/* ==========================================================================
   Prakira design tokens
   Satu sumber nilai untuk warna, tipografi, spacing, radius, dan elevasi.
   ========================================================================== */

:root {
    color-scheme: light;

    /* Brand & UI */
    --navy-950: #071224;
    --navy-900: #0b1b33;
    --navy-800: #12294a;
    --brand: #3b5bdb;
    --brand-hover: #324fc4;
    --brand-strong: #2c46b8;
    --brand-soft: #eef2ff;
    --brand-text: #3149b8;
    --accent: #0e9f6e;
    --accent-hover: #0b8b60;
    --accent-soft: #ecfdf5;
    --accent-text: #047857;
    --warning: #b45309;
    --warning-soft: #fffbeb;
    --warning-text: #92400e;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --danger-text: #b91c1c;
    --info: #257de0;
    --info-soft: #eff6ff;
    --info-text: #1d4ed8;
    --violet: #6d4ae2;
    --violet-soft: #f3eeff;
    --violet-text: #5b3bc4;

    /* Surfaces & ink */
    --bg: #f4f6fb;
    --bg-subtle: #eef1f7;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --surface-inverse: #0b1b33;
    --border: #e3e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-faint: #94a3b8;
    --text-inverse: #f8fafc;

    /* Sidebar */
    --sidebar-bg: #0b1b33;
    --sidebar-bg-2: #091628;
    --sidebar-text: #c6d2e5;
    --sidebar-muted: #7f91ad;
    --sidebar-active: rgba(255, 255, 255, 0.08);
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --sidebar-border: rgba(255, 255, 255, 0.07);

    /* Chart roles (divalidasi terhadap surface terang & gelap) */
    --chart-surface: #ffffff;
    --chart-series-1: #257de0;
    --chart-series-2: #f47230;
    --chart-series-3: #00b894;
    --chart-other: #94a3b8;
    --chart-grid: #e7ecf3;
    --chart-axis: #c2cbd9;
    --chart-ink: #64748b;
    --chart-tooltip-bg: #0b1b33;
    --chart-tooltip-text: #f8fafc;

    /* Typography */
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --fs-xs: 11.5px;
    --fs-sm: 12.5px;
    --fs-base: 13.5px;
    --fs-md: 15px;
    --fs-lg: 18px;
    --fs-xl: 22px;
    --fs-2xl: 26px;
    --fs-3xl: 32px;
    --lh-tight: 1.25;
    --lh-base: 1.55;

    /* Spacing (4px scale) */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-7: 28px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;

    /* Radii */
    --radius-xs: 5px;
    --radius-sm: 7px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 999px;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-pop: 0 12px 30px rgba(15, 23, 42, 0.16);
    --focus-ring: 0 0 0 3px rgba(59, 91, 219, 0.22);
    --focus-ring-danger: 0 0 0 3px rgba(220, 38, 38, 0.18);

    /* Layout */
    --sidebar-w: 264px;
    --sidebar-w-collapsed: 78px;
    --topbar-h: 68px;
    --page-max: 1540px;
    --page-px: 32px;

    /* Motion */
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --dur-fast: 120ms;
    --dur: 180ms;
    --dur-slow: 260ms;

    /* Component tokens */
    --input-h: 40px;
    --btn-h: 38px;
    --table-head-bg: #f8fafc;
    --overlay: rgba(6, 14, 28, 0.55);
}

[data-theme="dark"] {
    color-scheme: dark;

    --brand: #5b7cff;
    --brand-hover: #7390ff;
    --brand-strong: #4c6ae8;
    --brand-soft: rgba(91, 124, 255, 0.14);
    --brand-text: #a8bbff;
    --accent: #34d399;
    --accent-hover: #4ade80;
    --accent-soft: rgba(52, 211, 153, 0.12);
    --accent-text: #6ee7b7;
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.12);
    --warning-text: #fcd34d;
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.12);
    --danger-text: #fca5a5;
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, 0.12);
    --info-text: #93c5fd;
    --violet: #a78bfa;
    --violet-soft: rgba(167, 139, 250, 0.12);
    --violet-text: #c4b5fd;

    --bg: #070c16;
    --bg-subtle: #0a1220;
    --surface: #111827;
    --surface-2: #0e1626;
    --surface-3: #1b2639;
    --surface-inverse: #e8edf5;
    --border: #1f2a3c;
    --border-strong: #33415a;
    --text: #e8edf5;
    --text-secondary: #b2c0d4;
    --text-muted: #8b9bb4;
    --text-faint: #64748b;
    --text-inverse: #0b1220;

    --sidebar-bg: #0a1322;
    --sidebar-bg-2: #08101d;
    --sidebar-text: #c6d2e5;
    --sidebar-muted: #7487a3;
    --sidebar-active: rgba(255, 255, 255, 0.07);
    --sidebar-hover: rgba(255, 255, 255, 0.045);
    --sidebar-border: rgba(255, 255, 255, 0.06);

    --chart-surface: #111827;
    --chart-series-1: #338ced;
    --chart-series-2: #e76624;
    --chart-series-3: #00a888;
    --chart-other: #64748b;
    --chart-grid: #243146;
    --chart-axis: #3b4a63;
    --chart-ink: #8b9bb4;
    --chart-tooltip-bg: #e8edf5;
    --chart-tooltip-text: #0b1220;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.38);
    --shadow-lg: 0 22px 50px rgba(0, 0, 0, 0.5);
    --shadow-pop: 0 14px 34px rgba(0, 0, 0, 0.55);
    --focus-ring: 0 0 0 3px rgba(91, 124, 255, 0.3);
    --focus-ring-danger: 0 0 0 3px rgba(248, 113, 113, 0.24);
    --table-head-bg: #0e1626;
    --overlay: rgba(0, 0, 0, 0.65);
}
