:root {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.hidden { display: none !important; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-logo { width: 36px; height: 36px; }
.brand h1 { margin: 0; font-size: 1.15rem; }
.subtitle { font-size: 0.78rem; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }

.container {
  max-width: 1200px;
  margin: 1.25rem auto;
  padding: 0 1rem 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  margin-bottom: 1rem;
}

.auth-card { max-width: 460px; margin: 2.5rem auto; }
.muted { color: var(--muted); font-size: 0.9rem; }

.form-grid { display: grid; gap: 0.75rem; }
.form-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.full-span { grid-column: 1 / -1; }
label { display: grid; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); }
input, select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
}
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-row input { width: auto; }

.btn {
  padding: 0.62rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.btn-primary { background: var(--primary); color: #082f49; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-danger { background: #7f1d1d; color: #fecaca; padding: 0.35rem 0.65rem; font-size: 0.8rem; }
.full-width { width: 100%; }

.tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  padding-bottom: 0.25rem;
}
.tab {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.tab.active { background: var(--primary); color: #082f49; border-color: var(--primary); font-weight: 700; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem;
}
.kpi-label { font-size: 0.8rem; color: var(--muted); }
.kpi-val { font-size: 1.4rem; font-weight: 700; margin-top: 0.25rem; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1rem;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 0.55rem 0.65rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }

.pill {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.pill-ok { background: #064e3b; color: #a7f3d0; }
.pill-warn { background: #78350f; color: #fde68a; }
.pill-bad { background: #7f1d1d; color: #fecaca; }

.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 0.9rem; font-size: 0.9rem; }
.alert-error { background: #7f1d1d; color: #fecaca; }
.alert-ok { background: #064e3b; color: #a7f3d0; }
.divider { text-align: center; color: var(--muted); margin: 0.85rem 0; font-size: 0.85rem; }
.code-block {
  display: block;
  padding: 0.65rem;
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 8px;
  word-break: break-all;
  margin: 0.5rem 0;
  font-size: 0.8rem;
}
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.btn-row { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-top: 0.35rem; }
.cand-acct-select { min-width: 150px; margin-bottom: 0.35rem; }

.public-intro h2 { margin: 0.45rem 0 0.5rem; font-size: 1.25rem; }
.feature-list { margin: 0.65rem 0; padding-left: 1.25rem; color: var(--text); font-size: 0.92rem; }
.feature-list li { margin-bottom: 0.4rem; }
.legal-links-inline, .footer-links { font-size: 0.88rem; color: var(--muted); }
.legal-links-inline a, .footer-links a, .legal-page a { color: var(--primary); text-decoration: none; }
.legal-links-inline a:hover, .footer-links a:hover, .legal-page a:hover { text-decoration: underline; }
.site-footer {
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 1rem 1rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
}
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.legal-page h2 { margin-top: 0; font-size: 1.4rem; }
.legal-section { margin-top: 1.15rem; border-top: 1px solid var(--border); padding-top: 0.9rem; }
.legal-section h3 { margin: 0 0 0.45rem; font-size: 1.05rem; color: #e2e8f0; }
.legal-section p, .legal-section li { font-size: 0.93rem; color: #cbd5e1; }
.notice-box {
  background: #0f172a;
  border: 1px solid #1e40af;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 0.85rem 0;
  font-size: 0.9rem;
  color: #dbeafe;
}
