/* ============================================================
 * LEDGER — ERP theme. Navy depth + gold accent + parchment numerics.
 * Blueprint grid background. Inset card surfaces. IBM Plex Mono digits.
 * ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap');

:root {
    --bg-void:     #060B17;
    --bg-obsidian: #0B1220;
    --bg-surface:  #131C2E;
    --bg-elevated: #1A2438;
    --bg-glass:    rgba(19, 28, 46, 0.78);
    --bg-elev:     rgba(245, 181, 68, 0.04);

    --accent-gold:      #F5B544;
    --accent-gold-dim:  rgba(245, 181, 68, 0.12);
    --accent-gold-glow: rgba(245, 181, 68, 0.35);
    --accent-azure:     #4F8FFF;
    --accent-mint:      #34D399;

    /* legacy aliases — keep existing rules working */
    --accent-emerald:      #F5B544;
    --accent-emerald-dim:  rgba(245, 181, 68, 0.12);
    --accent-emerald-glow: rgba(245, 181, 68, 0.35);
    --accent-indigo:       #4F8FFF;

    --text-primary: #E8EEF7;
    --text-silver:  #B8C2D4;
    --text-muted:   #64748B;
    --text-numeric: #F5E6CC;

    --success: #34D399;
    --danger:  #EF4444;
    --warning: #F59E0B;
    --rose:    #EF4444;
    --amber:   #F5B544;

    --border-nexus:  1px solid rgba(245, 181, 68, 0.08);
    --border-strong: 1px solid rgba(245, 181, 68, 0.18);

    --font-display: 'Fraunces', 'Inter', system-ui, sans-serif;
    --font-ui:      'Inter', system-ui, sans-serif;
    --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

    --sidebar-width: 260px;
    --topbar-height: 72px;

    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition: 280ms var(--ease-spring);
    --transition-fast: 160ms ease-out;

    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
}

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

html, body { height: 100%; }
body {
    font-family: var(--font-ui);
    background: var(--bg-void);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background-image:
        url('../img/bg-grid.svg'),
        radial-gradient(ellipse at 0% 0%, rgba(245, 181, 68, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(79, 143, 255, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    overflow: hidden;
    font-feature-settings: 'cv02','cv03','cv04','cv11';
}
/* Tabular numerics on numbers */
.font-bold, .font-extrabold, .nexus-id, .text-right, .stat-card .value,
table td.text-right, .data-table-mini td.text-right, .od-totals b {
    font-variant-numeric: tabular-nums;
}

button, input, select, textarea { font-family: inherit; color: inherit; }

/* utilities */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; }
.align-center { align-items: center; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.grow { flex: 1 1 auto; }
.mt-md { margin-top: 12px; } .mt-lg { margin-top: 20px; } .mt-xl { margin-top: 32px; }
.mb-md { margin-bottom: 12px; } .mb-lg { margin-bottom: 20px; } .mb-xl { margin-bottom: 32px; }
.gap-sm { gap: 6px; } .gap-md { gap: 12px; } .gap-lg { gap: 20px; }
.p-0 { padding: 0; } .p-lg { padding: 20px; } .p-xl { padding: 32px; }
.fs-xs { font-size: 11px; } .fs-xxs { font-size: 10px; } .fs-xl { font-size: 22px; }
.font-bold { font-weight: 700; } .font-extrabold { font-weight: 800; }
.text-muted { color: var(--text-muted); }
.text-silver { color: var(--text-silver); }
.text-emerald { color: var(--accent-emerald); }
.text-rose { color: var(--rose); }
.text-amber { color: var(--amber); }
.error-text { color: var(--rose); font-size: 13px; margin-top: 12px; text-align: center; min-height: 16px; }
.span-2 { grid-column: span 2; }
.overflow-hidden { overflow: hidden; }
.border-bottom { border-bottom: var(--border-nexus); }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.08); }
.divider span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .1em; }

@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
.animate-in { animation: slideUp .35s ease-out backwards; }
.animate-pop { animation: pop .25s var(--ease-spring); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,255,157,0.25); }

