/* BWM Abfüllung – Oberfläche für Tablet im Lager und PC im Büro */

:root {
  --primaer: #1f6f5c;
  --primaer-dunkel: #164f42;
  --primaer-hell: #e3f0ec;
  --text: #1c2321;
  --leise: #5d6864;
  --linie: #d5dbd8;
  --flaeche: #f3f5f4;
  --karte: #ffffff;
  --ok: #1e7a3c;
  --ok-hell: #e1f3e6;
  --warnung: #8a5a00;
  --warnung-hell: #fff3d6;
  --fehler: #b3261e;
  --fehler-hell: #fde7e5;
  --info-hell: #e6eef9;
  --radius: 10px;
  --abstand: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--flaeche);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (pointer: coarse) { body { font-size: 17px; } }

a { color: var(--primaer); }
a:hover { color: var(--primaer-dunkel); }
h1 { font-size: 1.6rem; margin: .2em 0 .6em; line-height: 1.2; }
h2 { font-size: 1.25rem; margin: 1.6em 0 .6em; }
h3 { font-size: 1.05rem; margin: 1.2em 0 .5em; }
.karte h3:first-child, .karte h2:first-child { margin-top: 0; }
p { margin: 0 0 .8em; }
.leise { color: var(--leise); }
.klein { font-size: .88rem; }
.nowrap { white-space: nowrap; }
.rechts { text-align: right; }
.mitte { text-align: center; }
/* Rechtetabelle (Benutzer) */
.rechte .recht-ja { color: var(--ok); font-weight: 700; font-size: 1.1rem; }
.rechte .recht-nein { color: var(--leise); }
.rechte tr.rechte-neu td { border-top: 2px solid var(--linie); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .02em; }

