/* ===========================================================================
   projekt.css – coatdepot
   Wird als letzte Datei geladen. Nur Variablen der Farbwelt verwenden, keine
   festen Farben: sonst bricht ein Baustein beim Wechsel der Farbwelt.
   ========================================================================= */

/* Das hidden-Attribut muss immer gewinnen. Bausteine wie .hinweis oder
   .knopf setzen selbst ein display und würden versteckte Elemente sonst
   sichtbar machen (leere Meldungskästen, Kamera-Knöpfe ohne Kamera). */
[hidden] { display: none !important; }

/* --- Grundabstände im Inhalt ------------------------------------------- */
.inhalt { padding: 18px 18px 30px; max-width: 1400px; }
.inhalt > h1, .seitenkopf h1 { margin-bottom: 12px; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.seitenkopf .uz a { color: inherit; }
.abstand-oben { margin-top: var(--luft); }
.abstand-unten { margin-bottom: calc(var(--luft) * .8); }
.rechts, table.liste th.rechts, table.liste td.rechts { text-align: right; }
.nowrap { white-space: nowrap; }
.klein-text { font-size: .85rem; }
.text-warn { color: var(--warn); }
.text-fehler { color: var(--fehler); display: block; }
.bemerkung { white-space: normal; background: var(--flaeche2); border-left: 3px solid var(--rand); padding: 8px 12px; margin-top: 12px; }

/* --- Seitenleiste: Logo zweizeilig, Konto unten ------------------------- */
/* Nur am Desktop als Spalte: konsole.css blendet die Seitenleiste bis 860 px
   aus, ein display hier ohne Medienabfrage würde das überschreiben. */
@media (min-width: 860.02px) { .nav-seitlich { display: flex; flex-direction: column; } }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.logo-text small { font-weight: 400; font-size: .72rem; color: var(--dunkel-schwach); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-konto { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--dunkel-flaeche); }
.nav-konto__name { display: flex; flex-direction: column; line-height: 1.2; }
.nav-konto__name small { font-size: .72rem; opacity: .8; }
.nav-abmelden {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 15px; min-height: 44px; border: 0; border-left: 3px solid transparent;
  background: none; color: var(--dunkel-schwach); font: inherit; font-size: .87rem; cursor: pointer; text-align: left;
}
.nav-abmelden:hover { color: var(--dunkel-text); }
.nav-abmelden svg { width: 17px; height: 17px; }

/* --- Kopfzeile: Scanfeld ------------------------------------------------ */
.kopf-scan { display: flex; gap: 8px; flex: 1; max-width: 520px; }
.kopf-scan input { flex: 1; min-width: 0; background: var(--flaeche2); }

/* --- Tab-Leiste: fest unten. Die Konsole blendet die Seitenleiste schon
       ab 860 px aus, die Tab-Leiste muss deshalb bis 860 px sichtbar sein
       (nicht nur bis 640 px wie .nur-mobil), sonst gibt es dazwischen gar
       kein Menü. ----------------------------------------------------------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; }
.tabbar span { line-height: 1; }
@media (min-width: 860.02px) { .tabbar { display: none; } }
@media (max-width: 860px) {
  .inhalt { padding: 14px 12px 88px; }
  .konsole__kopf { padding: 9px 12px; }
}

/* --- Seiten ohne Menü (Login, Installer) -------------------------------- */
.ohne-menue main.einfach { max-width: 460px; margin: 0 auto; padding: 36px 16px 40px; }
.ohne-menue main.installer { max-width: 720px; }
.login-marke { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-marke b { font-size: 1.35rem; font-family: var(--schrift-titel); }
.login-marke small { color: var(--schwach); margin-left: auto; text-align: right; }
.login-marke .zeichen, .nav-seitlich__logo .zeichen {
  width: 34px; height: 34px; border-radius: var(--radius); flex: none;
  background: var(--akzent); color: var(--akzent-text); display: grid; place-items: center; font-weight: 700;
}
.nav-seitlich__logo .zeichen { width: 28px; height: 28px; }
.login-rahmen .karte h1 { font-size: 1.35rem; }
.sprachwahl { display: flex; gap: 14px; justify-content: center; margin-top: 10px; }
.sprachwahl a { text-decoration: none; color: var(--schwach); padding: 8px; }
.sprachwahl a[aria-current] { color: var(--text); font-weight: 700; }

/* --- Raster ------------------------------------------------------------ */
.raster-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--luft); align-items: start; }
.raster-artikel { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: var(--luft); align-items: start; }
/* Gebinde brauchen die volle Breite (viele Spalten); auf dem Handy stehen
   sie direkt unter dem Bestand, vor den Bewegungen. */
