/* ====================================================================
   VELBOOKS — COMMAND DESIGN SYSTEM
   Three-panel layout: nav panel + main content + summary strip.
   Warm Amber / Burnt Orange accent. Both dark and light modes.
   Type: system-ui for body, tight letter-spacing on display weights.
==================================================================== */

/* ===== LIGHT PALETTE (default) ===== */
:root {
    --bg-app: #F2F2F7;
    --bg-panel: #FFFFFF;
    --bg-panel-alt: #F9F9FB;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F5F5FA;
    --bg-input: #FFFFFF;

    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --border-hover: #D1D5DB;

    --text-1: #111827;
    --text-2: #6B7280;
    --text-3: #9CA3AF;
    --text-4: #D1D5DB;

    --shadow-xs: 0 1px 2px rgba(17,24,39,0.03);
    --shadow-sm: 0 1px 2px rgba(17,24,39,0.04);
    --shadow-md: 0 2px 8px rgba(17,24,39,0.05);
    --shadow-inset: none;

    --mod-txn: #10B981;
    --mod-inv: #F59E0B;
    --mod-crm: #8B5CF6;
    --mod-people: #007AFF;
    --mod-finance: #007AFF;

    --accent: #007AFF;
    --accent-hover: #0062CC;
    --accent-dim: rgba(0, 122, 255, 0.08);
    --accent-text: #0055B3;

    --green: #10B981;
    --green-dim: rgba(16, 185, 129, 0.08);
    --green-text: #059669;

    --red: #EF4444;
    --red-dim: rgba(239, 68, 68, 0.08);
    --red-text: #DC2626;

    --amber: #F59E0B;
    --amber-dim: rgba(245, 158, 11, 0.08);
    --amber-text: #D97706;

    --blue: #3B82F6;
    --blue-dim: rgba(59, 130, 246, 0.08);
    --blue-text: #2563EB;

    --purple: #8B5CF6;
    --purple-dim: rgba(139, 92, 246, 0.08);
    --purple-text: #7C3AED;

    --nav-bg: #1C1917;
    --nav-text: #A8A29E;
    --nav-text-hover: #D6D3D1;
    --nav-active-bg: rgba(0, 122, 255, 0.15);
    --nav-active-text: #5AC8FA;
    --nav-border: rgba(255, 255, 255, 0.06);
    --nav-divider: rgba(255, 255, 255, 0.06);
    --nav-brand-name: #F5F5F4;
    --nav-brand-sub: #78716C;
    --nav-section-label: #57534E;
    --nav-mod-txn: #6EE7B7;
    --nav-mod-inv: #FCD34D;
    --nav-mod-crm: #C4B5FD;
    --nav-mod-people: #5AC8FA;

    --strip-bg: #FFFFFF;
    --strip-border: #E5E7EB;
    --strip-label: #6B7280;
    --entry-btn-color: #7C3AED;
    --entry-btn-hover-bg: rgba(124,58,237,0.04);
    --entry-btn-hover-border: rgba(124,58,237,0.3);
}

/* ===== DARK PALETTE ===== */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-app: #18181B;
        --bg-panel: #27272A;
        --bg-panel-alt: #27272A;
        --bg-card: #27272A;
        --bg-card-hover: #3F3F46;
        --bg-input: #3F3F46;

        --border: #3F3F46;
        --border-light: #27272A;
        --border-hover: #52525B;

        --text-1: #F9FAFB;
        --text-2: #D4D4D8;
        --text-3: #A1A1AA;
        --text-4: #71717A;

        --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
        --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
        --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
        --shadow-inset: none;

        --accent: #0A84FF;
        --accent-hover: #409CFF;
        --accent-dim: rgba(10, 132, 255, 0.15);
        --accent-text: #64B5FF;

        --green: #34D399;
        --green-dim: rgba(52, 211, 153, 0.10);
        --green-text: #6EE7B7;

        --red: #FB7185;
        --red-dim: rgba(244, 63, 94, 0.12);
        --red-text: #FDA4AF;

        --amber: #FBBF24;
        --amber-dim: rgba(251, 191, 36, 0.10);
        --amber-text: #FCD34D;

        --blue: #60A5FA;
        --blue-dim: rgba(96, 165, 250, 0.10);
        --blue-text: #93C5FD;

        --purple: #A78BFA;
        --purple-dim: rgba(167, 139, 250, 0.10);
        --purple-text: #C4B5FD;

        --nav-bg: #18181B;
        --nav-text: #A1A1AA;
        --nav-text-hover: #D4D4D8;
        --nav-active-bg: rgba(10, 132, 255, 0.15);
        --nav-active-text: #5AC8FA;
        --nav-border: rgba(255, 255, 255, 0.06);
        --nav-divider: rgba(255, 255, 255, 0.06);
        --nav-brand-name: #F9FAFB;
        --nav-brand-sub: #71717A;
        --nav-section-label: #52525B;
        --nav-mod-txn: #6EE7B7;
        --nav-mod-inv: #FCD34D;
        --nav-mod-crm: #C4B5FD;
        --nav-mod-people: #5AC8FA;

        --strip-bg: #27272A;
        --strip-border: #3F3F46;
        --strip-label: #71717A;
        --entry-btn-color: #A78BFA;
        --entry-btn-hover-bg: rgba(167,139,250,0.08);
        --entry-btn-hover-border: rgba(167,139,250,0.3);
    }
}

