/* Aplyd — Modern SaaS Dashboard (Gen-Z Era) */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: dark;
    /* ── Background System ── */
    --bg: #060918;
    --bg-subtle: #0a0d1a;
    --bg-card: rgba(14,18,35,0.7);
    --bg-card-solid: #0e1223;
    --bg-card-hover: rgba(20,26,48,0.8);
    --bg-card-inner: rgba(8,12,25,0.6);
    --bg-elevated: rgba(22,28,52,0.9);

    /* ── Border System ── */
    --border: rgba(148,163,184,0.08);
    --border-hover: rgba(148,163,184,0.16);
    --border-card: rgba(148,163,184,0.1);
    --border-glow: rgba(6,182,212,0.2);

    /* ── Text System ── */
    --text: #e2e8f0;
    --text-secondary: rgba(226,232,240,0.6);
    --text-muted: rgba(226,232,240,0.35);
    --text-bright: #f8fafc;

    /* ── Multi-Color Accent System ── */
    --cyan: #06b6d4;
    --cyan-light: #22d3ee;
    --cyan-dim: rgba(6,182,212,0.12);
    --cyan-glow: rgba(6,182,212,0.2);

    --purple: #8b5cf6;
    --purple-light: #a78bfa;
    --purple-dim: rgba(139,92,246,0.12);
    --purple-glow: rgba(139,92,246,0.2);

    --blue: #3b82f6;
    --blue-light: #60a5fa;
    --blue-dim: rgba(59,130,246,0.12);

    --amber: #f59e0b;
    --amber-light: #fbbf24;
    --amber-dim: rgba(245,158,11,0.12);

    --emerald: #10b981;
    --emerald-light: #34d399;
    --emerald-dim: rgba(16,185,129,0.12);

    --rose: #f43f5e;
    --rose-light: #fb7185;
    --rose-dim: rgba(244,63,94,0.12);

    --orange: #f97316;
    --orange-dim: rgba(249,115,22,0.12);

    /* ── Layout ── */
    --sidebar-width: 240px;
    --radius: 16px;
    --radius-sm: 10px;

    /* ── Status Colors ── */
    --evaluated: var(--purple);
    --evaluated-dim: var(--purple-dim);
    --applied: var(--blue);
    --applied-dim: var(--blue-dim);
    --responded: var(--cyan);
    --responded-dim: var(--cyan-dim);
    --interview: var(--amber);
    --interview-dim: var(--amber-dim);
    --offer: var(--emerald);
    --offer-dim: var(--emerald-dim);
    --rejected: var(--rose);
    --rejected-dim: var(--rose-dim);
    --ghosted: rgba(255,255,255,0.18);
    --ghosted-dim: rgba(255,255,255,0.04);
    --skip: rgba(255,255,255,0.12);
    --discarded: rgba(255,255,255,0.12);

    /* ── Gradients ── */
    --grad-primary: linear-gradient(135deg, #06b6d4, #8b5cf6);
    --grad-warm: linear-gradient(135deg, #f97316, #f43f5e);
    --grad-cool: linear-gradient(135deg, #3b82f6, #06b6d4);
    --grad-success: linear-gradient(135deg, #10b981, #06b6d4);
    --grad-card-border: linear-gradient(135deg, rgba(6,182,212,0.3), rgba(139,92,246,0.15), rgba(148,163,184,0.05));
    --grad-card-border-hover: linear-gradient(135deg, rgba(6,182,212,0.5), rgba(139,92,246,0.3), rgba(148,163,184,0.1));
    --grad-bg-mesh: radial-gradient(ellipse at 20% 0%, rgba(6,182,212,0.07) 0%, transparent 50%),
                     radial-gradient(ellipse at 80% 100%, rgba(139,92,246,0.05) 0%, transparent 50%),
                     radial-gradient(ellipse at 50% 50%, rgba(59,130,246,0.03) 0%, transparent 70%);

    /* ── Shared ── */
    --success: var(--emerald);
    --success-dim: var(--emerald-dim);
    --error: var(--rose);
    --error-dim: var(--rose-dim);
    --warning: var(--amber);
    --warning-dim: var(--amber-dim);
    --info: var(--blue);
    --info-dim: var(--blue-dim);

    /* ── Spacing scale (4px base) ──
       Use these instead of ad-hoc rem values so vertical/horizontal rhythm
       snaps to a grid. New code should prefer these tokens; existing inline
       styles will migrate over time. */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --blur: blur(20px) saturate(180%);

    /* ── Shadows (multi-layer depth) ── */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2), 0 1px 3px rgba(0,0,0,0.15);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.15), 0 4px 8px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.1), 0 16px 32px rgba(0,0,0,0.15), 0 32px 64px rgba(0,0,0,0.1);
    --shadow-glow-cyan: 0 0 20px rgba(6,182,212,0.15), 0 0 40px rgba(6,182,212,0.05);
    --shadow-glow-purple: 0 0 20px rgba(139,92,246,0.15), 0 0 40px rgba(139,92,246,0.05);
}

