/* ZWT Backstage — gemeinsames Layout */
:root {
  --bg: #f6f5f2;
  --flaeche: #ffffff;
  --text: #1d1d1f;
  --gedaempft: #6b6b70;
  --linie: #dedcd6;
  --akzent: #7a1f3d;       /* Bordeaux */
  --akzent-hell: #f4e7ec;
  --ok: #1d7a46;
  --warn: #a35c00;
  --fehler: #b3261e;
  --radius: 8px;
  --menu-0: #b3413b;
  --menu-1: #2f6db3;
  --menu-2: #3f8a3a;
  --menu-3: #8a5bb3;
  --menu-4: #b38a2f;
  --menu-5: #2f9aa0;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.4;
}
a { color: var(--akzent); }
button, input, select, textarea { font: inherit; color: inherit; }
button {
  cursor: pointer;
  border: 1px solid var(--linie);
  background: var(--flaeche);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
}
button:hover { border-color: #b9b6ad; }
button.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; }
button.primaer:hover { filter: brightness(1.1); }
button.gefahr { color: var(--fehler); }
button.klein { padding: 0.15rem 0.45rem; font-size: 0.85rem; }
button:disabled { opacity: 0.5; cursor: default; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], input[type=search], input[type=email], select, textarea {
  border: 1px solid var(--linie);
  border-radius: 6px;
  padding: 0.3rem 0.45rem;
  background: #fff;
  min-width: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }

