/* ============================================================
   theme.css — the ACTIVE theme. Every color in the UI resolves
   to a token defined here; no other file defines colors.

   Creating a new theme:
     1. Copy this file (e.g. static/css/themes/mytheme.css) and
        retune the values — nothing else needs to change.
     2. Point the theme <link> in app/templates/base.html at it.
     Each accent has a paired *-rgb triplet: keep hex and triplet
     in sync — every translucent wash in the UI derives from the
     triplets (rgba(var(--x-rgb), alpha)), and charts read both
     via getComputedStyle (see the token helper in dashboard.html).

   This theme: neutral, elevation-based "true dark" (Material
   dark / GitHub / VS Code approach):
   - Neutral grays, no blue/slate cast.
   - Layered by elevation, not one flat black — surfaces step up
     as they get "closer"; the layering makes cards float without
     hard outlines.
   - Soft, not harsh: darkest surface lifted to #141414 (no
     halation), primary text #e6e6e6 not #ffffff.
   - Borders are low-opacity ink, not gray strokes.
   - Accents desaturated so translucent washes sit into the dark
     field instead of vibrating against it.
   ============================================================ */
:root {
    /* ---- Ink & shadow bases (all neutral washes derive from these).
       Dark theme: ink is white (hovers/dividers lighten), shadows black.
       A light theme flips ink to 0,0,0. */
    --ink-rgb: 255,255,255;
    --shadow-rgb: 0,0,0;

    /* ---- Accents — desaturated for the dark field. Hex + rgb pairs. */
    --primary: #55b1dd;            --primary-rgb: 85,177,221;
    --primary-dark: #3a95c4;       --primary-dark-rgb: 58,149,196;
    --primary-bright: #7cc4e4;     --primary-bright-rgb: 124,196,228;  /* chart line/gradient tint */
    --accent-indigo: #8f96da;      --accent-indigo-rgb: 143,150,218;
    --accent-green: #6cc98e;       --accent-green-rgb: 108,201,142;
    --accent-teal: #3aaa9d;        --accent-teal-rgb: 58,170,157;
    --accent-orange: #e09a62;      --accent-orange-rgb: 224,154,98;
    --accent-orange-dark: #c9834e; --accent-orange-dark-rgb: 201,131,78;
    --accent-red: #e08080;         --accent-red-rgb: 224,128,128;
    --accent-red-bright: #f0b9b9;    /* error text on red washes */
    --accent-yellow: #d4b84a;      --accent-yellow-rgb: 212,184,74;
    --accent-pink: #d989ae;        --accent-pink-rgb: 217,137,174;
    --accent-violet: #a89bd8;      --accent-violet-rgb: 168,155,216;

    /* Common derived washes (badge fills/borders use these alphas;
       components may also derive other alphas from the -rgb triplets) */
    --primary-light: rgba(var(--primary-rgb),0.15);
    --accent-orange-light: rgba(var(--accent-orange-rgb),0.15);

    /* ---- Primary action buttons — sky blue on the --primary ramp, dark
       text on the fill (contrast > 7:1); links, nav-active and focus
       states share the same --primary. */
    --btn-primary-bg: var(--primary);
    --btn-primary-bg-2: var(--primary-dark);
    --btn-primary-hover-2: #0284c7;
    --btn-primary-text: #161616;

    /* ---- Elevation layers — neutral grays stepping toward the viewer */
    --bg-body: #141414;              /* base background (page) */
    --bg-card: #1c1c1c;              /* panels, cards, sidebar, header, table body */
    --bg-inner: #1f1f1f;             /* subtle raise (table headers, bars, inner sections) */
    --bg-card-hover: #242424;        /* interactive: row hover, selected, chips */
    --bg-input: #242424;             /* inputs sit on the interactive layer */
    --bg-raised-hover: #333333;      /* hover on raised surfaces (buttons) */
    --bg-console: #101010;           /* terminal/log output wells — below base */
    --bg-sidebar: #1c1c1c;
    --bg-sidebar-hover: rgba(var(--ink-rgb),0.05);
    --bg-sidebar-active: rgba(var(--primary-rgb),0.12);

    /* ---- Text — soft white, never pure #fff; AA on their layers */
    --text-primary: #e6e6e6;
    --text-secondary: #c6c6c6;
    --text-muted: #9aa0a6;       --text-muted-rgb: 154,160,166;
    --text-sidebar: #c6c6c6;
    --text-sidebar-hover: #f2f2f2;
    --text-on-accent: #ffffff;       /* icon/initials on solid accent chips */
    --text-on-primary: #161616;      /* text on solid --primary fills (pagination active) */
    --nav-active-bg: #55b1dd;          /* sidebar: the current page's filled pill */
    --nav-active-fg: #0b1620;
    --text-bright: #ffffff;          /* stat numerals — the one intentional pure white */

    /* ---- Borders — low-opacity ink, subtler than gray strokes */
    --border-color: rgba(var(--ink-rgb),0.08);
    --border-color-hover: rgba(var(--ink-rgb),0.16);
    --border-radius: 8px;
    --border-radius-sm: 6px;
    --control-h: 34px;                /* every button, input and select */
    --control-h-sm: 28px;             /* .btn-sm and controls inside table rows */

    /* ---- Shadows & overlays */
    --shadow-sm: 0 1px 3px rgba(var(--shadow-rgb),0.2);
    --shadow-md: 0 4px 12px rgba(var(--shadow-rgb),0.3);
    --shadow-lg: 0 8px 24px rgba(var(--shadow-rgb),0.4);
    --stat-value-shadow: none;  /* depth behind stat numerals; none in light mode */
    --panel-shadow: none;
    --panel-shadow-hover: none;

    /* ---- Chart categorical series (fixed order, CVD-validated per surface —
       revalidate with a palette checker if you change these) */
    --chart-cat-1: #3987e5;  --chart-cat-2: #d95926;
    --chart-cat-3: #199e70;  --chart-cat-4: #c98500;
    --chart-cat-5: #d55181;  --chart-cat-6: #008300;
    --chart-cat-7: #9085e9;  --chart-cat-8: #e66767;
    --chart-tooltip-bg: rgba(20,20,20,0.95);
    --chart-tooltip-border: rgba(20,20,20,0.9);

    /* ---- Layout / misc (not colors, kept with the theme) */
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 52px;
    --sidebar-bg: #1c1c1c;
    --transition: all 0.15s ease;
    --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
}
