/* ==========================================================================
   COMSTAT3 mockup: DESIGN TOKENS
   Change fonts, colours, sizes and rounding HERE ONLY. Nothing else needs to be touched.
   ========================================================================== */

:root {
  /* ---- Fonts ----------------------------------------------------------
     To use a web font, add an @import (Google Fonts) or @font-face rule above
     and put its name first in the list, e.g.  "Inter", "Segoe UI", ...        */
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font-body);
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;

  --font-size-base: 15px;      /* body text */
  --font-size-small: 13px;     /* hints, table text */
  --font-size-label: 12px;     /* upper-case row labels */
  --font-size-h1: 22px;
  --font-size-h2: 18px;

  /* ---- Shape and spacing ---------------------------------------------- */
  --radius: 12px;              /* cards */
  --radius-sm: 8px;            /* buttons, inputs */
  --space-1: 6px;
  --space-2: 12px;
  --space-3: 18px;
  --space-4: 28px;
  --sidebar-width: 250px;
  --content-max-width: 1120px;

  /* ---- Colours: light theme (default) -------------------------------- */
  --color-bg: #f2f5f9;
  --color-surface: #ffffff;
  --color-surface-2: #e9eef5;      /* table headers, quiet areas */
  --color-border: #d3dbe7;
  --color-text: #1b2536;
  --color-text-muted: #5a6679;
  --color-primary: #0b6f8f;        /* main buttons, selected items */
  --color-primary-hover: #095b76;
  --color-primary-soft: #dcf0f6;   /* selected row background */
  --color-on-primary: #ffffff;
  --color-danger: #c0392b;
  --color-danger-soft: #fbe9e6;
  --color-warning: #a8650d;
  --color-warning-soft: #fdf1dc;
  --color-ok: #25794f;
  --color-ok-soft: #e1f4ea;
  --color-header-bg: #0d2b3e;      /* top bar */
  --color-header-text: #ffffff;
  --shadow: 0 1px 2px rgba(20, 35, 60, .06), 0 6px 18px rgba(20, 35, 60, .07);
  --shadow-pop: 0 10px 40px rgba(10, 20, 40, .28);
  --canvas-bar: #0b6f8f;           /* histogram bars */
  --canvas-line: #c0392b;          /* threshold line */
}

/* ---- Colours: dark theme. Used automatically when the computer prefers dark mode,
        or when the "Theme" button forces it. ------------------------------------ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0f1722;
    --color-surface: #172233;
    --color-surface-2: #1f2d42;
    --color-border: #2c3d56;
    --color-text: #e4ebf5;
    --color-text-muted: #98a6bb;
    --color-primary: #3fb3d6;
    --color-primary-hover: #66c6e4;
    --color-primary-soft: #153a4b;
    --color-on-primary: #08202b;
    --color-danger: #ff7b6b;
    --color-danger-soft: #3b1f1f;
    --color-warning: #f0b35a;
    --color-warning-soft: #3a2e17;
    --color-ok: #5fd08f;
    --color-ok-soft: #14301f;
    --color-header-bg: #0a1018;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
    --canvas-bar: #3fb3d6;
    --canvas-line: #ff7b6b;
  }
}
:root[data-theme="dark"] {
  --color-bg: #0f1722;
  --color-surface: #172233;
  --color-surface-2: #1f2d42;
  --color-border: #2c3d56;
  --color-text: #e4ebf5;
  --color-text-muted: #98a6bb;
  --color-primary: #3fb3d6;
  --color-primary-hover: #66c6e4;
  --color-primary-soft: #153a4b;
  --color-on-primary: #08202b;
  --color-danger: #ff7b6b;
  --color-danger-soft: #3b1f1f;
  --color-warning: #f0b35a;
  --color-warning-soft: #3a2e17;
  --color-ok: #5fd08f;
  --color-ok-soft: #14301f;
  --color-header-bg: #0a1018;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
  --canvas-bar: #3fb3d6;
  --canvas-line: #ff7b6b;
}