/* ═══════════════ Light Theme - Professional White UI ═══════════════ */
html.light {
    color-scheme: light;
    /* Backgrounds */
    --bg: #f1f5f9;
    --bg-subtle: #e2e8f0;
    --bg-card: #ffffff;
    --bg-card-solid: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-card-inner: #f8fafc;
    --bg-elevated: #ffffff;
    /* Borders */
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-card: #e2e8f0;
    --border-glow: rgba(6,182,212,0.25);
    /* Text - stronger contrast for readability */
    --text: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-bright: #020617;
    /* Status dims - light backgrounds for badges/tags */
    --cyan-dim: rgba(6,182,212,0.1);
    --purple-dim: rgba(139,92,246,0.1);
    --blue-dim: rgba(59,130,246,0.1);
    --amber-dim: rgba(245,158,11,0.1);
    --emerald-dim: rgba(16,185,129,0.1);
    --rose-dim: rgba(244,63,94,0.1);
    --orange-dim: rgba(249,115,22,0.1);
    /* Misc */
    --ghosted: rgba(0,0,0,0.08);
    --ghosted-dim: rgba(0,0,0,0.03);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.06), 0 4px 6px rgba(0,0,0,0.04);
    --shadow-glow-cyan: 0 0 15px rgba(6,182,212,0.1);
    --shadow-glow-purple: 0 0 15px rgba(139,92,246,0.1);
    --grad-bg-mesh: none;
}
/* Light sidebar - clean white with colored accents (Dribbble-style) */
html.light .sidebar {
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.03);
}
html.light .sidebar-header { background: none; }
html.light .sidebar-header .logo { color: #0f172a; }
html.light .sidebar-header .logo-icon { background: linear-gradient(135deg, #06b6d4, #8b5cf6); color: #fff; }
html.light .sidebar-header .subtitle { color: #94a3b8; }
html.light .sidebar .nav-links li a {
    color: #475569;
    border-radius: 10px;
}
html.light .sidebar .nav-links li a:hover {
    color: #0f172a;
    background: #f1f5f9;
}
html.light .sidebar .nav-links li a.active {
    color: #0891b2;
    background: linear-gradient(135deg, rgba(6,182,212,0.08), rgba(139,92,246,0.05));
    font-weight: 700;
    box-shadow: inset 3px 0 0 #06b6d4;
}
html.light .sidebar .nav-links li a .nav-icon { stroke: #64748b; }
html.light .sidebar .nav-links li a:hover .nav-icon { stroke: #0f172a; }
html.light .sidebar .nav-links li a.active .nav-icon { stroke: #0891b2; }
html.light .sidebar .nav-group-label { color: #94a3b8; }
html.light .sidebar-footer { color: #cbd5e1; }
html.light .sidebar-footer .version { color: #cbd5e1; }

/* Top bar */
html.light .top-bar { background: #ffffff; border-bottom: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
html.light .top-bar input { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }
html.light .top-bar input::placeholder { color: #94a3b8; }

/* Cards */
html.light .card { background: #ffffff; border: 1px solid #e2e8f0; box-shadow: var(--shadow-sm); }
html.light .card:hover { box-shadow: var(--shadow-md); }
html.light .card-header { border-bottom-color: #e2e8f0; }
html.light .card-title { color: #0f172a; font-weight: 700; }
html.light label { color: #334155; font-weight: 600; }

/* KPI cards */
html.light .kpi-card { background: #ffffff; border: 1px solid #e2e8f0; box-shadow: var(--shadow-sm); }
html.light .kpi-value { color: #0f172a; }
html.light .kpi-label { color: #64748b; }
html.light .kpi-icon { opacity: 0.9; }

/* Forms */
html.light input, html.light select, html.light textarea {
    background: #ffffff; border: 1px solid #cbd5e1; color: #1e293b; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
html.light input:focus, html.light select:focus, html.light textarea:focus {
    border-color: #06b6d4; box-shadow: 0 0 0 3px rgba(6,182,212,0.1);
}

/* Tables */
html.light table { border-color: #e2e8f0; }
html.light th { background: #f1f5f9; color: #0f172a; border-bottom: 2px solid #cbd5e1; font-weight: 700; }
html.light td { border-bottom: 1px solid #e2e8f0; color: #1e293b; }
html.light tbody tr:nth-child(even) td { background: #fafbfc; }
html.light tr:hover td { background: #f8fafc; }

/* Badges */
html.light .badge { border: none; }
html.light .badge-offer { background: #ecfdf5; color: #059669; }
html.light .badge-responded { background: #ecfeff; color: #0891b2; }
html.light .badge-evaluated { background: #f3e8ff; color: #7c3aed; }
html.light .badge-ghosted { background: #f1f5f9; color: #64748b; }

/* Alerts */
html.light .alert-banner { background: #ffffff !important; box-shadow: var(--shadow-sm); }

/* Buttons */
html.light .btn { background: #ffffff; border-color: #e2e8f0; color: #1e293b; }
html.light .btn:hover { background: #f1f5f9; border-color: #06b6d4; color: #0f172a; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
html.light .btn-primary { background: linear-gradient(135deg, #06b6d4, #3b82f6); color: #ffffff !important; border-color: transparent; }
html.light .btn-primary:hover { background: linear-gradient(135deg, #0891b2, #2563eb); color: #ffffff !important; box-shadow: 0 4px 12px rgba(6,182,212,0.25); }
html.light .btn-outline { border-color: #cbd5e1; color: #334155; background: transparent; }
html.light .btn-outline:hover { border-color: #06b6d4; color: #0891b2; background: rgba(6,182,212,0.06); }

/* Modals */
html.light .modal-overlay { background: rgba(15,23,42,0.4); backdrop-filter: blur(4px); }
html.light .modal-box { background: #ffffff; border: 1px solid #e2e8f0; box-shadow: var(--shadow-lg); }
html.light .modal-header { border-bottom: 1px solid #f1f5f9; }
html.light .modal-footer { border-top: 1px solid #f1f5f9; }

/* Dropdowns */
html.light .topbar-dropdown { background: #ffffff; border: 1px solid #e2e8f0; box-shadow: var(--shadow-lg); }
html.light .dropdown-item:hover { background: #f8fafc; }

/* Loading */
html.light .loading-overlay { background: rgba(248,250,252,0.95); }
html.light .spinner { border-color: rgba(6,182,212,0.2); border-top-color: #06b6d4; }

/* Auth pages - full light theme */
html.light .auth-body {
    background: #f1f5f9;
    background-image:
        radial-gradient(ellipse at 30% 20%, rgba(6,182,212,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(139,92,246,0.04) 0%, transparent 50%);
}
html.light .auth-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    backdrop-filter: none;
}
html.light .auth-card::before { background: linear-gradient(135deg, #06b6d4, #8b5cf6); }
html.light .auth-header .logo { color: #0f172a; -webkit-text-fill-color: #0f172a; background: none; }
html.light .auth-form label { color: #475569; }
html.light .auth-form input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}
html.light .auth-form input:focus {
    border-color: #06b6d4;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(6,182,212,0.1);
}
html.light .auth-form input::placeholder { color: #94a3b8; }
html.light .auth-footer { border-color: #e2e8f0; }
html.light .auth-footer a { color: #0891b2; }
html.light .alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Onboarding wizard - full light theme */
html.light body.wizard-body {
    background: #f1f5f9;
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(6,182,212,0.04) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(139,92,246,0.03) 0%, transparent 50%);
}
html.light .wizard-brand .logo {
    background: none !important;
    -webkit-text-fill-color: #0f172a !important;
    color: #0f172a;
}
html.light .wizard-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    backdrop-filter: none;
}
html.light .wizard-card::before { display: none; }
html.light .step-dot {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #94a3b8;
}
html.light .wizard-progress-step.active .step-dot {
    background: rgba(6,182,212,0.06);
    border-color: #06b6d4;
    color: #06b6d4;
    box-shadow: 0 0 12px rgba(6,182,212,0.2);
}
html.light .wizard-progress-step.completed .step-dot {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}
html.light .step-title { color: #0f172a; -webkit-text-fill-color: #0f172a; background: none !important; }
html.light .step-subtitle { color: #64748b; }
html.light .step-container label { color: #475569; }
html.light .step-container input,
html.light .step-container select,
html.light .step-container textarea {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}
html.light .step-container input:focus,
html.light .step-container select:focus,
html.light .step-container textarea:focus {
    border-color: #06b6d4;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(6,182,212,0.1);
}

/* Charts - ensure canvas areas have proper background */
html.light canvas { filter: none; }

/* Scrollbar */
html.light ::-webkit-scrollbar-thumb { background: #cbd5e1; }
html.light ::-webkit-scrollbar-track { background: #f1f5f9; }

/* Page header */
html.light .page-header h1 { color: #0f172a; }
html.light .page-subtitle { color: #64748b; }

/* Empty states */
html.light .empty-state .empty-icon { background: #f8fafc; border: 1px solid #e2e8f0; }

/* PWA banner */
html.light #pwa-install-banner { background: #ffffff; border-color: #06b6d4; box-shadow: var(--shadow-lg); }

/* ── Google-style: nuke ALL remaining dark bleed ── */

/* KPI cards - white with colored top border instead of dark gradient */
html.light .kpi-card[data-color] { background: #ffffff !important; border-top: 3px solid; }
html.light .kpi-card[data-color="cyan"] { border-top-color: #06b6d4; }
html.light .kpi-card[data-color="emerald"] { border-top-color: #10b981; }
html.light .kpi-card[data-color="blue"] { border-top-color: #3b82f6; }
html.light .kpi-card[data-color="purple"] { border-top-color: #8b5cf6; }
html.light .kpi-card[data-color="amber"] { border-top-color: #f59e0b; }
html.light .kpi-card[data-color="rose"] { border-top-color: #f43f5e; }
html.light .kpi-card .kpi-icon { background: #f8fafc !important; }

/* Progress bars - lighter track */
html.light [style*="background: rgba(255,255,255,0.06)"],
html.light [style*="background:rgba(255,255,255,0.06)"] { background: #e2e8f0 !important; }

/* Any inline dark backgrounds */
html.light [style*="background: var(--bg-card-inner)"] { background: #f8fafc !important; }
html.light [style*="background:var(--bg-card-inner)"] { background: #f8fafc !important; }
html.light [style*="background: var(--bg-card)"] { background: #ffffff !important; }
html.light [style*="background: var(--bg)"] { background: #f1f5f9 !important; }

/* Chart containers */
html.light .chart-row .card { background: #ffffff; }
html.light canvas { background: transparent !important; }

/* Gradient text - make it solid color in light */
html.light [style*="-webkit-text-fill-color: transparent"] {
    -webkit-text-fill-color: #0891b2 !important;
    background: none !important;
}
/* Bottom tab bar + More sheet — light theme */
html.light .bottom-tab-bar { background: #ffffff; border-top-color: #e2e8f0; box-shadow: 0 -2px 12px rgba(0,0,0,0.04); }
html.light .more-sheet-content { background: #ffffff; }
html.light .more-sheet-item:active { background: #f1f5f9; }

/* Version badge in sidebar footer */
html.light .sidebar-footer .version { color: rgba(226,232,240,0.25); }

/* Profile completion banner - white card style */
html.light [style*="border: 1px solid rgba(245,158,11"] {
    background: #ffffff !important;
    border-color: #fbbf24 !important;
    box-shadow: var(--shadow-sm);
}

/* Tier badges in sidebar - ensure readable */
html.light .nav-links .badge,
html.light .nav-links span[style*="background: var(--amber-dim)"],
html.light .nav-links span[style*="background: var(--cyan-dim)"],
html.light .nav-links span[style*="background: var(--emerald-dim)"] {
    opacity: 1;
}

/* Feature cards with colored backgrounds - ensure light versions */
html.light [style*="background: rgba(6,182,212,0.08)"] { background: #ecfeff !important; }
html.light [style*="background: rgba(16,185,129,0.08)"] { background: #ecfdf5 !important; }
html.light [style*="background: rgba(139,92,246,0.08)"] { background: #f5f3ff !important; }
html.light [style*="background: rgba(245,158,11,0.08)"] { background: #fffbeb !important; }
html.light [style*="background: rgba(244,63,94,0.08)"] { background: #fff1f2 !important; }
html.light [style*="background: rgba(59,130,246,0.08)"] { background: #eff6ff !important; }

/* Inline rgba borders - solidify */
html.light [style*="border: 1px solid var(--border)"] { border-color: #e2e8f0 !important; }
html.light [style*="border-bottom: 1px solid var(--border)"] { border-color: #e2e8f0 !important; }

/* Main content area - ensure clean white/gray */
html.light main { background: #f1f5f9; }
html.light .page-content { background: #f1f5f9; }

/* Filter tabs */
html.light .filter-tab { background: #ffffff; border-color: #e2e8f0; color: #1e293b; font-weight: 600; }
html.light .filter-tab.active { background: #0891b2; color: #ffffff; border-color: #0891b2; }

/* Kanban columns */
html.light .kanban-column { background: #f8fafc; border-color: #e2e8f0; }

/* Code blocks */
html.light code { background: #f1f5f9; color: #0891b2; }

/* ── Fix 1: Gradient text headings → solid dark in light mode ── */
html.light h1, html.light h2 {
    -webkit-text-fill-color: currentColor !important;
    background: none !important;
    color: #0f172a;
}
html.light .page-header h1 { color: #0f172a !important; }

/* ── Fix 2: Profile completion banner → clean white card ── */
html.light [style*="border: 1px solid rgba(245,158,11"] {
    background: #ffffff !important;
    border: 1px solid #fbbf24 !important;
    border-left: 4px solid #f59e0b !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}

/* ── Fix 3: All white-alpha backgrounds → visible gray in light ── */
html.light [style*="background: rgba(255,255,255,0.0"],
html.light [style*="background:rgba(255,255,255,0.0"],
html.light [style*="background: rgba(255,255,255,0.1"],
html.light [style*="background:rgba(255,255,255,0.1"] {
    background: #e2e8f0 !important;
}
/* Hover variants */
html.light [onmouseover*="rgba(255,255,255"] { --hover-bg: #f1f5f9; }

/* ── Fix 4: CV Review upload zone → visible dashed border ── */
html.light [style*="border: 2px dashed rgba(6,182,212"] {
    border-color: #06b6d4 !important;
    background: rgba(6,182,212,0.03) !important;
}

/* ── Fix 5: Pricing/tier cards → white bg ── */
html.light [style*="background: var(--bg-card-inner)"] { background: #f8fafc !important; }
html.light .card [style*="background: var(--bg-card)"] { background: #ffffff !important; }

/* ── Fix 6: Empty state backgrounds ── */
html.light .empty-state { background: transparent; }
html.light .empty-state .empty-icon { background: #f8fafc !important; }

/* ── Fix 7: KPI value centered, label stays near icon ── */

/* ── Misc light fixes ── */
html.light [style*="color: var(--text-bright)"] { color: #0f172a !important; }
html.light [style*="color: var(--text-secondary)"] { color: #334155 !important; }
html.light [style*="color: var(--text-muted)"] { color: #64748b !important; }
html.light [style*="border-bottom: 1px solid var(--border)"] { border-color: #e2e8f0 !important; }

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    min-height: 100vh;
    font-size: 13.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--cyan); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--cyan-light); }

::selection { background: rgba(6,182,212,0.3); color: var(--text-bright); }

/* ═══════════════════════ SIDEBAR ═══════════════════════ */
.sidebar {
    width: 240px;
    background: var(--bg-subtle);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sidebar-header {
    padding: 1.3rem 1.2rem 1.1rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(6,182,212,0.05) 0%, transparent 100%);
}
.sidebar-header .logo {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-bright);
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.sidebar-header .logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--grad-primary);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow: var(--shadow-glow-cyan);
}
.sidebar-header .subtitle {
    font-size: 0.58rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
    margin-left: 2.55rem;
}
.nav-links {
    list-style: none;
    padding: 0.6rem 0.55rem;
    flex: 1;
    overflow-y: auto;
}
.nav-links::-webkit-scrollbar { width: 2px; }
.nav-links::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
.nav-links li { margin-bottom: 2px; }
.nav-links li a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    position: relative;
}
.nav-links li a:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text);
}
.nav-links li a.active {
    background: linear-gradient(135deg, var(--cyan-dim), var(--purple-dim));
    color: var(--cyan-light);
    border: 1px solid rgba(6,182,212,0.2);
    box-shadow: 0 0 12px rgba(6,182,212,0.08);
}
.nav-links li a.active::before {
    content: '';
    position: absolute;
    left: -0.55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--grad-primary);
    border-radius: 0 3px 3px 0;
}
.nav-links .nav-icon {
    width: 18px;
    height: 18px;
    opacity: 0.5;
    flex-shrink: 0;
    stroke-width: 1.8;
}
.nav-links li a.active .nav-icon { opacity: 1; }
.nav-links li a:hover .nav-icon { opacity: 0.8; }
.nav-group-label {
    padding: 0.7rem 0.85rem 0.25rem;
    font-size: 0.66rem;       /* was 0.52rem (~7px, unreadable) */
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.3px;
    pointer-events: none;
    font-weight: 700;
}
.sidebar-footer {
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.15);
}
.sidebar-footer .version {
    font-size: 0.58rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* ═══════════════════════ MAIN CONTENT ═══════════════════════ */
main {
    margin-left: 240px;
    padding: 0;
    flex: 1;
    height: 100vh;
    max-width: calc(100vw - 240px);
    overflow-x: hidden;
    overflow-y: auto;
    background-image: var(--grad-bg-mesh);
    background-attachment: fixed;
}

/* ═══════════════════════ TOP BAR ═══════════════════════ */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1.8rem;
    border-bottom: 1px solid var(--border);
    background: rgba(6,9,24,0.8);
    backdrop-filter: var(--blur);
    position: sticky;
    top: 0;
    z-index: 50;
}
.search-box input {
    width: 340px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    padding: 0.42rem 0.8rem 0.42rem 2.2rem;
    border-radius: 100px;
    font-size: 0.78rem;
    color: var(--text);
    font-family: inherit;
    transition: all var(--transition);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(226,232,240,0.3)' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
}
.search-box input:focus {
    outline: none;
    border-color: var(--cyan-glow);
    box-shadow: 0 0 0 3px var(--cyan-dim), var(--shadow-glow-cyan);
    background-color: rgba(255,255,255,0.06);
}
.search-box input::placeholder { color: var(--text-muted); }
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.top-bar-user {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.25rem 0.7rem 0.25rem 0.25rem;
    border-radius: 100px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.top-bar-user:hover { background: rgba(255,255,255,0.06); border-color: var(--border-hover); }
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    box-shadow: 0 0 8px rgba(6,182,212,0.3);
}

/* ═══════════════════════ PAGE CONTENT ═══════════════════════ */
.page-content { padding: 1.5rem 1.8rem 2rem; }

/* ═══════════════════════ PAGE HEADER ═══════════════════════ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.6rem;        /* bumped from 1.4rem for stronger hierarchy */
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-bright);
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-header .page-subtitle {
    font-size: 0.88rem;       /* was 0.82rem */
    color: var(--text-secondary); /* was text-muted (failed contrast) */
    margin-top: 4px;
    font-weight: 400;
}

/* ═══════════════════════ ALERT BANNER ═══════════════════════ */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 1.2rem;
    margin-bottom: 1.2rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(6,182,212,0.08), rgba(139,92,246,0.06));
    border: 1px solid rgba(6,182,212,0.15);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 30px rgba(6,182,212,0.05);
}
.alert-banner .banner-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: var(--shadow-glow-cyan);
}
.alert-banner .banner-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}
.alert-banner .banner-text { color: var(--text-secondary); font-size: 0.82rem; }

/* ═══════════════════════ CARDS (3D Glassmorphism) ═══════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(12px) saturate(150%);
    transition: all var(--transition);
    overflow: hidden;
    min-width: 0;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.card:hover { box-shadow: var(--shadow-md); }
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: var(--grad-card-border);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.5;
    transition: opacity var(--transition);
}
.card:hover::before { opacity: 1; }
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
}
/* When card has no padding, header is first child and needs own spacing */
.card[style*="padding: 0"] > .card-header,
.card[style*="padding:0"] > .card-header {
    padding-top: 1rem;
}
/* Card title — sentence-case heading, not a microcap label.
   Was 0.68rem uppercase letter-spaced (looked like a footnote);
   now reads as a section heading. */
.card-title {
    font-size: 0.92rem;
    color: var(--text-bright);
    font-weight: 700;
    letter-spacing: -0.1px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-transform: none;
}
/* Eyebrow — opt-in for the legitimate uppercase-label use case
   (e.g. "STEP 1 OF 6", "REQUIRED" etc.) */
.card-eyebrow {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 700;
}
.card-title .ct-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--grad-primary);
    box-shadow: 0 0 6px rgba(6,182,212,0.3);
    box-shadow: 0 0 6px rgba(6,182,212,0.4);
}
.card-action {
    font-size: 0.72rem;
    color: var(--cyan);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.card-action:hover { color: var(--cyan-light); gap: 0.5rem; }

/* ═══════════════════════ KPI GRID ═══════════════════════ */
/* Overflow-safe redesign: vertical stack, fluid value sizing via clamp(),
   min-width:0 + overflow:hidden so 7-digit numbers ($1,234,567.89) don't
   crowd labels. Wider minmax (180px) so fewer cards squeeze into a row. */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem 0.95rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    /* 2-row grid: row 1 = icon + label (uses the previously wasted space
       beside the icon); row 2 = value spanning full width so 7-digit
       numbers still have room to breathe. */
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.6rem;
    row-gap: 0.35rem;
    align-items: center;
    min-width: 0;
}
.kpi-card > * { min-width: 0; }
.kpi-card > .kpi-top,
.kpi-card > .kpi-icon-box { grid-column: 1; grid-row: 1; }
.kpi-card > .kpi-label { grid-column: 2; grid-row: 1; align-self: center; margin: 0; }
.kpi-card > .kpi-value { grid-column: 1 / -1; grid-row: 2; text-align: center; }
.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--kpi-gradient, var(--grad-primary));
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 20px var(--kpi-glow, rgba(6,182,212,0.08));
    border-color: var(--border-hover);
}
.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0;
    min-width: 0;
}
.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kpi-icon-bg, var(--cyan-dim));
    box-shadow: 0 0 12px var(--kpi-glow, rgba(6,182,212,0.1));
    flex-shrink: 0;
}
.kpi-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--kpi-color, var(--cyan));
    stroke-width: 1.8;
}
.kpi-icon-box {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kpi-icon-bg, var(--cyan-dim));
    flex-shrink: 0;
}
.kpi-icon-box svg {
    width: 15px;
    height: 15px;
    stroke: var(--kpi-color, var(--cyan));
    stroke-width: 1.8;
}
.kpi-value {
    font-size: clamp(1.2rem, 1.8vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.1;
    color: var(--text-bright);
    /* Truncate gracefully if a value is wildly long */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.kpi-label {
    /* Bumped from 0.58rem (~7.8px, fails accessibility) to 0.72rem (~10.4px) */
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    line-height: 1.15;
    /* Allow up to 2 lines so labels like "TOTAL APPLICATIONS" or
       "LLM COST (USD)" don't get truncated in the narrow icon-row column. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    min-width: 0;
}
.kpi-trend {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.12rem 0.4rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.kpi-trend.up { color: var(--emerald); background: var(--emerald-dim); }
.kpi-trend.down { color: var(--rose); background: var(--rose-dim); }

/* KPI color variants */
.kpi-card[data-color="cyan"] { --kpi-gradient: linear-gradient(90deg, var(--cyan), var(--blue)); --kpi-glow: rgba(6,182,212,0.15); --kpi-color: var(--cyan); --kpi-icon-bg: var(--cyan-dim); }
.kpi-card[data-color="purple"] { --kpi-gradient: linear-gradient(90deg, var(--purple), var(--blue)); --kpi-glow: rgba(139,92,246,0.15); --kpi-color: var(--purple); --kpi-icon-bg: var(--purple-dim); }
.kpi-card[data-color="blue"] { --kpi-gradient: linear-gradient(90deg, var(--blue), var(--cyan)); --kpi-glow: rgba(59,130,246,0.15); --kpi-color: var(--blue); --kpi-icon-bg: var(--blue-dim); }
.kpi-card[data-color="amber"] { --kpi-gradient: linear-gradient(90deg, var(--amber), var(--orange)); --kpi-glow: rgba(245,158,11,0.15); --kpi-color: var(--amber); --kpi-icon-bg: var(--amber-dim); }
.kpi-card[data-color="emerald"] { --kpi-gradient: linear-gradient(90deg, var(--emerald), var(--cyan)); --kpi-glow: rgba(16,185,129,0.15); --kpi-color: var(--emerald); --kpi-icon-bg: var(--emerald-dim); }
.kpi-card[data-color="rose"] { --kpi-gradient: linear-gradient(90deg, var(--rose), var(--orange)); --kpi-glow: rgba(244,63,94,0.15); --kpi-color: var(--rose); --kpi-icon-bg: var(--rose-dim); }

/* ═══════════════════════ CHART ROW ═══════════════════════ */
.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

/* ═══════════════════════ METRIC RINGS ═══════════════════════ */
.ring-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    padding: 1.2rem 0;
}
.ring-chart {
    position: relative;
    width: 140px;
    height: 140px;
}
.ring-chart canvas { width: 100% !important; height: 100% !important; }
.ring-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.ring-center .ring-value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-bright);
}
.ring-center .ring-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    margin-top: 2px;
}

/* ═══════════════════════ STAT STACK ═══════════════════════ */
.stat-stack { display: flex; flex-direction: column; gap: 0.5rem; }
.stat-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.55rem 0.8rem;
    background: var(--bg-card-inner);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all var(--transition);
    cursor: default;
}
.stat-item:hover {
    border-color: var(--border-hover);
    background: rgba(255,255,255,0.03);
    transform: translateX(3px);
}
.stat-item .stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}
.stat-item .stat-num {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-bright);
    min-width: 30px;
}
.stat-item .stat-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    flex: 1;
}
.stat-item .stat-arrow {
    color: var(--text-muted);
    font-size: 0.72rem;
    opacity: 0;
    transition: all var(--transition);
}
.stat-item:hover .stat-arrow { opacity: 1; transform: translateX(2px); }

/* ═══════════════════════ TABLES ═══════════════════════ */
.table-wrapper { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}
th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid var(--border);
    background: transparent;
}
td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
tr { transition: background var(--transition); }
tr:hover { background: rgba(6,182,212,0.03); }
td a { color: var(--cyan); text-decoration: none; font-weight: 600; }
td a:hover { color: var(--cyan-light); }

/* ═══════════════════════ BADGES ═══════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: none;
    gap: 0.35rem;
}
.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px currentColor;
}
.badge-evaluated { background: var(--evaluated-dim); color: var(--purple-light); border-color: rgba(139,92,246,0.2); }
.badge-evaluated::before { background: var(--purple); }
.badge-applied { background: var(--applied-dim); color: var(--blue-light); border-color: rgba(59,130,246,0.2); }
.badge-applied::before { background: var(--blue); }
.badge-responded { background: var(--responded-dim); color: var(--cyan-light); border-color: rgba(6,182,212,0.2); }
.badge-responded::before { background: var(--cyan); }
.badge-interview { background: var(--interview-dim); color: var(--amber-light); border-color: rgba(245,158,11,0.2); }
.badge-interview::before { background: var(--amber); }
.badge-offer { background: var(--offer-dim); color: var(--emerald-light); border-color: rgba(16,185,129,0.2); }
.badge-offer::before { background: var(--emerald); }
.badge-rejected { background: var(--rejected-dim); color: var(--rose-light); border-color: rgba(244,63,94,0.2); }
.badge-rejected::before { background: var(--rose); }
.badge-ghosted { background: var(--ghosted-dim); color: rgba(255,255,255,0.4); border-color: rgba(255,255,255,0.06); }
.badge-ghosted::before { background: rgba(255,255,255,0.3); }
.badge-skip, .badge-discarded { background: rgba(255,255,255,0.03); color: var(--text-muted); border-color: rgba(255,255,255,0.05); }
.badge-skip::before, .badge-discarded::before { background: var(--text-muted); }

/* ═══════════════════════ BUTTONS ═══════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1.2rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-family: inherit;
}
.btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.btn-primary {
    background: var(--grad-primary);
    border: none;
    color: white;
    box-shadow: var(--shadow-glow-cyan);
}
.btn-primary:hover {
    box-shadow: var(--shadow-glow-cyan), var(--shadow-md);
    transform: translateY(-2px);
    color: white;
}
.btn-outline {
    background: transparent;
    border-color: var(--cyan-glow);
    color: var(--cyan);
}
.btn-outline:hover { background: var(--cyan-dim); color: var(--cyan-light); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.72rem; }
.btn-xs { padding: 0.25rem 0.55rem; font-size: 0.7rem; min-height: 26px; }

/* Destructive variant — use for delete/revoke/disable. Always visually
   distinct so users can't mistake it for a neutral action. */
.btn-danger {
    background: var(--rose-dim);
    border-color: rgba(244,63,94,0.3);
    color: var(--rose-light);
}
.btn-danger:hover {
    background: rgba(244,63,94,0.2);
    border-color: var(--rose);
    color: white;
}

/* ═══════════════════════ FORMS ═══════════════════════ */
.form-group { margin-bottom: 1rem; }
/* Form labels — sentence-case 0.78rem semibold.
   Was 0.65rem uppercase tracked (smaller than the placeholder it labels). */
.form-group label {
    display: block;
    font-size: 0.78rem;
    color: var(--text);
    margin-bottom: 0.4rem;
    font-weight: 600;
    letter-spacing: -0.1px;
    text-transform: none;
}
input, select, textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-card-inner);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.82rem;
    font-family: inherit;
    transition: all var(--transition);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: rgba(6,182,212,0.4);
    box-shadow: 0 0 0 3px var(--cyan-dim), var(--shadow-glow-cyan);
    background: rgba(255,255,255,0.03);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 100px; }
select {
    color-scheme: dark;
    -webkit-appearance: none;
    -moz-appearance: none;
    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='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 2rem;
}
select option {
    background: #0a0e1a;
    color: #e2e8f0;
    padding: 0.4rem 0.6rem;
}
select option:checked,
select option:hover {
    background: #162032;
    color: #f8fafc;
}
select::-ms-expand { display: none; }

/* ═══════════════════════ ALERTS ═══════════════════════ */
.alert {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    margin-bottom: 0.8rem;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.alert-error { background: var(--error-dim); color: var(--rose-light); border-color: rgba(244,63,94,0.2); }
.alert-success { background: var(--success-dim); color: var(--emerald-light); border-color: rgba(16,185,129,0.2); }

/* ═══════════════════════ SCORE ═══════════════════════ */
.score-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

/* ═══════════════════════ EMPTY STATE ═══════════════════════ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-6);
    text-align: center;
    min-height: 240px;
}
.empty-state .empty-icon {
    font-size: 2.8rem;
    margin-bottom: var(--space-3);
    opacity: 0.35;
    filter: grayscale(0.5);
}
.empty-state .empty-icon svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-muted);
    stroke-width: 1.5;
    opacity: 0.7;
}
.empty-state .empty-title {
    font-size: 1rem;
    color: var(--text);
    font-weight: 700;
    margin-bottom: var(--space-2);
    letter-spacing: -0.1px;
}
.empty-state .empty-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    max-width: 360px;
    line-height: 1.55;
}

/* ═══════════════════════ MODAL ═══════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    width: 640px;          /* was 540px — too cramped for 4-8 field forms */
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-lg), var(--shadow-glow-cyan);
}
.modal-body input[type="password"],
.modal-body input[type="text"],
.modal-body code {
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.3rem;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 0.95rem; font-weight: 700; color: var(--text-bright); }
.modal-close {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.1); }
.modal-body { padding: 1.3rem; }
.modal-footer {
    padding: 0.8rem 1.3rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ═══════════════════════ TOAST ═══════════════════════ */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-card);
    border-left: 3px solid;
    border-left-color: var(--cyan);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-size: 0.82rem;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s cubic-bezier(0.4,0,0.2,1), toastOut 0.3s ease 3.7s forwards;
}
.toast.error { border-left-color: var(--rose); }
.toast.success { border-left-color: var(--emerald); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(30px); } }

/* ═══════════════════════ AUTH PAGES ═══════════════════════ */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 30% 20%, rgba(6,182,212,0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(139,92,246,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(59,130,246,0.04) 0%, transparent 70%);
}
.auth-container { width: 100%; max-width: 420px; padding: 1rem; }
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    padding: 2.2rem 2rem;
    backdrop-filter: var(--blur);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--grad-primary);
}
.auth-header { text-align: center; margin-bottom: 1.5rem; }
.auth-header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.auth-form { margin-top: 1rem; }
.auth-footer {
    text-align: center;
    margin-top: 1.3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.auth-footer a { color: var(--cyan); text-decoration: none; font-size: 0.82rem; margin-left: 0.3rem; font-weight: 600; }
.auth-footer a:hover { color: var(--cyan-light); }

/* ═══════════════════════ SCORE GRID ═══════════════════════ */
.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.8rem;
}
.score-dim-item {
    padding: 0.7rem 0.8rem;
    background: var(--bg-card-inner);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.score-dim-item:hover { border-color: var(--border-hover); }
.score-dim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.score-dim-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
}
.score-dim-value {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.score-dim-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}
.score-dim-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px currentColor;
}
.score-dim-rationale {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ═══════════════════════ FILTER TABS ═══════════════════════ */
.filter-tabs {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}
.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: transparent;
    transition: all var(--transition);
    text-decoration: none;
    cursor: pointer;
}
.filter-tab:hover { background: rgba(255,255,255,0.04); border-color: var(--border-hover); color: var(--text); }
.filter-tab.active {
    background: var(--cyan-dim);
    border-color: var(--cyan-glow);
    color: var(--cyan-light);
}
.filter-tab[data-status="evaluated"].active { background: var(--purple-dim); border-color: var(--purple-glow); color: var(--purple-light); }
.filter-tab[data-status="applied"].active { background: var(--blue-dim); border-color: rgba(59,130,246,0.3); color: var(--blue-light); }
.filter-tab[data-status="interview"].active { background: var(--amber-dim); border-color: rgba(245,158,11,0.3); color: var(--amber-light); }
.filter-tab[data-status="offer"].active { background: var(--emerald-dim); border-color: rgba(16,185,129,0.3); color: var(--emerald-light); }
.filter-tab[data-status="rejected"].active, .filter-tab[data-status="ghosted"].active { background: var(--rose-dim); border-color: rgba(244,63,94,0.3); color: var(--rose-light); }
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 0.3rem;
    border-radius: 100px;
    font-size: 0.58rem;
    font-weight: 700;
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
}
.filter-tab.active .tab-count { background: rgba(255,255,255,0.12); color: inherit; }

/* ═══════════════════════ DETAIL GRID ═══════════════════════ */
.detail-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 0.8rem;
}
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-fields { display: flex; flex-direction: column; gap: 0; }
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 700;
    min-width: 90px;
}
.detail-value {
    font-size: 0.82rem;
    color: var(--text);
    text-align: right;
    word-break: break-word;
}

/* ═══════════════════════ TIMELINE ═══════════════════════ */
.timeline { display: flex; flex-direction: column; gap: 0; position: relative; padding-left: 1.2rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.6rem 0;
    position: relative;
}
.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    z-index: 1;
    border: 2px solid var(--bg-card);
}
.timeline-content { flex: 1; }
.timeline-event {
    font-size: 0.82rem;
    color: var(--text);
    font-weight: 600;
}
.timeline-date {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ═══════════════════════ MOBILE ═══════════════════════ */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 0.6rem;
    left: 0.6rem;
    z-index: 200;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.2rem;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-xs);
    cursor: pointer;
}
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99;
}
/* ─── Tablet (1024px and below) — collapse sidebar to icon-only ─── */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar { width: 64px; }
    .sidebar-header { padding: 1rem 0.5rem; text-align: center; }
    .sidebar-header .logo { font-size: 0; gap: 0; justify-content: center; }
    .sidebar-header .logo .logo-icon { font-size: 0.85rem; }
    .sidebar-header .subtitle { display: none; }
    .nav-links { padding: 0.5rem 0.4rem; }
    .nav-links li a { padding: 0.55rem 0; justify-content: center; }
    .nav-links .nav-text { display: none; }
    .nav-links .nav-icon { width: 20px; height: 20px; }
    .nav-group-label { font-size: 0; padding: 0.4rem 0 0.2rem; height: 1px; background: var(--border); margin: 0.3rem 0.5rem; }
    .nav-group-label .nav-text { display: none; }
    .nav-links li a .badge,
    .nav-links li a span:not(.nav-text):not(.nav-icon) { display: none; }
    .sidebar-footer .version { font-size: 0; }

    main { margin-left: 64px; max-width: calc(100vw - 64px); }
    .page-content { padding: 1.2rem; }
    .chart-row { grid-template-columns: 1fr; }
    /* KPI grid gets 3-up at this width (desktop is 4+) */
    .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}
/* Hide mobile-only elements on desktop */
.bottom-tab-bar { display: none; }
#more-sheet { display: none; }
@media (max-width: 768px) {
    /* ── Base font — 16px for native mobile feel ── */
    body { font-size: 16px; }

    /* ══════════════════════════════════════════════════════════════════
       MOBILE TYPOGRAPHY FLOOR — minimum 13px, bold where needed
       Override inline font-size attributes used across 30+ templates
       ══════════════════════════════════════════════════════════════════ */
    [style*="font-size: 0.5rem"],
    [style*="font-size:0.5rem"],
    [style*="font-size: 0.5"],
    [style*="font-size: 0.52rem"],
    [style*="font-size: 0.55rem"],
    [style*="font-size:0.55rem"],
    [style*="font-size: 0.58rem"] {
        font-size: 0.82rem !important;
    }
    [style*="font-size: 0.6rem"],
    [style*="font-size:0.6rem"],
    [style*="font-size: 0.6;"],
    [style*="font-size: 0.62rem"],
    [style*="font-size: 0.64rem"],
    [style*="font-size: 0.65rem"],
    [style*="font-size:0.65rem"],
    [style*="font-size: 0.66rem"] {
        font-size: 0.85rem !important;
    }
    [style*="font-size: 0.68rem"],
    [style*="font-size: 0.7rem"],
    [style*="font-size:0.7rem"],
    [style*="font-size: 0.7;"],
    [style*="font-size: 0.72rem"] {
        font-size: 0.88rem !important;
    }
    [style*="font-size: 0.75rem"],
    [style*="font-size: 0.78rem"],
    [style*="font-size: 0.8rem"] {
        font-size: 0.9rem !important;
    }
    /* Make bold where it matters */
    [style*="font-size: 0.82rem"],
    [style*="font-size: 0.85rem"] {
        font-size: 0.92rem !important;
        font-weight: 600 !important;
    }

    /* ── Layout ── */
    .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
    .sidebar.open { transform: translateX(0); z-index: 300; }
    .mobile-menu-btn { display: none !important; }
    .mobile-overlay { display: none !important; }
    body.menu-open .mobile-overlay { display: none !important; }
    main { margin-left: 0; max-width: 100vw; height: auto !important; min-height: 100vh; overflow-y: visible !important; padding-bottom: 72px; }
    .page-content { padding: 1rem 0.9rem 1.2rem; }
    .top-bar { padding: 0.6rem 0.9rem; justify-content: space-between; }
    .top-bar .search-box { display: none; }
    .top-bar-user span:last-child { display: none; }
    .user-name-text { display: none !important; }
    .mobile-logo { display: flex !important; }
    .top-bar { position: sticky; top: 0; z-index: 100; background: var(--bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
    .chart-row { grid-template-columns: 1fr !important; }
    /* Ring charts — stack vertically on mobile */
    .ring-container { flex-direction: column; gap: 1.2rem; padding: 0.8rem 0; }
    .ring-chart { width: 120px; height: 120px; }
    .ring-value { font-size: 1.3rem !important; font-weight: 800 !important; }
    .ring-label { font-size: 0.82rem !important; }
    /* Stat-stack items — readable */
    .stat-item { font-size: 0.88rem; padding: 0.4rem 0; }
    .stat-num { font-size: 1rem !important; font-weight: 800 !important; }
    .stat-text { font-size: 0.85rem !important; }
    /* Stat-stack inside pipeline metrics — single column */
    .stat-stack, [style*="display: flex"][style*="flex-wrap: wrap"][style*="flex: 1 1"] {
        flex-direction: column !important;
    }
    [style*="flex: 1 1 180px"], [style*="flex: 1 1 160px"] {
        flex-basis: 100% !important;
    }
    /* Dropdowns on mobile — full width */
    .topbar-dropdown {
        position: fixed !important;
        top: 48px !important;
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        max-width: none !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    /* ── KPI value contrast fix — ensure "0" values are visible ── */
    .kpi-value { color: var(--text) !important; }

    /* ── Bottom tab bar labels — slightly larger ── */
    .tab-item span { font-size: 0.7rem; }

    /* ── More sheet toggle theme button — match nav item style ── */
    .more-sheet-item[style*="border:none"] {
        font-size: 0.92rem !important;
        font-weight: 500 !important;
    }

    /* ── Page Headers — stack vertically, spacious ── */
    .page-header { flex-direction: column; align-items: flex-start !important; gap: 0.6rem; }
    .page-header h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.3px; }
    .page-header > div:last-child { width: 100%; }
    .page-header .btn-primary { font-size: 0.88rem; padding: 0.65rem 1.1rem; font-weight: 700; }
    .page-subtitle { font-size: 0.95rem; color: var(--text-secondary); font-weight: 500; }

    /* ── KPI Grid — 2-column, icon+label top, big number below ── */
    .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.6rem; }
    .kpi-card {
        padding: 0.85rem 1rem;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 0.2rem 0.5rem;
        border-radius: var(--radius);
        align-items: center;
    }
    .kpi-top { margin-bottom: 0; grid-column: 1; grid-row: 1; }
    .kpi-icon { width: 32px; height: 32px; }
    .kpi-icon svg { width: 16px; height: 16px; }
    .kpi-icon-box { width: 28px; height: 28px; }
    .kpi-icon-box svg { width: 14px; height: 14px; }
    .kpi-label {
        grid-column: 2; grid-row: 1; align-self: center;
        font-size: 0.78rem; margin-top: 0; letter-spacing: 0.2px;
        font-weight: 600; -webkit-line-clamp: unset; overflow: visible;
        text-transform: uppercase; color: var(--text-secondary);
        word-break: normal; white-space: normal; line-height: 1.3;
    }
    .kpi-value {
        grid-column: 1 / -1; grid-row: 2;
        font-size: 1.75rem; letter-spacing: -0.5px; font-weight: 800;
        color: var(--text); text-align: center; width: 100%;
    }

    /* ── Cards — generous padding, breathing room ── */
    .card { padding: 1.1rem; border-radius: var(--radius); }
    .card + .card { margin-top: 0.7rem; }
    .card-header { margin-bottom: 0.8rem; padding-bottom: 0.6rem; }
    .card-title { font-size: 0.92rem; font-weight: 700; }
    .card:hover { transform: none !important; }

    /* ── Forms — prevent iOS zoom, larger labels ── */
    input, select, textarea { min-height: 48px; font-size: 16px !important; border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; }
    label { font-size: 0.88rem; font-weight: 600; }
    .form-group { margin-bottom: 1rem; }

    /* ── Tables — horizontal scroll ── */
    table { font-size: 0.85rem; min-width: max-content; }
    .card > table, .card > div > table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    th { padding: 0.6rem 0.7rem; white-space: nowrap; font-weight: 700; font-size: 0.82rem; }
    td { padding: 0.6rem 0.7rem; white-space: nowrap; }
    .badge { white-space: nowrap; overflow: visible; text-overflow: clip; flex-shrink: 0; font-size: 0.78rem !important; font-weight: 600; }

    /* ── Filter tabs — horizontal scroll ── */
    .filter-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap !important; gap: 0.4rem; padding-bottom: 0.3rem; scrollbar-width: none; }
    .filter-tabs::-webkit-scrollbar { display: none; }
    .filter-tab { white-space: nowrap; font-size: 0.88rem; padding: 0.5rem 0.85rem; flex-shrink: 0; border-radius: 20px; font-weight: 600; }

    /* ── Filters row ── */
    .filters { flex-direction: column; gap: 0.4rem; }

    /* ── Modals — full width on mobile ── */
    .modal-box { width: 96vw !important; max-width: 96vw !important; max-height: 92vh; margin: 0 auto; border-radius: var(--radius); }
    .modal-body { padding: 1rem; }
    .modal-header { padding: 0.8rem 1rem; font-size: 1rem; }
    .modal-footer { padding: 0.7rem 1rem; }

    /* ── CRITICAL: Override ALL inline grid layouts ── */
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: 2fr 1fr"],
    [style*="grid-template-columns: 1fr 320px"],
    [style*="grid-template-columns: 1fr 340px"],
    [style*="grid-template-columns: 1fr 300px"],
    [style*="grid-template-columns: repeat(auto-fit"],
    [style*="grid-template-columns: repeat(auto-fill"],
    [style*="grid-template-columns: repeat(2"],
    [style*="grid-template-columns: repeat(3"],
    [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: 1fr !important;
    }
    /* Preserve 2-col for small items (KPIs already handled above) */
    .form-row { grid-template-columns: 1fr !important; }
    .form-row-3 { grid-template-columns: 1fr !important; }
    .summary-grid { grid-template-columns: 1fr !important; }
    .unlock-cards { grid-template-columns: 1fr !important; }
    .skill-input-row { grid-template-columns: 1fr !important; }

    /* ── Buttons — touch-friendly (48px min height), bold ── */
    .btn { font-size: 0.9rem; padding: 0.65rem 1rem; min-height: 48px; border-radius: var(--radius-sm); font-weight: 700; }
    .btn-sm { font-size: 0.85rem; padding: 0.5rem 0.8rem; min-height: 42px; font-weight: 600; }
    .btn-xs { font-size: 0.78rem; padding: 0.4rem 0.6rem; min-height: 36px; font-weight: 600; }
    .btn-primary { font-size: 0.9rem; }
    .btn-outline { font-size: 0.85rem; }

    /* ── Action button rows — wrap gracefully ── */
    [style*="display: flex"][style*="gap: 0.5rem"] { flex-wrap: wrap !important; }
    [style*="display: flex"][style*="gap: 0.4rem"] { flex-wrap: wrap !important; }

    /* ── Settings page avatar card ── */
    [style*="display: flex"][style*="gap: 1.2rem"] { flex-direction: column !important; }
    [style*="display: flex"][style*="gap: 0.4rem"] > .btn,
    [style*="display: flex"][style*="gap: 0.4rem"] > form { flex: 1; }

    /* ── Detail pages ── */
    .detail-grid { grid-template-columns: 1fr !important; }
    .stat-item { flex-wrap: wrap; gap: 0.3rem; }

    /* ── Kanban on mobile — single column with horizontal scroll ── */
    [style*="display: flex"][style*="overflow-x: auto"] { scroll-snap-type: x mandatory; }
    .kanban-column { min-width: 260px !important; scroll-snap-align: start; }
    .kanban-card { padding: 0.5rem !important; }

    /* ── Horizontal flex cards → stack on mobile (except action-card) ── */
    [style*="display: flex"][style*="align-items: center"][style*="gap: 1rem"]:not(.action-card),
    [style*="display: flex"][style*="align-items: center"][style*="gap: 0.8rem"]:not(.action-card),
    [style*="display: flex"][style*="align-items: flex-start"][style*="gap: 1rem"]:not(.action-card),
    [style*="display: flex"][style*="align-items: flex-start"][style*="gap: 0.8rem"]:not(.action-card) {
        flex-wrap: wrap !important;
    }
    /* Make the text section take full width when wrapped (except in action cards) */
    :not(.action-card) > [style*="flex: 1"][style*="min-width: 0"],
    :not(.action-card) > [style*="flex: 1;"] {
        min-width: 100% !important;
    }
    /* Action cards — keep horizontal on mobile */
    .action-card {
        flex-wrap: nowrap !important;
        align-items: center !important;
    }
    .action-card > [style*="flex: 1"] {
        min-width: 0 !important;
    }
    /* Stack icon + text blocks vertically in tight cards */
    .stat-item, [style*="display: flex"][style*="gap: 1rem"] > [style*="flex: 1"] {
        width: 100%;
    }
    /* Buttons in cards — full width on mobile */
    [style*="display: flex"][style*="gap: 0.4rem"][style*="flex-shrink: 0"] {
        width: 100% !important;
        justify-content: flex-start !important;
        margin-top: 0.3rem;
    }
    /* Calendar/integration stub cards */
    .card > [style*="display: flex"][style*="gap: 1rem"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    .card > [style*="display: flex"][style*="gap: 1rem"] > button,
    .card > [style*="display: flex"][style*="gap: 1rem"] > .btn {
        width: 100%;
    }
    /* Interview cards — date badge + info + buttons */
    [style*="border-radius: 10px"][style*="display: flex"][style*="gap: 1rem"] {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    [style*="border-radius: 10px"][style*="display: flex"] > [style*="flex: 1"] {
        flex-basis: calc(100% - 56px) !important;
        min-width: 0 !important;
    }
    /* Settings avatar row */
    [style*="display: flex"][style*="align-items: center"][style*="gap: 1.2rem"] {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
    }

    /* ── Google Calendar integration card — prevent button overflow ── */
    .gcal-integration-row { flex-wrap: wrap; }
    .gcal-header-row { flex-direction: column; align-items: flex-start !important; gap: 0.4rem !important; }
    .gcal-header-row .btn { align-self: flex-start; }

    /* ── Score bars on detail page ── */
    [style*="width: 90px"] { width: 70px !important; font-size: 0.68rem !important; }

    /* ── Breadcrumb ── */
    [style*="font-size: 0.75rem"] { font-size: 0.68rem; }

    /* ── Timeline ── */
    .timeline { font-size: 0.9rem; }
    .timeline-event { font-size: 0.9rem; }
    .timeline-date { font-size: 0.82rem; font-weight: 600; }

    /* ══════════════════════════════════════════════════════════════════
       BOTTOM TAB BAR — native-feeling mobile navigation
       ══════════════════════════════════════════════════════════════════ */
    .bottom-tab-bar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 500;
        height: 64px;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
        padding: 0 4px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        align-items: center;
        justify-content: space-around;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    .tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        flex: 1;
        padding: 6px 0;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.65rem;
        font-weight: 600;
        letter-spacing: 0.2px;
        transition: color 0.15s;
        background: none;
        border: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .tab-item.active { color: var(--cyan); }
    .tab-item:active { opacity: 0.7; }
    .tab-item svg { stroke-width: 2; }
    .tab-item.active svg { stroke-width: 2.5; }

    /* ── MORE SHEET ── */
    #more-sheet {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 600;
        background: rgba(0,0,0,0.45);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        align-items: flex-end;
        justify-content: center;
    }
    #more-sheet.open { display: flex; }
    .more-sheet-content {
        background: var(--bg-card);
        border-radius: 20px 20px 0 0;
        max-width: 480px;
        width: 100%;
        max-height: 80vh;
        overflow-y: auto;
        padding: 0.5rem 1.2rem 2rem;
        box-shadow: 0 -8px 40px rgba(0,0,0,0.25);
        animation: sheetUp 0.25s ease;
    }
    @keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
    .more-sheet-handle {
        width: 36px;
        height: 4px;
        background: var(--border);
        border-radius: 2px;
        margin: 0 auto 1rem;
    }
    .more-sheet-user {
        display: flex;
        align-items: center;
        gap: 0.7rem;
        padding: 0.8rem 0;
        border-bottom: 1px solid var(--border);
        margin-bottom: 0.5rem;
    }
    .more-sheet-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(135deg, #4F46E5, #06b6d4);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: 800;
        font-size: 1rem;
        flex-shrink: 0;
    }
    .more-sheet-group { margin-top: 0.6rem; }
    .more-sheet-label {
        font-size: 0.7rem;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.8px;
        padding: 0.4rem 0.5rem 0.3rem;
    }
    .more-sheet-item {
        display: flex;
        align-items: center;
        gap: 0.7rem;
        padding: 0.75rem 0.5rem;
        font-size: 0.92rem;
        font-weight: 500;
        color: var(--text);
        text-decoration: none;
        border-radius: var(--radius-sm);
        transition: background 0.15s;
        min-height: 48px;
    }
    .more-sheet-item:active { background: var(--bg-subtle); }
    .more-sheet-item .badge { font-size: 0.6rem !important; padding: 0.15rem 0.4rem; margin-left: auto; }

    /* ── Jobs + Tracker: card view on mobile, table on desktop ── */
    .mobile-jobs-list { display: flex !important; }
    .desktop-jobs-table { display: none !important; }
    .mobile-tracker-list { display: flex !important; }
    .desktop-tracker-table { display: none !important; }

    /* ── Settings grid — single column, auto height ── */
    .settings-grid {
        grid-template-columns: 1fr !important;
        grid-auto-rows: auto !important;
    }

    /* ── Banner compaction — reduce vertical space on mobile ── */
    .page-content > [style*="margin-bottom: 0.8rem"][style*="border:"],
    .page-content > [style*="margin-bottom: 1rem"][style*="border:"] {
        margin-bottom: 0.4rem !important;
        padding: 0.5rem 0.7rem !important;
    }
    /* Hide verbose "Still missing" list on mobile — just show % */
    .page-content > [style*="rgba(245,158,11"] [style*="font-size: 0.66rem"] {
        display: none !important;
    }
    /* Profile completeness progress bar: full width */
    .page-content > [style*="rgba(245,158,11"] [style*="max-width: 360px"] {
        max-width: 100% !important;
    }

    /* ── Hide user dropdown on mobile (moved to More sheet) ── */
    #user-dropdown-wrap { display: none !important; }

    /* ── PWA banners: top banner on mobile, not overlapping content ── */
    #pwa-install-banner,
    #ios-install-banner {
        position: fixed !important;
        bottom: auto !important;
        top: 52px !important;
        left: 8px !important;
        right: 8px !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        border-radius: 12px !important;
        z-index: 200 !important;
    }
}

/* ── Small phones (iPhone SE, etc.) ── */
@media (max-width: 380px) {
    .page-content { padding: 0.6rem; }
    .kpi-grid { grid-template-columns: 1fr 1fr !important; gap: 0.35rem; }
    .kpi-card { padding: 0.6rem 0.7rem; gap: 0.4rem; }
    .kpi-value { font-size: 1.1rem; }
    .card { padding: 0.8rem; border-radius: var(--radius-sm); }
    .page-header h1 { font-size: 1.2rem; }
    .filter-tab { font-size: 0.75rem; padding: 0.35rem 0.55rem; }
    .modal-box { width: 98vw !important; max-width: 98vw !important; }
}

/* ── Topbar Dropdowns ── */
.topbar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    background: var(--bg-card-solid);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 1px rgba(6,182,212,0.1);
    z-index: 500;
    overflow: hidden;
    animation: dropdownIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.topbar-dropdown::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(6,182,212,0.2), transparent);
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
    border-left: 2px solid transparent;
    white-space: nowrap;
}
.dropdown-item:hover {
    background: rgba(6,182,212,0.06);
    color: var(--text);
    border-left-color: var(--cyan);
}
.dropdown-item svg { flex-shrink: 0; opacity: 0.6; }
.dropdown-item:hover svg { opacity: 1; }

/* Notification items in dropdown */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid rgba(148,163,184,0.06);
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}
.notif-item:hover { background: rgba(6,182,212,0.05); }
.notif-item.unread { background: rgba(6,182,212,0.04); border-left: 2px solid var(--cyan); }
.notif-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--cyan); flex-shrink: 0; margin-top: 6px;
    box-shadow: 0 0 4px var(--cyan);
}
.notif-dot.read { background: transparent; box-shadow: none; }

/* ── Career Ladder (vertical timeline) ── */
.career-ladder {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 1.5rem;
}
.career-ladder::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 18px;
    bottom: 18px;
    width: 2px;
    background: linear-gradient(180deg, var(--border), var(--cyan), var(--purple));
    opacity: 0.3;
}
.ladder-step {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.4rem 0;
    position: relative;
}
.ladder-node {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* ── Responsive 2-column grid ── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}
@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr !important; }
}

/* ── Settings Cards ── */
.settings-grid .card {
    cursor: pointer;
    transition: all var(--transition);
}
.settings-grid .card:hover {
    border-color: rgba(6,182,212,0.2);
    transform: translateY(-1px);
}
.settings-grid .card:active {
    transform: translateY(0);
    background: rgba(6,182,212,0.02);
}

/* ── Responsive flex card row ── */
.flex-card-row {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}
.flex-card-row > :first-child { flex-shrink: 0; }
.flex-card-row > [style*="flex: 1"] { min-width: 0; }
@media (max-width: 768px) {
    .flex-card-row { gap: 0.5rem; }
    .flex-card-row > .btn,
    .flex-card-row > button:not([style*="flex-shrink"]) {
        align-self: stretch;
    }
}

/* ── Loading Overlay ── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6,9,24,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
    gap: 1rem;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loading-overlay .loading-msg {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   TAG INPUT — chip-style input with autocomplete
   ═══════════════════════════════════════════════════════════════ */
.tag-input-root {
    position: relative;
}
.tag-input-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    min-height: 40px;
    padding: 0.4rem 0.5rem;
    background: var(--bg-card-inner);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: text;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tag-input-box:focus-within {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
}
.tag-chips {
    display: contents;
}
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    background: var(--cyan-dim);
    color: var(--cyan-light, var(--cyan));
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.tag-chip-remove {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.65;
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.95rem;
    line-height: 1;
    border-radius: 50%;
    transition: opacity 0.15s, background 0.15s;
}
.tag-chip-remove:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
}
.tag-input-field {
    flex: 1;
    min-width: 120px;
    background: none !important;
    border: none !important;
    padding: 0.2rem 0.3rem !important;
    color: var(--text) !important;
    font-size: 0.78rem !important;
    box-shadow: none !important;
    outline: none !important;
}
.tag-suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
}
.tag-suggest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    font-size: 0.78rem;
    color: var(--text);
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.1s;
}
.tag-suggest-item:last-child {
    border-bottom: none;
}
.tag-suggest-item:hover,
.tag-suggest-item.active {
    background: rgba(6, 182, 212, 0.08);
    color: var(--cyan-light, var(--cyan));
}
.tag-suggest-meta {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Variant: emerald (target) */
.tag-input-root[data-variant="emerald"] .tag-chip {
    background: var(--emerald-dim);
    color: var(--emerald-light, var(--emerald));
    border-color: rgba(16, 185, 129, 0.25);
}
.tag-input-root[data-variant="emerald"] .tag-input-box:focus-within {
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.tag-input-root[data-variant="emerald"] .tag-suggest-item:hover,
.tag-input-root[data-variant="emerald"] .tag-suggest-item.active {
    background: rgba(16, 185, 129, 0.08);
    color: var(--emerald-light, var(--emerald));
}

/* Variant: rose (blacklist) */
.tag-input-root[data-variant="rose"] .tag-chip {
    background: var(--rose-dim);
    color: var(--rose-light, var(--rose));
    border-color: rgba(244, 63, 94, 0.25);
}
.tag-input-root[data-variant="rose"] .tag-input-box:focus-within {
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.12);
}
.tag-input-root[data-variant="rose"] .tag-suggest-item:hover,
.tag-input-root[data-variant="rose"] .tag-suggest-item.active {
    background: rgba(244, 63, 94, 0.08);
    color: var(--rose-light, var(--rose));
}

/* Job-type checkbox grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}
.check-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    background: var(--bg-card-inner);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.check-card:hover {
    border-color: var(--border-hover);
    color: var(--text);
}
.check-card input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--cyan);
}
.check-card input[type="checkbox"]:checked + .check-label {
    color: var(--cyan);
    font-weight: 600;
}
.check-card:has(input:checked) {
    background: rgba(6, 182, 212, 0.08);
    border-color: var(--cyan);
}

/* Save button highlighted after successful test */
.btn-glow {
    box-shadow: 0 0 0 3px rgba(16,185,129,0.25), 0 0 18px rgba(16,185,129,0.4) !important;
    animation: glow-pulse 1.6s ease-in-out infinite;
}
@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.25), 0 0 18px rgba(16,185,129,0.4); }
    50% { box-shadow: 0 0 0 4px rgba(16,185,129,0.4), 0 0 24px rgba(16,185,129,0.6); }
}

/* ═══════════════ Skeleton Loaders ═══════════════ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card-inner) 25%, rgba(255,255,255,0.06) 50%, var(--bg-card-inner) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 0.8rem; margin-bottom: 0.5rem; width: 80%; }
.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 60%; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card {
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ═══════════════ Empty States ═══════════════ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
}
.empty-state .empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(6,182,212,0.1), rgba(139,92,246,0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}
.empty-state .empty-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--cyan);
    opacity: 0.7;
}
.empty-state .empty-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-bright, var(--text));
    margin-bottom: 0.3rem;
}
.empty-state .empty-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 320px;
    line-height: 1.5;
    margin-bottom: 1rem;
}
.empty-state .empty-action {
    margin-top: 0.3rem;
}

/* ═══════════════════════════════════════════════════════════════
   MOTION DESIGN SYSTEM — Netflix/LinkedIn-grade animations
   ═══════════════════════════════════════════════════════════════ */

/* ── Keyframes ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes springIn {
    0% { opacity: 0; transform: translateX(40px) scale(0.9); }
    60% { transform: translateX(-4px) scale(1.02); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes drawCheck {
    from { stroke-dashoffset: 24; }
    to { stroke-dashoffset: 0; }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(6,182,212,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(6,182,212,0); }
}
@keyframes growWidth {
    from { width: 0; }
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes shimmerBar {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes rippleEffect {
    to { transform: scale(4); opacity: 0; }
}

/* ── Scroll-triggered reveal ── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Staggered page load — KPI grid ── */
.kpi-grid .kpi-card {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.kpi-grid .kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-grid .kpi-card:nth-child(2) { animation-delay: 0.1s; }
.kpi-grid .kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-grid .kpi-card:nth-child(4) { animation-delay: 0.2s; }
.kpi-grid .kpi-card:nth-child(5) { animation-delay: 0.25s; }
.kpi-grid .kpi-card:nth-child(6) { animation-delay: 0.3s; }
.kpi-grid .kpi-card:nth-child(7) { animation-delay: 0.35s; }
.kpi-grid .kpi-card:nth-child(8) { animation-delay: 0.4s; }

/* ── Staggered page load — chart cards ── */
.chart-row .card {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.chart-row .card:nth-child(1) { animation-delay: 0.15s; }
.chart-row .card:nth-child(2) { animation-delay: 0.25s; }

/* ── Page header entrance ── */
.page-header {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Enhanced button interactions ── */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:hover {
    transform: translateY(-2px) scale(1.02);
}
.btn:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.1s;
}
.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(6,182,212,0.25);
}

/* Button ripple */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

/* Button loading state */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}
.btn.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* ── Enhanced card hover ── */
.card {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(6,182,212,0.04);
}
html.light .card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08), 0 0 0 1px rgba(6,182,212,0.08);
}

/* ── KPI card enhanced hover ── */
.kpi-card {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.kpi-card:hover {
    transform: translateY(-4px) scale(1.01);
}

/* ── KPI glassmorphism + shimmer bar ── */
.kpi-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--cyan), var(--purple), transparent);
    background-size: 200% 100%;
    animation: shimmerBar 3s ease infinite;
    opacity: 0.6;
}

/* ── Table row hover ── */
tbody tr {
    transition: background 0.2s ease;
}
tbody tr:hover td {
    background: rgba(6,182,212,0.03);
}
html.light tbody tr:hover td {
    background: rgba(6,182,212,0.04);
}

/* ── Sidebar nav hover indicator ── */
.nav-links li a {
    position: relative;
}
.nav-links li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 55%;
    background: linear-gradient(180deg, var(--cyan), var(--purple));
    border-radius: 0 3px 3px 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-links li a:hover::before,
.nav-links li a.active::before {
    transform: translateY(-50%) scaleY(1);
}

/* ── Enhanced modal animation ── */
.modal-overlay {
    transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
}
.modal-box {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay:not(.open) .modal-box {
    transform: scale(0.92) translateY(10px);
    opacity: 0;
}
.modal-overlay.open .modal-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── Spring toast ── */
.toast {
    animation: springIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
               toastOut 0.3s ease 3.7s forwards;
}

/* ── Progress bar animated fill ── */
.score-dim-fill,
[style*="width:"][style*="background: var(--"] {
    animation: growWidth 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Badge pulse for new items ── */
.badge-new, [data-new] .badge {
    animation: badgePulse 2s ease-in-out 3;
}

/* ── Focus-visible accessibility ── */
:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
    border-radius: 4px;
}
:focus:not(:focus-visible) {
    outline: none;
}

/* ── Form validation animations ── */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    animation: shake 0.4s ease;
    border-color: var(--rose) !important;
    box-shadow: 0 0 0 3px rgba(244,63,94,0.12) !important;
}
.form-group.success input {
    border-color: var(--emerald) !important;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.12) !important;
}

/* ── Typography upgrade ── */
.page-header h1 {
    font-size: 1.8rem;
    letter-spacing: -0.8px;
}
.page-subtitle {
    font-size: 0.92rem;
    margin-top: 6px;
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }
* { scrollbar-width: thin; scrollbar-color: var(--text-muted) transparent; }

/* ── Skeleton loader light theme ── */
html.light .skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}

/* ═══════════════ LIGHT THEME - LAUNCH READABILITY SWEEP ═══════════════ */

/* Enforce minimum font sizes for readability - catches inline styles */
html.light [style*="font-size: 0.55rem"],
html.light [style*="font-size: 0.52rem"],
html.light [style*="font-size: 0.5rem"],
html.light [style*="font-size:0.55rem"],
html.light [style*="font-size:0.5rem"] {
    font-size: 0.62rem !important;
}
html.light [style*="font-size: 0.58rem"] {
    font-size: 0.64rem !important;
}
html.light [style*="font-size: 0.6rem"],
html.light [style*="font-size:0.6rem"] {
    font-size: 0.65rem !important;
}

/* Badge readability in light mode */
html.light .badge {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* KPI label readability */
html.light .kpi-label {
    color: #475569;
    font-weight: 700;
}

/* Sidebar nav text */
html.light .nav-links li a .nav-text {
    color: #334155;
    font-weight: 500;
}
html.light .nav-links li a.active .nav-text {
    color: #0891b2;
    font-weight: 700;
}

/* Ensure card body text is readable */
html.light .card {
    color: #1e293b;
}

/* Table cell links */
html.light td a {
    color: #0891b2;
    font-weight: 600;
}
html.light td a:hover {
    color: #06b6d4;
}

/* Empty state text */
html.light .empty-state .empty-title {
    color: #0f172a;
}
html.light .empty-state .empty-text {
    color: #475569;
}

/* Score pills / dimension dots - ensure visible */
html.light [style*="background: var(--emerald-dim)"] { background: rgba(16,185,129,0.15) !important; }
html.light [style*="background: var(--rose-dim)"] { background: rgba(244,63,94,0.15) !important; }
html.light [style*="background: var(--amber-dim)"] { background: rgba(245,158,11,0.15) !important; }
html.light [style*="background: var(--cyan-dim)"] { background: rgba(6,182,212,0.15) !important; }
html.light [style*="background: var(--purple-dim)"] { background: rgba(139,92,246,0.15) !important; }
html.light [style*="background: var(--blue-dim)"] { background: rgba(59,130,246,0.15) !important; }

/* Topbar search placeholder */
html.light .search-box input::placeholder {
    color: #94a3b8;
}

/* Form help text */
html.light .form-group [style*="color: var(--text-muted)"] {
    color: #64748b !important;
}

/* ── Score/stat labels that use muted but should be readable ── */
html.light .kpi-card [style*="color: var(--text-muted)"],
html.light .card-header [style*="color: var(--text-muted)"],
html.light details summary [style*="color: var(--text-muted)"],
html.light .stat-item [style*="color: var(--text-muted)"] {
    color: #475569 !important;
}

/* ── Pre/code blocks in cards need padding ── */
html.light .card pre {
    padding: 0.6rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

/* ── Canvas chart containers - minimum height on mobile ── */
@media (max-width: 768px) {
    canvas {
        min-height: 180px !important;
    }
    [style*="height: 220px"],
    [style*="height: 240px"],
    [style*="height: 260px"] {
        height: auto !important;
        min-height: 200px !important;
    }
}
