/* Server Manager design tokens (docs/MANAGER.md, "Design system").
   Dark is the default. Light is set with <html data-theme="light">; "system" follows the OS.
   Every colour, size and timing used by components.css comes from here. */
:root {
  /* type */
  --font-sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", ui-monospace, Consolas, "Liberation Mono", monospace;
  --fs-xs: 11px; --fs-sm: 12.5px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 26px; --fs-3xl: 32px;
  --lh-tight: 1.2; --lh: 1.5;
  --fw-normal: 450; --fw-medium: 550; --fw-bold: 650;
  --tracking-tight: -0.011em; --tracking-caps: 0.06em;

  /* space (4 px grid) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* shape */
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-pill: 999px;

  /* layout */
  --sidebar-w: 248px; --topbar-h: 56px; --content-max: 1440px; --gutter: 24px;

  /* motion */
  --ease: cubic-bezier(.2, .8, .2, 1); --ease-in: cubic-bezier(.4, 0, 1, 1);
  --t-fast: 120ms; --t-med: 200ms; --t-slow: 320ms;

  /* layers */
  --z-sticky: 10; --z-sidebar: 40; --z-overlay: 50; --z-modal: 60; --z-toast: 70; --z-tip: 80;
}

/* ---------------------------------------------------------------- dark (default) */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0c0f;
  --bg-sunken: #07090b;
  --surface: #111418;
  --surface-2: #161a1f;
  --surface-3: #1d2228;
  --surface-hover: #1a1f25;
  --border: #22282f;
  --border-strong: #2f363f;
  --text: #e8ebef;
  --text-2: #a3acb7;
  --text-3: #6c7682;
  --text-inverse: #0a0c0f;

  --accent: #e0b65a;
  --accent-strong: #f0c870;
  --accent-ink: #1a1408;
  --accent-bg: #d4a94e;
  --accent-soft: rgba(212, 169, 78, .15);

  --good: #3ecf8e; --good-soft: rgba(62, 207, 142, .13);
  --warn: #f5a524; --warn-soft: rgba(245, 165, 36, .14);
  --bad: #f0565b;  --bad-soft: rgba(240, 86, 91, .14);
  --info: #4cc2ff; --info-soft: rgba(76, 194, 255, .13);
  --muted-soft: rgba(163, 172, 183, .12);

  --focus: 0 0 0 2px var(--bg), 0 0 0 4px rgba(107, 140, 255, .55);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .35);
  --backdrop: rgba(3, 5, 8, .62);

  --console-bg: #07090b; --console-text: #d3d9e0; --console-dim: #5d6772;
  --console-note: #f5c84c; --console-err: #ff7b72; --console-cmd: #79c0ff; --console-good: #56d364;

  /* charts: series and the tick-time scale (fast → slow) */
  --c1: #6b8cff; --c2: #3ecf8e; --c3: #f5a524; --c4: #c084fc; --c5: #4cc2ff; --c6: #f472b6;
  --tick-0: #1f9d6b; --tick-1: #3ecf8e; --tick-2: #a3d955; --tick-3: #f5d524; --tick-4: #f5a524; --tick-5: #f07a3c; --tick-6: #f0565b; --tick-7: #c2185b;
  --grid: rgba(255, 255, 255, .06);
  --skeleton-a: #161a1f; --skeleton-b: #1f252c;
}

/* ---------------------------------------------------------------- light */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f9;
  --bg-sunken: #eef0f3;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f1f3f6;
  --surface-hover: #f4f6f8;
  --border: #e3e7ec;
  --border-strong: #d3d9e0;
  --text: #0e1217;
  --text-2: #4f5a66;
  --text-3: #808b97;
  --text-inverse: #ffffff;

  --accent: #a87b1f;
  --accent-strong: #8c6614;
  --accent-ink: #ffffff;
  --accent-bg: #b8862a;
  --accent-soft: rgba(184, 134, 42, .12);

  --good: #0f9960; --good-soft: rgba(15, 153, 96, .1);
  --warn: #b86e00; --warn-soft: rgba(229, 140, 0, .13);
  --bad: #d92d3a;  --bad-soft: rgba(217, 45, 58, .1);
  --info: #0b7fc1; --info-soft: rgba(11, 127, 193, .1);
  --muted-soft: rgba(79, 90, 102, .09);

  --focus: 0 0 0 2px var(--bg), 0 0 0 4px rgba(61, 90, 254, .45);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, .18), 0 2px 8px rgba(16, 24, 40, .08);
  --backdrop: rgba(14, 18, 23, .38);

  --console-bg: #0d1117; --console-text: #d3d9e0; --console-dim: #6e7681;

  --c1: #3d5afe; --c2: #0f9960; --c3: #e58c00; --c4: #8b5cf6; --c5: #0b7fc1; --c6: #db2777;
  --grid: rgba(14, 18, 23, .07);
  --skeleton-a: #eef0f3; --skeleton-b: #e3e7ec;
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    color-scheme: light;
    --bg: #f6f7f9; --bg-sunken: #eef0f3; --surface: #ffffff; --surface-2: #f9fafb; --surface-3: #f1f3f6; --surface-hover: #f4f6f8;
    --border: #e3e7ec; --border-strong: #d3d9e0; --text: #0e1217; --text-2: #4f5a66; --text-3: #808b97; --text-inverse: #ffffff;
    --accent: #3d5afe; --accent-strong: #2c46e0; --accent-bg: #3d5afe; --accent-soft: rgba(61, 90, 254, .1);
    --good: #0f9960; --good-soft: rgba(15, 153, 96, .1); --warn: #b86e00; --warn-soft: rgba(229, 140, 0, .13);
    --bad: #d92d3a; --bad-soft: rgba(217, 45, 58, .1); --info: #0b7fc1; --info-soft: rgba(11, 127, 193, .1); --muted-soft: rgba(79, 90, 102, .09);
    --focus: 0 0 0 2px var(--bg), 0 0 0 4px rgba(61, 90, 254, .45);
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06); --shadow-md: 0 4px 14px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-lg: 0 24px 60px rgba(16, 24, 40, .18), 0 2px 8px rgba(16, 24, 40, .08); --backdrop: rgba(14, 18, 23, .38);
    --console-bg: #0d1117;
    --c1: #3d5afe; --c2: #0f9960; --c3: #e58c00; --c4: #8b5cf6; --c5: #0b7fc1; --c6: #db2777;
    --grid: rgba(14, 18, 23, .07); --skeleton-a: #eef0f3; --skeleton-b: #e3e7ec;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --t-fast: 0ms; --t-med: 0ms; --t-slow: 0ms; }
}
