/* ── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Background layers (dark mode = default) */
  --bg-primary: #060a0e;
  --bg-surface: #0c1218;
  --bg-elevated: #111921;
  --bg-hover: #161f2a;

  /* Borders */
  --border: #1a2535;
  --border-active: #2a3a4f;

  /* Accent: Amber intelligence theme */
  --accent: #f0a500;
  --accent-bright: #ffbf40;
  --accent-dim: #7a5200;
  --accent-glow: rgba(240, 165, 0, 0.15);

  /* Semantic colors */
  --success: #00e68a;
  --danger: #ff4560;
  --info: #00b4ff;
  --purple: #a855f7;
  --cyan: #06d6a0;

  /* Text */
  --text-primary: #d0dce8;
  --text-secondary: #6b8199;
  --text-muted: #3d5468;

  /* Chart grid */
  --chart-grid: rgba(26, 37, 53, 0.7);
  --chart-text: #3d5468;

  /* Typography */
  --font-mono: 'IBM Plex Mono', 'Fira Code', monospace;
  --font-sans: 'IBM Plex Sans', -apple-system, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Radius */
  --radius-sm: 2px;
  --radius-md: 4px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-med: 0.3s ease;
}

/* ── Light Mode ───────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-primary: #f0f2f5;
  --bg-surface: #ffffff;
  --bg-elevated: #f7f8fa;
  --bg-hover: #ebedf0;

  --border: #d4d9e0;
  --border-active: #bbc3cd;

  --accent: #c88500;
  --accent-bright: #e09800;
  --accent-dim: #c8850033;
  --accent-glow: rgba(200, 133, 0, 0.08);

  --text-primary: #1a2233;
  --text-secondary: #5a6a7e;
  --text-muted: #8a96a6;

  --chart-grid: rgba(0, 0, 0, 0.06);
  --chart-text: #5a6a7e;
}

[data-theme="light"] body::after {
  display: none;
}

/* ── Reset & Base ──────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition-med), color var(--transition-med);
}

/* Subtle scanline overlay for intel feel (dark mode only) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg,
      transparent 0px,
      transparent 2px,
      rgba(0, 0, 0, 0.03) 2px,
      rgba(0, 0, 0, 0.03) 4px);
  pointer-events: none;
  z-index: 9999;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-bright);
}

/* ── Typography ────────────────────────────────────────────────────────── */
.mono {
  font-family: var(--font-mono);
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-accent {
  color: var(--accent);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-info {
  color: var(--info);
}

.label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}