:root[data-theme="dark"] {
    --bg-app: #18181B;
    --bg-panel: #27272A;
    --bg-panel-alt: #27272A;
    --bg-card: #27272A;
    --bg-card-hover: #3F3F46;
    --bg-input: #3F3F46;

    --border: #3F3F46;
    --border-light: #27272A;
    --border-hover: #52525B;

    --text-1: #F9FAFB;
    --text-2: #D4D4D8;
    --text-3: #A1A1AA;
    --text-4: #71717A;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-inset: none;

    --accent: #0A84FF;
    --accent-hover: #409CFF;
    --accent-dim: rgba(10, 132, 255, 0.15);
    --accent-text: #64B5FF;

    --green: #34D399;
    --green-dim: rgba(52, 211, 153, 0.10);
    --green-text: #6EE7B7;

    --red: #FB7185;
    --red-dim: rgba(244, 63, 94, 0.12);
    --red-text: #FDA4AF;

    --amber: #FBBF24;
    --amber-dim: rgba(251, 191, 36, 0.10);
    --amber-text: #FCD34D;

    --blue: #60A5FA;
    --blue-dim: rgba(96, 165, 250, 0.10);
    --blue-text: #93C5FD;

    --purple: #A78BFA;
    --purple-dim: rgba(167, 139, 250, 0.10);
    --purple-text: #C4B5FD;

    --nav-bg: #18181B;
    --nav-text: #A1A1AA;
    --nav-text-hover: #D4D4D8;
    --nav-active-bg: rgba(10, 132, 255, 0.15);
    --nav-active-text: #5AC8FA;
    --nav-border: rgba(255, 255, 255, 0.06);
    --nav-divider: rgba(255, 255, 255, 0.06);
    --nav-brand-name: #F9FAFB;
    --nav-brand-sub: #71717A;
    --nav-section-label: #52525B;
    --nav-mod-txn: #6EE7B7;
    --nav-mod-inv: #FCD34D;
    --nav-mod-crm: #C4B5FD;
    --nav-mod-people: #5AC8FA;

    --strip-bg: #27272A;
    --strip-border: #3F3F46;
    --strip-label: #71717A;
    --entry-btn-color: #A78BFA;
    --entry-btn-hover-bg: rgba(167,139,250,0.08);
    --entry-btn-hover-border: rgba(167,139,250,0.3);
}

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

