/* Snackpoint Lager – Design v4: hell & dunkel, ruhige Flächen, klare Akzente, sanfte Bewegung. Ergänzt Bootstrap 5. */

/* ================================================================ Farben & Maße */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f2f5f9;
  --surface-3: #e9eef5;
  --ink: #111c2d;
  --ink-2: #536176;
  --ink-3: #8390a3;
  --line: #e3e8ef;
  --line-strong: #cdd6e2;
  --accent: #2160e0;
  --accent-2: #6d4aff;
  --accent-ink: #ffffff;
  --accent-soft: #e8effd;
  --accent-hover: #1a4fbd;
  --grad: linear-gradient(135deg, #ff1f8c 0%, #8a3dff 55%, #1aa9d6 100%);
  --brand-pink: #ff1f8c;
  --brand-cyan: #22d3ee;
  --ok: #13804f;
  --ok-soft: #e3f5ec;
  --ok-line: #b5e0c8;
  --warn: #a15800;
  --warn-soft: #fff3de;
  --warn-line: #f3d39a;
  --bad: #c42b1f;
  --bad-soft: #fdebe9;
  --bad-line: #f3c2bd;
  --row-low: #fffaf0;
  --row-out: #fff5f4;
  --img-bg: #ffffff;
  --chart-bar: #2160e0;
  --chart-bar-soft: #c7d7f8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 28, 45, .04), 0 2px 8px rgba(17, 28, 45, .04);
  --shadow-lg: 0 10px 30px rgba(17, 28, 45, .10);
  --topbar-bg: rgba(255, 255, 255, .82);
  --side-bg: #0d1628;
  --side-ink: #aab6cb;
  --side-ink-strong: #ffffff;
  --side-line: rgba(255, 255, 255, .08);
  --side-hover: rgba(255, 255, 255, .06);
  --sidebar-w: 252px;
  --topbar-h: 64px;
  --bottom-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--ink-2);
  --bs-tertiary-bg: var(--surface-2);
  --bs-primary: var(--accent);
  --bs-primary-rgb: 33, 96, 224;
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: 33, 96, 224;
  --bs-link-hover-color: var(--accent-hover);
  --bs-link-hover-color-rgb: 26, 79, 189;
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-lg: 12px;
  --bs-focus-ring-color: rgba(33, 96, 224, .28);
  color-scheme: light;
}

[data-bs-theme="dark"] {
  --bg: #0a111e;
  --surface: #111a2b;
  --surface-2: #172236;
  --surface-3: #1d2a42;
  --ink: #e7ecf5;
  --ink-2: #9dabc1;
  --ink-3: #6e7c93;
  --line: #1f2c44;
  --line-strong: #2b3b58;
  --accent: #5b8cff;
  --accent-2: #9b7bff;
  --accent-ink: #0a111e;
  --accent-soft: rgba(91, 140, 255, .14);
  --accent-hover: #7aa2ff;
  --grad: linear-gradient(135deg, #e0157a 0%, #7a34f0 55%, #1596c4 100%);
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, .12);
  --ok-line: rgba(61, 220, 151, .3);
  --warn: #fbbf4d;
  --warn-soft: rgba(251, 191, 77, .12);
  --warn-line: rgba(251, 191, 77, .32);
  --bad: #ff7a70;
  --bad-soft: rgba(255, 122, 112, .12);
  --bad-line: rgba(255, 122, 112, .32);
  --row-low: rgba(251, 191, 77, .06);
  --row-out: rgba(255, 122, 112, .07);
  --img-bg: #f4f6fa;
  --chart-bar: #5b8cff;
  --chart-bar-soft: #2a3d63;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .18);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .45);
  --topbar-bg: rgba(10, 17, 30, .78);
  --side-bg: #070d18;
  --side-line: rgba(255, 255, 255, .06);

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--ink-2);
  --bs-tertiary-bg: var(--surface-2);
  --bs-primary-rgb: 91, 140, 255;
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: 91, 140, 255;
  --bs-link-hover-color: var(--accent-hover);
  --bs-focus-ring-color: rgba(91, 140, 255, .35);
  --bs-emphasis-color: #ffffff;
  color-scheme: dark;
}

/* ================================================================ Grundlagen */
html, body { background: var(--bg); }
body { color: var(--ink); -webkit-font-smoothing: antialiased; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
.num, .kpi-value, td.r, .stock-num { font-variant-numeric: tabular-nums; }
.font-monospace, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .01em; }
h1, .h1, h2, .h2, h3, .h3 { letter-spacing: -.015em; text-wrap: balance; }
.page-title { font-size: 1.6rem; font-weight: 700; margin: 0; }
.page-sub { color: var(--ink-2); margin: .2rem 0 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.muted { color: var(--ink-3); }
.text-secondary { color: var(--ink-2) !important; }
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { text-underline-offset: 2px; }
::selection { background: var(--accent-soft); }
.theme-switching, .theme-switching * { transition: background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease) !important; }

