:root {
  --schwarz: #121516;
  --creme: #e6d9bd;
  --creme-hell: #f6f1e6;
  --kupfer: #a9744f;
  --kupfer-dunkel: #8a5c3b;
  --text: #1b1d1e;
  --text-leise: #5b5f62;
  --linie: #d9d3c6;
  --flaeche: #ffffff;
  --hinter: #f4f1ea;
  --frei: #ffffff;
  --reserviert: #f2c14e;
  --bezahlt: #5fae6b;
  --eingelassen: #4a7fc1;
  --gesperrt: #9a9a9a;
  --auswahl: #a9744f;
  --rot: #c0392b;
  --gruen: #2e7d32;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--hinter);
}
* { box-sizing: border-box; }
html { font-size: calc(16px * var(--zoom, 1)); }
body { margin: 0; font-size: .9375rem; line-height: 1.45; }
a { color: var(--kupfer-dunkel); }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem; justify-content: space-between; }
code { background: var(--creme-hell); padding: 1px 5px; border-radius: 4px; }

.kopf { background: var(--schwarz); color: var(--creme); position: sticky; top: 0; z-index: 10; }
.demo-band { background: #f2c14e; color: #2b2200; font-size: .85rem; padding: 4px 16px; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.demo-rollen label { margin-right: .6rem; white-space: nowrap; }
.demo-rollen select { width: auto; min-height: 30px; padding: 2px 6px; }
.kopf-zeile { display: flex; align-items: center; gap: 1rem; padding: 10px 16px; flex-wrap: wrap; }
.marke { display: flex; align-items: center; gap: .6rem; color: var(--creme); text-decoration: none; font-weight: 700; }
.marke img { height: 30px; background: #fff; border-radius: 4px; padding: 2px; }
.ev-name { display: flex; flex-direction: column; font-size: .9rem; flex: 1; min-width: 200px; }
.ev-name span { opacity: .8; }
.nutzer { display: flex; align-items: center; gap: .6rem; font-size: .9rem; flex-wrap: wrap; }
.nutzer small { opacity: .75; }
.nutzer-name { display: flex; flex-direction: column; line-height: 1.2; }
.schrift { display: inline-flex; gap: 4px; }
.nav { display: flex; gap: 2px; padding: 0 12px; overflow-x: auto; }
.nav a { color: var(--creme); text-decoration: none; padding: 10px 12px; border-bottom: 3px solid transparent; white-space: nowrap; }
.nav a.aktiv, .nav a:hover { border-bottom-color: var(--kupfer); color: #fff; }

.inhalt { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }
.inhalt.schmal { max-width: 520px; padding-top: 60px; }
.kopfzeile { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 6px 0 16px; flex-wrap: wrap; }
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.karte.start { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.start-logo { height: 54px; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.raster.zwei { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.raster > .karte { margin-bottom: 0; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; }
.kpi-wert { font-size: 1.6rem; font-weight: 700; }
.kpi-label { color: var(--text-leise); }
.kpi small { color: var(--text-leise); }

.btn { font: inherit; border: 1px solid var(--linie); background: #fff; color: var(--text); border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; min-height: 38px; }
.btn:hover { border-color: var(--kupfer); }
.btn:focus-visible, .chip:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .sp-platz:focus-visible { outline: 3px solid var(--kupfer); outline-offset: 2px; }
.btn.primaer { background: var(--kupfer); border-color: var(--kupfer); color: #fff; }
.btn.primaer:hover { background: var(--kupfer-dunkel); }
.btn.gefahr { color: var(--rot); border-color: #e3b5b0; }
.btn.klein { padding: 3px 9px; min-height: 30px; font-size: .85rem; }
.btn.gross { padding: 12px 20px; font-size: 1.05rem; }
.kopf .btn { background: transparent; color: var(--creme); border-color: #555; }
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.aktionen.leiste { margin: 0 0 16px; }
.summe { margin-left: auto; font-size: 1.05rem; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.badge.gelb { background: #fbeec8; color: #6b4e00; }
.badge.rot { background: #f8d7d3; color: #8a1f14; }
.badge.gruen { background: #d6eed9; color: #1d5a24; }
.badge.blau { background: #d8e5f6; color: #1f4b84; }
.badge.grau { background: #e6e6e6; color: #444; }
.zaehler { background: var(--creme); color: var(--schwarz); border-radius: 99px; padding: 0 10px; font-size: .9rem; }

.meldung { background: var(--creme-hell); border-left: 4px solid var(--kupfer); padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.meldung.warnung { border-left-color: var(--rot); background: #fdf0ee; }
.hinweis { color: var(--text-leise); font-size: .9rem; margin: 6px 0; }
.leer { color: var(--text-leise); font-style: italic; }

.werkzeuge { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.werkzeuge input[type=search] { flex: 1; min-width: 240px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { font: inherit; border: 1px solid var(--linie); background: #fff; border-radius: 99px; padding: 5px 12px; cursor: pointer; }
.chip.aktiv { background: var(--schwarz); color: var(--creme); border-color: var(--schwarz); }

input, select, textarea { font: inherit; border: 1px solid #bdb6a8; border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; min-height: 38px; }
textarea { resize: vertical; }
textarea.mailtext { font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }
.formular { display: grid; gap: 12px; }
.formular.zwei { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feld { display: flex; flex-direction: column; gap: 4px; }
.feld-label { font-weight: 600; font-size: .9rem; }
.feld small { color: var(--text-leise); }
.check { display: flex; gap: .5rem; align-items: center; }
.check input { width: auto; min-height: 0; }

.tabelle-box { overflow-x: auto; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); }
.karte .tabelle-box { border: 0; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eee7da; vertical-align: top; }
.tabelle th { background: var(--creme-hell); font-size: .85rem; position: sticky; top: 0; }
.tabelle tr.klickbar { cursor: pointer; }
.tabelle tr.klickbar:hover { background: #fbf8f1; }
.tabelle tr.inaktiv td { color: #999; text-decoration: line-through; }
.tabelle tr.inaktiv td:last-child, .tabelle tr.inaktiv td:nth-last-child(2) { text-decoration: none; }
.tabelle.kompakt td { padding: 5px 6px; }
.zelle-aktionen { white-space: nowrap; display: flex; gap: 4px; flex-wrap: wrap; }
.daten { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.daten dt { color: var(--text-leise); }
.daten dd { margin: 0; }
.umbruch { white-space: pre-wrap; }
.liste { list-style: none; padding: 0; margin: 0; }
.liste li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f0ebe0; align-items: center; }
.verlauf { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.verlauf li { padding: 5px 0; border-bottom: 1px solid #f0ebe0; }
.verlauf time { color: var(--text-leise); font-variant-numeric: tabular-nums; }
.verlauf .wer { color: var(--text-leise); }
.anhaenge { padding-left: 0; list-style: none; }

.modal-bg { position: fixed; inset: 0; background: rgba(18, 21, 22, .55); display: flex; align-items: flex-start; justify-content: center; padding: 30px 12px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal.breit { max-width: 960px; }
.modal-kopf { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--linie); }
.modal-kopf h2 { margin: 0; }
.modal-kopf .x { border: 0; background: none; font-size: 1.6rem; cursor: pointer; line-height: 1; }
.modal-inhalt { padding: 16px 18px; display: grid; gap: 12px; }
.modal-fuss { padding: 12px 18px; border-top: 1px solid var(--linie); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

#toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: min(420px, 90vw); }
.toast { background: var(--schwarz); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.25); transition: opacity .5s; }
.toast.fehler { background: var(--rot); }
.toast.weg { opacity: 0; }
.laden-bg { position: fixed; inset: 0; background: rgba(255,255,255,.7); display: flex; align-items: center; justify-content: center; z-index: 90; }
.laden { background: #fff; border: 1px solid var(--linie); border-radius: 12px; padding: 20px 28px; text-align: center; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--creme); border-top-color: var(--kupfer); border-radius: 50%; margin: 0 auto 8px; animation: dreh 1s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }
.fehlerseite { max-width: 640px; margin: 60px auto; background: #fff; padding: 24px; border-radius: 12px; }

/* Saalplan */
.plan-box { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 8px; overflow: auto; max-height: 70vh; }
.plan-box.gross { max-height: none; }
.saalplan { width: 100%; min-width: 600px; height: auto; display: block; }
.sp-saal { fill: #eef0ee; stroke: #555; stroke-width: 2; }
.sp-tuer { fill: #fff; }
.sp-eingang { font-size: 20px; font-weight: 800; fill: #2b2b2b; }
.sp-buehne { fill: #3cb4c8; stroke: #2a7f8d; }
.sp-buehne-text { font-size: 30px; font-weight: 800; fill: #1d1d1d; }
.sp-tanz-text { font-size: 18px; font-weight: 700; fill: #b9bdb9; letter-spacing: 3px; }
.sp-tisch { fill: #ffffff; stroke: #9aa39c; }
.sp-tischnr { font-size: 15px; font-weight: 800; fill: var(--schwarz); }
.sp-platz circle { stroke: #6d6a63; stroke-width: 1.2; }
.sp-platz text { font-size: 11px; fill: #222; pointer-events: none; font-weight: 600; }
.sp-platz.eingelassen text, .sp-platz.auswahl text, .sp-platz.gesperrt text { fill: #fff; }
.sp-platz.markiert circle { stroke: var(--rot); stroke-width: 3; }
.sp-platz.klickbar { cursor: pointer; }
.sp-platz.klickbar:hover circle { stroke: var(--kupfer); stroke-width: 3; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; margin: 6px 0 10px; }
.legende i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid #6d6a63; margin-right: 5px; vertical-align: -2px; }

/* Einlass */
.scan-eingabe { font-size: 1.4rem; padding: 14px; text-align: center; letter-spacing: 2px; margin-bottom: 8px; }
.scan-ergebnis { border-radius: 14px; padding: 18px; margin-bottom: 16px; background: #fff; border: 1px solid var(--linie); text-align: center; font-size: 1.1rem; }
.scan-ergebnis.gruen { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.scan-ergebnis.rot { background: #c0392b; color: #fff; border-color: #c0392b; }
.scan-titel { font-size: 2rem; font-weight: 800; letter-spacing: 1px; }
.scan-ergebnis p { margin: 4px 0; }
.kamera { margin-top: 10px; max-width: 480px; }

/* Druck */
#druck { display: none; }
@media print {
  body.drucken > *:not(#druck) { display: none !important; }
  body.drucken #druck { display: block; }
  #druck .saalplan { min-width: 0; }
  #druck .tabelle { font-size: 10pt; }
  #druck .tabelle th, #druck .tabelle td { padding: 3px 6px; border-bottom: 1px solid #ccc; }
}
@media (max-width: 640px) {
  .scan-eingabe { font-size: 1.15rem; letter-spacing: 1px; }
  .ev-name { display: none; }
  h1 { font-size: 1.25rem; }
  .raster.zwei { grid-template-columns: 1fr; }
}
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; padding: 0; }
.demo-rollen label { display: inline-flex; gap: 4px; align-items: center; }

/* Anmeldung */
.login { display: grid; gap: 14px; width: 100%; text-align: left; }
.gross-eingabe { font-size: 1.2rem; min-height: 52px; }
.btn.riesig { font-size: 1.25rem; min-height: 60px; justify-content: center; width: 100%; }
.login-fehler { color: var(--rot); font-weight: 700; min-height: 1.2em; margin: 0; }
.formular.links { text-align: left; width: 100%; }
.btn.gruen { background: #1e7a2c; border-color: #1e7a2c; color: #fff; }
.btn.gruen:hover { background: #155c20; }

/* Kasse: große Schrift, starke Kontraste, große Knöpfe */
body.kasse-modus { background: #fff; }
.inhalt.kasse { max-width: 860px; }
.kasse-titel { font-size: 1.8rem; margin: 6px 0 14px; }
.kasse-hilfe { background: #fffbea; border: 2px solid #e6c65a; border-radius: 12px; padding: 12px 18px; margin-bottom: 18px; }
.kasse-hilfe summary { font-weight: 800; cursor: pointer; font-size: 1.15em; }
.kasse-hilfe ol { margin: 10px 0 4px; padding-left: 1.4em; }
.kasse-hilfe li { margin: 6px 0; }
.kasse-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kasse-tab { font: inherit; text-align: left; background: #fff; color: #111; border: 3px solid #9b9b9b; border-radius: 14px; padding: 14px 18px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-height: 96px; }
.kasse-tab.aktiv { border-color: #111; background: #111; color: #fff; }
.kasse-tab.warn:not(.aktiv) { border-color: #c0392b; }
.kasse-tab-titel { font-weight: 800; font-size: 1.15em; }
.kasse-tab-betrag { font-weight: 700; }
.kasse-such-feld { display: block; font-weight: 700; margin-bottom: 16px; }
.kasse-such-zeile { display: flex; gap: 10px; margin-top: 6px; }
.kasse-suche { font-size: 1.3em; min-height: 60px; border: 3px solid #555; }
.kasse-suche:focus { border-color: #111; }
.kasse-liste { display: grid; gap: 16px; }
.kasse-karte { border: 3px solid #555; border-radius: 16px; padding: 18px 20px; background: #fff; display: grid; gap: 8px; }
.kasse-karte.bezahlt { border-color: #1e7a2c; background: #f3faf3; }
.kasse-karte.warn { border-color: #c0392b; background: #fff6f5; }
.kk-name { font-size: 1.5em; font-weight: 800; }
.kk-betrag { font-size: 2em; font-weight: 800; }
.kk-label { color: #444; }
.kk-zeile.leise { color: #444; font-size: .9em; }
.kk-status { color: #1e7a2c; font-weight: 800; font-size: 1.1em; }
.kk-text { margin: 0; }
.btn.kk-knopf { font-size: 1.25em; min-height: 70px; justify-content: center; font-weight: 800; border-radius: 12px; margin-top: 6px; }
.btn.kk-klein { justify-self: start; font-size: 1rem; min-height: 48px; }
.kasse-leer { font-size: 1.2em; padding: 20px; background: #f4f4f4; border-radius: 12px; text-align: center; }
.kasse-meldung { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #e8f5e9; border: 3px solid #1e7a2c; border-radius: 14px; padding: 14px 18px; margin-bottom: 18px; font-weight: 700; }
body.kasse-modus .modal { max-width: 640px; }
body.kasse-modus .modal-kopf h2 { font-size: 1.4em; }
.kasse-frage { font-size: 1.3em; line-height: 1.5; margin: 0; }
body.kasse-modus .modal-fuss .btn { font-size: 1.15em; min-height: 64px; padding: 10px 22px; flex: 1; justify-content: center; }
body.kasse-modus .toast { font-size: 1.05rem; padding: 12px 16px; }
@media (max-width: 640px) {
  .kasse-such-zeile { flex-direction: column; }
  body.kasse-modus .modal-fuss { flex-direction: column-reverse; }
}
