/* ═══════════════════════════════════════════════════════
   Alice Pro — Acorn-inspired design system
   ═══════════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Layout dimensions ── */
:root {
    --sidebar-w:   260px;
    --topbar-h:    64px;
}

/* ══════════════════════════════════════════════════════
   LIGHT THEME (default)
   ══════════════════════════════════════════════════════ */
:root,
[data-theme="light"] {
    --bg:              #f0f2f5;
    --bg-surface:      #ffffff;
    --bg-hover:        #f8f9fb;
    --bg-input:        #ffffff;

    --sidebar-bg:      #1e2130;
    --sidebar-hover:   #2a2f42;
    --sidebar-active:  #1e3a5f;
    --sidebar-text:    #8b92a9;
    --sidebar-text-active: #60a5fa;
    --sidebar-border:  #252836;
    --sidebar-icon:    #555f7a;
    --sidebar-icon-active: #60a5fa;

    --topbar-bg:       rgba(255,255,255,0.65);
    --topbar-border:   rgba(255,255,255,0.4);

    --border:          #e5e7eb;
    --border-light:    #f3f4f6;

    --text:            #111827;
    --text-muted:      #6b7280;
    --text-light:      #9ca3af;
    --text-inverted:   #ffffff;

    --primary:         #1d4ed8;
    --primary-hover:   #1e40af;
    --primary-light:   #eff6ff;
    --primary-muted:   #93c5fd;

    --success:         #059669;
    --success-light:   #ecfdf5;
    --danger:          #dc2626;
    --danger-light:    #fef2f2;
    --warning:         #d97706;
    --warning-light:   #fffbeb;
    --info:            #0891b2;
    --info-light:      #ecfeff;

    --shadow-sm:       0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:       0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:       0 8px 24px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04);
    --shadow-xl:       0 16px 40px rgba(0,0,0,0.12);

    --radius-sm:       6px;
    --radius:          10px;
    --radius-lg:       14px;
    --radius-xl:       18px;
    --radius-full:     9999px;
}

/* ══════════════════════════════════════════════════════
   DARK THEME
   ══════════════════════════════════════════════════════ */
[data-theme="dark"] {
    --bg:              #0f1117;
    --bg-surface:      #1a1d27;
    --bg-hover:        #222535;
    --bg-input:        #1a1d27;

    --sidebar-bg:      #13151f;
    --sidebar-hover:   #1e2130;
    --sidebar-active:  #1e3a5f;
    --sidebar-text:    #8b92a9;
    --sidebar-text-active: #60a5fa;
    --sidebar-border:  #1e2130;
    --sidebar-icon:    #4b5563;
    --sidebar-icon-active: #60a5fa;

    --topbar-bg:       rgba(30,33,48,0.75);
    --topbar-border:   rgba(255,255,255,0.08);

    --border:          #1e2130;
    --border-light:    #252836;

    --text:            #e2e8f0;
    --text-muted:      #8b92a9;
    --text-light:      #4b5563;
    --text-inverted:   #111827;

    --primary:         #3b82f6;
    --primary-hover:   #2563eb;
    --primary-light:   #1e3a5f;
    --primary-muted:   #1e3a5f;

    --success:         #10b981;
    --success-light:   #022c22;
    --danger:          #ef4444;
    --danger-light:    #3b0a0a;
    --warning:         #f59e0b;
    --warning-light:   #3b2000;
    --info:            #06b6d4;
    --info-light:      #0c2a3a;

    --shadow-sm:       0 1px 3px rgba(0,0,0,0.3);
    --shadow-md:       0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg:       0 8px 24px rgba(0,0,0,0.5);
    --shadow-xl:       0 16px 40px rgba(0,0,0,0.6);
}

/* ══════════════════════════════════════════════════════
   BLUE THEME
   ══════════════════════════════════════════════════════ */
[data-theme="blue"] {
    --bg:              #f0f4ff;
    --bg-surface:      #ffffff;
    --bg-hover:        #e8eeff;
    --bg-input:        #ffffff;
    --sidebar-bg:      #1e40af;
    --sidebar-hover:   #1d3a9e;
    --sidebar-active:  #1e3a8a;
    --sidebar-text:    #bfdbfe;
    --sidebar-text-active: #ffffff;
    --sidebar-border:  #1d3a9e;
    --sidebar-icon:    #93c5fd;
    --sidebar-icon-active: #ffffff;
    --topbar-bg:       #ffffff;
    --topbar-border:   #dbeafe;
    --border:          #dbeafe;
    --border-light:    #eff6ff;
    --text:            #1e3a8a;
    --text-muted:      #3b82f6;
    --text-light:      #93c5fd;
    --text-inverted:   #ffffff;
    --primary:         #1d4ed8;
    --primary-hover:   #1e40af;
    --primary-light:   #dbeafe;
    --shadow-sm:       0 1px 3px rgba(30,64,175,0.08);
    --shadow-md:       0 4px 12px rgba(30,64,175,0.12);
    --shadow-lg:       0 8px 24px rgba(30,64,175,0.16);
    --shadow-xl:       0 16px 40px rgba(30,64,175,0.20);
    --success:  #059669; --success-light: #ecfdf5;
    --danger:   #dc2626; --danger-light:  #fef2f2;
    --warning:  #d97706; --warning-light: #fffbeb;
    --info:     #0891b2; --info-light:    #ecfeff;
    --radius-sm: 6px; --radius: 10px; --radius-lg: 14px;
    --radius-xl: 18px; --radius-full: 9999px;
}

/* ══════════════════════════════════════════════════════
   GREEN THEME
   ══════════════════════════════════════════════════════ */
