/* PhoneCRM � Cyberpunk Gold / Dark Gray Theme */

:root {
    --bg:      #0e0e0e;
    --bg2:     #161616;
    --bg3:     #1e1e1e;
    --border:  #2a2820;
    --border2: #3a3525;
    --accent:  #d4a017;
    --accent2: #a07810;
    --accent-dim: rgba(212,160,23,0.12);
    --accent-glow: rgba(212,160,23,0.25);
    --green:   #5aad6a;
    --red:     #cc4444;
    --yellow:  #d4a017;
    --orange:  #c87828;
    --text:    #e8dfc8;
    --text2:   #9a8e78;
    --text3:   #5a5040;
    --font-mono: 'Share Tech Mono', monospace;
    --font-sans: 'Rajdhani', sans-serif;
    --radius:  6px;
    --shadow:  0 4px 24px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    background-image:
        linear-gradient(rgba(212,160,23,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212,160,23,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
}

/* NAVBAR */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(14,14,14,0.97);
    border-bottom: 1px solid var(--border2);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 24px;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--border2), 0 2px 20px rgba(0,0,0,0.5);
}

.nav-brand {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-mono);
    font-size: 17px; font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    letter-spacing: 1px;
    text-shadow: 0 0 14px var(--accent-glow);
}
.brand-icon { font-size: 20px; }

.nav-links {
    display: flex; align-items: center; gap: 2px;
    flex: 1;
}
.nav-links a {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius);
    color: var(--text2);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: all 0.18s;
    white-space: nowrap;
    text-transform: uppercase;
}
.nav-links a:hover {
    background: var(--accent-dim);
    color: var(--text);
}
.nav-links a.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

.nav-right {
    display: flex; align-items: center; gap: 16px;
    margin-left: auto;
}

.cash-display {
    display: flex; flex-direction: column; align-items: flex-end;
    font-family: var(--font-mono);
}
.cash-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; }
.cash-amount { font-size: 15px; font-weight: 700; }
.cash-amount.positive { color: var(--green); }
.cash-amount.negative { color: var(--red); }

