:root {
  --bg: #f4f6f8; --karte: #fff; --text: #16202a; --muted: #5e6b78; --rand: #d9dee4;
  --primär: #0b7a4b; --primär-text: #fff; --warn: #b4381d; --warn-bg: #fdeae5; --ok-bg: #e4f5ec; --akzent: #1f5fbf;
  --radius: 14px; --schatten: 0 1px 3px rgba(0,0,0,.08);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f151b; --karte: #1a222b; --text: #e8edf2; --muted: #9aa7b4; --rand: #2b3642; --primär: #22a86a;
    --warn: #ff8a6a; --warn-bg: #3a1f17; --ok-bg: #16352a; --akzent: #6ea3ff; --schatten: none; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
header.app { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--primär); color: #fff; }
header.app h1 { font-size: 18px; margin: 0; font-weight: 700; }
header.app .sub { font-size: 13px; opacity: .9; }
header.app button, header.app a { background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 14px; text-decoration: none; }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
.admin main { max-width: 1200px; }
.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); padding: 16px; margin-bottom: 14px; border: 1px solid var(--rand); }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 14px 0 6px; color: var(--muted); font-weight: 600; }
p.hinweis, .muted { color: var(--muted); font-size: 14px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 12px; border: 1px solid var(--rand); border-radius: 10px; background: var(--bg); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: 1px; }
.zeile { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
button, .btn { font: inherit; border: 0; border-radius: 12px; padding: 13px 18px; cursor: pointer; background: var(--primär); color: var(--primär-text); font-weight: 600; text-decoration: none; display: inline-block; text-align: center; }
button.sek, .btn.sek { background: transparent; color: var(--text); border: 1px solid var(--rand); font-weight: 500; }
button.gefahr { background: var(--warn); }
button.klein, .btn.klein { padding: 7px 12px; font-size: 14px; border-radius: 9px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.gross { width: 100%; padding: 20px; font-size: 19px; }
.aktionen { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.aktionen > * { flex: 1; }
.banner { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; }
.banner.offen { background: var(--ok-bg); border: 1px solid #9ed6b7; }
.banner.zu { background: var(--warn-bg); color: var(--warn); border: 1px solid #f0b5a5; }
.banner .punkt { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--primär); }
.banner.zu .punkt { background: var(--warn); }
.banner small { display: block; color: inherit; opacity: .85; margin-top: 3px; }
.kennzahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kennzahl { background: var(--bg); border-radius: 12px; padding: 12px; text-align: center; }
.kennzahl b { display: block; font-size: 20px; }
.kennzahl span { font-size: 12px; color: var(--muted); }
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rand); cursor: pointer; }
.liste li:first-child { border-top: 0; }
.liste img, .thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; background: var(--bg); flex: none; }
.thumb.leer { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.liste .info { flex: 1; min-width: 0; }
.liste .info div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste .betrag { font-weight: 700; font-size: 17px; white-space: nowrap; }
.woche-kopf { display: flex; justify-content: space-between; margin: 16px 0 4px; font-size: 14px; color: var(--muted); font-weight: 600; }
.vorschau { width: 100%; max-height: 42vh; object-fit: contain; border-radius: 12px; background: #000; display: block; }
.ki { margin-top: 10px; font-size: 14px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.ki.fehler { background: var(--warn-bg); color: var(--warn); }
.fehler-text { color: var(--warn); font-size: 14px; margin-top: 10px; min-height: 1em; }
.meldung { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #222; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; }
.meldung.an { opacity: .95; }
.versteckt { display: none !important; }
.foto-gross { width: 100%; border-radius: 12px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { background: var(--karte); color: var(--text); border: 1px solid var(--rand); font-weight: 500; }
.tabs button.aktiv { background: var(--primär); color: #fff; border-color: var(--primär); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--rand); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
td.klick { cursor: pointer; color: var(--akzent); }
tr.summe td { font-weight: 700; border-top: 2px solid var(--rand); }
.tabelle-wrap { overflow-x: auto; }
.filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.filter label { margin: 0 0 4px; }
.filter > div { flex: 1; min-width: 140px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.badge.aus { background: var(--warn-bg); color: var(--warn); }
.dialog { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.dialog .karte { width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; margin: 0; }
@media (min-width: 720px) { .dialog { align-items: center; } .dialog .karte { border-radius: 18px; } }
.pfeil { color: var(--muted); }
code { background: var(--bg); padding: 2px 6px; border-radius: 6px; font-size: 14px; }

/* Übersicht */
.kennzahl small { display: block; font-size: 12px; margin-top: 2px; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gitter { stroke: var(--rand); stroke-width: 1; }
.chart .achse { fill: var(--muted); font-size: 12px; }
.chart .balken { fill: var(--primär); }
.chart .balken.aktuell { fill: var(--akzent); }
.chart .treffer { fill: transparent; cursor: pointer; }
.chart .treffer:hover + .balken, .chart .balken.hover { opacity: .8; }
.chart .wert { fill: var(--text); font-size: 12px; font-weight: 600; }
.tooltip { position: absolute; pointer-events: none; background: var(--karte); border: 1px solid var(--rand); border-radius: 8px; padding: 6px 10px; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.15); white-space: nowrap; transform: translate(-50%, -110%); }
@media (max-width: 640px) { .zeile { grid-template-columns: 1fr; } }
@media (max-width: 960px) { .admin .zeile { grid-template-columns: 1fr; } }