/* ============ AUTH ============ */
#auth-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-card {
    width: 100%; max-width: 460px; padding: 48px 40px;
    background: var(--bg-obsidian);
    border: var(--border-nexus); border-radius: var(--r-lg);
    box-shadow: 0 30px 80px -20px rgba(0,0,0,.6), 0 0 0 1px rgba(0,255,157,.06) inset;
}
.brand { text-align: center; margin-bottom: 32px; }
.brand-logo img { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 16px; }
.brand h1 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.brand p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.input-group label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: .12em; }
.input-group input, .input-group select {
    width: 100%; height: 46px; padding: 0 14px;
    background: rgba(0,0,0,.35); border: var(--border-nexus); border-radius: var(--r-sm);
    color: white; font-size: 14px; transition: var(--transition-fast);
}
.input-group input:focus { border-color: var(--accent-emerald); background: rgba(0,255,157,.04); box-shadow: 0 0 0 3px rgba(0,255,157,.1); }

.recent-sites { margin-top: 18px; }
.recent-list { display: flex; flex-direction: column; gap: 6px; }
.recent-chip {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    padding: 10px 14px; background: rgba(255,255,255,.03); border: var(--border-nexus);
    border-radius: var(--r-sm); cursor: pointer; transition: var(--transition-fast); text-align: left;
}
.recent-chip:hover { border-color: var(--accent-emerald); background: var(--accent-emerald-dim); }

/* ============ BUTTONS ============ */
.btn-primary {
    background: var(--accent-emerald); color: #000;
    border: none; padding: 0 28px; height: 48px; min-width: 100px;
    border-radius: var(--r-sm); font-weight: 800; font-size: 13px;
    text-transform: uppercase; letter-spacing: .08em;
    cursor: pointer; transition: var(--transition);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--accent-emerald-glow); }
.btn-primary.btn-sm { height: 38px; padding: 0 16px; font-size: 12px; }
.btn-ghost {
    background: transparent; border: 1px solid rgba(255,255,255,.1); color: var(--text-silver);
    padding: 0 18px; height: 42px; border-radius: var(--r-sm); font-weight: 600;
    cursor: pointer; transition: var(--transition-fast);
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-ghost:hover { background: rgba(255,255,255,.06); color: white; }
.btn-ghost.btn-sm { height: 38px; padding: 0 14px; font-size: 12px; }
.btn-icon {
    background: transparent; border: none; color: var(--text-silver);
    width: 38px; height: 38px; border-radius: var(--r-sm);
    cursor: pointer; transition: var(--transition-fast);
    display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.btn-icon:hover { background: rgba(255,255,255,.06); color: white; }

/* ============ DASHBOARD LAYOUT ============ */
#dashboard-layout { display: grid; grid-template-columns: var(--sidebar-width) 1fr; height: 100vh; overflow: hidden; }
.sidebar-wrapper {
    background: linear-gradient(180deg, var(--bg-obsidian) 0%, #0a0a18 100%);
    border-right: var(--border-nexus);
    display: flex; flex-direction: column;
    padding: 20px 0 0 0;
    position: relative;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    box-shadow: inset -1px 0 0 rgba(255,255,255,.02);
}
.sidebar-header {
    padding: 0 18px 20px;
    border-bottom: var(--border-nexus);
    margin-bottom: 8px;
    flex-shrink: 0;
}
.brand-small { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 800; transition: opacity .15s; }
.brand-small:hover { opacity: .85; }
.logo-img { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.4); }

.sync-status {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
    font-size: 10px; font-weight: 800; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .1em;
    padding: 4px 10px; border-radius: 999px;
    background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05);
}
.sync-status.online { color: var(--success); border-color: rgba(16,185,129,.25); background: rgba(16,185,129,.06); }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 8px var(--danger); transition: background .25s; }
.sync-status.online .sync-dot { background: var(--success); box-shadow: 0 0 10px var(--success); animation: ping 2s infinite; }
@keyframes ping { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: .6; } }

.sidebar-nav {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 12px 16px;
    overflow-y: auto; overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.08) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-track { background: rgba(255,255,255,.02); }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; border: 1px solid rgba(0,0,0,.2); }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(16,185,129,.4); }

/* Main content area scroll */
.scroll-area::-webkit-scrollbar { width: 10px; }
.scroll-area::-webkit-scrollbar-track { background: rgba(0,0,0,.2); }
.scroll-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 5px; }
.scroll-area::-webkit-scrollbar-thumb:hover { background: rgba(16,185,129,.4); }

.nav-group-label {
    font-size: 10px; font-weight: 800; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .12em;
    padding: 14px 10px 6px;
    opacity: .55;
}
.nav-group-label:first-child { padding-top: 4px; }

