@font-face { font-family: 'Lato'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/lato-400.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/lato-700.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 900; font-style: normal; font-display: swap; src: url('../fonts/lato-900.woff2') format('woff2'); }

/* Farben wie in den übrigen Apps von Montag Catering */
:root {
  --bg: #eef1f5;
  --flaeche: #ffffff;
  --flaeche-2: #f7f8fa;
  --text: #0f1720;
  --text-2: #46505c;
  --text-3: #6b7480;
  --linie: #d5dae1;
  --linie-stark: #9aa3ae;
  --primaer: #0b4f8a;
  --primaer-dunkel: #083a66;
  --primaer-hell: #e3eef9;
  --ok: #166534;
  --ok-hell: #dcfce7;
  --ok-rand: #22a050;
  --gelb-text: #6b3b00;
  --gelb-hell: #fff3c4;
  --gelb-rand: #d99a00;
  --rot-text: #9b1c1c;
  --rot-hell: #fde2e1;
  --rot-rand: #d42a2a;
  --grau-hell: #eceff3;
  --claude: #9a4a1c;
  --claude-hell: #fbeee6;
  --schatten: 0 1px 2px rgba(15, 23, 32, .08), 0 2px 8px rgba(15, 23, 32, .06);
  --radius: 12px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.45 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primaer); }
:focus-visible { outline: 3px solid var(--primaer); outline-offset: 2px; }
[hidden] { display: none !important; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { line-height: 1.2; }
h2 { font-size: 19px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 16px 0 8px; }
code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .92em; }

.startbild { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--text-2); }

/* ---------- Kopf und Rahmen ---------- */
.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  background: var(--flaeche); border-bottom: 1px solid var(--linie);
}
.marke { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 900; font-size: 19px; }
.marke .logo { height: 35px; width: auto; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a { padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text-2); font-weight: 700; font-size: 15px; }
.nav a:hover { background: var(--flaeche-2); color: var(--text); }
.nav a.aktiv { background: var(--primaer-hell); color: var(--primaer-dunkel); }
.kopf-rechts { display: flex; align-items: center; gap: 8px; }
.konto { display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text-2); font-size: 15px; }
.konto svg { width: 20px; height: 20px; }

main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left)); }
.seitentitel { font-size: 26px; font-weight: 900; margin: 8px 0 16px; overflow-wrap: anywhere; }
.einleitung { color: var(--text-2); margin: 0 0 16px; max-width: 75ch; }
.einleitung.gross { font-size: 18px; color: var(--text); }
.fuss { max-width: 1200px; margin: 0 auto; padding: 16px; display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--text-3); font-size: 13px; border-top: 1px solid var(--linie); }
.feld-hilfe { color: var(--text-3); font-size: 13px; }
.leer { color: var(--text-3); }

.karte { background: var(--flaeche); border-radius: var(--radius); box-shadow: var(--schatten); padding: 18px 20px; margin-bottom: 16px; }
.karte-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.karte-kopf h2 { margin: 0; }
.karte-kopf .zahl { background: var(--grau-hell); border-radius: 99px; padding: 1px 10px; font-weight: 700; font-size: 14px; }
.karte-kopf > :last-child { margin-left: auto; }

