/* FFW Eichstätt — Oberfläche
   Helle, ruhige Gestaltung mit viel Weißraum.
   Schriften: bewusst systemeigen, damit nichts nachgeladen werden muss
   (offline lauffähig, kein CDN, keine fremden Dateien).
   Alle Symbole sind selbst gezeichnete SVG bzw. Unicode-Zeichen. */

:root {
  /* Feuerwehrrot bleibt die Leitfarbe, aber ruhiger abgestimmt. */
  --red:        #C8102E;
  --red-dark:   #A00D25;
  --red-soft:   #FDF2F4;
  --red-glow:   rgba(200,16,46,0.14);

  --yellow:     #E8A317;
  --yellow-soft:#FEF8EC;

  /* Heller Hintergrund, Karten in Weiß. */
  --bg:         #F5F5F7;
  --surface:    #FFFFFF;
  --surface2:   #F5F5F7;
  --border:     #E3E3E6;
  --border-mid: #D2D2D7;

  --text:       #1D1D1F;
  --text-2:     #424245;
  --muted:      #6E6E73;
  --faint:      #94949B;

  --green:      #1D8F4E;
  --green-dim:  #EDF7F1;
  --blue:       #0071E3;

  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 2px 10px rgba(0,0,0,0.06);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.10);

  --radius:     12px;
  --radius-sm:  8px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ── ANMELDUNG ── */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background: linear-gradient(170deg, #FFFFFF 0%, #F5F5F7 60%, #EFEFF2 100%);
}
#login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px; padding: 44px 40px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
#login-box .login-mark { margin-bottom: 20px; }
#login-box h1 {
  font-size: 27px; letter-spacing: -0.4px; font-weight: 600;
  margin-bottom: 5px;
}
#login-box h1 .accent { color: var(--red); }
#login-box .sub {
  font-size: 14px; color: var(--muted); margin-bottom: 30px;
}
#login-box form { text-align: left; }

/* ── KOPFZEILE ── */
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px; gap: 18px;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  flex-wrap: wrap;
}
/* Streifen nur zeichnen, wenn die Kopfzeile einzeilig bleibt —
   bei Umbruch säße er sonst mitten im Inhalt. */
/* Schmaler rot-gelber Streifen als Erkennungsmerkmal der Feuerwehr.
   Liegt auf der Unterkante der Kopfzeile über die volle Breite. */
#topbar::after {
  content: '';
  position: absolute; left: 0; bottom: -1px;
  width: 100%; height: 2px;
  background: linear-gradient(90deg,
    var(--red) 0%, var(--red) 64%, var(--yellow) 64%, var(--yellow) 100%);
  pointer-events: none;
}
#topbar .brand {
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap;
}
#topbar .brand-text {
  font-size: 16px; font-weight: 600; letter-spacing: -0.2px;
  color: var(--text);
}
#topbar .brand-text b { color: var(--red); font-weight: 600; }
#topbar nav { display: flex; gap: 2px; flex-wrap: wrap; }
#topbar nav button {
  background: none; border: none;
  color: var(--text-2); padding: 7px 13px;
  font-size: 13px; font-weight: 400;
  cursor: pointer; border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
#topbar nav button:hover { background: rgba(0,0,0,0.05); color: var(--text); }
#topbar nav button.active {
  background: var(--red); color: #fff; font-weight: 500;
}
#topbar .right {
  display: flex; align-items: center; gap: 14px;
  font-size: 12px; color: var(--muted);
}

/* ── SICHERUNGSWARNUNG ── */
#backup-warning {
  display: none;
  background: var(--yellow-soft);
  border-bottom: 1px solid #F0DCB0;
  color: #8A5D00;
  padding: 11px 20px;
  font-size: 13px;
  text-align: center;
}
#backup-warning.show { display: block; }

/* ── BILDSCHIRME ── */
.screen { display: none; padding: 34px 24px 60px; max-width: 1000px; margin: 0 auto; }
.screen.active { display: block; }

.section-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.section-head h2 {
  font-size: 30px; letter-spacing: -0.5px; font-weight: 600;
}
.section-head .sub {
  font-size: 13px; color: var(--muted);
}