.nav-item {
    background: transparent; border: none; cursor: pointer;
    padding: 9px 12px; border-radius: var(--r-sm);
    color: var(--text-silver); display: flex; align-items: center; gap: 12px;
    font-size: 13.5px; font-weight: 500;
    transition: background .15s, color .15s, transform .1s;
    border-left: 2px solid transparent;
    text-align: left; width: 100%;
    position: relative;
}
.nav-item:hover {
    background: rgba(255,255,255,.04);
    color: white;
    transform: translateX(2px);
}
.nav-item.active {
    background: linear-gradient(90deg, rgba(16,185,129,.18), rgba(16,185,129,.04));
    color: var(--accent-emerald);
    font-weight: 700;
    border-left-color: var(--accent-emerald);
}
.nav-item.active::after {
    content: '';
    position: absolute; right: 10px; top: 50%;
    width: 5px; height: 5px; border-radius: 50%;
    transform: translateY(-50%);
    background: var(--accent-emerald);
    box-shadow: 0 0 10px var(--accent-emerald);
}
.nav-item .icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
    padding: 14px 16px 18px;
    border-top: var(--border-nexus);
    background: rgba(0,0,0,.25);
    flex-shrink: 0;
}
.nexus-meta { margin-bottom: 10px; }
.nexus-meta p { line-height: 1.3; }
.logout-btn-full {
    width: 100%; justify-content: flex-start;
    padding: 9px 12px; border-radius: var(--r-sm);
    background: transparent; border: 1px solid rgba(255,255,255,.06);
    color: var(--text-silver); font-size: 13px; font-weight: 600;
    display: flex; align-items: center; gap: 10px;
    transition: var(--transition-fast); cursor: pointer;
}
.logout-btn-full:hover {
    background: rgba(244,63,94,.1);
    border-color: rgba(244,63,94,.3);
    color: var(--rose);
}

/* content */
.content-wrapper { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; }
.top-bar {
    height: var(--topbar-height); padding: 0 32px;
    border-bottom: var(--border-nexus); display: flex;
    align-items: center; justify-content: space-between;
    background: rgba(10,10,31,.5); backdrop-filter: blur(12px);
}
.top-bar h2 { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.top-bar-actions { display: flex; align-items: center; gap: 14px; }
.live-pos-indicator { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pos-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.scroll-area { flex: 1; padding: 28px 32px 80px; overflow-y: auto; transition: opacity .25s; }

/* ============ CARDS ============ */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: var(--border-nexus);
    border-radius: var(--r-md);
    padding: 22px;
    transition: var(--transition);
}
.glass-card:hover { border-color: rgba(0,255,157,.18); }
.chart-wrap { height: 320px; position: relative; }
.chart-wrap-sm { height: 240px; position: relative; }

/* tiles */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.stat-card .header { display: flex; align-items: center; justify-content: space-between; }
.stat-card h4 { font-size: 13px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.stat-card .icon-box {
    width: 42px; height: 42px; border-radius: 10px;
    background: var(--accent-emerald-dim); color: var(--accent-emerald);
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.stat-card .value { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.stat-card.skel .value { background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05)); background-size: 200% 100%; animation: skeleton 1.4s infinite; height: 28px; border-radius: 4px; color: transparent; }
@keyframes skeleton { 0% { background-position: -100% 0; } 100% { background-position: 200% 0; } }
.stat-card.accent-success .icon-box { background: rgba(0,255,157,.15); color: var(--accent-emerald); }
.stat-card.accent-danger  .icon-box { background: rgba(244,63,94,.15);  color: var(--rose); }
.stat-card.accent-danger  .value     { color: var(--rose); }

/* dashboard grids */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: 1fr; } }
.chart-section { min-height: 380px; }
.recent-list-mini { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.recent-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 12px; background: var(--bg-elev); border-radius: var(--r-sm);
    cursor: pointer; transition: var(--transition-fast);
}
.recent-row:hover { background: rgba(0,255,157,.06); }

.top-list { display: flex; flex-direction: column; gap: 8px; }
.top-row {
    display: flex; gap: 12px; align-items: center;
    padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg-elev);
}
.top-row .rank { font-weight: 800; color: var(--accent-emerald); width: 32px; }

