/* Lager-UI: große Ziele, hoher Kontrast, eine Spalte (Memor 10/11 ≈ 360 px breit).
   Theming über Tokens: hell als Default, dunkel via prefers-color-scheme ODER [data-theme=dark]. */
:root {
  color-scheme: light dark;
  --bg: #f1f3f5;
  --surface: #ffffff;
  --hover: #e9ecef;
  --text: #212529;
  --muted: #495057;
  --rand: #ced4da;
  --header-bg: #1f2530;
  --header-text: #f4f5f7;
  --orange: #f94b0c;
  --gruen: #2b8a3e;
  --rot: #c92a2a;
  --gelb: #b66a00;
  --blau-hell: #3b5bdb;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216; --surface: #171a1f; --hover: #222831;
    --text: #e6e8ec; --muted: #9099a4; --rand: #2a2f37;
    --header-bg: #0c0e12; --header-text: #f1f3f5;
    --orange: #ff5a1f; --gruen: #5bc46a; --rot: #ff6b6b; --gelb: #e0a030; --blau-hell: #7aa2ff;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1216; --surface: #171a1f; --hover: #222831;
  --text: #e6e8ec; --muted: #9099a4; --rand: #2a2f37;
  --header-bg: #0c0e12; --header-text: #f1f3f5;
  --orange: #ff5a1f; --gruen: #5bc46a; --rot: #ff6b6b; --gelb: #e0a030; --blau-hell: #7aa2ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 18px;
  background: var(--bg);
  color: var(--text);
}
header.app {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0.6rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid var(--orange);
}
header.app a { color: #fff; text-decoration: none; font-weight: 600; }
header.app .nutzer { font-size: 0.8rem; opacity: 0.85; }
header.app .kopf-rechts { display: flex; align-items: center; gap: 0.6rem; }
.thementaste { background: transparent; border: 1px solid rgba(255,255,255,0.30); color: #fff; cursor: pointer;
  border-radius: 8px; padding: 0.3rem 0.5rem; font-size: 1rem; line-height: 1; }
main { padding: 1rem; max-width: 640px; margin: 0 auto; }
h1 { font-size: 1.3rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.1rem; margin: 1rem 0 0.5rem; }
.karte {
  background: var(--surface);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 0.9rem;
  margin-bottom: 0.75rem;
}
/* Menü-Buttons (Home) und Listeneinträge */
a.kachel, button.kachel {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--orange);
  border-radius: 12px;
  color: var(--orange);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  padding: 1.1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
}
a.kachel small { display: block; font-weight: 400; font-size: 0.85rem; color: var(--muted); }
ul.liste { list-style: none; margin: 0; padding: 0; }
ul.liste li { margin-bottom: 0.5rem; }
ul.liste a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 0.8rem;
  text-decoration: none;
  color: inherit;
}
ul.liste .titel { font-weight: 700; }
ul.liste .meta { font-size: 0.85rem; color: var(--muted); }
/* Gesperrter (fremd geclaimter) Auftrag: wie eine Listenkachel, aber inaktiv/gedimmt. */
ul.liste .liste-gesperrt {
  display: block; background: var(--surface); border: 1px solid var(--rand);
  border-radius: 10px; padding: 0.8rem; color: var(--muted); opacity: 0.8;
}
/* Formulare */
label { display: block; font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0.2rem; }
input, textarea, select {
  width: 100%;
  font-size: 1.15rem;
  padding: 0.7rem;
  border: 2px solid var(--rand);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
input:focus, textarea:focus { outline: 3px solid var(--orange); border-color: var(--orange); }
input.scan { border-color: var(--orange); font-weight: 600; }
button.primaer, button.sekundaer, button.gefahr {
  width: 100%;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0.9rem;
  margin-top: 0.9rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}
button.primaer { background: var(--gruen); color: #fff; }
button.sekundaer { background: var(--surface); color: var(--muted); border: 2px solid var(--rand); }
/* Abbruch/Gefahr: rot, damit „Stopp, nichts buchen" auf den ersten Blick eindeutig ist. */
button.gefahr { background: var(--rot); color: #fff; }
.putaway-abbruch-hinweis { font-size: 0.82rem; color: var(--muted); text-align: center; margin-top: 0.5rem; }
/* Meldungen */
.flash { border-radius: 10px; padding: 0.8rem; margin-bottom: 0.75rem; font-weight: 600;
  color: var(--c, var(--text)); background: color-mix(in srgb, var(--c, var(--muted)) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 45%, var(--surface)); }
.flash.ok { --c: var(--gruen); }
.flash.fehler { --c: var(--rot); }
/* Positions-/Bestandstabellen */
table.zeilen { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 10px; overflow: hidden; }
table.zeilen th, table.zeilen td { padding: 0.6rem 0.5rem; text-align: left; border-bottom: 1px solid var(--rand); }
table.zeilen th { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); }
/* Zeilen-Zustand: grün = exakt, orange = unter, blau = über; rejected immer rot. */
table.zeilen tr.zustand-voll td { color: var(--gruen); }
table.zeilen tr.zustand-unter td { color: var(--gelb); }
table.zeilen tr.zustand-ueber td { color: var(--blau-hell); }
table.zeilen .rejected { color: var(--rot); font-weight: 700; }
table.zeilen td.menge { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.klickbar { cursor: pointer; }
tr.klickbar:active { background: var(--hover); }
.badge { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px;
  color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, var(--muted)) 18%, var(--surface)); }
.badge.open { --c: var(--blau-hell); }
.badge.partial { --c: var(--gelb); }
.badge.complete { --c: var(--gruen); }
.badge.closed { --c: var(--muted); }
/* Auftrags-Status */
.badge.new, .badge.allocated { --c: var(--blau-hell); }
.badge.picking { --c: var(--gelb); }
.badge.picked, .badge.packed { --c: var(--gruen); }
.badge.shipped, .badge.cancelled { --c: var(--muted); }
.badge.short { --c: var(--rot); }
.produktkopf { font-size: 1.15rem; font-weight: 700; }
.produktkopf small { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 400; }

/* Einlagern: Bild + Text (Box-Inhaltsliste + Positions-Kopf). Bild ist per Lightbox klickbar (.bild-galerie). */
.pa-pos-kopf { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.2rem; }
.pa-zeile { display: flex; gap: 0.55rem; align-items: center; }
.pa-zeile-text { display: flex; flex-direction: column; min-width: 0; }
.pa-zeile-text small { display: block; font-size: 0.78rem; color: var(--muted); }
.pa-bild { flex-shrink: 0; width: 46px; height: 46px; border: 1px solid var(--rand); border-radius: 8px; overflow: hidden; background: rgba(127, 127, 127, 0.12); display: block; }
.pa-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pa-pos-kopf .pa-bild { width: 60px; height: 60px; }

/* ===================== Geführter Pick-Schritt (ein Artikel auf einmal) ===================== */
.pick-fortschritt { margin-bottom: 0.7rem; }
.pick-bar { height: 7px; background: var(--rand); border-radius: 5px; overflow: hidden; margin-bottom: 0.35rem; }
.pick-bar-fill { height: 100%; background: var(--orange); border-radius: 5px; transition: width 0.2s; }
.pick-step .pick-bild {
  width: 100%; min-height: 120px; max-height: 30vh; display: flex; align-items: center; justify-content: center;
  background: rgba(127, 127, 127, 0.12); border-radius: 12px; overflow: hidden; margin-bottom: 0.5rem;
}
.pick-step .pick-bild img { max-width: 100%; max-height: 30vh; object-fit: contain; display: block; }
.pick-bild-leer { color: var(--muted); font-size: 0.85rem; padding: 1.5rem; }
.pick-anweisung { font-size: 1.05rem; margin: 0.4rem 0 0.8rem; }
.pick-anweisung strong { color: var(--orange); }

/* Geführter Pick-Schritt blendet den App-Header aus → mehr Platz, kein Scrollen. */
body.chrome-hidden header.app { display: none; }

/* Anweisungs-Checkliste (① Lagerplatz → ② Produkt scannen) — kein Eingabefeld, nur validieren. */
.pick-anweisung-liste { list-style: none; padding: 0; margin: 0.4rem 0 0.7rem; display: flex; flex-direction: column; gap: 0.4rem; }
.pick-anweisung-liste li { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.7rem; border: 2px solid var(--rand); border-radius: 10px; font-size: 1.05rem; }
.pick-anweisung-liste li.aktiv { border-color: var(--orange); background: rgba(249, 75, 12, 0.08); font-weight: 600; }
.pick-anweisung-liste li.ok { border-color: var(--gruen); color: var(--gruen); }
.pick-anweisung-liste strong { color: var(--orange); }
.pick-anweisung-liste li.ok strong { color: var(--gruen); }
.anw-haken { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--rand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.pick-anweisung-liste li.aktiv .anw-haken { border-color: var(--orange); }
.pick-anweisung-liste li.ok .anw-haken { border-color: var(--gruen); background: var(--gruen); color: #fff; }
.pick-anweisung-liste li.ok .anw-haken::after { content: "✓"; }
.anw-count { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--orange); }
.pick-anweisung-liste li.ok .anw-count { color: var(--gruen); }
.pick-fehler { background: var(--rot); color: #fff; border-radius: 9px; padding: 0.55rem 0.7rem; font-weight: 600; margin-bottom: 0.5rem; }

/* Sicherheits-Abfrage bei „Weiter (ohne Scan)". */
.pick-confirm { border: none; border-radius: 14px; padding: 1.1rem; background: var(--surface); color: var(--text); max-width: 90vw; width: 22rem; box-shadow: 0 12px 48px rgba(0,0,0,0.35); }
.pick-confirm::backdrop { background: rgba(0,0,0,0.5); }
.pick-confirm p { margin: 0 0 1rem; font-size: 1.05rem; }
.pick-confirm .pick-confirm-aktionen { display: flex; gap: 0.6rem; }
.pick-confirm button { flex: 1; }
/* Pack: Gewicht + Waage-Knopf in einer Zeile. */
.pk-weight-zeile { display: flex; gap: 0.5rem; align-items: stretch; }
.pk-weight-zeile input { flex: 1; }
.pk-weight-zeile #pk-weigh { width: auto; white-space: nowrap; padding-left: 0.9rem; padding-right: 0.9rem; }
.pk-weigh-status { display: block; margin-top: 0.3rem; }

/* Pack-Check (read-only Soll-Inhalt nach Tote-Scan): kleine Bilder, Klick → groß (lightbox.js). */
.pack-check-bild { width: 60px; }
.pack-check-bild img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rand); display: block; }
.pack-check-leer { color: var(--muted); }
.fertig-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.fertig-links .kachel { flex: 1; text-align: center; min-width: 8rem; }
.pick-rest { margin: 0.7rem 0; }
.pick-rest summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; padding: 0.3rem 0; }
table.zeilen tr.aktiv td { color: var(--orange); font-weight: 700; }
table.zeilen tr.klickbar { cursor: pointer; }

