/* Lezi's Lager – Design: Farben aus dem Lezi's-Logo (Sand #c1a27f, Braun #8a6850) */
:root {
  --sand: #c1a27f;
  --sand-hell: #ece1d3;
  --braun: #8a6850;
  --braun-dunkel: #5e4635;
  --papier: #f6f1ea;
  --flaeche: #fffdfa;
  --tinte: #2b221c;
  --leise: #7d6f63;
  --linie: #e7ddd0;
  --linie-stark: #d6c7b5;

  --ok: #3d7a52;      --ok-hell: #e5f0e7;
  --warn: #a7700f;    --warn-hell: #fbf0da;
  --rot: #b13b2e;     --rot-hell: #fae6e2;
  --blau: #33607e;    --blau-hell: #e3edf3;
  --grau-hell: #efebe6;

  --r: 16px; --r-k: 10px;
  --schatten: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 24px rgba(60, 40, 20, .07);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --unten: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--papier); color: var(--tinte); font: 16px/1.45 var(--sans); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--braun); }
[hidden] { display: none !important; }
.laedt { text-align: center; color: var(--leise); padding: 30vh 0; }
.leise { color: var(--leise); }
.klein { font-size: 13px; }
.zahl { font-variant-numeric: tabular-nums; }
.zentriert { text-align: center; }

/* ---------- Kopf ---------- */
.kopf { background: var(--sand); color: var(--braun); padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; }
.kopf .logo { height: 34px; width: auto; display: block; }
.kopf .titel { font: 600 12px/1.1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--braun-dunkel); opacity: .85; }
.kopf .rechts { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.kopf .wer { font-size: 13px; color: var(--braun-dunkel); text-align: right; line-height: 1.2; }
.kopf .wer small { display: block; opacity: .75; }
.knopf-rund { border: 0; background: rgba(255,255,255,.35); color: var(--braun-dunkel); width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-size: 18px; }

/* ---------- Navigation ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--flaeche); border-top: 1px solid var(--linie);
  display: flex; padding-bottom: var(--unten); }
.nav button { flex: 1; border: 0; background: none; padding: 8px 2px 9px; font-size: 11.5px; color: var(--leise);
  display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; min-height: 58px; }
.nav button .ic { font-size: 21px; line-height: 1; }
.nav button.aktiv { color: var(--braun-dunkel); font-weight: 600; }
.nav button.aktiv::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--braun); }
.badge { background: var(--rot); color: #fff; border-radius: 999px; font: 700 11px/18px var(--sans); min-width: 18px; height: 18px;
  padding: 0 5px; display: inline-block; text-align: center; }
.nav .badge { position: absolute; top: 4px; left: calc(50% + 6px); }

main { max-width: 980px; margin: 0 auto; padding: 16px 14px calc(96px + var(--unten)); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 27px; }
h2 { font-size: 21px; margin: 26px 0 10px; }
h3 { font-size: 17px; }
.unterzeile { color: var(--leise); margin: 2px 0 16px; }

/* ---------- Große Aktionen ---------- */
.aktionen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 6px; }
.aktion { border: 0; border-radius: var(--r); padding: 16px 14px; text-align: left; min-height: 96px;
  display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--schatten); }
.aktion b { font: 600 18px/1.2 var(--serif); }
.aktion span { font-size: 13px; opacity: .85; }
.aktion .ic { font-size: 24px; }
.aktion.haupt { background: var(--braun); color: #fff; }
.aktion.zweit { background: var(--braun-dunkel); color: #fff; }
.aktion.leicht { background: var(--flaeche); color: var(--tinte); border: 1px solid var(--linie); box-shadow: none; }
.aktion.breit { grid-column: 1 / -1; min-height: 64px; flex-direction: row; align-items: center; gap: 12px; }

/* ---------- Kennzahlen ---------- */
.kacheln { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.kachel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-k); padding: 10px; text-align: left; }
.kachel b { display: block; font: 600 24px/1.1 var(--serif); }
.kachel span { font-size: 12px; color: var(--leise); }
.kachel.rot b { color: var(--rot); } .kachel.warn b { color: var(--warn); } .kachel.blau b { color: var(--blau); }
@media (max-width: 520px) { .kacheln { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Karten / Listen ---------- */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); padding: 14px; margin-bottom: 10px; }
.liste { display: flex; flex-direction: column; gap: 8px; }
.ware { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); padding: 12px 14px; width: 100%; text-align: left;
  display: block; }