[data-theme="green"] {
    --bg:              #f0fdf4;
    --bg-surface:      #ffffff;
    --bg-hover:        #dcfce7;
    --bg-input:        #ffffff;
    --sidebar-bg:      #14532d;
    --sidebar-hover:   #166534;
    --sidebar-active:  #15803d;
    --sidebar-text:    #86efac;
    --sidebar-text-active: #ffffff;
    --sidebar-border:  #166534;
    --sidebar-icon:    #4ade80;
    --sidebar-icon-active: #ffffff;
    --topbar-bg:       #ffffff;
    --topbar-border:   #dcfce7;
    --border:          #bbf7d0;
    --border-light:    #dcfce7;
    --text:            #14532d;
    --text-muted:      #16a34a;
    --text-light:      #86efac;
    --text-inverted:   #ffffff;
    --primary:         #16a34a;
    --primary-hover:   #15803d;
    --primary-light:   #dcfce7;
    --shadow-sm:       0 1px 3px rgba(20,83,45,0.08);
    --shadow-md:       0 4px 12px rgba(20,83,45,0.12);
    --shadow-lg:       0 8px 24px rgba(20,83,45,0.16);
    --shadow-xl:       0 16px 40px rgba(20,83,45,0.20);
    --success:  #059669; --success-light: #ecfdf5;
    --danger:   #dc2626; --danger-light:  #fef2f2;
    --warning:  #d97706; --warning-light: #fffbeb;
    --info:     #0891b2; --info-light:    #ecfeff;
    --radius-sm: 6px; --radius: 10px; --radius-lg: 14px;
    --radius-xl: 18px; --radius-full: 9999px;
}

/* ══════════════════════════════════════════════════════
   PURPLE THEME
   ══════════════════════════════════════════════════════ */
[data-theme="purple"] {
    --bg:              #faf5ff;
    --bg-surface:      #ffffff;
    --bg-hover:        #f3e8ff;
    --bg-input:        #ffffff;
    --sidebar-bg:      #4c1d95;
    --sidebar-hover:   #5b21b6;
    --sidebar-active:  #6d28d9;
    --sidebar-text:    #c4b5fd;
    --sidebar-text-active: #ffffff;
    --sidebar-border:  #5b21b6;
    --sidebar-icon:    #a78bfa;
    --sidebar-icon-active: #ffffff;
    --topbar-bg:       #ffffff;
    --topbar-border:   #ede9fe;
    --border:          #ddd6fe;
    --border-light:    #ede9fe;
    --text:            #4c1d95;
    --text-muted:      #7c3aed;
    --text-light:      #c4b5fd;
    --text-inverted:   #ffffff;
    --primary:         #7c3aed;
    --primary-hover:   #6d28d9;
    --primary-light:   #ede9fe;
    --shadow-sm:       0 1px 3px rgba(76,29,149,0.08);
    --shadow-md:       0 4px 12px rgba(76,29,149,0.12);
    --shadow-lg:       0 8px 24px rgba(76,29,149,0.16);
    --shadow-xl:       0 16px 40px rgba(76,29,149,0.20);
    --success:  #059669; --success-light: #ecfdf5;
    --danger:   #dc2626; --danger-light:  #fef2f2;
    --warning:  #d97706; --warning-light: #fffbeb;
    --info:     #0891b2; --info-light:    #ecfeff;
    --radius-sm: 6px; --radius: 10px; --radius-lg: 14px;
    --radius-xl: 18px; --radius-full: 9999px;
}

/* ══════════════════════════════════════════════════════
   ORANGE THEME
   ══════════════════════════════════════════════════════ */
[data-theme="orange"] {
    --bg:              #fff7ed;
    --bg-surface:      #ffffff;
    --bg-hover:        #ffedd5;
    --bg-input:        #ffffff;
    --sidebar-bg:      #7c2d12;
    --sidebar-hover:   #9a3412;
    --sidebar-active:  #c2410c;
    --sidebar-text:    #fdba74;
    --sidebar-text-active: #ffffff;
    --sidebar-border:  #9a3412;
    --sidebar-icon:    #fb923c;
    --sidebar-icon-active: #ffffff;
    --topbar-bg:       #ffffff;
    --topbar-border:   #fed7aa;
    --border:          #fed7aa;
    --border-light:    #ffedd5;
    --text:            #7c2d12;
    --text-muted:      #ea580c;
    --text-light:      #fdba74;
    --text-inverted:   #ffffff;
    --primary:         #ea580c;
    --primary-hover:   #c2410c;
    --primary-light:   #ffedd5;
    --shadow-sm:       0 1px 3px rgba(124,45,18,0.08);
    --shadow-md:       0 4px 12px rgba(124,45,18,0.12);
    --shadow-lg:       0 8px 24px rgba(124,45,18,0.16);
    --shadow-xl:       0 16px 40px rgba(124,45,18,0.20);
    --success:  #059669; --success-light: #ecfdf5;
    --danger:   #dc2626; --danger-light:  #fef2f2;
    --warning:  #d97706; --warning-light: #fffbeb;
    --info:     #0891b2; --info-light:    #ecfeff;
    --radius-sm: 6px; --radius: 10px; --radius-lg: 14px;
    --radius-xl: 18px; --radius-full: 9999px;
}

/* ══════════════════════════════════════════════════════
   PRO DARK THEME — Manrope + gold accent
   ══════════════════════════════════════════════════════ */