.analytics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1100px) { .analytics-grid { grid-template-columns: 1fr 1fr; } .analytics-grid .span-2 { grid-column: span 2; } }
@media (max-width: 720px)  { .analytics-grid { grid-template-columns: 1fr; } .analytics-grid .span-2 { grid-column: span 1; } }

/* ============ FILTER BAR ============ */
.filter-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    padding: 14px 18px;
}
.filter-bar label {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 800; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .08em;
}
.filter-bar input[type=date], .filter-bar input[type=search], .filter-bar input[type=text], .filter-bar select {
    height: 36px; background: rgba(0,0,0,.25); border: var(--border-nexus);
    border-radius: var(--r-sm); padding: 0 10px; color: white; font-size: 13px;
    transition: var(--transition-fast);
    text-transform: none; letter-spacing: 0; font-weight: 500;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--accent-emerald); }
.filter-bar input[type=search].grow { min-width: 220px; }
.filter-input { width: 100%; max-width: 360px; height: 38px; padding: 0 12px; background: rgba(0,0,0,.25); border: var(--border-nexus); border-radius: var(--r-sm); color: white; }

.quick-ranges { display: flex; gap: 4px; }
.quick-ranges button {
    background: rgba(255,255,255,.05); border: var(--border-nexus); color: var(--text-silver);
    padding: 0 12px; height: 36px; border-radius: var(--r-sm); cursor: pointer;
    font-size: 12px; font-weight: 700; transition: var(--transition-fast);
}
.quick-ranges button:hover { background: var(--accent-emerald-dim); color: var(--accent-emerald); border-color: var(--accent-emerald); }

/* ============ TABLES ============ */
.data-table-wrapper { background: var(--bg-surface); border: var(--border-nexus); border-radius: var(--r-md); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    background: rgba(255,255,255,.03); padding: 12px 16px; text-align: left;
    font-size: 11px; font-weight: 800; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .08em;
    border-bottom: var(--border-nexus);
}
.data-table td { padding: 12px 16px; border-bottom: var(--border-nexus); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: var(--transition-fast); cursor: pointer; }
.data-table tbody tr:hover { background: rgba(0,255,157,.03); }
.data-table .nexus-id { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 700; color: var(--accent-emerald); }

.data-table-mini { width: 100%; font-size: 13px; }
.data-table-mini td { padding: 8px 0; border-bottom: 1px dashed rgba(255,255,255,.08); }
.data-table-mini tr:last-child td { border-bottom: none; }

/* badges */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.badge-nexus-dim { background: rgba(160,160,184,.08); border: 1px solid rgba(160,160,184,.15); color: var(--text-silver); }
.badge-nexus-success { background: var(--accent-emerald-dim); color: var(--accent-emerald); border: 1px solid rgba(0,255,157,.2); }
.badge-nexus-danger { background: rgba(244,63,94,.1); color: var(--rose); border: 1px solid rgba(244,63,94,.2); }
.badge-amber { background: rgba(245,158,11,.1); color: var(--amber); border: 1px solid rgba(245,158,11,.2); }
.badge-outline { background: transparent; border: 1px solid rgba(255,255,255,.15); color: var(--text-silver); }

/* tabs */
.inventory-tabs { display: flex; gap: 4px; border-bottom: var(--border-nexus); padding-bottom: 0; }
.tab-btn {
    background: transparent; border: none; color: var(--text-silver);
    padding: 12px 18px; cursor: pointer; font-weight: 600; font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
}
.tab-btn:hover { color: white; }
.tab-btn.active { color: var(--accent-emerald); border-bottom-color: var(--accent-emerald); }

/* activity */
.activity-detailed-list { display: flex; flex-direction: column; }
.activity-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 20px; border-bottom: var(--border-nexus);
    transition: var(--transition-fast);
}
.activity-row:hover { background: rgba(255,255,255,.02); }
.activity-row:last-child { border-bottom: none; }

/* report sheet */
.report-sheet { max-width: 860px; margin: 0 auto; }
.report-head { text-align: center; }
.report-head h2 { font-size: 22px; }
.report-head h3 { letter-spacing: .15em; font-size: 14px; color: var(--accent-emerald); }
.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.report-grid > div { background: var(--bg-elev); padding: 14px; border-radius: var(--r-sm); display: flex; flex-direction: column; gap: 4px; }
.report-grid span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.report-grid b { font-size: 18px; }
@media (max-width: 900px) { .report-grid { grid-template-columns: repeat(2, 1fr); } }