html, body {
    background: var(--bg-app);
    color: var(--text-1);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    height: 100vh;
    overflow: hidden;
}
@media (max-width: 900px) {
    html { overflow: auto; }
    body { overflow: auto; min-height: 100vh; height: auto; }
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

::selection { background: var(--accent-dim); color: var(--accent-text); }

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

.hidden { display: none !important; }

/* ===== APP SHELL — THREE PANELS ===== */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== LEFT NAV PANEL ===== */
.nav-panel {
    width: 220px;
    background: var(--nav-bg);
    border-right: 1px solid var(--nav-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.nav-brand {
    padding: 18px 18px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--nav-divider);
}
.nav-brand-info { display: flex; flex-direction: column; min-width: 0; }
.nav-brand-name {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--nav-brand-name, #0F172A);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-brand-sub {
    font-size: 10px;
    color: var(--nav-brand-sub, #64748B);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-items {
    flex: 1;
    padding: 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
}
.nav-items::-webkit-scrollbar { width: 0; }

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--nav-section-label, #94A3B8);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 10px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--nav-text);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: all 0.12s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-link:hover {
    color: var(--nav-text-hover);
    background: rgba(255, 255, 255, 0.04);
}
.nav-link.is-active {
    color: var(--nav-active-text);
    background: var(--nav-active-bg);
    font-weight: 600;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-link.is-active svg { opacity: 1; }

/* Module accent — thin left bar on active nav items */
.nav-link.is-active { box-shadow: inset 3px 0 0 var(--accent); }
.nav-link.is-active[data-page="page-orders"],
.nav-link.is-active[data-page="page-sales"],
.nav-link.is-active[data-page="page-sale-returns"] { box-shadow: inset 3px 0 0 var(--mod-txn); color: var(--nav-mod-txn, #059669); }
.nav-link.is-active[data-page="page-purchase-orders"],
.nav-link.is-active[data-page="page-purchase"],
.nav-link.is-active[data-page="page-purchase-returns"] { box-shadow: inset 3px 0 0 var(--mod-txn); color: var(--nav-mod-txn, #059669); }
.nav-link.is-active[data-page="page-recovery"],
.nav-link.is-active[data-page="page-payment"],
.nav-link.is-active[data-page="page-journal"],
.nav-link.is-active[data-page="page-contra"],
.nav-link.is-active[data-page="page-accounting"] { box-shadow: inset 3px 0 0 var(--mod-finance); }
.nav-link.is-active[data-page="page-inventory"] { box-shadow: inset 3px 0 0 var(--mod-inv); color: var(--nav-mod-inv, #B45309); }
.nav-link.is-active[data-page="page-crm"] { box-shadow: inset 3px 0 0 var(--mod-crm); color: var(--nav-mod-crm, #7C3AED); }
.nav-link.is-active[data-page="page-customers"],
.nav-link.is-active[data-page="page-suppliers"],
.nav-link.is-active[data-page="page-salesman"] { box-shadow: inset 3px 0 0 var(--mod-people); color: var(--nav-mod-people, #B45309); }
.nav-link.is-active[data-page="page-reports"] { box-shadow: inset 3px 0 0 var(--mod-finance); }
.nav-link.is-active[data-page="page-users"],
.nav-link.is-active[data-page="page-load-data"],
.nav-link.is-active[data-page="page-system"] { box-shadow: inset 3px 0 0 var(--text-4); color: var(--nav-text-hover); }

.nav-divider {
    height: 1px;
    background: var(--nav-divider);
    margin: 6px 10px;
}

/* Collapsible nav groups */
.nav-group { margin-bottom: 1px; }
.nav-group-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--nav-text);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: all 0.12s ease;
    white-space: nowrap;
}
.nav-group-header:hover {
    color: var(--nav-text-hover);
    background: rgba(255,255,255,0.04);
}
.nav-group-header svg:first-child { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-group-header span { flex: 1; }
.nav-chevron {
    width: 14px; height: 14px;
    flex-shrink: 0;
    opacity: 0.4;
    transition: transform 0.2s ease;
}
.nav-group.is-open .nav-chevron { transform: rotate(90deg); opacity: 0.6; }
.nav-group-items {
    display: none;
    flex-direction: column;
    gap: 1px;
    padding-left: 27px;
    overflow: hidden;
}
.nav-group.is-open .nav-group-items { display: flex; }
.nav-group-items .nav-link { padding: 6px 10px; font-size: 12.5px; font-weight: 400; gap: 0; }
.nav-group-items .nav-link svg { display: none; }
.nav-group.has-active > .nav-group-header { color: var(--nav-text-hover); }
.nav-group.has-active > .nav-group-header svg:first-child { opacity: 1; }

/* Dashboard quick actions */
/* Data viewing buttons — plain, no fill */

.nav-bottom {
    padding: 10px 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nav-company {
    padding: 12px 14px;
    border-top: 1px solid var(--nav-divider);
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-company-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
}
.nav-company-info { display: flex; flex-direction: column; min-width: 0; }
.nav-company-name {
    font-size: 11px;
    font-weight: 600;
    color: #A0A2B4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-company-year {
    font-size: 10px;
    color: #5C5E74;
    white-space: nowrap;
}

.nav-user {
    padding: 12px 14px;
    border-top: 1px solid var(--nav-divider);
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}
.nav-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.nav-user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--nav-text-hover);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-logout-btn {
    background: none;
    border: none;
    color: var(--nav-text);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    text-align: left;
    transition: color 0.15s;
}
.nav-logout-btn:hover {
    color: var(--red);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top bar */
.topbar {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-panel);
    position: relative;
    z-index: 2;
}
.topbar-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-1);
    line-height: 1.2;
}
.topbar-date {
    font-size: 11px;
    color: var(--text-4);
    font-weight: 500;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 12px;
    width: 220px;
    transition: all 0.15s ease;
}
.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-bar svg { width: 15px; height: 15px; color: var(--text-4); flex-shrink: 0; }
.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    color: var(--text-1);
}
.search-bar input::placeholder { color: var(--text-4); }
.search-bar kbd {
    font-family: inherit;
    font-size: 10px;
    color: var(--text-4);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-weight: 600;
}

.topbar-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s ease;
    position: relative;
}
.topbar-btn:hover { color: var(--text-1); border-color: var(--border-hover); }
.topbar-btn svg { width: 17px; height: 17px; }
.topbar-btn-notify .notify-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
    border: 2px solid var(--bg-app);
}

/* ===== GLOBAL SEARCH RESULTS ===== */
.search-bar { position: relative; }
.global-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: 320px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    z-index: 200;
    padding: 6px;
}
.gs-group {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 10px 4px;
}
.gs-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
}
.gs-item:hover { background: var(--bg-card-hover); }
.gs-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.gs-meta { font-size: 11px; color: var(--text-4); white-space: nowrap; }
.gs-loading, .gs-empty {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-4);
}

/* ===== NOTIFICATION PANEL ===== */
.topbar-btn-notify { position: relative; }
.notify-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 340px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    z-index: 200;
    padding: 4px;
}
.notify-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    padding: 10px 12px 6px;
}
.notify-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.1s;
}
.notify-item:hover { background: var(--bg-card-hover); }
.notify-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--bg-app);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.notify-body { min-width: 0; flex: 1; }
.notify-title { font-size: 12px; font-weight: 600; color: var(--text-1); }
.notify-desc {
    font-size: 11px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notify-time { font-size: 10px; color: var(--text-4); margin-top: 2px; }
.notify-loading, .notify-empty {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-4);
}

