/* ═══════════════════════════════════════════════════════════════
   Trellar — Design Tokens (single source of truth)
   Source: Figma "Trellar — Design System" → Foundations
   (Color, Radius, Spacing, Typography).

   RULES
   - This is the ONLY place the core palette is defined.
   - Load this file BEFORE any page stylesheet.
   - Page CSS must not redeclare these tokens in its own :root.
   - Never hardcode core colors (hex / rgb) — use the tokens below.
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* ─── Brand & ink ─── */
    --brand-primary:        #915ff0;                 /* Actions · links · selection */
    --brand-primary-hover:  #6828d2;                 /* Figma Controls/Button · Primary · Hover */
    --brand-primary-active: var(--primary-700);
    --ink-primary:          #1e1b4b;                 /* Text · icons · key information */
    --ink-muted:            #77748d;                 /* Secondary text, labels, inactive icons */

    /* RGB triplets, for translucent tints:  rgba(var(--brand-primary-rgb), 0.12) */
    --brand-primary-rgb:    145, 95, 240;
    --ink-primary-rgb:      30, 27, 75;

    /* ─── Surfaces ─── */
    --bg-page:  #f9f8fc;                             /* Application canvas */
    --bg-card:  #ffffff;                             /* Cards & content */
    --bg-hover: #ece7f8;                             /* Hover & soft emphasis */

    /* ─── Boundaries (translucent ink, not solid gray) ─── */
    --border-light: rgba(30, 27, 75, 0.16);          /* Dividers & control outlines */
    --border-card:  rgba(30, 27, 75, 0.12);          /* Quiet card boundaries */

    /* ─── Disabled ─── */
    --disabled-bg: #efedf3;
    --disabled-fg: #aaa7b8;

    /* ─── Severity (foreground + soft background). Labels carry meaning, not color alone ─── */
    --severity-critical:    #a43d67;
    --severity-critical-bg: #f7eaf0;
    --severity-high:        #a15b32;
    --severity-high-bg:     #faefe6;
    --severity-medium:      #806622;
    --severity-medium-bg:   #f6f1df;
    --severity-low:         #41746c;
    --severity-low-bg:      #eaf3f0;

    /* ─── Overlay (modal backdrop) ─── */
    --overlay-backdrop: rgba(30, 27, 75, 0.28);

    /* ─── Data-viz series (donut / legends) ─── */
    --series-1: var(--primary-500);
    --series-2: var(--primary-300);
    --series-3: var(--primary-700);
    --series-4: var(--primary-100);

    /* ─── Primary scale ───
       NOTE: as designed in Figma, primary-800 (#6600ff) is a vivid violet that is
       brighter than primary-700 (#532c97). The scale is not monotonic, so do NOT
       use primary-800 for hover/pressed states — use the --brand-primary-* tokens. */
    --primary-50:  #ededfa;                          /* Subtle tinted backgrounds */
    --primary-100: #e2e1fc;                          /* Selected-row backgrounds */
    --primary-200: #d8cff7;                          /* Light borders, chart fill */
    --primary-300: #ccadfc;                          /* Secondary accents */
    --primary-400: #aa73fd;                          /* Icons, links */
    --primary-500: #915ff0;                          /* Brand anchor — buttons, links */
    --primary-600: #883afe;                          /* Hover */
    --primary-700: #532c97;                          /* Active / pressed */
    --primary-800: #6600ff;                          /* High-emphasis accents (see note) */
    --primary-900: #290e56;                          /* Darkest, rare — high-contrast text */

    /* ─── Spacing: small values within a group, larger between groups ─── */
    --space-1: 4px;                                  /* Tight detail */
    --space-2: 8px;                                  /* Related elements */
    --space-3: 12px;                                 /* Control internals */
    --space-4: 16px;                                 /* Component rhythm */
    --space-5: 24px;                                 /* Card padding */
    --space-6: 32px;                                 /* Section grouping */
    --space-7: 48px;                                 /* Major separation */

    /* ─── Radius: one value per component family ─── */
    --radius-sm: 8px;                                /* Controls & inputs */
    --radius-md: 14px;                               /* Compact cards */
    --radius-lg: 20px;                               /* Content panels */
    --radius-xl: 28px;                               /* Large containers */

    /* ─── Typography families ─── */
    --font-ui:      'Exo 2', sans-serif;             /* Body & UI */
    --font-heading: 'Fredoka', sans-serif;           /* Headings & display */
    --font-data:    'JetBrains Mono', monospace;     /* Scores, counts, IDs, time */

    /* Type roles (size / line-height) — Trellar/Body, Small, Data, Metric */
    --text-body-size:   14px;  --text-body-line:   22px;
    --text-small-size:  12px;  --text-small-line:  18px;
    --text-metric-size: 36px;  --text-metric-line: 44px;   /* JetBrains Mono Bold */

    /* ─── Legacy aliases (keep existing page CSS working) ─── */
    --accent-purple: var(--brand-primary);
    --text-primary:  var(--ink-primary);

    /* ─── Not defined in Figma yet — kept as-is until designed ─── */
    --text-secondary: #5b5780;
    --text-muted:     #7d7999;
    --accent-orange:  rgba(176, 113, 49, 0.9);       /* Legacy; reserved for a later pass */
    --accent-green:   #16a34a;
    --accent-teal:    #0f766e;
    --accent-red:     #dc2626;
}