/* ── KARTEN ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 15px; font-weight: 600;
  color: var(--text); margin-bottom: 16px;
}

/* ── EINGABEFELDER ── */
input[type=text], input[type=password], input[type=number],
input[type=date], input[type=time], select, textarea {
  width: 100%; background: var(--surface);
  border: 1px solid var(--border-mid); color: var(--text);
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 15px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
label.field-label {
  display: block;
  font-size: 12px; font-weight: 500;
  color: var(--muted); margin-bottom: 7px;
}

/* ── SCHALTFLÄCHEN ── */
.btn {
  padding: 10px 20px; border: none; border-radius: 980px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.18s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--red-dark); }
.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-mid);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface2); border-color: var(--muted);
}
.btn-danger { background: transparent; color: var(--red); border: 1px solid #E8B4BD; }
.btn-danger:hover:not(:disabled) { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm { padding: 7px 15px; font-size: 13px; }
.w100 { width: 100%; }

/* ── RASTER ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── MITGLIEDERLISTE ── */
.member-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px; gap: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.member-row:hover { border-color: var(--border-mid); box-shadow: var(--shadow-sm); }
.member-row.inactive { opacity: 0.5; }
.member-name { font-weight: 600; font-size: 15px; }
.member-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.member-nfc {
  font-family: var(--font-mono);
  font-size: 12px; color: #8A5D00;
  background: var(--yellow-soft); border: 1px solid #F0DCB0;
  padding: 4px 9px; border-radius: 6px;
  white-space: nowrap;
}
.member-nfc.unset {
  color: var(--faint); background: var(--surface2); border-color: var(--border);
}
.row-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* ── SUCHE ── */
.search-wrap { position: relative; margin-bottom: 16px; }
.search-wrap input { padding-left: 38px; }
.search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 14px; pointer-events: none;
}

/* ── ÜBERLAGERUNGEN ── */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  z-index: 300;
  align-items: center; justify-content: center; padding: 20px;
}
.overlay.open { display: flex; }
.overlay-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 30px; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: slide-up 0.18s ease;
}
.overlay-box.accent-yellow { border-top: 3px solid var(--yellow); }
@keyframes slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.enroll-ring {
  width: 96px; height: 96px; border-radius: 50%;
  border: 3px solid var(--yellow); background: var(--yellow-soft);
  display: flex; align-items: center; justify-content: center;
  margin: 22px auto; font-size: 36px;
  animation: pulse-yellow 1.6s ease-in-out infinite;
}
@keyframes pulse-yellow {
  0%,100% { box-shadow: 0 0 0 0 rgba(232,163,23,0.30); }
  50%     { box-shadow: 0 0 0 14px rgba(232,163,23,0); }
}

/* ── KIOSK ── */
.kiosk-center { text-align: center; padding: 26px 0 50px; }
.kiosk-icon { margin-bottom: 20px; }
.kiosk-idle-title {
  font-size: 28px; letter-spacing: -0.5px; font-weight: 600; color: var(--text);
}
/* Ruhezustand als eigene Karte, damit der Bildschirm nicht leer wirkt. */
#kiosk-idle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  max-width: 480px; margin: 40px auto 0;
  padding: 48px 40px 52px;
}

#kiosk-badge {
  display: inline-block;
  font-size: 13px; font-weight: 500; letter-spacing: 0.2px;
  padding: 6px 16px; border-radius: 980px; margin-bottom: 18px;
  background: var(--yellow-soft); color: #8A5D00;
  border: 1px solid #F0DCB0;
}
#kiosk-title {
  font-size: clamp(32px, 6vw, 54px);
  letter-spacing: -1px; line-height: 1.08; font-weight: 600;
  margin-bottom: 8px;
}
#kiosk-subtitle {
  font-size: 15px; color: var(--muted); margin-bottom: 36px;
}

#scan-zone { position: relative; display: inline-block; }
#scan-ring {
  width: 156px; height: 156px; border-radius: 50%;
  border: 2px solid var(--border-mid); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; font-size: 54px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  animation: pulse-idle 2.6s ease-in-out infinite;
}
#scan-ring.success {
  border-color: var(--green); background: var(--green-dim);
  box-shadow: 0 0 0 10px rgba(29,143,78,0.10);
  animation: none;
}
#scan-ring.error {
  border-color: var(--red); background: var(--red-soft);
  box-shadow: 0 0 0 10px var(--red-glow);
  animation: none;
}
@keyframes pulse-idle {
  0%,100% { box-shadow: 0 0 0 0 rgba(200,16,46,0.10), var(--shadow-md); }
  50%     { box-shadow: 0 0 0 12px rgba(200,16,46,0), var(--shadow-md); }
}
/* Unsichtbares Eingabefeld — der Leser tippt hier hinein. */
#scan-input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
  pointer-events: none; top: 0; left: 0;
}
#scan-hint {
  font-size: 14px; color: var(--muted); margin-top: 16px;
}