.ware:active { background: var(--sand-hell); }
.ware .z1 { display: flex; align-items: flex-start; gap: 8px; }
.ware .name { font-weight: 600; font-size: 16.5px; flex: 1; }
.ware .meta { font-size: 13px; color: var(--leise); }
.werte { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.wert { background: var(--papier); border-radius: 8px; padding: 6px 8px; }
.wert small { display: block; font-size: 11px; color: var(--leise); text-transform: uppercase; letter-spacing: .04em; }
.wert b { font-size: 17px; font-variant-numeric: tabular-nums; }
.wert.minus b { color: var(--rot); } .wert.plus b { color: var(--blau); }
.status { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.st { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.st-ok { background: var(--ok-hell); color: var(--ok); }
.st-faellig { background: var(--warn-hell); color: var(--warn); }
.st-abweichung { background: var(--rot-hell); color: var(--rot); }
.st-leer { background: var(--tinte); color: #fff; }
.st-nachbestellen { background: var(--blau-hell); color: var(--blau); }
.st-unbekannt, .st-grau { background: var(--grau-hell); color: var(--leise); }
.st-pruefung { background: var(--warn-hell); color: var(--warn); }
.st-offen { background: var(--rot-hell); color: var(--rot); }
.st-erledigt { background: var(--ok-hell); color: var(--ok); }
.leer-hinweis { text-align: center; color: var(--leise); padding: 28px 10px; }

/* ---------- Filter ---------- */
.suche { width: 100%; border: 1px solid var(--linie-stark); background: var(--flaeche); border-radius: 12px; padding: 12px 14px; font-size: 16px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--linie-stark); background: var(--flaeche); border-radius: 999px; padding: 7px 13px; font-size: 14px; white-space: nowrap; }
.chip.an { background: var(--braun); border-color: var(--braun); color: #fff; }
.filterzeile { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }

/* ---------- Formulare ---------- */
label.f { display: block; margin: 12px 0 0; }
label.f > span { display: block; font-size: 13px; font-weight: 600; color: var(--leise); margin-bottom: 5px; }
.eingabe, select.eingabe, textarea.eingabe { width: 100%; border: 1px solid var(--linie-stark); background: #fff; border-radius: 12px;
  padding: 12px 13px; font-size: 16px; }
textarea.eingabe { min-height: 74px; resize: vertical; }
.eingabe:focus, .suche:focus { outline: 2px solid var(--sand); outline-offset: 1px; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.knopf { border: 0; border-radius: 12px; padding: 14px 18px; font-weight: 600; font-size: 16px; background: var(--braun); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; }
.knopf.voll { width: 100%; }
.knopf.zweit { background: var(--sand-hell); color: var(--braun-dunkel); }
.knopf.rand { background: transparent; color: var(--braun-dunkel); border: 1px solid var(--linie-stark); }
.knopf.klein { padding: 8px 12px; min-height: 38px; font-size: 14px; border-radius: 10px; }
.knopf.gefahr { background: var(--rot); }
.knopf:disabled { opacity: .55; }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.knopfreihe .knopf { flex: 1; }
.schalter { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding: 12px; border: 1px solid var(--linie); border-radius: 12px; background: #fff; }
.schalter input { width: 22px; height: 22px; accent-color: var(--braun); flex: none; }
.gruende { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.grund { border: 1px solid var(--linie-stark); background: #fff; border-radius: 10px; padding: 10px; text-align: left; font-size: 14px; line-height: 1.25; min-height: 48px; }
.grund.an { border-color: var(--braun); background: var(--sand-hell); font-weight: 600; box-shadow: inset 0 0 0 1px var(--braun); }
.grund.lang { grid-column: 1 / -1; }
.tage { display: flex; gap: 5px; flex-wrap: wrap; }
.tage label { flex: 1; min-width: 40px; }
.tage input { display: none; }
.tage span { display: block; text-align: center; border: 1px solid var(--linie-stark); border-radius: 10px; padding: 9px 0; background: #fff; font-weight: 600; }
.tage input:checked + span { background: var(--braun); color: #fff; border-color: var(--braun); }

/* Zähl-Eingabe */
.zaehler { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; align-items: stretch; margin-top: 6px; }
.zaehler button { border: 1px solid var(--linie-stark); background: #fff; border-radius: 14px; font-size: 28px; color: var(--braun-dunkel); }
.zaehler input { text-align: center; font: 600 32px/1 var(--sans); border: 2px solid var(--braun); border-radius: 14px; padding: 12px 0; width: 100%; background: #fff; font-variant-numeric: tabular-nums; }
.diffbox { margin-top: 10px; border-radius: 12px; padding: 10px 12px; font-weight: 600; background: var(--grau-hell); }
.diffbox.minus { background: var(--rot-hell); color: var(--rot); }
.diffbox.plus { background: var(--blau-hell); color: var(--blau); }
.diffbox.null { background: var(--ok-hell); color: var(--ok); }
.info { border-radius: 12px; padding: 10px 12px; font-size: 14px; background: var(--warn-hell); color: #6d4a08; margin-top: 10px; }
.info.blau { background: var(--blau-hell); color: var(--blau); }

/* ---------- Sheet (Dialog) ---------- */
.sheet-hg { position: fixed; inset: 0; background: rgba(43, 34, 28, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--papier); width: 100%; max-width: 640px; max-height: 94vh; overflow: auto; border-radius: 22px 22px 0 0;
  padding: 0 16px calc(18px + var(--unten)); animation: hoch .18s ease-out; overscroll-behavior: contain; }
@media (min-width: 700px) { .sheet-hg { align-items: center; } .sheet { border-radius: 22px; max-height: 88vh; } }
@keyframes hoch { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-kopf { position: sticky; top: 0; background: var(--papier); display: flex; align-items: center; gap: 10px; padding: 16px 0 10px; z-index: 2; }
.sheet-kopf h2 { margin: 0; flex: 1; font-size: 21px; }
.zu { border: 0; background: var(--sand-hell); width: 38px; height: 38px; border-radius: 50%; font-size: 20px; color: var(--braun-dunkel); flex: none; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + var(--unten)); z-index: 80; background: var(--tinte); color: #fff;
  padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100% - 28px); box-shadow: var(--schatten); }
.toast.ok { background: var(--ok); }
.toast.fehler { background: var(--rot); }

/* ---------- Tabellen ---------- */
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th { text-align: left; font-size: 12px; color: var(--leise); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--linie-stark); }
.tabelle td { padding: 8px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle td.r, .tabelle th.r { text-align: right; }
.scroll { overflow-x: auto; }

/* Verlauf / Protokoll */
.eintrag { border-left: 3px solid var(--linie-stark); padding: 6px 0 8px 12px; margin-bottom: 6px; }
.eintrag.kontrolle { border-color: var(--braun); }
.eintrag.eingang { border-color: var(--ok); }
.eintrag.korrektur { border-color: var(--warn); }
.eintrag .k { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--leise); }
.eintrag .t { font-size: 15px; }

/* Woche */
.wochenkopf { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.wochenkopf b { flex: 1; text-align: center; font-family: var(--serif); font-size: 18px; }
.tag { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); margin-bottom: 10px; overflow: hidden; }
.tag > header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--sand-hell); }
.tag > header b { flex: 1; }
.tag.heute > header { background: var(--sand); color: var(--braun-dunkel); }
.zeile { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--linie); font-size: 15px; }
.zeile .pkt { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.pkt.erledigt { background: var(--ok); } .pkt.offen { background: var(--rot); } .pkt.geplant { background: var(--linie-stark); }
.pkt.abw { background: var(--warn); }
.zeile .rest { margin-left: auto; font-size: 13px; color: var(--leise); text-align: right; }
.fortschritt { height: 6px; background: var(--linie); border-radius: 3px; overflow: hidden; width: 70px; }
.fortschritt i { display: block; height: 100%; background: var(--ok); }

/* Feierabend */
.fa-zeile { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; }
.fa-zeile.fertig { border-color: var(--ok); }
.fa-zeile.abw { border-color: var(--warn); }
.fa-zeile .oben { display: flex; align-items: center; gap: 10px; }
.fa-zeile .oben .name { flex: 1; font-weight: 600; }
.fa-zeile .oben input { width: 110px; text-align: center; font: 600 22px/1 var(--sans); border: 2px solid var(--linie-stark); border-radius: 12px; padding: 10px 4px; background: #fff; }
.fa-zeile.fertig .oben input { border-color: var(--ok); }
.leiste { position: sticky; bottom: calc(62px + var(--unten)); background: var(--papier); padding: 10px 0; z-index: 5; }
.foto-vorschau { max-width: 100%; border-radius: 12px; margin-top: 8px; display: block; }

/* Login */
.login-seite { min-height: 100vh; display: grid; place-items: center; background: var(--sand); padding: 20px; }
.login { background: var(--papier); border-radius: 22px; padding: 26px 22px; width: 100%; max-width: 380px; box-shadow: var(--schatten); }
.login .logo { color: var(--braun); width: 190px; display: block; margin: 0 auto 4px; }
.login p.leise { text-align: center; margin: 0 0 14px; }
.fehlertext { color: var(--rot); font-weight: 600; margin-top: 10px; }

@media (min-width: 900px) {
  .liste.raster { display: grid; grid-template-columns: 1fr 1fr; }
}
@media print { .nav, .kopf .rechts, .knopf, .chips { display: none !important; } main { padding: 0; } }
.login .logo svg { width: 100%; height: auto; display: block; }
.kopf svg.logo { height: 34px; width: auto; }
