/* ============ EFI Garage design system ============ */
:root {
  --bg: #0b0e13;
  --bg-elev: #10141c;
  --surface: #141a24;
  --surface-2: #1a2230;
  --border: #232d3d;
  --border-strong: #31405a;
  --text: #e8eef5;
  --text-muted: #93a1b5;
  --text-faint: #5d6b80;
  --accent: #2dd4bf;          /* teal — primary actions */
  --accent-dim: #14b8a6;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --amber: #f5a623;           /* warnings, knock, highlights */
  --red: #f4577b;
  --blue: #5aa9fa;
  --green: #4ade80;
  --purple: #b58cf7;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --radius: 10px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }

.boot-splash { display: grid; place-items: center; height: 100vh; }
.boot-logo { font-size: 28px; font-weight: 800; letter-spacing: 0.04em; }
.boot-logo span { color: var(--accent); }

/* ---- App layout ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 228px; flex-shrink: 0; background: var(--bg-elev);
  border-right: 1px solid var(--border); padding: 18px 12px;
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .logo {
  font-size: 19px; font-weight: 800; letter-spacing: 0.04em; padding: 4px 10px 16px;
  color: var(--text); display: block;
}
.sidebar .logo span { color: var(--accent); }
.sidebar .nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); padding: 14px 10px 4px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--text-muted); font-weight: 500; font-size: 14px;
}
.nav-link:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.nav-link .ico { width: 18px; text-align: center; }
.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--bg-elev);
  position: sticky; top: 0; z-index: 40;
}
.content { padding: 24px; max-width: 1400px; margin: 0 auto; }
.content.narrow { max-width: 860px; }

/* ---- Components ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.card.pad-lg { padding: 26px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px;
  border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer;
  font-family: var(--sans); transition: all 0.12s;
}
.btn:hover { border-color: var(--accent-dim); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #06281f; }
.btn.primary:hover { background: #43e0cb; }
.btn.danger { color: var(--red); border-color: rgba(244, 87, 123, 0.4); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--bg-elev); color: var(--text); font-family: var(--sans); font-size: 14px;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent-dim); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }

.badge {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.amber { background: rgba(245, 166, 35, 0.12); color: var(--amber); border-color: transparent; }
.badge.red { background: rgba(244, 87, 123, 0.12); color: var(--red); border-color: transparent; }
.badge.blue { background: rgba(90, 169, 250, 0.12); color: var(--blue); border-color: transparent; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 8px 12px; color: var(--text-faint); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border);
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table tr:hover td { background: rgba(255, 255, 255, 0.015); }
.table .num { font-family: var(--mono); font-size: 12.5px; }

.stat-tile { padding: 16px 18px; }
.stat-tile .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.stat-tile .stat-value { font-size: 26px; font-weight: 700; font-family: var(--mono); margin-top: 2px; }
.stat-tile .stat-sub { font-size: 12px; color: var(--text-faint); }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; }
.avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px;
}

.empty {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty .empty-icon { font-size: 34px; margin-bottom: 10px; }

.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 11px 16px; box-shadow: var(--shadow); font-size: 13.5px; animation: slide-in 0.18s ease;
}
.toast.error { border-color: var(--red); }
.toast.success { border-color: var(--accent-dim); }
@keyframes slide-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4, 6, 10, 0.7); z-index: 90;
  display: grid; place-items: center; padding: 24px;
}
.modal {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px;
  padding: 24px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal.wide { max-width: 780px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  padding: 9px 16px; font-weight: 600; font-size: 13.5px; color: var(--text-muted);
  border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; font-family: var(--sans);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--text-muted); font-size: 13.5px; margin-top: 3px; }

.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 40px;
  text-align: center; color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent-dim); background: var(--accent-soft); color: var(--text); }

.spinner {
  width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Chart containers */
.chart-box { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; overflow-x: auto; }
.chart-box svg { max-width: 100%; height: auto; }

/* Landing */
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; max-width: 1200px; margin: 0 auto; }
.hero { text-align: center; padding: 90px 24px 60px; max-width: 900px; margin: 0 auto; }
.hero h1 { font-size: 46px; line-height: 1.12; letter-spacing: -0.02em; }
.hero .tagline { font-size: 18px; color: var(--text-muted); max-width: 640px; margin: 18px auto 30px; }
.hero-glow {
  position: absolute; top: -120px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 400px; pointer-events: none;
  background: radial-gradient(ellipse, rgba(45, 212, 191, 0.14), transparent 65%);
}

@media (max-width: 860px) {
  .sidebar { display: none; }
  .content { padding: 16px; }
  .hero h1 { font-size: 32px; }
}
