/* ── Theme: dark (the default) ─────────────────────────────────────────────
   Semantic tokens only (DESIGN.md §1, layer 2). A theme is one file of
   these overrides; theme-light.css redefines every colour token below.
   Status colours come in pairs: --x (foreground) with --x-dim
   (background); tests/js/design-tokens.test.js checks each pair, and the
   text tokens, reach 4.5:1 in both themes. Version D palette
   (2026-10-06): deeper canvas, orange = needs action, red = broken. */
:root {
    color-scheme: dark;
    --bg:            var(--p-night-950);
    --surface:       var(--p-night-900);
    --surface-2:     var(--p-night-850);
    --surface-3:     var(--p-night-800);
    --sunken:        var(--p-night-920);
    --hover:         var(--p-night-800);   /* row and control hover */
    --rail-bg:       var(--p-night-920);   /* the sidebar, a step below the page */
    --border:        var(--p-night-750);
    --border-strong: var(--p-night-500);   /* input borders 3:1 (DESIGN.md §2) */
    --border-sub:    var(--p-night-750);
    --text:          var(--p-night-50);
    --text-2:        var(--p-night-200);
    --text-3:        var(--p-night-300);

    --accent:        var(--p-teal-400);
    --accent-hover:  var(--p-teal-300);
    --accent-text:   var(--p-teal-300);
    --accent-dim:    rgba(0,212,184,0.12);
    --accent-border: rgba(0,212,184,0.38);
    --btn-accent-text: var(--p-teal-950);
    --on-accent:     var(--p-teal-950);
    --focus:         var(--p-teal-400);

    --warn:          var(--p-orange-400);
    --warn-dim:      rgba(251,146,60,0.14);
    --error:         var(--p-red-400);
    --error-dim:     rgba(248,113,113,0.13);
    --success:       var(--p-green-400);
    --success-dim:   rgba(52,211,153,0.12);
    --info:          var(--p-blue-300);
    --info-dim:      rgba(96,165,250,0.13);
    --ghost:         var(--p-slate-300);
    --ghost-dim:     rgba(148,163,184,0.13);
    /* Conflict = "sources disagree": its own hue, never blended into warn. */
    --conflict:      var(--p-magenta-400);
    --conflict-dim:  rgba(232,121,249,0.12);

    /* Chart series: canvas code reads these at draw time. */
    --chart-1:       var(--p-chart-blue-400);
    --chart-2:       var(--p-chart-violet-400);
    --chart-3:       var(--p-chart-green-400);
    --chart-4:       var(--p-chart-amber-400);
    --chart-5:       var(--p-chart-cyan-400);
    --chart-6:       var(--p-chart-rose-400);
    /* Chart-only second red (the donut's "No S1 agent"): its pill shares
       Unmanaged's --error; the rose --chart-6 was 1.03:1 against it here. */
    --chart-error-2: var(--p-chart-red-600);
    --chart-axis:    rgba(130,160,180,0.28);
    --chart-grid:    rgba(130,160,180,0.10);

    --overlay-bg:       rgba(5,8,12,0.72);
    --login-overlay-bg: rgba(5,8,12,0.88);
    --scrim:            rgba(5,8,12,0.45);
    --stripe-bg:        rgba(255,255,255,0.02);
    --shadow-1: 0 1px 2px rgba(0,0,0,0.30);
    --shadow-2: 0 8px 24px rgba(0,0,0,0.35);
    --shadow-3: 0 28px 70px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.04);

    --body-font-size:    14px;
    --body-font-weight:  450;
    --table-font-size:   13.5px;
    --table-font-weight: 450;
    --mono-font-weight:  500;

    /* Icons drawn as CSS backgrounds (select chevron, date picker): a
       background image cannot take a var() colour, so each theme embeds
       the icon from static/lib/icons.js in its own --text-3 (tests/js/icons.test.js
       keeps the path data in step). */
    --icon-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b98ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --icon-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b98ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E");
}
