/* Einlass-App – dunkles, großes Layout für den Einsatz am Einlass (auch nachts, auch mit Handschuhen) */
:root {
  --bg: #0f1115;
  --flaeche: #181b22;
  --flaeche2: #20242d;
  --linie: #2c313c;
  --text: #f2f4f8;
  --leise: #9aa3b2;
  --gruen: #28a745;
  --gruen-hell: #34c759;
  --rot: #e5484d;
  --gelb: #f5a524;
  --radius: 14px;
  --leiste: 64px;
  --sicher-unten: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  padding-bottom: calc(var(--leiste) + var(--sicher-unten) + 16px);
}
body.seite-login { padding-bottom: 24px; }
a { color: var(--gruen-hell); }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
.titel { font-size: 1.6rem; margin: 8px 0 16px; }
.untertitel { font-size: 1.1rem; margin: 24px 0 8px; color: var(--leise); }
.leise { color: var(--leise); }
.klein { font-size: .85rem; }
.zentriert { text-align: center; }
.rechts { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .03em; }
.vorformatiert { white-space: pre-line; }
.leer { color: var(--leise); text-align: center; padding: 32px 0; }
[hidden] { display: none !important; }

/* Kopf */
.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  background: rgba(15, 17, 21, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linie);
}
.kopf__marke { color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.kopf__punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--gruen); box-shadow: 0 0 10px var(--gruen); }
.kopf__user { color: var(--leise); font-size: .9rem; }
.inhalt { max-width: 640px; margin: 0 auto; padding: 16px; }

/* Untere Leiste */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--leiste) + var(--sicher-unten)); padding-bottom: var(--sicher-unten);
  background: rgba(24, 27, 34, .97); border-top: 1px solid var(--linie);
}
.leiste a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--leise); text-decoration: none; font-size: .72rem;
}
.leiste svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.leiste a.aktiv { color: var(--text); }
.leiste a.leiste__scan svg { width: 30px; height: 30px; color: var(--gruen-hell); }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 0;
  background: var(--flaeche2); color: var(--text); font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; text-align: center;
}
.knopf:disabled { opacity: .55; }
.knopf--gruen { background: var(--gruen); color: #fff; }
.knopf--rahmen { background: transparent; border: 2px solid var(--linie); }
.knopf--gross { width: 100%; min-height: 58px; font-size: 1.1rem; }
.knopf--scan { margin-bottom: 20px; font-size: 1.2rem; min-height: 68px; }
.knopf--scan svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.knopf--weiter { width: 100%; margin-top: 10px; background: var(--flaeche2); }
.rund {
  width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; cursor: pointer;
}
.rund svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.rund.an { background: var(--gelb); color: #000; }
.link { background: none; border: 0; padding: 0; color: var(--gruen-hell); font: inherit; text-decoration: underline; cursor: pointer; }

/* Formulare */
.formular { display: grid; gap: 14px; margin: 16px 0; }
.formular label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--leise); }
input[type=email], input[type=password], input[type=text], input[type=search], input[type=number] {
  width: 100%; min-height: 50px; padding: 10px 14px; font: inherit; font-size: 1.05rem;
  color: var(--text); background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px;
}
input:focus { outline: 2px solid var(--gruen); outline-offset: 1px; }

