:root {
  --hg: #f5f6f8; --karte: #fff; --text: #1f2937; --leise: #6b7280; --linie: #e5e7eb;
  --akzent: #2563eb; --akzent-text: #fff; --minus: #b91c1c; --plus: #15803d; --offen: #fff7ed;
  --gefahr: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --hg: #111318; --karte: #1b1e25; --text: #e5e7eb; --leise: #9ca3af; --linie: #2d323c;
    --akzent: #60a5fa; --akzent-text: #0b1220; --minus: #f87171; --plus: #4ade80; --offen: #2a2116;
    --gefahr: #f87171;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--hg); color: var(--text); }
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.leise { color: var(--leise); }
.klein { font-size: .85em; margin-left: .5rem; }
.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.minus { color: var(--minus); } .plus { color: var(--plus); }

.kopf { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding: .75rem 1rem; background: var(--karte); border-bottom: 1px solid var(--linie); }
.marke { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.kopf nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; }
.kopf nav a { color: var(--leise); padding: .25rem 0; }
.kopf nav a.aktiv { color: var(--text); font-weight: 600; border-bottom: 2px solid var(--akzent); }
.inline { display: inline; }

.inhalt { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.karte-mitte { max-width: 420px; margin: 8vh auto; padding: 2rem 1.5rem; background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; }
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.hinweis { border-left: 4px solid var(--akzent); }
.spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.titelzeile { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.titelzeile h1, .titelzeile h2 { margin: 0; }

.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kachel { background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; padding: 1rem 1.25rem; }
.kachel span { display: block; color: var(--leise); font-size: .9rem; }
.kachel strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }

label { display: block; margin-bottom: .75rem; font-weight: 500; }
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=color]), select, textarea {
  display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; border: 1px solid var(--linie); border-radius: 6px; background: var(--hg);
}
input[type=color] { display: block; margin-top: .25rem; width: 3rem; height: 2.2rem; border: 1px solid var(--linie); border-radius: 6px; background: none; }
button, .knopf { display: inline-block; padding: .5rem 1rem; border: 1px solid var(--linie); border-radius: 6px; background: var(--karte); cursor: pointer; color: var(--text); }
button.primaer, .knopf.primaer { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
button.gefahr, a.gefahr { color: var(--gefahr); }
button.link { border: 0; background: none; padding: 0; color: var(--leise); }
.knoepfe { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
.knoepfe .gefahr { margin-left: auto; }
.formular { max-width: 640px; }
.formular > div { margin-bottom: .9rem; }
.formular .helptext, .formular div > div:not(:first-child) { font-size: .85rem; color: var(--leise); }
.errorlist { color: var(--gefahr); margin: .25rem 0; padding-left: 1.1rem; }
.formular ul:not(.errorlist), .formular div[id$="personen"] { list-style: none; padding: 0; display: flex; gap: 1rem; }
.formular div[id$="personen"] label { font-weight: 400; }

.meldung { padding: .6rem 1rem; border-radius: 8px; margin-bottom: 1rem; background: var(--karte); border: 1px solid var(--linie); }
.meldung.success { border-left: 4px solid var(--plus); }
.meldung.error { border-left: 4px solid var(--minus); }
.meldung.info { border-left: 4px solid var(--akzent); }

.tabelle { width: 100%; border-collapse: collapse; }
.tabelle td { padding: .4rem .25rem; border-bottom: 1px solid var(--linie); }
.punkt { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .5rem; vertical-align: middle; }
.etikett { font-size: .75rem; background: var(--hg); border: 1px solid var(--linie); border-radius: 4px; padding: 0 .35rem; margin-left: .35rem; }
.baum { list-style: none; padding: 0; margin: 0; }
.baum > li { padding: .35rem 0; border-bottom: 1px solid var(--linie); }
.baum ul { list-style: none; padding-left: 1.7rem; margin: .25rem 0 0; }
.inaktiv, .inaktiv a { opacity: .5; text-decoration: line-through; }

.filter { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.filter select, .filter input { width: auto !important; max-width: 100%; margin: 0 !important; }
.liste { display: flex; flex-direction: column; gap: .4rem; }
.zeile { display: grid; grid-template-columns: 6.5rem 1fr 8rem 14rem auto 2.5rem; gap: .75rem; align-items: center;
  background: var(--karte); border: 1px solid var(--linie); border-radius: 8px; padding: .6rem .8rem; }
.zeile.offen { background: var(--offen); }
.zeile select { margin: 0; }
.z-text { min-width: 0; overflow-wrap: anywhere; }
.chip { display: inline-flex; align-items: center; gap: .3rem; margin: 0 .5rem 0 0; font-weight: 400; white-space: nowrap; }
.z-ok button { padding: .4rem .7rem; }
@media (max-width: 900px) {
  .zeile { grid-template-columns: 1fr auto; }
  .z-datum { order: 1; } .z-betrag { order: 2; } .z-text { order: 3; grid-column: 1 / -1; }
  .z-kat { order: 4; grid-column: 1 / -1; } .z-pers { order: 5; } .z-ok { order: 6; }
}
.seiten { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; }

.qr { display: block; margin: .5rem auto 1rem; background: #fff; border-radius: 8px; padding: 6px; }
.geheimnis { display: block; word-break: break-all; padding: .5rem; background: var(--hg); border-radius: 6px; margin: .5rem 0 1rem; }
.schritte { padding-left: 1.2rem; }