/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/manrope/manrope-400-latin-ext.woff2') format('woff2');
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/manrope/manrope-400-latin.woff2') format('woff2');
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/manrope/manrope-500-latin-ext.woff2') format('woff2');
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/manrope/manrope-500-latin.woff2') format('woff2');
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/manrope/manrope-600-latin-ext.woff2') format('woff2');
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/manrope/manrope-600-latin.woff2') format('woff2');
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/manrope/manrope-700-latin-ext.woff2') format('woff2');
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/manrope/manrope-700-latin.woff2') format('woff2');
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/manrope/manrope-800-latin-ext.woff2') format('woff2');
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/manrope/manrope-800-latin.woff2') format('woff2');
}
/* latin-ext */
@font-face {
  font-family: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/spline-sans-mono/spline-sans-mono-400-latin-ext.woff2') format('woff2');
}
/* latin */
@font-face {
  font-family: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/spline-sans-mono/spline-sans-mono-400-latin.woff2') format('woff2');
}
/* latin-ext */
@font-face {
  font-family: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/spline-sans-mono/spline-sans-mono-500-latin-ext.woff2') format('woff2');
}
/* latin */
@font-face {
  font-family: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/spline-sans-mono/spline-sans-mono-500-latin.woff2') format('woff2');
}
/* latin-ext */
@font-face {
  font-family: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/spline-sans-mono/spline-sans-mono-600-latin-ext.woff2') format('woff2');
}
/* latin */
@font-face {
  font-family: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/spline-sans-mono/spline-sans-mono-600-latin.woff2') format('woff2');
}

[data-theme="pro"] {
    /* Backgrounds */
    --bg:              #0D0F14;
    --bg-surface:      #151822;
    --bg-hover:        #1B1F2A;
    --bg-input:        #1B1F2A;

    /* Sidebar — deepest layer */
    --sidebar-bg:      #0A0C10;
    --sidebar-hover:   #151822;
    --sidebar-active:  #1C1A0A;
    --sidebar-text:    #8891A5;
    --sidebar-text-active: #C9A227;
    --sidebar-border:  #1D2130;
    --sidebar-icon:    #5B6178;
    --sidebar-icon-active: #C9A227;

    /* Topbar */
    --topbar-bg:       rgba(21,24,34,0.85);
    --topbar-border:   rgba(201,162,39,0.18);

    /* Borders */
    --border:          #262B38;
    --border-light:    #1D2130;

    /* Text */
    --text:            #EDEFF4;
    --text-muted:      #8891A5;
    --text-light:      #5B6178;
    --text-inverted:   #0D0F14;

    /* Primary = gold */
    --primary:         #C9A227;
    --primary-hover:   #DCB233;
    --primary-light:   rgba(201,162,39,0.12);
    --primary-muted:   #8A7220;

    /* Status colours — slightly adjusted for dark bg */
    --success:         #34D399;
    --success-light:   #032019;
    --danger:          #F87171;
    --danger-light:    #3b0a0a;
    --warning:         #FBBF24;
    --warning-light:   #3b2000;
    --info:            #60A5FA;
    --info-light:      #0c2a3a;

    /* Shadows */
    --shadow-sm:       0 1px 4px rgba(0,0,0,0.5);
    --shadow-md:       0 4px 16px rgba(0,0,0,0.6);
    --shadow-lg:       0 8px 32px rgba(0,0,0,0.7);
    --shadow-xl:       0 16px 48px rgba(0,0,0,0.8);

    /* Radii — slightly tighter than default */
    --radius-sm:       7px;
    --radius:          10px;
    --radius-lg:       14px;
    --radius-xl:       18px;
    --radius-full:     9999px;
}

/* ── Pro Dark: visual skin (typography, shape, layout) ── */

/* Typography foundation */
[data-theme="pro"],
[data-theme="pro"] body {
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* Headings — tighter, heavier */
[data-theme="pro"] h1,[data-theme="pro"] h2,[data-theme="pro"] h3,
[data-theme="pro"] h4,[data-theme="pro"] h5,[data-theme="pro"] h6 {
    font-family: 'Manrope', system-ui, sans-serif;
    letter-spacing: -0.02em;
    font-weight: 700;
}

/* Page title (topbar / page header) */
[data-theme="pro"] .page-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* ── Topbar ── */
[data-theme="pro"] .topbar {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--topbar-border);
}

/* ── Sidebar ── */
[data-theme="pro"] .sidebar-link {
    border-radius: 0;
    border-left: 2px solid transparent;
    letter-spacing: 0;
    font-weight: 500;
}
[data-theme="pro"] .sidebar-link.active {
    border-left-color: var(--primary);
    background: linear-gradient(90deg, rgba(201,162,39,0.10) 0%, transparent 100%);
    font-weight: 700;
}
[data-theme="pro"] .sidebar-link:hover:not(.active) {
    border-left-color: var(--sidebar-border);
}

/* ── Cards — sharp borders, no shadows ── */
[data-theme="pro"] .card,
[data-theme="pro"] [class*="card"] {
    box-shadow: none !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Card headers */
[data-theme="pro"] .card-header,
[data-theme="pro"] .card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}
/* Section-label h3 inside card-head → small uppercase eyebrow */
[data-theme="pro"] .card-head h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin: 0;
}
/* .card-title inside card-header / card-head → proper bold title */
[data-theme="pro"] .card-header .card-title,
[data-theme="pro"] .card-head .card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: 0;
    text-transform: none;
}
/* "View all →" or any link inside a card head */
[data-theme="pro"] .card-head a:not(.btn),
[data-theme="pro"] .card-header a:not(.btn) {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}
[data-theme="pro"] .card-head a:not(.btn):hover,
[data-theme="pro"] .card-header a:not(.btn):hover {
    color: var(--primary-hover);
}

/* ── Tables — tighter, monospace numbers ── */
[data-theme="pro"] table thead th {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    background: var(--bg-hover);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}
[data-theme="pro"] table tbody td {
    border-bottom: 1px solid var(--border-light);
    padding: 12px 16px;
    font-size: 13px;
    transition: background 0.1s ease;
}
[data-theme="pro"] table tbody tr:last-child td {
    border-bottom: none;
}
[data-theme="pro"] table tbody tr:hover td {
    background: var(--bg-hover);
}
/* All numeric/money cells in Pro Dark → monospace tabular */
[data-theme="pro"] td:not(:first-child),
[data-theme="pro"] .num-mono,
[data-theme="pro"] td.num {
    font-family: 'Spline Sans Mono', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--text-muted);
}
[data-theme="pro"] td:first-child {
    font-family: 'Manrope', system-ui, sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: var(--text);
}