/* HTMX-Ladeindikator */
.htmx-request { opacity: 0.6; }

/* ===================== Scan-Feld-Erweiterung (Kamera / Suche / Tippen) =====================
   JS (scanfield.js) hängt an jedes .scan-Feld eine Tastenreihe; auf dem Memor ungenutzt,
   auf dem Handy der Weg ohne Hardware-Wedge. */
.scanfeld { position: relative; }
/* Strich-Icons rechts IM Eingabefeld (vertikal zentriert; bei Textarea oben angedockt). */
.scanfeld-icons {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 2px;
}
.scanfeld.mehrzeilig .scanfeld-icons { top: 8px; transform: none; }
.scanfeld-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  border-radius: 8px; -webkit-tap-highlight-color: transparent;
}
.scanfeld-icon svg { width: 22px; height: 22px; display: block; }
.scanfeld-icon:active { background: var(--hover); }
.scanfeld-icon.kamera { color: var(--orange); }       /* Kamera = primäre Aktion, Grexon-Orange */
.scanfeld-icon.tippen.aktiv { color: var(--gruen); }

/* --- Suche-Overlay (zentrierte Karte auf abgedunkeltem Grund). Das Kamera-Overlay (.scan-cam-*)
   liegt in camera.css, da es auch der Desk lädt; die Close-Taste .scan-cam-x kommt von dort. --- */
