:root {
  --color-bg: #f4f1ec;
  --color-surface: #ffffff;
  --color-border: #e2dcd0;
  --color-text: #2b241b;
  --color-text-muted: #6f6656;
  --color-primary: #7a4a1f;
  --color-primary-dark: #5c3616;
  --color-primary-contrast: #ffffff;
  --color-accent: #b8860b;
  --color-success: #2e7d32;
  --color-success-bg: #e8f5e9;
  --color-warning: #b45309;
  --color-warning-bg: #fef3c7;
  --color-danger: #c62828;
  --color-danger-bg: #fdecea;
  --color-info: #1565c0;
  --color-info-bg: #e3f2fd;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(43, 36, 27, 0.08), 0 1px 2px rgba(43, 36, 27, 0.06);
  --sidebar-width: 240px;
  /* Ueberschriften in der (braunen) Sidebar: hell im Hellmodus (heller Text auf dunklem Grund),
     dunkel im Dark Mode (dort ist die Sidebar heller/tan). */
  --sidebar-heading: #fff8ee;
  /* Sidebar-/Menue-Hintergrund. Im Hellmodus etwas heller + waermer (oranger) als das dunkle
     --color-primary-dark, damit es nicht zu dunkel wirkt; Kontrast zur cremefarbenen Schrift bleibt. */
  --sidebar-bg: #854e1a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #1c1712;
    --color-surface: #262019;
    --color-border: #3a3226;
    --color-text: #ece6da;
    --color-text-muted: #a99d87;
    --color-primary: #c98a4b;
    --color-primary-dark: #b8763a;
    --color-primary-contrast: #1c1712;
    --color-accent: #d8a94a;
    --color-success-bg: #16301a;
    --color-warning-bg: #3a2a0a;
    --color-danger-bg: #3a1414;
    --color-info-bg: #10263d;
    --sidebar-heading: #241a10;
    --sidebar-bg: #b8763a;
  }
}

:root[data-theme="dark"] {
  --color-bg: #1c1712;
  --color-surface: #262019;
  --color-border: #3a3226;
  --color-text: #ece6da;
  --color-text-muted: #a99d87;
  --color-primary: #c98a4b;
  --color-primary-dark: #b8763a;
  --color-primary-contrast: #1c1712;
  --color-accent: #d8a94a;
  --color-success-bg: #16301a;
  --color-warning-bg: #3a2a0a;
  --color-danger-bg: #3a1414;
  --color-info-bg: #10263d;
  --sidebar-heading: #241a10;
  --sidebar-bg: #b8763a;
}

* { box-sizing: border-box; }

/* Basis fuer alle rem-Groessen (Buttons, Tabellen, Labels, Badges, Inline-Styles): 16 -> 17px =
   App-Schrift eine Stufe groesser (User-Wunsch 2026-09-14). */
html { font-size: 17px; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--color-primary); }

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #fff8ee;
  flex-shrink: 0;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 10px;
  text-align: center;
}

.sidebar-brand small { display: block; font-weight: 700; font-size: 0.85rem; color: var(--sidebar-heading); opacity: 1; text-transform: uppercase; letter-spacing: 0.06em; }

.brand-logo {
  display: block;
  margin: 0 auto;
}
/* Menue-/Sidebar-Logo als eingefaerbte CSS-Maske (schwarze Strichgrafik): im Hellmodus hell/creme
   (sichtbar auf dem braunen Grund), im Dark Mode dunkel - analog zu den Ueberschriften. */
.sidebar-brand .brand-logo {
  width: 150px; height: 137px; margin: 0 auto 8px;
  background-color: var(--sidebar-heading);
  -webkit-mask: url("/static/img/logo.png") center / contain no-repeat;
  mask: url("/static/img/logo.png") center / contain no-repeat;
}
.login-card .brand-logo {
  width: 200px;
  height: auto;
  margin-bottom: 16px;
  background: #fff8ee;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sidebar a.nav-link {
  color: #f2e6d3;
  text-decoration: none;
  padding: 10px 20px;
  font-size: 0.92rem;
  border-left: 3px solid transparent;
}

.sidebar a.nav-link:hover { background: rgba(255,255,255,0.08); }
.sidebar a.nav-link.active { background: rgba(255,255,255,0.14); border-left-color: var(--color-accent); font-weight: 600; }
.sidebar a.nav-link.nav-link-heading { font-weight: 700; color: var(--sidebar-heading); }

.sidebar .nav-section-title {
  padding: 16px 20px 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--sidebar-heading);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 1;
}

.sidebar button.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 8px 0 0;
  padding: 16px 20px 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--sidebar-heading);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar button.nav-section-toggle:hover { opacity: 0.75; }

.sidebar .nav-section-arrow {
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.15s ease;
  transform: rotate(0deg);
}