.btn-manual {
  padding: 13px 30px;
  border: 1px solid var(--border-mid);
  background: var(--surface);
  color: var(--text);
  border-radius: 980px;
  font-size: 15px; font-weight: 500;
  cursor: pointer; transition: all 0.18s;
  box-shadow: var(--shadow-sm);
}
.btn-manual:hover {
  background: var(--surface2); border-color: var(--muted);
}

#flash-msg {
  min-height: 46px; display: flex;
  align-items: center; justify-content: center;
  font-size: 26px; letter-spacing: -0.4px; font-weight: 600;
  opacity: 0; transition: opacity 0.2s; margin-top: 18px;
}
#flash-msg.show { opacity: 1; }
#flash-msg.ok  { color: var(--green); }
#flash-msg.err { color: var(--red); }

#kiosk-counter {
  font-size: 14px; color: var(--muted); margin: 24px 0 18px;
}
#kiosk-counter strong {
  font-size: 21px; color: var(--green); margin: 0 4px; font-weight: 600;
}

#attendance-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; max-width: 760px; margin: 0 auto;
}
.chip {
  background: var(--green-dim); border: 1px solid #BFE0CD;
  border-radius: 980px; padding: 7px 15px;
  font-size: 14px; font-weight: 500; color: #14663A;
  animation: chip-in 0.25s ease;
}
.chip .chip-time {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--muted); margin-left: 8px;
}
@keyframes chip-in {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── ÜBUNGSLISTE ── */
.uebung-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  box-shadow: var(--shadow-sm);
}
.uebung-card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-md); transform: translateY(-1px);
}
.uebung-badge {
  display: inline-block;
  font-size: 12px; font-weight: 500;
  padding: 3px 10px; border-radius: 980px; margin-bottom: 7px;
  background: var(--yellow-soft); color: #8A5D00;
  border: 1px solid #F0DCB0;
}
.uebung-badge.running {
  background: var(--green-dim); color: #14663A; border-color: #BFE0CD;
}
.uebung-name { font-weight: 600; font-size: 16px; }
.uebung-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.uebung-count {
  font-size: 26px; font-weight: 600; color: var(--green);
  line-height: 1; text-align: right;
}
.uebung-count-label {
  font-size: 12px; color: var(--muted); text-align: right; margin-top: 3px;
}

/* ── EINSATZART-AUSWAHL ── */
.check-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
.check-grid label {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm); padding: 11px 14px;
  font-size: 14px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.check-grid label:hover { border-color: var(--muted); background: var(--surface2); }
.check-grid input { accent-color: var(--red); }
.check-grid input { width: auto; }