/* ================================================================ Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { display: none; }
.main-col { flex: 1 1 auto; min-width: 0; }
.page { padding: 1.1rem 16px calc(var(--bottom-h) + 1.75rem + env(safe-area-inset-bottom)); max-width: 1360px; margin: 0 auto; }
.page-login { padding-top: 3rem; }

@media (min-width: 992px) {
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex: none;
    background: var(--side-bg); color: var(--side-ink); padding: 1.1rem .8rem; overflow-y: auto; view-transition-name: sidebar;
    background-image: radial-gradient(120% 60% at 0% 0%, rgba(90, 69, 240, .22), transparent 60%);
  }
  .page { padding: 1.6rem 2.2rem 2.75rem; }
  .bottom-bar, .brand-mobile { display: none !important; }
}

.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-size: 1.05rem; padding: .35rem .55rem 1.1rem; }
.sidebar .brand { color: var(--side-ink-strong); }
.brand b { font-weight: 750; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(90, 69, 240, .35); }
.brand-mark svg { width: 19px; height: 19px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a, .side-foot a, .side-foot button {
  position: relative; display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: var(--radius-sm);
  color: var(--side-ink); text-decoration: none; font-size: .93rem; background: none; border: 0; width: 100%; text-align: left;
  transition: background-color .15s, color .15s;
}
.side-nav a:hover, .side-foot a:hover, .side-foot button:hover { background: var(--side-hover); color: var(--side-ink-strong); }
.side-nav a.active { background: rgba(255, 255, 255, .09); color: #fff; font-weight: 600; }
.side-nav a.active::before { content: ""; position: absolute; left: -.8rem; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.side-nav a.active svg { color: #9db8ff; }
.side-nav .nav-badge { margin-left: auto; font-size: .7rem; font-weight: 700; background: #f59e0b; color: #111; border-radius: 999px; padding: .05rem .45rem; }
.nav-group { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #5f6f8a; padding: 1.05rem .7rem .35rem; }
.side-foot { border-top: 1px solid var(--side-line); padding-top: .6rem; margin-top: .6rem; }
.side-foot .muted { color: #5f6f8a; }

/* Kopfzeile mit Scanfeld */
.topbar {
  position: sticky; top: 0; z-index: 1020; height: var(--topbar-h); display: flex; align-items: center; gap: .6rem;
  padding: 0 16px; background: var(--topbar-bg); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line); view-transition-name: topbar;
}
@media (min-width: 992px) { .topbar { padding: 0 2.2rem; } }
.global-scan {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: .55rem; max-width: 680px; height: 44px; padding: 0 .85rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; color: var(--ink-3);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.global-scan:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--bs-focus-ring-color); color: var(--accent); }
.global-scan-input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 1rem; color: var(--ink); }
.global-scan-input::placeholder { color: var(--ink-3); }
.scan-ready { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 600; color: var(--ok); white-space: nowrap; }
.scan-ready::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(19, 128, 79, .5); } 70% { box-shadow: 0 0 0 7px rgba(19, 128, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(19, 128, 79, 0); } }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); flex: none; transition: color .15s, border-color .15s, transform .1s; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn:active { transform: scale(.94); }

/* Fortschrittsbalken beim Laden */
#nav-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2000; pointer-events: none; opacity: 0; }
#nav-progress::before { content: ""; position: absolute; inset: 0; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); }
.is-loading #nav-progress { opacity: 1; }
.is-loading #nav-progress::before { animation: progress 8s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes progress { 0% { transform: scaleX(0); } 10% { transform: scaleX(.35); } 100% { transform: scaleX(.95); } }

/* Untere Leiste (Smartphone) */
.bottom-bar {
  position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 1030; display: flex;
  background: var(--topbar-bg); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); view-transition-name: bottombar;
}
.bottom-bar a, .bottom-bar button {
  flex: 1 1 0; min-height: var(--bottom-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-2); text-decoration: none; font-size: .7rem; font-weight: 550; background: none; border: 0; position: relative;
}
.bottom-bar svg { width: 23px; height: 23px; transition: transform .15s var(--ease); }
.bottom-bar a:active svg, .bottom-bar button:active svg { transform: scale(.88); }
.bottom-bar .active { color: var(--accent); font-weight: 700; }
.bottom-bar .active::after { content: ""; position: absolute; top: 6px; width: 34px; height: 30px; border-radius: 10px; background: var(--accent-soft); z-index: -1; }
.bottom-bar .scan-fab svg { color: #fff; }
.bottom-bar .scan-fab span.fab { width: 46px; height: 46px; margin-top: -22px; border-radius: 16px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 8px 20px rgba(90, 69, 240, .4); }
.more-sheet { height: auto !important; border-radius: 20px 20px 0 0; background: var(--surface); }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.more-grid a, .more-grid button { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .85rem .3rem; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; font-size: .82rem; text-align: center; background: var(--surface-2); }
.more-grid svg { width: 24px; height: 24px; color: var(--accent); }

/* ================================================================ Flächen & Karten */
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); }
.panel { padding: 1.1rem 1.2rem; }
.panel-title { font-size: .98rem; font-weight: 680; margin: 0; display: flex; align-items: center; gap: .55rem; }
.panel-title .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.panel-title .ico svg { width: 17px; height: 17px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .85rem; }
.panel-link { font-size: .84rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.panel-link:hover { text-decoration: underline; }
.shadow-sm { box-shadow: var(--shadow) !important; }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 992px) { .grid-2 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.grid-3 { display: grid; gap: 1rem; }
@media (min-width: 992px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.lift { transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s; }
@media (hover: hover) { .lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); } }