.scan-such { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: flex-start; justify-content: center; background: rgba(0,0,0,0.5); padding: 1rem; }
.scan-such[hidden] { display: none; }
.scan-such-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1rem; font-weight: 700; border-bottom: 1px solid var(--rand);
}
.scan-such-karte {
  background: var(--surface); color: var(--text);
  width: 100%; max-width: 520px; margin-top: 6vh;
  border: 1px solid var(--rand); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; max-height: 84vh;
}
.scan-such-feld { margin: 0.8rem; width: auto; }
.scan-such-treffer { overflow-y: auto; padding: 0 0.8rem 0.8rem; }
.scan-such-treffer-btn {
  display: flex; flex-direction: column; gap: 0.15rem; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--rand); border-radius: 10px;
  padding: 0.7rem 0.8rem; margin-bottom: 0.5rem; cursor: pointer; color: inherit;
}
.scan-such-treffer-btn:active { background: var(--hover); }
/* Tastatur-Auswahl (↑/↓): deutlicher als :hover, Grexon-Orange-Akzent. */
.scan-such-treffer-btn.active { background: var(--hover); border-color: var(--orange); box-shadow: inset 3px 0 0 var(--orange); }
.scan-such-treffer-btn .haupt { font-weight: 700; font-size: 1.05rem; }
.scan-such-treffer-btn .sub { font-size: 0.8rem; color: var(--muted); }
.scan-such-leer { color: var(--muted); padding: 0.8rem; text-align: center; }

