/* Einkaufsliste 2.0 – eigenes CSS, kein Framework. Mobile first. */

:root {
  --accent-h: 215;          /* Standard: Blau – pro Benutzer änderbar */
  --accent-s: 60%;
  --bg: hsl(var(--accent-h) 18% 91.5%);       /* Arbeitsfläche, leicht getönt */
  --surface: #ffffff;                          /* Karten */
  --surface-2: hsl(var(--accent-h) 28% 96.5%); /* Kopfzeilen in Karten, Felder */
  --text: hsl(var(--accent-h) 30% 11%);
  --muted: hsl(var(--accent-h) 10% 38%);
  --line: hsl(var(--accent-h) 16% 86%);       /* Linien innen */
  --edge: hsl(var(--accent-h) 14% 79%);       /* Kartenrand */
  --primary: hsl(var(--accent-h) var(--accent-s) 27%);
  --primary-ink: #ffffff;
  --primary-soft: hsl(var(--accent-h) calc(var(--accent-s) * .7) 92%);
  --frame: hsl(var(--accent-h) calc(var(--accent-s) * .7) 14%);      /* Menüleiste */
  --frame-2: hsl(var(--accent-h) calc(var(--accent-s) * .6) 20%);
  --frame-ink: hsl(var(--accent-h) 20% 92%);
  --frame-muted: hsl(var(--accent-h) 15% 66%);
  --warn: #a8530a;
  --warn-soft: #fdf0dc;
  --danger: #b3261e;
  --danger-soft: #fbe6e4;
  --ok: #1f6b4a;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 40, 30, .08);
  --nav-h: 64px;
  --side-w: 244px;
  --font: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

/* Dunkles Design: automatisch (Gerät) oder fest per Profil-Einstellung */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: hsl(var(--accent-h) 18% 6.5%);
    --surface: hsl(var(--accent-h) 14% 11%);
    --surface-2: hsl(var(--accent-h) 14% 14%);
    --text: hsl(var(--accent-h) 15% 91%);
    --muted: hsl(var(--accent-h) 8% 63%);
    --line: hsl(var(--accent-h) 12% 20%);
    --edge: hsl(var(--accent-h) 12% 24%);
    --frame: hsl(var(--accent-h) calc(var(--accent-s) * .5) 8%);
    --frame-2: hsl(var(--accent-h) calc(var(--accent-s) * .5) 13%);
    --primary: hsl(var(--accent-h) calc(var(--accent-s) * .85) 62%);
    --primary-ink: hsl(var(--accent-h) 50% 8%);
    --primary-soft: hsl(var(--accent-h) calc(var(--accent-s) * .5) 18%);
    --warn: #f0a54a;
    --warn-soft: #3a2a16;
    --danger: #f2877e;
    --danger-soft: #3b1d1b;
    --ok: #5cc08f;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
    --bg: hsl(var(--accent-h) 18% 6.5%);
    --surface: hsl(var(--accent-h) 14% 11%);
    --surface-2: hsl(var(--accent-h) 14% 14%);
    --text: hsl(var(--accent-h) 15% 91%);
    --muted: hsl(var(--accent-h) 8% 63%);
    --line: hsl(var(--accent-h) 12% 20%);
    --edge: hsl(var(--accent-h) 12% 24%);
    --frame: hsl(var(--accent-h) calc(var(--accent-s) * .5) 8%);
    --frame-2: hsl(var(--accent-h) calc(var(--accent-s) * .5) 13%);
    --primary: hsl(var(--accent-h) calc(var(--accent-s) * .85) 62%);
    --primary-ink: hsl(var(--accent-h) 50% 8%);
    --primary-soft: hsl(var(--accent-h) calc(var(--accent-s) * .5) 18%);
    --warn: #f0a54a;
    --warn-soft: #3a2a16;
    --danger: #f2877e;
    --danger-soft: #3b1d1b;
    --ok: #5cc08f;
    --shadow: none;
    color-scheme: dark;
  }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
img { max-width: 100%; display: block; }

.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; border: 0 !important; white-space: nowrap; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.user-chip { display: none; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; padding: 6px 10px; border-radius: 999px; }
.user-chip:hover { background: var(--surface); text-decoration: none; color: var(--text); }
.topbar .brand { font-weight: 700; color: var(--text); font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.topbar .brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; }
.topbar .spacer { flex: 1; }
.topbar .back { display: inline-flex; align-items: center; color: var(--text); padding: 6px; margin-left: -6px; border-radius: 8px; }

/* ---------- Navigation: unten auf dem Handy, oben am Desktop ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: .72rem; font-weight: 500; text-decoration: none;
}
.nav a .icon { width: 24px; height: 24px; }
.nav a.active { color: var(--primary); }
.nav a.nav-out.active { color: var(--danger); }
.nav a.nav-in.active { color: var(--ok); }

@media (min-width: 860px) {
  body { padding-bottom: 32px; }
  .topbar { padding: 0 24px; gap: 28px; min-height: 60px; }
  .nav {
    position: static; height: auto; padding: 0; background: none; border: 0;
    justify-content: flex-start; gap: 4px; align-self: stretch;
  }
  .nav a { flex: 0 0 auto; flex-direction: row; gap: 8px; font-size: .95rem; padding: 0 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
  .nav a:hover { color: var(--text); text-decoration: none; }
  .nav a .icon { width: 18px; height: 18px; }
  .nav a.active { border-bottom-color: var(--primary); color: var(--text); }
  .nav a.nav-out.active { border-bottom-color: var(--danger); color: var(--danger); }
  .nav a.nav-in.active { border-bottom-color: var(--ok); color: var(--ok); }
  .nav a.nav-account { display: none; }
  .user-chip { display: inline-flex; }
}

/* ---------- Layout ---------- */
.page { margin: 0 auto; padding: 16px; }
.page.narrow { max-width: 760px; }
@media (min-width: 860px) { .page { padding: 28px 32px; } }
@media (min-width: 2200px) { .page { max-width: 2100px; } }

/* Produktliste: am PC als Kachel-Raster über die ganze Breite */
@media (min-width: 860px) {
  .list.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; background: none; border: 0; box-shadow: none; }
  .product-grid > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
  .product-grid > li + li { border-top: 1px solid var(--line); }
  .product-grid .item { height: 100%; padding: 14px; }
  .product-grid .thumb { width: 56px; height: 56px; }
  .product-grid .item .title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
}