/* Einblenden beim Laden (gestaffelt) */
.reveal { animation: reveal .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ================================================================ Startseite */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 1.35rem 1.35rem 1.25rem; color: #fff; background: var(--grad);
  box-shadow: 0 16px 40px rgba(170, 40, 200, .28); margin-bottom: 1rem;
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 360px; height: 360px; right: -120px; top: -160px; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 65%); }
.hero::after { width: 260px; height: 260px; left: 35%; bottom: -170px; background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 65%); }
.hero-top { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.hero h1 { font-size: 1.55rem; font-weight: 750; margin: 0; }
.hero .hero-sub { opacity: .85; margin: .2rem 0 0; font-size: .95rem; }
.hero-stats { position: relative; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: 1rem; }
.hero-stat { font-size: .82rem; opacity: .9; }
.hero-stat b { display: block; font-size: 1.35rem; font-weight: 750; opacity: 1; letter-spacing: -.01em; }
.hero-actions { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-top: 1.1rem; }
@media (min-width: 576px) { .hero-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .hero-actions { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.hero-action {
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: .55rem; padding: .7rem .8rem; border-radius: 14px; text-decoration: none; color: #fff; font-weight: 600; font-size: .9rem;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(6px); transition: background-color .15s, transform .12s;
}
.hero-action:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.hero-action:active { transform: scale(.97); }
.hero-action svg { width: 20px; height: 20px; }
.hero-action.primary { background: #fff; color: #c2126e; border-color: #fff; }
.hero-action .badge { margin-left: auto; background: #f59e0b !important; color: #111 !important; }
@media (min-width: 992px) { .hero { padding: 1.7rem 1.8rem 1.5rem; } .hero h1 { font-size: 1.8rem; } }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
@media (min-width: 992px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; } }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .95rem 1rem; box-shadow: var(--shadow); color: inherit; text-decoration: none; display: block; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kpi-label { font-size: .8rem; color: var(--ink-2); font-weight: 550; }
.kpi-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.kpi-ico svg { width: 17px; height: 17px; }
.kpi-value { font-size: 1.65rem; font-weight: 750; line-height: 1.2; margin-top: .35rem; letter-spacing: -.02em; }
.kpi-foot { font-size: .76rem; color: var(--ink-3); margin-top: .15rem; }
.trend { font-weight: 700; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--bad); }
.kpi.warn { border-color: var(--warn-line); background: linear-gradient(180deg, var(--warn-soft), var(--surface) 140%); }
.kpi.warn .kpi-value { color: var(--warn); }
.kpi.warn .kpi-ico { background: var(--warn-soft); color: var(--warn); }
a.kpi:hover { border-color: var(--accent); color: inherit; }

/* Diagramm: Abgänge pro Tag */
.chart { position: relative; }
.chart-plot { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 22px; border-bottom: 1px solid var(--line-strong); }
.chart-grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); pointer-events: none; }
.chart-grid span { position: absolute; right: 0; top: -1.15em; font-size: .68rem; color: var(--ink-3); background: var(--surface); padding-left: .25rem; }
.bar { position: relative; flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; outline: none; cursor: default; }
.bar i { display: block; width: 100%; max-width: 28px; margin: 0 auto; min-height: 2px; height: var(--h); border-radius: 5px 5px 0 0; background: var(--chart-bar-soft); transform-origin: bottom; animation: grow .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); transition: background-color .15s; }
.bar.today i { background: var(--chart-bar); }
.bar.zero i { background: var(--line); }
.bar:hover i, .bar:focus-visible i { background: var(--accent); }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.bar .tip {
  position: absolute; bottom: calc(var(--h) + 8px); left: 50%; transform: translate(-50%, 4px); opacity: 0; pointer-events: none; z-index: 5;
  background: var(--ink); color: var(--surface); font-size: .75rem; line-height: 1.35; padding: .4rem .55rem; border-radius: 8px; white-space: nowrap; transition: opacity .12s, transform .12s; box-shadow: var(--shadow-lg);
}
.bar:hover .tip, .bar:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }
.bar:first-child .tip, .bar:nth-child(2) .tip { left: 0; transform: translate(0, 4px); }
.bar:first-child:hover .tip, .bar:nth-child(2):hover .tip { transform: none; }
.bar:last-child .tip, .bar:nth-last-child(2) .tip { left: auto; right: 0; transform: translate(0, 4px); }
.bar:last-child:hover .tip, .bar:nth-last-child(2):hover .tip, .bar:last-child:focus-visible .tip { transform: none; }
.chart-x { display: flex; gap: 4px; margin-top: .35rem; }
.chart-x span { flex: 1 1 0; text-align: center; font-size: .68rem; color: var(--ink-3); }
.chart-x span.today { color: var(--accent); font-weight: 700; }
@media (max-width: 575.98px) { .chart-x span:nth-child(even) { visibility: hidden; } }

/* Bestandsgesundheit (gestapelter Balken) */
.health-bar { display: flex; gap: 2px; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: .35rem 0 .75rem; }
.health-bar span { height: 100%; transform-origin: left; animation: growx .8s var(--ease) both; }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.health-bar .ok { background: var(--ok); }
.health-bar .low { background: var(--warn); }
.health-bar .out { background: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--ink-2); }
.legend a, .legend span { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.legend a:hover { color: var(--accent); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { color: var(--ink); }

/* Kleine Balken in Listen (Bestseller) */
.meter { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: .3rem; }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--grad); transform-origin: left; animation: growx .8s var(--ease) both; }

/* Aufgaben-Karten („Zu tun“) */
.todo { display: flex; align-items: center; gap: .8rem; padding: .75rem .85rem; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); background: var(--surface); }
.todo + .todo { margin-top: .5rem; }
.todo:hover { border-color: var(--accent); color: var(--ink); }
.todo .t-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.todo.warn .t-ico { background: var(--warn-soft); color: var(--warn); }
.todo.bad .t-ico { background: var(--bad-soft); color: var(--bad); }
.todo.ok .t-ico { background: var(--ok-soft); color: var(--ok); }
.todo .t-main { flex: 1; min-width: 0; line-height: 1.3; }
.todo .t-title { font-weight: 650; font-size: .93rem; }
.todo .t-meta { font-size: .8rem; color: var(--ink-2); }
.todo .t-end { font-weight: 700; white-space: nowrap; }
.todo svg.chev { color: var(--ink-3); }