.topbar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #B45309, #92400E);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    cursor: pointer;
}

/* Scrollable content */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 32px;
    background: var(--bg-app);
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.qa-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.qa-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-1);
}
.qa-btn:active { opacity: 0.7; transform: scale(0.97); }
.qa-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.qa-icon svg { width: 13px; height: 13px; }
.qa-sale .qa-icon { background: var(--green-dim); color: var(--green-text); }
.qa-sale:hover { border-color: var(--green); color: var(--green-text); }
.qa-purchase .qa-icon { background: var(--amber-dim); color: var(--amber-text); }
.qa-purchase:hover { border-color: var(--amber); color: var(--amber-text); }
.qa-receipt .qa-icon { background: var(--accent-dim); color: var(--accent-text); }
.qa-receipt:hover { border-color: var(--accent); color: var(--accent-text); }
.qa-payment .qa-icon { background: var(--red-dim); color: var(--red-text); }
.qa-payment:hover { border-color: var(--red); color: var(--red-text); }
.qa-customer .qa-icon { background: rgba(139, 92, 246, 0.08); color: #8B5CF6; }
.qa-customer:hover { border-color: #8B5CF6; color: #8B5CF6; }
.qa-product .qa-icon { background: rgba(180, 83, 9, 0.08); color: #B45309; }
.qa-product:hover { border-color: #B45309; color: #B45309; }

/* ===== DASHBOARD GREETING ===== */
.dash-greeting-wrap {
    margin-bottom: 18px;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}
.dash-greeting-wrap::before,
.dash-greeting-wrap::after {
    display: none;
}
.dash-greeting {
    font-size: 23px;
    font-weight: 750;
    color: var(--text-1);
    margin-bottom: 3px;
    letter-spacing: -0.03em;
    line-height: 1.12;
}
.dash-greeting-sub {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    letter-spacing: 0.01em;
}
.dash-greeting-company {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
    z-index: 1;
}
.dash-greeting-company::before {
    content: "";
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    opacity: 0.7;
}

/* ===== PRIMARY DASHBOARD CARDS ===== */
.dash-primary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.dash-primary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dash-primary-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}
.dash-primary-card:active { opacity: 0.7; transform: scale(0.98); }

.dash-primary-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.dash-primary-icon svg { width: 16px; height: 16px; }
.dash-primary-card.sales .dash-primary-icon { background: var(--accent-dim); color: var(--accent-text); }
.dash-primary-card.collection .dash-primary-icon { background: var(--green-dim); color: var(--green-text); }
.dash-primary-card.receivable .dash-primary-icon { background: var(--red-dim); color: var(--red-text); }
.dash-primary-card.payable .dash-primary-icon { background: var(--amber-dim); color: var(--amber-text); }
.dash-primary-card.profit .dash-primary-icon { background: var(--green-dim); color: var(--green-text); }

.dash-primary-info { min-width: 0; flex: 1; }

.dash-primary-value {
    font-size: clamp(14px, 1vw, 17px);
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--text-1);
    line-height: 1.15;
    overflow-wrap: anywhere;
}
.dash-primary-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-primary-meta {
    font-size: 10px;
    color: var(--text-4);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== DASHBOARD CHARTS ===== */
.dash-charts-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.dash-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px 12px;
}
.dash-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.dash-chart-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
}
.dash-chart-range {
    display: flex;
    gap: 2px;
    background: var(--bg-app);
    border-radius: 6px;
    padding: 2px;
}
.range-btn {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-4);
    cursor: pointer;
    transition: all 0.15s;
}
.range-btn:hover { color: var(--text-2); }
.range-btn.is-active {
    background: var(--bg-card);
    color: var(--accent);
    box-shadow: var(--shadow-xs);
}
.dash-chart-wrap {
    position: relative;
    height: 160px;
}
.dash-chart-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
}
.dash-chart-tooltip {
    position: absolute;
    padding: 6px 10px;
    background: var(--nav-bg);
    color: #F8FAFC;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: opacity 0.12s;
    font-variant-numeric: tabular-nums;
}
.dash-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.dash-chart-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-3);
    font-weight: 500;
    cursor: pointer;
}
.dash-chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}
.dash-chart-legend-val {
    font-weight: 700;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}
