:root{
  --blau:#1F6DB6;--blau-dunkel:#174F86;--blau-hell:#E8F0F9;
  --rot:#C8102E;--rot-text:#A50E26;--rot-hell:#FCE8EB;--rot-rand:#F0B7C0;
  --orange:#D97A0A;--orange-text:#8A4A06;--orange-hell:#FDF0DC;
  --gruen:#1E8A4C;--gruen-text:#17633A;--gruen-hell:#E3F3EA;
  --text:#16202B;--text2:#2C3845;--grau:#4E5A68;--grau2:#5F6B78;
  --linie:#E1E5EB;--linie2:#C9D2DD;--feld:#F7F8FA;--grund:#F2F4F7;--weiss:#FFFFFF;
  --schrift:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:var(--grund);color:var(--text);font-family:var(--schrift);font-size:16px;-webkit-tap-highlight-color:transparent}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--blau)}a:hover{color:var(--blau-dunkel)}
h1,h2,h3{margin:0;line-height:1.2}
h1{font-size:26px;font-weight:700}h2{font-size:21px;font-weight:700}h3{font-size:17px;font-weight:700}
p{margin:0}
.versteckt{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* Grundgerüst */
.seite{min-height:100%;display:flex;flex-direction:column}
.kopf{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:76px;padding:10px 28px;background:var(--weiss);border-bottom:1px solid var(--linie);flex:none;flex-wrap:wrap}
.kopf-links{display:flex;align-items:center;gap:14px;min-width:0}
.kopf-rechts{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.logo{width:44px;height:44px;border-radius:12px;background:var(--blau);display:flex;align-items:center;justify-content:center;flex:none}
.titel{display:flex;flex-direction:column;gap:2px;min-width:0}
.titel b{font-size:21px;font-weight:800;letter-spacing:-.01em}
.titel span{font-size:14px;font-weight:500;color:var(--grau)}
.uhr{display:flex;flex-direction:column;align-items:flex-end}
.uhr b{font-size:28px;font-weight:700;line-height:30px}
.uhr span{font-size:13px;font-weight:500;color:var(--grau)}
.pille{display:inline-flex;align-items:center;gap:6px;min-height:30px;padding:0 12px;border-radius:15px;font-size:14px;font-weight:700;white-space:nowrap}
.pille.blau{background:var(--blau-hell);color:var(--blau-dunkel)}
.pille.rot{background:var(--rot-hell);color:var(--rot-text)}
.pille.orange{background:var(--orange-hell);color:var(--orange-text)}
.pille.gruen{background:var(--gruen-hell);color:var(--gruen-text)}
.pille.grau{background:#E9ECF1;color:var(--text2)}
.inhalt{flex:1;display:flex;gap:24px;padding:24px 28px;min-height:0}
.spalte{flex:1;display:flex;flex-direction:column;gap:16px;min-width:0}
.karte{background:var(--weiss);border:1px solid var(--linie);border-radius:20px;padding:20px}
.zeile{display:flex;align-items:center;gap:12px}
.zwischen{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.klein{font-size:14px;font-weight:500;color:var(--grau)}
.leer{padding:28px;text-align:center;color:var(--grau);font-weight:500}

/* Knöpfe */
.knopf{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:52px;padding:0 22px;border-radius:14px;border:none;background:var(--blau);color:#fff;font-size:17px;font-weight:700;cursor:pointer;text-decoration:none;white-space:nowrap}
.knopf:hover{background:var(--blau-dunkel);color:#fff}
.knopf.gross{min-height:72px;font-size:21px;border-radius:18px}
.knopf.zweit{background:var(--weiss);color:var(--text);border:1px solid var(--linie2)}
.knopf.zweit:hover{background:var(--feld);color:var(--text)}
.knopf.dunkel{background:var(--text)}
.knopf.dunkel:hover{background:#000}
.knopf.rot{background:var(--rot)}
.knopf.klein{min-height:44px;padding:0 14px;font-size:15px;border-radius:12px}
.knopf:disabled{background:#E9ECF1;color:var(--grau2);cursor:not-allowed;border:none}
.knopf:focus-visible,.kachel:focus-visible,.taste:focus-visible,.filter:focus-visible,.reiter a:focus-visible{outline:3px solid var(--blau);outline-offset:2px}

/* Startbildschirm */
.bereiche{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.bereich{display:flex;flex-direction:column;gap:12px;padding:18px;border-radius:18px;background:var(--weiss);border:1px solid var(--linie)}
.balken{height:8px;border-radius:4px;background:#E9ECF1;overflow:hidden}
.balken>div{height:100%;border-radius:4px}
.faellig{width:420px;flex:none;display:flex;flex-direction:column;gap:6px}
.faellig-liste{display:flex;flex-direction:column;overflow:auto}
.faellig-eintrag{display:flex;align-items:center;gap:14px;min-height:72px;border-bottom:1px solid #EEF1F4}
.punkt{width:14px;height:14px;border-radius:7px;flex:none}
.fusszeile{padding:10px 28px 16px;font-size:13px;color:var(--grau);text-align:center}

/* PIN */
.personen{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.kachel{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:118px;border-radius:18px;cursor:pointer;background:var(--weiss);border:1px solid var(--linie);padding:8px}
.kachel[aria-pressed="true"]{background:var(--blau-hell);border:3px solid var(--blau)}
.kachel:disabled{opacity:.55;cursor:not-allowed}
.avatar{width:52px;height:52px;border-radius:26px;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;background:#E9ECF1;color:var(--text2);flex:none}
.kachel[aria-pressed="true"] .avatar,.avatar.aktiv{background:var(--blau);color:#fff}
.pinfeld{width:400px;flex:none;display:flex;flex-direction:column;align-items:center;gap:16px}
.punkte{display:flex;gap:16px;height:28px;align-items:center}
.punkte span{width:22px;height:22px;border-radius:11px;border:2.5px solid #9AA6B4}
.punkte span.voll{background:var(--blau);border-color:var(--blau)}
.tasten{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;width:100%}
.taste{min-height:68px;border-radius:16px;border:1px solid #DDE2E8;background:var(--feld);font-size:28px;font-weight:600;cursor:pointer}
.taste:active{background:var(--blau-hell)}
.fehler{padding:12px 16px;border-radius:12px;background:var(--rot-hell);color:var(--rot-text);font-weight:700;font-size:15px}
.hinweis{padding:12px 16px;border-radius:12px;background:var(--blau-hell);color:var(--blau-dunkel);font-weight:600;font-size:15px}
.erfolg{padding:12px 16px;border-radius:12px;background:var(--gruen-hell);color:var(--gruen-text);font-weight:700;font-size:15px}

/* Aufgaben */
.filterleiste{width:240px;flex:none;display:flex;flex-direction:column;gap:8px}
.filter{display:flex;align-items:center;justify-content:space-between;min-height:56px;padding:0 18px;border-radius:14px;cursor:pointer;font-size:17px;font-weight:600;text-align:left;background:var(--weiss);border:1px solid var(--linie)}
.filter[aria-pressed="true"]{background:var(--blau);color:#fff;border-color:var(--blau)}
.zahl{min-width:28px;height:28px;padding:0 8px;border-radius:14px;display:inline-flex;align-items:center;justify-content:center;font-size:14px;font-weight:700;background:#E9ECF1;color:var(--text2)}
.filter[aria-pressed="true"] .zahl{background:rgba(255,255,255,.22);color:#fff}
.aufgabe{display:flex;flex-direction:column;gap:14px;padding:14px 18px;border-radius:18px;background:var(--weiss);border:1px solid var(--linie)}
.aufgabe.spaet{border-color:var(--rot-rand)}
.aufgabe.fertig{background:#F7FBF8}
.aufgabe-kopf{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.haken{width:36px;height:36px;flex:none;border-radius:18px;display:flex;align-items:center;justify-content:center;border:2.5px solid #9AA6B4}
.haken.spaet{border-color:var(--rot)}
.haken.fertig{background:var(--gruen);border-color:var(--gruen)}
.haken.nm{background:var(--orange);border-color:var(--orange)}
.aufgabe-text{flex:1;min-width:200px;display:flex;flex-direction:column;gap:3px}
.aufgabe-text b{font-size:19px;line-height:23px}
.frist{font-size:15px;font-weight:700;white-space:nowrap}
.frist.spaet{color:var(--rot-text)}.frist.offen{color:var(--orange-text)}
.messwerte{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap;padding-left:52px}
.feld{display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:600;color:var(--text2)}
.feld input,.feld select,.feld textarea{min-height:48px;padding:0 14px;border-radius:12px;border:2px solid var(--linie2);background:var(--weiss);font-size:17px;font-weight:500;color:var(--text)}
.feld textarea{padding:10px 14px;min-height:90px;resize:vertical}
.feld input:focus,.feld select:focus,.feld textarea:focus{outline:none;border-color:var(--blau)}
.feld.zahlfeld input{width:150px;font-size:20px;font-weight:600}
.check{display:flex;align-items:center;gap:12px;min-height:44px;font-size:16px;font-weight:600;cursor:pointer}
.check input{width:24px;height:24px;accent-color:var(--blau)}
.banner{display:flex;align-items:center;gap:14px;min-height:60px;padding:10px 18px;border-radius:16px;background:var(--blau-hell);border:2px solid var(--blau);color:var(--text);text-decoration:none}

/* Fenster */
.schleier{position:fixed;inset:0;background:rgba(22,32,43,.45);display:flex;align-items:center;justify-content:center;padding:20px;z-index:50}
.fenster{background:var(--weiss);border-radius:22px;padding:24px;width:min(620px,100%);max-height:calc(100vh - 40px);overflow:auto;display:flex;flex-direction:column;gap:16px}
.fenster .knoepfe{display:flex;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.auswahl{display:flex;flex-wrap:wrap;gap:10px}
.auswahl button{min-height:52px;padding:0 18px;border-radius:14px;border:1px solid var(--linie2);background:var(--weiss);font-size:16px;font-weight:600;cursor:pointer}
.auswahl button[aria-pressed="true"]{background:var(--blau);color:#fff;border-color:var(--blau)}
.toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);background:var(--text);color:#fff;padding:16px 22px;border-radius:14px;font-weight:700;font-size:17px;z-index:60;display:flex;gap:16px;align-items:center;box-shadow:0 8px 24px rgba(0,0,0,.2)}
.toast button{background:transparent;border:1px solid rgba(255,255,255,.5);color:#fff;border-radius:10px;min-height:40px;padding:0 14px;font-weight:700;cursor:pointer}

/* Leitung */
.leitung .inhalt{flex-direction:column;max-width:1320px;width:100%;margin:0 auto}
.reiter{display:flex;gap:4px;flex-wrap:wrap;padding:0 28px;background:var(--weiss);border-bottom:1px solid var(--linie)}
.reiter a{display:flex;align-items:center;min-height:52px;padding:0 16px;color:var(--text2);text-decoration:none;font-weight:600;border-bottom:3px solid transparent}
.reiter a[aria-current="page"]{color:var(--blau-dunkel);border-bottom-color:var(--blau)}
.kennzahlen{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.kennzahl{display:flex;flex-direction:column;gap:4px;padding:16px 20px;border-radius:18px;background:var(--weiss);border:1px solid var(--linie)}
.kennzahl b{font-size:34px;line-height:38px}
.tabelle-box{overflow-x:auto}
table{width:100%;border-collapse:collapse}
th,td{padding:10px 8px;text-align:left;border-bottom:1px solid #EEF1F4;font-size:15px;vertical-align:top}
th{font-size:13px;color:var(--grau);font-weight:700;text-transform:none}
.matrix td,.matrix th{text-align:center}
.matrix td:first-child,.matrix th:first-child{text-align:left}
.zelle{display:inline-flex;align-items:center;justify-content:center;min-width:72px;height:38px;border-radius:10px;font-size:14px;font-weight:700}
.formular{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.formular .breit{grid-column:1/-1}
.schluessel{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:20px;letter-spacing:2px;padding:14px;border-radius:12px;background:var(--feld);word-break:break-all}
.anmeldung{flex:1;display:flex;align-items:center;justify-content:center;padding:24px}
.anmeldung .karte{width:min(440px,100%);display:flex;flex-direction:column;gap:16px;padding:28px}

/* Kleinere Bildschirme */
@media (max-width:1100px){
  .bereiche{grid-template-columns:repeat(2,minmax(0,1fr))}
  .personen{grid-template-columns:repeat(4,minmax(0,1fr))}
  .faellig,.pinfeld{width:360px}
}
@media (max-width:820px){
  .inhalt{flex-direction:column;padding:16px}
  .kopf{padding:10px 16px}
  .faellig,.pinfeld,.filterleiste{width:100%}
  .filterleiste{flex-direction:row;overflow-x:auto}
  .filter{flex:none}
  .personen{grid-template-columns:repeat(3,minmax(0,1fr))}
  .kennzahlen{grid-template-columns:repeat(2,minmax(0,1fr))}
  .formular{grid-template-columns:1fr}
  .messwerte{padding-left:0}
  .reiter{padding:0 8px}
}
@media print{.kopf,.reiter,.knopf{display:none!important}}

.qr svg{width:100%;height:100%}

.sprachwahl{min-height:48px;border-radius:12px;border:1px solid var(--linie2);background:var(--weiss);font:inherit;font-size:16px;font-weight:600;padding:0 12px;color:var(--text)}

/* Kontrollen */
.kwahl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-width:560px}
.kwahl button{min-height:56px;padding:0 8px;border-radius:14px;border:1px solid var(--linie2);background:var(--weiss);font-size:16px;font-weight:700;cursor:pointer;color:var(--text)}
.ktab .pille{white-space:normal;min-height:30px;height:auto;padding:4px 12px;line-height:1.3}
@media (max-width:820px){
  .ktab table,.ktab tbody,.ktab tr,.ktab td{display:block;width:100%}
  .ktab thead{display:none}
  .ktab tr{padding:10px 0;border-bottom:1px solid var(--linie)}
  .ktab td{border:0;padding:4px 0;text-align:left!important;white-space:normal!important}
  .kwahl button{font-size:15px}
}
.leitung .karte .zeile .pille{white-space:normal;height:auto;padding:4px 12px;line-height:1.3}
@media (max-width:820px){.leitung .zwischen{flex-wrap:wrap;gap:10px}.leitung .zwischen .zeile{flex-wrap:wrap}}
.formular>*{min-width:0}.formular select{max-width:100%}
@media (max-width:820px){.ktab td[data-l]::before{content:attr(data-l) ": ";font-weight:700;font-size:14px;color:var(--grau)}}
