:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120;
    --surface: #111827;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --border: #1e293b;
    --accent: #14b8a6;
    --accent-hover: #2dd4bf;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #1e293b;
  --accent: #14b8a6;
  --accent-hover: #2dd4bf;
}

*, *::before, *::after { 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.55;
}

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

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 60px; gap: 1rem; flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
nav a:hover { color: var(--accent); }

main { padding: 2rem 0 3rem; }
h1 { font-size: clamp(1.6rem, 3vw, 2.25rem); line-height: 1.2; margin: 0 0 0.5rem; }
.lead { color: var(--muted); margin: 0 0 1.5rem; max-width: 68ch; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.field { margin-bottom: 1rem; }
label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.35rem; }
input, select {
  width: 100%; padding: 0.6rem 0.75rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text); font-size: 1rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: 0.65rem 1.1rem; font-weight: 600; cursor: pointer; font-size: 0.95rem;
}
.btn:hover { background: var(--accent-hover); }
.btn-ghost {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.35rem 0.65rem; cursor: pointer; font-size: 0.85rem;
}

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
.kpi {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.75rem;
}
.kpi-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-val { font-size: 1.35rem; font-weight: 800; color: var(--accent); }

table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }

.state-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem; margin-top: 1rem;
}
.state-grid a {
  padding: 0.45rem 0.65rem; border: 1px solid var(--border); border-radius: 6px;
  text-decoration: none; color: var(--text); font-size: 0.9rem; background: var(--surface);
}
.state-grid a:hover { border-color: var(--accent); color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--border); padding: 1.5rem 0;
  color: var(--muted); font-size: 0.875rem;
}
.site-footer a { color: var(--muted); }

.print-only { display: none; }

@media print {
  .no-print { display: none !important; }
  .print-only { display: block !important; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .kpi-val { color: #000; }
}