/* ── WERTE-RASTER (Wasserentnahme, Geräte, Material) ── */
.wert-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
}
.wert-zeile {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px;
  transition: border-color 0.15s, background 0.15s;
}
.wert-zeile.gefuellt { border-color: #F0DCB0; background: var(--yellow-soft); }
.wert-label { flex: 1; font-size: 14px; }
.wert-zeile input { width: 76px; padding: 6px 9px; font-size: 14px; text-align: right; }
.wert-einheit { font-size: 12px; color: var(--muted); min-width: 26px; }
/* Mehrteilige Geräte: Hohlstrahlrohr D/C/B */
.wert-teile { display: flex; gap: 6px; }
.wert-teil { text-align: center; }
.wert-teil input { width: 52px; }
.wert-teil-label {
  font-size: 10px; color: var(--muted); display: block;
  text-align: center; margin-top: 2px;
}
.check-inline {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; cursor: pointer; padding: 9px 0;
}
.check-inline input { width: auto; accent-color: var(--red); }

/* Rueckmeldung des automatischen Speicherns. */
.speicherstand {
  font-size: 13px; color: var(--muted);
  min-height: 20px; transition: color 0.15s;
}
.speicherstand.fehler { color: var(--red); font-weight: 500; }

/* ── EINSATZLISTE ── */
.einsatz-badge {
  display: inline-block;
  font-size: 12px; font-weight: 500;
  padding: 3px 10px; border-radius: 980px; margin-bottom: 7px;
  background: var(--red-soft); color: var(--red);
  border: 1px solid #F0C9D0;
}
.einsatz-badge.open {
  background: var(--green-dim); color: #14663A; border-color: #BFE0CD;
}

/* ── SITZORDNUNG WIE IM FAHRZEUG ── */
/* Die Plätze werden so angeordnet, wie die Gruppe tatsächlich sitzt:
   vorne das Fahrerhaus, dahinter der Mannschaftsraum. Der Rahmen
   deutet den Fahrzeugaufbau an. */
.sitzordnung {
  position: relative;
  border: 2px solid var(--border-mid);
  border-left: 5px solid var(--red);   /* Front des Fahrzeugs */
  border-radius: 6px 14px 14px 6px;
  padding: 14px;
  background: var(--surface2);
  max-width: 780px;
}
.sitz-reihe {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px 12px;
  margin-bottom: 10px;
}
.sitz-reihe:last-child { margin-bottom: 0; }
/* Das Fahrerhaus sitzt vorne und wird farblich abgesetzt. */
.sitz-reihe.kabine {
  border-color: #F0C9D0;
  background: var(--red-soft);
}
.sitz-reihe-titel {
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
  color: var(--muted); text-transform: uppercase; margin-bottom: 8px;
}
.sitz-reihe.kabine .sitz-reihe-titel { color: var(--red); }
.sitz-reihe-plaetze {
  display: grid;
  grid-template-columns: repeat(var(--spalten, 2), 1fr);
  gap: 8px;
}
/* Qualifikationen im besetzten Sitz. */
.seat-quals { margin-top: 4px; }
.seat-quals .qual-chip { margin-left: 0; margin-right: 4px; }
@media (max-width: 700px) {
  .sitz-reihe-plaetze { grid-template-columns: repeat(2, 1fr); }
}

/* ── SITZPLAN ── */
.seat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 10px;
}
.seat {
  background: var(--surface);
  border: 1.5px dashed var(--border-mid);
  border-radius: var(--radius-sm); padding: 14px 16px;
  min-height: 78px;
  display: flex; flex-direction: column; justify-content: center;
  cursor: pointer; transition: all 0.15s;
}
.seat:hover { border-color: var(--red); background: var(--red-soft); }
.seat.occupied {
  border-style: solid; border-color: #BFE0CD;
  background: var(--green-dim); cursor: default;
}
.seat-role {
  font-size: 12px; font-weight: 500;
  color: var(--muted); margin-bottom: 6px;
}
.seat.occupied .seat-role { color: #14663A; }
.seat-person { font-size: 15px; font-weight: 600; }
.seat-rank { font-size: 12px; color: var(--muted); margin-top: 2px; }
.seat-free {
  font-size: 15px; font-weight: 500; color: var(--faint);
}
.seat-clear {
  align-self: flex-start; margin-top: 7px;
  font-size: 12px; color: var(--red); cursor: pointer;
  background: none; border: none; padding: 0;
}
.seat-clear:hover { text-decoration: underline; }

/* ── EINSATZMITTEL ── */
.equip-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 8px;
}
.equip-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px;
  transition: border-color 0.15s, background 0.15s;
}
.equip-row input {
  width: 70px; padding: 6px 9px; font-size: 14px; text-align: right;
}
.equip-name { flex: 1; font-size: 14px; }
.equip-unit { font-size: 12px; color: var(--muted); min-width: 40px; }
.equip-row.filled { border-color: #F0DCB0; background: var(--yellow-soft); }

/* ── AUFKLAPPBARE FAHRZEUGE ── */
.fahrzeug-block { margin-bottom: 10px; }
.fahrzeug-block.offen .report-row {
  border-color: var(--red);
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
  margin-bottom: 0;
}
.aufklapp-pfeil {
  font-size: 17px; color: var(--muted); line-height: 1;
  width: 16px; text-align: center;
}
.fahrzeug-block.offen .aufklapp-pfeil { color: var(--red); }

.fahrzeug-inhalt {
  border: 1px solid var(--red); border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 18px 18px 20px;
  background: var(--surface);
  animation: aufklappen 0.18s ease;
}
@keyframes aufklappen {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fz-abschnitt { margin-bottom: 22px; }
.fz-abschnitt:last-child { margin-bottom: 0; }
.fz-titel {
  font-size: 14px; font-weight: 600;
  color: var(--text); margin-bottom: 12px;
}

/* ── FAHRZEUGKARTEN im Einsatz ── */
.report-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 17px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px; gap: 14px; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.report-row:hover { border-color: var(--border-mid); box-shadow: var(--shadow-sm); }
.report-callsign { font-size: 16px; font-weight: 600; }
.report-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.report-crew-count {
  font-size: 22px; font-weight: 600; color: var(--green); line-height: 1;
}

/* ── REITER (Verwaltung) ── */
.tab-bar {
  display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); padding-bottom: 10px;
}
.tab-bar button {
  background: none; border: none;
  color: var(--text-2); padding: 8px 15px;
  font-size: 14px; cursor: pointer; border-radius: 980px;
  transition: background 0.15s, color 0.15s;
}
.tab-bar button:hover { background: rgba(0,0,0,0.05); }
.tab-bar button.active {
  background: var(--red); color: #fff; font-weight: 500;
}

/* ── KENNZAHLEN ── */
.stat-tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.stat-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 18px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-tile-value {
  font-size: 34px; font-weight: 600; line-height: 1; letter-spacing: -1px;
}
.stat-tile-label {
  font-size: 13px; color: var(--muted); margin-top: 8px;
}

/* ── BALKEN in der Statistik ── */
.stat-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 4px; border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-name { min-width: 210px; font-size: 13px; font-weight: 600; }
.stat-sub {
  font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px;
}
.stat-pos {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--green); font-weight: 400; margin-top: 3px;
}
.stat-bar-bg {
  flex: 1; background: #EBEBEF;
  border-radius: 980px; height: 8px; overflow: hidden;
}
.stat-bar-fill {
  background: var(--red); height: 8px; border-radius: 980px;
  transition: width 0.5s;
}
.stat-nums {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--muted); min-width: 112px; text-align: right;
}