/* ===================== Annahme-Maske: Gruppen (grün/rot) + Mengen-Stepper ===================== */
.annahme-gruppe {
  border: 1px solid var(--rand); border-left: 5px solid var(--c, var(--rand)); border-radius: 10px;
  padding: 0.55rem 0.8rem 0.85rem; margin: 0.7rem 0;
  background: color-mix(in srgb, var(--c, var(--muted)) 7%, var(--surface));
}
.annahme-gut { --c: var(--gruen); }
.annahme-schlecht { --c: var(--rot); }
.gruppe-titel { font-weight: 800; color: var(--c); margin-bottom: 0.1rem; }
.menge-stepper { display: flex; align-items: stretch; gap: 0.5rem; }
.menge-stepper input { flex: 1; text-align: center; font-weight: 700; }
.stepper {
  flex: 0 0 3.2rem; font-size: 1.6rem; font-weight: 700; line-height: 1;
  border: 2px solid var(--rand); border-radius: 10px; background: var(--surface); color: var(--text);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.stepper:active { background: var(--hover); }

/* Bestätigungs-Dialog (Annahme abschließen u. a.) — ersetzt natives confirm() */
dialog.dialog {
  border: none; border-radius: 14px; padding: 1.1rem; width: 22rem; max-width: 90vw;
  background: var(--surface); color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
dialog.dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog.dialog p { margin: 0 0 1rem; font-size: 1.05rem; font-weight: 600; }
.dialog-tasten { display: flex; gap: 0.6rem; }
.dialog-tasten button {
  flex: 1; font-size: 1.05rem; font-weight: 700; padding: 0.7rem; border-radius: 10px; border: none; cursor: pointer;
}
.dialog-tasten .primaer { background: var(--gruen); color: #fff; }
.dialog-tasten .sekundaer { background: var(--surface); color: var(--muted); border: 2px solid var(--rand); }

/* ===================== Off-Canvas-Navigation (Drawer, ☰) ===================== */
header.app .kopf-links { display: flex; align-items: center; gap: 0.5rem; }
header.app a.marke { color: #fff; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; }
.menue-taste {
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.30); color: #fff; cursor: pointer;
  border-radius: 8px; padding: 0.2rem 0.55rem; font-size: 1.3rem; line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
/* Während einer laufenden Operation: das große ☰-Menü ausblenden (kein versehentliches
   Wegnavigieren). Das Logo bleibt bewusst ein funktionierender Heim-Link — alle Buchungen
   sind persist-as-you-go, ein Verlassen verliert nichts, und ohne Logo wäre der Werker
   ganz ohne Ausweg gefangen (z. B. im Versand-Schritt ohne Abbrechen-Taste). */
body.op-active .menue-taste { display: none; }
/* Schnellzugriff „Scannen" im Header (viel genutzt) — orange, damit er als Primär-Aktion auffällt.
   Wie das ☰ bei laufender Operation ausgeblendet (kein Wegnavigieren mitten im Pick/Pack). */
.scan-taste { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--orange); color: #fff;
  border: none; border-radius: 8px; padding: 0.4rem 0.7rem; font-weight: 700; font-size: 0.95rem; line-height: 1;
  white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.scan-taste .ic { width: 18px; height: 18px; }
.scan-taste:active { opacity: 0.85; }
.scan-taste.aktiv { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
body.op-active .scan-taste { display: none; }
/* Sehr schmale Geräte: Label ausblenden, Icon bleibt (der Scan-Button hat Vorrang vor dem Namen). */
@media (max-width: 380px) {
  .scan-taste-text { display: none; }
  header.app .nutzer { display: none; }
}

.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 1000;
}
body.drawer-auf .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 300px; max-width: 85vw;
  background: var(--surface); color: var(--text); z-index: 1001;
  border-right: 2px solid var(--orange); box-shadow: 2px 0 18px rgba(0, 0, 0, 0.28);
  /* visibility:hidden nimmt den geschlossenen Drawer aus der Tab-Reihenfolge (sonst
     fokussierbare Links hinter aria-hidden) — verzögert via transition, damit die
     Slide-out-Animation noch läuft; beim Öffnen schaltet sie sofort auf sichtbar. */
  visibility: hidden;
  transform: translateX(-100%); transition: transform 0.22s ease, visibility 0.22s ease;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
body.drawer-auf .drawer { transform: translateX(0); visibility: visible; }
.drawer-kopf {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--rand);
  background: var(--header-bg); color: var(--header-text);
}
.drawer-titel { font-weight: 700; }
.drawer-zu {
  background: transparent; border: none; color: var(--header-text); font-size: 1.3rem; line-height: 1;
  cursor: pointer; padding: 0.1rem 0.4rem; -webkit-tap-highlight-color: transparent;
}
.drawer-baum { list-style: none; margin: 0; padding: 0.3rem 0 1rem; }
.drawer-baum > li { margin: 0; }
.drawer-top, .drawer-sub, .drawer-baum summary {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1rem; text-decoration: none; color: var(--text);
}
.drawer-top { font-weight: 600; cursor: pointer; }
/* Abmelden ganz unten im Drawer — rot, volle Breite (Touch-Ziel) */
.drawer-abmelden { margin-top: 1.2rem; border-top: 1px solid var(--rand); padding-top: 0.6rem; }
.drawer-abmelden form { margin: 0; }
button.drawer-logout { width: 100%; text-align: left; background: transparent; border: none; font: inherit; color: var(--rot); display: flex; align-items: center; gap: 0.55rem; }
button.drawer-logout:active { opacity: 0.7; }
/* Sprachwahl im Drawer (Flaggen wie am Desk) — von überall im Scanner erreichbar */
.drawer-sprache { padding: 0.85rem 1rem 0.2rem; }
.drawer-sprache-titel { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--muted); font-size: 0.85rem; }
.drawer-flaggen { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.55rem; }
.drawer-flaggen form { margin: 0; }
.drawer-flagge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.7rem; border-radius: 999px;
  border: 2px solid var(--rand); background: var(--surface); color: var(--text); font: inherit; font-size: 0.92rem; cursor: pointer; }
.drawer-flagge img { width: 22px; height: 16px; border-radius: 3px; display: block; }
.drawer-flagge.aktiv { border-color: var(--orange); color: var(--orange); font-weight: 700; }
.drawer-flagge:active { background: var(--hover); }
.drawer-baum summary {
  font-weight: 600; cursor: pointer; list-style: none; justify-content: space-between;
  -webkit-tap-highlight-color: transparent;
}
.drawer-baum summary::-webkit-details-marker { display: none; }
.drawer-baum a:active, a.drawer-top:active, .drawer-baum summary:active { background: var(--hover); }
.drawer-sub { padding-left: 2.3rem; font-size: 0.95rem; }
.drawer-baum .pfeil { font-size: 0.7rem; color: var(--muted); transition: transform 0.15s ease; }
.drawer-baum details[open] > summary .pfeil { transform: rotate(90deg); }
/* Line-Icons (icons-Tag): in Flex nicht stauchen; Drawer-Größe; pfeil rechts halten */
.ic { flex: none; vertical-align: -0.14em; }
.drawer-baum .ic { width: 20px; height: 20px; }
.drawer-baum summary { justify-content: flex-start; }
.drawer-baum summary .pfeil { margin-left: auto; }
.thementaste { display: inline-flex; align-items: center; }
.thementaste .ic { display: block; width: 17px; height: 17px; }
.thementaste .ic-sun { display: none; }
:root[data-theme="dark"] .thementaste .ic-moon { display: none; }
:root[data-theme="dark"] .thementaste .ic-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .thementaste .ic-moon { display: none; }
  :root:not([data-theme="light"]) .thementaste .ic-sun { display: block; }
}
.drawer-baum .aktiv { color: var(--orange); font-weight: 700; box-shadow: inset 4px 0 0 var(--orange); }
.drawer-baum .soon { color: var(--muted); cursor: default; opacity: 0.75; }
.soon-badge {
  margin-left: auto; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  background: color-mix(in srgb, var(--muted) 22%, var(--surface)); color: var(--muted);
  border-radius: 999px; padding: 0.12rem 0.5rem;
}

