/* Design tokens. Components reference these only -- never a raw colour value.
   The look (user 2026-11-16, from heroui.com's dashboard demo, in NOS blue): live NOS's own navy ground on dark (user), raised
   panels a step lighter, live NOS's blue as the accent and the focus ring (user: "change purple to blue"), big round cards, and Inter.
   Everything is IN NOS: the font file is web/shared/fonts/InterVariable.woff2 (SIL Open Font
   Licence, Inter-LICENSE.txt beside it); nothing is loaded from heroui.com or any other site
   (user: "a live link can change if they update any design"). The accent and the muted text keep
   4.5:1 on their ground in both themes. NATco's navy stays as --color-brand (portal home panel). */

@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --color-bg: #131a24;
  --color-surface: #1a2330;
  --color-muted: #232e3e;
  --color-border: #344256;
  --color-fg: #f2f3f5;
  --color-fg-muted: #9aa8ba;
  --color-accent: #58a6ff;
  --color-accent-text: #6cb2ff;
  --color-on-accent: #0d1420;
  --color-accent-2: #58a6ff;
  --color-on-accent-2: #0d1420;
  --color-destructive: #f2667f;
  --color-warning: #f5b544;
  --color-info: #5ec6e8;
  --color-ring: #58a6ff;
  --color-overlay: rgba(8, 12, 18, .72);
  --color-brand: #1e2f4a;
  --color-on-brand: #ffffff;
  --color-on-brand-muted: #c9d5e5;

  /* Fields: white on the light theme with a clear border, so a box reads as editable before
     it is clicked (user 2026-11-17: the grey filled fields looked read-only). */
  --color-field: #131a24;
  --color-field-border: #61728b;

  /* Soft layered shadows on the light theme; none on the dark one, where the lighter
     surface already lifts a card off the page. */
  --shadow-surface: 0 0 0 0 transparent;
  --shadow-overlay: 0 0 0 0 transparent;

  /* 4/8px rhythm */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --control-h: 38px;
  --control-h-sm: 30px;

  /* System faces only -- the design system forbids fetching from a CDN. */
  --font-ui: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "Courier New", monospace;

  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 17px;
  --text-xl: 24px;

  --transition: 200ms cubic-bezier(.32, .72, 0, 1);
  --sidebar-width: 248px;
}

/* The light palette, twice: once for the explicit toggle, once for the OS
   preference. Plain CSS has no way to share one block between a media query and a
   bare selector, so THESE TWO MUST BE KEPT IN STEP. */
:root[data-theme="light"] {
  color-scheme: light;

  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-muted: #eef1f5;
  --color-border: #e3e7ee;
  --color-fg: #151922;
  --color-fg-muted: #586273;
  --color-accent: #1663c7;
  --color-accent-text: #1663c7;
  --color-on-accent: #ffffff;
  --color-accent-2: #1663c7;
  --color-on-accent-2: #ffffff;
  --color-destructive: #d11f3d;
  --color-warning: #b45309;
  --color-info: #0b7285;
  --color-ring: #1663c7;
  --color-overlay: rgba(0, 0, 0, .5);
  --color-brand: #2f4669;
  --color-on-brand: #ffffff;
  --color-on-brand-muted: #d9e2ee;
  --color-field: #ffffff;
  --color-field-border: #8a95a5;
  --shadow-surface: 0 2px 4px 0 rgba(0, 0, 0, .04), 0 1px 2px 0 rgba(0, 0, 0, .06), 0 0 1px 0 rgba(0, 0, 0, .06);
  --shadow-overlay: 0 4px 16px 0 rgba(24, 24, 27, .08), 0 8px 24px 0 rgba(24, 24, 27, .09);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --color-bg: #f5f7fa;
    --color-surface: #ffffff;
    --color-muted: #eef1f5;
    --color-border: #e3e7ee;
    --color-fg: #151922;
    --color-fg-muted: #586273;
    --color-accent: #1663c7;
    --color-accent-text: #1663c7;
    --color-on-accent: #ffffff;
    --color-accent-2: #1663c7;
    --color-on-accent-2: #ffffff;
    --color-destructive: #d11f3d;
    --color-warning: #b45309;
    --color-info: #0b7285;
    --color-ring: #1663c7;
    --color-overlay: rgba(0, 0, 0, .5);
    --color-brand: #2f4669;
    --color-on-brand: #ffffff;
    --color-on-brand-muted: #d9e2ee;
    --color-field: #ffffff;
    --color-field-border: #8a95a5;
    --shadow-surface: 0 2px 4px 0 rgba(0, 0, 0, .04), 0 1px 2px 0 rgba(0, 0, 0, .06), 0 0 1px 0 rgba(0, 0, 0, .06);
    --shadow-overlay: 0 4px 16px 0 rgba(24, 24, 27, .08), 0 8px 24px 0 rgba(24, 24, 27, .09);
  }
}

/* State -> token. Status is the most-scanned column, so the mapping is fixed
   here rather than chosen per component. */
.status-active, .status-ok, .status-succeeded { --status-color: var(--color-accent); }
.status-pending, .status-disabled             { --status-color: var(--color-fg-muted); }
.status-locked, .status-failed                { --status-color: var(--color-destructive); }
.status-info                                  { --status-color: var(--color-info); }
.status-warning                               { --status-color: var(--color-warning); }

/* Worker state -> token. The states that mean nothing is being processed are
   red: as plain text they would read as healthy as the rest. */
.state-running, .state-watching              { --status-color: var(--color-accent); }
.state-waiting                               { --status-color: var(--color-info); }
.state-paused                                { --status-color: var(--color-warning); }
.state-stale, .state-not-running             { --status-color: var(--color-destructive); }