/* ── Badges → pills ── */
[data-theme="pro"] .badge {
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 10px;
    border: 1px solid transparent;
}
[data-theme="pro"] .badge-primary  { border-color: var(--primary-muted);  background: var(--primary-light);  color: var(--primary); }
[data-theme="pro"] .badge-success  { border-color: #065f46; background: #032019; color: var(--success); }
[data-theme="pro"] .badge-danger   { border-color: #7f1d1d; background: #3b0a0a; color: var(--danger); }
[data-theme="pro"] .badge-warning  { border-color: #78350f; background: #3b2000; color: var(--warning); }
[data-theme="pro"] .badge-info     { border-color: #0c4a6e; background: #0c2a3a; color: var(--info); }
[data-theme="pro"] .badge-gray     { border-color: var(--border); background: var(--bg-hover); color: var(--text-muted); }

/* ── Buttons ── */
[data-theme="pro"] .btn {
    font-family: 'Manrope', system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-hover);
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
[data-theme="pro"] .btn:hover {
    border-color: var(--primary-muted);
    background: #20242F;
}
[data-theme="pro"] .btn:active { transform: scale(0.97); }

[data-theme="pro"] .btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #15130A;
    font-weight: 700;
}
[data-theme="pro"] .btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #15130A;
}
[data-theme="pro"] .btn-danger {
    background: var(--danger-light);
    border-color: #7f1d1d;
    color: var(--danger);
}
[data-theme="pro"] .btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}
[data-theme="pro"] .btn-ghost:hover {
    background: var(--bg-hover);
    border-color: var(--border);
    color: var(--text);
}

/* ── Form inputs — gold focus ring ── */
[data-theme="pro"] input,
[data-theme="pro"] select,
[data-theme="pro"] textarea {
    font-family: 'Manrope', system-ui, sans-serif;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: border-color 0.15s;
}
[data-theme="pro"] input:focus,
[data-theme="pro"] select:focus,
[data-theme="pro"] textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(201,162,39,0.15);
}
[data-theme="pro"] label.form-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

/* ── Stat/KPI cards ── */
[data-theme="pro"] .stat-value,
[data-theme="pro"] .kpi-value {
    font-family: 'Spline Sans Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ── Friendly IDs / invoice numbers — monospace ── */
[data-theme="pro"] .friendly-id,
[data-theme="pro"] [style*="font-family:monospace"],
[data-theme="pro"] [style*="font-family: monospace"] {
    font-family: 'Spline Sans Mono', monospace !important;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    font-weight: 500;
}

/* ── Pagination ── */
[data-theme="pro"] .pagination .page-btn {
    border-radius: var(--radius-sm);
    font-family: 'Spline Sans Mono', monospace;
    font-size: 12px;
}

/* ── Dividers ── */
[data-theme="pro"] hr {
    border-color: var(--border);
}

/* ── Scrollbar ── */
[data-theme="pro"] ::-webkit-scrollbar { width: 6px; height: 6px; }
[data-theme="pro"] ::-webkit-scrollbar-track { background: var(--bg); }
[data-theme="pro"] ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
[data-theme="pro"] ::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ── Card header — hide Phosphor icons in eyebrow labels ── */
[data-theme="pro"] .card-header .card-title i,
[data-theme="pro"] .card-header .card-title svg {
    display: none;
}

/* ── Pro Dark invoice: full-width layout containers ── */
[data-theme="pro"] .pro-totals-wrap {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
    margin-bottom: 20px;
}
@media (max-width: 768px) {
    [data-theme="pro"] .pro-totals-wrap { grid-template-columns: 1fr; }
}
[data-theme="pro"] .pro-notes-area {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

/* ── Pro Dark: line table cell classes ── */
[data-theme="pro"] td.desc {
    font-weight: 500;
    color: var(--text);
}
[data-theme="pro"] td.desc .unit {
    display: block;
    font-size: 11px;
    color: var(--text-faint, var(--text-light));
    font-weight: 400;
    margin-top: 3px;
    font-family: 'Spline Sans Mono', monospace;
    font-variant-numeric: tabular-nums;
}
[data-theme="pro"] td.num {
    text-align: right;
    font-family: 'Spline Sans Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--text-muted);
}
[data-theme="pro"] td.total-cell {
    text-align: right;
    font-family: 'Spline Sans Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}
[data-theme="pro"] .vat-tag {
    display: inline-block;
    font-family: 'Spline Sans Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 5px;
}

/* ── Pro Dark: actions row ── */
[data-theme="pro"] .pro-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 32px;
}
[data-theme="pro"] .pro-actions .btn {
    padding: 11px 18px;
    justify-content: center;
}
[data-theme="pro"] .pro-actions .pro-actions-submit {
    flex: 1;
}

/* ── Ledger / totals block ── */
[data-theme="pro"] .ledger { padding: 0; }
[data-theme="pro"] .ledger-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-light);
}
[data-theme="pro"] .ledger-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}
[data-theme="pro"] .ledger-val {
    font-family: 'Spline Sans Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}
[data-theme="pro"] .ledger-divider {
    height: 1px;
    margin: 6px 20px;
    background: linear-gradient(90deg, transparent 0%, var(--primary) 40%, var(--primary) 60%, transparent 100%);
    border: none;
}
[data-theme="pro"] .ledger-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 20px;
    background: linear-gradient(180deg, transparent 0%, rgba(201,162,39,0.07) 100%);
}
[data-theme="pro"] .ledger-total .ledger-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--primary);
}
[data-theme="pro"] .ledger-total .ledger-val {
    font-family: 'Spline Sans Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

/* ══════════════════════════════════════════════════════
   BASE STYLES
   ══════════════════════════════════════════════════════ */
html { font-size: 14px; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ══════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════ */
.layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--sidebar-border);
    min-height: var(--topbar-h);
}