.dash-chart-footer {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-4);
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    font-variant-numeric: tabular-nums;
}

/* Outstanding bar */
.outstanding-bar {
    height: 3px;
    background: var(--accent-dim);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}
.outstanding-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.5s ease;
}
.outstanding-bar.amber { background: var(--amber-dim); }
.outstanding-bar.amber .outstanding-bar-fill { background: var(--amber); }

/* ===== LEGACY STAT CARDS (used by other pages) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px 12px;
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}
.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon-sales { background: var(--accent-dim); color: var(--accent-text); }
.stat-icon-receivable { background: var(--red-dim); color: var(--red-text); }
.stat-icon-stock { background: var(--green-dim); color: var(--green-text); }
.stat-icon-payable { background: var(--amber-dim); color: var(--amber-text); }

.stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-3);
    margin-top: 2px;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    color: var(--text-1);
    line-height: 1;
}
.stat-card-mini {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: var(--shadow-xs);
}
.stat-card-mini .stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-4);
    margin-bottom: 4px;
}
.stat-card-mini .stat-value {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--text-1);
    line-height: 1.2;
}

.stat-change {
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px 8px;
    border-radius: 6px;
}
.stat-change.up { color: var(--green-text); background: var(--green-dim); }
.stat-change.down { color: var(--red-text); background: var(--red-dim); }
.stat-change.neutral { color: var(--text-4); background: var(--bg-input); }
.stat-change svg { width: 12px; height: 12px; }
.stat-spark {
    margin-top: 10px;
    opacity: 0.5;
}
.stat-spark svg { width: 100%; height: 24px; display: block; }

/* ===== SECTION CARD ===== */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.section-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-1);
}
.section-action {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-text);
    cursor: pointer;
    border: none;
    background: var(--accent-dim);
    padding: 5px 12px;
    border-radius: 6px;
    transition: all 0.12s;
}
.section-action:hover { background: var(--accent); color: #fff; }

/* Chart area */
.chart-area svg { width: 100%; display: block; }

/* Tab toggle */
.tab-toggle {
    display: inline-flex;
    gap: 2px;
    background: var(--bg-input);
    border-radius: 7px;
    padding: 2px;
}
.tab-toggle-btn {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
    transition: all 0.12s ease;
}
.tab-toggle-btn:hover:not(.is-active) { background: var(--bg-panel-alt); }
.tab-toggle-btn.is-active {
    background: var(--accent);
    color: white;
}
/* ===== Report Center ===== */
.rpt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.rpt-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
}
.rpt-card:hover, .rpt-card:focus-visible {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    outline: none;
}
.rpt-card-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rpt-card-icon svg { width: 20px; height: 20px; }
.rpt-card-body { flex: 1; min-width: 0; }
.rpt-card-body h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    margin: 0 0 2px;
}
.rpt-card-body p {
    font-size: 11px;
    color: var(--text-3);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rpt-card-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-4);
    background: var(--bg-panel-alt);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
/* Back button (shared across levels) */
.rpt-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px 6px 4px;
    border: none;
    background: none;
    color: var(--text-3);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: 4px;
}
.rpt-back-btn svg { width: 18px; height: 18px; }
.rpt-back-btn:hover { color: var(--accent); }
/* Category page title */
.rpt-cat-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-1);
    margin: 0 0 16px;
}
/* Breadcrumb in report view */
.rpt-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 14px;
}
.rpt-breadcrumb .rpt-back-btn { margin-bottom: 0; }
.rpt-breadcrumb-current {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
}
/* Report card — used for both category index AND individual report cards inside a category */
.rpt-card-rpt {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
}
.rpt-card-rpt:hover, .rpt-card-rpt:focus-visible {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    outline: none;
}
.rpt-card-rpt .rpt-card-body h3 { font-size: 13px; }
.rpt-card-rpt .rpt-card-body p { white-space: normal; }

/* List items */
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}
.list-row + .list-row { border-top: 1px solid var(--border-light); }

.list-label {
    font-size: 13px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-value {
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.list-value.red { color: var(--red-text); }
.list-value.green { color: var(--green-text); }

/* Chart legend */
.chart-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}
.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
}
.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Outstanding list */
.outstanding-list { display: flex; flex-direction: column; gap: 2px; }
.outstanding-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}
.outstanding-row + .outstanding-row { border-top: 1px solid var(--border-light); }
.outstanding-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.outstanding-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.outstanding-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.outstanding-days { font-size: 11px; color: var(--text-4); }
.outstanding-amount {
    font-size: 13px;
    font-weight: 700;
    color: var(--red-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.outstanding-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 0 0;
    margin-top: 4px;
    border-top: 2px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-1);
}