/* ── SICHERUNG ── */
.backup-state {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface2);
}
.backup-state.ok    { border-color: #BFE0CD; background: var(--green-dim); }
.backup-state.stale { border-color: #F0DCB0; background: var(--yellow-soft); }
.backup-state .icon { font-size: 24px; }
.backup-state .text { font-size: 14px; font-weight: 500; }
.backup-state .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ── SITZPLAN-EDITOR ── */
.seatedit-row {
  display: flex; gap: 7px; align-items: center; margin-bottom: 7px;
}
.seatedit-row input.code { width: 76px; }
.seatedit-row input.label { flex: 1; }
.seatedit-row button {
  background: none; border: 1px solid var(--red); color: var(--red);
  border-radius: 3px; padding: 7px 11px; cursor: pointer; font-size: 12px;
}

/* ── MITGLIEDERZEILE: Abstufung nach Wichtigkeit ── */
.member-positions {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--green); margin-top: 3px;
}
.member-quiet {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--faint); margin-top: 3px;
}

/* ── AUSWERTUNG im Bearbeiten-Dialog ── */
.member-stats {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 15px 17px;
}
.member-stats-head {
  font-size: 13px; font-weight: 600;
  color: var(--muted); margin-bottom: 10px;
}
.member-stats-row {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 3px 0;
}
.member-stats-row .n {
  font-family: var(--font-mono); font-weight: 600; color: var(--green);
}
.member-stats-sum {
  display: flex; gap: 18px; margin-bottom: 10px;
  padding-bottom: 9px; border-bottom: 1px solid var(--border);
}
.member-stats-sum div { font-size: 13px; }
.member-stats-sum strong { font-size: 17px; margin-right: 5px; }

details summary::-webkit-details-marker { color: var(--muted); }

/* Emoji in Schaltflächen etwas Luft geben. */
.btn-emoji { margin-right: 4px; font-size: 0.95em; }

/* ── QUALIFIKATIONS-KÜRZEL ── */
.qual-chip {
  display: inline-block;
  font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
  padding: 2px 8px; border-radius: 980px; margin-left: 5px;
  background: var(--surface2); color: var(--text-2);
  border: 1px solid var(--border-mid);
  vertical-align: middle;
}
.qual-chip.match {
  background: var(--green-dim); color: #14663A; border-color: #BFE0CD;
}

/* ── DIALOG MIT LISTE DER EINGETRAGENEN ── */
/* Beim Eintragen soll sichtbar bleiben, wer schon da ist — sonst
   ruft man Namen doppelt auf oder sucht vergeblich. */