.sidebar-logo-icon {
    width: 34px;
    height: 34px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--sidebar-text-active);
    letter-spacing: -0.3px;
}

.sidebar-logo-sub {
    font-size: 10px;
    color: var(--sidebar-text);
    font-weight: 400;
    letter-spacing: 0.3px;
}

.sidebar-nav {
    padding: 12px 12px;
    flex: 1;
}

.nav-section {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sidebar-text);
    padding: 16px 8px 6px;
    opacity: 0.7;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    margin-bottom: 2px;
    cursor: pointer;
    position: relative;
}

.nav-item i {
    font-size: 17px;
    color: var(--sidebar-icon);
    flex-shrink: 0;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.nav-item:hover i { color: var(--sidebar-icon-active); }

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    font-weight: 600;
}

.nav-item.active i { color: var(--sidebar-icon-active); }

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    background: var(--sidebar-text-active);
    border-radius: 0 3px 3px 0;
}

/* ── Main content ── */
.layout {
    display: flex;
    width: 100%;
}
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ── Topbar ── */
.topbar {
    height: var(--topbar-h);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(255,255,255,0.3), 0 4px 16px rgba(0,0,0,0.06);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

/* ── Content area ── */
.content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--topbar-h));
}

/* ── System banners ── */
.system-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    font-size: 13px;
    margin: -24px -24px 20px -24px;
}
.system-banner-warning {
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    color: #92400e;
}
[data-theme="dark"] .system-banner-warning {
    background: #2d1f00;
    border-bottom-color: #713f12;
    color: #fde68a;
}
.system-banner a {
    font-weight: 600;
    color: inherit;
    text-decoration: underline;
    margin-left: 6px;
}
.system-banner-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.6;
}
.system-banner-close:hover { opacity: 1; }

/* ── Sidebar footer (company switcher) ── */
.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding: 12px;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════ */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    gap: 12px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
}

.card-body {
    padding: 20px;
}


/* ══════════════════════════════════════════════════════
   STATS CARDS
   ══════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon.green  { background: #dcfce7; color: #16a34a; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.orange { background: #ffedd5; color: #ea580c; }
.stat-icon.red    { background: #fee2e2; color: #dc2626; }
.stat-icon.teal   { background: #ccfbf1; color: #0d9488; }
.stat-icon.yellow { background: #fef3c7; color: #d97706; }
.stat-icon.pink   { background: #fce7f3; color: #db2777; }

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

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

.stat-change {
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

.stat-change.up   { color: #16a34a; }
.stat-change.down { color: #dc2626; }

/* ══════════════════════════════════════════════════════
   FEATURE GRID (settings cards)
   ══════════════════════════════════════════════════════ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-muted);
    color: var(--text);
}

.feature-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.feature-card-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.feature-card-icon.green  { background: #dcfce7; color: #16a34a; }
.feature-card-icon.purple { background: #ede9fe; color: #7c3aed; }
.feature-card-icon.orange { background: #ffedd5; color: #ea580c; }
.feature-card-icon.red    { background: #fee2e2; color: #dc2626; }
.feature-card-icon.teal   { background: #ccfbf1; color: #0d9488; }

.feature-card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.feature-card-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ══════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════ */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr {
    transition: background 0.1s;
}

tbody tr:hover { background: var(--bg-hover); }

/* ══════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
    box-shadow: 0 4px 12px rgba(29,78,216,0.25);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
    color: var(--text);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover {
    opacity: 0.9;
    color: #fff;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover {
    opacity: 0.9;
    color: #fff;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    gap: 4px;
}

.btn-lg {
    padding: 11px 24px;
    font-size: 14px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* ══════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger);  }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--info-light);    color: var(--info);    }
.badge-gray    { background: var(--bg-hover);      color: var(--text-muted); }

/* ══════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: 0.1px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-input);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    line-height: 1.5;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder { color: var(--text-light); }

textarea.form-control { resize: vertical; min-height: 80px; }

input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
    color-scheme: light;
    color: var(--text);
}
input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-fields-wrapper,
input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-text,
input[type="time"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-year-field,
input[type="time"]::-webkit-datetime-edit-hour-field,
input[type="time"]::-webkit-datetime-edit-minute-field,
input[type="time"]::-webkit-datetime-edit-ampm-field {
    color: var(--text);
}
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"] {
    color-scheme: dark;
}

select.form-control { appearance: none; cursor: pointer;
    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='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    line-height: 1.5;
}

.alert i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border-color: #a7f3d0;
}
.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
    border-color: #fca5a5;
}
.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
    border-color: #fcd34d;
}
.alert-info {
    background: var(--info-light);
    color: var(--info);
    border-color: #a5f3fc;
}

/* ══════════════════════════════════════════════════════
   PAGE HEADER
   ══════════════════════════════════════════════════════ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.page-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 400;
}

/* ══════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* ── Modal guard strip (unsaved-changes warning) ────── */
.modal-guard-strip {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    white-space: nowrap;
    z-index: 10;
    min-width: 340px;
    max-width: 90vw;
}

@keyframes mgSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes mgShake {
    0%,100% { transform: translateX(calc(-50%)); }
    20%      { transform: translateX(calc(-50% - 6px)); }
    60%      { transform: translateX(calc(-50% + 6px)); }
}

/* ══════════════════════════════════════════════════════
   LANGUAGE & USER MENU DROPDOWNS
   ══════════════════════════════════════════════════════ */
.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
    transition: background 0.1s;
    cursor: pointer;
}

.lang-option:hover  { background: var(--bg-hover); color: var(--text); }
.lang-option.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.1s;
    cursor: pointer;
}

.user-menu-item:hover { background: var(--bg-hover); color: var(--text); }
.user-menu-item i { font-size: 16px; color: var(--text-muted); flex-shrink: 0; }