/* Salesman row */
.salesman-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}
.salesman-row + .salesman-row { border-top: 1px solid var(--border-light); }
.salesman-rank {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-4);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.salesman-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-text);
    flex-shrink: 0;
}
.salesman-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.salesman-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.salesman-amount {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.salesman-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
}
.salesman-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #F59E0B);
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* Activity timeline */
.activity-timeline { display: flex; flex-direction: column; }
.activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    position: relative;
}
.activity-item + .activity-item { border-top: 1px solid var(--border-light); }
.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}
.activity-dot-green { background: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.activity-dot-blue { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.activity-dot-amber { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-dim); }
.activity-dot-red { background: var(--red); box-shadow: 0 0 0 3px var(--red-dim); }
.activity-content { flex: 1; min-width: 0; }
.activity-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.activity-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-amount {
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.activity-amount.green { color: var(--green-text); }
.activity-amount.red { color: var(--red-text); }
.activity-meta {
    font-size: 11px;
    color: var(--text-4);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-wide-narrow { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

/* ===== RIGHT SUMMARY STRIP ===== */
.summary-strip {
    width: 220px;
    background: var(--strip-bg);
    border-left: 1px solid var(--strip-border);
    box-shadow: -2px 0 8px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 20px 16px;
    gap: 20px;
}

.strip-section { display: flex; flex-direction: column; gap: 8px; }
.strip-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--strip-label);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.strip-divider { height: 1px; background: var(--border-light); }

.strip-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.strip-item-name {
    font-size: 12px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.strip-item-value {
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.strip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.strip-row-label {
    font-size: 12px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.strip-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}
.strip-badge.red { background: var(--red-dim); color: var(--red-text); }
.strip-badge.amber { background: var(--amber-dim); color: var(--amber-text); }

.strip-progress {
    width: 100%;
    height: 5px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}
.strip-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
}
.strip-target-val {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--text-1);
}
.strip-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.strip-target-pct {
    font-size: 11px;
    color: var(--accent-text);
    font-weight: 600;
    margin-top: 2px;
}
.strip-meta {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 2px;
}

/* Strip alerts */
.strip-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.strip-alert-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.strip-alert-icon svg { width: 12px; height: 12px; }
.strip-alert-icon.red { background: var(--red-dim); color: var(--red-text); }
.strip-alert-icon.amber { background: var(--amber-dim); color: var(--amber-text); }
.strip-alert-info { flex: 1; min-width: 0; }
.strip-alert-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.strip-alert-qty { font-size: 10px; color: var(--text-4); }

/* Strip expiry */
.strip-expiry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
}
.strip-expiry-name {
    font-size: 12px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Strip products */
.strip-product {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
}
.strip-product-rank {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: var(--accent-dim);
    color: var(--accent-text);
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.strip-product-name {
    flex: 1;
    font-size: 12px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.strip-product-qty {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-4);
    white-space: nowrap;
}

/* ===== PAGES ===== */
.page { display: none; }
.page.is-active { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* ===== RESPONSIVE ===== */
/* ===== MOBILE HOME — PREMIUM DESIGN ===== */
.mobile-home { display: none; }

/* Hero Header */
.mh-hero {
    background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 100%);
    margin: -16px -16px 0;
    padding: 16px 20px 20px;
    border-radius: 0 0 24px 24px;
}
.mh-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.mh-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mh-brand-text {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #F5F5F4;
    letter-spacing: -0.01em;
}
.mh-brand-text b {
    font-weight: 700;
    color: #2563EB;
}
.mh-hero-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.mh-hero-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}
.mh-hero-btn:active { background: rgba(255,255,255,0.15); }
.mh-hero-btn svg { width: 18px; height: 18px; }
.mh-hero-notify { position: relative; }
.mh-notify-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #F59E0B;
    border: 1.5px solid #0F172A;
}
.mh-hero-greeting {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}
.mh-greeting {
    font-size: 22px;
    font-weight: 750;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.mh-company {
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.62);
    margin-top: 3px;
    letter-spacing: 0.01em;
}
.mh-date-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
    flex-shrink: 0;
}
.mh-date-chip svg { width: 13px; height: 13px; }

/* Stat Cards */
.mh-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: -12px 0 0;
    padding: 0 4px;
    position: relative;
    z-index: 1;
}
.mh-stat-card {
    background: var(--bg-panel);
    border-radius: 14px;
    padding: 11px 13px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 0 0 1px var(--border);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 11px;
    align-items: center;
}
.mh-stat-card:active { transform: scale(0.97); }
.mh-sc-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    grid-column: 1;
    grid-row: 1 / 4;
    align-self: center;
}
.mh-sc-icon svg { width: 18px; height: 18px; }
.mh-sc-icon.green { background: var(--green-dim); color: var(--green-text); }
.mh-sc-icon.amber { background: var(--amber-dim); color: var(--amber-text); }
.mh-sc-icon.blue { background: var(--blue-dim); color: var(--blue-text); }
.mh-sc-icon.red { background: var(--red-dim); color: var(--red-text); }
.mh-sc-label {
    grid-column: 2;
    grid-row: 1;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.2px;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mh-sc-amount {
    grid-column: 2;
    grid-row: 2;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-1);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
    line-height: 1.12;
    overflow-wrap: anywhere;
}
.mh-sc-meta {
    grid-column: 2;
    grid-row: 3;
    font-size: 10.5px;
    font-weight: 600;
    margin-top: 1px;
}
.mh-sc-meta.green { color: var(--green-text); }
.mh-sc-meta.amber { color: var(--amber-text); }
.mh-sc-meta.blue { color: var(--blue-text); }
.mh-sc-meta.red { color: var(--red-text); }