.raster-artikel > .gebinde-karte { grid-column: 1 / -1; }
.raster-artikel > .karte { margin-bottom: 0; }
@media (max-width: 1100px) { .raster-artikel > .gebinde-karte { order: 2; } .raster-artikel > .bewegungen-karte { order: 3; } }
.formular-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--luft); align-items: start; }
.formular-raster .formular-fuss { grid-column: 1 / -1; }
.einfach-formular { max-width: 640px; }
@media (max-width: 1100px) {
  .raster-2, .raster-artikel, .formular-raster { grid-template-columns: minmax(0, 1fr); }
}
.feld-reihe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 480px) { .feld-reihe { grid-template-columns: minmax(0, 1fr); } }

/* --- Karten ------------------------------------------------------------ */
.karte__kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.karte__kopf h2 { margin: 0; }
.karte--tabelle { padding: 0; overflow-x: auto; }
.karte--tabelle > .karte__kopf { padding: 14px 16px 0; }
.karte--tabelle > .leer { padding: 28px 16px; }
@media (max-width: 640px) {
  .karte--tabelle { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .karte--tabelle > .karte__kopf { padding: 0 0 6px; }
}

/* --- Kennzahlen -------------------------------------------------------- */
.kennzahlen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: var(--luft); }
.kennzahlen .kachel { background: var(--flaeche); border-color: var(--rand); }
.kachel--link { text-decoration: none; color: inherit; display: block; }
.kachel--link:hover { border-color: var(--akzent); }
.wert--warn { color: var(--warn); }
.wert--fehler { color: var(--fehler); }
@media (max-width: 860px) { .kennzahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kennzahlen .kachel__wert { font-size: 1.4rem; } }