/* ══════════════════════════════════════════════════════
   HAMBURGER & MOBILE
   ══════════════════════════════════════════════════════ */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text);
    font-size: 22px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.hamburger:hover { background: var(--bg-hover); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}

/* ══════════════════════════════════════════════════════
   THEME SWITCHER
   ══════════════════════════════════════════════════════ */
.theme-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s;
    font-family: inherit;
}
.theme-option:hover  { background: var(--bg-hover); }
.theme-option.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.theme-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   TOPBAR COMPONENTS
   ══════════════════════════════════════════════════════ */

/* Icon button — notifications, language, theme */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
    position: relative;
    flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    font-size: 9.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
    line-height: 1;
}

/* Session pill */
.session-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'Spline Sans Mono', monospace;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: border-color 0.15s ease;
    user-select: none;
}
.session-pill:hover { border-color: var(--primary); }
.session-pill i { font-size: 14px; }

/* User chip */
.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
    border: none;
    transition: background 0.12s ease;
}
.user-chip:hover { background: var(--bg-hover); }
.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.12);
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}
.user-chip-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
}
.user-chip-sub {
    font-size: 10.5px;
    color: var(--text-muted);
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
}

/* ── Unified dropdown system ── */
.dropdown-wrap { position: relative; }
.dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 300;
    overflow: hidden;
    min-width: 160px;
}
.dropdown-panel.open { display: block; }

.dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    position: sticky;
    top: 0;
    z-index: 1;
}
.dropdown-head span,
.dropdown-head a {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}
.link-btn {
    font-size: 11px;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
}
.link-btn:hover { background: var(--primary-light); }

/* Notification panel */
.notif-panel { width: 360px; max-height: 480px; flex-direction: column; }
.notif-panel.open { display: flex; }
.notif-list { overflow-y: auto; padding: 6px; flex: 1; }
.notif-row {
    display: flex;
    gap: 10px;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.12s ease;
    margin-bottom: 2px;
}
.notif-row:hover { background: var(--bg-hover); }
.notif-row.unread { background: var(--primary-light); }
.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
}
.notif-icon i { font-size: 15px; color: var(--primary); }
.notif-title { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-msg { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 5px; }
.notif-empty { text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 12.5px; }

/* Theme panel */
.theme-panel { width: 170px; padding: 6px; }
.theme-panel-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 6px 8px 8px;
}

/* User dropdown panel */
.user-panel { width: 230px; padding: 6px; }
.user-panel-head {
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.user-panel-name { font-size: 13px; font-weight: 700; color: var(--text); }
.user-panel-email { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.user-menu-divider { border-top: 1px solid var(--border); margin: 4px 0; }

/* Page header extras */
.page-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 6px;
}
.page-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Sidebar company switcher */
.sidebar-footer-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sidebar-text, var(--text-muted));
    margin-bottom: 8px;
    padding: 0 4px;
}
.company-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--sidebar-text, var(--text-muted));
    margin-bottom: 2px;
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
}
.company-item:hover { background: var(--sidebar-hover, var(--bg-hover)); color: var(--text); }
.company-item.active { background: var(--bg-hover); color: var(--text); }

/* App footer */
footer.app-footer {
    flex-shrink: 0;
    padding: 16px 24px;
    margin: 0 -24px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
}
footer.app-footer strong { color: var(--text); font-weight: 600; }
footer.app-footer a { color: var(--text-muted); text-decoration: none; }
footer.app-footer a:hover { color: var(--primary); }

/* ══════════════════════════════════════════════════════
   DASHBOARD COMPONENTS
   ══════════════════════════════════════════════════════ */

/* Hero greeting */
.hero {
    position: relative;
    border-radius: var(--radius-lg, 14px);
    padding: 26px 28px;
    margin-bottom: 20px;
    background:
        radial-gradient(circle at 15% 20%, rgba(201,162,39,0.14), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(167,139,250,0.10), transparent 50%),
        var(--bg-surface);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.hero-eyebrow {
    font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--primary); margin-bottom: 6px;
}
.hero-title { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.hero-sub { font-size: 13px; color: var(--text-muted); margin-top: 5px; }
.hero-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* KPI grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease;
    display: block;
    text-decoration: none;
    color: inherit;
}
.kpi-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.kpi-icon {
    width: 34px; height: 34px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kpi-icon i { font-size: 17px; }
.kpi-trend {
    display: flex; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px;
}
.kpi-trend.up  { color: var(--success); background: var(--success-light); }
.kpi-trend.flat { color: var(--text-muted); background: var(--bg-hover); }
.kpi-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 4px;
}
.kpi-value {
    font-family: 'Spline Sans Mono', monospace;
    font-size: 28px; font-weight: 700; letter-spacing: -0.01em; line-height: 1;
    font-variant-numeric: tabular-nums;
}
.kpi-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
.kpi-spark { display: block; width: 100%; margin-top: 12px; height: 26px; }