/* order detail modal */
.order-detail .od-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.order-detail .od-header h2 { font-size: 22px; }
.od-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.od-meta > div { background: var(--bg-elev); padding: 10px; border-radius: var(--r-sm); display: flex; flex-direction: column; gap: 2px; }
.od-meta span { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.od-meta b { font-size: 14px; }
.od-totals { margin-top: 18px; border-top: var(--border-nexus); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.od-totals > div { display: flex; justify-content: space-between; font-size: 14px; }
.od-totals .grand { margin-top: 8px; padding-top: 10px; border-top: var(--border-nexus); font-size: 17px; font-weight: 800; color: var(--accent-emerald); }
.receipt-img { max-width: 100%; margin-top: 12px; border-radius: var(--r-sm); border: var(--border-nexus); }

/* billing screen */
.bill-banner { padding: 18px 22px; border-radius: var(--r-md); margin-bottom: 20px; font-size: 14px; line-height: 1.5; }
.bill-banner.warn { background: linear-gradient(180deg, rgba(251,191,36,.12), rgba(251,191,36,.04)); border: 1px solid rgba(251,191,36,.35); color: #fde68a; }
.bill-banner.danger { background: linear-gradient(180deg, rgba(244,63,94,.15), rgba(244,63,94,.05)); border: 1px solid rgba(244,63,94,.45); color: #fecaca; }
.bill-state { display: inline-block; padding: 8px 16px; border-radius: var(--r-sm); font-weight: 800; font-size: 14px; letter-spacing: .08em; }
.bill-state.state-success { background: rgba(16,185,129,.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,.4); }
.bill-state.state-warning { background: rgba(251,191,36,.15); color: #fde68a; border: 1px solid rgba(251,191,36,.4); }
.bill-state.state-danger  { background: rgba(244,63,94,.15);  color: #fecaca; border: 1px solid rgba(244,63,94,.4); }
.bill-state.state-info    { background: rgba(99,102,241,.15); color: #c7d2fe; border: 1px solid rgba(99,102,241,.4); }
.bill-howto { padding-left: 22px; line-height: 1.8; color: var(--text-silver); font-size: 14px; }
.bill-howto li { margin-bottom: 6px; }
.bill-qr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 8px; }
.bill-qr-card {
    background: white; border-radius: var(--r-md); padding: 22px 18px 18px;
    border: 1px solid rgba(255,255,255,.08);
    display: flex; flex-direction: column; align-items: center;
    box-shadow: 0 8px 24px -8px rgba(0,0,0,.5);
}
.bill-qr-card .bill-qr-label {
    font-size: 13px; font-weight: 800; color: #1f2937; text-transform: uppercase;
    letter-spacing: .05em; margin-bottom: 14px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    min-height: 50px; justify-content: center;
}
.bill-qr-img {
    width: 100%; max-width: 360px; height: auto; aspect-ratio: 1/1;
    object-fit: contain; border-radius: var(--r-sm); background: white;
    display: block;
}
.bill-qr-card p { color: #4b5563 !important; font-size: 13px !important; margin-top: 10px; font-weight: 600; }
@media (max-width: 900px) {
    .bill-qr-grid { grid-template-columns: 1fr; }
    .bill-qr-img { max-width: 420px; margin: 0 auto; }
}

/* expense form */
.expense-form .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.expense-form .grid-4 { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 8px; }
.expense-form .span-2 { grid-column: span 2; }
.po-line, .je-row { display: grid; gap: 8px; margin-top: 8px; }
.po-line { grid-template-columns: 2fr 1fr 1fr 1fr; }
.je-row { grid-template-columns: 2fr 1fr 1fr 1.5fr; }
.po-line input, .po-line select,
.je-row input, .je-row select {
    height: 36px; padding: 0 10px; background: rgba(0,0,0,.3); border: var(--border-nexus);
    border-radius: var(--r-sm); color: white; font-size: 13px;
}
.expense-form label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.expense-form input, .expense-form select {
    height: 42px; padding: 0 12px; background: rgba(0,0,0,.3); border: var(--border-nexus);
    border-radius: var(--r-sm); color: white; font-size: 14px; transition: var(--transition-fast);
    font-weight: 500; text-transform: none; letter-spacing: 0;
}
.expense-form input:focus, .expense-form select:focus { border-color: var(--accent-emerald); }

/* code block */
.code-block { background: var(--bg-elev); padding: 14px; border-radius: var(--r-sm); font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; color: var(--text-silver); overflow-x: auto; max-height: 500px; overflow-y: auto; }

/* page loading */
.page-loading { display: flex; align-items: center; justify-content: center; padding: 80px 0; }
.spinner { width: 36px; height: 36px; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--accent-emerald); border-radius: 50%; animation: spin .9s linear infinite; }
.empty-state { padding: 40px; display: flex; align-items: center; justify-content: center; }

/* modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(5,5,16,.7); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 24px;
}
.modal-overlay.hidden { display: none; }
.modal-content {
    width: 100%; max-width: 720px; max-height: 90vh; overflow-y: auto;
    background: var(--bg-obsidian); border: var(--border-strong); border-radius: var(--r-lg);
    box-shadow: 0 40px 100px -20px rgba(0,0,0,.8);
}
.modal-header {
    padding: 18px 24px; display: flex; justify-content: space-between; align-items: center;
    border-bottom: var(--border-nexus);
}
.modal-header h3 { font-size: 17px; font-weight: 800; }
.close-modal { background: transparent; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; line-height: 1; padding: 4px 10px; border-radius: 6px; transition: var(--transition-fast); }
.close-modal:hover { background: rgba(255,255,255,.06); color: white; }
.modal-body { padding: 24px; }

/* toasts */
#toast-host {
    position: fixed; bottom: 24px; right: 24px; z-index: 2000;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: var(--bg-obsidian); border: var(--border-strong); border-radius: var(--r-sm);
    padding: 12px 18px; font-size: 13px; font-weight: 600;
    box-shadow: 0 16px 40px -10px rgba(0,0,0,.6);
    transition: opacity .25s;
}
.toast-success { border-left: 3px solid var(--accent-emerald); }
.toast-error { border-left: 3px solid var(--rose); }
.toast-info { border-left: 3px solid var(--accent-indigo); }

/* mobile */
.mobile-nav { display: none; }
.mobile-only { display: none; }
.menu-toggle { background: transparent; border: none; color: white; font-size: 22px; cursor: pointer; }

@media (max-width: 1024px) {
    #dashboard-layout { grid-template-columns: 1fr; }
    .sidebar-wrapper {
        position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 999;
        transform: translateX(-100%); transition: transform .25s;
    }
    .sidebar-wrapper.mobile-open { transform: translateX(0); }
    .mobile-only { display: inline-flex; align-items: center; justify-content: center; background: transparent; border: none; color: white; font-size: 22px; cursor: pointer; width: 38px; height: 38px; }
    .top-bar { padding: 0 16px; }
    .scroll-area { padding: 18px 16px 120px; }
    .mobile-nav {
        display: flex; position: fixed; bottom: 18px; left: 18px; right: 18px;
        height: 64px; background: var(--bg-obsidian);
        border: var(--border-strong); border-radius: 32px; z-index: 800;
        align-items: center; justify-content: space-around; padding: 0 14px;
        box-shadow: 0 18px 50px -10px rgba(0,0,0,.8);
    }
    .m-nav-btn {
        width: 48px; height: 48px; border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        background: transparent; border: none; color: var(--text-silver);
        font-size: 22px; cursor: pointer; transition: var(--transition);
    }
    .m-nav-btn.active { background: var(--accent-emerald-dim); color: var(--accent-emerald); transform: translateY(-8px); box-shadow: 0 10px 24px -4px var(--accent-emerald-glow); }
    .dashboard-grid, .analytics-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1 !important; }
    .filter-bar { gap: 8px; }
    .filter-bar input[type=search].grow { min-width: 100%; }
    .od-meta { grid-template-columns: 1fr 1fr; }
    .expense-form .grid-2 { grid-template-columns: 1fr; }
    .expense-form .span-2 { grid-column: span 1; }
}

/* print */
@media print {
    body { background: white; color: black; overflow: visible; }
    .sidebar-wrapper, .top-bar, .filter-bar, .mobile-nav, .top-bar-actions, #toast-host { display: none !important; }
    .scroll-area { padding: 0; overflow: visible; height: auto; }
    .glass-card { background: white; border: 1px solid #ddd; color: black; box-shadow: none; backdrop-filter: none; }
    .text-muted { color: #555 !important; }
    .text-emerald { color: #00773f !important; }
    .badge { border: 1px solid #999; color: #333 !important; }
}