/* ===================== Dashboard (Statistik-Kacheln) ===================== */
.dash { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; margin-bottom: 1rem; }
.dash-kachel {
  display: flex; flex-direction: column; gap: 0.15rem;
  background: var(--surface); border: 1px solid var(--rand); border-left: 5px solid var(--c, var(--orange));
  border-radius: 12px; padding: 0.9rem; text-decoration: none; color: inherit;
}
a.dash-kachel:active { background: var(--hover); }       /* Press-Feedback nur für klickbare Kacheln */
.dash-kachel.info { cursor: default; }                   /* Info-Kachel (z. B. Retouren): nur Zahl, kein Link */
.dash-zahl { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--c, var(--orange)); font-variant-numeric: tabular-nums; }
.dash-titel { font-weight: 700; font-size: 0.95rem; }
.dash-sub { font-size: 0.78rem; color: var(--muted); }
.dash-kachel.k-recv { --c: var(--blau-hell); }
.dash-kachel.k-put { --c: var(--gelb); }
.dash-kachel.k-pick { --c: var(--orange); }
.dash-kachel.k-pack { --c: var(--gruen); }
.dash-kachel.k-ret { --c: var(--rot); }
/* Arbeitsplatz-Wahl-Gate: Buttons untereinander (Tap-Fallback zum Scan) */
.ws-wahl { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.4rem; }
.ws-wahl form { margin: 0; }
.ws-wahl .kachel { width: 100%; }