/* --- Schnellwahl auf dem Handy ----------------------------------------- */
.schnellwahl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: var(--luft); }
.schnellwahl__kachel {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 14px; min-height: 108px;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius-gross);
  color: var(--text); text-decoration: none;
}
.schnellwahl__kachel svg { color: var(--akzent); }
.schnellwahl__kachel small { color: var(--schwach); font-size: .8rem; line-height: 1.3; }
.schnellwahl__kachel:first-child { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
.schnellwahl__kachel:first-child svg, .schnellwahl__kachel:first-child small { color: var(--akzent-text); }

/* --- Listen ------------------------------------------------------------ */
.zeilenliste { list-style: none; margin: 0; padding: 0; }
.zeilenliste li { padding: 9px 0; border-bottom: 1px solid var(--rand-fein); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.zeilenliste li:last-child { border-bottom: 0; }
.zeilenliste li small { flex-basis: 100%; }
.zeile-still td, li.zeile-still { color: var(--schwach); }
.zeile-storniert td { color: var(--schwach); text-decoration: line-through; text-decoration-color: var(--rand); }
.zeile-storniert td:nth-child(4), .zeile-storniert td:last-child { text-decoration: none; }
.zeilen-titel { font-weight: 600; text-decoration: none; }
td small { display: block; }
.zeilen-aktionen { white-space: nowrap; text-align: right; }
.zeilen-aktionen form { display: inline; }
.zeilen-aktionen .knopf { margin-left: 4px; }
@media (max-width: 640px) {
  .zeilen-aktionen { justify-content: flex-end !important; gap: 6px; flex-wrap: wrap; white-space: normal; }
  .zeilen-aktionen::before { content: none !important; }
  table.liste td.zeilen-aktionen { padding-top: 8px; }
}
.mini-balken { display: block; width: 72px; height: 5px; background: var(--rand-fein); border-radius: 99px; overflow: hidden; margin: 5px 0 0 auto; }
.mini-balken i, .balken i.ok { background: var(--erfolg); }
.mini-balken i { display: block; height: 100%; }
.mini-balken i.warn, .balken i.warn { background: var(--warn); }
.baum-einzug { display: inline-block; }
@media (max-width: 640px) { .baum-einzug { padding-left: 0 !important; } }

/* --- Filter ------------------------------------------------------------ */
.filterleiste { display: flex; gap: 8px; max-width: 560px; margin-bottom: 10px; }
.filterleiste input { flex: 1; min-width: 0; }
.filter-formular { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 0 10px; align-items: end; }
.filter-formular .knopfreihe { margin-bottom: var(--luft); }
@media (max-width: 1100px) { .filter-formular { grid-template-columns: repeat(2, minmax(0, 1fr)); } .filter-formular .knopfreihe { grid-column: 1 / -1; } }
.reiter--unter { flex-wrap: wrap; margin-bottom: 8px; }
.reiter--unter a { display: inline-flex; align-items: center; gap: 6px; }

/* --- Menüzeilen (Mehr-Seite, Artikelauswahl) --------------------------- */
.menue-karte { padding-top: 6px; padding-bottom: 6px; }
.menue-karte .uz { margin-top: 12px; }
.menue-zeile {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 2px;
  border: 0; border-bottom: 1px solid var(--rand-fein); background: none;
  color: var(--text); text-decoration: none; font: inherit; text-align: left; cursor: pointer;
}
.menue-zeile > span { flex: 1; display: flex; flex-direction: column; }
.menue-zeile > svg:last-child { color: var(--schwach); }
.menue-karte form:last-child .menue-zeile, .menue-karte > .menue-zeile:last-child { border-bottom: 0; }

/* --- Artikel ----------------------------------------------------------- */
.bestand-gross { font-family: var(--schrift-titel); font-size: 2.1rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 10px; }
.bestand-gross + .balken { margin-bottom: 6px; }
.auswahl-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.auswahl-kachel { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; margin: 0; }
.auswahl-kachel:hover { border-color: var(--akzent); }
.ghs-auswahl { border: 0; padding: 0; margin: 0 0 var(--luft); display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 8px; }
.ghs-auswahl legend { margin-bottom: 6px; }
.chip--klein { min-height: 0; padding: 2px 8px; font-size: .78rem; cursor: default; }

/* --- Fieldset als Feldgruppe ohne Browser-Rahmen ------------------------ */
fieldset.feld { border: 0; padding: 0; margin-left: 0; margin-right: 0; min-width: 0; }
fieldset.feld > legend { padding: 0; }

/* --- Handy: leere Zeilen in Listenkarten weglassen ------------------------ */
@media (max-width: 640px) { table.liste td:empty { display: none; } }

/* --- Buchen ------------------------------------------------------------ */
.buchen-kopf h2 { margin-bottom: 4px; }
.buchen-kopf h2 a { color: inherit; text-decoration: none; }
.buchen-kopf .hinweis { margin: 10px 0 0; }
.rest-zeile { display: flex; align-items: center; gap: 12px; }
.rest-zeile .balken { flex: 1; }
.buchen-formular, .buchen-kopf { max-width: 720px; }
.feld-gross input { font-size: 1.6rem; font-weight: 700; min-height: 58px; }
.zaehler-feld { display: flex; gap: 6px; }
.zaehler-feld input { text-align: center; min-width: 0; flex: 1; }
.zaehler-feld .knopf { min-width: 48px; font-size: 1.2rem; }
.schnellmengen { margin: -6px 0 10px; }
.gebinde-wahl .kontrolle span { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.gebinde-wahl .kontrolle small { flex-basis: 100%; }
input.gesperrt { background: var(--flaeche2); color: var(--schwach); }
.knopf--erfolg { background: var(--erfolg); border-color: var(--erfolg); color: #fff; } /* feste-farbe-ok: Weiss auf Erfolgsgrün */

/* --- Scannen ----------------------------------------------------------- */
.scan-karte { max-width: 720px; }
.scan-eingabe { font-size: 1.3rem; min-height: 56px; letter-spacing: .02em; }
.scan-bereit { display: flex; align-items: center; gap: 8px; color: var(--schwach); font-size: .88rem; }
.scan-bereit .punkt { width: 9px; height: 9px; border-radius: 50%; background: var(--erfolg); }

/* --- Installer ---------------------------------------------------------- */
.installer .zeilenliste li { flex-wrap: wrap; }

/* --- Letzte Buchungen (Übersicht) --------------------------------------- */
.buchungsliste li { align-items: center; }
.buchungsliste li > a { flex: 1; min-width: 0; }
.buchungsliste__menge { white-space: nowrap; font-weight: 600; }

/* --- Kamera-Scanner ---------------------------------------------------------
   Kein Vollbild-Overlay: die Vorschau steht im Seitenfluss. So gibt es keine
   Höhe in vh/dvh, die in der App-WebView 0 sein kann. */
.kamera { margin: 4px 0 12px; }
.kamera__bild { position: relative; margin-top: 10px; border-radius: var(--radius-gross); overflow: hidden; background: #000; } /* feste-farbe-ok: Kamerabild */
.kamera__bild video { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; max-height: 420px; object-fit: cover; }
.kamera__rahmen {
  position: absolute; left: 14%; right: 14%; top: 16%; bottom: 40%;
  border: 2px solid var(--akzent); border-radius: var(--radius-gross); pointer-events: none;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .25);
}
.kamera__leiste {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 10px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .88rem; /* feste-farbe-ok: Text auf Kamerabild */
}
.kamera__leiste [data-kamera-status] { flex: 1; min-width: 120px; }
.kamera__leiste .chips { flex-basis: 100%; order: 2; }
.kamera__leiste .knopfreihe { order: 1; }
.kamera .hinweis { margin: 10px 0 0; }

/* --- Hinweis "Buchungen warten" oberhalb des Inhalts ---------------------- */
.warteschlange-hinweis {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 9px 12px;
  border: 1px solid var(--warn); border-radius: var(--radius); background: var(--flaeche);
  color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 600;
}
.warteschlange-hinweis svg { color: var(--warn); flex: none; }
.warteschlange-hinweis.mit-fehler, .warteschlange-hinweis.mit-fehler svg { border-color: var(--fehler); color: var(--fehler); }
.warteschlange-hinweis[hidden] { display: none; }
.offline-band a { color: inherit; font-weight: 700; margin-left: 6px; }

/* --- Offline-Seite --------------------------------------------------------- */
.offline-typ { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.offline-typ .kontrolle--rahmen { margin: 0; align-items: center; }
@media (max-width: 420px) { .offline-typ { grid-template-columns: minmax(0, 1fr); } }
.feld-gross-einfach { font-size: 1.4rem !important; font-weight: 700; min-height: 54px; }
.warteschlange-liste li { flex-direction: column; align-items: stretch; gap: 4px; }
.warteschlange-liste li.mit-fehler { border-left: 3px solid var(--fehler); padding-left: 10px; }
.ws-kopf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ws-kopf b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.warteschlange-liste .text-fehler { margin: 2px 0; }
[data-sync-status][hidden] { display: none; }

/* --- Etiketten ------------------------------------------------------------ */
.knopfreihe--mitte { justify-content: center; }
.etikett-angebot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 var(--luft);
  padding: 10px 12px; border: 1px solid var(--akzent); border-radius: var(--radius); background: var(--flaeche);
}
.etikett-angebot > span { flex: 1; min-width: 180px; font-weight: 600; }
.etikett-angebot > svg { color: var(--akzent); flex: none; }

/* --- Inventur: Zählliste --------------------------------------------------- */
.zaehl-liste { list-style: none; margin: 0; padding: 0; }
.zaehl-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 8px; padding: 12px 14px; }
.zaehl-zeile__text { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.zaehl-zeile__form { display: flex; gap: 8px; flex: 0 0 auto; }
.zaehl-zeile__form .feld-einheit input { width: 110px; }
.zaehl-zeile.ist-gezaehlt { border-left: 4px solid var(--erfolg); }
@media (max-width: 480px) { .zaehl-zeile__form { flex: 1 1 100%; } .zaehl-zeile__form .feld-einheit { flex: 1; } .zaehl-zeile__form .feld-einheit input { width: 100%; } }
.text-fehler-inline { color: var(--fehler); }

/* --- Bestellungen ---------------------------------------------------------- */
.kopf-formular { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kopf-formular select { width: auto; min-width: 180px; }
.feld-klein { display: inline-flex; max-width: 150px; }
.feld-klein input { min-width: 0; }
.feld-klein-input { max-width: 150px; text-align: right; }
td.rechts .feld-klein { margin-left: auto; }
.wahl-zelle { width: 44px; }
.wahl-zelle .kontrolle { padding: 0; min-height: 0; }
.karte-innen { padding: 12px 16px; align-items: center; }
.neue-zeile select { width: 100%; }
@media (max-width: 640px) { .feld-klein { max-width: 60%; } td.wahl-zelle { justify-content: flex-start !important; } }
.text-erfolg { color: var(--erfolg); font-weight: 600; }
.bestellt-hinweis { display: flex; align-items: center; gap: 6px; color: var(--erfolg); font-weight: 600; }

/* --- Auswertungen ------------------------------------------------------------ */
.filter-formular--auswertung { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
.zeitraum-chips { grid-column: 1 / -1; margin-top: 4px; }
.chip--aktiv { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
a.chip { text-decoration: none; }
.kennzahlen--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; }
.anleitung-liste { margin: 0 0 12px; padding-left: 20px; }
.anleitung-liste li { margin-bottom: 8px; }
@media (max-width: 1100px) { .filter-formular--auswertung { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- Import: Probelauf ----------------------------------------------------- */
.liste--import td small { display: block; }
.liste--import .zelle-meldungen small + small { margin-top: 3px; }
@media (max-width: 640px) {
  .liste--import td { flex-wrap: wrap; min-width: 0; }
  .liste--import td > * { min-width: 0; overflow-wrap: anywhere; }
  .liste--import td.zelle-meldungen { display: block; text-align: left; }
  .liste--import td.zelle-meldungen::before { display: block; margin-bottom: 4px; }
}

/* --- E-Mail ---------------------------------------------------------------- */
code.umbruch { display: block; word-break: break-all; padding: 8px 10px; background: var(--flaeche); border-radius: var(--radius); margin-top: 6px; }