.user-menu {
    display: flex; align-items: center; gap: 10px;
}
.user-name {
    font-size: 13px; color: var(--text2);
    max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-logout {
    font-size: 12px; padding: 5px 12px;
    background: rgba(204,68,68,0.1);
    color: #e07070;
    border: 1px solid rgba(204,68,68,0.25);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.btn-logout:hover { background: rgba(204,68,68,0.25); }

.nav-toggle {
    display: none;
    background: none; border: none; color: var(--text); font-size: 22px;
    cursor: pointer; margin-left: auto;
}

/* MOBILE MENU */
.mobile-menu {
    display: none;
    position: fixed; top: 60px; left: 0; right: 0; z-index: 99;
    background: rgba(14,14,14,0.98);
    border-bottom: 1px solid var(--border2);
    flex-direction: column;
    padding: 12px 0;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
    padding: 12px 24px;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.mobile-cash {
    padding: 12px 24px;
    color: var(--green);
    font-family: var(--font-mono);
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

/* MAIN */
.main-content { padding: 24px 0 60px; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* PAGE HEADER */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap; gap: 12px;
}
.page-title {
    font-family: var(--font-mono);
    font-size: 20px; font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.page-title span { color: var(--accent); text-shadow: 0 0 10px var(--accent-glow); }

/* FLASH MESSAGES */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 600;
    border-left: 3px solid;
}
.flash-success {
    background: rgba(90,173,106,0.1);
    border-color: var(--green);
    color: #7acc8a;
}
.flash-error {
    background: rgba(204,68,68,0.1);
    border-color: var(--red);
    color: #e07070;
}

/* CARDS */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.card-title {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    border-color: var(--border2);
    box-shadow: 0 0 16px rgba(212,160,23,0.06);
}
.stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 2px;
}
.stat-card::after {
    content: '';
    position: absolute; top: 0; left: 0;
    width: 2px; bottom: 0;
    opacity: 0.4;
}
.stat-card.blue::before  { background: #4a9eca; }
.stat-card.blue::after   { background: #4a9eca; }
.stat-card.green::before { background: var(--green); }
.stat-card.green::after  { background: var(--green); }
.stat-card.yellow::before{ background: var(--yellow); }
.stat-card.yellow::after { background: var(--yellow); }
.stat-card.purple::before{ background: #8860c0; }
.stat-card.purple::after { background: #8860c0; }
.stat-card.red::before   { background: var(--red); }
.stat-card.red::after    { background: var(--red); }
.stat-card.orange::before{ background: var(--orange); }
.stat-card.orange::after { background: var(--orange); }

.stat-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; }
.stat-value {
    font-family: var(--font-mono);
    font-size: 28px; font-weight: 700;
    color: var(--text);
    margin: 4px 0;
}
.stat-sub { font-size: 12px; color: var(--text3); }

/* BUTTONS */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 13px; font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.btn-primary {
    background: var(--accent);
    color: #0e0e0e;
    box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover {
    background: #e8b820;
    box-shadow: 0 0 14px var(--accent-glow);
}
.btn-success { background: var(--green); color: #0e0e0e; }
.btn-success:hover { background: #4a9e5a; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b03030; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border2);
    color: var(--text2);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 4px 11px; font-size: 11px; }
.btn-icon { padding: 6px 10px; }

/* TABLES */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border2);
    white-space: nowrap;
    background: rgba(212,160,23,0.04);
}
td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 14px;
}
tr:hover td { background: rgba(212,160,23,0.03); }
tr:last-child td { border-bottom: none; }

/* BADGES */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-mono);
}
.badge-green  { background: rgba(90,173,106,0.15); color: #7acc8a; border: 1px solid rgba(90,173,106,0.3); }
.badge-blue   { background: rgba(74,158,202,0.15); color: #7ab8d8; border: 1px solid rgba(74,158,202,0.3); }
.badge-yellow { background: rgba(212,160,23,0.15);  color: var(--accent); border: 1px solid rgba(212,160,23,0.3); }
.badge-orange { background: rgba(200,120,40,0.15);  color: #d8924a; border: 1px solid rgba(200,120,40,0.3); }
.badge-red    { background: rgba(204,68,68,0.15);   color: #e07070; border: 1px solid rgba(204,68,68,0.3); }
.badge-gray   { background: rgba(90,80,64,0.2);     color: var(--text3); border: 1px solid rgba(90,80,64,0.4); }
.badge-purple { background: rgba(136,96,192,0.15);  color: #b090e0; border: 1px solid rgba(136,96,192,0.3); }

/* FORMS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-mono);
}
input, select, textarea {
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    color: var(--text);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212,160,23,0.1);
}
select option { background: var(--bg3); }
textarea { resize: vertical; min-height: 80px; }

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* FILTER BAR */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-bar input, .filter-bar select {
    flex: 1;
    min-width: 150px;
    max-width: 220px;
}

/* PHONE CARD */
.phone-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.phone-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}
.phone-card::before {
    content: '';
    position: absolute; top: 0; left: 0;
    width: 3px; bottom: 0;
    background: var(--border2);
    border-radius: var(--radius) 0 0 var(--radius);
    transition: background 0.2s;
}
.phone-card:hover {
    border-color: var(--border2);
    box-shadow: 0 0 16px rgba(212,160,23,0.07);
}
.phone-card:hover::before { background: var(--accent); }
.phone-card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 12px;
}
.phone-card-title { font-weight: 700; font-size: 15px; }
.phone-card-imei { font-family: var(--font-mono); font-size: 11px; color: var(--text3); }
.phone-card-body { display: flex; flex-direction: column; gap: 6px; }
.phone-card-row { display: flex; justify-content: space-between; font-size: 13px; }
.phone-card-label { color: var(--text3); }
.phone-card-actions { display: flex; gap: 8px; margin-top: 12px; }

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text3);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; color: var(--text3); }
.empty-state-icon i { font-size: 48px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text2); }

/* CASH */
.cash-hero {
    background: linear-gradient(135deg, var(--bg2) 0%, rgba(212,160,23,0.06) 100%);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.cash-hero::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.cash-balance-big {
    font-family: var(--font-mono);
    font-size: 48px;
    font-weight: 700;
    margin: 8px 0;
    letter-spacing: 2px;
}
.cash-balance-big.positive { color: var(--green); }
.cash-balance-big.negative { color: var(--red); }

.amount-income  { color: var(--green); font-family: var(--font-mono); font-weight: 700; }
.amount-expense { color: var(--red);   font-family: var(--font-mono); font-weight: 700; }

/* MODAL */
.modal-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(0,0,0,0.8), 0 0 0 1px rgba(212,160,23,0.1);
}
.modal-title {
    font-family: var(--font-mono);
    font-size: 15px;
    margin-bottom: 20px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* LOGIN */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image:
        linear-gradient(rgba(212,160,23,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212,160,23,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    background-color: var(--bg);
}
.login-box {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 0 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(212,160,23,0.1);
    position: relative;
}
.login-box::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: var(--radius) var(--radius) 0 0;
}
.login-logo {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 26px;
    color: var(--accent);
    margin-bottom: 8px;
    letter-spacing: 2px;
    text-shadow: 0 0 18px var(--accent-glow);
}
.login-sub {
    text-align: center;
    color: var(--text3);
    font-size: 13px;
    margin-bottom: 32px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-mono);
}

/* FOOTER */
.footer {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(14,14,14,0.97);
    border-top: 1px solid var(--border);
    padding: 8px 24px;
    font-size: 11px;
    color: var(--text3);
    font-family: var(--font-mono);
    z-index: 50;
    letter-spacing: 0.5px;
}

/* SECTION DIVIDER */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}

/* PROFIT INDICATOR */
.profit-positive { color: var(--green); font-family: var(--font-mono); font-weight: 700; }
.profit-negative { color: var(--red);   font-family: var(--font-mono); font-weight: 700; }

/* GRID LAYOUTS */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* TABS */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border2); }
.tab {
    padding: 10px 20px;
    color: var(--text3);
    cursor: pointer;
    font-size: 13px; font-weight: 700;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* SEARCH HIGHLIGHT */
mark { background: rgba(212,160,23,0.2); color: var(--accent); border-radius: 2px; padding: 0 2px; }

/* DETAIL VIEW */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.detail-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; font-family: var(--font-mono); }
.detail-value { font-size: 15px; color: var(--text); font-weight: 500; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent2); }

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-links, .nav-right { display: none; }
    .nav-toggle { display: block; }
    .container { padding: 0 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .cash-balance-big { font-size: 36px; }
    .page-title { font-size: 16px; }
    th, td { padding: 8px 10px; }
    .filter-bar input, .filter-bar select { max-width: 100%; }
    .btn { padding: 8px 14px; font-size: 12px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 22px; }
}

/* ========== PRINT ========== */
.print-only { display: none; }
@media print {
    .navbar, .footer, .no-print { display: none !important; }
    .print-only { display: block !important; }
    .screen-only { display: none !important; }
    body { background: white !important; color: black !important; background-image: none !important; }
    .main-content { padding: 0 !important; }
    .container { padding: 0 !important; max-width: 100% !important; }
}