/* ===================== Scannen-Universalseite (P3) ===================== */
.scan-suche input { width: 100%; box-sizing: border-box; padding: 0.7rem 0.8rem; font-size: 1rem;
  border: 2px solid var(--orange); border-radius: 10px; background: var(--surface); color: var(--text);
  margin-bottom: 0.6rem; }
.scan-karte { display: flex; flex-direction: column; gap: 0.5rem; }
.scan-kopf { display: flex; flex-direction: column; gap: 0.1rem; }
.scan-code { font-size: 1.3rem; }
.scan-warnflag { color: var(--rot); font-weight: 700; }
.scan-produkt { display: flex; align-items: center; gap: 0.7rem; }
.scan-produkt-bild { display: block; flex: 0 0 auto; }
.scan-produkt-bild img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--rand); display: block; }
.scan-produkt-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }

/* Location-/Produkt-Inhalt als Karten-Liste (statt Tabelle → kein horizontales Überlaufen
   in der schmalen Scanner-Ansicht). Bild ist per Lightbox klickbar (.bild-galerie). */
.scan-inhalt { display: flex; flex-direction: column; gap: 0.4rem; }
.scan-line { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem;
  border: 1px solid var(--rand); border-radius: 10px; background: var(--bg, transparent); }
.scan-line-bild { flex: 0 0 auto; }
.scan-line-bild-leer { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.scan-line-bild-leer .ic { width: 22px; height: 22px; }
.scan-line-text { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; flex: 1 1 auto; }
.scan-line-text strong { font-size: 1rem; }
.scan-line-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-line-menge { flex: 0 0 auto; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scan-line-summe { border: none; padding-top: 0.2rem; font-weight: 700; }
.scan-line-summe span:first-child { flex: 1 1 auto; color: var(--muted); text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.03em; }
.scan-hilfe { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.scan-hilfe li { display: flex; flex-direction: column; gap: 0.1rem; }
.scan-hilfe li strong { color: var(--orange); }
.scan-hilfe li span { color: var(--muted); font-size: 0.9rem; }

/* ===================== Transfer (mehrzeiliges Umlagern) ===================== */
.transfer-kopf { flex-direction: row; align-items: center; justify-content: space-between; gap: 0.6rem; }
.transfer-kopf-info { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.transfer-alles { width: auto; margin-top: 0; white-space: nowrap; flex: 0 0 auto; padding: 0.6rem 0.9rem; font-size: 1rem; }
.transfer-ziel-label { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; margin: 0.2rem 0 0.3rem; }
#transfer-ziel { width: 100%; box-sizing: border-box; padding: 0.75rem 0.8rem; font-size: 1.05rem;
  border: 2px solid var(--orange); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 600; }
#transfer-ziel.erkannt { border-color: var(--gruen); }
.transfer-zeilen { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.7rem 0; }
.transfer-card { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem;
  border: 1px solid var(--rand); border-radius: 12px; background: var(--surface); }
.transfer-card.markiert { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.transfer-card.gesperrt { opacity: 0.7; }
.transfer-bild { flex: 0 0 auto; }
.transfer-bild-leer { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.transfer-card-text { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; flex: 1 1 auto; }
.transfer-card-text strong { font-size: 1rem; }
.transfer-card-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-vorrat { color: var(--orange) !important; font-weight: 600; }
.transfer-card-menge { flex: 0 0 auto; display: flex; align-items: center; gap: 0.35rem; }
.transfer-qty { width: 3.6rem; box-sizing: border-box; padding: 0.55rem 0.4rem; text-align: center;
  font-size: 1.15rem; font-weight: 700; border: 2px solid var(--orange); border-radius: 9px;
  background: var(--surface); color: var(--text); -moz-appearance: textfield; }
.transfer-qty::-webkit-outer-spin-button, .transfer-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.transfer-max { background: transparent; border: 2px solid var(--rand); color: var(--muted);
  border-radius: 9px; padding: 0.5rem 0.55rem; font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.transfer-max:active { background: var(--hover); }
.transfer-abbruch { display: block; text-align: center; text-decoration: none; }

/* ===================== Foto / Anhang (Kamera-Beleg an Anlieferung) ===================== */
.hinweis { color: var(--muted); font-size: 0.9rem; margin: 0.3rem 0 0.7rem; }
.attach-suche input { width: 100%; box-sizing: border-box; padding: 0.7rem 0.8rem; font-size: 1rem;
  border: 2px solid var(--orange); border-radius: 10px; background: var(--surface); color: var(--text); margin-bottom: 0.6rem; }
.attach-po-liste { display: flex; flex-direction: column; gap: 0.5rem; }
a.kachel.attach-po { text-align: left; padding: 0.8rem 1rem; font-size: 1rem; }
.attach-po strong { display: block; font-size: 1.05rem; }
.attach-po small { color: var(--muted); font-weight: 400; }
.attach-kopf { display: flex; flex-direction: column; gap: 0.1rem; }
.attach-kopf small { color: var(--muted); }
.attach-scan-msg { background: color-mix(in srgb, var(--rot) 14%, var(--surface)); color: var(--rot);
  border: 1px solid color-mix(in srgb, var(--rot) 35%, var(--surface)); border-radius: 8px;
  padding: 0.5rem 0.7rem; margin: 0.3rem 0 0.6rem; font-weight: 600; }
/* ---- Entlade-Video (Pflicht-Aufnahme nach dem Abladen) ---- */
.vid-karte { display: flex; flex-direction: column; gap: 0.4rem; }
.vid-karte.pflicht { border: 2px solid var(--rot); }
.vid-titel { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 1.02rem; }
.vid-karte.pflicht .vid-titel { color: var(--rot); }
.vid-titel.ok { color: var(--gruen); }
.vid-start { width: 100%; }
.vid-upload { display: flex; flex-direction: column; gap: 0.3rem; }
/* [hidden] muss display:flex schlagen — sonst steht der Upload-Balken dauerhaft da. */
.vid-upload[hidden] { display: none !important; }
.vid-upload-zeile { display: flex; align-items: center; gap: 0.5rem; }
.vid-upload progress { flex: 1; height: 14px; }
.vid-overlay { position: fixed; inset: 0; z-index: 1200; background: #000; display: flex;
  flex-direction: column; }
.vid-overlay[hidden] { display: none; }
.vid-overlay video { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #000; }
.vid-rec-status { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center;
  gap: 0.4rem; padding: 0.25rem 0.6rem; border-radius: 999px; background: rgba(0,0,0,0.55);
  color: #fff; font-weight: 700; }
.vid-dot { width: 10px; height: 10px; border-radius: 50%; background: #f43;
  animation: vid-blink 1s steps(2, start) infinite; }
@keyframes vid-blink { to { visibility: hidden; } }
.vid-torch { position: absolute; top: 12px; right: 12px; padding: 0.5rem 0.9rem; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.4); background: rgba(0,0,0,0.55); color: #fff; font-weight: 700;
  font-size: 0.95rem; cursor: pointer; }
.vid-torch.an { background: var(--orange); border-color: var(--orange); }
.vid-controls { display: flex; gap: 0.5rem; padding: 0.7rem; background: #111; }
.vid-controls .kachel, .vid-controls .sekundaer { flex: 1; margin: 0; }
.vid-controls .vid-stop { background: var(--rot); border-color: var(--rot); color: #fff; }
.attach-barcode { color: var(--muted); letter-spacing: 0.03em; }
/* Positionswahl: „Ganze Anlieferung"-Kachel + Tabelle (Thumbnail | SKU | Anhang-Zähler). */
a.kachel.attach-ganze { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.6rem; }
.attach-ganze-badges { display: inline-flex; align-items: center; gap: 0.4rem; }
.vid-fehlt-badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.55rem;
  border-radius: 999px; background: var(--rot); color: #fff; font-size: 0.85rem; font-weight: 700; }
.attach-ganze strong { display: flex; align-items: center; gap: 0.45rem; }
.attach-tabelle td { vertical-align: middle; }
.attach-tabelle .attach-name { color: var(--muted); font-weight: 400; }
.attach-zahl-zelle { text-align: right; width: 3.6rem; }
.attach-zahl { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.5rem;
  border: 1px solid var(--rand); border-radius: 999px; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
/* Foto-Seite: Kopf der gewählten Position. */
.attach-pos { display: flex; align-items: center; gap: 0.7rem; margin: 0.5rem 0 0.7rem; }
.attach-pos-bild { display: block; flex: 0 0 auto; }
.attach-pos-bild img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rand); display: block; }
.attach-pos-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.attach-pos-text small { color: var(--muted); }
.attach-shoot { margin-bottom: 0.5rem; }
.attach-datei-btn { display: block; width: 100%; margin-bottom: 0.8rem; }
a.sekundaer.attach-fertig { display: block; text-align: center; margin-top: 0.8rem; text-decoration: none; }
.attach-strip { margin: 0.4rem 0; }
.attach-galerie { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.attach-item { position: relative; }
.attach-thumb { display: block; width: 84px; height: 84px; border: 1px solid var(--rand); border-radius: 10px;
  overflow: hidden; background: rgba(127, 127, 127, 0.12); }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-datei-chip { display: flex; align-items: center; justify-content: center; width: 84px; height: 84px;
  border: 1px solid var(--rand); border-radius: 10px; background: rgba(127, 127, 127, 0.12); color: var(--muted); }
.attach-line-badge { position: absolute; bottom: 2px; left: 2px; padding: 0.05rem 0.35rem; border-radius: 6px;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 10px; font-weight: 700; max-width: 78px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-note { display: block; max-width: 84px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--muted); font-size: 11px; margin-top: 2px; }
#attach-note { width: 100%; box-sizing: border-box; padding: 0.6rem 0.7rem; font-size: 0.95rem;
  border: 1px solid var(--rand); border-radius: 9px; background: var(--surface); color: var(--text);
  margin-bottom: 0.5rem; }
.attach-del { position: absolute; top: -7px; right: -7px; margin: 0; }
.attach-x { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid var(--rand);
  background: var(--surface); color: var(--muted); font-size: 13px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }

/* Badge-Login-Hero (Anmeldeseite im Lager-Netz): kein Eingabefeld — großes QR-Symbol als
   Scan-Aufforderung, der globale Wedge-Fänger übernimmt. Toggle darunter öffnet Name/Passwort. */
.badge-hero { text-align: center; padding: 1.6rem 1rem 1.2rem; }
.badge-hero-ic { font-size: 92px; display: block; margin: 0 auto 0.6rem; stroke-width: 1.5; color: var(--orange); }
.badge-hero-titel { font-size: 1.15rem; font-weight: 700; margin: 0 0 0.3rem; }
.badge-hero-hinweis { color: var(--muted); margin: 0 0 1.1rem; }
.badge-cam-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  margin: 0.5rem auto 0; padding: 0.7rem 1.1rem; font-size: 1rem; }
.badge-hero-toggle { background: none; border: none; padding: 0.55rem 0.4rem; cursor: pointer;
  color: var(--muted); text-decoration: underline; font-size: 0.95rem; }
/* Desk-Login: Passwort-Formular (links) und Badge-Scan-Hinweis (rechts) nebeneinander;
   auf schmalen Screens (Memor-Fallback ohne next) stapeln die Spalten. */
.login-split { display: flex; gap: 1rem; align-items: stretch; }
.login-split > form.karte { flex: 1 1 0; margin: 0; }
.login-split > .badge-side { flex: 1 1 0; margin: 0; border-left: 3px solid var(--orange); }
.login-split .badge-hero-ic { font-size: 72px; }
@media (max-width: 700px) { .login-split { flex-direction: column; } }
.login-split > .login-links { flex: 1 1 0; display: flex; flex-direction: column; }
.login-split > .login-links > .karte { flex: 1; margin: 0; }
.pw-launch-btn { font-size: 1rem; padding: 0.7rem 1.2rem; }

/* Aufwand / Timer (Billing B1.5) */
.effort-titel { font-size: 1.05rem; margin: 1.1rem 0 0.2rem; }
button.kachel.effort-item { width: 100%; text-align: left; padding: 0.8rem 1rem; font-size: 1rem; }
button.kachel.effort-item small { display: block; font-weight: 400; font-size: 0.85rem; color: var(--muted); }
form.karte.effort-direkt { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.9rem; }
.effort-direkt .effort-direkt-name { flex: 1; min-width: 0; }
.effort-direkt .effort-direkt-name small { display: block; color: var(--muted); font-size: 0.85rem; }
.effort-direkt input[name="quantity"] { width: 4.5rem; font-size: 1.1rem; padding: 0.5rem 0.3rem; text-align: center; }
.effort-lauf { text-align: center; padding: 1.2rem 1rem; }
.effort-lauf small { display: block; color: var(--muted); margin-top: 0.2rem; }
.effort-zeit { font-size: 3rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
button.effort-stop { width: 100%; font-size: 1.2rem; padding: 1rem; margin: 0.9rem 0 0.6rem; }
button.effort-verwerfen { width: 100%; }
