/* EJB Sportlerdatenbank – Eisbären-Farben: Dunkelblau / Weiß / Rot */
:root {
  --blue: #003366;
  --blue-light: #0a4f8f;
  --red: #c8102e;
  --bg: #f4f6f9;
  --border: #d8dee7;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: #1a1a2e; }
main { max-width: 1500px; margin: 0 auto; padding: 20px; }
a { color: var(--blue-light); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; } h2 { font-size: 18px; margin-top: 28px; }
.muted { color: #667; } .error { color: var(--red); font-weight: 600; }

/* Navigation */
.topnav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; background: var(--blue); color: #fff; padding: 5px 20px; border-bottom: 5px solid #d61126; /* CI-Rot aus dem EJB-Logo */
  /* Als Homescreen-App: nicht unter die iPhone-Statusleiste rutschen */
  padding-top: calc(5px + env(safe-area-inset-top)); }
.topnav a { color: #fff; }
.topnav .brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.nav-logo { height: 28px; width: auto; }
.topnav .spacer { flex: 1; }
.topnav .who { font-size: 13px; opacity: .85; }
.inline { display: inline; }
button.link { background: none; border: none; color: #fff; cursor: pointer; text-decoration: underline; font-size: 14px; }

/* Login */
.login-box { max-width: 380px; margin: 80px auto; background: #fff; padding: 32px; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.login-box h1 { margin-top: 0; color: var(--blue); }
.login-logo { display: block; height: 100px; width: auto; margin: 0 auto 14px; }
.login-box { text-align: center; }
.login-box form { text-align: left; }
.login-box label { display: block; margin: 14px 0 4px; font-weight: 600; font-size: 14px; }
.login-box input { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; }
.login-box button[type=submit] { width: 100%; margin-top: 20px; }

/* Buttons */
.btn, button[type=submit] {
  display: inline-block; background: var(--blue); color: #fff; border: none;
  padding: 9px 16px; border-radius: 8px; font-size: 14px; cursor: pointer;
}
.btn:hover, button[type=submit]:hover { background: var(--blue-light); text-decoration: none; }
.btn-muted { background: #8a94a6; }
.btn-danger { background: var(--red); }

/* KPI-Kacheln */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin: 20px 0; }
.kpi { background: #fff; border: 1px solid var(--border); border-left: 5px solid var(--blue); border-radius: 10px; padding: 16px; color: inherit; }
.kpi:hover { box-shadow: 0 3px 10px rgba(0,0,0,.08); text-decoration: none; }
.kpi .num { display: block; font-size: 28px; font-weight: 700; color: var(--blue); }
.kpi-warn { border-left-color: #e6a700; } .kpi-warn .num { color: #b58300; }
.kpi-bad { border-left-color: var(--red); } .kpi-bad .num { color: var(--red); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.dashboard-training { background: #fff; border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
/* Desktop: die beiden Trainingspläne nebeneinander (mobil untereinander) */
.training-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; align-items: start; }
.training-raster .dashboard-training { margin-bottom: 0; }
.aenderungen-details { margin-top: 24px; color: #778; }
.aenderungen-details summary { cursor: pointer; font-size: 14px; }
.aenderungen-details table { margin-top: 8px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

/* Tabellen */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.05); margin: 12px 0; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: var(--blue); color: #fff; font-weight: 600; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f0f4fa; }
td.c, th.c { text-align: center; } td.r, th.r { text-align: right; } input.r { text-align: right; }
table.plain { box-shadow: none; } table.plain td { border-bottom: 1px solid #eee; }

/* Status-Tags */
.tag { padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.tag-aktiv { background: #d9efd9; color: #1e6b1e; }
.tag-inaktiv { background: #eee; color: #666; }
.tag-archiviert { background: #f4dede; color: #8b2020; }
.tag-pay-bezahlt { background: #d9efd9; color: #1e6b1e; }
.tag-pay-offen, .tag-pay-teilweisebezahlt { background: #fdf1d2; color: #9a7400; }
.tag-pay-berfllig { background: #f4dede; color: var(--red); }
.tag-pay-storniert { background: #eee; color: #666; }

/* Beitragseinstellungen: breite Klassen-Spalte + Beitragsanzeige */
.beitrag-zeile-1 { grid-auto-flow: row; grid-template-columns: 2.2fr 1fr 1fr; }
@media (max-width: 700px) { .beitrag-zeile-1 { grid-template-columns: 1fr; } }
.beitrag-anzeige { display: block; margin-top: 4px; padding: 9px; font-size: 15px; font-weight: 700; color: var(--blue); background: #f0f4fa; border-radius: 8px; }

.zellen-sub { font-size: 12px; color: #667; }

/* Untere Tab-Leiste (nur Mobil sichtbar) */
.tabbar { display: none; }
#mehr-menue { display: none; }
@media (max-width: 800px) {
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    background: #fff; border-top: 1px solid var(--border);
    /* Abstand zum iPhone-Balken (Home-Indikator), mindestens 12px */
    padding-bottom: max(env(safe-area-inset-bottom), 12px);
    box-shadow: 0 -2px 10px rgba(0,0,0,.06);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 0 6px; font-size: 11px; color: #667; text-decoration: none;
    background: none; border: none; font-family: inherit; cursor: pointer;
  }
  .tabbar .tab-icon { height: 22px; display: flex; align-items: center; justify-content: center; }
  .tabbar .tab-icon svg { display: block; }
  .tabbar .tab-aktiv { color: var(--blue); font-weight: 700; }
  #mehr-menue {
    display: block; position: fixed; right: 10px; bottom: calc(64px + max(env(safe-area-inset-bottom), 12px));
    z-index: 901; background: #fff; border-radius: 14px; box-shadow: 0 4px 24px rgba(0,0,0,.18);
    padding: 8px; min-width: 210px;
  }
  #mehr-menue[hidden] { display: none; }
  #mehr-menue a, #mehr-menue button {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; font-size: 15px;
    color: inherit; text-decoration: none; background: none; border: none; font-family: inherit;
    border-radius: 8px; cursor: pointer;
  }
  .mehr-icon { display: flex; color: var(--blue); }
  .mehr-icon svg { display: block; }
  #mehr-menue a:hover, #mehr-menue button:hover { background: #f0f4fa; }
  /* Oben nur noch die schlanke Markenzeile, Links wandern in die Tab-Leiste */
  .topnav a:not(.brand), .topnav .who, .topnav form, .topnav .spacer { display: none; }
  .topnav { justify-content: center; }
}

/* Mobile Darstellung (iPhone & Co.) */
@media (max-width: 800px) {
  .topnav { flex-wrap: wrap; gap: 6px 14px; padding: 8px 12px; row-gap: 4px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .topnav .who { font-size: 11px; }
  main { padding: 12px; padding-bottom: calc(78px + max(env(safe-area-inset-bottom), 12px)); }
  /* Breite Tabellen scrollen in sich statt die Seite zu sprengen */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .page-head { flex-wrap: wrap; gap: 8px; }
  .form-grid { grid-template-columns: 1fr; }
  /* Detailzeilen: Beschriftung über dem Wert statt daneben */
  .grid-dl { grid-template-columns: 1fr; gap: 2px 0; }
  .grid-dl dt { margin-top: 8px; }
  .grid-dl dd { overflow-wrap: anywhere; }
}

/* Bild-Großansicht (Lightbox) */
#lightbox { position: fixed; inset: 0; background: rgba(0,10,30,.92); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
#lightbox[hidden] { display: none; }
#lightbox img { max-width: 96vw; max-height: 90vh; border-radius: 10px; }
#lightbox-zu { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255,255,255,.15); color: #fff; font-size: 22px; cursor: pointer; }
#lightbox-zu:hover { background: var(--red); }

/* Infos (Teams-Stil) */
.infos-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .infos-layout { grid-template-columns: 1fr; } }
.kanal-liste { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.kanal-liste h2 { margin: 0 0 10px; font-size: 16px; }
.kanal { display: block; padding: 8px 10px; border-radius: 8px; color: inherit; margin-bottom: 2px; }
.kanal:hover { background: #f0f4fa; text-decoration: none; }
.kanal-aktiv { background: var(--blue); color: #fff; }
.kanal-aktiv:hover { background: var(--blue-light); }
.kanal-name { display: block; font-weight: 600; }
.kanal-hinweis { font-size: 11px; opacity: .7; }
.kanal-neu { margin-top: 12px; }
.kanal-neu summary, .kanal-einstellungen summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.kanal-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; font-size: 13px; }
.kanal-form input[type=text], .kanal-form input:not([type]) { padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.kanal-inhalt { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.kanal-kopf { display: flex; justify-content: space-between; align-items: start; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.kanal-kopf h1 { margin: 0; font-size: 22px; }
.kanal-einstellungen { max-width: 320px; }
.beitrag { border-bottom: 1px solid #eef1f5; padding: 14px 0; }
.beitrag-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.beitrag-kopf .muted { font-size: 12px; }
.beitrag-text { white-space: pre-line; line-height: 1.5; }
.beitrag-loeschen { background: none; border: none; cursor: pointer; font-size: 13px; opacity: .5; }
.beitrag-loeschen:hover { opacity: 1; }
.antwort { margin: 10px 0 0 24px; padding: 8px 12px; background: #f5f7fa; border-left: 3px solid var(--border); border-radius: 0 8px 8px 0; }
.antwort-schreiben { margin: 8px 0 0 24px; font-size: 13px; }
.antwort-schreiben summary { cursor: pointer; color: var(--blue-light); }
.antwort-schreiben textarea, .beitrag-neu textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; margin: 8px 0; box-sizing: border-box; }
.beitrag-neu { margin-top: 16px; border-top: 2px solid var(--border); padding-top: 14px; }
.beitrag-bilder { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.beitrag-bilder img { max-height: 160px; max-width: 240px; border-radius: 8px; display: block; }
.bild-dropzone { border: 2px dashed var(--border); border-radius: 10px; padding: 14px; text-align: center; color: #667; cursor: pointer; margin-bottom: 10px; font-size: 14px; }
.bild-dropzone:hover, .dropzone-aktiv { border-color: var(--blue); background: #f0f4fa; color: var(--blue); }
.bild-anzahl { font-weight: 600; color: #1e6b1e; }

/* Wohnungen */
.inventar-foto { height: 44px; width: auto; border-radius: 6px; display: block; }
.foto-link { display: inline-flex; align-items: center; gap: 8px; }
.foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.foto-karte { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.foto-karte img { width: 100%; height: 200px; object-fit: cover; display: block; }
.foto-karte-fuss { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; }
.foto-hinzufuegen { margin: 14px 0; }
.foto-knopf { font-size: 16px; padding: 14px 22px; cursor: pointer; display: inline-block; }
.foto-knopf input[type=file] { display: none; }
.foto-zelle { min-width: 130px; }
.wohnung-einstellungen { background: #fff; border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; }
.wohnung-einstellungen summary { cursor: pointer; font-weight: 600; color: var(--blue); }

/* Lager */
.bestand-zelle { white-space: nowrap; }
.bestand-input { width: 52px; min-width: 52px; display: inline-block; text-align: center; }
tr.bestand-leer td { opacity: 0.55; }
.listen-hinweis { display: inline-block; background: #fff; border-left: 5px solid var(--blue); border-radius: 8px; padding: 10px 16px; font-size: 16px; font-weight: 700; color: var(--blue); box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.listen-untertitel { margin: 28px 0 10px; font-size: 20px; color: var(--blue); }
.team-schalter { display: inline-flex; margin-right: 4px; }
.team-schalter select { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.4);
  border-radius: 8px; padding: 3px 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.team-schalter select option { color: #1a1a2e; background: #fff; }
.sammel-details { margin-top: 32px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
.sammel-details summary { cursor: pointer; font-weight: 700; color: var(--blue); font-size: 16px; }
.sammel-details form { margin-top: 14px; }
.sammel-titel { margin: 18px 0 8px; }
.sammel-alle { display: block; margin-bottom: 8px; }
.sammel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.sammel-grid label { display: flex; align-items: center; gap: 6px; }
.mieter-wahl { min-width: 170px; }
.mieter-wahl summary { cursor: pointer; font-size: 13px; }
.mieter-liste { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 8px 10px; margin-top: 4px; background: #fff; border: 1px solid var(--border); border-radius: 8px; width: 100%; box-sizing: border-box; }
.mieter-liste label { display: flex; align-items: baseline; gap: 7px; font-size: 13px; text-align: left; width: 100%; }
.mieter-liste label input { flex-shrink: 0; }
/* Formular-Regel „input = volle Breite" gilt nicht für die Häkchen der Mieter-Auswahl */
.form-grid .mieter-liste label input[type="checkbox"],
.mieter-liste label input[type="checkbox"] { display: inline-block; width: auto; margin: 0; }
.mieter-liste.offen { margin-top: 6px; }
.ablage-foto { height: 46px; width: auto; border-radius: 6px; vertical-align: middle; }
.listen-untertitel:first-of-type { margin-top: 8px; }
.rueckstand-info { font-size: 13px; font-weight: 600; color: var(--red); background: #f4dede; padding: 3px 12px; border-radius: 20px; margin-left: 10px; vertical-align: middle; }
.rueckstand-ok { font-size: 13px; font-weight: 600; color: #1e6b1e; background: #d9efd9; padding: 3px 12px; border-radius: 20px; margin-left: 10px; vertical-align: middle; }

.tag-btr-offen { background: #fdf1d2; color: #9a7400; }
.tag-btr-bezahlt { background: #d9efd9; color: #1e6b1e; }
.tag-btr-angemahnt { background: #f4dede; color: var(--red); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-ok { background: #2e9e2e; } .dot-warn { background: #e6a700; } .dot-bad { background: var(--red); }

/* Seitenkopf, Suche */
.page-head { display: flex; justify-content: space-between; align-items: center; }
.searchbar { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.searchbar input { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; width: 260px; }

/* Profil */
.profile-head { display: flex; gap: 18px; align-items: center; background: #fff; padding: 18px; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.05); flex-wrap: wrap; }
.profile-head h1 { margin: 0 0 4px; }
.avatar { width: 104px; height: 104px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; flex-shrink: 0; }
.passbild { height: 156px; width: auto; border-radius: 10px; border: 1px solid var(--border); flex-shrink: 0; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.list-passbild { height: 46px; width: auto; border-radius: 6px; display: block; margin: 0 auto; }
.list-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.passfoto-vorschau img { height: 72px; width: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* Detail-Listen */
.grid-dl { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; background: #fff; padding: 16px; border-radius: 10px; margin: 12px 0; }
.grid-dl dt { font-weight: 600; color: #445; } .grid-dl dd { margin: 0; }

/* Formulare */
.form-zeilen { background: #fff; padding: 20px; border-radius: 12px; }
.form-zeilen label { font-size: 13px; font-weight: 600; color: #445; display: block; }
.form-zeilen input, .form-zeilen select { display: block; width: 100%; margin-top: 4px; padding: 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; box-sizing: border-box; }
.form-zeilen h3 { margin: 20px 0 10px; font-size: 15px; color: var(--blue); }
.form-zeilen .form-actions { display: flex; gap: 10px; margin-top: 18px; }
.form-zeile { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 14px; margin-bottom: 14px; }
.form-zeilen .checkbox-label { display: flex; align-items: center; gap: 8px; align-self: end; padding-bottom: 10px; }
.form-zeilen .checkbox-label input { width: 17px; height: 17px; margin: 0; }
@media (max-width: 700px) { .form-zeile { grid-auto-flow: row; } }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; background: #fff; padding: 20px; border-radius: 12px; }
.form-grid label { font-size: 13px; font-weight: 600; color: #445; }
.form-grid input, .form-grid select { display: block; width: 100%; margin-top: 4px; padding: 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 8px; }

/* DEB-Logo neben Überschriften */
.mit-logo { display: flex; align-items: center; gap: 10px; }
.deb-logo { height: 36px; width: auto; }

/* Datei-Upload-Zeilen (Spielerpass/Einzellizenz) */
.datei-zeile { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fff; padding: 12px 16px; border-radius: 10px; margin: 0 0 8px; }
.upload-form { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.upload-form input[type=file] { font-size: 13px; max-width: 220px; }
.upload-inline { margin: 6px 0 0; }
.upload-inline input[type=file] { max-width: 170px; font-size: 12px; }
.btn-klein { padding: 5px 10px; font-size: 12px; }

/* Direkt in der Tabelle bearbeitbare Zellen (Material) */
.zellen-input { width: 100%; min-width: 70px; padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; box-sizing: border-box; }
.zellen-kurz { min-width: 60px; max-width: 95px; }
/* Auf/Ab-Pfeile in schmalen Zahlenfeldern ausblenden, damit der Betrag voll sichtbar ist */
input[type="number"].zellen-kurz { -moz-appearance: textfield; appearance: textfield; }
input[type="number"].zellen-kurz::-webkit-outer-spin-button,
input[type="number"].zellen-kurz::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.aktionen-zelle { white-space: nowrap; }
.checkbox-zeile { display: flex; align-items: center; gap: 8px; font-size: 14px !important; padding-top: 22px; }
.checkbox-zeile input { width: 17px; height: 17px; margin: 0; }

/* Eigene Vorschlagsliste (Ersatz für fehlerhafte Safari-Datalist) */
.kombi-box {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 2px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,.18); z-index: 50; max-height: 190px; overflow-y: auto;
}
.kombi-eintrag { padding: 8px 12px; font-size: 14px; cursor: pointer; color: #1a1a2e; text-align: left; }
.kombi-eintrag:hover { background: #f0f4fa; }

/* CSS-Tabs (Radio-basiert, ohne JS) */
.tabs { margin-top: 20px; }
.tabs > input[type=radio] { display: none; }
/* Reiter in EINER Zeile, seitlich wischbar (wie in Apps üblich) */
.tab-zeile {
  display: flex; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
  /* Wischen auf der Zeile wirkt nur seitlich, nicht zusätzlich hoch/runter */
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}
.tab-zeile::-webkit-scrollbar { display: none; }
.tab-zeile label {
  flex: 0 0 auto; white-space: nowrap;
  padding: 8px 14px; cursor: pointer; font-size: 14px; font-weight: 600;
  color: #556; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab-zeile label:hover { color: var(--blue); }
.tabs > section { display: none; padding-top: 8px; }

.tabs:has(> #tab-stammdaten:checked) label[for=tab-stammdaten],
.tabs:has(> #tab-adressen:checked) label[for=tab-adressen],
.tabs:has(> #tab-eltern:checked) label[for=tab-eltern],
.tabs:has(> #tab-dokumente:checked) label[for=tab-dokumente],
.tabs:has(> #tab-pass:checked) label[for=tab-pass],
.tabs:has(> #tab-gesundheit:checked) label[for=tab-gesundheit],
.tabs:has(> #tab-notfall:checked) label[for=tab-notfall],
.tabs:has(> #tab-einverstaendnis:checked) label[for=tab-einverstaendnis],
.tabs:has(> #tab-material:checked) label[for=tab-material],
.tabs:has(> #tab-schlaeger:checked) label[for=tab-schlaeger],
.tabs:has(> #tab-zuzahlungen:checked) label[for=tab-zuzahlungen],
.tabs:has(> #tab-historie:checked) label[for=tab-historie],
.tabs:has(> #tab-beitraege:checked) label[for=tab-beitraege] {
  color: var(--blue); border-bottom-color: var(--red);
}

#tab-stammdaten:checked ~ #panel-stammdaten,
#tab-adressen:checked ~ #panel-adressen,
#tab-eltern:checked ~ #panel-eltern,
#tab-dokumente:checked ~ #panel-dokumente,
#tab-pass:checked ~ #panel-pass,
#tab-gesundheit:checked ~ #panel-gesundheit,
#tab-notfall:checked ~ #panel-notfall,
#tab-einverstaendnis:checked ~ #panel-einverstaendnis,
#tab-material:checked ~ #panel-material,
#tab-schlaeger:checked ~ #panel-schlaeger,
#tab-zuzahlungen:checked ~ #panel-zuzahlungen,
#tab-historie:checked ~ #panel-historie,
#tab-beitraege:checked ~ #panel-beitraege {
  display: block;
}

/* Bearbeitungsstand im Schriftverkehr */
.status-offen { background: #fde8e8; color: #b42318; }
.status-inBearbeitung { background: #fdf3d7; color: #935f00; }
.status-erledigt { background: #d9f2e2; color: #1a7f37; }
select.status-select { border-radius: 20px; font-weight: 600; text-align: center; }

/* Mitwachsende Textfelder (Betreff/Notizen im Schriftverkehr) */
textarea.zellen-text { min-width: 180px; resize: none; overflow: hidden; line-height: 1.45; font-family: inherit; }

/* ===== @-Erwähnungen ===== */
.erwaehnung { color: var(--blue-light); font-weight: 600; }
.erwaehnung-badge { background: var(--red); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 12px; font-weight: 700; display: inline-block; min-width: 18px; line-height: 18px; text-align: center; }
.tab-icon { position: relative; }
.tab-punkt { position: absolute; top: -5px; right: -12px; background: var(--red); color: #fff; border-radius: 9px; font-size: 10px; line-height: 14px; min-width: 14px; padding: 0 3px; text-align: center; font-weight: 700; }
.kanal-punkt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); margin-left: 6px; vertical-align: middle; }
.erwaehnung-vorschlaege { border: 1px solid var(--border); background: #fff; border-radius: 8px; margin-top: 4px; box-shadow: 0 4px 10px rgba(0,0,0,.08); overflow: hidden; }
.erwaehnung-vorschlaege button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: none; font-size: 14px; cursor: pointer; }
.erwaehnung-vorschlaege button:hover { background: var(--bg); }

/* Übergabeprotokolle: dezente Verweise in einer Zeile statt grauer Knöpfe */
.protokoll-links { display: flex; gap: 6px; flex-wrap: nowrap; }
.protokoll-links a {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 20px;
  background: #fff; color: var(--blue); font-size: 13px; font-weight: 600;
}
.protokoll-links a:hover { border-color: var(--blue-light); background: #f0f4fa; text-decoration: none; }

/* Rechtstexte (Impressum, Datenschutz) */
.rechtstext { max-width: 720px; margin: 0 auto; background: #fff; border-radius: 12px; padding: 28px 32px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.rechtstext h1 { color: var(--blue); }
.rechtstext h2 { color: var(--blue); font-size: 16px; margin-top: 24px; }
.rechtstext p, .rechtstext li { font-size: 14px; line-height: 1.6; }
.rechtslinks { margin-top: 10px; font-size: 12px; }
.rechtslinks a { color: #8a94a6; }

/* Gestapelte Tabelle (z. B. Eltern): am Desktop nur so breit wie der Inhalt,
   damit die Aktion-Spalte direkt hinter den Feldern steht */
@media (min-width: 801px) {
  .stapel-tabelle { width: 100%; }
  .stapel-tabelle th, .stapel-tabelle td { padding: 8px 7px; }
  .stapel-tabelle th { font-size: 13px; }
  /* Feste Spaltverteilung: Notizen nimmt den Rest, nichts wächst nach rechts */
  .stapel-tabelle td[data-label="Vorname"], .stapel-tabelle td[data-label="Nachname"] { width: 9%; min-width: 80px; }
  .stapel-tabelle td[data-label="Verhältnis"] { min-width: 185px; }
  .stapel-tabelle td[data-label="Mobil"] { width: 11%; min-width: 125px; }
  .stapel-tabelle td[data-label="E-Mail"] { width: 17%; min-width: 150px; }
  .stapel-tabelle td[data-label="Notizen"] { width: 26%; }
}
/* Mitwachsende Zellen-Felder (Eltern): mehrzeilig, wachsen nach unten */
textarea.zellen-wachsend { width: 100%; min-width: 0; resize: none; overflow: hidden; line-height: 1.4; font-family: inherit; }

/* Gestapelte Tabelle (z. B. Eltern): mobil ein Kasten je Zeile statt Seitwärts-Scrollen */
@media (max-width: 800px) {
  .stapel-tabelle { display: block; overflow: visible; background: none; box-shadow: none; }
  .stapel-tabelle thead { display: none; }
  .stapel-tabelle tbody { display: block; }
  .stapel-tabelle tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    padding: 12px 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
  }
  .stapel-tabelle tr:hover { background: #fff; }
  .stapel-tabelle td { display: flex; flex-direction: column; gap: 3px; border: none; padding: 0; text-align: left; }
  .stapel-tabelle td::before { content: attr(data-label); font-size: 11px; font-weight: 700; color: #667; text-transform: uppercase; letter-spacing: .02em; }
  .stapel-tabelle td[data-label="Notfall"], .stapel-tabelle td[data-label="Sorgerecht"], .stapel-tabelle td[data-label="Abholung"] {
    flex-direction: row; align-items: center; gap: 8px;
  }
  .stapel-tabelle .zelle-breit { grid-column: 1 / -1; }
  .stapel-tabelle .aktionen-zelle { flex-direction: row; justify-content: flex-end; }
  .stapel-tabelle .aktionen-zelle::before { margin-right: auto; align-self: center; }
  .stapel-tabelle .zellen-input { width: 100% !important; }
}

/* PDF-Anhänge in Info-Beiträgen */
.beitrag-dateien { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.beitrag-dateien a {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 20px;
  background: #fff; color: var(--blue); font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.beitrag-dateien a:hover { border-color: var(--blue-light); background: #f0f4fa; text-decoration: none; }

/* Anhänge nachträglich verwalten (Infos) */
.anhang-verwalten { margin-top: 6px; }
.anhang-verwalten summary { font-size: 12px; color: #667; cursor: pointer; font-weight: 400; }
.anhang-bereich { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0 2px; }
.anhang-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px;
  border: 1px solid var(--border); border-radius: 20px; background: #fff; color: var(--red);
  font-size: 13px; cursor: pointer; }
.anhang-chip:hover { border-color: var(--red); background: #fdf1f1; }
.anhang-neu { display: flex; gap: 8px; align-items: center; }
.anhang-neu input[type=file] { font-size: 12px; max-width: 230px; }

/* Zimmerbelegung Auswärtsfahrten */
.kpi-grid-schmal { margin-bottom: 0; grid-template-columns: repeat(auto-fill, minmax(200px, 340px)); }
.zimmer-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .zimmer-spalten { grid-template-columns: 1fr; } }
.zimmer-spalte { background: #fff; border-radius: 12px; padding: 14px 18px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.zimmer-spalte h2 { margin-top: 4px; }
.zimmer-liste { display: flex; flex-wrap: wrap; gap: 8px; }
.zimmer-chip { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 20px;
  background: #fff; color: var(--blue); font-size: 14px; font-weight: 600; cursor: pointer; }
.zimmer-chip:hover { border-color: var(--blue-light); background: #f0f4fa; }
.chip-doppel { background: #eaf1fa; border-color: #b9cee6; }
.chip-einzel { background: #fdf3d7; border-color: #e6d194; color: #6b5200; }

/* Zimmerbelegung: 12 Doppelzimmer-Boxen */
.zimmer-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.zimmer-box { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05); cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.zimmer-box:hover { border-color: var(--blue-light); }
.zimmer-box.zimmer-voll { cursor: default; background: #f7f9fc; }
.zimmer-titel { font-size: 12px; font-weight: 700; color: #667; text-transform: uppercase; letter-spacing: .02em; }
.zimmer-platz-frei { border: 1px dashed var(--border); border-radius: 20px; padding: 7px 14px;
  color: #99a; font-size: 13px; text-align: center; }
.zimmer-box .zimmer-chip { width: 100%; }
.zimmer-box-einzel { cursor: pointer; margin-bottom: 8px; }
.chip-gewaehlt { background: var(--blue) !important; color: #fff !important; border-color: var(--blue) !important; }

/* Zimmerbelegung: Verwaltung + Sperren */
.zimmer-gesperrt { opacity: .55; cursor: not-allowed !important; background: #f2f2f4; }
.chip-fest { cursor: default; }
.zimmer-verwaltung { margin-top: 28px; background: #fff; border-radius: 12px; padding: 14px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.zimmer-verwaltung summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.zimmer-verwaltung h3 { margin-bottom: 8px; }
.sperre-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.sperre-form label { font-size: 13px; font-weight: 600; color: #445; display: flex; flex-direction: column; gap: 4px; }
.sperre-form input { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.zimmer-verwaltung-tabelle { max-width: 560px; }

/* Zimmerbelegung: Druckansicht (PDF über den Druckdialog) */
.zimmer-druck { display: none; }
@media print {
  .nur-bildschirm, .no-print, .topnav, .tabbar, #mehr-menue { display: none !important; }
  .zimmer-druck { display: block; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .page-head h1 { color: #003366; border-bottom: 3px solid #003366; padding-bottom: 6px; margin-bottom: 4px; }
  .zimmer-druck .druck-stand { color: #555; font-size: 12px; margin-top: 0; }
  .zimmer-druck table { box-shadow: none; font-size: 13px; }
  .zimmer-druck th { background: #003366 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .zimmer-druck tr { break-inside: avoid; }
  .zimmer-druck .druck-frei { font-size: 12px; }
  .zimmer-druck .druck-fuss { font-size: 10px; color: #777; margin-top: 12px; }
}

/* Belege (Quittungen/Rechnungen) */
.hinweis-ok { background: #e6f6ea; border: 1px solid #9ad2a8; color: #1c6b33;
  border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.belege-auswertung, .belege-bereiche { max-width: 640px; }
.bereiche-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 900px; }
@media (max-width: 800px) { .bereiche-spalten { grid-template-columns: 1fr; } }
.wj-wahl { margin: 6px 0 -6px; }
.wj-wahl label { font-size: 14px; font-weight: 600; color: #445; }
.wj-wahl select { margin-left: 6px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; }
.saldo-minus { color: #c22; }
.summen-zeile td { border-top: 2px solid var(--blue); }

/* Infos: Mitglieder-Kanäle */
.kanal-mitglieder summary { cursor: pointer; font-size: 13px; color: var(--blue); }
/* Ordentliches Spaltenraster: alle Namen bündig untereinander */
.kanal-mitglieder-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 7px 16px; padding: 10px 2px; max-height: 280px; overflow-y: auto; }
.kanal-mitglieder-liste label { display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanal-mitglieder-liste input { flex: none; margin: 0; }

/* Belege: Ampel-Status */
.ampel-wahl { border-width: 2px !important; }
.ampel-gruen { border-color: #2e9e4f !important; background: #e6f6ea; }
.ampel-gelb { border-color: #e6a700 !important; background: #fdf4d8; }
.ampel-rot { border-color: #c8102e !important; background: #fae3e7; }
.ampel-blau { border-color: #0a4f8f !important; background: #e3edf8; }

/* Belege: Aufteilung (Splitbuchung) */
.teil-editor td { background: #f4f7fb; }
.teil-form { display: flex; flex-direction: column; gap: 8px; }
.teil-zeilen { display: flex; flex-direction: column; gap: 6px; }
.teil-zeile { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.teil-zeile input.teil-betrag { width: 110px; }
.teil-fuss { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.teil-summe.teil-rest { color: #b58300; font-weight: 700; }
.teil-hinweis { font-size: 13px; }
.teil-hinweis div { white-space: nowrap; }

/* Belege: zweizeilige Tabellen – Zweck/Notizen in voller Breite */
.beleg-textzeile td { background: #fafbfd; padding-top: 4px; }
tr:has(+ .beleg-textzeile) td { border-bottom: none; }
.beleg-textfelder { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.beleg-textfelder label { font-size: 12px; font-weight: 600; color: #667; display: block; }
.beleg-textfelder textarea { display: block; width: 100%; margin-top: 2px; resize: none; overflow: hidden;
  font-weight: 400; font-size: 14px; line-height: 1.35; }
@media (max-width: 800px) { .beleg-textfelder { grid-template-columns: 1fr; } }

/* Benutzerverwaltung: Team-Freischaltung als Häkchenliste */
.team-haken summary { cursor: pointer; font-size: 13px; white-space: nowrap; }
.team-haken-liste { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 6px 2px; max-width: 260px; }
.team-haken-liste label { font-size: 13px; white-space: nowrap; font-weight: 400; }
.team-haken-neu { max-width: none; margin-bottom: 8px; }

/* Datenauswahl: gespeicherte Tabellen */
.vorlagen-zeile { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px;
  padding-top: 10px; border-top: 1px dashed var(--border); }
.vorlagen-zeile label { font-size: 13px; font-weight: 600; color: #445; display: flex; align-items: center; gap: 6px; }
.vorlagen-zeile select, .vorlagen-zeile input { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.vorlagen-zeile input { min-width: 220px; }
.vorlagen-trenner { flex-basis: 12px; }
@media print { .vorlagen-zeile { display: none; } }

/* Lagerauswertung (PDF über den Druckdialog) */
.lager-auswertung h2 { color: var(--blue); margin-top: 26px; }
.lager-auswertung .druck-stand { color: #556; font-size: 13px; }
.lager-auswertung .druck-fuss { font-size: 12px; color: #778; margin-top: 16px; }
@media print {
  .lager-auswertung table { box-shadow: none; font-size: 10px; }
  .lager-auswertung th, .lager-auswertung td { padding: 3px 6px; }
  .lager-auswertung th { background: #003366 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lager-auswertung tr { break-inside: avoid; }
  .lager-auswertung h2 { color: #003366; break-after: avoid; }
  .lager-auswertung h3 { break-after: avoid; }
  .lager-auswertung .druck-fuss { font-size: 10px; color: #777; }
}

/* Umfragen */
.umfragen-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.umfrage-karte { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--border);
  border-left: 5px solid var(--blue); border-radius: 10px; padding: 14px 16px; color: inherit; }
.umfrage-karte:hover { box-shadow: 0 3px 10px rgba(0,0,0,.08); text-decoration: none; }
.umfrage-karte.umfrage-zu { border-left-color: #8a94a6; opacity: .8; }
.umfrage-formular { background: #fff; border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.05); max-width: 640px; }
.umfrage-formular label { display: block; font-weight: 600; font-size: 14px; color: #445; margin: 12px 0 4px; }
.umfrage-formular input, .umfrage-formular select { display: block; width: 100%; margin-top: 4px; padding: 9px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 15px; font-weight: 400; }
.frage-block { border-top: 1px dashed var(--border); margin-top: 12px; padding-top: 4px; }
.antwort-bereich { background: #fff; border-radius: 12px; padding: 12px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.05); margin-bottom: 18px; }
.antwort-bereich summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.antwort-bereich .umfrage-formular { box-shadow: none; padding: 4px 0 8px; }
.umfrage-tabelle td, .umfrage-tabelle th { vertical-align: top; }
.zeile-offen td { color: #99a; }
@media print {
  .umfrage-tabelle { font-size: 11px; }
  .umfrage-tabelle th { background: #003366 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .umfrage-tabelle tr { break-inside: avoid; }
}

/* Umfragen: Mehrfachauswahl */
.frage-mehrfach { margin: 12px 0 4px; }
.frage-mehrfach .frage-titel { display: block; font-weight: 600; font-size: 14px; color: #445; margin-bottom: 6px; }
.mehrfach-option { display: inline-flex !important; align-items: center; gap: 6px; margin: 2px 14px 2px 0 !important;
  font-weight: 400 !important; font-size: 14px !important; }
.umfrage-formular input[type=checkbox], .umfrage-formular input[type=radio] { width: auto; display: inline; margin: 0; }

/* Umfragen: Antworten-Liste mit Ja/Nein je Zeile */
.janein-zeile { display: flex; align-items: center; gap: 4px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.janein-zeile:last-child { border-bottom: none; }
.janein-antwort { flex: 1; font-size: 14px; }

/* Umfragen im Forms-Stil */
.umfrage-karte { padding: 0; overflow: hidden; border-left: 1px solid var(--border); }
.karte-kopf { display: flex; justify-content: center; align-items: center;
  background: linear-gradient(135deg, #002a55, #0a4f8f); padding: 22px 0; }
.karte-kopf img { height: 64px; width: auto; }
.karte-inhalt { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.karte-inhalt strong { font-size: 16px; color: #1a1a2e; }
.karte-antworten { font-weight: 600; color: var(--blue); font-size: 14px; }

.umfrage-hero { max-width: 760px; border-radius: 14px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.08); margin-bottom: 18px; background: #fff; }
.hero-blau { background: linear-gradient(135deg, #002a55, #0a4f8f); display: flex; justify-content: center; padding: 30px; }
.hero-blau img { height: 110px; width: auto; }
.hero-text { padding: 22px 30px; }
.hero-text h1 { color: var(--blue); margin: 0 0 8px; font-size: 30px; }
.hero-text p { color: #556; margin: 0; }

.antwort-bereich, .umfrage-formular { max-width: 760px; }
.antwort-bereich { background: none; box-shadow: none; padding: 0; }
.antwort-bereich summary { background: #fff; border-radius: 12px; padding: 12px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.antwort-bereich .umfrage-formular { background: none; }
.frage-karte { background: #fff; border-radius: 12px; padding: 16px 20px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.05); margin: 12px 0; }
.frage-karte .frage-titel { font-size: 15px; }
/* Auswahl-Antworten untereinander (wie bei Forms) */
.frage-senkrecht .mehrfach-option { display: flex !important; margin: 8px 0 !important; }
@media print { .umfrage-hero .hero-blau { display: none; } }

/* Umfrage-Kacheln: kompakte Auswertung */
.karte-frage { font-size: 12px; font-weight: 700; color: #667; text-transform: uppercase; letter-spacing: .02em; margin-top: 6px; }
.karte-wert { font-size: 13px; color: #334; }

/* Umfrage-Kacheln: Fußzeile mit Tabellen-Knopf */
.umfrage-karte .karte-link { display: flex; flex-direction: column; color: inherit; }
.umfrage-karte .karte-link:hover { text-decoration: none; }
.umfrage-karte:hover { box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.karte-fuss { padding: 0 16px 14px; margin-top: auto; }

/* Push-Benachrichtigungen */
.push-haken { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: #445; margin-right: 12px; }
.push-haken input { width: 16px; height: 16px; }
#push-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#push-banner[hidden] { display: none; }

/* Anwesenheitsliste */
.anw-legende .anw-status { margin-right: 2px; }
.anw-kopf { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.anw-tabs, .anw-nav { display: flex; align-items: center; gap: 6px; }
.anw-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.anw-tabelle { min-width: 640px; }
.anw-tabelle th, .anw-tabelle td { text-align: center; padding: 6px 4px; }
.anw-tabelle th:first-child, .anw-tabelle td:first-child { text-align: left; white-space: nowrap; padding-left: 10px; }
.anw-tabelle th.anw-we { color: #b06060; }
.anw-tabelle .anw-heute { background: #fff8dd; }
.anw-summe { color: #666; font-size: 12px; }
.anw-zelle { width: 30px; height: 30px; border: 1px solid #d5d5d5; border-radius: 6px;
  background: #fff; cursor: pointer; font-weight: 700; font-size: 13px; padding: 0; }
.anw-status { display: inline-block; min-width: 22px; text-align: center; border-radius: 6px;
  font-weight: 700; font-size: 13px; padding: 2px 4px; }
.anw-x { background: #e6f6ea; color: #217a38; border-color: #2e9e4f; }
.anw-k { background: #fdecea; color: #b3261e; border-color: #d9534f; }
.anw-n { background: #e8f0fe; color: #1a56b8; border-color: #4a7fd6; }
.anw-klein { font-size: 11px; }
.anw-klein .anw-k, .anw-klein .anw-n { background: none; padding: 0; min-width: 0; }
.anw-konfig { margin: 16px 0; }
.anw-konfig summary { cursor: pointer; font-weight: 600; }
.anw-gruppe td { background: #eef2f6; color: #46586b; font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: .4px; padding: 4px 10px; }
.anw-gruppen-titel { margin: 12px 0 4px; font-weight: 700; font-size: 13px; color: #46586b; }

/* Lieferscheine */
.lief-neu { margin: 10px 0 18px; }
.lief-neu summary { cursor: pointer; font-weight: 600; }
.lief-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px;
  align-items: end; background: #fff; border-radius: 10px; padding: 14px; margin-top: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.lief-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.lief-form input, .lief-form select, .lief-form textarea { padding: 7px 8px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; font-family: inherit; }
.lief-tabelle .lief-unvollstaendig td { background: #fff4e5; }
.lief-dateien { font-size: 13px; }
.lief-datei { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.lief-datei-x { border: none; background: none; color: #b3261e; cursor: pointer; font-size: 12px; padding: 0 2px; }
.lief-nachreichen { display: inline-block; margin-top: 2px; }
.lief-nachreichen label { cursor: pointer; }
.fehlt-feld { display: flex; flex-direction: column; gap: 6px; grid-column: 1 / -1; }
.fehlt-titel { font-size: 14px; font-weight: 600; }
.fehlt-zeilen { display: flex; flex-direction: column; gap: 4px; }
.fehlt-zeile { display: flex; gap: 6px; }
.fehlt-zeile input[name="fmenge"] { width: 70px; flex: none; }
.fehlt-zeile input[name="fartikel"] { flex: 1; min-width: 140px; }
.fehlt-editor { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 220px; }
.fehlt-feld .fehlt-plus, .fehlt-editor .fehlt-plus { align-self: flex-start; }
.lief-bearbeiter { font-size: 12px; color: #666; }
.lief-bearbeiter span { display: block; white-space: nowrap; }
.trikot-ausgabe { display: flex; gap: 4px; align-items: center; }
.trikot-ausgabe select { max-width: 150px; padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.trikot-ausgabe input { width: 60px; padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.kpi-nur-text { display: flex; align-items: center; }
.kpi-nur-text span { font-weight: 600; }
.groessen-block { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.groessen-titel { font-size: 14px; font-weight: 600; }
.groessen-zeilen { display: flex; flex-direction: column; gap: 4px; }
.groessen-zeile { display: flex; gap: 6px; }
.groessen-zeile input[name="ggroesse"] { width: 180px; }
.groessen-zeile input[name="gmenge"] { width: 90px; }
.groessen-block .groesse-plus { align-self: flex-start; }
/* Lager: Bezeichnung immer vollständig lesbar */
.zellen-input[name="item_name"] { min-width: 130px; }
/* Lager: Such- und Filterleiste */
.lager-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.lager-filter input[type="search"] { flex: 1; min-width: 240px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.lager-filter select { padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.lager-filter .filter-haken { display: flex; align-items: center; gap: 5px; font-size: 14px; white-space: nowrap; cursor: pointer; }
.lager-tabelle textarea[name="besteller"], .lager-tabelle textarea[name="notes"] { min-width: 95px; }
.trikot-ausgabe .uebergabe-sportler { max-width: 170px; }
/* Lager: Übergabe zweizeilig (oben Mannschaft + Person, darunter Menge + Knopf) */
.uebergabe-zweizeilig { display: grid; grid-template-columns: 84px minmax(96px, 1fr); gap: 4px; align-items: center; }
.uebergabe-zweizeilig select, .uebergabe-zweizeilig .uebergabe-sportler { width: 100%; max-width: none; min-width: 0; }
.uebergabe-zweizeilig input[name="menge"] { width: 60px; }
.uebergabe-zweizeilig .btn { justify-self: start; }
/* Lagertabellen scrollen bei Platzmangel in sich – die Seite bleibt im Format */
table.lager-tabelle { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.zubuchen { display: flex; gap: 4px; align-items: center; justify-content: center; }
.zubuchen input { width: 64px; padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }

/* Bestellverwaltung */
.status-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef2f6; white-space: nowrap; }
.status-bestellt, .status-offen { background: #fff3cd; color: #7a5b00; }
.status-teilgeliefert { background: #e8f0fe; color: #1a56b8; }
.status-geliefert, .status-erledigt { background: #e6f6ea; color: #217a38; }
.status-storniert, .status-abgelehnt { background: #fdecea; color: #b3261e; }
.r { text-align: right; }
.pos-zeilen { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.pos-zeile { display: grid; grid-template-columns: 110px minmax(150px, 1.4fr) 1fr 1fr 80px 100px 80px 1fr; gap: 6px; align-items: center; }
.pos-zeile.pos-mit-preis { grid-template-columns: 110px minmax(150px, 1.4fr) 1fr 1fr 80px 100px 80px 110px; }
.pos-kopf span { font-size: 12px; font-weight: 600; color: #46586b; }
.pos-zeile input, .pos-zeile select { padding: 6px 7px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; min-width: 0; }
.pos-aktionen { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.best-form, .best-kopf { background: #fff; border-radius: 10px; padding: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05); margin-top: 10px; }
.best-kopf { display: grid; }
.bedarf-aktion { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin: 8px 0 18px; }
.bedarf-aktion label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.bedarf-aktion input, .bedarf-aktion select { padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.hinweis-ok { background: #e6f6ea; border: 1px solid #2e9e4f; border-radius: 10px; padding: 10px 14px; margin: 10px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lief-unterschrift { font-size: 13px; white-space: nowrap; }
.lief-unterschrift span { display: block; margin-bottom: 3px; }
/* Lieferschein-Druck + Unterschrift */
.ls-kopf td { padding: 4px 10px 4px 0; }
.ls-pad { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.ls-pad label { font-weight: 600; font-size: 14px; display: flex; flex-direction: column; gap: 4px; max-width: 360px; }
.ls-pad input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; }
#us-canvas { width: 100%; max-width: 700px; height: auto; background: #fff; border: 2px dashed #9aa7b8; border-radius: 10px; touch-action: none; cursor: crosshair; }
.ls-pad-knoepfe { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ls-unterschrift-fertig img { max-width: 420px; width: 100%; border-bottom: 1px solid #333; }
.ls-unterschrift-linie { margin-top: 40px; }
.print-only { display: none; }
@media print { .print-only { display: block; } .no-print { display: none !important; } }
@media (max-width: 900px) { .pos-zeile, .pos-zeile.pos-mit-preis { grid-template-columns: 1fr 1fr; } .pos-kopf { display: none; } }
.fehlt-editor .fehlt-artikel { min-width: 280px; }
.fehlt-editor .fehlt-zeile input[name="fmenge"] { width: 64px; }
/* Mitwachsende Felder nie flacher als eine Zeile (auch wenn beim Laden versteckt) */
textarea.zellen-wachsend { min-height: 30px; }
.team-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e8f0fe; color: #1a56b8; white-space: nowrap; vertical-align: middle; }
td .team-badge { margin-top: 3px; }
.schlaeger-zeile input[name="sflex"], .schlaeger-zeile input[name="scurve"] { width: 120px; }
.schlaeger-zeile select[name="sbieg"] { padding: 6px 7px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.schlaeger-zeile input[name="smenge"] { width: 90px; }
/* Hersteller/Modell/Farbe: Breite folgt dem Inhalt (JS setzt width in ch) */
.lager-tabelle input[name="manufacturer"], .lager-tabelle input[name="model"], .lager-tabelle input[name="color"] { min-width: 0; }
.lager-tabelle input[name="color"] { max-width: none; }
/* Besondere Jahrgänge in der Sportlerübersicht (U15: 2014, U17: 2010) */
tr.jahrgang-rot td, tr.jahrgang-rot td a { color: #c0392b; }

/* Neu-laden-Knopf für den App-Modus (Dock/Homescreen, ohne Browser-Leiste) */
.nav-reload { background: rgba(255, 255, 255, .15); color: #fff; border: none; border-radius: 50%;
  width: 30px; height: 30px; font-size: 17px; line-height: 1; cursor: pointer; flex-shrink: 0; }
.nav-reload:hover { background: rgba(255, 255, 255, .3); }
.nav-reload.dreht { animation: nav-reload-drehung .8s linear infinite; }
@keyframes nav-reload-drehung { to { transform: rotate(360deg); } }

/* Benutzerverwaltung: alle Spalten vollständig lesbar, Team-Spalte darf umbrechen */
.benutzer-scroll { overflow-x: auto; }
.benutzer-tabelle td:nth-child(1), .benutzer-tabelle td:nth-child(6) { white-space: nowrap; }
.benutzer-tabelle td:nth-child(2) .zellen-input { min-width: 180px; }
.benutzer-tabelle td:nth-child(3) .zellen-input { min-width: 170px; }
.benutzer-tabelle td:nth-child(4) .zellen-input { min-width: 210px; }
.benutzer-tabelle td:nth-child(5) { min-width: 200px; max-width: 260px; }
.benutzer-tabelle .team-haken summary { white-space: normal; line-height: 1.4; }

/* Umfrage: Auswertung auf einen Blick */
.auswertung-blick { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin: 8px 0 20px; }
.auswertung-block { background: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.auswertung-titel { font-weight: 600; margin-bottom: 6px; }
.auswertung-tabelle { margin: 0; box-shadow: none; }
.auswertung-tabelle td { padding: 4px 6px; border-bottom: none; font-size: 14px; }
.auswertung-option { width: 45%; }
.auswertung-balken { width: 40%; }
.auswertung-balken .balken { height: 12px; background: var(--blue); border-radius: 6px; min-width: 2px; }
.auswertung-zahl { white-space: nowrap; }
.auswertung-text { font-size: 14px; padding: 2px 0; }
@media print { .auswertung-blick { display: block; } .auswertung-block { break-inside: avoid; margin-bottom: 10px; } }

/* Umfrage: Teilnehmer-Häkchenliste */
.teilnehmer-knoepfe { display: flex; gap: 6px; margin: 4px 0 8px; }
.teilnehmer-haken { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.teilnehmer-haken label { font-size: 14px; font-weight: 400; white-space: nowrap; }
.teilnehmer-gruppe { flex-basis: 100%; font-weight: 600; font-size: 13px; color: #445; margin-top: 8px; }

/* Trainingskalender (Bereich Trainer) */
.kal-kopf { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 14px; }
.kal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kal-titel { margin-left: 6px; }
.kal-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kal-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; border: 2px solid var(--farbe); background: var(--farbe); color: #fff; }
.kal-chip input { accent-color: #fff; margin: 0; }
.kal-chip-aus { background: #fff; color: var(--farbe); }
.kal-woche { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.kal-tag { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px; min-height: 120px; }
.kal-tag header { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.kal-tag header a { text-decoration: none; }
.kal-heute { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(26, 86, 184, .15); }
.kal-heute header strong { color: var(--blue); }
.kal-leer { text-align: center; margin: 12px 0; }
.kal-termin { display: block; margin: 0 0 6px; padding: 6px 8px; border-radius: 8px; border-left: 5px solid var(--farbe); background: color-mix(in srgb, var(--farbe) 12%, #fff); color: inherit; text-decoration: none; font-size: 13px; line-height: 1.35; }
.kal-termin:hover { background: color-mix(in srgb, var(--farbe) 22%, #fff); }
.kal-zeit { display: block; font-weight: 700; }
.kal-team { display: inline-block; font-weight: 700; color: var(--farbe); margin-right: 4px; }
.kal-art { display: inline-block; }
.kal-info { display: block; font-size: 12px; color: #556; }
@media (max-width: 1000px) { .kal-woche { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .kal-woche { grid-template-columns: 1fr; } .kal-tag { min-height: 0; } }

/* Benutzerverwaltung: Übersicht + Filter */
.bn-uebersicht { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0; }
.bn-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 13px; cursor: pointer; color: inherit; }
.bn-chip b { background: #eef1f6; border-radius: 999px; padding: 0 7px; font-weight: 700; }
.bn-chip:hover { border-color: var(--blue); }
.bn-chip-aktiv { background: var(--blue); color: #fff; border-color: var(--blue); }
.bn-chip-aktiv b { background: rgba(255,255,255,.25); }
.bn-chip-rot:not(.bn-chip-aktiv) { border-color: var(--red); color: var(--red); }
.bn-chip-gelb:not(.bn-chip-aktiv) { border-color: #e0a300; color: #9a6b00; }
.bn-chip-trenner { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.bn-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 4px; }
.bn-filter input, .bn-filter select { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; }
.bn-filter input { min-width: 220px; flex: 1 1 220px; max-width: 360px; }
.bn-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.bn-sort:hover { color: var(--blue); }
.bn-pfeil { font-size: 10px; margin-left: 2px; }

/* Lager: Ausgabe an Einzelpersonen */
.personen-ausgabe > summary { font-size: 16px; }
.personen-form { margin-bottom: 12px; }
.personen-form select { display: block; width: 100%; margin-top: 4px; padding: 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
