:root {
  --grund: #f6f7f9;
  --flaeche: #ffffff;
  --text: #1c2430;
  --leise: #5f6b7a;
  --linie: #e1e5ea;
  --akzent: #1f5fbf;
  --gut: #1a7f4b;
  --achtung: #a86800;
  --schlecht: #c0362c;
  --reihe-1: #1f5fbf;
  --reihe-2: #9aa9bd;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #12161c;
    --flaeche: #1a2029;
    --text: #e6eaf0;
    --leise: #9aa5b3;
    --linie: #2c3440;
    --akzent: #7fb0ff;
    --gut: #4cc38a;
    --achtung: #e3a43a;
    --schlecht: #ff7b6e;
    --reihe-1: #7fb0ff;
    --reihe-2: #5b6778;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--grund); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--akzent); }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
small, .klein { color: var(--leise); font-size: .85rem; font-weight: normal; }
main { max-width: 1180px; margin: 0 auto; padding: 1.5rem 16px 4rem; }

.kopf { background: var(--flaeche); border-bottom: 1px solid var(--linie); padding: .6rem 16px; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.marke { font-weight: 700; color: var(--text); text-decoration: none; }
nav.haupt { display: flex; gap: .25rem .9rem; flex-wrap: wrap; align-items: center; flex: 1; }
nav.haupt a { text-decoration: none; color: var(--leise); padding: .2rem 0; }
nav.haupt a[aria-current] { color: var(--text); font-weight: 600; border-bottom: 2px solid var(--akzent); }
nav.haupt form { margin-left: auto; }
.zaehler { background: var(--schlecht); color: #fff; border-radius: 9px; padding: 0 .4rem; font-size: .75rem; }
nav.sprung { display: flex; gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; font-size: .9rem; }

button { font: inherit; background: var(--akzent); color: #fff; border: 0; border-radius: 6px; padding: .5rem 1rem; cursor: pointer; }
button.leise { background: none; color: var(--leise); padding: 0; text-decoration: underline; }
input { font: inherit; width: 100%; padding: .55rem .6rem; border: 1px solid var(--linie); border-radius: 6px; background: var(--flaeche); color: var(--text); }
label { display: grid; gap: .25rem; margin-bottom: .9rem; font-size: .9rem; }

.anmeldung { max-width: 360px; margin: 3rem auto; background: var(--flaeche); padding: 1.5rem; border: 1px solid var(--linie); border-radius: 10px; }
.fehler, .hinweis { padding: .6rem .8rem; border-radius: 6px; }
.fehler { background: color-mix(in srgb, var(--schlecht) 12%, transparent); color: var(--schlecht); }
.hinweis { background: color-mix(in srgb, var(--akzent) 10%, transparent); }

.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1rem; }
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 1rem 1.2rem; }
.karte h2 { margin: 0 0 .75rem; }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.kennzahlen dt { color: var(--leise); font-size: .8rem; }
.kennzahlen dd { margin: 0; font-size: 1.4rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.trend { font-size: .8rem; font-weight: 600; color: var(--leise); margin-left: .25rem; }
.trend.gut { color: var(--gut); } .trend.schlecht { color: var(--schlecht); } .trend.neu { color: var(--akzent); }
.status { list-style: none; padding: 0; margin: 0 0 .5rem; }
.status li { padding: .2rem 0 .2rem 1.1rem; position: relative; }
.status li::before { content: ""; position: absolute; left: 0; top: .65rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--linie); }
.status li.gut::before { background: var(--gut); } .status li.achtung::before { background: var(--achtung); } .status li.schlecht::before { background: var(--schlecht); }

.raster3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1rem; }
.raster2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 1rem; }
.diagramm { margin: 0 0 1rem; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: .75rem; }
.diagramm figcaption { font-weight: 600; font-size: .9rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.legende { font-weight: normal; color: var(--leise); display: flex; gap: .8rem; }
.legende i { display: inline-block; width: .8rem; height: .2rem; margin-right: .3rem; vertical-align: middle; }
.diagramm svg { width: 100%; height: auto; display: block; }
.diagramm .raster { stroke: var(--linie); stroke-width: 1; }
.diagramm .achse { fill: var(--leise); font-size: 11px; }
.diagramm .linie { fill: none; stroke-width: 2; }
.diagramm .linie.r1 { stroke: var(--reihe-1); } .diagramm .linie.r2 { stroke: var(--reihe-2); }
.diagramm circle.r1 { fill: var(--reihe-1); } .diagramm circle.r2 { fill: var(--reihe-2); }
.legende i.r1 { background: var(--reihe-1); } .legende i.r2 { background: var(--reihe-2); }

.tabelle { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; }
.tabelle.lang { max-height: 560px; overflow-y: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .45rem .7rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { position: sticky; top: 0; background: var(--flaeche); color: var(--leise); font-weight: 600; font-size: .8rem; }
td { font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.leer { color: var(--leise); }
.leise { color: var(--leise); }

.ampel { font-weight: 600; } .ampel.gut { color: var(--gut); } .ampel.achtung { color: var(--achtung); } .ampel.schlecht { color: var(--schlecht); }

.befunde, .meldungen { list-style: none; padding: 0; margin: 0; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; }
.befunde li, .meldungen li { padding: .6rem .9rem; border-bottom: 1px solid var(--linie); border-left: 4px solid var(--linie); }
.befunde li:last-child, .meldungen li:last-child { border-bottom: 0; }
.befunde li.kritisch, .meldungen li.kritisch { border-left-color: var(--schlecht); }
.befunde li.wichtig, .meldungen li.wichtig { border-left-color: var(--achtung); }
.befunde form { display: inline; margin-left: .5rem; }
.schwere { font-size: .75rem; text-transform: uppercase; color: var(--leise); }
.meldungen time { color: var(--leise); font-size: .85rem; margin-right: .4rem; }
.meldungen li.gelesen { opacity: .65; }
details { margin-top: 1rem; }

.bericht { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 1rem 1.5rem; }
.bericht blockquote { margin: 0; padding: .5rem 1rem; border-left: 3px solid var(--linie); color: var(--leise); }

@media print {
  .kopf, nav.sprung, form, button { display: none !important; }
  body { background: #fff; color: #000; }
  .karte, .diagramm, .tabelle, .bericht, .befunde { border-color: #ccc; }
  .tabelle.lang { max-height: none; overflow: visible; }
}