/* Kopfzeile und Navigation */
.kopf {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  background: var(--primaer-dunkel); color: #fff;
  padding: 0 var(--abstand); min-height: 56px;
}
.marke { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; white-space: nowrap; }
.marke span { font-weight: 400; opacity: .85; }
.marke:hover { color: #fff; }
.nav { display: flex; gap: 0; flex: 1; min-width: 0; }
.nav a {
  color: #e8f2ef; text-decoration: none; padding: 17px 8px 14px; white-space: nowrap; font-size: .95rem;
  border-bottom: 3px solid transparent;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.aktiv { color: #fff; border-bottom-color: #9fd6c5; font-weight: 600; }
.konto { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.konto a { color: #e8f2ef; }
.konto form { margin: 0; }
.knopf-link { background: none; border: 0; color: #e8f2ef; text-decoration: underline; cursor: pointer; font: inherit; padding: 8px 0; }
.menue-knopf { display: none; }

@media (max-width: 1380px) { .konto > a { display: none; } }
@media (max-width: 1150px) {
  .kopf { flex-wrap: wrap; }
  .menue-knopf {
    display: block; margin-left: auto; background: rgba(255,255,255,.12); color: #fff;
    border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 10px 16px; font: inherit;
  }
  .nav { display: none; order: 3; flex-basis: 100%; flex-direction: column; padding-bottom: 8px; }
  .nav.offen { display: flex; }
  .nav a { padding: 14px 8px; border-bottom: 1px solid rgba(255,255,255,.1); border-left: 3px solid transparent; }
  .nav a.aktiv { border-left-color: #9fd6c5; border-bottom-color: rgba(255,255,255,.1); }
  .konto { order: 2; }
}

.inhalt { max-width: 1280px; margin: 0 auto; padding: 20px var(--abstand) 64px; }
.brotkrumen { margin: 0 0 .3em; font-size: .92rem; color: var(--leise); }
.titelzeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.titelzeile h1 { margin-bottom: .4em; }
.titelzeile .aktionen-oben { display: flex; gap: 8px; flex-wrap: wrap; }

/* Meldungen */
.meldung { padding: 12px 16px; border-radius: var(--radius); margin: 0 0 16px; border: 1px solid; }
.meldung-ok { background: var(--ok-hell); border-color: #b5dcc0; color: #134d27; }
.meldung-warnung { background: var(--warnung-hell); border-color: #f0d48a; color: #5c3d00; }
.meldung-fehler { background: var(--fehler-hell); border-color: #f2b8b3; color: #7a1a14; }
.meldung-info { background: var(--info-hell); border-color: #bcd0ef; color: #1d3a66; }
.rueckfrage { border-width: 2px; padding: 16px 20px; }
.rueckfrage h2 { margin-top: 0; }
.hinweis { background: var(--primaer-hell); border-radius: 8px; padding: 10px 14px; }
.hinweis:empty { display: none; }

/* Karten, Kacheln */
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kacheln-breit { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.kachel {
  display: flex; flex-direction: column; gap: 4px; padding: 18px; min-height: 96px;
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius);
  text-decoration: none; color: var(--text);
}
.kachel:hover { border-color: var(--primaer); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.kachel b { font-size: 1.08rem; color: var(--primaer-dunkel); }
.kachel span { color: var(--leise); font-size: .92rem; }
.kachel .zahl-gross { font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.kachel-warnung { border-color: #f0d48a; background: #fffbef; }
.kachel-fehler { border-color: #f2b8b3; background: #fff6f5; }

/* Formulare */
.formular { display: flex; flex-direction: column; gap: 14px; }
.formular fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.raster-2, .raster-3, .raster-4 { display: grid; gap: 14px; }
.raster-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.raster-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.raster-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.zeile { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }
.final-setzen { align-items: flex-end; gap: 10px 12px; }
.final-setzen .feld { min-width: 240px; }
.feld { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; border: 0; padding: 0; }
.feld > span, .feld > legend { font-weight: 600; font-size: .93rem; padding: 0; }
.feld small { color: var(--leise); font-size: .85rem; }
.pflicht { color: var(--fehler); font-weight: 600; }
input[type=text], input[type=search], input[type=password], input[type=date], input[type=time], input[type=datetime-local], input[type=number],
input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff;
  border: 1px solid #b9c2be; border-radius: 8px; padding: 10px 12px; min-height: 46px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #9fd6c5; outline-offset: 0; border-color: var(--primaer); }
input[type=file] { font: inherit; padding: 8px 0; max-width: 100%; }
.mit-einheit { display: flex; align-items: center; gap: 8px; }
.mit-einheit i { font-style: normal; color: var(--leise); white-space: nowrap; }
.hat-fehler input, .hat-fehler select, .hat-fehler textarea { border-color: var(--fehler); background: #fffafa; }
.fehler { color: var(--fehler); font-style: normal; font-size: .9rem; font-weight: 600; }
.haken { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.haken input { width: 24px; height: 24px; accent-color: var(--primaer); flex: none; }
/* Reinigungs-Checkliste: ein Schritt je Zeile, ganze Zeile antippbar, erledigte Schritte grün */
.checkliste-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.checkliste-kopf h3 { margin: 0 0 8px; }
.checkliste { border: 0; margin: 0; padding: 0; min-width: 0; }
.checkliste[hidden] { display: none; }
.checkliste legend { padding: 0; margin-bottom: 6px; }
.checkliste-schritte { list-style: none; margin: 0; padding: 0; border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; counter-reset: schritt; }
.checkliste-schritte li { counter-increment: schritt; }
.checkliste-schritte li + li { border-top: 1px solid var(--linie); }
.checkpunkt { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px; min-height: 56px; cursor: pointer; line-height: 1.35; }
.checkpunkt:hover { background: var(--flaeche); }
.checkpunkt input { width: 26px; height: 26px; margin: 0; flex: none; accent-color: var(--primaer); }
.checkpunkt .nr { flex: none; min-width: 1.2em; color: var(--leise); font-variant-numeric: tabular-nums; padding-top: 2px; }
.checkpunkt .nr::before { content: counter(schritt) "."; }
.checkpunkt > span:last-child { padding-top: 2px; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.checkpunkt:has(input:checked) { background: var(--ok-hell); }
.checkpunkt:has(input:checked) > span:last-child { color: #134d27; }
.aktionen { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.filter .feld { min-width: 180px; }
.filter-klein { margin: 0 0 10px; }
.scan-feld input { font-size: 1.2rem; min-height: 56px; border-width: 2px; border-color: var(--primaer); }

/* Auswahlknöpfe (Team, Arbeitsplatz) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 48px; padding: 8px 18px;
  border: 1px solid #b9c2be; border-radius: 999px; background: #fff; user-select: none;
}
.chip input:checked + span { background: var(--primaer); border-color: var(--primaer); color: #fff; font-weight: 600; }
.chip input:focus-visible + span { outline: 3px solid #9fd6c5; }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 8px; border: 1px solid var(--primaer);
  background: var(--primaer); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.knopf:hover { background: var(--primaer-dunkel); color: #fff; }
.knopf-zweit { background: #fff; color: var(--primaer); }
.knopf-zweit:hover { background: var(--primaer-hell); color: var(--primaer-dunkel); }
.knopf-gefahr { background: #fff; color: var(--fehler); border-color: var(--fehler); }
.knopf-gefahr:hover { background: var(--fehler-hell); color: var(--fehler); }
.knopf-gross { min-height: 64px; font-size: 1.15rem; padding: 14px 28px; }
.knopf-riesig { min-height: 96px; font-size: 1.4rem; width: 100%; }
.knopf-klein { min-height: 36px; padding: 4px 12px; font-weight: 500; }
.knopf[disabled] { opacity: .5; cursor: not-allowed; }
.inline { display: inline; margin: 0; }

/* Tabellen */
.tabelle-rahmen { overflow-x: auto; background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); margin-bottom: 16px; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e7ebe9; vertical-align: top; }
.tabelle th { background: #f7f9f8; font-size: .85rem; color: var(--leise); font-weight: 600; white-space: nowrap; }
.tabelle th.rechts, .tabelle td.rechts { text-align: right; }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle tbody tr:hover { background: #fafcfb; }
.tabelle tr.inaktiv td { color: #8b9590; }
.tabelle tr.warnung td { background: #fffbef; }
.tabelle tr.fehler td { background: #fff6f5; }
.tabelle tfoot td { font-weight: 700; background: #f7f9f8; }
.tabelle .leer { text-align: center; color: var(--leise); padding: 24px; }
.aenderungen div { font-size: .88rem; }
.aenderungen s { color: #8b9590; }

/* Status und Kennzeichen */
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; background: #eceff0; color: #39423f; }
.status-frei, .status-fertig, .status-abgeschlossen, .status-eingegangen, .status-gedruckt, .status-ok, .status-final { background: var(--ok-hell); color: #134d27; }
.status-gesperrt, .status-reklamation, .status-fehler, .status-nicht_ok { background: var(--fehler-hell); color: #7a1a14; }
.status-ware_da, .status-laeuft, .status-in_abfuellung, .status-offen, .status-avisiert { background: var(--warnung-hell); color: #5c3d00; }
.status-geplant, .status-entwurf { background: var(--info-hell); color: #1d3a66; }
.status-verladen { background: #e7e3f6; color: #3a2a77; }
.status-storniert { background: #eceff0; color: #6b7571; text-decoration: line-through; }
.marke-bio, .marke-ft { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 4px; margin-right: 4px; }
.marke-bio { background: #dff1d2; color: #2c5b12; }
.marke-allergen { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 4px; background: #fde7d6; color: #7a3a0e; }
.etikettenhaken { margin-top: 4px; font: inherit; font-size: .8rem; padding: 3px 9px; min-height: 30px; border-radius: 999px; border: 1px dashed #b9c2be; background: #fff; color: var(--leise); cursor: pointer; }
.etikettenhaken.an { border-style: solid; border-color: #b5dcc0; background: var(--ok-hell); color: #134d27; font-weight: 600; }
.marke-ft { background: #dbe9f7; color: #1c4670; }

/* Kennzahlen */
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 20px; }
.kennzahl { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 16px; }
.kennzahl span { display: block; color: var(--leise); font-size: .85rem; }
.kennzahl b { font-size: 1.5rem; }
.kennzahl.warnung { background: var(--warnung-hell); border-color: #f0d48a; }
.kennzahl.fehler { background: var(--fehler-hell); border-color: #f2b8b3; }
.kennzahl.ok { background: var(--ok-hell); border-color: #b5dcc0; }

dl.daten { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.daten dt { color: var(--leise); }
dl.daten dd { margin: 0; font-weight: 500; }

.fortschritt { height: 12px; background: #e3e8e6; border-radius: 6px; overflow: hidden; }
.fortschritt i { display: block; height: 100%; background: var(--primaer); }

.anmelden { max-width: 420px; margin: 8vh auto 0; }
.anmelden h1 { text-align: center; color: var(--primaer-dunkel); font-size: 2rem; }
.anmelden h1 span { font-weight: 400; }
.anmelden form { display: flex; flex-direction: column; gap: 16px; }

.seiten { display: flex; gap: 10px; }
.fehlerliste li { color: var(--fehler); }

/* Ziehen und Sortieren im Plan */
.ziehbar { cursor: grab; }
.ziehbar.zieht { opacity: .5; }
.griff { cursor: grab; color: #8b9590; font-size: 1.3rem; user-select: none; padding: 0 4px; }
.sortier-knoepfe { display: inline-flex; gap: 4px; }
.sortier-knoepfe button { min-width: 40px; min-height: 40px; border: 1px solid var(--linie); background: #fff; border-radius: 6px; font-size: 1rem; cursor: pointer; }

/* Chargenzeilen im Wareneingang */
.chargen { display: flex; flex-direction: column; gap: 12px; }
.chargenzeile {
  display: grid; gap: 10px 14px; align-items: end; padding: 14px;
  grid-template-columns: minmax(180px, 2fr) minmax(130px, 1.3fr) minmax(150px, 1fr) minmax(120px, 1fr);
  border: 1px solid var(--linie); border-left: 4px solid var(--primaer); border-radius: 8px; background: #fbfcfb;
}
.chargenzeile.hat-fehler { border-left-color: var(--fehler); background: #fffafa; }
.chargenzeile .feld-breit { grid-column: span 2; }
.chargenzeile .zeile-ende { display: flex; justify-content: flex-end; }
.chargenzeile > .fehler { grid-column: 1 / -1; }
@media (max-width: 700px) { .chargenzeile { grid-template-columns: 1fr 1fr; } .chargenzeile .feld-ware, .chargenzeile .feld-breit { grid-column: 1 / -1; } }

.fotos { display: flex; flex-wrap: wrap; gap: 10px; }
.fotos a img { width: 140px; height: 105px; object-fit: cover; border-radius: 8px; border: 1px solid var(--linie); }
/* Fotofeld mit Kamera-Knopf: die Dateifelder sind unsichtbar, der Knopf (label) öffnet sie */
.fotofeld { position: relative; }
.fotofeld-knoepfe { gap: 10px; }
.fotofeld label.knopf { position: relative; }
.fotofeld label.knopf:focus-within { outline: 3px solid #9fd6c5; }
.datei-versteckt { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.fotofeld-vorschau:empty { display: none; }
.fotofeld-gruppe { display: contents; }
.fotofeld-bild { position: relative; }
.fotofeld-bild img, .fotofeld-bild .datei { display: flex; align-items: center; justify-content: center; width: 140px; height: 105px;
  object-fit: cover; border-radius: 8px; border: 1px solid var(--linie); background: #fff; font-size: .85rem; padding: 0; overflow: hidden; word-break: break-all; }
.fotofeld-bild .datei { padding: 8px; text-align: center; }
.fotofeld-bild button { position: absolute; top: 4px; right: 4px; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }

.gross { font-size: 1.15rem; }
.text-fehler { color: var(--fehler); }
.hinweis-fehler { background: var(--fehler-hell); color: #7a1a14; }
.hinweis-klein { font-size: .85rem; color: var(--warnung); }
.knopf-link-dunkel { background: none; border: 0; padding: 4px 0; color: var(--primaer); text-decoration: underline; font: inherit; cursor: pointer; }
.wochenwahl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.wochenwahl b { font-size: 1.1rem; }
.wochenwahl form { margin: 0 0 0 auto; gap: 12px; }
.wochenwahl select { min-width: 200px; }
.tabelle tr.erledigt td { color: #6b7571; background: #f7f9f8; }
.tabelle tr.zieht td { background: var(--primaer-hell); }
.reiter { display: flex; gap: 4px; border-bottom: 2px solid var(--linie); margin-bottom: 16px; flex-wrap: wrap; }
.reiter a { padding: 12px 16px; text-decoration: none; color: var(--leise); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.reiter a.aktiv { color: var(--primaer-dunkel); border-bottom-color: var(--primaer); font-weight: 600; }
.chip-gross span { min-height: 60px; border-radius: 12px; padding: 10px 18px; }
.kachel-laufend { border-left: 5px solid var(--warnung); }
.palette-melden { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: stretch; margin-bottom: 20px; }
.palette-melden .knopf-riesig { height: 100%; min-height: 120px; }
.restpalette { margin: 0; align-items: flex-end; }
@media (max-width: 800px) { .palette-melden { grid-template-columns: 1fr; } }
.cp-zeile.cp-ok { border-left: 5px solid var(--ok); }
.cp-zeile.cp-fehler { border-left: 5px solid var(--fehler); }
.protokolltag { break-inside: avoid-page; margin-bottom: 24px; }
.protokoll-block { margin-bottom: 16px; break-inside: avoid; }
.protokoll-block .kopfzeile { margin-bottom: 4px; background: #f7f9f8; }
details.karte summary { cursor: pointer; font-weight: 600; min-height: 32px; }
details.karte[open] summary { margin-bottom: 14px; }

.verlade-stand { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; font-size: 1.1rem; }
.verlade-stand b { font-size: 2.4rem; margin-right: 8px; }
.verlade-stand .fortschritt { height: 18px; margin-top: 8px; }
.verlade-stand.fertig { background: var(--ok-hell); border-color: #b5dcc0; }
.ladeliste-kopf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; font-size: .95rem; }
.unterschriften { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 64px; }
.unterschriften div { border-top: 1px solid #000; padding-top: 6px; font-size: .9rem; }
@media (max-width: 700px) { .ladeliste-kopf { grid-template-columns: 1fr; } }

/* Druckansichten */
@media print {
  .kopf, .keindruck, .meldung { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .inhalt { padding: 0; max-width: none; }
  .tabelle-rahmen, .karte { border: 0; padding: 0; }
  .tabelle th, .tabelle td { padding: 4px 6px; }
  a { color: inherit; text-decoration: none; }
}

/* Rückfrage vor folgenreichen Aktionen (Fenster in der Seite statt Browser-Dialog) */
.rueckfrage-hintergrund { position: fixed; inset: 0; background: rgba(28, 35, 33, .45); display: flex; align-items: center;
  justify-content: center; padding: var(--abstand); z-index: 100; }
.rueckfrage-fenster { background: var(--karte); border-radius: var(--radius); padding: 24px; max-width: 520px; width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.rueckfrage-fenster p { font-size: 1.1rem; margin: 0 0 20px; }
@media print { .rueckfrage-hintergrund { display: none; } }