.sidebar button.nav-section-toggle.nav-section-toggle-open .nav-section-arrow { transform: rotate(90deg); }

.sidebar .nav-section-group { display: flex; flex-direction: column; gap: 2px; }

.sidebar-user {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.85rem;
}
.sidebar-user form { margin-top: 6px; }
.sidebar-user button.link-btn { background:none;border:none;color:#f2e6d3;text-decoration:underline;padding:0;cursor:pointer;font-size:0.8rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  padding: 16px 28px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 { font-size: 1.3rem; margin: 0; }
/* Zurück-Knopf oben links (auf allen aus dem Hauptfenster geöffneten Seiten). */
.topbar-back {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-right: 4px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-text);
  font-size: 1.4rem; line-height: 1; font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.topbar-back:hover { background: var(--color-surface-alt, var(--color-border)); }
/* Batch 182: display:inline-flex wuerde das hidden-Attribut uebersteuern - auf der
   Hauptuebersicht muss der Zurueck-Pfeil aber wirklich verschwinden. */
.topbar-back[hidden] { display: none; }
/* Batch 186: Spalte fuer die beiden Zurueck-Pfeile (oben Hauptuebersicht, darunter vorige
   Seite). Sind beide sichtbar, werden sie flacher, damit die Topbar nicht zu hoch wird. */
.topbar-nav { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
/* Ohne sichtbaren Pfeil verschwindet die ganze Spalte - sonst zentriert das leere Flex-Item
   den Seitentitel der Desktop-Startseite (Review Batch 186). */
.topbar-nav:not(:has(.topbar-back:not([hidden]))) { display: none; }
@media print {
  /* Navigations-Pfeile und Theme-Umschalter gehoeren auf kein Papier. */
  .topbar-nav, .theme-toggle { display: none !important; }
}
.topbar-prev { font-size: 1.1rem; }
.topbar-nav:has(.topbar-prev:not([hidden])) .topbar-back { height: 33px; }

/* Aufklappbare Lieferanten-Kacheln (Bestellvorschlag, Lieferanten-Verwaltung): <details class="card bv-kachel"> */
.bv-kachel { padding: 0; overflow: hidden; }
.bv-kachel > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 18px; -webkit-tap-highlight-color: transparent;
}
.bv-kachel > summary::-webkit-details-marker { display: none; }
.bv-kachel > summary .bv-pfeil { margin-left: auto; font-size: 1.2rem; color: var(--color-text-muted); transition: transform 0.15s; }
.bv-kachel[open] > summary .bv-pfeil { transform: rotate(90deg); }
.bv-kachel .bv-inhalt { padding: 0 18px 18px; }

/* Zahnrad-Menü rechts oben (Bestellvorschlag): kleines Aufklapp-Panel */
.zahnrad-menu { position: relative; flex: 0 0 auto; }
.zahnrad-menu > summary { list-style: none; cursor: pointer; font-size: 1.5rem; line-height: 1; -webkit-tap-highlight-color: transparent; }
.zahnrad-menu > summary::-webkit-details-marker { display: none; }
.zahnrad-menu .zahnrad-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  min-width: 270px; max-width: 86vw; max-height: 340px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

/* Kassa-Tablet: Hinweisleiste "Angemeldet: <Name> · Sperren" unter der Kopfzeile */
.kassa-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--color-primary); color: #fff8ee; font-size: 0.95rem; }
.kassa-bar strong { color: #fff; }
/* Sperren-Knopf am Kassa-Tablet bewusst groß + deutlich beschriftet (schnell erreichbar). */
.kassa-bar .kassa-lock-btn {
  display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
  font-family: inherit; font-size: 1.05rem; font-weight: 800; letter-spacing: 0.06em;
  padding: 11px 28px; border-radius: 10px; cursor: pointer;
  background: #fff; color: var(--color-primary); border: 2px solid #fff;
  -webkit-tap-highlight-color: transparent;
}
.kassa-bar .kassa-lock-btn:hover { background: rgba(255,255,255,0.88); }
.kassa-bar .kassa-lock-btn:active { transform: translateY(1px); }
/* Admin am Kassa-/Lagertablet (23.10.2026): Leiste in Warnfarbe - sichtbar, dass gerade der Chef angemeldet ist. */
.kassa-bar.kassa-bar-admin { background: #b45309; }
.kassa-bar.kassa-bar-admin .kassa-lock-btn { color: #b45309; }

/* Zigarren-Scan: Leiste "Zurueck zum Warenkorb" auf den Seiten der Zigarrendatenbank - das Erste unter
   der Kopfzeile, links, bleibt beim Rollen oben stehen. Eine Zeile; am Handy ohne die Korb-Nummer. */
.korbweg { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
  padding: 8px 16px; background: var(--color-surface); border-bottom: 2px solid var(--color-primary); }
.korbweg .korbweg-knopf { min-height: 44px; margin: 0; font-weight: 700; }
.korbweg .korbweg-text { font-size: 0.92rem; color: var(--color-text-muted, #6b6258); overflow-wrap: anywhere; }
@media (max-width: 420px) { .korbweg .korbweg-nr { display: none; } }
.korb-meldung { font-weight: 600; overflow-wrap: anywhere; }
/* Knopf "In den Warenkorb" auf der Seite einer Zigarre */
.korb-dazu { margin-top: 14px; }
.korb-dazu form { margin: 0; }
.korb-dazu .btn { min-height: 46px; font-size: 1rem; font-weight: 700; }
.korb-dazu .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.korb-dazu-text { margin: 6px 0 0; font-size: 0.9rem; color: var(--color-text-muted, #6b6258); overflow-wrap: anywhere; }
/* Scan-Wache: ein Scan ausserhalb der Scan-Seite wird rot gemeldet (app/static/js/scanwache.js) */
.scanwache { position: fixed; left: 0; right: 0; top: 0; z-index: 1200; padding: 14px 16px; background: #b3261e; color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35); font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.scanwache-text { flex: 1 1 240px; overflow-wrap: anywhere; }
.scanwache button { min-height: 44px; padding: 8px 18px; border-radius: 10px; border: 2px solid #fff; background: #fff; color: #b3261e;
  font: inherit; font-weight: 800; cursor: pointer; }

.content { padding: 24px 28px; flex: 1; }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.card h2, .card h3 { margin-top: 0; }

.collapsible-card summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.collapsible-card summary::-webkit-details-marker { display: none; }
.collapsible-card summary::before { content: "▸ "; color: var(--color-text-muted); }
.collapsible-card[open] summary::before { content: "▾ "; }
.collapsible-card .collapsible-summary-title { font-weight: 700; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } }

.stat-tile { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-tile .stat-value { font-size: 1.7rem; font-weight: 700; }
.stat-tile .stat-label { color: var(--color-text-muted); font-size: 0.82rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--color-border); }
th { color: var(--color-text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr:hover { background: rgba(122,74,31,0.05); }
.table-wrap { overflow-x: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* Knoepfe brechen NIE zweizeilig um ("Filter / loeschen" sah kaputt aus) - Container
     muessen stattdessen wrappen (form-row/actions-bar tun das). */
  white-space: nowrap;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--color-primary-dark); }
.btn.btn-secondary { background: transparent; color: var(--color-primary); border: 1px solid var(--color-border); }
.btn.btn-secondary:hover { background: rgba(122,74,31,0.08); }
.btn.btn-danger { background: var(--color-danger); }
.btn.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-info { background: var(--color-info-bg); color: var(--color-info); }
.badge-muted { background: var(--color-border); color: var(--color-text-muted); }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; font-size: 0.9rem; }
.alert-success { background: var(--color-success-bg); color: var(--color-success); }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.alert-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.alert-info { background: var(--color-info-bg); color: var(--color-info); }

label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; margin-top: 12px; }
input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.92rem;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; }
/* Batch 175: Haken/Radios nie auf Feldbreite dehnen (verzerrte Antwortkreise im Jugendschutztest) */
input[type="checkbox"], input[type="radio"] { width: auto; padding: 0; flex: 0 0 auto; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 160px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }

.actions-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.text-muted { color: var(--color-text-muted); }
.mt-0 { margin-top: 0; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--color-text-muted); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--color-primary-dark); }
.login-card { background: var(--color-surface); border-radius: var(--radius); padding: 36px; width: 100%; max-width: 380px; box-shadow: 0 8px 30px rgba(0,0,0,0.25); }
.login-card h1 { text-align: center; margin-bottom: 4px; }
.login-card p.sub { text-align: center; color: var(--color-text-muted); margin-top: 0; margin-bottom: 20px; font-size: 0.88rem; }

.bar-chart-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 0.85rem; }
.bar-chart-label { width: 160px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .bar-chart-label { width: 104px; } }
/* Wochentags-Umsatzchart (analytics): am Handy Label+Wert in Zeile 1, Balken volle Breite in Zeile 2 -
   sonst blieben dem Balken ~30px (Verifier-Messung). */
.wt-zeile { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.wt-name { flex: 0 0 auto; width: 72px; }
.wt-track { flex: 1; min-width: 120px; }
.wt-wert { flex: 0 0 auto; min-width: 96px; text-align: right; margin-left: auto; }
@media (max-width: 600px) {
  .wt-track { flex-basis: 100%; order: 3; }
  .wt-name { width: auto; }
}
.bar-chart-track { flex: 1; background: var(--color-border); border-radius: 6px; height: 18px; overflow: hidden; }
.bar-chart-fill { background: var(--color-primary); height: 100%; border-radius: 6px; }
.bar-chart-fill.fill-danger { background: var(--color-danger); }
.bar-chart-value { width: 60px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }

.hour-chart { display: flex; align-items: flex-end; gap: 2px; height: 160px; }
.hour-chart-bar { flex: 1; background: var(--color-primary); border-radius: 3px 3px 0 0; min-height: 2px; }
.hour-chart-labels { display: flex; gap: 2px; margin-top: 4px; }
.hour-chart-labels span { flex: 1; text-align: center; font-size: 0.65rem; color: var(--color-text-muted); }

.pill-nav { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.pill-nav a, .pill-nav label { padding: 6px 14px; border-radius: 999px; background: var(--color-surface); border: 1px solid var(--color-border); text-decoration: none; color: var(--color-text); font-size: 0.85rem; font-weight: normal; margin: 0; display: inline-block; }
.pill-nav a.active, .pill-nav label.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { background: rgba(122,74,31,0.08); }

.mobile-toggle { display: none; }
.topbar-logo { display: none; }
.mobile-dock { display: none; }
.sidebar-backdrop { display: none; }
.sidebar-close { display: none; }
.dock-subbar { display: none; }
.dock-subbar-backdrop { display: none; }
@media (max-width: 860px) {
  .sidebar {
    position: fixed; z-index: 30; top: 0; left: 0;
    width: 100%;                                   /* Vollbild-Menue am Handy */
    height: 100vh; height: 100dvh;                 /* dvh: berueksichtigt die Handy-Browserleiste */
    overflow-y: auto;                              /* langes Menue scrollt IN sich selbst */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;                  /* kein Weiterscrollen auf den Hintergrund */
    transform: translateX(-100%); transition: transform 0.2s;
  }
  .sidebar.open { transform: translateX(0); }
  body.menu-open { overflow: hidden; }             /* Hintergrund sperren, solange das Menue offen ist */
  .mobile-toggle { display: none; }                /* durch Logo oben + Menue-Tab unten ersetzt */
  /* Batch 175: App-Shell am Handy - NICHT das Dokument scrollt, sondern nur .main. Handy-Browser
     (Samsung Internet, Chrome) blenden ihre eigenen Leisten nur beim Dokument-Scrollen ein/aus und
     schoben dabei das fixe Dock unten bzw. die obere Slide-Leiste weg (User: 'verschwindet beim
     Hochscrollen'). Hoehe ueber 100% (= sichtbarer Bereich mit Browserleiste) statt 100vh, damit
     das Dock auch mit eingeblendeter Adressleiste im Bild ist. */
  @media screen {  /* nur am Bildschirm - beim Drucken (Papier < 860px) muss das Dokument normal ueberlaufen (Review) */
    html, body { height: 100%; }
    body { overflow: hidden; }
    .layout { flex-direction: column; height: 100%; min-height: 0; }
    .main { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  }
  .content { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .topbar { padding: 14px 16px; }
  /* Zurueck-Pfeil am Handy/Tablet deutlich groesser (leichter zu treffen) */
  .topbar-back { width: 54px; height: 54px; font-size: 1.9rem; border-radius: 14px; margin-right: 8px; }
  .topbar-prev { font-size: 1.45rem; }
  .topbar-nav:has(.topbar-prev:not([hidden])) .topbar-back { height: 41px; }

  /* Logo statt ☰ oben links. Das Logo ist schwarze Strichgrafik auf transparent - als CSS-Maske
     eingefaerbt, damit es im Dark Mode nicht auf dunklem Grund verschwindet (siehe Farb-Override
     am Dateiende: im Dark Mode orange/braun statt schwarz). */
  .topbar-logo {
    display: block; flex: 0 0 auto; height: 48px; width: 53px;
    background-color: #2b241b;                       /* dunkles Logo im Hellmodus */
    -webkit-mask: url("/static/img/logo.png") center / contain no-repeat;
    mask: url("/static/img/logo.png") center / contain no-repeat;
  }
  /* min-width:0 + Silbentrennung: lange Einzelwort-Titel ('Verbesserungsvorschlag') schoben
     sonst bei 17px-Basis den Theme-Knopf aus dem Bild (Review Batch 159). */
  .topbar h1 { font-size: 1.22rem; text-align: center; flex: 1; min-width: 0; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }

  /* ✕ zum Schliessen des Vollbild-Menues (bleibt beim Scrollen oben rechts stehen; die per
     transform verschobene .sidebar ist der Bezug fuer position:fixed) */
  .sidebar-close {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 12px; right: 12px; z-index: 2;
    width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255,255,255,0.14); color: #fff8ee; font-size: 1.4rem; line-height: 1;
  }

  /* Abdunkeln hinter dem offenen Menue - Tippen schliesst es */
  .sidebar-backdrop {
    display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 25;
    background: rgba(0,0,0,0.45); opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  body.menu-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

  /* Untere Menueleiste (Dock) - nur am Handy. z-index 45 = UEBER dem Vollbild-Menue (.sidebar z30 +
     Backdrop z25) und der oberen Slide-Leiste (.dock-subbar z40), damit das Dock IMMER sichtbar und
     bedienbar bleibt - auch bei offenem Menue (der "Menue"-Tab schliesst es dann wieder). */
  .mobile-dock {
    /* Batch 175: fester Flex-Fuss der App-Shell statt position:fixed (siehe .layout oben); z-index
       bleibt, damit das Dock ueber dem Vollbild-Menue (.sidebar z30) und der Slide-Leiste liegt. */
    display: flex; position: relative; flex: 0 0 auto; z-index: 45;
    background: var(--color-surface); border-top: 1px solid var(--color-border);
    padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -3px 14px rgba(0,0,0,0.07);
  }
  /* Platz am unteren Ende des offenen Vollbild-Menues, damit die letzten Eintraege nicht hinter
     dem (jetzt darueber liegenden) Dock verschwinden. */
  .sidebar.open { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .dock-tab {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: none; border: 0; cursor: pointer; text-decoration: none; font-family: inherit;
    color: var(--color-text-muted); font-size: 0.66rem; font-weight: 500; padding: 4px 1px;
    -webkit-tap-highlight-color: transparent;
  }
  .dock-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dock-ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .dock-tab.active { color: var(--color-primary); font-weight: 600; }
  .dock-tab.dock-open { color: var(--color-primary); }
  /* 23.10.2026: sechs Reiter im normalen Modus (mit "Bestellen") - ohne Seitenabstand und etwas kleinere Schrift (statt enger
     Laufweite), damit auch bei 360 px "Dienstplan" und "Datenbank" ganz lesbar bleiben UND sichtbar Abstand haben (gemessen
     mind. 5 px; Kassa-Tablet: eigene Leiste, unveraendert). */
  .mobile-dock.dock-sechs .dock-tab { padding-left: 0; padding-right: 0; font-size: 0.6rem; }

  /* Obere Slide-Leiste mit den Unterpunkten eines Dock-Bereichs (Lager, Verkauf, ...) */
  .dock-subbar {
    display: block; position: fixed; top: 0; left: 0; right: 0; z-index: 40;
    background: var(--color-surface); border-bottom: 1px solid var(--color-border);
    box-shadow: 0 6px 18px rgba(0,0,0,0.14);
    padding: calc(12px + env(safe-area-inset-top)) 14px 16px;
    transform: translateY(-100%); transition: transform 0.22s ease;
  }
  .dock-subbar.open { transform: translateY(0); }
  .dock-subbar-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
  .dock-subbar-title { font-weight: 700; font-size: 1.05rem; color: var(--color-text); }
  .dock-subbar-close {
    margin-left: auto; width: 46px; height: 46px; border: 0; background: none; cursor: pointer;
    color: var(--color-text-muted); font-size: 1.5rem; line-height: 1;
  }
  .dock-subbar-pills {
    display: flex; gap: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px; scrollbar-width: none;
  }
  .dock-subbar-pills::-webkit-scrollbar { display: none; }
  .dock-pill {
    flex: 0 0 auto; white-space: nowrap; text-decoration: none; cursor: pointer;
    padding: 14px 20px; border-radius: 999px; font-size: 1rem; font-weight: 500;
    background: var(--color-bg); border: 1px solid var(--color-border); color: var(--color-text);
  }
  .dock-pill.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; font-weight: 600; }

  .dock-subbar-backdrop {
    display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 39;
    background: rgba(0,0,0,0.35); opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  body.subbar-open .dock-subbar-backdrop { opacity: 1; pointer-events: auto; }
}

/* Dark Mode: Handy-Topbar-Logo in Orange/Braun (Primaerfarbe) statt Schwarz, damit es auf dem
   dunklen Grund sichtbar ist. Wirkt nur am Handy, da .topbar-logo sonst display:none ist. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .topbar-logo { background-color: var(--color-primary); }
}
:root[data-theme="dark"] .topbar-logo { background-color: var(--color-primary); }

/* ---- Demo-Modus (app/demo.py): Banner oben, Tag neben dem Titel, Umschalter unten im Menue.
   Eigene Lila-Farbe, damit es NICHT mit Warnungen/Fehlern verwechselt wird. ---- */
.demo-bar {
  background: #7c3aed; color: #fff;
  padding: 10px 16px; border-radius: 8px; margin: 0 0 16px;
  font-size: 0.9rem; line-height: 1.4;
}
.demo-tag {
  background: #7c3aed; color: #fff; font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap; letter-spacing: 0.02em;
}
.demo-toggle-wrap { margin-top: 12px; text-align: right; }
.demo-toggle-btn {
  background: transparent; color: var(--sidebar-heading, #9aa4b2);
  border: 1px solid currentColor; border-radius: 999px;
  padding: 5px 14px; font-size: 0.8rem; font-weight: 700; cursor: pointer;
}
.demo-toggle-btn.demo-on { background: #7c3aed; color: #fff; border-color: #7c3aed; }

/* Batch 174: To-Do fuer mehrere Personen (Checkbox-Chips unter dem Eingabefeld) */
.todo-ziele { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 2px; }
.todo-ziele-titel { font-size: 0.85rem; font-weight: 600; }
/* 16.10.2026: die Auswahl 'Für:' haben jetzt auch Mitarbeiter am Handy - ein sehr langer Name bricht um (frueher nowrap), statt aus dem Bild zu ragen */
.todo-ziel { display: inline-flex; align-items: center; gap: 5px; font-size: 0.9rem; margin: 0; max-width: 100%; overflow-wrap: anywhere; cursor: pointer; }
.todo-ziel input { width: auto; margin: 0; }

/* Batch 180: markante Hinweis-Banner auf der Uebersicht (Pflicht-Schulung, Jugendschutztest,
   Stichprobeninventur) - grosses Symbol, fette Titelzeile, echter Knopf statt Textlink. */
.hinweis-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border: 2px solid currentColor; }
.hinweis-banner .hb-icon { font-size: 2.3rem; line-height: 1; flex: 0 0 auto; }
.hinweis-banner .hb-text { flex: 1 1 230px; min-width: 0; }
.hinweis-banner .hb-titel { display: block; font-size: 1.45rem; font-weight: 800; line-height: 1.2; }
.hinweis-banner .hb-sub { display: block; font-size: 1rem; margin-top: 3px; }
.hinweis-banner .btn { flex: 0 0 auto; font-size: 1.02rem; font-weight: 700; }

/* Lagertablet (22.10.2026, Zebra TC21 mit 360 x 640): Kopfzeile, Sperr-Leiste, Dock und Rand niedrig halten - auf dem Scan-
   Bildschirm bleibt so mehr als die Haelfte fuer die Zeilen. Tippflaechen bleiben mindestens 48 px hoch. */
body[data-lager] .theme-toggle { min-width: 48px; min-height: 48px; }
body[data-lager] .kassa-bar .kassa-lock-btn { white-space: nowrap; min-height: 48px; }
@media (max-width: 560px) {
  body[data-lager] .mobile-dock { padding: 2px 2px calc(2px + env(safe-area-inset-bottom)); }
  body[data-lager] .dock-tab { min-height: 50px; padding: 3px 1px; justify-content: center; }
  body[data-lager] .topbar { padding: 4px 10px; }
  body[data-lager] .topbar-logo { height: 40px; width: 44px; }
  body[data-lager] .topbar-back { width: 48px; height: 48px; font-size: 1.6rem; margin-right: 6px; }
  body[data-lager] .topbar h1 { font-size: 1.08rem; }
  body[data-lager] .kassa-bar { padding: 2px 10px; font-size: 0.86rem; gap: 8px; }
  body[data-lager] .kassa-bar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body[data-lager] .kassa-bar .kassa-lock-btn { min-height: 48px; padding: 6px 14px; font-size: 0.95rem; }
  body[data-lager] .content { padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
}

/* =====================================================================================================================================
   Ab hier Ergaenzung vom 30.10.2026 (neues Design, Etappe 1). ALLES DARUEBER ist die Bildschirm-CSS vom 29.10.2026 (Commit 0d72d09),
   byte-gleich eingefroren: base.html laedt diese Datei nur noch fuer den DRUCK (media="print"), die neue style.css nur fuer den
   Bildschirm. So bleibt jeder Ausdruck pixelgleich wie vorher (Strg+P, "Drucken" der Lieferkontrolle, Zubuchungen, Bestelluebernahme).
   Oben nichts aendern. Hier unten nur, was die neuen Vorlagen dafuer brauchen:
   (1) neue Bedienelemente und Icons kommen nie aufs Papier (die alten Zeichen stehen dort weiter, Klasse app-papier);
   (2) Zeilen im Konto-Bereich des Menues hatten Inline-Abstaende, jetzt Klassen - hier dieselben Werte;
   (3) Farbnamen, die Vorlagen jetzt statt fester Altfarben nutzen - mit genau den alten Werten.
   ===================================================================================================================================== */
.ic, .nav-ic, .app-schirm, .topbar-aktionen, .akzent-wahl, .su-farbe { display: none !important; }
/* Kopfzeile (Titel mittig, 30.10.2026): die beiden Bloecke links/rechts gibt es fuers Papier nicht - ihre Teile stehen wie bisher direkt
   in der Kopfzeile */
.topbar-links, .topbar-rechts { display: contents; }
.sidebar-user a.nav-link.su-a8 { padding: 8px 0 0; display: block; }
.sidebar-user a.nav-link.su-a4 { padding: 4px 0 0; display: block; }
.sidebar-user .su-rolle { opacity: 0.7; }
.sidebar-user button.link-btn.su-push { display: block; padding: 8px 0 0; text-align: left; }
.sidebar-user button.link-btn.su-test { display: block; padding: 6px 0 0; text-align: left; }
.sidebar-user form.su-sperren { margin-top: 8px; }
:root {
  --color-hover: rgba(122, 74, 31, 0.05);        /* Summenzeilen GuV (frueher fest) */
  --color-accent-tint: rgba(122, 74, 31, 0.12);  /* GuV Personal: Quelle "von Hand" */
  --color-warning-tint: rgba(180, 83, 9, 0.12);  /* GuV Personal: Quelle "Gehaelter"/"geschaetzt" */
  --color-warning-line: rgba(180, 83, 9, 0.25);  /* Rechnungskontrolle: Linien im gelben Kasten */
  --logo-farbe: #2b241b;                         /* Logo oben (Humidor-PC, geteilte Ansicht) */
  --logo-humidor: #7a4a1f;                       /* Humidor-PC: Logo bei leerem Warenkorb */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --logo-farbe: #c98a4b; --logo-humidor: #c98a4b; }
}
:root[data-theme="dark"] { --logo-farbe: #c98a4b; --logo-humidor: #c98a4b; }
/* Teil 3 (30.10.2026, neue Menue-Ordnung): die roten Zahlen nie auf Papier; die Huelle um das Icon eines Reiters ohne Wirkung. Die
   Chef-Leiste hat am Bildschirm fuenf Reiter, auf Papier wie bisher sechs (Klasse dock-sechs-papier - dieselben Werte wie
   .mobile-dock.dock-sechs oben). Neue Reiter und Knoepfe tragen app-schirm (oben schon aus), die bisherigen fuers Papier app-papier. */
.nav-zahl, .dock-zahl, .knopf-zahl { display: none !important; }
.dock-ic-wrap { display: contents; }
@media (max-width: 860px) {
  .mobile-dock.dock-sechs-papier .dock-tab { padding-left: 0; padding-right: 0; font-size: 0.6rem; }
}
/* Seite "Bestellungen" (Teil 3, Pruef-Fund 30.10.2026): auf Papier eine schlichte Liste - je Gruppe der Titel, je Knopf eine Zeile mit
   Name und Erklaerung (die langen Texte; die Kurzformen des Handys nicht). Die Zeile mit der Anzahl und der Hinweis zu fehlenden
   Zahlen nie auf Papier (keine Zahlen auf Papier). Nur neue Klassen - kein bisheriger Ausdruck aendert sich. */
.knopf-unterzeile, .knopf-hinweis, .knopf-kurz { display: none !important; }
.knopf-gruppe { margin: 0 0 14px; }
.knopf-gruppe-titel { margin: 0 0 4px; font-size: 1rem; }
.knopf-raster { display: block; }
.knopf-gross { display: block; padding: 2px 0; color: inherit; text-decoration: none; break-inside: avoid; page-break-inside: avoid; }
.knopf-text { display: inline; }
.knopf-name { font-weight: 600; }
.knopf-erkl { color: var(--color-text-muted); }
.knopf-erkl::before { content: ": "; }
/* Eine Reservierung (Batch 354, 31.10.2026, Seite /reservierungen/<Nr>): auf Papier ein schlichtes Blatt - Name und Kontakt, die Artikel
   als Zeilen, der Verlauf mit Zeichen statt Punkten (erledigt ✓, aktuell ●, offen ○), Ablageplatz und Notiz als Text. Kopf, Kacheln,
   Knoepfe, Formulare und der Kreis nie auf Papier. Nur neue Klassen - kein bisheriger Ausdruck aendert sich. */
.re-kopf, .re-kreis, .re-kacheln, .re-fuss, .re-aktion, .re-status-wahl, .re-notiz-form, .re-treffer form, .re-ablage-form .btn,
.re-artikel-ic, .re-papier-aus { display: none !important; }
.re-seite { max-width: none; margin: 0; }
.re-person { margin: 0 0 6px; }
.re-name { margin: 0 0 2px; font-size: 1.4rem; line-height: 1.25; }
.re-kontakt { font-size: 0.95rem; color: var(--color-text-muted); }
.re-treffer { margin: 10px 0 0; }
.re-titel { margin: 16px 0 4px; padding: 0 0 2px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--color-text-muted); border-bottom: 1px solid var(--color-border); }
.re-artikel { padding: 3px 0; break-inside: avoid; page-break-inside: avoid; }
.re-artikel-text { display: block; }
.re-artikel-name { font-weight: 600; }
.re-artikel-info { color: var(--color-text-muted); }
.re-artikel-name::after, .re-artikel-info:not(:last-child)::after { content: " · "; color: var(--color-text-muted); font-weight: 400; }
.re-artikel-nr { margin: 3px 0 0; color: var(--color-text-muted); }
.re-verlauf { margin: 0; padding: 0; list-style: none; }
.re-schritt { padding: 2px 0; break-inside: avoid; page-break-inside: avoid; }
.re-spur { display: none; }
.re-schritt-text { display: block; }
.re-schritt-name { font-weight: 600; }
.re-schritt-name::before { display: inline-block; width: 1.3em; font-weight: 400; }
.re-schritt.ist-erledigt .re-schritt-name::before { content: "✓"; }
.re-schritt.ist-aktuell .re-schritt-name::before { content: "●"; }
.re-schritt.ist-offen .re-schritt-name::before { content: "○"; }
.re-schritt.ist-offen .re-schritt-name { font-weight: 400; color: var(--color-text-muted); }
.re-schritt-info { color: var(--color-text-muted); }
.re-schritt-info::before { content: " · "; }
.re-ablage-form { margin: 0; }
.re-ablage-form input { width: 100%; margin: 0; padding: 0; border: 0; background: none; color: var(--color-text); font: inherit; }
.re-ablage-form input:placeholder-shown { display: none; }
.re-blase { white-space: pre-wrap; overflow-wrap: anywhere; }
.re-leer { margin: 0; color: var(--color-text-muted); }
.re-erledigt { margin: 14px 0 0; color: var(--color-text-muted); }
/* Tagesabrechnung (11.11.2026, jedes Speichern in der Historie): die rechte Spalte des Chefs ("Soll / Ist Vergleich" und darunter die
   Karte "Speicherungen an diesem Tag") gibt es fuers Papier nicht - "Soll / Ist Vergleich" steht wie bisher direkt im Raster, die neue
   Karte und die Spalte "Speicherungen" im Verlauf tragen app-schirm (oben schon aus). Nur eine neue Klasse - kein bisheriger Ausdruck
   aendert sich. */
.ta-rechts { display: contents; }
/* Uebersicht mit Kacheln (16.11.2026, app/uebersicht.py): auf Papier keine Kacheln, keine Zahlen und kein "Neu" (alles app-schirm, oben
   schon aus) und ALLE Fenster untereinander (die Klasse ue-zu, die am Bildschirm verbirgt, kennt diese Datei nicht). Ein Block mit
   Unterteilungen (Meine Aufgaben, Termine, Aufgaben fuers Team, Reservierungen) steht als eine Karte mit seinem Titel, die Unterteilungen
   mit feiner Linie und ihrer Ueberschrift. Nur neue Klassen - kein bisheriger Ausdruck aendert sich. */
.ue-block-titel { margin: 0 0 10px; font-size: 1.2rem; }
.ue-teil + .ue-teil { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--color-border); }
.ue-teil-kopf { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 8px; }
.ue-teil-titel { margin: 0; font-size: 1.05rem; }
.ue-teil-link { margin-left: auto; font-size: 0.85rem; }
.ue-teil-kopf > .ue-teil-knopf { margin-left: auto; }
.ue-neu, .ue-teil-zahl, .ue-zahl { display: none !important; }
/* To-Do kompakt (16.11.2026, _todo_karte.html, _haken_auswahl.html): auf Papier die Zeilen der To-Do-Liste wie bisher (Haken und Text
   nebeneinander, feine Linie darunter); Stift und Bearbeiten-Bereich nie. Die eingeklappten Listen darunter klappt app.js vor dem Drucken
   auf. Die Beschriftung "Neuer Punkt" nur fuer Screenreader, das Formular in einer Zeile. Nur neue Klassen - kein bisheriger Ausdruck aendert
   sich. */
.todo-liste { list-style: none; margin: 0 0 12px; padding: 0; }
.todo-punkt { border-bottom: 1px solid var(--color-border); }
.todo-zeile { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
.todo-haken { margin: 0; }
.todo-haken input { width: auto; margin-top: 3px; }
.todo-inhalt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.todo-zeichen { margin-left: 4px; }
.todo-bearb-knopf, .todo-bereich, .hw-fuss { display: none !important; }
.todo-neu { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px; }
.todo-neu > .todo-neu-text { flex: 1 1 220px; min-width: 0; margin: 0; }
.todo-zusatz { margin: 14px 0 0; }
.todo-zusatz > summary { font-size: 0.85rem; font-weight: 600; color: var(--color-text-muted); }
.hw-vorlesen { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