/* Schnellaktionen (ältere Kacheln, z. B. Produktseite) */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 768px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; min-height: 86px; padding: .6rem .3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-size: .86rem; font-weight: 550; text-align: center; box-shadow: var(--shadow); }
.tile svg { width: 26px; height: 26px; color: var(--accent); }
.tile:hover { border-color: var(--accent); color: var(--accent); }
.tile.primary { background: var(--grad); border-color: transparent; color: #fff; }
.tile.primary svg { color: #fff; }

/* Listen */
.rows { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: .75rem; padding: .62rem .5rem; margin: 0 -.5rem; border-radius: 10px; color: inherit; text-decoration: none; transition: background-color .12s; }
.row-item + .row-item { border-top: 1px solid var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
a.row-item:hover { background: var(--surface-2); }
a.row-item:hover .row-title { color: var(--accent); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-meta { font-size: .8rem; color: var(--ink-2); }
.row-end { text-align: right; white-space: nowrap; }
.empty { color: var(--ink-2); padding: .75rem 0; }
.mv-dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.mv-dot.in { background: var(--ok-soft); color: var(--ok); }
.mv-dot.out { background: var(--accent-soft); color: var(--accent); }
.mv-dot.bad { background: var(--bad-soft); color: var(--bad); }
.mv-dot svg { width: 17px; height: 17px; }

/* ================================================================ Buttons & Formulare */
.btn { border-radius: var(--radius-sm); font-weight: 600; transition: transform .1s, background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:active { transform: scale(.97); }
.btn-primary { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--accent-hover); --bs-btn-hover-border-color: var(--accent-hover); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--accent-hover); --bs-btn-active-border-color: var(--accent-hover); --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent); box-shadow: 0 4px 14px rgba(33, 96, 224, .25); }
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #fff; --bs-btn-bg: #3d72f0; --bs-btn-border-color: #3d72f0; --bs-btn-hover-bg: #5584f5; --bs-btn-hover-border-color: #5584f5; }
.btn-grad { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 18px rgba(90, 69, 240, .32); }
.btn-grad:hover, .btn-grad:focus { color: #fff; filter: brightness(1.07); }
.btn-outline-primary { --bs-btn-color: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--accent); --bs-btn-active-color: #fff; }
.btn-outline-secondary { --bs-btn-color: var(--ink-2); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--line-strong); }
.btn-light { --bs-btn-bg: var(--surface-2); --bs-btn-border-color: var(--line); --bs-btn-color: var(--ink); --bs-btn-hover-bg: var(--surface-3); --bs-btn-hover-border-color: var(--line-strong); --bs-btn-hover-color: var(--ink); --bs-btn-active-bg: var(--surface-3); --bs-btn-active-color: var(--ink); }
.btn-success { --bs-btn-bg: #14854f; --bs-btn-border-color: #14854f; --bs-btn-hover-bg: #0f6f41; --bs-btn-hover-border-color: #0f6f41; }
.btn-lg, .form-control-lg, .form-select-lg { min-height: 3rem; }
.form-control, .form-select { border-color: var(--line-strong); background-color: var(--surface); color: var(--ink); }
.form-control::placeholder { color: var(--ink-3); }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--bs-focus-ring-color); background-color: var(--surface); color: var(--ink); }
.form-label { font-size: .88rem; font-weight: 550; }
.form-text { color: var(--ink-3); }
.barcode-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.25rem; letter-spacing: .03em; }
.qty-input { font-size: 1.6rem; font-weight: 700; text-align: center; max-width: 14rem; font-variant-numeric: tabular-nums; }
.btn-submit { font-size: 1.1rem; padding-top: .75rem; padding-bottom: .75rem; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
#scan-indicator.htmx-request { display: block; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
@media (min-width: 768px) { .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .quick-actions { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.btn-check:checked + .btn-outline-primary { color: #fff; }

/* ================================================================ Badges / Status / Meldungen */
.badge { font-weight: 650; border-radius: 999px; padding: .34em .68em; }
.text-bg-success { background: var(--ok-soft) !important; color: var(--ok) !important; }
.text-bg-warning { background: var(--warn-soft) !important; color: var(--warn) !important; }
.text-bg-danger { background: var(--bad-soft) !important; color: var(--bad) !important; }
.text-bg-secondary { background: var(--surface-2) !important; color: var(--ink-2) !important; }
.text-bg-info { background: var(--accent-soft) !important; color: var(--accent) !important; }
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .55rem; }
.alert { border-radius: 14px; border-width: 1px; animation: reveal .35s var(--ease) both; }
.alert-success { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.alert-danger { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.alert-warning { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.alert-info { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.alert .alert-link { color: inherit; }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.booking-result { font-size: 1.05rem; }
.booking-result.alert-success::before, .quick-done::before {
  content: ""; display: inline-block; width: 1.2em; height: 1.2em; margin-right: .45rem; vertical-align: -.22em; border-radius: 50%;
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 70% no-repeat;
  animation: pop .45s var(--ease) both;
}
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ================================================================ Produktbilder */
.product-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--img-bg); flex: none; }
.list-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--img-bg); flex: none; }
.product-image { max-height: 340px; width: 100%; object-fit: contain; background: var(--img-bg); border-radius: var(--radius); border: 1px solid var(--line); }
.visually-hidden-file input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.stock-now { font-size: 1.05rem; }
.booking-card { border-width: 1px; }
.booking-card.border-primary { border-color: var(--accent) !important; box-shadow: 0 0 0 4px var(--accent-soft); }
.card.border-info { border-color: var(--accent) !important; }

/* Kamera */
.camera-view { position: relative; width: 100%; max-width: 520px; aspect-ratio: 4 / 3; background: #000; border-radius: var(--radius); overflow: hidden; }
.camera-view video { width: 100%; height: 100%; object-fit: cover; }
.camera-frame { position: absolute; left: 8%; right: 8%; top: 30%; bottom: 30%; border: 3px solid rgba(255, 255, 255, .95); border-radius: 12px; box-shadow: 0 0 0 2000px rgba(0, 0, 0, .3); }
.camera-frame::after { content: ""; position: absolute; left: 4%; right: 4%; height: 2px; top: 50%; background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; animation: scanline 1.8s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { transform: translateY(-38px); opacity: .6; } 50% { transform: translateY(38px); opacity: 1; } }

/* ================================================================ Tabellen */
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-hover-bg: var(--surface-2); --bs-table-hover-color: var(--ink); margin: 0; }
.table > :not(caption) > * > * { padding: .65rem .75rem; border-color: var(--line); }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); font-weight: 700; background: var(--surface-2); white-space: nowrap; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.panel .table-responsive { border-radius: 10px; }
.table-light { --bs-table-bg: var(--surface-2); --bs-table-color: var(--ink-2); }
tr.row-low > td { background-color: var(--row-low) !important; }
tr.row-out > td { background-color: var(--row-out) !important; }
.change-pos { color: var(--ok); font-weight: 700; }
.change-neg { color: var(--bad); font-weight: 700; }
.text-success { color: var(--ok) !important; }
.text-danger { color: var(--bad) !important; }
.text-warning, .text-warning-emphasis { color: var(--warn) !important; }
.container-xxl-wide { max-width: 1600px; }
.list-group-item { background: var(--surface); color: var(--ink); border-color: var(--line); }
.list-group-item-action:hover { background: var(--surface-2); color: var(--ink); }
.page-link { background: var(--surface); border-color: var(--line); color: var(--accent); }
.page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-item.disabled .page-link { background: var(--surface-2); color: var(--ink-3); border-color: var(--line); }

@media (min-width: 768px) {
  .movement-table .text-break, .product-table .text-break { word-break: normal !important; overflow-wrap: break-word; }
  .movement-table td[data-label="Produkt"], .product-table td[data-label="Produkt"] { min-width: 11rem; }
  .movement-table td[data-label="Grund"], .movement-table td[data-label="Notiz"] { min-width: 10rem; }
  .movement-table td[data-label="Barcode"], .product-table td[data-label="Barcode"] { white-space: nowrap; }
}
@media (max-width: 767.98px) {
  .product-table table, .movement-table table, .cards-sm table { border: 0; }
  .product-table thead, .movement-table thead, .cards-sm thead { display: none; }
  .product-table tr, .movement-table tr, .cards-sm tr { display: block; background: var(--surface); border-bottom: 1px solid var(--line); padding: .6rem .9rem; }
  .product-table td, .movement-table td, .cards-sm td { display: flex; justify-content: space-between; gap: 1rem; border: 0 !important; padding: .18rem 0 !important; text-align: right !important; background: transparent !important; }
  .product-table td::before, .movement-table td::before, .cards-sm td::before { content: attr(data-label); font-weight: 600; color: var(--ink-2); text-align: left; flex: none; }
  .product-table td[data-label="Bild"]::before { content: ""; }
  .table-wrap { overflow: visible; }
  /* Produktliste am Handy: kompakte Karte – Bild, Name, Bestand, Status */
  .product-table tr { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; column-gap: .8rem; row-gap: .15rem; align-items: center; padding: .7rem .9rem; }
  .product-table td[data-label="Bild"] { grid-row: 1 / span 2; grid-column: 1; }
  .product-table td[data-label="Bild"] img { width: 56px; height: 56px; }
  .product-table td[data-label="Produkt"] { grid-column: 2 / span 2; display: block; text-align: left !important; }
  .product-table td[data-label="Produkt"]::before { content: none; }
  .product-table td[data-label="Bestand"] { grid-column: 2; justify-content: flex-start; }
  .product-table td[data-label="Bestand"]::before { font-weight: 500; }
  .product-table td[data-label="Status"] { grid-column: 3; grid-row: 2; }
  .product-table td[data-label="Status"]::before { content: none; }
  .product-table td[data-label="Mindestbestand"], .product-table td[data-label="Einkaufspreis"], .product-table td[data-label="Verkaufspreis"],
  .product-table td[data-label="Händler"], .product-table td[data-label="Kategorie · Ort"] { display: none; }
}

/* ================================================================ Bestellliste / Bestseller */
.supplier-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .9rem 1.15rem; border-bottom: 1px solid var(--line); }
.supplier-name { font-weight: 750; font-size: 1.05rem; }
.supplier-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: .45rem; background: var(--accent); vertical-align: .05em; }
.order-qty { font-size: 1.15rem; font-weight: 750; color: var(--accent); white-space: nowrap; }
.rank { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; font-weight: 750; font-size: .85rem; flex: none; color: var(--ink-2); }
.rank.top { background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(90, 69, 240, .3); }
.price-up { color: var(--ok); }
.price-down { color: var(--bad); }