/* Meldungen */
.meldung { padding: 12px 14px; border-radius: 12px; margin: 0 0 14px; font-weight: 600; transition: opacity .4s; }
.meldung--ok { background: rgba(40, 167, 69, .18); color: #8ff0a4; }
.meldung--fehler { background: rgba(229, 72, 77, .18); color: #ffb3b5; }
.meldung.weg { opacity: 0; }
.warnung { background: rgba(245, 165, 36, .18); color: #ffd58a; padding: 10px 12px; border-radius: 10px; margin: 0 0 10px; font-weight: 700; }

/* Login */
.login { max-width: 400px; margin: 6vh auto 0; text-align: center; }
.login .formular { text-align: left; }
.login__logo { border-radius: 18px; margin-bottom: 12px; }

/* Karten / Events */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.event { padding: 0; overflow: hidden; }
.event__bild { aspect-ratio: 16 / 7; background: var(--flaeche2) center / cover no-repeat; }
.event__text { padding: 14px 16px 16px; }
.event__datum { color: var(--gruen-hell); font-weight: 700; font-size: .85rem; margin: 0 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.event h2 { font-size: 1.15rem; }
.auslastung p { margin: 6px 0 0; }
.auslastung__balken { height: 10px; border-radius: 99px; background: var(--flaeche2); overflow: hidden; }
.auslastung__balken span { display: block; height: 100%; background: linear-gradient(90deg, var(--gruen), var(--gruen-hell)); border-radius: inherit; }
.aufschluesselung { margin: 10px 0 12px; color: var(--leise); font-size: .9rem; }
.aufschluesselung summary { cursor: pointer; }
.aufschluesselung table { width: 100%; margin-top: 6px; border-collapse: collapse; }
.aufschluesselung th, .aufschluesselung td { padding: 4px 0; text-align: right; }
.aufschluesselung th:first-child, .aufschluesselung td:first-child { text-align: left; }
.event .knopf--rahmen { width: 100%; }

/* Daten-Liste */
.daten { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0; }
.daten dt { color: var(--leise); font-size: .88rem; padding-top: 1px; }
.daten dd { margin: 0; font-weight: 600; word-break: break-word; }

/* Listen (Suche, Verlauf) */
.liste { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; background: var(--flaeche); }
.liste li + li { border-top: 1px solid var(--linie); }
.liste li > a, .liste li > div { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--text); text-decoration: none; }
.liste__text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.liste__text small { color: var(--leise); }
.liste__punkt { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.liste__punkt.gruen { background: var(--gruen-hell); }
.liste__punkt.rot { background: var(--rot); }
.liste__zeit { text-align: right; font-weight: 700; display: grid; }
.liste__zeit small { color: var(--leise); font-weight: 400; }
.suchfeld { display: flex; gap: 8px; margin-bottom: 16px; }
.suchfeld input { flex: 1; }

/* Tabellen */
.tabelle { width: 100%; border-collapse: collapse; margin: 8px 0 16px; }
.tabelle td { padding: 8px 4px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle .summe td { font-weight: 800; font-size: 1.1rem; border-bottom: 0; }

/* Abendkasse */
.preis-gross { font-size: 2rem; font-weight: 800; margin: 0 0 8px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 16px; }
.stepper input { width: 96px; text-align: center; font-size: 1.6rem; font-weight: 800; }
.stepper .rund { background: var(--flaeche2); width: 56px; height: 56px; }

/* Scanner */
.seite-scan .inhalt { padding-top: 8px; }
.scanner__bild {
  position: relative; border-radius: var(--radius); overflow: hidden; background: #000;
  aspect-ratio: 3 / 4; max-height: 62dvh; width: 100%;
}
.scanner__bild video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner__rahmen { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scanner__rahmen span {
  width: 74%; aspect-ratio: 1; border-radius: 18px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35);
  border: 3px solid rgba(255, 255, 255, .85);
}
.scanner__status {
  position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0;
  padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.7); text-align: center; font-weight: 600;
}
.scanner__status--fehler { background: rgba(229, 72, 77, .9); }
.scanner__knoepfe { position: absolute; top: 12px; right: 12px; display: grid; gap: 10px; }
.scanner__eingabe { display: flex; gap: 8px; margin: 14px 0 6px; }
.scanner__eingabe input { flex: 1; font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; }
.scanner__eingabe input::placeholder { text-transform: none; font-family: system-ui, sans-serif; }

/* Ergebnis-Blatt (über dem Kamerabild) */
.blatt {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .6);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 12px 12px calc(12px + var(--sicher-unten));
}
.blatt__inhalt { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; animation: hoch .18s ease-out; }
@keyframes hoch { from { transform: translateY(24px); opacity: 0; } }

.ergebnis {
  background: var(--flaeche); border-radius: 18px; padding: 18px; border: 1px solid var(--linie);
  border-top: 10px solid var(--linie);
}
.ergebnis--gruen { border-top-color: var(--gruen-hell); }
.ergebnis--gelb { border-top-color: var(--gelb); }
.ergebnis--rot { border-top-color: var(--rot); }
.ergebnis__kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ergebnis__kopf h2 { margin: 0; font-size: 1.5rem; }
.ergebnis__symbol {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.6rem; font-weight: 900; color: #fff; background: var(--linie);
}
.ergebnis--gruen .ergebnis__symbol { background: var(--gruen-hell); }
.ergebnis--gelb .ergebnis__symbol { background: var(--gelb); color: #000; }
.ergebnis--rot .ergebnis__symbol { background: var(--rot); }
.ergebnis--gruen[data-fertig] { background: #10301a; }
.ergebnis__artikel { font-size: 1.15rem; }
.ergebnis__code { font-family: ui-monospace, Menlo, monospace; font-size: 1.2rem; font-weight: 700; word-break: break-all; }
.ergebnis__aktion { margin-top: 12px; }

/* TOA-Bändchen */
.legende { background: var(--flaeche2); border-radius: 12px; padding: 12px; margin: 10px 0; }
.legende p { margin: 8px 0 0; font-weight: 600; }
.baendchen { display: inline-block; padding: 8px 14px; border-radius: 8px; font-weight: 900; margin: 0 6px 4px 0; border: 1px solid rgba(255,255,255,.25); }

@media (min-width: 700px) {
  .scanner__bild { aspect-ratio: 4 / 3; }
  .blatt { align-items: center; }
}
