:root {
  color-scheme: light;
  --page-plane: #f9f9f7;
  --surface-1: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --gridline: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page-plane: #0d0d0d;
    --surface-1: #1a1a19;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --gridline: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-plane);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

a { color: var(--accent); }

h1, h2 { line-height: 1.25; }
h1 { font-size: 1.75rem; margin: 1.5rem 0 0.25rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }

.site-header {
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--text-primary);
}

.site-nav a {
  margin-left: 1.25rem;
  text-decoration: none;
  color: var(--text-secondary);
}

.site-nav a:hover { color: var(--accent); }

.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0 2.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.period-note {
  color: var(--text-secondary);
  margin-top: 0;
}

.subtitle {
  color: var(--text-secondary);
  margin-top: 0;
}

.breadcrumb {
  margin-bottom: 0;
}
.breadcrumb a {
  text-decoration: none;
  font-size: 0.9rem;
}

.empty-state {
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}

.kpi-tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 600;
  font-variant-numeric: proportional-nums;
}

.chart-section {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.chart-wrap {
  position: relative;
  height: 280px;
}

.chart-wrap--tall {
  height: 480px;
}

.chart-table {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.chart-table summary {
  cursor: pointer;
  color: var(--accent);
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
}

.filter-form input,
.filter-form select,
.filter-form button {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-1);
  color: var(--text-primary);
}

.filter-form button {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  cursor: pointer;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--gridline);
  white-space: nowrap;
}

.data-table td:first-child,
.data-table th:first-child {
  white-space: normal;
}

.data-table th {
  color: var(--text-secondary);
  font-weight: 600;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.pagination a {
  text-decoration: none;
}

@media (max-width: 600px) {
  h1 { font-size: 1.4rem; }
  .chart-wrap { height: 220px; }
  .chart-wrap--tall { height: 360px; }
}