/* ================================================================ Schnellauswahl (Modal) */
.modal-content { border-radius: 22px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--line); }
.modal-backdrop.show { opacity: .45; }
.modal.fade .modal-dialog { transform: translateY(18px) scale(.98); transition: transform .22s var(--ease); }
.modal.show .modal-dialog { transform: none; }
@media (max-width: 575.98px) { .modal-fullscreen-sm-down .modal-content { border-radius: 0; border: 0; } }
.quick-head { display: flex; gap: .9rem; align-items: flex-start; }
.quick-qty { display: flex; align-items: center; gap: .5rem; margin: 1rem 0 .75rem; }
.quick-qty button { width: 50px; height: 50px; font-size: 1.4rem; border-radius: 14px; }
.quick-qty input { max-width: 7rem; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.quick-grid .btn { min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; font-size: .9rem; border-radius: 14px; }
.quick-grid .btn svg { width: 22px; height: 22px; }
.quick-grid .wide { grid-column: 1 / -1; }
.quick-grid .btn-primary { background: var(--grad); border: 0; }
[data-quick-sheet] { animation: reveal .28s var(--ease) both; }

/* Produktdaten-Vorschläge */
.lookup-hit { display: flex; gap: .75rem; align-items: center; padding: .65rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); animation: reveal .3s var(--ease) both; }
.lookup-hit + .lookup-hit { margin-top: .5rem; }
.lookup-hit img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: var(--img-bg); border: 1px solid var(--line); flex: none; }
.supplier-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.supplier-links a { font-size: .82rem; }
.skeleton { display: block; height: 56px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.skeleton + .skeleton { margin-top: .5rem; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Zählung */
.count-line.diff-plus .count-diff { color: var(--ok); }
.count-line.diff-minus .count-diff { color: var(--bad); }
.count-diff { font-weight: 750; }
.count-input { font-size: 1.6rem; font-weight: 700; text-align: center; max-width: 9rem; }
.quick-qty button.qty-ve { width: auto; font-size: .95rem; font-weight: 650; padding: 0 .85rem; white-space: nowrap; }
.quick-qty input, .count-input { -moz-appearance: textfield; text-align: center; }
.quick-qty input::-webkit-outer-spin-button, .quick-qty input::-webkit-inner-spin-button,
.count-input::-webkit-outer-spin-button, .count-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Produktdetail */
.detail-image { width: 132px; height: 132px; object-fit: cover; background: var(--img-bg); flex: none; border-radius: 14px !important; }
.detail-stock { font-size: 1.35rem; }
.facts { display: grid; grid-template-columns: minmax(0, 11rem) 1fr; gap: .4rem .9rem; margin: 0; font-size: .92rem; }
.facts dt { font-weight: 500; color: var(--ink-3); }
.facts dd { margin: 0; }
@media (max-width: 420px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: .35rem; } }

/* Anmeldung */
.brand-mark-lg { width: 56px; height: 56px; border-radius: 16px; display: inline-grid; }
.brand-mark-lg svg { width: 30px; height: 30px; }
.login-page { background: var(--bg); background-image: radial-gradient(80% 60% at 50% -10%, rgba(90, 69, 240, .18), transparent 60%); min-height: 100vh; }
.login-card { border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); background: var(--surface); }

