/* VroomDesk design tokens (P6.M).
 *
 * Pages used to inline ~80 lines of repeated CSS each — every
 * static/*.html and static/admin/*.html. This file centralizes the palette,
 * typography, spacing, and the small set of components (.card, .btn, .table,
 * .modal, .toast, .pill) actually used by the panels. Pages keep their
 * unique-to-them styles inline; the shared bits live here.
 *
 * No build step — it's a single static file referenced via:
 *   <link rel="stylesheet" href="/static/theme.css">
 */

:root {
  /* Palette */
  --bg: #131313;
  --bg-card: rgba(34, 34, 33, 0.5);
  --bg-input: rgba(20, 20, 20, 0.7);
  --fg: #e7e5e4;
  --fg-muted: #a8a6a3;
  --fg-faint: #8e8d8b;
  --fg-empty: #6e6c69;
  --accent: #4edea3;
  --accent-hover: #5fe8b0;
  --accent-on: #0c1b16;
  --danger: #fca5a5;
  --danger-bg: rgba(239, 68, 68, 0.18);
  --danger-bg-hover: rgba(239, 68, 68, 0.28);
  --danger-border: rgba(239, 68, 68, 0.4);
  --warn: #f1c40f;
  --border: rgba(255, 255, 255, 0.08);
  --border-faint: rgba(255, 255, 255, 0.05);
  --hover-row: rgba(78, 222, 163, 0.04);

  /* Typography */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --text-xs: 10px;
  --text-sm: 11px;
  --text-base: 12px;
  --text-md: 13px;
  --text-lg: 14px;
  --text-xl: 18px;

  /* Spacing */
  --gap-1: 4px;
  --gap-2: 6px;
  --gap-3: 8px;
  --gap-4: 12px;
  --gap-5: 16px;
  --gap-6: 22px;

  /* Radius */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-pill: 999px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}

/* Layout helpers */
.crumbs { font-size: var(--text-sm); color: var(--fg-faint); margin-bottom: var(--gap-2); }
.crumbs a { color: var(--accent); text-decoration: none; }
h1 { font-size: var(--text-xl); margin: 0 0 var(--gap-1) 0; font-weight: 600; }
.sub { font-size: var(--text-base); color: var(--fg-faint); margin-bottom: var(--gap-5); }

/* Buttons */
button, .btn {
  background: var(--accent); color: var(--accent-on);
  border: none; border-radius: var(--radius);
  padding: var(--gap-2) var(--gap-4);
  font-family: inherit; font-size: var(--text-md); font-weight: 600;
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--accent-hover); }
button.ghost, .btn.ghost {
  background: transparent; color: var(--fg-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
button.ghost:hover, .btn.ghost:hover {
  color: var(--accent); border-color: rgba(78, 222, 163, 0.35);
}
button.danger, .btn.danger {
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid var(--danger-border);
}
button.danger:hover, .btn.danger:hover { background: var(--danger-bg-hover); }
button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Inputs */
input, select, textarea {
  background: var(--bg-input); color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--gap-2) var(--gap-3);
  font-family: inherit; font-size: var(--text-md); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: rgba(78, 222, 163, 0.55); }

/* Tables */
table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg); overflow: hidden;
  font-size: var(--text-base);
}
th, td {
  text-align: left; padding: var(--gap-3) var(--gap-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}
th {
  background: rgba(20, 20, 20, 0.6);
  font-weight: 600; color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: 0.3px; font-size: var(--text-xs);
}
tr:hover td { background: var(--hover-row); }
.empty { text-align: center; padding: 40px; color: var(--fg-empty); }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 14px var(--gap-5);
}

/* Pills */
.pill {
  display: inline-block; padding: 1px var(--gap-2);
  font-size: var(--text-xs); border-radius: var(--radius-pill);
}
.pill.yes, .pill.active {
  background: rgba(78, 222, 163, 0.12); color: var(--accent);
  border: 1px solid rgba(78, 222, 163, 0.3);
}
.pill.no, .pill.dead {
  background: rgba(239, 68, 68, 0.10); color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.pill.super, .pill.imp {
  background: rgba(239, 68, 68, 0.16); color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.45);
}
.pill.warn {
  background: rgba(241, 196, 15, 0.10); color: var(--warn);
  border: 1px solid rgba(241, 196, 15, 0.3);
}

/* Modal — accessible */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6); z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-backdrop.show { display: flex; }
.modal-card {
  background: #1a1a1a; border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: var(--gap-6);
  width: 380px; max-width: 92vw;
}

/* Toast — surfaced via window.toast() in header.js */
.toast {
  position: fixed; bottom: var(--gap-5); left: 50%; transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(78, 222, 163, 0.4);
  color: var(--fg);
  padding: var(--gap-3) 14px;
  border-radius: var(--radius);
  font-size: var(--text-base);
  opacity: 0; transition: opacity 0.15s; pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.error { border-color: rgba(239, 68, 68, 0.6); }

/* Accessibility helpers */
.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;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