/* Quick Actions */
.mh-section {
    margin-top: 20px;
}
.mh-section-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}
.mh-section-hdr span {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-1);
}
.mh-view-all {
    font-size: 12px;
    font-weight: 600;
    color: var(--blue-text, var(--accent-text));
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 0;
}
.mh-qa-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 8px;
    padding: 0 4px;
}
.mh-qa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mh-qa-btn:active .mh-qa-circle { transform: scale(0.9); }
.mh-qa-btn.is-active .mh-qa-circle { box-shadow: 0 0 0 2.5px #2563EB; }
.mh-qa-btn span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
    text-align: center;
    line-height: 1.2;
}
.mh-qa-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
}
.mh-qa-circle svg { width: 22px; height: 22px; }
.mh-qa-circle.green { background: var(--green-dim); color: var(--green-text); }
.mh-qa-circle.amber { background: var(--amber-dim); color: var(--amber-text); }
.mh-qa-circle.blue { background: var(--blue-dim); color: var(--blue-text); }
.mh-qa-circle.purple { background: var(--purple-dim); color: var(--purple-text); }
.mh-qa-circle.orange { background: var(--accent-dim); color: var(--accent-text); }
.mh-qa-circle.teal { background: rgba(20, 184, 166, 0.08); color: #0D9488; }
.mh-qa-circle.cyan { background: rgba(14, 165, 233, 0.08); color: #0EA5E9; }
.mh-qa-circle.slate { background: rgba(100, 116, 139, 0.1); color: #64748B; }

/* Expandable sub-items */
.mh-hub-page {
    flex: 1;
    min-height: 0;
    background: var(--bg-app);
    display: none;
    flex-direction: column;
    animation: mhHubSlide 0.2s ease;
}
.mh-hub-page.is-open {
    display: flex;
}
@keyframes mhHubSlide {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
.mh-hub-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel);
}
.mh-hub-back {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-app);
    color: var(--text-1);
    cursor: pointer;
}
.mh-hub-back:active { background: var(--border); }
.mh-hub-back svg { width: 20px; height: 20px; }
.mh-hub-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-1);
}
.mh-hub-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mh-hub-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    cursor: pointer;
    transition: all 0.12s;
}
.mh-hub-btn:active { background: var(--border); transform: scale(0.98); }
.mh-hub-btn svg { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }

/* Recent Activity (mobile home) */
.mh-activity {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}
.mh-activity-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
}
.mh-activity-row:last-child { border-bottom: none; }
.mh-activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}
.mh-activity-info {
    flex: 1;
    min-width: 0;
}
.mh-activity-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mh-activity-desc {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 1px;
}
.mh-activity-amt {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-1);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Back button for full dashboard on mobile */
.mobile-dash-back {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    margin-bottom: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-text);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
}
.mobile-dash-back svg { width: 16px; height: 16px; }

