:root {
  --anthrazit: #575756; --gelb: #f9b104; --gruen: #2e7d32; --rot: #b3261e;
  --flaeche: #fff; --grund: #f2f2f0; --text: #222; --leise: #666; --rand: #d8d8d4;
}
* { box-sizing: border-box; }
body { margin: 0; font: 17px/1.4 system-ui, sans-serif; color: var(--text); background: var(--grund); }
header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--anthrazit); color: #fff; }
header a, header .link { color: #fff; text-decoration: none; }
.marke { font-weight: 700; border-bottom: 3px solid var(--gelb); }
nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
main { max-width: 900px; margin: 0 auto; padding: 16px 16px 110px; }
footer { text-align: center; color: var(--leise); font-size: 13px; padding: 0 0 100px; }
h1 { font-size: 24px; margin: 4px 0 12px; }
h2 { font-size: 18px; margin: 0 0 8px; }
h3 { font-size: 16px; margin: 16px 0 6px; }
small, .klein { color: var(--leise); font-size: 14px; }
em { font-style: normal; color: var(--rot); display: block; }

button, .knopf, input, select { font: inherit; }
button, .knopf { cursor: pointer; border-radius: 10px; border: 1px solid var(--anthrazit); background: var(--flaeche);
  color: var(--text); padding: 8px 14px; min-height: 44px; text-decoration: none; display: inline-flex; align-items: center; }
button.gross, .knopf.gross { width: 100%; justify-content: center; min-height: 58px; font-size: 19px; font-weight: 700;
  background: var(--gelb); border-color: var(--gelb); color: #222; }
button:disabled { opacity: .45; cursor: default; }
button.link { background: none; border: 0; padding: 0; min-height: 0; text-decoration: underline; }
input, select { padding: 10px; border: 1px solid var(--rand); border-radius: 8px; background: #fff; min-height: 44px; max-width: 100%; }
input[type=checkbox], input[type=radio] { width: 26px; height: 26px; min-height: 0; flex: none; accent-color: var(--anthrazit); }
:focus-visible { outline: 3px solid var(--gelb); outline-offset: 2px; }

.hinweis { background: #fff6dc; border-left: 5px solid var(--gelb); padding: 10px 12px; border-radius: 6px; }
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 12px; padding: 12px; margin: 0 0 12px; }
.schmal { max-width: 380px; margin: 40px auto; display: grid; gap: 14px; }
.schmal label { display: grid; gap: 4px; }
.leiste { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px; background: var(--grund);
  border-top: 1px solid var(--rand); }
.leiste.zwei { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.reihe { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 10px; }
.reihe label { display: grid; gap: 2px; font-size: 14px; }
.wahl { display: flex !important; align-items: center; gap: 8px; font-size: 16px !important; margin: 6px 0; }
.mitarbeiter { border-top: 1px solid var(--rand); padding-top: 10px; align-items: center; }
.tabelle { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--rand); white-space: nowrap; }

/* Bestellliste */
.bestellung { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; }
.bestellung.grau { color: #6b6b6b; }
.bestellung.grau em { color: #555; }
.bestellung.fehler b { color: var(--rot); }
.artikel { margin: 4px 0 0; padding: 0; list-style: none; font-size: 15px; }
.gruppe summary { cursor: pointer; }
.gruppe summary label { display: inline-flex; gap: 12px; align-items: center; }
.gruppe .bestellung { border-top: 1px solid var(--rand); margin-left: 8px; }

.karton { display: inline-block; background: var(--anthrazit); color: #fff; border-radius: 6px; padding: 0 7px;
  font-size: 14px; white-space: nowrap; }

/* Pickrunde */
.kartons { margin-top: 0; }
.position { touch-action: manipulation; width: 100%; display: grid; grid-template-columns: 72px 1fr 34px; gap: 10px; text-align: left;
  align-items: center; padding: 12px; margin-bottom: 10px; border: 2px solid var(--anthrazit); border-radius: 14px; }
.position .menge { font-size: 34px; font-weight: 800; text-align: center; }
.position .text { display: grid; gap: 2px; }
.position .name { font-weight: 700; font-size: 19px; }
.position .aufteilung { display: flex; flex-wrap: wrap; gap: 6px; justify-self: start; }
/* ein Badge je Bestellung, Farbe trennt die Bestellungen, Text nennt den Zielkarton */
.auf { border-radius: 6px; padding: 2px 8px; font-weight: 600; white-space: nowrap; color: #222; }
.auf0 { background: #f9b104; } .auf1 { background: #8ecae6; } .auf2 { background: #b5e48c; }
.auf3 { background: #ffb4a2; } .auf4 { background: #cdb4db; } .auf5 { background: #ffd6a5; }
.auf6 { background: #a9def9; } .auf7 { background: #e4c1f9; }
.position .haken { font-size: 30px; color: var(--gruen); }
.position.erledigt { background: #e9f3e9; border-color: var(--gruen); opacity: .7; }
.position.erledigt .name { text-decoration: line-through; }
.weg-ende { font-weight: 700; text-align: center; }

/* Fehlmenge und Kommentar */
.position-block { margin-bottom: 10px; }
.position-block .position { margin-bottom: 0; }
.fehlt-hinweis { color: var(--rot); font-weight: 600; font-size: 14px; }
.fehlt-box summary { color: var(--leise); font-size: 14px; padding: 6px 2px; cursor: pointer; }
.fehlt-form { margin-top: 6px; align-items: end; }
.fehlt-form input[type=number] { width: 90px; }
.kommentar { display: inline-block; background: #fff6dc; border: 1px solid var(--gelb); border-radius: 6px;
  padding: 0 7px; font-size: 14px; cursor: pointer; }
.kommentar .text { display: none; }
.kommentar.offen { display: block; margin-top: 4px; }
.kommentar.offen .text { display: block; font-weight: 600; margin-top: 2px; }
.wunsch { display: inline-block; background: #eef; border: 1px solid #99c; border-radius: 6px;
  padding: 0 7px; font-size: 14px; white-space: nowrap; }
.wunsch.faellig { background: #fde2e0; border-color: var(--rot); color: var(--rot); font-weight: 600; }
.warnung { display: inline-block; background: #fde2e0; border-radius: 6px; padding: 0 6px;
  font-size: 13px; color: var(--rot); font-weight: 600; }

.uebersicht { background: var(--anthrazit); color: #fff; border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; }
.uebersicht b { font-size: 19px; }
.gewaehlt-anzeige { margin-top: 4px; font-size: 15px; color: var(--gelb); font-weight: 700; }
.kartons-gesamt { margin-top: 6px; font-size: 15px; }
.kartons-gesamt span { color: #cfcfcc; }
.vorschlag-knopf { margin-top: 12px; background: var(--gelb); border-color: var(--gelb); color: #222; font-weight: 700; }
.spaeter-box { margin-top: 10px; }
.spaeter-box > summary { cursor: pointer; padding: 12px; border-top: 2px solid var(--rand);
  color: var(--leise); font-weight: 700; list-style: none; }
.spaeter-box > summary::-webkit-details-marker { display: none; }
.spaeter-box > summary::before { content: "▸ "; }
.spaeter-box[open] > summary::before { content: "▾ "; }
.kommentar-text { background: #fff6dc; border-left: 5px solid var(--gelb); padding: 10px 12px; border-radius: 6px; margin: 6px 0; }
.notiz-text { background: #eef3ff; border-left: 5px solid #5b7cc0; padding: 10px 12px; border-radius: 6px; margin: 6px 0; }

/* Kundenkommentar + interne Notiz zu Beginn der Pickrunde */
.start-hinweis { background: #fff6dc; border-left: 5px solid var(--gelb); border-radius: 6px; padding: 8px 12px; margin: 0 0 10px; }
.start-hinweis .notiz { color: #33508c; margin-top: 4px; }

/* Restzähler je Bestellung (offene Biere), farbig, zählt beim Bestätigen runter */
.rest-zeile { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.rest { border-radius: 6px; padding: 3px 10px; font-weight: 700; font-size: 15px; color: #222; }
.rest.fertig { opacity: .5; text-decoration: line-through; }

/* Lager */
.ablage { position: sticky; top: 0; z-index: 2; box-shadow: 0 2px 6px #0002; }
.ablage #frei { max-height: 26vh; overflow-y: auto; }
#suche { width: 100%; margin-bottom: 8px; }
.ziel { min-height: 46px; display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px dashed var(--rand);
  border-radius: 8px; background: var(--grund); align-content: flex-start; }
.chip { background: var(--flaeche); border: 1px solid var(--anthrazit); border-radius: 8px; padding: 6px 10px;
  font-size: 14px; cursor: grab; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.chip[hidden] { display: none; }

.reihe > *, input[type=file] { max-width: 100%; box-sizing: border-box; }
.liste { flex-direction: column; flex-wrap: nowrap; counter-reset: pos; }
.liste .chip { counter-increment: pos; }
.liste .chip::before { content: counter(pos) ". "; color: var(--leise); }
.griff { cursor: grab; font-size: 22px; padding: 6px 10px; touch-action: none; user-select: none; }
.sektor input[name=name] { flex: 1; min-width: 0; font-weight: 700; }