.dialog-mit-liste {
  display: flex; gap: 16px; align-items: flex-start;
  max-height: 88vh;
}
.anwesend-spalte {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 20px;
  width: 300px; flex-shrink: 0;
  max-height: 88vh;
  display: flex; flex-direction: column;
  animation: slide-up 0.18s ease;
}
.anwesend-kopf {
  font-size: 15px; color: var(--text);
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.anwesend-kopf strong {
  font-size: 21px; color: var(--green); font-weight: 600; margin: 0 3px;
}
.anwesend-liste {
  overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 6px;
}
.anwesend-zeile {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px;
  background: var(--green-dim); border: 1px solid #BFE0CD;
  border-radius: 8px; padding: 7px 11px;
  font-size: 14px; color: #14663A;
}
.anwesend-zeile .zeit {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--muted); flex-shrink: 0;
}
/* Der zuletzt eingetragene Name wird kurz hervorgehoben. */
.anwesend-zeile.neu {
  animation: neu-eingetragen 1.6s ease;
}
@keyframes neu-eingetragen {
  0%   { background: var(--green); color: #fff; transform: scale(1.02); }
  100% { background: var(--green-dim); color: #14663A; transform: scale(1); }
}
.anwesend-leer {
  color: var(--muted); font-size: 14px; text-align: center; padding: 24px 0;
}

/* Auf schmalen Bildschirmen untereinander statt nebeneinander. */
@media (max-width: 900px) {
  .dialog-mit-liste { flex-direction: column; overflow-y: auto; }
  .anwesend-spalte { width: 100%; max-height: 32vh; }
}

/* ── KAMERA-SCAN ── */
#kamera-buehne {
  position: relative;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
#kamera-video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* Zielrahmen als Hilfe beim Ausrichten. */
#kamera-rahmen {
  position: absolute; inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 2000px rgba(0,0,0,0.35);
  -webkit-mask:
    linear-gradient(#000 0 0) center / 62% 62% no-repeat,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) center / 62% 62% no-repeat,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}
#kamera-rahmen::after {
  content: '';
  position: absolute; left: 19%; top: 19%; width: 62%; height: 62%;
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 10px;
}
#kamera-buehne.treffer #kamera-rahmen::after {
  border-color: var(--green); border-width: 3px;
}
#kamera-meldung {
  font-size: 14px; color: var(--muted); text-align: center; min-height: 22px;
}
#kamera-meldung.ok  { color: var(--green); font-weight: 600; font-size: 17px; }
#kamera-meldung.err { color: var(--red); font-weight: 500; }

/* ── ANMELDEPROTOKOLL ── */
.protokoll-zeile {
  display: flex; align-items: baseline; gap: 12px;
  padding: 8px 12px; border-radius: 6px; margin-bottom: 4px;
  font-size: 13px; background: var(--surface2);
  border-left: 3px solid var(--border-mid);
}
.protokoll-zeile.ok   { border-left-color: var(--green); }
.protokoll-zeile.fehl { border-left-color: var(--red); background: var(--red-soft); }
.protokoll-zeit {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--muted); min-width: 118px;
}
.protokoll-ip {
  font-family: var(--font-mono); font-size: 12px;
  min-width: 120px; color: var(--text-2);
}
.protokoll-text { flex: 1; }
.protokoll-zeichen { font-weight: 600; }
.protokoll-zeile.ok   .protokoll-zeichen { color: var(--green); }
.protokoll-zeile.fehl .protokoll-zeichen { color: var(--red); }

/* ── MELDUNGEN ── */
#toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1D1D1F; border: none;
  color: #fff; padding: 14px 24px; border-radius: 12px;
  font-size: 14px; font-weight: 500; z-index: 500; opacity: 0;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.2s, transform 0.2s;
  max-width: 90vw;
}
#toast.ok  { border-left: 3px solid var(--green); }
#toast.err { border-left: 3px solid #FF6B6B; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── SONSTIGES ── */
.flex-row { display: flex; gap: 10px; align-items: center; }
.flex-end { justify-content: flex-end; }
.mt8  { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.mb8  { margin-bottom: 8px; }
.text-muted { color: var(--muted); font-size: 14px; }
.empty-state { text-align: center; color: var(--muted); padding: 44px; font-size: 15px; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #C7C7CC; border-radius: 980px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