/* Offcanvas / Dropdowns im Dunkelmodus */
.offcanvas { background: var(--surface); color: var(--ink); }

/* ================================================================ Seitenübergänge */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .16s ease both; }
::view-transition-new(root) { animation: vt-in .24s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  @view-transition { navigation: none; }
}

/* Handy: kompakter Kopfbereich & Filter */
@media (max-width: 575.98px) {
  .hero { padding: 1.1rem 1rem 1rem; border-radius: 20px; }
  .hero h1 { font-size: 1.35rem; }
  .hero .hero-sub { font-size: .85rem; }
  .hero-stats { gap: .4rem 1.1rem; margin-top: .8rem; }
  .hero-stat { font-size: .74rem; }
  .hero-stat b { font-size: 1.15rem; }
  .hero-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin-top: .9rem; }
  .hero-action { flex-direction: column; gap: .25rem; padding: .6rem .2rem; font-size: .74rem; text-align: center; justify-content: center; border-radius: 12px; }
  .hero-action .badge { position: absolute; top: 4px; right: 4px; margin: 0; }
  .hero-action { position: relative; }
  .kpi-label { font-size: .74rem; }
  .kpi-value { font-size: 1.35rem; }
  .kpi-ico { width: 28px; height: 28px; }
}
@media (max-width: 767.98px) {
  .product-table tr.row-low { background: var(--row-low); }
  .product-table tr.row-out { background: var(--row-out); }
}
@media (max-width: 767.98px) { .product-table td, .movement-table td, .cards-sm td { box-shadow: none !important; } }
.table a.fw-semibold, .table td[data-label="Produkt"] a { text-decoration: none; }
.table a.fw-semibold:hover, .table td[data-label="Produkt"] a:hover { text-decoration: underline; }

