/* ==========================================================================
 * Digital Twin CBM — Theme & Design System Tokens
 * Preserves the full industrial palette, RAG semantics, Zone Pulse dark canvas,
 * and Gauge panel surfaces extracted from TPower.
 * ========================================================================== */

:root {
  /* Core UI Chrome & Card Surfaces */
  --bg: #0f1724;
  --bg-elev: #162135;
  --surface: #f4f6f9;
  --panel: #ffffff;
  --panel-muted: #f8fafc;
  --ink: #1a2333;
  --ink-strong: #0f172a;
  --muted: #64748b;
  --border: #dfe4ec;
  --border-strong: #cbd5e1;

  /* Primary Brand & State Accents */
  --accent: #0b5fff;
  --accent-strong: #0848c9;
  --accent-soft: #eef4ff;
  --danger: #d92d20;
  --danger-soft: #fef2f2;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --success: #047857;
  --success-soft: #ecfdf5;

  /* RAG Status Tokens (ISO-friendly neutral status palette) */
  --rag-green: #16a34a;
  --rag-green-bg: #dcfce7;
  --rag-amber: #f59e0b;
  --rag-amber-bg: #fef3c7;
  --rag-red: #dc2626;
  --rag-red-bg: #fee2e2;
  --rag-grey: #6b7280;
  --rag-grey-bg: #e5e7eb;

  /* Spatial Zone / Scope Accent Colors */
  --zone1: #2563eb;
  --zone2: #0891b2;
  --zone3: #7c3aed;
  --zone4: #059669;

  /* Telemetry Pulse Dark Theme Tokens (.zone-pulse) */
  --zp-bg: #0b1220;
  --zp-surface: #121c2f;
  --zp-surface-2: #18253d;
  --zp-border: #24344f;
  --zp-ink: #f1f5f9;
  --zp-muted: #94a3b8;
  --zp-accent: #38bdf8;

  /* Gauge Panel Dark Theme Tokens (.zgp-panel) */
  --zgp-bg: #0f172a;
  --zgp-card: #162033;
  --zgp-border: #29364f;
  --zgp-ink: #f8fafc;
  --zgp-muted: #94a3b8;
  --zgp-track: #1e293b;

  /* Layout & Elevation */
  --header-h: 58px;
  --sidebar-w: 242px;
  --sidebar-collapsed-w: 68px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 14px 34px rgba(2, 6, 23, 0.25);

  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* Optional Full Dark Workspace Theme Toggle (root[data-theme="dark"]) */
:root[data-theme="dark"] {
  --surface: #0b1120;
  --panel: #131c31;
  --panel-muted: #18233c;
  --ink: #e2e8f0;
  --ink-strong: #f8fafc;
  --muted: #94a3b8;
  --border: #25334d;
  --border-strong: #334155;
  --accent-soft: #172554;
  --danger-soft: #450a0a;
  --warning-soft: #451a03;
  --success-soft: #064e3b;
  --rag-green-bg: rgba(22, 163, 74, 0.18);
  --rag-amber-bg: rgba(245, 158, 11, 0.18);
  --rag-red-bg: rgba(220, 38, 38, 0.2);
  --rag-grey-bg: rgba(107, 114, 128, 0.22);
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: var(--font-mono);
}

.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;
}

.hidden {
  display: none !important;
}

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

.mono {
  font-family: var(--font-mono);
}