/* Zwei Spalten am PC (Produktseite, Formular, Buchen) */
.split { display: grid; gap: 14px; align-items: start; }
.split > * { min-width: 0; }
.split > .col { display: grid; gap: 14px; }
@media (min-width: 980px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
  .split.main-side { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .split.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
  .split > .col { gap: 20px; }
  .sticky-col { position: sticky; top: 84px; }
}
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { margin: 0; flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.card > h2 { display: flex; align-items: center; gap: 8px; }
.card.flush { padding: 0; overflow: hidden; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: .95rem;
  min-height: 44px; padding: 10px 16px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: transparent; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .875rem; }
.btn.block { width: 100%; }
.btn.icon-only { padding: 10px; min-width: 44px; }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: 5px; }
input[type=text], input[type=password], input[type=search], input[type=number], input[type=email], input[type=url], input[type=date], input:not([type]),
select, textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px verhindert Zoom auf iOS */
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 12px; min-height: 46px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 1px; border-color: var(--primary); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input[type=file] { font: inherit; font-size: .9rem; width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
.inline-new { margin-top: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.linkish { background: none; border: 0; padding: 6px 0; color: var(--primary); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.form-actions .btn.primary { flex: 1; }

/* Bestand-Zeilen im Formular */
.stock-row { display: grid; grid-template-columns: 1fr 96px 44px; gap: 8px; align-items: center; margin-bottom: 8px; }

/* ---------- Meldungen ---------- */
.flash { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: .95rem; border: 1px solid transparent; }
.flash.ok { background: var(--primary-soft); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.flash.error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Suche & Filter ---------- */
.searchbar { position: relative; }
@media (min-width: 860px) { .filter-row { display: flex; gap: 12px; align-items: center; } .filter-row .searchbar { flex: 0 1 520px; } .filter-row .chips { flex: 1; } }
.searchbar .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.searchbar input { padding-left: 42px; background: var(--surface); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 7px 13px; font-size: .88rem; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.chip:hover { text-decoration: none; border-color: var(--muted); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { font-size: .78rem; opacity: .7; }
.chip select { border: 0; background-color: transparent; padding: 0 22px 0 0; min-height: 0; font-size: .88rem; background-position: right 2px center; }

/* ---------- Produktliste ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--line); }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--text); text-decoration: none;
}
.item:hover { text-decoration: none; background: var(--surface-2); }
.thumb {
  width: 48px; height: 48px; border-radius: 10px; flex-shrink: 0; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: 1.1rem;
}
.item .title { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { display: block; color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qty { text-align: right; flex-shrink: 0; }
.qty b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.qty .unit { display: block; color: var(--muted); font-size: .75rem; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.low { background: var(--warn-soft); color: var(--warn); }
.badge.empty { background: var(--danger-soft); color: var(--danger); }
.badge.ok { background: var(--primary-soft); color: var(--ok); }
.status-low .qty b { color: var(--warn); }
.status-empty .qty b { color: var(--danger); }

.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-state .icon { width: 40px; height: 40px; margin: 0 auto 10px; display: block; }

/* ---------- Produktseite ---------- */
.product-hero { display: flex; gap: 16px; align-items: flex-start; }
.product-hero .photo { width: 112px; height: 112px; border-radius: var(--radius); object-fit: cover; flex-shrink: 0; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; font-size: 2rem; font-weight: 700; color: var(--muted); }
.product-hero h1 { margin-bottom: 6px; overflow-wrap: anywhere; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.total-big { font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }

.stock-list { list-style: none; margin: 0; padding: 0; }
.stock-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.stock-list li + li { border-top: 1px solid var(--line); }
.stock-list .loc { flex: 1; min-width: 0; }
.stock-list .loc .path-parent { color: var(--muted); font-size: .82rem; display: block; }
.stock-list .amount { font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }

.ean-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ean-list code { background: var(--surface-2); border: 1px solid var(--line); padding: 4px 8px; border-radius: 8px; }

/* Verlauf */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 0; }
.timeline li + li { border-top: 1px solid var(--line); }
.timeline .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.timeline .dot .icon { width: 16px; height: 16px; }
.timeline .t-out .dot { background: var(--danger-soft); color: var(--danger); }
.timeline .t-in .dot { background: var(--primary-soft); color: var(--ok); }
.timeline .t-correction .dot { background: var(--warn-soft); color: var(--warn); }
.timeline .meta { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.timeline .range { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 6px; background: var(--surface-2); font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline .note { color: var(--muted); font-style: italic; }

/* ---------- Tabellen ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }

/* ---------- Login / Installer ---------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
body.bare { padding-bottom: 0; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .logo-big { width: 56px; height: 56px; border-radius: 16px; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; margin: 0 auto 14px; }
.auth-card .logo-big .icon { width: 30px; height: 30px; }
.auth-card h1 { text-align: center; }
.installer { max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; }
.installer fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.installer legend { font-weight: 700; font-size: 1.05rem; margin-bottom: 10px; display: flex; gap: 10px; align-items: center; }
.installer legend .num { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-size: .85rem; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 4px 0; display: flex; gap: 8px; }
.checks .good { color: var(--ok); }
.checks .bad { color: var(--danger); }
pre.config { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; overflow-x: auto; font-size: .82rem; }

/* Bestätigungs-Dialog */
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 20px; max-width: 420px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }

@media print {
  .nav, .topbar, .form-actions, .no-print { display: none !important; }
  body { background: #fff; padding: 0; }
  .card { box-shadow: none; border: 0; }
}

/* Aufklappbare Zeilen (Benutzerliste) */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary .icon.muted { transform: rotate(90deg); }
summary.item .icon { transition: transform .15s; }

/* ---------- Globale Suche in der Kopfzeile ---------- */
.global-search { position: relative; display: none; align-items: center; }
.global-search > .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.global-search input { min-height: 40px; padding: 8px 36px 8px 38px; background: var(--surface); border-radius: 999px; }
.global-search .gs-key { position: absolute; right: 10px; font: 600 .75rem/1 var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; background: var(--surface-2); }
.global-search input:focus ~ .gs-key { display: none; }
.global-search .gs-close { display: none; }
.gs-open { margin-right: -8px; }
.gs-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.14); overflow: hidden; max-height: 70vh; overflow-y: auto;
}
.gs-results a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: var(--text); text-decoration: none; }
.gs-results a .thumb { width: 36px; height: 36px; font-size: .9rem; border-radius: 8px; }
.gs-results a .grow b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-results a .grow span { color: var(--muted); font-size: .8rem; }
.gs-results a[aria-selected=true], .gs-results a:hover { background: var(--primary-soft); }
.gs-results .gs-all { justify-content: center; color: var(--primary); font-weight: 600; font-size: .9rem; border-top: 1px solid var(--line); }
.gs-results .gs-empty { padding: 14px; color: var(--muted); font-size: .9rem; }

/* Handy: Lupe öffnet die Suche über der ganzen Kopfzeile */
@media (max-width: 859px) {
  .topbar.searching > :not(.global-search):not(.nav) { display: none; }
  .topbar.searching .global-search { display: flex; flex: 1; }
  .topbar.searching .global-search .gs-key { display: none; }
  .topbar.searching .global-search .gs-close { display: inline-flex; position: absolute; left: -4px; min-height: 40px; }
  .topbar.searching .global-search > .icon { left: 46px; }
  .topbar.searching .global-search input { margin-left: 40px; padding-right: 12px; }
  .topbar.searching .gs-results { left: 0; position: fixed; top: 62px; left: 8px; right: 8px; }
}
@media (min-width: 860px) {
  .global-search { display: flex; flex: 0 1 380px; }
  .gs-open { display: none; }
  .topbar .spacer { flex: 1 1 0; }
}

/* ---------- Buchen ---------- */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; }
.segmented button { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; min-height: 46px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.segmented button[aria-checked=true] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.booking[data-mode=out] .segmented [data-mode=out][aria-checked=true] { background: var(--danger); color: #fff; }
.booking[data-mode=in] .segmented [data-mode=in][aria-checked=true] { background: var(--primary); color: var(--primary-ink); }
.where-row { margin-bottom: 12px; gap: 6px; }
.where-select { width: auto; min-height: 36px; padding: 4px 30px 4px 10px; font-size: .9rem; background-color: transparent; border-color: transparent; font-weight: 600; color: var(--primary); }
.searchbar.big input { min-height: 56px; font-size: 1.1rem; padding-left: 46px; }
.searchbar.big .icon { left: 15px; width: 22px; height: 22px; }
.bk-results { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.bk-results button.item { width: 100%; border: 0; background: var(--surface); font: inherit; text-align: left; cursor: pointer; }
.bk-results button.item:hover, .bk-results button.item:focus { background: var(--primary-soft); outline: none; }
.bk-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.bk-head .thumb { width: 56px; height: 56px; overflow: hidden; }
.bk-head .thumb img { width: 100%; height: 100%; object-fit: cover; }
.bk-name { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.bk-label { font-weight: 600; font-size: .9rem; margin: 14px 0 8px; }
.loc-options { display: grid; gap: 8px; }
@media (min-width: 640px) { .loc-options { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.loc-option { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; background: var(--surface-2); }
.loc-option input { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; }
.loc-option b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.loc-option .path-parent { display: block; color: var(--muted); font-size: .78rem; font-weight: 400; }
.loc-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.loc-option.disabled { opacity: .45; cursor: not-allowed; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .btn { width: 52px; height: 52px; padding: 0; border-radius: 14px; }
.stepper input { width: 96px; text-align: center; font-size: 1.35rem; font-weight: 700; min-height: 52px; }
.bk-note { margin-top: 10px; }
.bk-submit { margin-top: 16px; min-height: 56px; font-size: 1.05rem; white-space: normal; text-align: center; }
.booking[data-mode=out] .bk-submit { background: var(--danger); border-color: var(--danger); color: #fff; }
.bk-submit:disabled { opacity: .45; cursor: not-allowed; }
.bk-hint { padding: 28px 16px; }
.timeline li.undone .grow, .timeline li.undone > div > div:first-child { opacity: .55; text-decoration: line-through; }
.timeline li.undone .badge { text-decoration: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  width: max-content; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 14px;
  background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: .95rem;
}
.toast.error { background: var(--danger); color: #fff; }
.toast button { background: none; border: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 4px; }
@media (min-width: 860px) { .toast { bottom: 24px; } }

/* ---------- Verlauf ---------- */
.side-layout { display: grid; gap: 14px; align-items: start; }
.side-layout > * { min-width: 0; }
@media (min-width: 980px) {
  .side-layout { grid-template-columns: 320px minmax(0, 1fr); gap: 24px; }
  .history-filter { position: sticky; top: 84px; }
}
.wrap-chips { flex-wrap: wrap; overflow: visible; }
.history-days { display: grid; gap: 14px; }
.day-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.day-head h2 { margin: 0; flex: 1; }
.day-head h2 a { color: var(--text); }
.day-counts { display: flex; gap: 6px; }
.day-counts .icon { width: 13px; height: 13px; }
.day-sum { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; font-size: .9rem; padding: 8px 10px; border-radius: var(--radius-sm); margin: 8px 0; }
.day-sum-out { background: var(--danger-soft); }
.day-sum-in { background: var(--primary-soft); }
.day-sum-label { font-weight: 700; }
.sum-item { white-space: nowrap; }
.timeline a { color: inherit; }
.timeline a:hover b { text-decoration: underline; }

.time-chips { flex-wrap: nowrap; }
@media (min-width: 980px) {
  .time-chips { flex-wrap: wrap; overflow: visible; }
  .filter-more > summary { display: none; }
}

/* Kopf der Buchen-Seite */
.booking-head h1 { display: flex; align-items: center; gap: 10px; }
.mode-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.mode-icon .icon { width: 20px; height: 20px; }
.booking-head-out .mode-icon { background: var(--danger); }
.booking-head-in .mode-icon { background: var(--primary); color: var(--primary-ink); }
.booking-head .btn .icon { width: 16px; height: 16px; }
.quick-toggle { font-size: .85rem; color: var(--muted); margin: 0; align-items: center; }
.quick-toggle input { width: 18px; height: 18px; margin: 0; }
.booking[data-mode=out] .searchbar.big input:focus { outline-color: color-mix(in srgb, var(--danger) 55%, transparent); border-color: var(--danger); }

/* Notiz in "Zuletzt gebucht" */
.recent-actions { display: flex; gap: 2px; align-items: center; flex-shrink: 0; }
.recent-actions .btn.small { min-height: 32px; padding: 4px 8px; }
.recent-actions .icon { width: 16px; height: 16px; }
.note-form { display: flex; gap: 6px; margin-top: 8px; }
.note-form input { min-height: 38px; padding: 6px 10px; font-size: 15px; }
#bk-recent .note { color: var(--muted); font-style: italic; font-size: .88rem; margin-top: 2px; }

:root[data-theme=light] { color-scheme: light; }

/* ---------- Avatare ---------- */
.avatar { --hue: 150; display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 50%; object-fit: cover;
  width: 36px; height: 36px; font-weight: 700; font-size: .95rem;
  background: hsl(var(--hue) 45% 88%); color: hsl(var(--hue) 45% 28%); }
:root[data-theme=dark] span.avatar { background: hsl(var(--hue) 30% 24%); color: hsl(var(--hue) 50% 82%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) span.avatar { background: hsl(var(--hue) 30% 24%); color: hsl(var(--hue) 50% 82%); } }
.avatar.sm { width: 30px; height: 30px; font-size: .82rem; }
.avatar.md { width: 40px; height: 40px; }
.avatar.lg { width: 52px; height: 52px; font-size: 1.2rem; }
.avatar.xl { width: 88px; height: 88px; font-size: 2rem; }

/* ---------- Benutzermenü oben rechts ---------- */
.user-menu { position: relative; }
.user-menu > summary { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; cursor: pointer; color: var(--text); }
.user-menu > summary:hover, .user-menu[open] > summary { background: var(--surface); }
.user-menu .user-name { font-size: .92rem; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu > summary .icon { width: 16px; height: 16px; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 240px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.16); padding: 6px; }
.menu-head { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-pop a, .menu-pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; color: var(--text);
  background: none; border: 0; font: inherit; font-size: .95rem; cursor: pointer; text-decoration: none; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop .icon { width: 18px; height: 18px; color: var(--muted); }
@media (max-width: 859px) {
  .user-menu .user-name, .user-menu > summary > .icon { display: none; }
  .user-menu > summary { padding: 2px; }
  .topbar.searching .user-menu { display: none; }
}
/* Menü: manche Punkte nur am PC, "Mehr" nur am Handy */
@media (max-width: 859px) { .nav a.nav-desktop { display: none; } }
@media (min-width: 860px) { .nav a.nav-mobile { display: none; } }
@media (min-width: 860px) and (max-width: 1250px) { .nav a .icon { display: none; } .nav a { padding: 0 10px; } .global-search { flex-basis: 260px; } }
.user-chip { display: none !important; }

/* Handy-Menü */
.menu-user { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; }
.menu-user:hover { text-decoration: none; }
.menu-user .grow b, .menu-user .grow span { display: block; }
.menu-list .item .icon:first-child { color: var(--muted); }

/* ---------- Einstellungen ---------- */
.settings-layout { display: grid; gap: 16px; align-items: start; }
.settings-layout > * { min-width: 0; }
.settings-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.settings-nav::-webkit-scrollbar { display: none; }
.settings-group { display: contents; }
.settings-group-label { display: none; }
.settings-nav a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: .9rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.settings-nav a .icon { width: 17px; height: 17px; color: var(--muted); }
.settings-nav a.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.settings-nav a.active .icon { color: inherit; }
@media (min-width: 980px) {
  .settings-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 28px; }
  .settings-nav { flex-direction: column; gap: 2px; overflow: visible; position: sticky; top: 84px; }
  .settings-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
  .settings-group-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 0 12px 6px; }
  .settings-nav a { border: 0; background: none; border-radius: 10px; padding: 10px 12px; font-size: .95rem; }
  .settings-nav a:hover { background: var(--surface); }
  .settings-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
}
.settings-title { font-size: 1.25rem; margin: 0 0 14px; }
.settings-title-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.settings-title-row .settings-title { margin: 0; flex: 1; }
.profile-head { display: flex; gap: 18px; align-items: center; }
.user-edit { padding: 4px 14px 16px; border-top: 1px dashed var(--line); margin: 0 14px; padding-left: 0; padding-right: 0; }
.user-row summary .badge { flex-shrink: 0; }
@media (max-width: 600px) { .user-row summary .badge:not(.empty) { display: none; } }
.theme-options { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-option { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 500; font-size: .88rem; cursor: pointer; margin: 0; }
.theme-option input { position: absolute; opacity: 0; }
.theme-option .swatch { width: 92px; height: 58px; border-radius: 10px; border: 2px solid var(--line); }
.theme-light .swatch { background: linear-gradient(135deg, #f4f2ec 50%, #fff 50%); }
.theme-dark .swatch { background: linear-gradient(135deg, #121513 50%, #222724 50%); }
.theme-auto .swatch { background: linear-gradient(135deg, #f4f2ec 50%, #121513 50%); }
.theme-option input:checked + .swatch { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.theme-option input:focus-visible + .swatch { outline: 2px solid var(--primary); }
.roles-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.role-name { font-weight: 700; font-size: 1.05rem; }
.perm-list { list-style: none; padding: 0; margin: 0 0 14px; }
.perm-list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.perm-list li:last-child { border-bottom: 0; }
.perm-list .check { margin: 0; font-weight: 500; }
.perm-hint { display: block; font-weight: 400; }
.role-delete { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.loc-tree li { padding-left: calc(var(--depth, 0) * 22px); }
.loc-tree li[style*="--depth:0"] + li[style*="--depth:0"] { border-top-color: var(--line); }
.list .item .thumb .icon { width: 20px; height: 20px; }

/* Akzentfarbe im Profil */
.accent-options { display: flex; flex-wrap: wrap; gap: 12px; }
.accent-option { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; cursor: pointer; font-weight: 500; }
.accent-option input { position: absolute; opacity: 0; }
.accent-option .dot { width: 38px; height: 38px; border-radius: 50%; background: hsl(var(--accent-h) var(--accent-s) 32%); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.accent-option input:checked + .dot { box-shadow: 0 0 0 3px hsl(var(--accent-h) var(--accent-s) 45%); }
.accent-option input:focus-visible + .dot { outline: 2px solid var(--text); outline-offset: 3px; }

/* ---------- Startseite ---------- */
.quick-actions { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
@media (min-width: 700px) { .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .quick-actions { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.qa { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow); min-width: 0; }
.qa:hover { text-decoration: none; border-color: var(--primary); }
.qa b, .qa .small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa > span:last-child { min-width: 0; }
.qa-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.qa-out .qa-icon { background: var(--danger); color: #fff; }
.qa-in .qa-icon { background: var(--primary); color: var(--primary-ink); }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
@media (min-width: 1000px) { .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--text); text-decoration: none; display: flex; flex-direction: column; }
.kpi:hover { text-decoration: none; border-color: var(--muted); }
.kpi-val { font-size: 1.6rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-label { color: var(--muted); font-size: .8rem; }
.kpi-warn .kpi-val { color: var(--warn); }
.kpi-danger .kpi-val { color: var(--danger); }
.dash-grid { display: grid; gap: 14px; }
.dash-grid > * { min-width: 0; }
@media (min-width: 980px) { .dash-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; } }
.list.compact .item { padding: 8px 2px; }
.list.compact .qty b { font-size: 1rem; }

/* ---------- Diagramme ---------- */
.chart { width: 100%; height: auto; display: block; margin: 4px 0 8px; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar-out { fill: var(--danger); opacity: .85; }
.chart .bar-in { fill: var(--primary); opacity: .85; }
.legend { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-out { background: var(--danger); } .lg-in { background: var(--primary); }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .92rem; }
.hb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-name a { color: var(--text); }
.hb-track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hb-fill { display: block; height: 100%; border-radius: 99px; }
.hb-fill.bar-out { background: var(--danger); opacity: .8; }
.hb-fill.bar-in { background: var(--primary); }
.hb-fill.bar-neutral { background: var(--muted); }
.hb-val { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Berichte ---------- */
.report-grid { display: grid; gap: 14px; }
@media (min-width: 980px) { .report-grid { grid-template-columns: 1fr 1fr; gap: 20px; } }
.report-grid > * { min-width: 0; }
.report-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.report-head h2 { margin: 0 0 4px; }
.report-head p { margin: 0; }
.report-links { display: grid; gap: 10px; }
@media (min-width: 980px) { .report-links { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); } }
.report-card .check { margin-bottom: 6px; }
.check-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cchip { margin: 0; font-weight: 500; cursor: pointer; }
.cchip input { position: absolute; opacity: 0; }
.cchip span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: .88rem; }
.cchip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.cchip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.stats-grid { display: grid; gap: 14px; }
.stats-grid > * { min-width: 0; }
@media (min-width: 980px) { .stats-grid { grid-template-columns: 1fr 1fr; gap: 20px; } .stats-wide { grid-column: span 1; } }
@media (min-width: 1400px) { .stats-grid { grid-template-columns: 1fr 1fr 1fr; } }
.kpis.kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 800px) { .kpis.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Etiketten */
.labels-options { position: static; }
@media (min-width: 980px) { .labels-layout { grid-template-columns: 340px minmax(0, 1fr); } .labels-options { position: sticky; top: 84px; } }
.label-table tbody tr { cursor: pointer; }
.label-table tbody tr.selected { background: var(--primary-soft); }
.label-table td { padding: 8px; }
.label-table .copies { max-width: 80px; min-height: 38px; padding: 6px 8px; }
.label-table .ean-select { min-height: 38px; padding: 6px 30px 6px 8px; font-size: 14px; }
.label-table input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--primary); }
.gen-box { position: sticky; bottom: calc(var(--nav-h) + 12px); margin-top: 14px; border-color: var(--warn); background: var(--warn-soft); }
@media (min-width: 860px) { .gen-box { bottom: 16px; } }
.label-summary { padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }

/* Barcode-Vorschau auf der Produktseite */
.ean-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.ean-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; background: #fff; text-align: center; }
.ean-card img { width: 100%; height: 84px; object-fit: contain; }
.ean-card .badge { margin-top: 6px; }
.mode-options { display: grid; gap: 8px; }
@media (min-width: 700px) { .mode-options { grid-template-columns: 1fr 1fr; } }
.mode-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); margin: 0; cursor: pointer; font-weight: 400; background: var(--surface-2); }
.mode-option b, .mode-option .small { display: block; }
.mode-option input { accent-color: var(--primary); width: 18px; height: 18px; margin-top: 2px; }
.mode-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
button.chip { cursor: pointer; font: inherit; font-size: .88rem; }
.topbar .brand { white-space: nowrap; }
.check input { flex-shrink: 0; }
.dash-grid { align-items: start; }

/* Säulendiagramm (HTML) */
.vchart { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin: 6px 0 10px; }
.vc-axis { height: var(--vh); display: flex; flex-direction: column; justify-content: space-between; font-size: .72rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; transform: translateY(-.5em); }
.vc-plot { position: relative; min-width: 0; }
.vc-grid { position: absolute; inset: 0 0 auto 0; height: var(--vh); display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.vc-grid i { display: block; border-top: 1px solid var(--line); }
.vc-cols { position: relative; display: flex; align-items: stretch; gap: 2px; }
.vc-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.vc-bars { height: var(--vh); width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.vc-bar { display: block; width: min(42%, 18px); border-radius: 3px 3px 0 0; min-height: 0; }
.vc-bar.bar-out { background: var(--danger); opacity: .85; }
.vc-bar.bar-in { background: var(--primary); opacity: .85; }
.vc-col:hover .vc-bar { opacity: 1; }
.vc-label { font-size: .7rem; color: var(--muted); white-space: nowrap; height: 1.4em; margin-top: 4px; overflow: visible; }
@media (max-width: 699px) {
  .qa .small { display: none; }
  .qa { padding: 12px; gap: 10px; }
  .qa-icon { width: 36px; height: 36px; }
}

.role-inline { display: none; }
@media (max-width: 600px) { .role-inline { display: inline; } }

/* ---------- Glocke ---------- */
.bell-menu { position: relative; }
.bell-menu > summary { list-style: none; cursor: pointer; position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text); }
.bell-menu > summary::-webkit-details-marker { display: none; }
.bell-menu > summary:hover, .bell-menu[open] > summary { background: var(--surface); }
.bell-menu > summary .icon { width: 22px; height: 22px; }
.bell-count { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.bell-pop { width: min(380px, calc(100vw - 24px)); right: -48px; padding: 0; }
@media (min-width: 860px) { .bell-pop { right: 0; } }
.bell-head, .bell-foot { padding: 10px 12px; }
.bell-head { border-bottom: 1px solid var(--line); }
.bell-foot { border-top: 1px solid var(--line); font-size: .88rem; }
.bell-foot a { display: inline-flex; gap: 6px; align-items: center; }
.bell-foot .icon { width: 15px; height: 15px; }
#bell-list { max-height: 60vh; overflow-y: auto; }
#bell-list a { display: block; padding: 10px 12px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
#bell-list a:hover { background: var(--surface-2); }
#bell-list a.unread { background: var(--primary-soft); }
#bell-list a b { display: block; font-size: .92rem; }
#bell-list a span { display: block; color: var(--muted); font-size: .8rem; white-space: pre-line; max-height: 3.6em; overflow: hidden; }
.notif-list li.unread .item { background: var(--primary-soft); }
.notif-list .notif-body { white-space: normal; }
.notif-list .ev-low .thumb, .notif-list .ev-empty .thumb { color: var(--warn); }

/* Benachrichtigungs-Einstellungen */
.channel-list { display: grid; gap: 12px; }
.channel { display: flex; gap: 14px; align-items: flex-start; }
.channel .qa-icon { width: 42px; height: 42px; }
.channel b { display: block; }
.channel .steps { margin: 6px 0 0; padding-left: 18px; }
.channel-actions { flex-shrink: 0; }
.notify-matrix th.c, .notify-matrix td.c { text-align: center; width: 90px; }
.matrix-check { display: inline-grid; place-items: center; margin: 0; padding: 6px; cursor: pointer; }
.matrix-check input { width: 22px; height: 22px; accent-color: var(--primary); }
.matrix-check input:disabled { opacity: .3; }
@media (max-width: 600px) { .notify-matrix th.c, .notify-matrix td.c { width: 56px; font-size: .72rem; } }

/* ---------- Einkaufslisten ---------- */
.list-card { display: flex; gap: 14px; align-items: center; color: var(--text); text-decoration: none; }
.list-card:hover { text-decoration: none; border-color: var(--primary); }
.list-card b, .list-card .small { display: block; }
.progress { display: block; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s; }
.list-progress { margin-bottom: 14px; padding: 12px 16px; }
.live-dot { color: var(--ok); font-size: .75rem; }
.add-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; position: relative; margin-bottom: 14px; padding: 12px; }
.add-bar .searchbar { flex: 1 1 240px; }
.add-qty { width: 90px !important; flex: 0 0 auto; }
.add-suggest { position: absolute; left: 12px; right: 12px; top: calc(100% - 4px); z-index: 40; background: var(--surface); box-shadow: 0 12px 30px rgba(0,0,0,.15); margin: 0; }
.list-groups { display: grid; gap: 14px; }
@media (min-width: 1100px) { .list-groups { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); align-items: start; } }
.list-group h2 { margin-bottom: 6px; }
.shop-items { list-style: none; margin: 0; padding: 0; }
.shop-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.shop-item:first-child { border-top: 0; }
.shop-check { margin: 0; cursor: pointer; flex-shrink: 0; position: relative; }
.shop-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.shop-check .box { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--muted); background: var(--surface); transition: background .15s, border-color .15s; }
.shop-check input:checked + .box { background: var(--primary); border-color: var(--primary); }
.shop-check input:checked + .box::after { content: ''; width: 9px; height: 15px; border: solid var(--primary-ink); border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -2px); }
.shop-check input:focus-visible + .box { outline: 2px solid var(--primary); outline-offset: 2px; }
.shop-text { min-width: 0; }
.shop-name { display: block; font-weight: 600; font-size: 1.02rem; }
.shop-info { display: block; color: var(--muted); font-size: .8rem; }
.shop-item.checked .shop-name { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.shop-qty { flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; font-weight: 700; font-size: .9rem; color: var(--text); cursor: pointer; min-width: 64px; text-align: center; }
.list-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: flex-start; }
.list-more > summary { list-style: none; }
.list-more[open] { flex-basis: 100%; }
.book-table input, .book-table select { min-height: 40px; padding: 6px 10px; font-size: 15px; }
.book-table input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); }

.print-combo { display: inline-flex; align-items: center; gap: 6px; }
.copies-label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; color: var(--muted); }
.copies-input { width: 70px !important; min-height: 44px; text-align: center; }
.print-direct { gap: 6px; }
.print-direct select { min-height: 36px; padding: 4px 28px 4px 8px; width: auto; font-size: 14px; }
.print-direct .copies-input { min-height: 36px; padding: 4px; }
.detected-hint { margin-left: 4px; }

/* Kopfzeile am PC: genug Platz für die Suche */
@media (min-width: 860px) {
  .global-search { flex: 0 1 320px; min-width: 200px; }
  .topbar { gap: 18px; }
}
@media (min-width: 860px) and (max-width: 1560px) { .nav a .icon { display: none; } .nav a { padding: 0 10px; } }
@media (min-width: 860px) and (max-width: 1180px) { .brand-name { display: none; } .user-menu .user-name { display: none; } }
.bell-pop .bell-head button, .bell-pop .bell-foot a { width: auto; display: inline-flex; padding: 4px 6px; }
.bell-pop .bell-head { align-items: center; }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; }

/* ---------- Kamera-Scanner ---------- */
.cam-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: var(--primary-soft); color: var(--primary); border-radius: 10px; padding: 7px 9px; cursor: pointer; font: inherit; font-weight: 600; font-size: .85rem; }
.cam-btn .icon { width: 20px; height: 20px; }
.cam-btn[hidden] { display: none !important; }
.searchbar.big .cam-btn { right: 8px; padding: 10px 12px; }
.searchbar.big input { padding-right: 120px; }
.global-search .gs-cam { right: 34px; padding: 4px 6px; background: none; }
.topbar.searching .global-search .gs-cam { right: 6px; }
.add-bar .cam-btn { position: static; transform: none; padding: 11px; }
html.scanner-open, html.scanner-open body { overflow: hidden; }
.scanner { position: fixed; inset: 0; z-index: 200; background: #000; color: #fff; display: flex; flex-direction: column; }
.scanner-top { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 10px 10px; }
.scanner-title { flex: 1; font-size: 1.05rem; }
.scanner-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.scanner-btn.on { background: #ffd54a; color: #000; }
.scanner-btn[hidden] { display: none; }
.scanner-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; }
.scanner-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: relative; width: min(78vw, 420px); aspect-ratio: 1.35; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); border-radius: 18px; }
.scanner-frame i { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; }
.scanner-frame i:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 18px 0 0 0; }
.scanner-frame i:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 18px 0 0; }
.scanner-frame i:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 18px; }
.scanner-frame i:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 18px 0; }
.scanner-line { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: #ff4d4d; box-shadow: 0 0 12px #ff4d4d; animation: scanline 1.8s ease-in-out infinite alternate; }
@keyframes scanline { from { top: 18%; } to { top: 82%; } }
.scanner.hit .scanner-frame i { border-color: #4dff88; }
.scanner.hit .scanner-frame { box-shadow: 0 0 0 100vmax rgba(0,80,30,.45); }
.scanner-bottom { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: #000; }
.scanner-status { font-weight: 600; margin-bottom: 8px; }
.scanner-cont { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; color: #ddd; }
.scanner-cont input { width: 20px; height: 20px; accent-color: #4dff88; }
.scanner-hits { list-style: none; margin: 8px 0 0; padding: 0; max-height: 84px; overflow: hidden; font-size: .82rem; color: #9fe6b6; }
.scanner-error { max-width: 420px; padding: 24px; text-align: center; line-height: 1.5; }
.scanner-error code { background: rgba(255,255,255,.15); padding: 1px 5px; border-radius: 4px; }

/* ---------- Orte als Baum ---------- */
.loc-tree2 { list-style: none; margin: 0; padding: 6px 0; }
.loc-tree2 > li { position: relative; padding-left: calc(var(--depth) * 26px); }
.loc-tree2 > li.root:not(:first-child) { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.lt-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; position: relative; }
.loc-tree2 li:not(.root) .lt-row::before { content: ''; position: absolute; left: -12px; top: 0; bottom: 50%; width: 14px; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); border-bottom-left-radius: 8px; }
.loc-tree2 li:not(.root):not(.last) .lt-row::after { content: ''; position: absolute; left: -12px; top: 50%; bottom: 0; border-left: 2px solid var(--line); }
.lt-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex-shrink: 0; }
.loc-tree2 li.root .lt-icon { background: var(--primary-soft); color: var(--primary); }
.lt-icon .icon { width: 18px; height: 18px; }
.lt-text { min-width: 0; }
.lt-text b, .lt-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-actions { display: flex; gap: 2px; flex-shrink: 0; }
.lt-actions .btn { padding: 6px 8px; }
@media (max-width: 700px) { .lt-label { display: none; } .loc-tree2 > li { padding-left: calc(var(--depth) * 16px); } }
.lt-panel { margin: 0 12px 10px 56px; padding: 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
select option.opt-root { font-weight: 700; }

/* Produktliste: Ansicht umschalten + Ansicht nach Orten */
.view-switch { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.view-switch a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .88rem; font-weight: 500; text-decoration: none; }
.view-switch a.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.view-switch .icon { width: 16px; height: 16px; }
.loc-crumb { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .88rem; font-weight: 600; }
.loc-crumb .icon { width: 15px; height: 15px; }
.loc-crumb a { color: inherit; text-decoration: none; padding: 0 2px 0 4px; }
.place-view { display: grid; gap: 8px; margin-top: 14px; }
.place { margin-left: calc(var(--depth) * 22px); padding: 10px 12px; }
.place > summary { display: flex; align-items: center; gap: 10px; }
.place-path { display: block; }
.place .list { margin-top: 6px; }
@media (max-width: 600px) { .place { margin-left: calc(var(--depth) * 12px); } }

.field-error { color: var(--danger); font-size: .9rem; margin-top: 6px; font-weight: 600; }
.choice-list { display: grid; gap: 8px; }
.choice-list .check { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.choice-list .check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }

/* ---------- Sonderangebote ---------- */
.offer-groups { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); align-items: start; }
.offer-group-head { align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.offer-group-head h2 a { color: inherit; }
.offer-list { list-style: none; margin: 0; padding: 0; }
.offer { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.offer:first-child { border-top: 0; }
.offer-img { width: 52px; height: 52px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--line); flex-shrink: 0; }
.offer-text { min-width: 0; }
.offer-title { font-weight: 600; overflow-wrap: anywhere; }
.offer-shop { color: var(--text); }
.offer-loyal { color: var(--warn); font-weight: 600; }
.offer-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; white-space: nowrap; }
.offer-price b { font-size: 1.1rem; }
.shop-offer { display: flex; align-items: flex-start; gap: 4px; margin-top: 4px; font-size: .82rem; line-height: 1.35; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 3px 8px; border-radius: 8px; width: fit-content; max-width: 100%; }
.shop-offer .icon { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
.shop-offer:hover { text-decoration: none; filter: brightness(.95); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; }

/* Inventur nebenbei */
.bk-verify { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--primary-soft); border: 1px solid var(--primary); display: grid; gap: 8px; }
.bk-verify p { margin: 0; }
.bk-verify .bk-verify-input { width: 110px; font-size: 1.2rem; font-weight: 700; text-align: center; }

/* Changelog */
.changelog h3 { margin: 22px 0 6px; font-size: 1.15rem; }
.changelog h3:first-of-type { margin-top: 6px; }
.changelog h4 { margin: 10px 0 4px; font-size: .95rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.changelog ul { margin: 0 0 6px; padding-left: 20px; line-height: 1.55; }
.changelog li { margin: 2px 0; }

/* Verbrauchsprognose */
.forecast-line { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2, rgba(0,0,0,.03)); }
.forecast-line .icon { flex-shrink: 0; margin-top: 2px; color: var(--muted); }
.forecast-line.soon { background: var(--warn-soft); }
.forecast-line.soon .icon, .forecast-line.soon b { color: var(--warn); }
.soon-head { display: flex; align-items: center; gap: 6px; margin: 16px 0 4px; font-size: .95rem; color: var(--warn); }
.status-soon .qty b { color: var(--warn); }
.fc-soon { color: var(--warn); font-weight: 600; }

/* Offline-Anzeige in der Kopfzeile */
.net-pill { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.net-pill .icon { width: 16px; height: 16px; }
.net-pill.off { background: var(--surface-2, #e9e7e1); color: var(--text); }
.net-pill.wait { background: var(--warn-soft); color: var(--warn); }
.net-pill.bad { background: var(--danger-soft, #fde3e1); color: var(--danger); }
.net-panel { position: fixed; z-index: 60; top: 64px; right: 12px; width: min(420px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.net-panel ul { margin: 6px 0 10px; padding-left: 18px; line-height: 1.5; }
.net-panel .err { color: var(--danger); font-size: .85rem; }
.bk-pending { opacity: .85; }
.bk-pending .badge { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 700px) { .net-pill span { display: none; } .net-pill { padding: 7px; } .net-pill.bad span, .net-pill.wait span { display: inline; } }

/* ---------- Anmeldung: Aufbau wie früher (Logo + Karte), Farben der neuen App ---------- */
body.login-v1 { padding: 0; min-height: 100vh; color: #14223a;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255,255,255,.18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(0,0,0,.18), transparent 60%),
    linear-gradient(135deg, #1d5fa8 0%, #2f7fc4 45%, #5b4fc4 100%); }
.lg-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.lg-card { width: 900px; max-width: 100%; display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px rgba(10, 25, 60, .35); }
.lg-pic { position: relative; overflow: hidden; display: grid; place-items: center; padding: 48px; background: linear-gradient(160deg, #f2f6fb, #e2eaf5); }
.lg-pic::after { content: ""; position: absolute; inset: auto -40px -40px auto; width: 180px; height: 180px; border-radius: 50%; background: rgba(29,95,168,.08); }
.lg-pic img { position: relative; z-index: 1; width: 100%; max-width: 280px; height: auto; display: block; filter: drop-shadow(0 18px 30px rgba(20, 60, 120, .25)); transition: transform .25s ease-out; will-change: transform; }
.lg-form { padding: 56px 52px 40px; display: flex; flex-direction: column; justify-content: center; }
.lg-title { margin: 0 0 28px; font-size: 1.75rem; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; color: #14223a; }
.lg-title span { display: block; margin-top: 6px; font-size: 1rem; font-weight: 600; color: #1d5fa8; }
.lg-input { position: relative; display: block; margin-bottom: 12px; }
.lg-input input { display: block; width: 100%; height: 52px; border: 1.5px solid #dde4ee; outline: 0; border-radius: 14px; padding: 0 16px 0 48px; background: #f5f7fb; color: #14223a; font: inherit; font-size: 1rem; font-weight: 500; transition: border-color .2s, box-shadow .2s, background .2s; }
.lg-input input::placeholder { color: #8792a3; }
.lg-input input:focus { border-color: #1d5fa8; background: #fff; box-shadow: 0 0 0 4px rgba(29,95,168,.15); }
.lg-icon { position: absolute; left: 0; top: 0; bottom: 0; display: flex; align-items: center; padding-left: 16px; color: #8792a3; pointer-events: none; transition: color .2s; }
.lg-icon .icon { width: 19px; height: 19px; }
.lg-input input:focus + .lg-icon { color: #1d5fa8; }
.lg-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; margin-top: 10px; border: 0; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, #1d5fa8, #2f7fc4); color: #fff; font: inherit; font-size: 1rem; font-weight: 700; box-shadow: 0 10px 22px rgba(29,95,168,.35); transition: transform .12s, box-shadow .2s, filter .2s; }
.lg-btn:hover { filter: brightness(1.06); box-shadow: 0 14px 28px rgba(29,95,168,.42); }
.lg-btn:active { transform: translateY(1px) scale(.99); }
.lg-btn:focus-visible { outline: 3px solid #5b4fc4; outline-offset: 3px; }
.lg-error { margin: -12px 0 16px; padding: 10px 14px; border-radius: 12px; background: #fdecea; color: #b3261e; font-size: .92rem; font-weight: 600; }
.lg-foot { margin: 22px 0 0; font-size: .82rem; line-height: 1.5; color: #8792a3; overflow-wrap: anywhere; }
.lg-foot a { color: #4c5a70; text-decoration: none; }
.lg-foot a:hover { color: #1d5fa8; text-decoration: underline; }
@media (max-width: 760px) {
  .lg-card { grid-template-columns: 1fr; max-width: 420px; border-radius: 22px; }
  .lg-pic { padding: 28px 28px 20px; }
  .lg-pic img { max-width: 140px; }
  .lg-form { padding: 26px 24px 26px; }
  .lg-title { text-align: center; font-size: 1.5rem; margin-bottom: 20px; }
  .lg-foot { text-align: center; }
}
/* Autofill des Browsers nicht blau einfärben */
.lg-input input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #f5f7fb inset; -webkit-text-fill-color: #14223a; caret-color: #14223a; }
.lg-input input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 40px #fff inset, 0 0 0 4px rgba(29,95,168,.15); }
@media (prefers-color-scheme: dark) {
  .lg-input input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #1e2735 inset; -webkit-text-fill-color: #eef2f8; caret-color: #eef2f8; }
  .lg-card { background: #141b26; }
  .lg-pic { background: linear-gradient(160deg, #1b2433, #131a25); }
  .lg-title { color: #eef2f8; } .lg-title span { color: #86b8f0; }
  .lg-input input { background: #1e2735; border-color: #2c3748; color: #eef2f8; }
  .lg-input input:focus { background: #1e2735; border-color: #86b8f0; }
  .lg-foot a { color: #b4bfd0; }
}

/* Bildfeld mit Vorschau */
.img-pick { display: flex; gap: 16px; align-items: center; padding: 12px; border: 2px dashed var(--line); border-radius: 16px; transition: border-color .2s, background .2s; }
.img-pick.drag { border-color: var(--primary); background: var(--primary-soft); }
.img-pick-preview { width: 104px; height: 104px; flex-shrink: 0; border-radius: 14px; overflow: hidden; background: var(--surface-2, #efeee9); display: grid; place-items: center; cursor: pointer; }
.img-pick-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-pick-empty { display: grid; justify-items: center; gap: 4px; color: var(--muted); font-size: .8rem; }
.img-pick-empty .icon { width: 28px; height: 28px; }
.img-pick-body { min-width: 0; display: grid; gap: 8px; }
.img-pick-body label.btn { cursor: pointer; }
.img-pick-body [data-img-name] { overflow-wrap: anywhere; }
@media (pointer: coarse) { .hide-touch { display: none; } }
@media (max-width: 420px) { .img-pick { flex-direction: column; align-items: stretch; text-align: center; } .img-pick-preview { width: 100%; height: 180px; } .img-pick-body .row { justify-content: center; } }

/* Andere Datei-Felder */
.file-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px; border: 2px dashed var(--line); border-radius: 14px; cursor: pointer; transition: border-color .2s, background .2s; }
.file-pick:hover, .file-pick.drag { border-color: var(--primary); }
.file-pick.drag { background: var(--primary-soft); }
.file-pick.has-file { border-style: solid; border-color: var(--primary); }
.file-pick .btn { pointer-events: none; }
.file-pick-name { min-width: 0; overflow-wrap: anywhere; font-size: .92rem; }
.file-pick.has-file .file-pick-name { font-weight: 600; }
textarea { resize: vertical; min-height: 2.8em; }


/* =====================================================================
   Design 2.10: klare Bereiche
   – am PC eine feste Menüleiste links (in der Akzentfarbe, sehr dunkel)
   – Karten weiß mit sichtbarem Rand, Überschriften als abgesetzte Kopfzeile
   – am Handy dunkle Kopfzeile, Leiste unten klar abgesetzt
   ===================================================================== */
@font-face { font-family: "Lexend"; font-weight: 400; font-display: swap; src: url("fonts/lexend-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-weight: 500; font-display: swap; src: url("fonts/lexend-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-weight: 600; font-display: swap; src: url("fonts/lexend-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-weight: 700; font-display: swap; src: url("fonts/lexend-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-weight: 800; font-display: swap; src: url("fonts/lexend-latin-800-normal.woff2") format("woff2"); }

body { font-variant-numeric: tabular-nums; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.012em; line-height: 1.15; }
h2 { font-size: 1.08rem; font-weight: 700; }

/* ---- Karten: sichtbarer Rand, Kopfzeile ---- */
.card { border-color: var(--edge); box-shadow: var(--shadow); }
.card > h2:first-child,
.card > .row:first-child:has(> h2) {
  margin: -16px -16px 14px; padding: 12px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card > .row:first-child:has(> h2) h2 { margin: 0; }
.card > h2:first-child .icon, .card > .row:first-child h2 .icon { color: var(--primary); }
.card.flush > h2:first-child, .card.flush > .row:first-child:has(> h2) { margin: 0; }
.list { border-color: var(--edge); }

/* ---- Handy: dunkle Kopfzeile ---- */
.topbar { background: var(--frame); border-bottom: 0; color: var(--frame-ink); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.topbar .brand, .topbar .back { color: var(--frame-ink); }
.topbar .brand .logo { background: rgba(255,255,255,.12); color: #fff; }
.topbar .btn.ghost, .topbar .gs-open, .topbar summary, .topbar .user-name { color: var(--frame-ink); }
.topbar .muted { color: var(--frame-muted); }
.topbar .btn.ghost:hover, .topbar summary:hover { background: rgba(255,255,255,.1); }
.topbar .menu-pop, .topbar .gs-results { color: var(--text); }
.topbar .net-pill.off { background: rgba(255,255,255,.14); color: #fff; }
.nav { border-top: 1px solid var(--edge); box-shadow: 0 -2px 12px rgba(20,40,30,.08); }
.nav a.active { position: relative; }
.nav a.active::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: currentColor; }

/* ---- Seitenleiste (nur PC) ---- */
.sidebar { display: none; }
@media (min-width: 1000px) {
  body.has-sidebar { padding-left: var(--side-w); }
  .sidebar {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 25;
    background: var(--frame); color: var(--frame-ink); padding: 18px 14px 14px; overflow-y: auto;
  }
  .side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: #fff; font-weight: 800; font-size: 1.08rem; line-height: 1.2; text-decoration: none; }
  .side-brand:hover { text-decoration: none; }
  .side-brand .logo { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
  .side-nav { display: grid; gap: 18px; }
  .side-label { padding: 0 12px 6px; font-size: .8rem; font-weight: 600; color: var(--frame-muted); }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--frame-ink); font-weight: 500; text-decoration: none; }
  .side-link .icon { width: 19px; height: 19px; opacity: .8; }
  .side-link:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
  .side-link.active { background: var(--frame-2); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 hsl(var(--accent-h) 70% 60%); }
  .side-link.active .icon { opacity: 1; }
  .side-out.active { box-shadow: inset 3px 0 0 #f2877e; }
  .side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); display: grid; gap: 4px; }
  .side-version { padding: 4px 12px; font-size: .8rem; color: var(--frame-muted); }
  .side-version:hover { color: var(--frame-ink); }

  /* Kopfzeile am PC: hell, nur Suche + Glocke + Benutzer */
  .topbar { background: var(--surface); color: var(--text); border-bottom: 1px solid var(--edge); box-shadow: none; padding: 0 28px; min-height: 64px; }
  .topbar .brand, .topbar > .nav { display: none; }
  .topbar .btn.ghost, .topbar .gs-open, .topbar summary, .topbar .user-name { color: var(--text); }
  .topbar .muted { color: var(--muted); }
  .topbar .btn.ghost:hover, .topbar summary:hover { background: var(--surface-2); }
  .topbar .back { color: var(--text); }
  .topbar .net-pill.off { background: var(--surface-2); color: var(--text); }
  .topbar .global-search { flex: 0 1 560px; margin-right: auto; }
  .topbar .spacer { display: none; }
  .page { padding: 28px 32px 40px; }
}
@media (min-width: 860px) and (max-width: 999px) {
  /* Tablet quer: Menü oben wie bisher, aber in der dunklen Kopfzeile */
  .topbar .nav a { color: var(--frame-muted); }
  .topbar .nav a:hover, .topbar .nav a.active { color: #fff; }
  .topbar .nav a.active { border-bottom-color: #fff; }
  .topbar .global-search { background: rgba(255,255,255,.1); }
}

/* Suche in der Kopfzeile am Handy/Tablet lesbar auf dunklem Grund */
@media (max-width: 999px) {
  .topbar .global-search input { color: var(--text); }
}

@media (min-width: 1000px) {
  .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 1750px) { .quick-actions { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
/* Handy: Schnellaktionen dürfen zweizeilig sein statt abgeschnitten */
@media (max-width: 699px) {
  .qa { padding: 12px; gap: 10px; }
  .qa b { white-space: normal; line-height: 1.2; font-size: .95rem; }
  .qa-icon { width: 38px; height: 38px; }
}

/* Kamera-Knopf in Suchfeldern: Symbol nicht wie das Lupen-Symbol positionieren */
.searchbar .cam-btn .icon, .global-search .cam-btn .icon { position: static; transform: none; top: auto; left: auto; width: 20px; height: 20px; color: inherit; }
@media (max-width: 480px) { .searchbar.big .cam-btn span { display: none; } .searchbar.big input { padding-right: 64px; } }
.searchbar.big input { padding-right: 132px; }
.global-search input { padding-right: 120px; }
.global-search .gs-key { right: 10px; letter-spacing: .02em; }
.global-search .gs-cam { right: 62px; }
@media (max-width: 999px) { .global-search .gs-key { display: none; } .global-search .gs-cam { right: 8px; } .global-search input { padding-right: 44px; } }


/* =====================================================================
   2.11: ruhiger – weniger Deko, mehr Werkzeug
   ===================================================================== */
:root { --radius: 8px; --radius-sm: 6px; --shadow: none; }
.card { box-shadow: none; }
/* Kartenüberschrift: nur eine Linie darunter, keine Fläche, kein Symbol */
.card > h2:first-child,
.card > .row:first-child:has(> h2) { background: none; padding: 12px 16px 11px; }
.card h2 > .icon, .card > .row:first-child h2 > .icon { display: none; }
/* Knöpfe flach */
.btn { box-shadow: none; }
/* Seitenleiste schlichter */
@media (min-width: 1000px) {
  .side-link.active, .side-out.active { box-shadow: none; background: rgba(255,255,255,.1); }
  .side-brand .logo { box-shadow: none; background: rgba(255,255,255,.12); }
  .side-label { font-weight: 500; }
}
.nav a.active::before { display: none; }

/* Startseite */
.home-head { align-items: baseline; }
.home-head h1 { flex: 0 1 auto; }
.home-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.btn.primary.btn-out { background: var(--danger); border-color: var(--danger); }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 16px; padding: 0; overflow: hidden; }
.summary a { display: block; padding: 12px 16px; color: var(--text); text-decoration: none; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary a:hover { background: var(--surface-2); text-decoration: none; }
.summary dt { font-size: .85rem; color: var(--muted); }
.summary dd { margin: 2px 0 0; font-size: 1.35rem; font-weight: 700; }
.summary .is-warn dd { color: var(--warn); }
.summary .is-bad dd { color: var(--danger); }
@media (min-width: 900px) {
  .summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .summary a { border-bottom: 0; }
  .summary a:last-child { border-right: 0; }
}
@media (max-width: 899px) { .summary a:nth-child(3n) { border-right: 0; } .summary a:nth-child(n+4) { border-bottom: 0; } }
@media (max-width: 699px) { .home-bar .btn { flex: 1 1 calc(50% - 8px); justify-content: center; } .home-bar .btn:not(.primary) { display: none; } }

/* Anmeldung ruhiger */
.lg-pic::after { display: none; }
.lg-pic img { filter: none; }
.lg-btn { background: #1d5fa8; box-shadow: none; }
.lg-btn:hover { background: #174d8a; box-shadow: none; filter: none; }
.lg-card { box-shadow: 0 10px 40px rgba(10, 25, 60, .25); border-radius: 14px; }

/* =====================================================================
   2.11.1: kompakter am PC (wirkte wie hineingezoomt)
   Am Handy bleiben Knöpfe/Felder groß genug zum Tippen.
   ===================================================================== */
@media (min-width: 1000px) {
  body { font-size: 14.5px; line-height: 1.45; }
  h1 { font-size: 1.45rem; }
  h2 { font-size: 1rem; }
  .page { padding: 22px 28px 36px; }
  .card { padding: 14px; }
  .card > h2:first-child, .card > .row:first-child:has(> h2) { margin: -14px -14px 12px; padding: 10px 14px 9px; }
  .card.flush > h2:first-child, .card.flush > .row:first-child:has(> h2) { margin: 0; }
  .btn { min-height: 36px; padding: 7px 13px; font-size: .92rem; gap: 6px; }
  .btn.small { min-height: 30px; padding: 4px 10px; font-size: .85rem; }
  .btn .icon { width: 17px; height: 17px; }
  input[type=text], input[type=password], input[type=search], input[type=number], input[type=email], input[type=url], input[type=date], input:not([type]), select, textarea {
    min-height: 38px; padding: 7px 11px; font-size: .95rem;
  }
  select { padding-right: 32px; }
  textarea { min-height: 70px; }
  .field { margin-bottom: 12px; }
  .item { padding: 9px 12px; gap: 10px; }
  .thumb { width: 38px; height: 38px; }
  .list .item .qty b { font-size: 1rem; }
  .summary a { padding: 9px 14px; }
  .summary dd { font-size: 1.15rem; }
  .home-bar { gap: 6px; margin-bottom: 14px; }
  .stack > * + * { margin-top: 12px; }
  .split, .split > .col { gap: 16px; }
  .dash-grid { gap: 16px; }
  .topbar { min-height: 56px; }
  .global-search input { min-height: 36px; }
  .side-link { padding: 7px 12px; font-size: .95rem; }
  .side-nav { gap: 14px; }
  .side-brand { font-size: 1rem; padding-bottom: 14px; }
  .total-big { font-size: 2rem; }
  .vchart { --vh: 150px; }
  .settings-nav a { padding-top: 7px; padding-bottom: 7px; }
}
/* Handy: etwas weniger Luft, Schrift bleibt 16px (sonst zoomt iOS beim Tippen) */
@media (max-width: 999px) {
  .page { padding: 12px; }
  .card { padding: 13px; }
  .card > h2:first-child, .card > .row:first-child:has(> h2) { margin: -13px -13px 11px; padding: 10px 13px 9px; }
  .card.flush > h2:first-child, .card.flush > .row:first-child:has(> h2) { margin: 0; }
  h1 { font-size: 1.35rem; }
  .item { padding: 10px 12px; }
  .summary dd { font-size: 1.1rem; }
  .summary a { padding: 8px 12px; }
}
.summary.card { padding: 0; }
.global-search input { padding-left: 36px; }
.searchbar input { padding-left: 40px; }
.searchbar.big input { padding-left: 44px; }
@media (min-width: 1000px) {
  .list.compact .qty { display: flex; flex-direction: row-reverse; align-items: baseline; gap: 8px; }
  .list.compact .qty .unit { display: inline; }
  .list.compact .item { padding-top: 8px; padding-bottom: 8px; }
}

/* Anmeldung: Hinweis + Angemeldet bleiben */
.lg-info { margin: -12px 0 16px; padding: 10px 14px; border-radius: 10px; background: #e8f0fb; color: #1d4f8c; font-size: .92rem; font-weight: 600; }
.lg-remember { display: flex; align-items: center; gap: 8px; margin: 4px 0 2px; font-size: .9rem; color: #3d4a5e; cursor: pointer; }
.lg-remember input { width: 17px; height: 17px; accent-color: #1d5fa8; }
.lg-remember span { color: #8792a3; }
@media (prefers-color-scheme: dark) { .lg-info { background: #1b2a40; color: #a9c8f2; } .lg-remember { color: #b4bfd0; } }

/* Hinweis kurz vor dem automatischen Abmelden */
.idle-warn { position: fixed; z-index: 80; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%); width: min(460px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--text); color: var(--surface); box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.idle-warn .grow { font-size: .95rem; }
.idle-warn .btn { background: var(--surface); color: var(--text); border-color: transparent; }
@media (min-width: 1000px) { .idle-warn { bottom: 20px; } }
.side-company { padding: 0 12px 2px; font-size: .75rem; line-height: 1.35; color: var(--frame-muted); opacity: .8; }
.side-company:hover { color: var(--frame-ink); opacity: 1; text-decoration: none; }
/* keine Großbuchstaben-Etiketten */
.table th, .changelog h4 { text-transform: none; letter-spacing: 0; }
@media (min-width: 700px) { .settings-group-label { text-transform: none; letter-spacing: 0; font-size: .8rem; font-weight: 600; } }

/* ---- Ausrichtung ---- */
/* Bestand / Mindestmenge: Beschriftungen auf einer Linie, Zahlen auf einer Grundlinie */
.stock-facts { display: grid; grid-template-columns: 1fr auto; column-gap: 24px; row-gap: 2px; align-items: baseline; margin-top: 16px; }
.stock-facts > :nth-child(2n) { text-align: right; }
.stock-facts .total-big .unit { font-size: 1rem; font-weight: 500; color: var(--muted); }
.stock-facts .total-big.min { color: var(--muted); }
/* Knöpfe in Zeilen nicht strecken */
.form-actions.compact .btn.primary { flex: 0 0 auto; }
.form-actions.compact { align-items: center; }
/* Mitlaufende rechte Spalte genau auf Höhe der linken */
@media (min-width: 1000px) { .sticky-col { top: 78px; } }
@media (min-width: 860px) and (max-width: 999px) { .sticky-col { top: 78px; } }
/* Kopfzeile auch bei Formular-Karten (versteckte Felder davor) */
.card > input[type=hidden]:first-child + h2,
.card > input[type=hidden]:first-child + input[type=hidden] + h2 {
  margin: -14px -14px 12px; padding: 10px 14px 9px; border-bottom: 1px solid var(--line);
}
@media (max-width: 999px) { .card > input[type=hidden]:first-child + h2, .card > input[type=hidden]:first-child + input[type=hidden] + h2 { margin: -13px -13px 11px; padding: 10px 13px 9px; } }
/* Balken in Statistik-Listen beginnen und enden überall gleich */
.hbars li { grid-template-columns: minmax(0, 1fr) minmax(80px, 1fr) 3.2em; }
.hbars li > :last-child { text-align: right; }
/* Kopfzeile: Zähler neben dem Titel */
.page-head .head-count { align-self: baseline; margin-right: auto; }
.page-head h1 + .head-count { margin-left: 4px; }
/* "Zuletzt gebucht": Knöpfe an der ersten Zeile ausrichten */
.recent-actions { align-self: flex-start; margin-top: -4px; }
.page-head h1:has(+ .head-count) { flex: 0 1 auto; }

/* =====================================================================
   2.12.3: Anmeldung – Felder unabhängig von den allgemeinen Feld-Regeln
   (höhere Spezifität, damit Symbol und Text nicht übereinanderliegen)
   ===================================================================== */
body.login-v1 .lg-input input {
  height: 52px; min-height: 52px; padding: 0 16px 0 48px; font-size: 1rem; line-height: 52px;
  border: 1.5px solid #dde4ee; border-radius: 14px; background: #f5f7fb; color: #14223a;
}
body.login-v1 .lg-input input:focus { border-color: #1d5fa8; background: #fff; box-shadow: 0 0 0 4px rgba(29,95,168,.15); }
/* Automatisch ausgefüllt (Chrome/Edge/Safari): Farben selbst bestimmen */
body.login-v1 .lg-input input:-webkit-autofill,
body.login-v1 .lg-input input:-webkit-autofill:hover { -webkit-box-shadow: 0 0 0 60px #f5f7fb inset; -webkit-text-fill-color: #14223a; caret-color: #14223a; transition: background-color 9999s; }
body.login-v1 .lg-input input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 60px #fff inset, 0 0 0 4px rgba(29,95,168,.15); -webkit-text-fill-color: #14223a; }
body.login-v1 .lg-remember { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; font-size: .92rem; font-weight: 500; color: #3d4a5e; cursor: pointer; }
body.login-v1 .lg-remember input { width: 18px; height: 18px; min-height: 0; margin: 0; flex-shrink: 0; accent-color: #1d5fa8; }
body.login-v1 .lg-remember small { font-size: .85em; color: #8792a3; font-weight: 400; }
@media (prefers-color-scheme: dark) {
  body.login-v1 .lg-input input { background: #1e2735; border-color: #2c3748; color: #eef2f8; }
  body.login-v1 .lg-input input::placeholder { color: #7d8aa0; }
  body.login-v1 .lg-input input:focus { background: #1e2735; border-color: #86b8f0; box-shadow: 0 0 0 4px rgba(134,184,240,.18); }
  body.login-v1 .lg-input input:-webkit-autofill,
  body.login-v1 .lg-input input:-webkit-autofill:hover { -webkit-box-shadow: 0 0 0 60px #1e2735 inset; -webkit-text-fill-color: #eef2f8; caret-color: #eef2f8; }
  body.login-v1 .lg-input input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 60px #1e2735 inset, 0 0 0 4px rgba(134,184,240,.18); -webkit-text-fill-color: #eef2f8; }
  body.login-v1 .lg-input input:focus + .lg-icon { color: #86b8f0; }
  body.login-v1 .lg-remember { color: #c3ccda; }
  body.login-v1 .lg-remember small { color: #8a96aa; }
  body.login-v1 .lg-btn { background: #2a6fc0; }
  body.login-v1 .lg-btn:hover { background: #3480d6; }
}

/* =====================================================================
   2.12.4: Filterleiste – alle Teile gleich hoch, auf einer Linie
   ===================================================================== */
:root { --ctl-h: 42px; }
@media (min-width: 1000px) { :root { --ctl-h: 38px; } }
.filter-row { align-items: center; }
.filter-row .searchbar input { height: var(--ctl-h); min-height: var(--ctl-h); padding-top: 0; padding-bottom: 0; }
.filter-row .chips { align-items: center; padding: 0; }
.chip { height: var(--ctl-h); padding: 0 14px; box-sizing: border-box; }
.chip .icon { width: 16px; height: 16px; flex-shrink: 0; }
.filter-row .chip select, .chip select {
  height: auto; min-height: 0; padding: 0 22px 0 0; margin: 0; border: 0; background-color: transparent; box-shadow: none; font-size: .88rem; line-height: 1;
}
@media (min-width: 860px) { .filter-row > * + * { margin-top: 0; } }
/* Ansicht umschalten: kleiner Umschalter neben "Neu" */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--edge); border-radius: 10px; background: var(--surface); }
.segmented a { display: inline-flex; align-items: center; gap: 6px; height: calc(var(--ctl-h) - 8px); padding: 0 12px; border-radius: 7px; color: var(--text); font-size: .88rem; font-weight: 500; text-decoration: none; }
.segmented a .icon { width: 16px; height: 16px; }
.segmented a:hover { background: var(--surface-2); text-decoration: none; }
.segmented a.active { background: var(--primary); color: var(--primary-ink); }
.page-head .segmented + .btn { height: var(--ctl-h); }
.page-head:has(.segmented) h1 { flex: 1; }
.loc-crumb-row { margin-top: 10px; }
@media (max-width: 600px) { .segmented a { padding: 0 9px; } .segmented a .icon { display: none; } }
label.chip { margin: 0; font-weight: 500; }
.chip select { max-width: 190px; text-overflow: ellipsis; }
.page-head { align-items: center; }
.page-head > .btn, .page-head > .segmented, .page-head > form, .page-head > a { margin-top: 0; margin-bottom: 0; align-self: center; }

/* =====================================================================
   Inventur
   ===================================================================== */
.inv-layout { display: grid; gap: 14px; align-items: start; }
@media (min-width: 1100px) { .inv-layout { grid-template-columns: 340px minmax(0, 1fr); } .inv-tools { position: sticky; top: 72px; } }
.inv-tools { display: grid; gap: 12px; }
.inv-progress .progress { margin-top: 6px; }
.inv-groups { display: grid; gap: 14px; }
.inv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 3.2em; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.inv-group > h2 + .inv-row { border-top: 0; }
.inv-name { min-width: 0; display: grid; }
.inv-name b { overflow-wrap: anywhere; }
.inv-input { display: flex; align-items: center; gap: 6px; }
.inv-input input { width: 84px; text-align: right; font-weight: 700; font-size: 1.05rem; }
.inv-input input.invalid { border-color: var(--danger); }
.inv-state { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-row.is-ok .inv-state { color: var(--ok); }
.inv-row.is-diff .inv-state { color: var(--warn); }
.inv-row.is-diff .inv-input input { border-color: var(--warn); }
.inv-row.is-ok .inv-input input { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.inv-row.saving { opacity: .7; }
.inv-row.flash-row { background: var(--primary-soft); border-radius: 6px; transition: background .2s; }
.inv-places { padding: 10px; border-radius: 8px; background: var(--warn-soft); display: grid; gap: 8px; }
.inv-filter { justify-self: start; }
@media (max-width: 600px) {
  .inv-row { grid-template-columns: minmax(0, 1fr) auto 2.8em; }
  .inv-row .inv-same { display: none; }
  .inv-input input { width: 72px; }
}
.inv-name .badge { justify-self: start; margin: 2px 0; }
.searchbar.big .cam-btn[hidden] { display: none; }
.searchbar.big:not(:has(.cam-btn:not([hidden]))) input { padding-right: 14px; }
.inv-input .muted { display: inline-block; min-width: 3.6em; }
@media (max-width: 699px) {
  .page-head h1 { flex: 1 1 100%; }
  .page-head .head-count { flex: 1 1 100%; margin: -6px 0 0; }
  .page-head .head-count + * { margin-left: auto; }
}

/* ---------- 2.14.0: EANs als Liste ---------- */
.ean-list { list-style: none; margin: 0 0 10px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; display: block; width: 100%; }
.ean-list > .ean-row { display: grid; width: 100%; box-sizing: border-box; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; margin: 0; background: var(--surface); }
.ean-list > .ean-row + .ean-row { border-top: 1px solid var(--line); }
.ean-thumb { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); }
.ean-thumb .icon { width: 20px; height: 20px; }
.ean-row.is-new .ean-thumb { background: var(--primary-soft); color: var(--primary); }
.ean-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.ean-code { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .02em; overflow-wrap: anywhere; }
.ean-meta { font-size: .8rem; color: var(--muted); }
.ean-row.is-new .ean-meta { color: var(--primary); }
.ean-note { font-size: .8rem; display: flex; gap: 5px; align-items: flex-start; }
.ean-note .icon { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.ean-note.bad { color: var(--danger); font-weight: 600; }
.ean-note.warn { color: var(--warn); }
.ean-row.is-clash { background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.ean-row.is-clash .ean-thumb { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); }
.ean-row.is-removed .ean-code { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.ean-row.is-removed .ean-thumb { opacity: .45; }
.ean-row .btn.icon-only { min-width: var(--ctl-h); width: var(--ctl-h); height: var(--ctl-h); padding: 0; margin: 0; }
.ean-row .btn.small { margin: 0; }
.ean-empty { padding: 12px; color: var(--muted); font-size: .9rem; }
.ean-add-row { display: flex; gap: 8px; align-items: stretch; }
.ean-add-row input { flex: 1; min-width: 0; height: var(--ctl-h); margin: 0; font-variant-numeric: tabular-nums; }
.ean-add-row .btn { height: var(--ctl-h); margin: 0; white-space: nowrap; }
.ean-tools { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 4px; }
#ean-hint.is-msg { color: var(--text); font-weight: 600; }
.ean-quick { margin-top: 12px; }
.ean-card { display: flex; flex-direction: column; align-items: stretch; }
.ean-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; margin-top: 6px; }
.ean-card-foot .badge { margin: 0; }
.ean-card-foot form { margin: 0 0 0 auto; }
.ean-card-foot .btn.icon-only { min-width: 30px; width: 30px; height: 30px; padding: 0; margin: 0; color: #666; background: transparent; }
.ean-card-foot .btn.icon-only:hover, .ean-card-foot .btn.icon-only:focus-visible { color: var(--danger); }
@media (max-width: 520px) {
  .ean-add-row .btn:has(.ean-btn-text) { width: var(--ctl-h); min-width: var(--ctl-h); padding: 0; justify-content: center; }
  .ean-btn-text { display: none; }
}

/* ---------- 2.15.0: Angebote – Suche und Ansicht ---------- */
.offer-search { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.offer-search .searchbar { flex: 1; min-width: 0; margin: 0; }
.offer-search .btn { height: var(--ctl-h); margin: 0; }
.offer-search-result { margin-bottom: 18px; }
.offer-sub { font-size: 1rem; margin: 4px 0 10px; }
.offer-open { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.offer .offer-img { width: 52px; height: 52px; display: grid; place-items: center; position: relative; overflow: hidden; }
.offer .offer-img img { width: 100%; height: 100%; object-fit: contain; }
.offer .offer-zoom { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; padding: 2px; border-radius: 50%; background: rgba(255,255,255,.9); color: #333; opacity: 0; transition: opacity .15s; }
.offer .offer-open:hover .offer-zoom, .offer .offer-open:focus-visible .offer-zoom { opacity: 1; }
@media (hover: none) { .offer .offer-zoom { opacity: .85; } }
button.offer-title:hover { color: var(--primary); }
.offer-open:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.offer-dialog { max-width: 520px; padding: 0; overflow: hidden; }
.offer-dialog .od-close { position: absolute; top: 8px; right: 8px; z-index: 1; background: rgba(255,255,255,.92); color: #222; min-width: 36px; width: 36px; height: 36px; padding: 0; font-size: 1rem; }
.od-img { background: #fff; display: grid; place-items: center; height: min(52vh, 380px); border-bottom: 1px solid var(--line); }
.od-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.od-body { padding: 14px 18px 18px; }
.od-body h2 { margin: 2px 0 6px; font-size: 1.1rem; }
.od-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.od-price b { font-size: 1.35rem; }
.od-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.od-actions form { margin: 0; }
@media (max-width: 520px) {
  .offer-search { flex-wrap: wrap; }
  .offer-search .searchbar { flex: 1 1 100%; }
  .offer-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--radius) var(--radius) 0 0; }
  .od-actions .btn { flex: 1; justify-content: center; }
}
.od-img[hidden] { display: none; }
.offer-dialog:has(.od-img[hidden]) .od-body { padding-top: 22px; padding-right: 52px; }
@media (max-width: 520px) { .od-actions form { flex: 1; display: flex; } }

/* ---------- 2.15.1: Upload-Fortschritt ---------- */
.upload-progress { margin: 4px 0 12px; }
.up-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.up-bar span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.up-text { margin-top: 6px; color: var(--muted); }
.upload-progress.is-error .up-text { color: var(--danger); font-weight: 600; }
.upload-progress.is-error .up-bar span { background: var(--danger); }

/* ---------- 2.17.0: Startseite ohne Lücken, Diagramm anklickbar ---------- */
.dash-cols .dash-col { display: contents; }
.dash-cols .dash-col > * { order: var(--o, 9); }
.dash-cols { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
@media (min-width: 980px) {
  .dash-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .dash-cols .dash-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
}
.vc-slot { flex: 0 1 min(42%, 18px); height: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: 4px 4px 0 0; }
.vc-slot .vc-bar { width: 100%; }
a.vc-slot { cursor: pointer; }
a.vc-slot:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
a.vc-slot:hover .vc-bar, a.vc-slot:focus-visible .vc-bar { opacity: 1; }
a.vc-slot:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
a.vc-label { color: var(--muted); text-decoration: none; }
a.vc-label:hover { color: var(--primary); text-decoration: underline; }
.dash-chart .vchart { margin-bottom: 6px; }

/* ---------- 2.18.0: Drucken ---------- */
.print-frame { position: fixed; right: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }
.print-toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 90;
  background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: 0 6px 24px rgba(0,0,0,.2);
  opacity: 0; transition: opacity .2s, transform .2s; max-width: min(92vw, 560px); font-size: .92rem; pointer-events: none; }
.print-toast.show { opacity: 1; transform: translate(-50%, 0); }
.print-toast.is-bad { background: var(--danger); color: #fff; }
@media (max-width: 999px) { .print-toast { bottom: calc(76px + env(safe-area-inset-bottom)); } }
.is-busy { opacity: .6; cursor: progress; }
.printer-device { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.printers-table td { vertical-align: top; }
#printer-form [hidden] { display: none !important; }

/* ---------- 2.20.0: Seiten in der Produktliste ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 4px; flex-wrap: wrap; }
.pager .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.pager-pages { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: center; }
.pager-num { min-width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); font-variant-numeric: tabular-nums; }
a.pager-num:hover { background: var(--surface-2); }
.pager-num.is-current { background: var(--primary); color: #fff; font-weight: 600; }

/* ---------- 2.20.0: Fehlende Bilder nachladen ---------- */
.mi-drop { display: flex; align-items: center; gap: 14px; border: 2px dashed var(--line); background: var(--surface); }
.mi-drop > .icon { width: 28px; height: 28px; color: var(--muted); flex: none; }
.mi-drop.is-over, .mi-row.is-over { border-color: var(--primary); background: var(--primary-soft); }
.mi-drop label.btn { margin: 0; }
.mi-row { display: flex; align-items: center; gap: 12px; padding: 8px 14px; }
.mi-thumb { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); overflow: hidden;
  background-image: linear-gradient(45deg, #0001 25%, transparent 25%, transparent 75%, #0001 75%), linear-gradient(45deg, #0001 25%, transparent 25%, transparent 75%, #0001 75%);
  background-size: 10px 10px; background-position: 0 0, 5px 5px; }
.mi-thumb img { width: 100%; height: 100%; object-fit: contain; }
.mi-text { display: flex; flex-direction: column; min-width: 0; }
.mi-text .small { overflow-wrap: anywhere; }
.mi-row label.btn { margin: 0; }
.mi-row.is-done .mi-text .small::after { content: ' · ✓ übernommen'; color: var(--ok, #1d7a46); font-weight: 600; }
.mi-row.is-error .mi-text .small { color: var(--danger); }
.mi-row.is-busy { opacity: .6; }
.req { color: var(--danger); font-weight: 700; margin-left: 2px; }
.mi-drop .grow { min-width: 0; }
@media (max-width: 640px) { .mi-drop { flex-wrap: wrap; } .mi-drop label.btn { width: 100%; justify-content: center; } }

/* ---------- 2.21.0: Telegram-Bot ---------- */
.tg-users { list-style: none; margin: 0; padding: 0; }
.tg-users li { flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tg-users li:last-child { border-bottom: 0; }
.tg-link-out { flex: 1 1 100%; font-size: .85rem; margin: 2px 0 6px; }

/* ---------- 2.21.1: Produktbilder nie abschneiden ---------- */
/* Ganzes Bild zeigen (Flaschen, hohe Packungen); heller Grund, damit Fotos mit weißem Rand und freigestellte PNGs gleich aussehen */
img.thumb, .product-hero img.photo, .bk-head .thumb img, .img-pick-preview img, .mi-thumb img, .offer-img img {
  object-fit: contain; background: #fff;
}
img.thumb, .product-hero img.photo { padding: 3px; box-sizing: border-box; }

/* ---------- 2.21.2: Auswahlfelder bleiben in ihrer Karte ---------- */
.verify-fields { min-width: 0; max-width: 100%; }
.verify-fields select { max-width: 100%; min-width: 0; flex: 1 1 auto; text-overflow: ellipsis; }
.roles-grid > * { min-width: 0; }
.roles-grid select, .roles-grid input:not([type=checkbox]):not([type=radio]) { max-width: 100%; }
/* Vorschau im Formular: Bild in die Box einpassen (Grid-Zelle hat sonst keine feste Höhe -> Bild lief unten raus) */
.img-pick-preview { grid-template-rows: 100%; grid-template-columns: 100%; }
.img-pick-preview img { min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; background: #fff; }
/* Einstellung mit Zahl mitten im Satz: alles auf einer Linie */
.inline-setting { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.inline-setting input[type=number] { margin: 0; height: var(--ctl-h); }
.inline-setting .check { align-items: center; }
.inline-num { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }

/* ---------- 2.23.0: Statistik-Zeiträume ---------- */
.stats-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 14px; }
.stats-filter .chips { flex-wrap: wrap; }
.chips-sep { width: 1px; align-self: stretch; background: var(--line); margin: 4px 4px; }
.stats-free { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stats-free input[type=date] { width: auto; height: var(--ctl-h); margin: 0; }
.stats-free .btn { height: var(--ctl-h); margin: 0; }
.kpi-cmp { font-size: .8rem; font-weight: 600; color: var(--muted); margin-left: 4px; vertical-align: middle; }
.pager-head { margin: 0 2px 4px; }
.history-days > .pager:first-of-type { margin-top: 0; margin-bottom: 14px; }
#liste { scroll-margin-top: 70px; }

/* ---------- 2.23.2: Orte – Zeile verfolgen ---------- */
/* Punktlinie vom Namen bis zu den Knöpfen + ganze Zeile beim Überfahren hervorheben */
.lt-text { flex: 0 1 auto; }
.lt-leader { flex: 1 1 24px; min-width: 24px; align-self: center; border-bottom: 2px dotted color-mix(in srgb, var(--muted) 35%, transparent); margin: 0 6px; transform: translateY(2px); }
.loc-tree2 > li { transition: background-color .12s; }
.loc-tree2 > li:has(> .lt-row:hover), .loc-tree2 > li:has(> .lt-row:focus-within), .loc-tree2 > li:has(> .lt-panel:not(.hidden)) { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.loc-tree2 > li:has(> .lt-row:hover) .lt-leader { border-bottom-color: color-mix(in srgb, var(--primary) 55%, transparent); }
.loc-tree2 > li:has(> .lt-row:hover) .lt-text b { color: var(--primary); }
.loc-tree2 > li:not(.root) { border-top: 1px solid color-mix(in srgb, var(--line) 45%, transparent); }
@media (max-width: 700px) { .lt-leader { display: none; } .lt-text { flex: 1 1 auto; } }

/* ---------- 2.24.0: Produktliste – Auswahl ---------- */
.list-head { margin: 0 0 8px; align-items: center; }
.bulk-check { display: none; width: 22px; height: 22px; flex: none; border: 2px solid var(--line); border-radius: 6px; background: var(--surface); position: relative; }
.bulk-mode .bulk-check { display: inline-block; }
.bulk-mode .product-grid li { cursor: pointer; }
.product-grid li.is-selected { outline: 2px solid var(--primary); outline-offset: -2px; background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.product-grid li.is-selected .bulk-check { background: var(--primary); border-color: var(--primary); }
.product-grid li.is-selected .bulk-check::after { content: ''; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.bulk-bar { position: sticky; bottom: 12px; z-index: 30; margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.bulk-bar select, .bulk-bar input { width: auto; max-width: 260px; height: var(--ctl-h); margin: 0; }
.bulk-bar .btn { height: var(--ctl-h); margin: 0; }
.bulk-count { margin-right: 4px; }
@media (max-width: 999px) { .bulk-bar { bottom: calc(72px + env(safe-area-inset-bottom)); } }
/* Filterleiste der Produkte: Chips umbrechen statt rechts abgeschnitten */
.filter-row .chips { flex-wrap: wrap; overflow: visible; row-gap: 8px; }
@media (min-width: 860px) { .filter-row .searchbar { flex: 0 1 420px; min-width: 240px; } }
@media (max-width: 859px) { .filter-row .chips { flex-wrap: nowrap; overflow-x: auto; } }
@media (min-width: 860px) {
  .filter-row { flex-wrap: wrap; align-items: flex-start; }
  .filter-row .searchbar { flex: 1 1 320px; max-width: 520px; }
  .filter-row .chips { flex: 1 1 auto; }
  .filter-row .chip select { max-width: 170px; }
}

/* ---------- 2.24.0: Update ---------- */
.side-update { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: .8rem; font-weight: 600; color: #fff; background: var(--primary); border-radius: 8px; padding: 4px 8px; text-decoration: none; width: fit-content; }
.side-update .icon { width: 14px; height: 14px; }
.update-rel { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.update-notes { margin-top: 8px; font-size: .9rem; max-height: 260px; overflow: auto; }

/* 2.24.1: Buchen – gesperrtes Suchfeld, solange ein Produkt wartet */
#bk-search-form.locked { opacity: .6; }
#bk-search-form.locked input { cursor: not-allowed; }
#bk-product.shake { animation: bk-shake .4s; outline: 2px solid var(--danger, #c0392b); outline-offset: 2px; border-radius: var(--radius, 10px); }
@keyframes bk-shake { 0%,100% { transform: none; } 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { #bk-product.shake { animation: none; } }

/* 2.24.2: Buchen – sichtbare Warnung (auch bei stummem PC) */
#bk-flash { position: fixed; inset: 0; z-index: 9999; pointer-events: none; background: #e0201a; opacity: 0; }
#bk-flash.on { animation: bk-flash .9s steps(1, end); }
@keyframes bk-flash { 0% { opacity: .55; } 16% { opacity: 0; } 33% { opacity: .55; } 50% { opacity: 0; } 66% { opacity: .55; } 83%,100% { opacity: 0; } }
body.bk-waiting::after { content: ""; position: fixed; inset: 0; z-index: 9998; pointer-events: none; box-shadow: inset 0 0 0 6px #e0201a; }

/* 2.24.3: Standort-Auswahl beim Buchen – so breit wie der gewählte Ort, Pfeil direkt dahinter */
.where-row { align-items: center; }
.where-row > label[for="bk-where"] { display: inline-flex; align-items: center; gap: 4px; line-height: 1; }
.where-select { field-sizing: content; min-height: 32px; padding: 4px 24px 4px 6px; border-radius: 8px; line-height: 1.2;
  background-position: right 6px center; background-size: 10px 7px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232f5aa8' stroke-width='2.2'/%3E%3C/svg%3E"); }
.where-select:hover { background-color: color-mix(in srgb, var(--primary) 10%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .where-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238fb3ff' stroke-width='2.2'/%3E%3C/svg%3E"); } }
:root[data-theme=dark] .where-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238fb3ff' stroke-width='2.2'/%3E%3C/svg%3E"); }

/* 2.27.1: Nachzählen („Inventur nebenbei“) – eigene Farbe (gelb) statt Alarm-Rot */
#bk-flash.info { background: #f2b705; }
#bk-flash.info.on { animation: bk-flash-info .7s steps(1, end); }
@keyframes bk-flash-info { 0% { opacity: .45; } 30% { opacity: 0; } 55% { opacity: .45; } 85%,100% { opacity: 0; } }
body.bk-verifying::after { content: ""; position: fixed; inset: 0; z-index: 9998; pointer-events: none; box-shadow: inset 0 0 0 6px #f2b705; }
.bk-verify { border: 2px solid #f2b705; background: color-mix(in srgb, #f2b705 12%, var(--surface)); }
#bk-verify.shake { animation: bk-shake .4s; }
body.bk-verifying #bk-search-form.locked { box-shadow: 0 0 0 2px #f2b705; border-radius: 12px; }

/* 2.32.0: Hilfe */
.help-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.help-toc { position: sticky; top: 76px; padding: 12px; max-height: calc(100vh - 96px); overflow: auto; }
.help-toc input { margin-bottom: 8px; min-height: 38px; padding: 7px 10px; font-size: .92rem; }
.help-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: h; }
.help-toc li a { display: block; padding: 6px 8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .92rem; }
.help-toc li a:hover { background: var(--surface-2); }
.help-toc li a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.help-body { display: grid; gap: 16px; min-width: 0; }
.help-sec { scroll-margin-top: 76px; line-height: 1.6; max-width: 900px; }
.help-sec h2 { margin-top: 0; }
.help-sec h3 { margin: 22px 0 6px; font-size: 1.02rem; }
.help-sec ul, .help-sec ol { padding-left: 1.3em; }
.help-sec li + li { margin-top: 4px; }
.help-sec .steps li::marker { font-weight: 700; color: var(--primary); }
.help-shot { margin: 12px 0; }
.help-shot img { display: block; width: auto; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.help-shot figcaption { font-size: .85rem; color: var(--muted); margin-top: 5px; }
.help-shot.help-narrow { max-width: 300px; }
.help-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help-table td, .help-table th { vertical-align: top; }
.help-sec .danger-t { color: var(--danger); }
.help-sec .warn-t { color: #a06a00; }
.help-hit { animation: help-hit 1.6s ease-out; }
@keyframes help-hit { 0% { box-shadow: 0 0 0 3px var(--primary); } 100% { box-shadow: 0 0 0 3px transparent; } }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); font: 600 .8rem/1.4 inherit; text-align: center; }
.side-help .side-kbd, .side-link .side-kbd { margin-left: auto; opacity: .6; font-size: .7rem; background: transparent; color: inherit; border-color: currentColor; }
@media (max-width: 900px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; max-height: none; }
  .help-toc ol { columns: 2; }
  .help-pair { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .help-hit { animation: none; } }

/* 2.32.0: Handy – nichts darf die Seite breiter machen (auch mit großer Systemschrift) */
html, body { overflow-x: clip; max-width: 100%; }
@media (max-width: 859px) {
  .nav a { flex: 1 1 0; min-width: 0; padding: 0 1px; }
  .nav a span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(.6rem, 2.85vw, .78rem); letter-spacing: -.01em; }
  .topbar { min-width: 0; }
  .topbar .brand { min-width: 0; flex: 1 1 auto; }
  .topbar .brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bell-pop { position: fixed; left: 10px; right: 10px; top: 58px; width: auto; }
  .user-menu .menu-pop { position: fixed; right: 10px; top: 58px; max-width: calc(100vw - 20px); }
  .help-layout > * { min-width: 0; }
  .help-toc ol { columns: 1; }
}

/* 2.32.1: Tooltips für Symbol-Knöpfe */
.tip { position: fixed; z-index: 10000; max-width: 260px; padding: 6px 9px; border-radius: 7px; background: #1f2633; color: #fff;
  font-size: .8rem; line-height: 1.35; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
:root[data-theme=dark] .tip { background: #e8ecf3; color: #121722; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .tip { background: #e8ecf3; color: #121722; } }

/* 2.33.0: Kurz nachzählen – Ausnahmen */
.vx-rows { display: grid; gap: 6px; }
.vx-row { align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.vx-row.vx-new { border-style: dashed; }
.vx-row select { min-height: 38px; padding-top: 6px; padding-bottom: 6px; }

/* 2.35.0: Hintergrund-Aufgaben */
.bg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--muted); }
.bg-dot.ok { background: #2e9d5b; } .bg-dot.warn { background: #e0a100; }
.bg-status td { padding-top: 7px; padding-bottom: 7px; }

/* 2.35.3: EAN-Karten – Barcode groß auf weißem Feld, darunter Art und Entfernen */
.ean-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 260px)); }
.ean-card { padding: 0; overflow: hidden; background: var(--surface); text-align: left; }
.ean-card .ean-img { background: #fff; padding: 14px 16px 10px; }
.ean-card .ean-img img { display: block; width: 100%; height: auto; max-height: 130px; object-fit: contain; }
.ean-card-foot { margin: 0; padding: 4px 6px 4px 12px; min-height: 36px; border-top: 1px solid var(--line); }
.ean-card-foot .btn.icon-only { color: var(--muted); }

/* Unbekannter Code beim Buchen */
.bk-unknown { margin-top: 12px; padding: 14px; border-radius: 14px; display: grid; gap: 10px;
  border: 2px solid var(--danger, #c0392b); background: color-mix(in srgb, var(--danger, #c0392b) 8%, var(--surface)); }
.bk-unknown .mono { font-family: ui-monospace, monospace; letter-spacing: .03em; }
.bk-unknown label { display: block; margin-bottom: 6px; }
.bk-unknown .bk-results { margin-top: 6px; max-height: 300px; overflow: auto; }
.bk-unknown .bk-results:empty { display: none; }
#bk-unknown.shake { animation: bk-shake .4s; }

/* Kleine Profilbilder neben Namen (Verlauf, Einkaufsliste) */
.avatar.xs { width: 18px; height: 18px; font-size: .62rem; font-weight: 700; margin-right: 5px; line-height: 1; }
.who { display: inline-flex; align-items: center; white-space: nowrap; vertical-align: top; line-height: inherit; }
.who > .avatar.xs { align-self: center; }

/* Etiketten: Produktbild in der Liste */
.label-prod { display: flex; align-items: center; gap: 12px; }
.label-prod .thumb { width: 40px; height: 40px; border-radius: 8px; font-size: .95rem; flex-shrink: 0; }

/* EAN-Karten: anklickbar zum Drucken, Zähler pro Code */
.ean-card[data-ean] { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.ean-card.chosen { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.ean-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ean-count { display: inline-flex; gap: 8px; margin-left: auto; margin-right: 4px; white-space: nowrap; }
.ean-count .icon { width: 13px; height: 13px; vertical-align: -2px; margin-right: 1px; }
.ean-count .in { color: var(--ok, #1f7a4d); }
.ean-count .out { color: var(--danger, #b3261e); }
.ean-count + form { margin-left: 0; }

/* Bild groß anzeigen */
img.photo, .label-prod img.thumb, img[data-zoom] { cursor: zoom-in; }
.zoom-box { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px;
  background: rgba(10, 14, 20, .82); cursor: zoom-out; animation: zoom-in .15s ease-out; }
.zoom-box img { width: min(92vw, 900px); height: auto; max-height: 88vh; object-fit: contain; border-radius: 12px; background: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,.45); cursor: default; }
.zoom-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.92); color: #111; font-size: 1.2rem; cursor: pointer; }
.zoom-close:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
html.zoom-open { overflow: hidden; }
@keyframes zoom-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .zoom-box { animation: none; } }

/* Übersicht der Tastenkürzel (?) */
.kbd-sheet { position: fixed; inset: 0; z-index: 1900; display: grid; place-items: center; padding: 16px; background: rgba(10,14,20,.55); }
.kbd-card { width: min(460px, 100%); max-height: 86vh; overflow: auto; background: var(--surface); color: var(--text); border-radius: 14px; padding: 16px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.kbd-card .table td { padding: 6px 8px; }
.kbd-card .table td:first-child { white-space: nowrap; width: 1%; }
