:root {
  --bg: #f3f4f6;
  --ink: #111827;
  --muted: #6b7280;
  --card: #ffffff;
  --line: #e5e7eb;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --neg: #b91c1c;
  --pos: #047857;
  --nav: #111827;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  padding: 0.7rem 1rem;
  background: var(--nav);
  color: white;
  align-items: center;
}
.nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.2rem;
}
.nav a:hover { text-decoration: underline; }
.nav .right { margin-left: auto; }
.nav strong { font-size: 0.95rem; }
main { padding: 1.4rem; max-width: 1400px; margin: 0 auto; min-width: 0; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 1.4rem;
}
.layout > * { min-width: 0; }
.filters, .card {
  background: var(--card);
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}
.filters label, .card label { display: block; margin: 0.7rem 0; color: #374151; font-size: 0.92rem; }
select, input, button {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  background: white;
}
input[type="checkbox"], input[type="radio"] {
  width: auto;
  min-width: 1.15rem;
  min-height: 1.15rem;
  padding: 0;
  margin-right: 0.45rem;
  vertical-align: middle;
}
label.check {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}
button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  cursor: pointer;
  font-weight: 600;
  margin-top: 0.4rem;
}
button:hover { filter: brightness(1.05); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 0.7rem; margin-bottom: 1rem; }
.kpis article {
  background: var(--card);
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.kpis article[title] { cursor: help; }
.kpis strong { display: block; font-size: 1.4rem; }
.kpi-share { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.1rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
th, td { border-bottom: 1px solid var(--line); padding: 0.55rem 0.65rem; text-align: left; font-size: 0.92rem; }
th { background: #f9fafb; font-weight: 600; }
th a { color: inherit; text-decoration: none; }
th a:hover { color: var(--accent); }
th[aria-sort="ascending"] a::after { content: " ↑"; }
th[aria-sort="descending"] a::after { content: " ↓"; }
tbody tr:hover { background: #f0fdfa; }
.neg { color: var(--neg); }
.pos { color: var(--pos); }
.error { color: var(--neg); }
.ok { color: var(--pos); }
.hint { color: var(--muted); font-size: 0.9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.chip {
  background: #ccfbf1;
  color: #115e59;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-block;
}
.chip-remove:hover { background: #99f6e4; }
.chip-fixed { background: #e5e7eb; color: #374151; }
.pager { display: flex; gap: 0.4rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.pager a, .pager .current {
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  background: white;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.pager .current { background: var(--accent); color: white; border-color: var(--accent); }
.chart-figure { margin: 1.2rem 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.chart-figure figcaption { font-weight: 600; margin-bottom: 0.6rem; }
.chart-svg { width: 100%; height: auto; color: #6b7280; overflow: visible; }
.chart-svg .axis { font-size: 10px; fill: #6b7280; }
.chart-svg .axis-title { font-size: 11px; fill: #374151; font-weight: 600; }
.chart-svg .bar-value { font-size: 10px; fill: #115e59; }
.chart-svg .x-label { font-size: 10px; fill: #6b7280; }
.login { max-width: 400px; width: calc(100% - 2rem); margin: 5rem auto; }
.tafel-form input[type="number"] { min-width: 4rem; padding: 0.3rem; }
.years-form input[type="date"] { min-width: 9rem; padding: 0.3rem; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 1rem 0; }
.filters a { display: inline-block; padding: 0.45rem 0; min-height: 44px; }
@media (max-width: 800px) {
  .layout, .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 0.85rem; }
  .nav { padding: 0.55rem 0.75rem; }
  .nav strong { flex: 1 1 100%; }
  .nav a { padding: 0 0.45rem; }
  .nav .right { margin-left: 0; }
  .login { margin: 2rem auto; }
  select, input, button, textarea { font-size: 16px; }
  select[multiple] { min-height: 7rem; }
  .chart-figure { padding: 0.7rem; overflow-x: auto; }
  .table-wrap {
    overflow-x: scroll;
    padding-bottom: 0.45rem;
  }
  .tafel-form input[type="number"] {
    min-width: 3.25rem;
    min-height: 2.75rem;
    padding: 0.45rem 0.2rem;
  }
}