/* ---------- Knöpfe ---------- */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; text-decoration: none; white-space: nowrap; }
.knopf svg { width: 20px; height: 20px; flex: none; }
.knopf:disabled { opacity: .55; cursor: progress; }
.knopf-primaer { background: var(--primaer); color: #fff; }
.knopf-primaer:hover:not(:disabled) { background: var(--primaer-dunkel); }
.knopf-zweit { background: var(--flaeche); color: var(--primaer); border-color: var(--linie-stark); }
.knopf-zweit:hover:not(:disabled) { background: var(--primaer-hell); }
.knopf-rot { background: var(--rot-rand); color: #fff; }
.knopf-leise, .knopf.knopf-leise { background: none; border: 0; color: var(--primaer); font-weight: 700; padding: 6px 8px; border-radius: 8px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; cursor: pointer; }
.knopf-leise:hover { background: var(--primaer-hell); }
.knopf.klein { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.knopfreihe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.knopfreihe.klebend { position: sticky; bottom: 0; background: var(--flaeche); padding: 10px 0; border-top: 1px solid var(--linie); }
.aktion { display: inline-flex; flex-direction: column; gap: 6px; }
.aktion-ausgabe:empty { display: none; }
svg.inline { width: 16px; height: 16px; vertical-align: -3px; }

.werkzeugleiste { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.werkzeugleiste .abstand { flex: 1; }

/* ---------- Meldungen ---------- */
.meldung { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; margin: 8px 0; border: 1px solid; }
.meldung svg { width: 22px; height: 22px; flex: none; }
.meldung-fehler { background: var(--rot-hell); color: var(--rot-text); border-color: var(--rot-rand); }
.meldung-ok { background: var(--ok-hell); color: var(--ok); border-color: var(--ok-rand); }
.meldung-info { background: var(--grau-hell); color: var(--text-2); border-color: var(--linie-stark); }

/* ---------- Notfall und Fristen ---------- */
.notfall { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.notfall-knopf { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius); text-decoration: none; color: #fff; box-shadow: var(--schatten); }
.notfall-knopf svg { width: 36px; height: 36px; flex: none; }
.notfall-knopf strong { display: block; font-size: 19px; font-weight: 900; }
.notfall-knopf span { opacity: .9; }
.notfall-anfrage { background: var(--primaer); }
.notfall-anfrage:hover { background: var(--primaer-dunkel); }
.notfall-panne { background: var(--rot-rand); }
.notfall-panne:hover { background: #b51f1f; }

.banner-panne { background: var(--rot-rand); color: #fff; }
.banner-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; max-width: 1200px; margin: 0 auto; padding: 10px 16px; color: #fff; text-decoration: none; }
.banner-zeile svg { width: 22px; height: 22px; }
.banner-zeile strong { font-size: 17px; }

.frist-kasten { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--radius); background: var(--gelb-hell); border: 2px solid var(--gelb-rand); color: var(--gelb-text); margin-bottom: 16px; }
.frist-kasten svg { width: 34px; height: 34px; flex: none; }
.frist-kasten strong { display: block; font-size: 20px; }
.frist-kasten.frist-rot { background: var(--rot-hell); border-color: var(--rot-rand); color: var(--rot-text); }
.leitfaden ol { margin: 0; padding-left: 22px; }
.leitfaden li { margin-bottom: 6px; }

/* ---------- Ampel ---------- */
.ampel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.ampel-kachel { position: relative; display: grid; gap: 2px; padding: 14px 14px 14px 44px; border-radius: var(--radius); background: var(--flaeche); box-shadow: var(--schatten); text-decoration: none; color: var(--text); border: 2px solid transparent; }
.ampel-kachel:hover { border-color: var(--linie-stark); }
.ampel-kachel.gewaehlt { border-color: var(--primaer); }
.ampel-licht { position: absolute; left: 14px; top: 16px; width: 18px; height: 18px; border-radius: 50%; background: var(--linie-stark); }
.farbe-rot .ampel-licht { background: var(--rot-rand); box-shadow: 0 0 0 4px var(--rot-hell); }
.farbe-gelb .ampel-licht { background: var(--gelb-rand); box-shadow: 0 0 0 4px var(--gelb-hell); }
.farbe-gruen .ampel-licht { background: var(--ok-rand); box-shadow: 0 0 0 4px var(--ok-hell); }
.farbe-grau .ampel-licht { background: var(--linie-stark); box-shadow: 0 0 0 4px var(--grau-hell); }
.ampel-kachel strong { font-size: 16px; hyphens: auto; overflow-wrap: anywhere; }
.ampel-zahl { color: var(--text-2); font-size: 14px; }
.farbe-rot .ampel-zahl { color: var(--rot-text); font-weight: 700; }
.ampel-hinweis { color: var(--text-3); font-size: 12px; }

.hinweis-claude { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); background: var(--claude-hell); color: var(--claude); border: 1px solid #e3b598; margin-bottom: 16px; }
.hinweis-claude svg { width: 24px; height: 24px; flex: none; }
.hinweis-claude.gross strong { font-size: 18px; }
.hinweis-claude p { margin: 4px 0 0; color: var(--text-2); }

/* ---------- Aufgaben ---------- */
.aufgaben { list-style: none; margin: 0; padding: 0; }
.aufgabe { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--linie); }
.aufgabe:first-child { border-top: 0; }
.prio-punkt { width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--linie-stark); }
.prio-hoch .prio-punkt, .ueberfaellig .prio-punkt { background: var(--rot-rand); }
.prio-mittel .prio-punkt { background: var(--gelb-rand); }
.aufgabe-text { flex: 1; display: grid; gap: 3px; min-width: 0; }
.aufgabe-text a, .aufgabe-text strong { font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.aufgabe-text a:hover { text-decoration: underline; }
.aufgabe-hinweis { color: var(--text-2); font-size: 14px; }
.aufgabe-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--grau-hell); color: var(--text-2); white-space: nowrap; }
.chip-rot { background: var(--rot-hell); color: var(--rot-text); }
.chip-leise { background: none; color: var(--text-3); border: 1px solid var(--linie); }
.chip-claude { background: var(--claude-hell); color: var(--claude); margin-left: 8px; }

/* ---------- Tabellen ---------- */
.tabelle-rahmen { background: var(--flaeche); border-radius: var(--radius); box-shadow: var(--schatten); overflow-x: auto; margin-bottom: 8px; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle th { font-size: 13px; color: var(--text-3); font-weight: 700; background: var(--flaeche-2); }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle td a { font-weight: 700; text-decoration: none; }
.tabelle td a:hover { text-decoration: underline; }
.tabelle tr.zu-bestaetigen td:first-child { box-shadow: inset 4px 0 0 var(--claude); }
.tabelle tr.inaktiv { color: var(--text-3); }
.tabelle td.aktionen { white-space: nowrap; text-align: right; }
.wert-fehlt, .wert-M-ngel, .wert-hoch { color: var(--rot-text); font-weight: 700; }
.wert-unklar, .wert-angefragt { color: var(--gelb-text); font-weight: 700; }
.wert-liegt-vor, .wert-in-Ordnung, .wert-erledigt { color: var(--ok); }
.suche { max-width: 320px; }

/* ---------- Formulare ---------- */
.formular { display: grid; gap: 14px; }
.formular.inline { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--linie); }
.formular .reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.abschnitt { border: 0; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.abschnitt legend { font-size: 18px; font-weight: 900; padding: 0; margin-bottom: 10px; }
.feld { display: grid; gap: 4px; align-content: start; }
.feld-breit { grid-column: 1 / -1; }
.feld-label { font-weight: 700; font-size: 14px; }
.pflicht { color: var(--rot-text); }
.vvt { color: var(--primaer); font-size: 11px; font-weight: 900; }
.eingabe { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--linie-stark); border-radius: 8px; background: var(--flaeche); }
textarea.eingabe { resize: vertical; min-height: 70px; }
.eingabe.klein { min-height: 34px; padding: 4px 6px; width: auto; }
.hat-fehler .eingabe, .hat-fehler.mehrfach { border-color: var(--rot-rand); background: var(--rot-hell); }
.feld-fehler { color: var(--rot-text); font-size: 13px; font-weight: 700; }
.feld-fehler:empty { display: none; }
.mehrfach { border: 1px solid var(--linie-stark); border-radius: 8px; padding: 8px 10px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 12px; }
.haken { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; cursor: pointer; }
.haken input { width: 18px; height: 18px; margin-top: 2px; flex: none; }

/* ---------- Detailansicht ---------- */
.werte { display: grid; grid-template-columns: minmax(160px, 260px) 1fr; gap: 8px 18px; margin: 0; }
.werte dt { color: var(--text-2); font-size: 14px; font-weight: 700; }
.werte dd { margin: 0; overflow-wrap: anywhere; }
.werte dd.mehrzeilig { white-space: pre-wrap; }
.werte dd.leer { color: var(--text-3); }
.werte dd.fehlt { color: var(--gelb-text); background: var(--gelb-hell); border-radius: 6px; padding: 0 8px; justify-self: start; }
.werte dd.fehlt::after { content: ' fehlt'; font-size: 13px; font-weight: 700; }
.hochladen { margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dokumente { margin: 0; padding-left: 20px; }

.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf > li { padding: 10px 0; border-top: 1px solid var(--linie); }
.verlauf > li:first-child { border-top: 0; }
.verlauf-kopf { color: var(--text-2); font-size: 14px; }
.verlauf-kopf strong { color: var(--text); }
.verlauf-hinweis { margin: 4px 0 0; font-size: 14px; color: var(--text-2); font-style: italic; }
.aenderungen { margin: 6px 0 0; padding: 0; list-style: none; font-size: 14px; display: grid; gap: 3px; }
.aenderungen li { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.aend-feld { color: var(--text-3); min-width: 180px; }
.aenderungen del { background: var(--rot-hell); color: var(--rot-text); padding: 0 4px; border-radius: 4px; white-space: pre-wrap; }
.aenderungen ins { background: var(--ok-hell); color: var(--ok); padding: 0 4px; border-radius: 4px; text-decoration: none; white-space: pre-wrap; }

.link-kasten { display: grid; gap: 8px; padding: 14px; border-radius: 10px; background: var(--gelb-hell); border: 1px solid var(--gelb-rand); margin: 12px 0; }
.link-kasten code { overflow-wrap: anywhere; background: var(--flaeche); padding: 8px; border-radius: 6px; }
.anleitung { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; margin: 0; }

/* ---------- Anmeldung ---------- */
.anmelde-rahmen { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.anmelde-karte { width: 100%; max-width: 480px; background: var(--flaeche); border-radius: 16px; box-shadow: var(--schatten); padding: 28px; }
.anmelde-logo { display: block; margin: 0 auto 8px; }
.anmelde-karte h1 { text-align: center; font-size: 24px; margin: 0 0 16px; }
.anmelde-karte h2 { font-size: 17px; margin: 8px 0 0; }
.anmelde-karte .knopf { width: 100%; }
.anmelde-karte .knopfreihe .knopf { width: auto; }

@media (max-width: 900px) {
  .ampel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .kopf-rechts { margin-left: auto; }
}
@media (max-width: 640px) {
  .notfall { grid-template-columns: 1fr; }
  .abschnitt { grid-template-columns: 1fr; }
  .werte { grid-template-columns: 1fr; gap: 2px; }
  .werte dd { margin-bottom: 10px; }
  .konto span { display: none; }
  .tabelle thead { display: none; }
  .tabelle, .tabelle tbody, .tabelle tr, .tabelle td { display: block; width: 100%; }
  .tabelle tr { border-bottom: 1px solid var(--linie); padding: 8px 0; }
  .tabelle td { border: 0; padding: 3px 14px; }
  .tabelle td[data-label]::before { content: attr(data-label) ': '; color: var(--text-3); font-size: 13px; }
  .tabelle td.aktionen { text-align: left; }
  .suche { max-width: none; flex: 1; }
}
@media print {
  .kopf, .fuss, .knopfreihe, .werkzeugleiste, .banner-panne, .notfall { display: none !important; }
  body { background: #fff; }
  .karte, .anmelde-karte { box-shadow: none; }
}

/* ---------- Assistenten (Schritt 4) ---------- */
.assistent-titel { font-size: 21px; margin: 20px 0 10px; }
.schritt { border-left: 5px solid var(--linie-stark); }
.schritt.erledigt { border-left-color: var(--ok-rand); }
.schritt-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.schritt-kopf h2 { margin: 0; }
.schritt-nr { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: var(--primaer-hell); color: var(--primaer-dunkel); flex: none; }
.schritt.erledigt .schritt-nr { background: var(--ok-hell); color: var(--ok); }
.stufen { margin: 0 0 12px; padding-left: 20px; }
.stufen li { margin-bottom: 4px; }
.systemliste { display: grid; gap: 10px; }
.system-karte { border: 1px solid var(--linie); border-radius: 10px; padding: 12px 14px; background: var(--flaeche-2); }
.system-karte.erledigt { border-color: var(--ok-rand); }
.system-karte p { margin: 4px 0; }
.system-kopf { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 700; }
.system-karte .reihe { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr; gap: 8px; margin-top: 8px; }
.hinweis-sperre { background: var(--gelb-hell); color: var(--gelb-text); border-radius: 6px; padding: 4px 8px; }
textarea.schreiben { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13.5px; line-height: 1.5; margin-top: 8px; }
.alle-angaben > summary { cursor: pointer; font-weight: 700; color: var(--primaer); padding: 8px 0 12px; }
.auftrag .karte-kopf svg { width: 22px; height: 22px; color: var(--claude); }

/* ---------- Bereiche (Schritte 3, 5, 6) ---------- */
.zaehler { display: flex; gap: 22px; align-items: center; }
.zaehler-zahl { text-align: center; min-width: 90px; }
.zaehler-zahl strong { font-size: 44px; font-weight: 900; line-height: 1; }
.zaehler-zahl span { color: var(--text-3); }
.zaehler > div:last-child { flex: 1; }
.zaehler h2 { margin-bottom: 8px; }
.zaehler-balken { height: 12px; border-radius: 99px; background: var(--grau-hell); overflow: hidden; margin-bottom: 6px; }
.zaehler-balken span { display: block; height: 100%; background: var(--ok-rand); }
.zaehler-balken.farbe-gelb span { background: var(--gelb-rand); }
.zaehler-balken.farbe-rot span { background: var(--rot-rand); }
.abgleich { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.abgleich li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pruefergebnisse li { margin-bottom: 6px; }
.fusszeile-start { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.foto img { max-width: 320px; max-height: 220px; border-radius: 8px; border: 1px solid var(--linie); display: block; }
@media (max-width: 640px) {
  .zaehler { flex-direction: column; align-items: stretch; }
  .system-karte .reihe { grid-template-columns: 1fr; }
}
/* Lange Zeichenketten im Verlauf (z. B. SHA-256 beim Upload) dürfen umbrechen */
.verlauf-hinweis, .aenderungen del, .aenderungen ins, .verlauf-kopf { overflow-wrap: anywhere; min-width: 0; }

/* ---------- Anmeldung über Authentik, Notfallzugang ---------- */
.knopf.gross { min-height: 54px; font-size: 18px; width: 100%; margin: 8px 0; }
.zentriert { text-align: center; }
.eingabe-schluessel { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: 1px; }
.notfallschluessel { display: block; font-size: 17px; padding: 12px; background: var(--flaeche-2); border: 1px solid var(--linie-stark); border-radius: 8px; word-break: break-all; margin: 12px 0 6px; user-select: all; }
.banner-notfall { display: flex; gap: 10px; align-items: center; padding: 10px 16px; background: var(--gelb-hell); color: var(--gelb-text); border-bottom: 2px solid var(--gelb-rand); }
.banner-notfall svg { width: 22px; height: 22px; flex: none; }