@media (max-width: 1100px) {
    .summary-strip { display: none; }
}
@media (max-width: 900px) {
    .nav-panel {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        width: 260px;
    }
    .nav-panel.is-open { transform: translateX(0); }
    .mobile-home { display: block; }
    #page-dashboard > .topbar { display: none; }
    #page-dashboard.mh-show-dash > .topbar { display: flex; }
    .dash-content { display: none; }
    .dash-content.is-visible { display: block; }
    .mobile-dash-back.is-visible { display: flex; }
    .dash-primary-grid { grid-template-columns: repeat(3, 1fr); }
    .dash-primary-value { font-size: 14px; }
    .dash-primary-icon { width: 28px; height: 28px; }
    .dash-primary-icon svg { width: 14px; height: 14px; }
    .dash-charts-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-wide-narrow { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .content-scroll { padding: 16px 16px 32px; }
    .topbar { padding: 10px 16px; }
    .settings-section { max-width: none; }
    .mobile-menu-btn { display: flex !important; }
    .page:not(#page-dashboard) .mobile-menu-btn svg line { display: none; }
    .page:not(#page-dashboard) .mobile-menu-btn svg {
        transform: scaleX(-1);
    }
    .page:not(#page-dashboard) .mobile-menu-btn svg::after { content: ''; }
    .page:not(#page-dashboard) .mobile-menu-btn { position: relative; }
    .page:not(#page-dashboard) .mobile-menu-btn svg { display: none; }
    .page:not(#page-dashboard) .mobile-menu-btn::before {
        content: '\2039';
        font-size: 28px;
        font-weight: 300;
        line-height: 1;
        margin-top: -2px;
    }
    .search-bar { display: none; }
    .quick-actions { gap: 6px; }
    .qa-btn { padding: 8px 12px; font-size: 11px; }
    .qa-icon { width: 24px; height: 24px; border-radius: 6px; }
    .qa-icon svg { width: 12px; height: 12px; }
    .stat-value { font-size: 20px; }
    .stat-icon { width: 32px; height: 32px; }
    .stat-icon svg { width: 15px; height: 15px; }
}
@media (max-width: 480px) {
    .dash-primary-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .dash-primary-card { padding: 8px 10px 6px; border-radius: 10px; gap: 8px; }
    .dash-primary-value { font-size: 14px; }
    .dash-primary-label { font-size: 10px; }
    .dash-primary-icon { width: 26px; height: 26px; }
    .dash-primary-icon svg { width: 13px; height: 13px; }
    .dash-greeting { font-size: 17px; }
    .dash-greeting-sub { font-size: 11px; }
    .dash-greeting-wrap { margin-bottom: 14px; }
    .dash-greeting-company { font-size: 10px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 12px 12px 10px; border-radius: 10px; }
    .stat-value { font-size: 20px; }
    .stat-spark { display: none; }
    .quick-actions { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
    .qa-btn { flex-shrink: 0; }
    .topbar-title { font-size: 17px; }
    .section-card { padding: 14px 16px; }
    .activity-meta { font-size: 10px; }
}
@media (min-width: 901px) {
    .mobile-menu-btn { display: none !important; }
    .nav-overlay { display: none !important; }
}

.mobile-menu-btn {
    display: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-2);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.mobile-menu-btn svg { width: 18px; height: 18px; }

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.nav-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ===== COMPANY SETUP SCREEN ===== */
.setup-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-app);
    padding: 24px;
}
.setup-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 480px;
    text-align: center;
    box-shadow: var(--shadow-md);
}
.setup-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--accent-dim);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.setup-icon svg { width: 28px; height: 28px; }
.setup-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-1);
    margin: 0 0 6px;
}
.setup-subtitle {
    font-size: 14px;
    color: var(--text-3);
    margin: 0 0 32px;
}
.setup-field {
    text-align: left;
    margin-bottom: 16px;
    flex: 1;
}
.setup-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
}
.setup-field input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-1);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    box-shadow: var(--shadow-inset);
}
.setup-field input:hover:not(:focus) {
    border-color: var(--border-hover);
}
.setup-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.setup-field input::placeholder { color: var(--text-4); }
.setup-row {
    display: flex;
    gap: 12px;
}
.setup-error {
    background: var(--red-dim);
    color: var(--red-text);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: left;
}
.setup-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.setup-btn:hover { background: var(--accent-hover); }
.setup-btn:disabled { opacity: 0.6; cursor: not-allowed; }
@media (max-width: 480px) {
    .setup-card { padding: 32px 20px; }
    .setup-row { flex-direction: column; gap: 0; }
}

/* ===== SETTINGS PAGE ===== */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }
.btn-primary:active { opacity: 0.7; transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    max-width: 700px;
}
.settings-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-1);
    margin: 0 0 12px;
    letter-spacing: -0.01em;
}
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.settings-grid .field {
    display: flex;
    flex-direction: column;
}
.settings-grid .field.full-width {
    grid-column: 1 / -1;
}
.settings-grid .field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.settings-grid .field input,
.settings-grid .field select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-1);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.settings-grid .field input:hover:not(:focus),
.settings-grid .field select:hover:not(:focus) {
    border-color: var(--border-hover);
}
.settings-grid .field input:focus,
.settings-grid .field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
}
.settings-grid .field input::placeholder { color: var(--text-4); }
.settings-grid .field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237C7F96' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    cursor: pointer;
}

.settings-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    z-index: 200;
    animation: toast-in 0.3s ease;
}
.settings-toast.success {
    background: var(--green-dim);
    color: var(--green-text);
    border: 1px solid var(--green-text);
}
.settings-toast.error {
    background: var(--red-dim);
    color: var(--red-text);
    border: 1px solid var(--red-text);
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 600px) {
    .settings-grid { grid-template-columns: 1fr; }
    .settings-section { padding: 16px; }
}
