:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #000000;
  --muted: #475569;
  --accent: #0369a1;
  --accent-2: #be185d;
  --border: #cbd5e1;
  --max-width: 960px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

a { color: var(--accent); }
a:hover { text-decoration: underline; }

header, main, footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
}

header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.subtitle {
  color: var(--muted);
  margin: 0;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.kpi-label {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 6px;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
}

.kpi-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0 0;
}

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

.card h2 {
  margin: 0 0 16px;
  font-size: 1.15rem;
}

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

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 12px 0 0;
}

.table-wrap {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

thead th {
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:last-child td { border-bottom: none; }

footer {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding-top: 8px;
  padding-bottom: 32px;
}

.error {
  background: #fee2e2;
  border: 1px solid #b91c1c;
  color: #7f1d1d;
  padding: 12px 16px;
  border-radius: 8px;
}
