/* Shared design tokens for the engine-monitor UI (dashboard + login +
   privacy/imprint). Light is the default brand palette (green/status
   accents); dark follows the agreed reference: navy/anthracite with
   blue/green functional accents. Same component structure in both. */

:root {
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --panel: #ffffff;
  --panel-hover: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --accent: #16a34a; /* primary brand accent stays green in light mode */
  --accent-contrast: #ffffff;
  --interactive: #2563eb; /* blue only as a secondary interactive color */
  --ok-bg: #dcfce7;
  --ok-fg: #15803d;
  --warn-bg: #fef3c7;
  --warn-fg: #b45309;
  --err-bg: #fee2e2;
  --err-fg: #b91c1c;
  --neutral-bg: #e2e8f0;
  --neutral-fg: #475569;
  --icon-blue-bg: #dbeafe;
  --icon-blue-fg: #2563eb;
  --icon-green-bg: #dcfce7;
  --icon-green-fg: #16a34a;
  --icon-purple-bg: #f3e8ff;
  --icon-purple-fg: #9333ea;
  --icon-orange-bg: #ffedd5;
  --icon-orange-fg: #c2410c;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --radius: 8px;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0b1120;
  --bg-elevated: #0f172a;
  --panel: #111827;
  --panel-hover: #1a2436;
  --border: #1f2937;
  --text: #e5e7eb;
  --text-muted: #94a3b8;
  --accent: #2563eb; /* primary functional accent is blue in dark mode, per reference */
  --accent-contrast: #ffffff;
  --interactive: #2563eb;
  --ok-bg: rgba(34, 197, 94, 0.16);
  --ok-fg: #4ade80;
  --warn-bg: rgba(245, 158, 11, 0.16);
  --warn-fg: #fbbf24;
  --err-bg: rgba(239, 68, 68, 0.16);
  --err-fg: #f87171;
  --neutral-bg: rgba(148, 163, 184, 0.16);
  --neutral-fg: #94a3b8;
  --icon-blue-bg: rgba(59, 130, 246, 0.18);
  --icon-blue-fg: #60a5fa;
  --icon-green-bg: rgba(34, 197, 94, 0.18);
  --icon-green-fg: #4ade80;
  --icon-purple-bg: rgba(168, 85, 247, 0.18);
  --icon-purple-fg: #c084fc;
  --icon-orange-bg: rgba(249, 115, 22, 0.18);
  --icon-orange-fg: #fb923c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0b1120;
    --bg-elevated: #0f172a;
    --panel: #111827;
    --panel-hover: #1a2436;
    --border: #1f2937;
    --text: #e5e7eb;
    --text-muted: #94a3b8;
    --accent: #2563eb;
    --accent-contrast: #ffffff;
    --interactive: #2563eb;
    --ok-bg: rgba(34, 197, 94, 0.16);
    --ok-fg: #4ade80;
    --warn-bg: rgba(245, 158, 11, 0.16);
    --warn-fg: #fbbf24;
    --err-bg: rgba(239, 68, 68, 0.16);
    --err-fg: #f87171;
    --neutral-bg: rgba(148, 163, 184, 0.16);
    --neutral-fg: #94a3b8;
    --icon-blue-bg: rgba(59, 130, 246, 0.18);
    --icon-blue-fg: #60a5fa;
    --icon-green-bg: rgba(34, 197, 94, 0.18);
    --icon-green-fg: #4ade80;
    --icon-purple-bg: rgba(168, 85, 247, 0.18);
    --icon-purple-fg: #c084fc;
    --icon-orange-bg: rgba(249, 115, 22, 0.18);
    --icon-orange-fg: #fb923c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-muted);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--panel-hover); color: var(--text); }
.theme-toggle svg { width: 16px; height: 16px; }