/* ================================================================ Hilfe */
.help-btn { position: relative; }
.help-btn.is-new::after { content: ""; position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 2px var(--surface); animation: pulse-warn 2s infinite; }
@keyframes pulse-warn { 0% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 2px rgba(245, 158, 11, .6); } 70% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 9px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 2px rgba(245, 158, 11, 0); } }
.help-panel.offcanvas-end { width: min(460px, 100vw); border-left: 1px solid var(--line); }
.help-panel .offcanvas-header { border-bottom: 1px solid var(--line); }
.help-ico { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--grad); color: #fff; flex: none; }
.help-ico svg { width: 18px; height: 18px; }
.help-body { font-size: .95rem; line-height: 1.55; }
.help-body h3 { font-size: .8rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 1.2rem 0 .5rem; }
.help-lead { font-size: 1.02rem; color: var(--ink); margin-bottom: 1rem; }
.help-steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 1rem; }
.help-steps > li { counter-increment: step; position: relative; padding: .1rem 0 .1rem 2.4rem; margin-bottom: .75rem; }
.help-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 750; font-size: .85rem; display: grid; place-items: center; }
.help-steps ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.help-steps ul li { margin-bottom: .25rem; }
.help-tips { list-style: none; padding: 0; margin: 0 0 1rem; }
.help-tips > li { position: relative; padding-left: 1.4rem; margin-bottom: .6rem; }
.help-tips > li::before { content: ""; position: absolute; left: .2rem; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--grad); }
.help-note { background: var(--accent-soft); color: var(--ink); border-radius: 12px; padding: .75rem .9rem; font-size: .9rem; margin: .5rem 0 1rem; border-left: 3px solid var(--accent); }
.help-glossary { display: grid; grid-template-columns: minmax(0, 10rem) 1fr; gap: .45rem 1rem; margin: 0; }
.help-glossary dt { font-weight: 700; }
.help-glossary dd { margin: 0; color: var(--ink-2); }
@media (max-width: 480px) { .help-glossary { grid-template-columns: 1fr; } .help-glossary dd { margin-bottom: .5rem; } }
.help-more { border-top: 1px solid var(--line); margin-top: 1.25rem; padding-top: 1rem; }
.help-index { display: flex; flex-wrap: wrap; gap: .45rem; }
.help-index a { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .7rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .86rem; font-weight: 550; }
.help-index a:hover { border-color: var(--accent); color: var(--accent); }
.help-index svg { color: var(--accent); width: 16px; height: 16px; }
.help-all { display: grid; gap: 1rem; }
@media (min-width: 992px) { .help-all { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.help-section { scroll-margin-top: calc(var(--topbar-h) + 1rem); }
.help-section:target { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

@media print {
  .sidebar, .topbar, .bottom-bar, .help-index, [data-print], #nav-progress { display: none !important; }
  .page { padding: 0 !important; max-width: none; }
  .help-all { display: block; }
  .help-section { break-inside: avoid; box-shadow: none; margin-bottom: 12px; border: 1px solid #ccc; }
  body, html { background: #fff !important; color: #000; }
}

/* ================================================================ Logo */
.brand-side { flex-direction: column; align-items: flex-start; gap: .1rem; padding: .1rem .35rem 1rem; }
.brand-logo { width: 188px; height: auto; display: block; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); }
.brand-tag { font-size: .66rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--brand-cyan); padding-left: .35rem; }
.brand-mobile { padding: 0; }
.brand-mark-img { width: 40px; height: 40px; border-radius: 50%; display: block; }
.login-brand { margin: -1.5rem -1.5rem 1.1rem; padding: 1.3rem 1.5rem .9rem; border-radius: 22px 22px 0 0; text-align: center;
  background: #0b1220; background-image: radial-gradient(90% 90% at 20% 0%, rgba(255, 31, 140, .25), transparent 60%), radial-gradient(80% 80% at 90% 100%, rgba(34, 211, 238, .2), transparent 60%); }
.login-brand img { width: 82%; max-width: 330px; height: auto; }

/* ================================================================ Automaten-Auswahl */
.machine-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .5rem; }
.machine-chip {
  display: flex; align-items: center; gap: .6rem; padding: .75rem .85rem; border-radius: 14px; cursor: pointer; user-select: none;
  border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 700; font-size: .86rem; line-height: 1.2;
  transition: border-color .15s, background-color .15s, transform .1s, box-shadow .15s;
}
.machine-chip svg { width: 22px; height: 22px; color: var(--ink-3); flex: none; }
.machine-chip:hover { border-color: var(--accent); }
.machine-chip:active { transform: scale(.98); }
.btn-check:checked + .machine-chip { border-color: transparent; background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(170, 40, 200, .28); }
.btn-check:checked + .machine-chip svg { color: #fff; }
.btn-check:focus-visible + .machine-chip { box-shadow: 0 0 0 4px var(--bs-focus-ring-color); }
.machine-pick.need .machine-chip { border-color: var(--bad); animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.machine-hint { color: var(--bad); font-weight: 650; font-size: .88rem; margin-top: .45rem; }
.machine-panel { border-color: var(--accent); }
.quick-sheet-machines .machine-pick { grid-template-columns: 1fr; }
.danger-zone { border-color: var(--bad-line); background: linear-gradient(180deg, var(--bad-soft), var(--surface) 70%); }
.danger-zone .panel-title .ico { background: var(--bad-soft); color: var(--bad); }
.btn-danger { --bs-btn-bg: #d42a1e; --bs-btn-border-color: #d42a1e; --bs-btn-hover-bg: #b32218; --bs-btn-hover-border-color: #b32218; }
.flex-none { flex: none; }
.img-box { position: relative; text-align: center; }
.img-box figcaption { margin-top: .25rem; }
.img-lg { width: 112px; height: 112px; }
.img-box .img-gone { display: none; position: absolute; left: 0; right: 0; top: 40px; font-size: .75rem; font-weight: 800; color: #fff; background: var(--bad); border-radius: 6px; padding: .1rem .3rem; }
.img-box.removed img { opacity: .35; filter: grayscale(1); }
.img-box.removed .img-gone { display: block; }
.detail-image-wrap { display: flex; flex-direction: column; align-items: center; gap: .35rem; flex: none; }

/* ⓘ Info-Blasen & „So funktioniert's“ */
.info-tip { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: .2rem; padding: 0; vertical-align: -.3em;
  border: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent); cursor: pointer; transition: transform .12s, background-color .15s; }
.info-tip svg { width: 15px; height: 15px; }
.info-tip:hover, .info-tip[aria-describedby] { background: var(--accent); color: #fff; }
.info-tip:active { transform: scale(.9); }
.hero .info-tip, .machine-panel .info-tip { background: rgba(255, 255, 255, .22); color: #fff; }
.help-pill { display: inline-flex; align-items: center; gap: .35rem; margin-left: .65rem; vertical-align: .25em; padding: .28rem .7rem .28rem .5rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: 0;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .12s, border-color .15s; white-space: nowrap; }
.help-pill svg { width: 16px; height: 16px; }
.help-pill:hover { border-color: var(--accent); }
.hero .help-pill { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .35); color: #fff; box-shadow: none; }
.popover { --bs-popover-bg: var(--surface); --bs-popover-border-color: var(--line-strong); --bs-popover-body-color: var(--ink); --bs-popover-header-bg: var(--surface-2); --bs-popover-header-color: var(--ink); --bs-popover-max-width: 300px; font-size: .88rem; box-shadow: var(--shadow-lg); border-radius: 14px; }
.popover-header { font-size: .85rem; font-weight: 700; }
.quick-qty .info-tip { width: 22px; height: 22px; font-size: inherit; border-radius: 50%; }

/* ================================================================ Notizen, Protokoll, Bericht */
.note-fab {
  position: fixed; right: 16px; bottom: calc(var(--bottom-h) + 28px + env(safe-area-inset-bottom)); z-index: 1025;
  width: 52px; height: 52px; border-radius: 18px; border: 0; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #ff9f1c, #ff1f8c); box-shadow: 0 10px 24px rgba(255, 31, 140, .35); transition: transform .15s var(--ease);
}
.note-fab svg { width: 24px; height: 24px; }
.note-fab:hover { transform: translateY(-2px); }
.note-fab:active { transform: scale(.94); }
@media (min-width: 992px) { .note-fab { bottom: 24px; right: 24px; } }
.note-panel.offcanvas-end { width: min(440px, 100vw); }
.note-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.note-kind { display: flex; align-items: center; justify-content: center; gap: .35rem; padding: .6rem; border-radius: 12px; border: 2px solid var(--line-strong); font-weight: 700; cursor: pointer; background: var(--surface); }
.btn-check:checked + .note-kind { border-color: transparent; background: var(--grad); color: #fff; }
.chip-link { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: .86rem; font-weight: 600; }
.chip-link.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.note-card { border-left: 4px solid var(--accent); }
.note-card.note-bug { border-left-color: var(--bad); }
.note-card.note-wunsch { border-left-color: #f59e0b; }
.note-card.done { opacity: .6; }
.note-card.done .note-text { text-decoration: line-through; }
.note-text { margin-top: .5rem; font-size: 1rem; white-space: normal; }
.note-badge { font-weight: 700; color: var(--ink); }
.console { background: #0b1220; color: #cbd5e1; border-radius: var(--radius); padding: .5rem 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; max-height: 70vh; overflow: auto; border: 1px solid var(--line); }
.log-row { display: grid; grid-template-columns: 5.2rem 5rem 5.5rem minmax(0, 1fr); gap: .6rem; padding: .3rem .8rem; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.log-row:hover { background: rgba(255, 255, 255, .04); }
.log-time { color: #64748b; }
.log-kind { color: #7dd3fc; font-weight: 700; }
.log-user { color: #a78bfa; overflow: hidden; text-overflow: ellipsis; }
.log-main { min-width: 0; overflow-wrap: anywhere; }
.log-msg { display: block; color: #e2e8f0; white-space: pre-wrap; }
.log-req { display: block; color: #64748b; font-size: .74rem; }
.lv-warn { background: rgba(251, 191, 36, .08); }
.lv-warn .log-kind { color: #fbbf24; }
.lv-error { background: rgba(248, 113, 113, .12); }
.lv-error .log-kind, .lv-error .log-msg { color: #fca5a5; }
.log-empty { padding: 1rem; color: #94a3b8; }
.console-embed .console { max-height: 42vh; }
.console-mini { max-height: 16rem; font-size: .75rem; }
.console-stat { font-size: .8rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: var(--bs-light-bg-subtle, rgba(127, 127, 127, .12)); }
.console-stat.bad { color: var(--bad, #dc2626); }
.console-stat.warn { color: #b45309; }
.note-logs summary { cursor: pointer; font-size: .85rem; color: var(--bs-secondary-color, #64748b); }
.note-logs summary:hover { color: inherit; }
@media (max-width: 575.98px) { .log-row { grid-template-columns: 4.6rem minmax(0, 1fr); } .log-kind { grid-column: 2; } .log-user { display: none; } .log-main { grid-column: 1 / -1; } }
.report-head h2 { font-size: 1.3rem; font-weight: 750; margin: 0 0 .2rem; }
.report-stats { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-weight: 650; }
.report-sec { margin-top: 1rem; }
.report-sec h3 { font-size: 1.05rem; font-weight: 750; margin-bottom: .75rem; }
.report-note { padding: .6rem 0; border-top: 1px solid var(--line); }
.report-note:first-of-type { border-top: 0; }
.console-print { max-height: none; }
@media print {
  .no-print, .note-fab, .help-pill { display: none !important; }
  .console { background: #fff; color: #000; border: 1px solid #999; font-size: 9pt; }
  .log-row { border-bottom: 1px solid #ddd; break-inside: avoid; }
  .log-msg, .lv-error .log-msg { color: #000; }
  .log-kind, .lv-warn .log-kind, .lv-error .log-kind { color: #333; }
  .lv-error { background: #fde8e8 !important; } .lv-warn { background: #fff5dc !important; }
  .panel { box-shadow: none; border: 1px solid #ccc; }
}

/* Scan-Zählen */
.scan-count-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.scan-count-toggle { border: 2px solid var(--line); border-radius: 999px; font-weight: 600; padding: .45rem 1rem; display: inline-flex; align-items: center; gap: .5rem; background: transparent; }
.scan-count-toggle .scan-count-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--ink-3); transition: background .2s, box-shadow .2s; }
.scan-count-toggle.on { border-color: var(--ok); color: var(--ok); }
.scan-count-toggle.on .scan-count-dot { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.scan-count-on [data-scan-count-target] { border-color: var(--ok); font-weight: 700; }
.scan-count-bump { animation: scanCountBump .35s ease; }
@keyframes scanCountBump { 0% { transform: scale(1); } 40% { transform: scale(1.12); background: color-mix(in srgb, var(--ok) 18%, transparent); } 100% { transform: scale(1); } }

/* Packliste */
.pack-summary { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: baseline; }
.pack-summary b { font-size: 1.4rem; }
.pack-list { display: grid; gap: .5rem; }
.pack-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto; gap: .75rem; align-items: center; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bs-body-bg, #fff); }
.pack-row.just-added { border-color: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); animation: scanCountBump .4s ease; }
.pack-row.short { border-color: var(--bad); }
.pack-row img, .pack-row .pack-ph { width: 52px; height: 52px; object-fit: contain; border-radius: 10px; background: color-mix(in srgb, var(--line) 50%, transparent); }
.pack-name { font-weight: 600; line-height: 1.25; }
.pack-meta { font-size: .8rem; color: var(--ink-3); }
.pack-meta .bad { color: var(--bad); font-weight: 600; }
.pack-qty { display: flex; align-items: center; gap: .25rem; }
.pack-qty input { width: 4.2rem; text-align: center; font-weight: 700; font-size: 1.1rem; }
.pack-qty .btn { min-width: 2.4rem; }
.pack-check { display: none; width: 1.3rem; height: 1.3rem; border: 2px solid #000; border-radius: 4px; }
@media (max-width: 575.98px) { .pack-row { grid-template-columns: 44px minmax(0, 1fr); } .pack-row img, .pack-row .pack-ph { width: 44px; height: 44px; } .pack-qty, .pack-del { grid-column: 2; } .pack-del { justify-self: end; margin-top: -2.4rem; } }
@media print {
  .pack-noprint, .scan-box, .side-nav, .topbar, .note-fab { display: none !important; }
  .pack-row { grid-template-columns: 1.6rem minmax(0, 1fr) 4rem; break-inside: avoid; border-color: #999; }
  .pack-row img, .pack-row .pack-ph, .pack-del, .pack-qty .btn { display: none !important; }
  .pack-check { display: block; }
  .pack-qty input { border: 0; font-size: 14pt; }
}
