/* ==========================================================================
   Shiftboard — design tokens, reset, base
   Palette derived from runtime inspection of the reference product
   (deep blue topbar, cool neutral canvas, 6-col dashlet grid, 14px gutters)
   then re-tuned for contrast and a light/dark pair.
   ========================================================================== */

:root {
  color-scheme: light;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --topbar-h: 56px;
  --sidebar-w: 254px;
  --sidebar-rail: 68px;
  --gutter: 14px;

  --r-xs: 3px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  --dur: 150ms;
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* surfaces */
  --app-bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --surface-3: #e8eef5;
  --surface-hover: #eff5fb;
  --border: #d8e1ea;
  --border-strong: #b7c6d4;

  /* type */
  --heading: #102132;
  --text: #142638;
  --text-2: #44586b;
  --muted: #6b7d8f;
  --faint: #8b9aa9;

  /* brand + accent */
  --brand: #32689b;
  --brand-2: #275580;
  --brand-ink: #ffffff;
  --accent: #2468a2;
  --accent-hover: #1c5789;
  --accent-ink: #17517f;
  --accent-soft: #e3effb;
  --accent-soft-2: #d3e6f9;

  /* status */
  --ok-ink: #146c43;   --ok-bg: #e6f6ee;   --ok-border: #b3e0c7;   --ok-solid: #1a8f5f;
  --warn-ink: #875410; --warn-bg: #fdf3e2; --warn-border: #f0d8a8; --warn-solid: #d2951f;
  --danger-ink: #a2222a; --danger-bg: #fcebeb; --danger-border: #f3c3c3; --danger-solid: #d43a45;
  --info-ink: #0b6376; --info-bg: #e4f4f8; --info-border: #b7e1ea; --info-solid: #2b8aa5;
  --neutral-ink: #4b5d6e; --neutral-bg: #eef1f5; --neutral-border: #d5dee7;

  /* chart */
  --chart-1: #2f6fa7;
  --chart-2: #1a8f5f;
  --chart-3: #d2951f;
  --grid-line: rgba(20, 38, 56, .10);

  /* depth */
  --shadow-1: 0 1px 2px rgba(16, 33, 50, .07);
  --shadow-2: 0 10px 26px rgba(16, 33, 50, .10), 0 2px 4px rgba(16, 33, 50, .06);
  --shadow-pop: 0 26px 64px rgba(9, 20, 32, .28), 0 2px 8px rgba(9, 20, 32, .12);

  --focus: #1f7ad1;
  --scrim: rgba(10, 22, 34, .46);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --app-bg: #161a1f;
  --surface: #23282e;
  --surface-2: #2a3037;
  --surface-3: #313841;
  --surface-hover: #303841;
  --border: #3c454f;
  --border-strong: #54606d;

  --heading: #f3f6f9;
  --text: #e9eef4;
  --text-2: #c3ced9;
  --muted: #98a6b4;
  --faint: #7f8d9b;

  --brand: #283f54;
  --brand-2: #1e3245;
  --brand-ink: #eef4fa;
  --accent: #57a6e8;
  --accent-hover: #7ab9ee;
  --accent-ink: #a9d4f8;
  --accent-soft: #22374a;
  --accent-soft-2: #29445b;

  --ok-ink: #8bd8ad;   --ok-bg: #23362c;   --ok-border: #3d6350;   --ok-solid: #35a473;
  --warn-ink: #f0c584; --warn-bg: #38301f; --warn-border: #6b5733; --warn-solid: #d2a133;
  --danger-ink: #ffa49c; --danger-bg: #3a2427; --danger-border: #6d4046; --danger-solid: #e0565f;
  --info-ink: #92dcec; --info-bg: #1f343b; --info-border: #365e69; --info-solid: #46a7bd;
  --neutral-ink: #b6c2cd; --neutral-bg: #2b333b; --neutral-border: #414b56;

  --chart-1: #5aa9e6;
  --chart-2: #4cc38a;
  --chart-3: #e8b455;
  --grid-line: rgba(233, 240, 247, .12);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 12px 30px rgba(0, 0, 0, .45), 0 2px 4px rgba(0, 0, 0, .3);
  --shadow-pop: 0 28px 70px rgba(0, 0, 0, .6), 0 2px 10px rgba(0, 0, 0, .4);

  --focus: #7cc0f5;
  --scrim: rgba(3, 8, 13, .62);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--app-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4 { color: var(--heading); font-weight: 660; letter-spacing: -.005em; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; }
img { max-width: 100%; }
kbd { font-family: var(--font-mono); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection { background: var(--accent-soft-2); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

/* Utilities */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 999;
  padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-2); font-weight: 650;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 10px; text-decoration: none; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.wrap { flex-wrap: wrap; }
.right { margin-left: auto; }

/* Boot splash */
.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}
.boot__mark {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  box-shadow: var(--shadow-2);
  animation: boot-pulse 1.6s var(--ease) infinite;
}
@keyframes boot-pulse {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-3px); opacity: .82; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