.kopf {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem 1rem; background: var(--flaeche); border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 50;
}
.kopf .marke { font-weight: 700; letter-spacing: 0.02em; text-decoration: none; color: var(--text); }
.kopf .marke span { color: var(--akzent); }
.kopf nav { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.kopf nav a { text-decoration: none; color: var(--gedaempft); }
.kopf nav a.aktiv, .kopf nav a:hover { color: var(--text); }
.kopf .rechts { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; color: var(--gedaempft); font-size: 0.9rem; }

main { max-width: 1200px; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.35rem; margin: 0.2rem 0 0.8rem; }
h2 { font-size: 1.1rem; margin: 1.2rem 0 0.6rem; }
h3 { font-size: 1rem; margin: 0.8rem 0 0.4rem; }
.gedaempft { color: var(--gedaempft); }
.klein-text { font-size: 0.85rem; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem; }
.zeile { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.spalten { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
label.feld { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; color: var(--gedaempft); }
label.feld > input, label.feld > select, label.feld > textarea { color: var(--text); font-size: 0.95rem; }

#meldung { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 200; max-width: 90vw; }
#meldung div { padding: 0.55rem 1rem; border-radius: 6px; color: #fff; background: #333; box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
#meldung div.fehler { background: var(--fehler); }
#meldung div.ok { background: var(--ok); }

table.liste { width: 100%; border-collapse: collapse; background: var(--flaeche); }
table.liste th, table.liste td { padding: 0.35rem 0.45rem; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: middle; }
table.liste th { font-size: 0.8rem; color: var(--gedaempft); font-weight: 600; background: #faf9f6; position: sticky; top: 0; }
table.liste tr.storniert td { color: var(--gedaempft); text-decoration: line-through; }
table.liste tr.storniert td.aktionen, table.liste tr.storniert td.aktionen * { text-decoration: none; }
table.liste td input[type=text], table.liste td select { width: 100%; }
.tabelle-scroll { overflow-x: auto; border: 1px solid var(--linie); border-radius: var(--radius); }

.badge { display: inline-block; font-size: 0.72rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: #eee; color: #444; white-space: nowrap; vertical-align: middle; }
.badge.hz { background: #e8eef8; color: #2f4f86; }
.badge.warn { background: #fff1dc; color: var(--warn); }
.badge.storno { background: #fde8e6; color: var(--fehler); }
.menu-punkt { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 50%; vertical-align: middle; margin-right: 0.25rem; background: #bbb; }

.reiter { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--linie); margin-bottom: 1rem; overflow-x: auto; }
.reiter button { border: none; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 0.5rem 0.8rem; color: var(--gedaempft); white-space: nowrap; }
.reiter button.aktiv { color: var(--text); border-bottom-color: var(--akzent); font-weight: 600; }

.kennzahlen { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.kennzahl { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 0.45rem 0.75rem; min-width: 7rem; }
.kennzahl .wert { font-size: 1.35rem; font-weight: 700; }
.kennzahl .titel { font-size: 0.78rem; color: var(--gedaempft); }
.kennzahl.warn .wert { color: var(--warn); }

/* Tischplan */
.tischplan { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; align-items: start; }
@media (max-width: 760px) {
  .tischplan { grid-template-columns: 1fr; }
  .ohne-tisch { position: static; max-height: 45vh; }
  .kennzahl { min-width: 5.5rem; padding: 0.35rem 0.55rem; }
  .kennzahl .wert { font-size: 1.1rem; }
}
.ohne-tisch { position: sticky; top: 3.6rem; max-height: calc(100vh - 5rem); overflow-y: auto; }
.tische { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tisch { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 0.55rem; min-height: 6rem; }
.tisch.voll { border-color: #c9c3b3; }
.tisch.ueberbucht { border-color: var(--fehler); box-shadow: inset 0 0 0 1px var(--fehler); }
.tisch.ziel, .ohne-tisch.ziel { background: var(--akzent-hell); border-color: var(--akzent); }
.tisch-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 0.4rem; margin-bottom: 0.35rem; }
.tisch-kopf strong { font-size: 1rem; }
.tisch-kopf .belegung { font-size: 0.85rem; color: var(--gedaempft); }
.tisch.ueberbucht .belegung { color: var(--fehler); font-weight: 700; }
.tisch-menues { font-size: 0.75rem; color: var(--gedaempft); margin-bottom: 0.3rem; }
.chip {
  display: flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.35rem; margin: 0.15rem 0;
  border: 1px solid var(--linie); border-radius: 6px; background: #fcfbf9; font-size: 0.88rem; cursor: grab; user-select: none;
}
.chip.gewaehlt { border-color: var(--akzent); background: var(--akzent-hell); box-shadow: 0 0 0 1px var(--akzent); }
.chip .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .funktion { font-size: 0.7rem; color: var(--gedaempft); }
.chip .hinweis { color: var(--warn); font-size: 0.8rem; }
.chip button.weg { border: none; background: none; padding: 0 0.2rem; color: var(--gedaempft); }
.auswahl-hinweis { background: var(--akzent-hell); border: 1px solid var(--akzent); border-radius: 6px; padding: 0.35rem 0.6rem; margin-bottom: 0.6rem; font-size: 0.9rem; }

.import-ergebnis ul { margin: 0.2rem 0 0.6rem; padding-left: 1.2rem; }
.import-ergebnis li { margin: 0.1rem 0; }

.login-box { max-width: 22rem; margin: 12vh auto; }
.login-box h1 { text-align: center; }

.anlass-liste { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.anlass-karte { text-decoration: none; color: inherit; display: block; }
.anlass-karte:hover { border-color: var(--akzent); }

/* Druck */
#druckbereich { display: none; }
@media print {
  body { background: #fff; font-size: 11pt; }
  body > *:not(#druckbereich) { display: none !important; }
  #druckbereich { display: block; }
  .druck-tische { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8pt; }
  .druck-tisch { border: 1px solid #999; padding: 6pt; break-inside: avoid; }
  .druck-tisch h3 { margin: 0 0 4pt; font-size: 12pt; }
  .druck-tisch ul { margin: 0; padding-left: 12pt; }
  table.druck { width: 100%; border-collapse: collapse; }
  table.druck th, table.druck td { border-bottom: 1px solid #ccc; padding: 2pt 4pt; text-align: left; }
  h1 { font-size: 15pt; }
}

/* Runde 2 */
select.menu-offen { background: #fff1dc; border-color: #d9a441; }
.menu-punkt.offen { background: transparent !important; border: 1.5px dashed var(--warn); box-sizing: border-box; }
.badge.offen { background: #fff1dc; color: var(--warn); }
.badge.schedule { background: #efe8f6; color: #5a3d80; }
.gruppen-wahl { display: flex; gap: 0.9rem; flex-wrap: wrap; align-items: center; }
.gruppen-wahl label { white-space: nowrap; }
.abschnitt { margin-top: 1rem; }
.datenblatt-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.formular-raster { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); align-items: end; }
.formular-raster .breit { grid-column: 1 / -1; }
textarea { width: 100%; min-height: 4rem; resize: vertical; }
a.name-link { color: var(--text); text-decoration: none; }
a.name-link:hover { text-decoration: underline; color: var(--akzent); }
.hotel-karte { margin-bottom: 1rem; }
.hotel-karte summary { cursor: pointer; list-style: none; }
.hotel-karte summary::-webkit-details-marker { display: none; }
@media print {
  .druck-datenblatt h2 { font-size: 12pt; margin: 10pt 0 4pt; }
  .druck-datenblatt dl { display: grid; grid-template-columns: 9rem 1fr; gap: 2pt 8pt; margin: 0; }
  .druck-datenblatt dt { color: #555; }
  .druck-datenblatt dd { margin: 0; }
  .druck-seite { break-after: page; }
}