.c-gold  .kpi-icon { background: var(--primary-light); color: var(--primary); }
.c-gold  .kpi-value { color: var(--primary); }
.c-green .kpi-icon { background: var(--success-light); color: var(--success); }
.c-green .kpi-value { color: var(--success); }
.c-violet .kpi-icon { background: rgba(167,139,250,0.12); color: #A78BFA; }
.c-violet .kpi-value { color: #A78BFA; }
.c-blue  .kpi-icon { background: rgba(96,165,250,0.12); color: var(--info); }
.c-blue  .kpi-value { color: var(--info); }

/* Funnel / quote cards */
.funnel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}
@media (max-width: 768px) { .funnel-grid { grid-template-columns: 1fr; } }
.funnel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-left-color 0.15s ease;
}
.funnel-card:hover { border-left-color: var(--primary); }
.funnel-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 6px;
}
.funnel-value {
    font-family: 'Spline Sans Mono', monospace;
    font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.funnel-sub  { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.funnel-cta  { font-size: 12px; color: var(--primary); margin-top: 4px; font-weight: 600; }

/* Dashboard split layout */
.dash-split {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 14px;
    align-items: start;
    margin-bottom: 16px;
}
@media (max-width: 900px) { .dash-split { grid-template-columns: 1fr; } }

/* Card head — plain title variant used in dashboard */
.card-head span.t, .card-head .t { font-size: 13px; font-weight: 700; color: var(--text); }
.card-head a.more { font-size: 12px; font-weight: 600; color: var(--primary); text-decoration: none; }
.card-head a.more:hover { color: var(--primary-hover); }

/* Table utility classes */
td.code {
    font-family: 'Spline Sans Mono', monospace;
    font-size: 11.5px; color: var(--text-muted); white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
td .row-title { font-weight: 600; font-size: 13px; }
td .row-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
td.num, td.amount {
    text-align: right;
    font-family: 'Spline Sans Mono', monospace;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.status-chip {
    display: inline-block; padding: 3px 9px; border-radius: 6px;
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
}
.status-draft    { background: var(--bg-hover);     color: var(--text-muted); }
.status-pending  { background: var(--warning-light); color: var(--warning); }
.status-approved { background: var(--success-light); color: var(--success); }
.status-invoiced { background: rgba(167,139,250,0.12); color: #A78BFA; }

/* Activity / pending feed */
.feed-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 28px 16px;
    color: var(--text-muted); text-align: center;
}
.feed-empty i { font-size: 26px; margin-bottom: 8px; color: var(--success); }
.feed-empty span { font-size: 12.5px; }
.feed-item {
    display: flex; gap: 10px; padding: 12px 18px;
    border-bottom: 1px solid var(--border-light);
}
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.feed-text { font-size: 12.5px; }
.feed-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* System health */
.health-grid { display: grid; grid-template-columns: 1fr 1fr; }
.health-col  { padding: 16px 20px; }
.health-col + .health-col { border-left: 1px solid var(--border); }
.health-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 10px;
}
.health-figure { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.health-pct    { font-family: 'Spline Sans Mono', monospace; font-size: 22px; font-weight: 700; }
.health-detail { font-size: 11.5px; color: var(--text-muted); }
.health-bar  { background: var(--bg-hover); border-radius: 5px; height: 8px; overflow: hidden; }
.health-fill { height: 8px; border-radius: 5px; width: 0%; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.health-breakdown { margin-top: 14px; display: flex; flex-direction: column; gap: 5px; }
.health-breakdown-row { display: flex; justify-content: space-between; font-size: 11.5px; }
.health-breakdown-row span:first-child { color: var(--text-muted); }
.health-breakdown-row span:last-child  {
    color: var(--text); font-weight: 600;
    font-family: 'Spline Sans Mono', monospace; font-size: 11px;
}
.backup-status { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.backup-dot {
    width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--success-light);
}

/* Dashboard fade-up animation */
@keyframes dashFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero, .kpi-card, .funnel-card, .dash-split, .health-card {
    animation: dashFadeUp 0.4s ease backwards;
}
.kpi-card:nth-child(1) { animation-delay: 0.02s; }
.kpi-card:nth-child(2) { animation-delay: 0.06s; }
.kpi-card:nth-child(3) { animation-delay: 0.10s; }
.kpi-card:nth-child(4) { animation-delay: 0.14s; }

/* ══════════════════════════════════════════════════════
   INVOICE / DOCUMENT LAYOUT
   ══════════════════════════════════════════════════════ */

/* Document page cap */
.doc-sheet { max-width: 960px; }

/* Header row: title left, status + actions right */
.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    gap: 20px;
}
.doc-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 6px;
}
.doc-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.01em;
    font-family: 'Spline Sans Mono', monospace;
}
.doc-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Status pills (replaces old badge in doc context) */
.doc-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.doc-status::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.doc-status-draft    { background: var(--bg-hover);      color: var(--text-muted); border: 1px solid var(--border); }
.doc-status-sent     { background: var(--info-light);    color: var(--info);       border: 1px solid var(--info); }
.doc-status-partial  { background: var(--warning-light); color: var(--warning);    border: 1px solid var(--warning); }
.doc-status-paid     { background: var(--success-light); color: var(--success);    border: 1px solid var(--success); }
.doc-status-overdue  { background: var(--danger-light);  color: var(--danger);     border: 1px solid var(--danger); }
.doc-status-cancelled{ background: var(--bg-hover);      color: var(--text-muted); border: 1px solid var(--border); }
.doc-status-credited { background: rgba(167,139,250,0.12); color: #A78BFA;         border: 1px solid #A78BFA; }

/* Right-side actions group */
.doc-header-end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

/* 4-field metadata strip */
.doc-meta-fields {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
.doc-meta-field {
    padding: 12px 16px;
    border-right: 1px solid var(--border);
}
.doc-meta-field:last-child { border-right: none; }
.doc-meta-field .field-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.doc-meta-field .field-val {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}
.doc-meta-field .field-val.mono {
    font-family: 'Spline Sans Mono', monospace;
    font-variant-numeric: tabular-nums;
}

/* Totals wrap — global (not just Pro Dark) */
.totals-wrap {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
    margin-bottom: 20px;
}
@media (max-width: 768px) { .totals-wrap { grid-template-columns: 1fr; } }

.notes-area {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.notes-area .form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.notes-area p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Global ledger (used in detail + create for all themes) */
.ledger {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.ledger-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-light);
}
.ledger-row:last-child { border-bottom: none; }
.ledger-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.ledger-val {
    font-family: 'Spline Sans Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}
.ledger-divider {
    margin: 4px 20px;
    border: none;
    border-top: 1px dashed var(--border);
}
.ledger-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 18px 20px 20px;
    background: linear-gradient(180deg, transparent 0%, var(--primary-light) 100%);
}
.ledger-total .ledger-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
}
.ledger-total .ledger-val {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

/* Document actions bar */
.doc-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.doc-actions .btn { padding: 11px 18px; }
.doc-actions .doc-actions-primary { flex: 1; justify-content: center; }

/* Timeline */
.timeline { padding: 4px 0; }
.timeline-event {
    display: flex;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-light);
}
.timeline-event:last-child { border-bottom: none; }
.timeline-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.timeline-dot i { font-size: 13px; color: #fff; }
.timeline-label { font-size: 13px; font-weight: 500; color: var(--text); }
.timeline-meta  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Payment row in timeline */
.pay-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 13px;
}
.pay-row-amount { font-weight: 600; font-family: 'Spline Sans Mono', monospace; }
.pay-row-meta   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ══════════════════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ══════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ══════════════════════════════════════════════════════ */

/* ── Sidebar-hide mixin applied across breakpoints ── */
/* Covers: phones (any orientation), small tablets, landscape phones,
   and ALL portrait-mode screens up to 1280px (tablets in portrait). */
@media (max-width: 1024px),
       (orientation: portrait) and (max-width: 1280px) {
    .hamburger { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 101;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }

    .main { margin-left: 0; }

    .topbar { padding: 0 12px; gap: 8px; }

    .content { padding: 12px; }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .feature-grid { grid-template-columns: 1fr; }

    .modal { padding: 20px; border-radius: var(--radius-lg); }

    .btn { font-size: 12px; padding: 8px 14px; min-height: 38px; }
    .btn-sm { padding: 6px 10px; font-size: 11px; min-height: 32px; }

    .hide-mobile { display: none !important; }

    thead th, tbody td { padding: 8px 10px; }

    /* Tables scroll within their container */
    .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .card table { min-width: max-content; }
}

/* ── Landscape phones (wide but short) ── */
@media (max-width: 932px) and (max-height: 450px) {
    .hamburger { display: flex; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main { margin-left: 0; }
    .content { padding: 8px 12px; }
    .topbar { padding: 0 12px; }
}

/* ── Small phones ── */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 17px; }
    .content { padding: 8px; }
    /* Filter bars stack vertically, each full-width */
    form[id$="-filter-form"] > * { flex: 1 1 100%; min-width: 0; }
    form[id$="-filter-form"] .btn,
    form[id$="-filter-form"] a.btn { flex: 0 0 auto; }
    /* Modal fills screen */
    .modal-box, .modal { max-width: 100% !important; width: 100% !important; border-radius: var(--radius-md) var(--radius-md) 0 0 !important; }
    .modal-overlay { align-items: flex-end; }
}

/* ── Topbar actions (right side) ── */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Topbar actions (right side) ── */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Extra icon colors ── */
.stat-icon.indigo,
.feature-card-icon.indigo { background: #e0e7ff; color: #4338ca; }
.stat-icon.amber,
.feature-card-icon.amber  { background: #fef3c7; color: #d97706; }
.stat-icon.cyan,
.feature-card-icon.cyan   { background: #cffafe; color: #0891b2; }
.stat-icon.rose,
.feature-card-icon.rose   { background: #ffe4e6; color: #e11d48; }

/* ── Sidebar submenu animation ── */

    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

/* ── Sidebar submenus ── */
.submenu-items {
    margin-bottom: 4px;
}

.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 34px;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--sidebar-text);
    transition: color 0.15s;
}

.nav-sub-item i {
    font-size: 14px;
    color: var(--sidebar-icon);
    transition: color 0.15s;
}

.nav-sub-item:hover {
    color: var(--sidebar-text-active);
}

.nav-sub-item:hover i {
    color: var(--sidebar-icon-active);
}

.nav-sub-item.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-sub-item.active i {
    color: var(--primary);
}






/* ── View Transitions ── */
@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: 0.15s ease both fade-out;
}

::view-transition-new(root) {
    animation: 0.2s ease both fade-in;
}

@keyframes fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Slide Toggle (replaces checkboxes) ── */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle-wrap input[type="checkbox"] {
    display: none;
}

.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--border);
    border-radius: 11px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-wrap input:checked + .toggle {
    background: var(--primary);
}

.toggle-wrap input:checked + .toggle::after {
    transform: translateX(18px);
}

.toggle-wrap input:disabled + .toggle {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-label {
    font-size: 13px;
    color: var(--text);
}

.toggle-sm .toggle {
    width: 32px;
    height: 18px;
    border-radius: 9px;
}

.toggle-sm .toggle::after {
    width: 12px;
    height: 12px;
    top: 3px;
    left: 3px;
}

.toggle-sm input:checked + .toggle::after {
    transform: translateX(14px);
}

/* ── Toast Notifications ── */
#toast-container {
    position: fixed;
    top: calc(var(--topbar-h) + 12px);
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.65);
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.6);
    min-width: 280px;
    max-width: 400px;
    pointer-events: all;
    animation: toast-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

[data-theme="dark"] .toast {
    background: rgba(30,33,48,0.75);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

.toast.toast-out {
    animation: toast-out 0.3s ease forwards;
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.toast-success .toast-icon { background: var(--success-light); color: var(--success); }
.toast-danger  .toast-icon { background: var(--danger-light);  color: var(--danger);  }
.toast-warning .toast-icon { background: var(--warning-light); color: var(--warning); }
.toast-info    .toast-icon { background: #eff6ff;              color: var(--primary); }

.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 13px; font-weight: 600; color: var(--text); }
.toast-msg   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
    flex-shrink: 0;
    font-size: 14px;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100%); }
}

/* Search dropdown */
.search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    z-index: 99;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.addr-search-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}
.addr-search-item:hover {
    background: var(--bg-subtle);
}
