/* Werkbank 2.0: Designsystem der Inventar-App.
   Aufbau: Schriften, Tokens, Grundlagen, Rahmen und Navigation, Komponenten, Module, Responsiv, Druck.
   Keine Inline-Styles: Die Sicherheitsrichtlinie verbietet sie. Variable Breiten laufen ueber SVG-Attribute. */

@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-var.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --display: "Manrope", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --r-sm: 7px; --r: 10px; --r-lg: 14px; --r-xl: 18px;
  --control: 42px; --control-sm: 36px; --gap: 16px; --pad: 20px;
  --nav-w: 252px; --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
  --bg: #edf2f3; --surface: #ffffff; --surface-2: #f5f8f9; --sunken: #e5edef;
  --line: #d9e3e6; --line-strong: #b7c7cc;
  --ink: #0f2a33; --muted: #4c636d;
  --accent: #0a6e7c; --accent-strong: #07525d; --accent-soft: #dcf0f2; --on-accent: #ffffff; --turq: #12a5a5; --bar-ok: #12a5a5; --bar-low: #e08a00; --bar-crit: #d92d20;
  --ok: #12704a; --ok-soft: #dff3e8; --warn: #8a5200; --warn-soft: #fbefd9; --bad: #b42318; --bad-soft: #fce8e6; --on-bad: #ffffff; --info: #1e5aa8; --info-soft: #e3edfb;
  --in: #086a60; --out: #a34714; --in-fill: #12a5a5; --out-fill: #d9772f;
  --shadow-1: 0 1px 2px rgba(15, 42, 51, .05);
  --shadow-2: 0 2px 4px rgba(15, 42, 51, .05), 0 10px 28px rgba(15, 42, 51, .08);
  --shadow-3: 0 12px 44px rgba(8, 28, 35, .26);

  --nav: #0c2f3a; --nav-2: #123c49; --nav-ink: #e4f1f4; --nav-muted: #a4c0c9; --nav-line: rgba(228, 241, 244, .13); --nav-active: rgba(60, 196, 196, .17); --nav-mark: #4fd6d6;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a181e; --surface: #12262e; --surface-2: #172e37; --sunken: #0e2027;
  --line: #24404b; --line-strong: #3d606d;
  --ink: #e8f1f3; --muted: #a6bcc5;
  --accent: #3cc4c4; --accent-strong: #76dcdc; --accent-soft: #123c42; --on-accent: #042226; --turq: #3cc4c4; --bar-ok: #3cc4c4; --bar-low: #f2c06f; --bar-crit: #f7786b;
  --ok: #6fd9a2; --ok-soft: #123a29; --warn: #f2c06f; --warn-soft: #3e2e10; --bad: #f7a198; --bad-soft: #47201c; --on-bad: #2c0a06; --info: #a2c6f7; --info-soft: #1a3152;
  --in: #4fd6c4; --out: #f5a66d; --in-fill: #3cc4c4; --out-fill: #ef9a5c;
  --shadow-1: none; --shadow-2: 0 10px 28px rgba(0, 0, 0, .28); --shadow-3: 0 14px 48px rgba(0, 0, 0, .55);
  --nav: #071418; --nav-2: #0f252d;
}

/* Grundlagen */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font: 700 24px/1.2 var(--display); letter-spacing: -.02em; }
h2 { font: 700 16px/1.3 var(--display); letter-spacing: -.01em; }
h3 { font-size: 14.5px; font-weight: 600; }
p { margin: 0; }
small { font-size: 13px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.nav :focus-visible { outline-color: var(--nav-mark); }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: var(--r); }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.code { font-family: var(--mono); font-size: max(.88em, 12.5px); color: var(--muted); letter-spacing: -.01em; }
.code-lg { font-size: 1.1em; color: var(--ink); }
.break { overflow-wrap: anywhere; }
.link { color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }
.link .ico { width: 15px; height: 15px; }
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.text-in { color: var(--in); } .text-out { color: var(--out); }
.text-up { color: var(--in); } .text-down { color: var(--bad); }
.ico { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .only-light, [data-theme="light"] .only-dark { display: none; }

/* Rahmen */
.shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); transition: grid-template-columns .18s var(--ease); }
.main-wrap { min-width: 0; }
.main { max-width: 1480px; margin: 0 auto; padding: 26px 32px 64px; display: flex; flex-direction: column; gap: var(--gap); }
.main > * { min-width: 0; }

/* Navigation: Seitenleiste */
.nav { background: var(--nav); color: var(--nav-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 14px 12px 10px; z-index: 40; min-width: 0; }
.nav-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; padding: 0 4px 0 6px; }
.brand { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
.brand:hover { color: inherit; }
.brand-mark { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 9px; background: var(--nav-2); color: var(--nav-mark); }
.brand-mark .ico { width: 20px; height: 20px; }
.brand-text { font: 800 16px/1.1 var(--display); letter-spacing: -.02em; white-space: nowrap; }
.brand-text small { display: block; font: 400 12.5px/1.3 var(--font); letter-spacing: 0; color: var(--nav-muted); }
.nav-tools { display: flex; flex-direction: column; gap: 6px; padding: 12px 0 8px; }
.nav-cta { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border-radius: var(--r); background: var(--nav-mark); color: #05262c; font-weight: 600; font-size: 14.5px; text-decoration: none; transition: background .14s, transform .14s; }
.nav-cta:hover { background: #79e3e3; color: #05262c; }
.nav-cta:active { transform: translateY(1px); }
.nav-cta.is-active { box-shadow: 0 0 0 2px var(--nav), 0 0 0 4px var(--nav-mark); }
.nav-search { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 10px; border: 1px solid var(--nav-line); border-radius: var(--r); background: transparent; color: var(--nav-muted); font: 400 14px var(--font); cursor: pointer; text-align: left; transition: border-color .14s, color .14s; }
.nav-search:hover { border-color: var(--nav-muted); color: var(--nav-ink); }
.nav-search kbd { margin-left: auto; font: 400 12px var(--mono); padding: 1px 6px; border: 1px solid var(--nav-line); border-radius: 5px; }
.nav-groups { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--nav-line) transparent; margin: 0 -4px; padding: 2px 4px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-label { font-size: 12.5px; font-weight: 500; color: var(--nav-muted); padding: 5px 10px 3px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 0 10px; min-height: 36px; border-radius: var(--r-sm); color: var(--nav-ink); text-decoration: none; font-size: 14.5px; transition: background .12s, color .12s; }
.nav-link:hover { background: var(--nav-2); color: #fff; }
[data-theme="dark"] .nav-link:hover { color: var(--nav-ink); }
.nav-link .ico { color: var(--nav-muted); transition: color .12s; }
.nav-link:hover .ico { color: var(--nav-ink); }
.nav-link.is-active { background: var(--nav-active); color: #fff; font-weight: 600; }
.nav-link.is-active::before { content: ""; position: absolute; left: -4px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--nav-mark); }
.nav-link.is-active .ico { color: var(--nav-mark); }
.nav-badge { margin-left: auto; background: #f2c06f; color: #33240a; border-radius: 99px; min-width: 21px; padding: 0 6px; font-size: 12.5px; font-weight: 600; line-height: 21px; text-align: center; }
.nav-foot { border-top: 1px solid var(--nav-line); margin-top: 8px; padding-top: 8px; display: flex; align-items: center; gap: 2px; }
.nav-user { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; min-width: 0; flex: 1; padding: 5px 6px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.nav-user:hover { background: var(--nav-2); color: inherit; }
.nav-user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user small { display: block; color: var(--nav-muted); font-size: 12.5px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font: 700 13px var(--display); }
.nav .avatar { background: var(--nav-2); color: var(--nav-mark); }
.nav-actions { display: flex; gap: 1px; }
.nav-actions form { display: contents; }
.icon-btn { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; background: none; border: 0; border-radius: var(--r-sm); color: inherit; cursor: pointer; transition: background .12s; padding: 0; }
.icon-btn:hover { background: var(--sunken); }
.nav .icon-btn { color: var(--nav-muted); }
.nav .icon-btn:hover { background: var(--nav-2); color: var(--nav-ink); }
.nav-collapse .ico { transition: transform .18s var(--ease); }
.nav .nav-close { display: none; }
.tabbar, .nav-scrim { display: none; }

/* Eingeklappte Seitenleiste */
@media (min-width: 760px) {
  [data-nav="collapsed"] { --nav-w: 70px; }
  [data-nav="collapsed"] .nav-head { justify-content: center; padding: 0; flex-direction: column; gap: 6px; }
  [data-nav="collapsed"] .brand-text, [data-nav="collapsed"] .nav-text, [data-nav="collapsed"] .nav-search kbd, [data-nav="collapsed"] .nav-user-name { display: none; }
  [data-nav="collapsed"] .nav-collapse .ico { transform: rotate(180deg); }
  [data-nav="collapsed"] .nav-label { height: 1px; padding: 0; margin: 2px 8px 5px; background: var(--nav-line); overflow: hidden; color: transparent; }
  [data-nav="collapsed"] .nav-group:first-child .nav-label { display: none; }
  [data-nav="collapsed"] .nav-cta, [data-nav="collapsed"] .nav-search { justify-content: center; padding: 0; }
  [data-nav="collapsed"] .nav-link { justify-content: center; padding: 0; min-height: 40px; }
  [data-nav="collapsed"] .nav-link.is-active::before { left: -8px; }
  [data-nav="collapsed"] .nav-badge { position: absolute; top: 3px; right: 3px; min-width: 17px; padding: 0 4px; font-size: 11.5px; line-height: 17px; margin: 0; }
  [data-nav="collapsed"] .nav-foot { flex-direction: column; }
  [data-nav="collapsed"] .nav-user { flex: 0 0 auto; padding: 3px; }
  [data-nav="collapsed"] .nav-actions { flex-direction: column; }
}
.tip { position: fixed; z-index: 90; max-width: 280px; padding: 6px 10px; border-radius: var(--r-sm); background: #06191f; color: #eef6f7; font-size: 13px; line-height: 1.4; pointer-events: none; box-shadow: var(--shadow-2); white-space: pre-line; opacity: 0; transition: opacity .1s; }
.tip.is-on { opacity: 1; }
[data-theme="dark"] .tip { background: #e8f1f3; color: #0f2a33; }

/* Ladebalken bei Seitenwechsel */
.page-progress { position: fixed; left: 0; top: 0; height: 2px; width: 100%; z-index: 95; background: var(--turq); transform-origin: left; transform: scaleX(0); opacity: 0; }
.page-progress.is-on { opacity: 1; animation: page-progress 2.4s var(--ease) forwards; }
@keyframes page-progress { from { transform: scaleX(.05); } to { transform: scaleX(.92); } }

/* Seitenkopf */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; flex: 1 1 280px; display: flex; flex-direction: column; gap: 3px; }
.page-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.page-sub { color: var(--muted); font-size: 14.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-actions form { display: contents; }
.crumbs { font-size: 13.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: -8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: var(--control); padding: 8px 15px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 14px/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s, box-shadow .12s, transform .08s; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn-in { background: var(--in); border-color: var(--in); color: var(--on-accent); }
.btn-in:hover { background: var(--in); border-color: var(--in); color: var(--on-accent); filter: brightness(.92); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: var(--on-bad); }
.btn-danger:hover { background: var(--bad); border-color: var(--bad); color: var(--on-bad); filter: brightness(.92); }
.btn-danger-ghost { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn-danger-ghost:hover { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.btn-ghost { background: none; border-color: transparent; }
.btn-ghost:hover { background: var(--sunken); border-color: transparent; }
.btn-sm { min-height: var(--control-sm); padding: 6px 11px; font-size: 13.5px; border-radius: var(--r-sm); }
.btn-lg { min-height: 48px; padding: 10px 20px; font-size: 15px; }
.btn-xl { min-height: 58px; font-size: 17px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon-only { width: var(--control); padding: 0; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; }
.btn-primary.is-loading::after, .btn-in.is-loading::after, .btn-danger.is-loading::after { border-color: color-mix(in srgb, var(--on-accent) 40%, transparent); border-top-color: var(--on-accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.is-fav { color: var(--warn); }
.is-fav .ico { fill: currentColor; }

/* Felder */
:where(input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input:not([type]), select, textarea) {
  width: 100%; min-height: var(--control); padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 400 15px/1.3 var(--font); transition: border-color .12s, box-shadow .12s;
}
:where(input, select, textarea):hover { border-color: var(--muted); }
:where(input, select, textarea):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=file] { font: inherit; color: var(--ink); max-width: 100%; }
input[type=file]::file-selector-button { font: 600 14px var(--font); min-height: 38px; padding: 6px 12px; margin-right: 10px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); cursor: pointer; }
input::placeholder { color: var(--muted); opacity: .85; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
select { width: auto; max-width: 100%; }
.form select, .field select { width: 100%; }
label { font-size: 13.5px; font-weight: 500; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-narrow { max-width: 520px; }
.form-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field.has-error input { border-color: var(--bad); }
.hint { font-size: 13px; color: var(--muted); }
.check-label { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 400; min-height: 32px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; margin: 0; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.form-actions form { display: contents; }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-row .field { flex: 1 1 180px; }
.form-section { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-section:first-of-type { padding-top: 0; border-top: 0; }
.form-section-title { font-size: 14px; font-weight: 600; }
.input-with-btn { position: relative; }
.input-with-btn input { padding-right: 96px; }
.input-with-btn .btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }
.inline { display: inline; margin-left: 8px; }
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form-end { justify-content: flex-end; }

.env-banner { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 80; width: max-content; max-width: 100%; padding: 2px 12px; border-radius: 0 0 var(--r-sm) var(--r-sm); background: #f2c06f; color: #231a05; font-size: 12.5px; font-weight: 600; text-align: center; pointer-events: none; }

/* Flaechen */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--pad); box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel-flush { padding: 0; }
.panel-title { font: 700 15.5px/1.3 var(--display); letter-spacing: -.01em; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 24px; }
.panel-danger { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.panel-danger .panel-title { color: var(--bad); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: var(--gap); align-items: start; }

/* Hinweise */
.alert { padding: 11px 14px; border-radius: var(--r); font-size: 14.5px; border: 1px solid transparent; display: block; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert-error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.alert-warning { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.flash-area { display: flex; flex-direction: column; gap: 8px; }
.flash-area:empty { display: none; }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; color: inherit; text-decoration: none; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 2px; min-width: 0; transition: border-color .14s, box-shadow .14s; }
a.kpi:hover { border-color: var(--accent); box-shadow: var(--shadow-2); color: inherit; }
.kpi-label { font-size: 13.5px; color: var(--muted); }
.kpi b { font: 700 29px/1.15 var(--display); letter-spacing: -.025em; }
.kpi b.kpi-date { font-size: 20px; line-height: 1.7; }
.kpi small { font-size: 13px; color: var(--muted); }
.kpi-warn b { color: var(--warn); }
.kpi-bad b { color: var(--bad); }
.kpi-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.spark { width: 84px; height: 30px; flex: 0 0 84px; display: block; overflow: visible; }
.spark path { fill: none; stroke: var(--out-fill); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: var(--muted); }

.filter-more { display: contents; }
.filter-more > summary { display: none; }
.filter-more > .toolbar { display: contents; }

/* Fuellstand: Balken mit Sollmarke */
.gauge-wrap { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.gauge { display: block; flex: 1 1 auto; min-width: 40px; height: 8px; border-radius: 99px; overflow: hidden; }
.gauge-track { fill: var(--sunken); }
.gauge-fill { fill: var(--bar-ok); }
.gauge-low .gauge-fill { fill: var(--bar-low); }
.gauge-critical .gauge-fill { fill: var(--bar-crit); }
.gauge-pct { flex: 0 0 auto; min-width: 3.4em; text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.gauge-none .gauge-pct { font-weight: 400; color: var(--muted); }
.gauge-critical .gauge-pct { color: var(--bad); }
.gauge-lg .gauge { height: 14px; }
.mode-pick { display: flex; flex-direction: column; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.mode-pick legend { font-weight: 600; font-size: 14.5px; margin-bottom: 8px; padding: 0; }
.mode-card { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--r); cursor: pointer; font-weight: 400; }
.mode-card span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mode-card small { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.mode-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mode-card-danger:has(input:checked) { border-color: var(--bad); background: var(--bad-soft); }
.import-compare { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; }
.import-save { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.import-save .hint { flex: 1 1 200px; }
.import-next { justify-content: space-between; }
.import-next [hidden] { display: none; }
.import-line { gap: 10px; scroll-margin-top: 16px; }
.import-line-head { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.import-decision { margin-left: auto; }
.import-similar { padding: 8px 10px; background: var(--sunken); border-radius: var(--r-sm); }
.import-choice { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; }
.import-choice label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; min-height: 40px; font-weight: 500; cursor: pointer; }
.import-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.import-fields[hidden] { display: none; }
.import-title { padding: 14px var(--pad) 0; }
[data-import-group] .table-wrap, .panel-flush > .table-wrap { margin: 0; max-width: 100%; }
.sticky-actions.import-bulk { position: static; flex-wrap: wrap; justify-content: flex-start; }
.sticky-actions.import-bulk .btn { flex: 1 1 auto; white-space: normal; }
.sticky-actions.import-bulk #selected-count { flex: 1 1 100%; }
.stock-limits { display: block; margin-top: 1px; font-size: 12.5px; line-height: 1.2; color: var(--muted); }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gauge-lg .gauge-pct { font-size: 15px; }
.stock-figure { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.stock-figure b { font: 700 16px var(--display); }
.stock-figure small { color: var(--muted); }

/* Aufgaben */
.task-list { gap: 2px; }
.task-list .panel-title { margin-bottom: 8px; }
.task { display: flex; align-items: center; gap: 12px; padding: 10px; margin: 0 -10px; min-height: 56px; border-radius: var(--r); color: inherit; text-decoration: none; transition: background .12s; }
.task:hover { background: var(--surface-2); color: inherit; }
.task-ico { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); }
.task-warn .task-ico { background: var(--warn-soft); color: var(--warn); }
.task-bad .task-ico { background: var(--bad-soft); color: var(--bad); }
.task-info .task-ico { background: var(--info-soft); color: var(--info); }
.task-text { flex: 1; min-width: 0; font-weight: 500; line-height: 1.35; }
.task-action { color: var(--accent); font-weight: 600; font-size: 13.5px; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.task-action .ico { width: 16px; height: 16px; transition: transform .14s var(--ease); }
.task:hover .task-action .ico { transform: translateX(2px); }
.all-clear { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.all-clear .task-ico { background: var(--ok-soft); color: var(--ok); }

/* Bewegungen */
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed li { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); min-width: 0; }
.feed li:first-child { border-top: 0; }
.feed-main { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.feed-title { color: inherit; text-decoration: none; font-weight: 500; }
a.feed-title:hover { color: var(--accent); text-decoration: underline; }
.feed-kind { display: block; font-weight: 600; }
.feed-note { display: block; margin: 3px 0 2px; padding: 3px 8px; border-left: 3px solid var(--line-strong, var(--line)); background: var(--sunken); border-radius: 0 var(--r-sm, 6px) var(--r-sm, 6px) 0; font-size: 14px; }
.feed-note-label { color: var(--muted); font-size: 12.5px; margin-right: 4px; }
.feed-main small { display: block; color: var(--muted); font-size: 13px; }
.feed li.is-reversed .feed-main, .feed li.is-reversed .feed-title, .feed li.is-reversed .feed-kind { color: var(--muted); }
.feed li.is-reversed .delta { color: var(--muted); background: var(--sunken); text-decoration: line-through; }
.delta { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 28px; padding: 0 7px; border-radius: 8px; font-weight: 600; font-size: 14px; flex: 0 0 auto; }
.delta-in { color: var(--in); background: color-mix(in srgb, var(--in) 12%, transparent); }
.delta-out { color: var(--out); background: color-mix(in srgb, var(--out) 12%, transparent); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.plain-list li:first-child { border-top: 0; }
.def-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 18px; margin: 0; font-size: 14.5px; }
.def-list dt { color: var(--muted); }
.def-list dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }

/* Leere Zustaende */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 16px; color: var(--muted); }
.empty > .ico { width: 44px; height: 44px; padding: 11px; border-radius: 14px; background: var(--sunken); color: var(--muted); }
.empty h2 { color: var(--ink); }
.empty p { max-width: 44ch; }
.empty .btn { margin-top: 6px; }
.empty-sm { padding: 20px 12px; }

/* Werkzeugleiste und Filter */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar-wrap > .search-box { flex: 1 1 100%; }
.search-box { position: relative; flex: 1 1 260px; min-width: 0; }
.search-box .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 38px; }
.search-box-lg input { min-height: 54px; font-size: 16.5px; border-radius: 12px; }
.date-field { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 400; }
.date-field input { width: 152px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 36px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); color: var(--ink); text-decoration: none; font: 500 13.5px/1.2 var(--font); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.chip:hover { background: var(--surface-2); border-color: var(--muted); color: var(--ink); }
.chip b { font-weight: 600; color: var(--muted); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip.is-active b { color: inherit; opacity: .85; }
.chip-fav .ico { width: 15px; height: 15px; color: var(--warn); fill: currentColor; }
.segmented { display: inline-flex; background: var(--sunken); border-radius: var(--r); padding: 3px; gap: 2px; }
.segmented a, .segmented button { padding: 6px 13px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); font: 600 13.5px/1.2 var(--font); text-decoration: none; cursor: pointer; transition: background .12s, color .12s; }
.segmented a:hover, .segmented button:hover { color: var(--ink); }
.segmented .is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }
.segmented-lg { display: grid; grid-template-columns: 1fr 1fr; }
.segmented-lg button { min-height: 46px; font-size: 15px; }
.segmented-lg button[data-type="out"].is-active { color: var(--out); }
.segmented-lg button[data-type="in"].is-active { color: var(--in); }
[aria-busy="true"] { opacity: .55; transition: opacity .12s; }

/* Tabellen */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.panel .table-wrap { border: 0; box-shadow: none; border-radius: 0; margin: 0 calc(var(--pad) * -1); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.table th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); background: var(--surface-2); padding: 9px 14px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: var(--surface-2); }
.table thead th:first-child { border-top-left-radius: var(--r-lg); }
.table thead th:last-child { border-top-right-radius: var(--r-lg); }
.table .num { text-align: right; }
.table .check { width: 44px; }
.table .gauge-cell { width: 150px; min-width: 110px; }
.table-sticky { overflow: visible; }
.table-sticky .table th { position: sticky; top: 0; z-index: 5; }
.sort { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; min-height: 22px; }
.sort:hover { color: var(--ink); text-decoration: underline; }
.sort .ico { width: 14px; height: 14px; opacity: .85; }
.sort-off .ico { opacity: .32; }
.row-title { display: block; font-weight: 600; color: inherit; text-decoration: none; overflow-wrap: anywhere; line-height: 1.35; }
a.row-title:hover { color: var(--accent); text-decoration: underline; }
.cell-note { display: block; font-size: 13px; }
.cell-note-col { max-width: 260px; overflow-wrap: anywhere; font-size: 14px; }
.tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 99px; background: var(--sunken); color: var(--muted); font-size: 12.5px; line-height: 20px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 13px; font-weight: 500; white-space: nowrap; line-height: 20px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-low { background: var(--warn-soft); color: var(--warn); }
.pill-ordered { background: var(--info-soft); color: var(--info); }
.pill-negative, .pill-urgent { background: var(--bad-soft); color: var(--bad); }
.pill-muted, .pill-order-cancelled { background: var(--sunken); color: var(--muted); }
.pill-order-draft { background: var(--warn-soft); color: var(--warn); }
.pill-order-released, .pill-order-partial { background: var(--info-soft); color: var(--info); }
.pill-order-completed { background: var(--ok-soft); color: var(--ok); }
.pill-abc-a { background: var(--bad-soft); color: var(--bad); } .pill-abc-b { background: var(--warn-soft); color: var(--warn); } .pill-abc-c { background: var(--ok-soft); color: var(--ok); }
.is-reversed td { color: var(--muted); }
.is-reversed .row-title { font-weight: 500; }
.is-reversed .text-in, .is-reversed .text-out { color: var(--muted); text-decoration: line-through; }
.actions-row { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.actions-row form { display: contents; }
.qty-input { width: 88px; text-align: right; }
.sticky-actions { position: sticky; bottom: 12px; z-index: 6; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); margin-top: var(--gap); }
.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pager { display: flex; gap: 3px; align-items: center; justify-content: center; flex-wrap: wrap; }
.pager-num, .pager-now, .pager-gap { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); font-size: 14px; }
.pager-num:hover { background: var(--sunken); color: var(--ink); }
.pager-now { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* Dashboard */
.hello { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.hello > div:first-child { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--gap); align-items: stretch; }
.dash-top .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dist-bar { display: flex; height: 12px; gap: 2px; border-radius: 6px; overflow: hidden; }
.dist-bar svg { width: 100%; height: 12px; display: block; }
.dist-ok { fill: var(--turq); } .dist-ordered { fill: color-mix(in srgb, var(--info) 65%, transparent); } .dist-low { fill: var(--warn); } .dist-urgent { fill: var(--bar-crit); } .dist-negative { fill: var(--bad); }
.dist-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13.5px; list-style: none; margin: 0; padding: 0; }
.dist-legend a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; }
.dist-legend a:hover { text-decoration: underline; }
.dist-legend i { width: 10px; height: 10px; border-radius: 3px; }
i.k-ok { background: var(--turq); } i.k-ordered { background: color-mix(in srgb, var(--info) 65%, transparent); } i.k-low { background: var(--warn); } i.k-negative { background: var(--bad); }
i.k-urgent { background: var(--bar-crit); }
.dist-legend b { font-weight: 600; }

/* Diagramm: Achsen sind HTML, damit die Schrift auf jedem Bildschirm gleich gross bleibt */
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.chart-legend { font-size: 13.5px; color: var(--muted); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 11px; height: 11px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }
.key-in { background: var(--in-fill); } .key-out { background: var(--out-fill); } .key-net { background: var(--accent); height: 3px; }
.chart-frame { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 210px auto; column-gap: 8px; row-gap: 6px; }
.chart-y { display: flex; flex-direction: column-reverse; justify-content: space-between; font-size: 12.5px; line-height: 1; color: var(--muted); text-align: right; min-width: 24px; }
.chart-x { grid-column: 2; display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.chart { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .base { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .bar-in { fill: var(--in-fill); }
.chart .bar-out { fill: var(--out-fill); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: color-mix(in srgb, var(--ink) 7%, transparent); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart-note { font-size: 13px; color: var(--muted); }
.chart-sm { grid-template-rows: 150px auto; }
.bars, .dist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 46px; gap: 12px; align-items: center; }
.bars-label { min-width: 0; font-size: 14px; overflow-wrap: anywhere; line-height: 1.3; }
.bars-label small { display: block; }
.bars-value { text-align: right; }
.dist li { display: grid; grid-template-columns: 112px minmax(0, 1fr) 46px; gap: 10px; align-items: center; }
.dist li b { text-align: right; }
.dist li .pill { justify-self: start; }
meter { width: 100%; height: 8px; display: block; background: var(--sunken); border-radius: 4px; -webkit-appearance: none; appearance: none; border: 0; }
meter::-webkit-meter-bar { background: var(--sunken); border: 0; border-radius: 4px; height: 8px; }
meter::-webkit-meter-optimum-value { background: var(--out-fill); border-radius: 4px; }
meter::-moz-meter-bar { background: var(--out-fill); border-radius: 4px; }
.meter-progress::-webkit-meter-optimum-value { background: var(--turq); } .meter-progress::-moz-meter-bar { background: var(--turq); }
.meter-ok::-webkit-meter-optimum-value { background: var(--turq); } .meter-ok::-moz-meter-bar { background: var(--turq); }
.meter-ordered::-webkit-meter-optimum-value { background: var(--info); } .meter-ordered::-moz-meter-bar { background: var(--info); }
.meter-low::-webkit-meter-optimum-value { background: var(--warn); } .meter-low::-moz-meter-bar { background: var(--warn); }
.meter-negative::-webkit-meter-optimum-value { background: var(--bad); } .meter-negative::-moz-meter-bar { background: var(--bad); }

/* Bestand: Zusatzangaben nur am Handy, Fuellstand nur bei genug Platz */
.only-phone { display: none; }

/* Artikeldetail */
.article-hero { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 28px; }
.figure { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.figure b { font: 700 32px/1.15 var(--display); letter-spacing: -.025em; }
.figure span { font-size: 13.5px; color: var(--muted); }
.article-gauge { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.gauge-state { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink); }
.gauge-legend { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.disclosure { border-top: 1px solid var(--line); }
.disclosure:first-of-type { border-top: 0; }
.disclosure summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none; border-radius: var(--r-sm); }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary .ico { width: 16px; height: 16px; color: var(--muted); transition: transform .16s var(--ease); }
.disclosure[open] summary .ico { transform: rotate(90deg); }
.disclosure-body { padding: 2px 0 16px; display: flex; flex-direction: column; gap: 10px; }
.disclosure-danger summary { color: var(--bad); }

/* Artikel hinzufuegen, Wareneingang */
.result-list, .receive-list { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }
.result, .receive { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; padding: 13px 16px; }
.result-main, .receive-main { min-width: 0; flex: 1 1 280px; display: flex; flex-direction: column; gap: 2px; }
.result h2 { font: 600 15px/1.35 var(--font); letter-spacing: 0; overflow-wrap: anywhere; }
.add-form, .receive-form { display: flex; gap: 8px; align-items: flex-end; }
.add-form label, .receive-form label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); font-weight: 400; }
.add-form input { width: 78px; text-align: right; }
.receive-group { display: flex; flex-direction: column; gap: 8px; }
.receive-group-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 2px 0; }
.receive-group-head h2 { display: flex; align-items: center; gap: 8px; }

/* Auftrag: Zeitachse */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 14px; line-height: 1.35; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--turq); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 16px; bottom: -2px; width: 1px; background: var(--line-strong); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline small { display: block; color: var(--muted); }

/* Buchen */
.book { display: flex; flex-direction: column; gap: 12px; max-width: 620px; width: 100%; margin: 0 auto; }
.book-search { display: flex; gap: 8px; }
.btn-scan { min-height: 54px; padding: 8px 16px; border-radius: 12px; }
.results { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); max-height: 50vh; overflow-y: auto; }
.results button { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; width: 100%; text-align: left; padding: 11px 14px; min-height: 58px; background: none; border: 0; border-top: 1px solid var(--line); color: inherit; font: 500 15px/1.3 var(--font); cursor: pointer; align-items: center; }
.results li:first-child button { border-top: 0; }
.results button:hover, .results button:focus-visible { background: var(--surface-2); }
.results small { display: block; color: var(--muted); font-family: var(--mono); font-size: 12.5px; font-weight: 400; margin-top: 2px; }
.results .result-stock { grid-column: 2; grid-row: 1 / span 2; text-align: right; font: 700 18px var(--display); }
.results .result-stock small { font: 400 12.5px var(--font); margin: 0; }
.book-msg:empty { display: none; }
.fav-row { display: flex; gap: 6px; overflow-x: auto; padding: 1px 1px 3px; scrollbar-width: none; }
.fav-row .chip { white-space: nowrap; flex: 0 0 auto; }
.book-card { gap: 12px; box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.book-article { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.book-article strong { display: block; font: 700 18px/1.3 var(--display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.book-stockline { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }
.book-stock-num { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; font-size: 13.5px; color: var(--muted); }
.book-stock-num b { font: 700 22px var(--display); color: var(--ink); }
.book-after { font-weight: 600; color: var(--ink); white-space: nowrap; }
.book-gauge { flex: 1; min-width: 40px; }
.stepper { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 8px; }
.stepper-btn { min-height: 62px; padding: 0; border-radius: 12px; }
.stepper-btn .ico { width: 24px; height: 24px; stroke-width: 2.2; }
.stepper input { min-height: 62px; text-align: center; font: 700 30px var(--display); border-radius: 12px; }
.quick-qty { display: flex; gap: 6px; }
.quick-qty .chip { flex: 1; justify-content: center; min-height: 40px; }
.book-note summary { font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer; min-height: 32px; display: flex; align-items: center; gap: 6px; list-style: none; }
.book-note summary::-webkit-details-marker { display: none; }
.book-note summary .ico { width: 15px; height: 15px; }
.book-note[open] summary { margin-bottom: 4px; }
.feed .undo { flex: 0 0 auto; }
.scanner { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #000; }
.scanner video { display: block; width: 100%; height: 44vh; max-height: 420px; object-fit: cover; background: #000; }
.scanner[data-state="problem"] { background: var(--surface); border: 1px solid var(--line); }
.scanner[data-state="problem"]:not([data-code="playback"]) video { display: none; }
.scanner[data-state="problem"] .scanner-frame, .scanner[data-state="problem"] .scanner-hint { display: none; }
.scanner[data-state="problem"] .scanner-stop { display: none; }
.scanner-problem { display: flex; flex-direction: column; gap: 10px; padding: var(--pad); color: var(--ink); }
.scanner-problem[hidden] { display: none; }
.scanner-problem h2 { font: 700 17px/1.3 var(--display); color: var(--bad); }
.scanner-problem p { line-height: 1.45; }
.scanner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.scanner-actions .btn { flex: 1 1 150px; min-height: 44px; }
.scanner-details { font-size: 13px; color: var(--muted); }
.scanner-details pre { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12.5px; }
.scanner-frame { position: absolute; left: 10%; right: 10%; top: 30%; bottom: 30%; border-radius: 12px; pointer-events: none; border: 2px solid #4fd6d6; }
.scanner-frame::after { content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #4fd6d6; opacity: .75; animation: scan-line 1.8s ease-in-out infinite alternate; }
@keyframes scan-line { from { transform: translateY(-34px); } to { transform: translateY(34px); } }
.scanner-stop { position: absolute; top: 10px; right: 10px; }
.scanner-hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #fff; font-size: 14px; text-shadow: 0 1px 2px #000; }

/* Inventur */
.inv-progress { position: sticky; top: 0; z-index: 8; gap: 8px; }
.inv-progress-line { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; align-items: center; }
.inv-list { list-style: none; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.inv-row { display: grid; grid-template-columns: minmax(0, 1fr) 74px 104px 232px; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); transition: background .14s; }
.inv-row:first-child { border-top: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.inv-row:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.inv-main strong { display: block; font-weight: 600; overflow-wrap: anywhere; line-height: 1.35; }
.inv-expected { text-align: right; line-height: 1.25; }
.inv-expected small { display: block; color: var(--muted); }
.inv-state { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 5px; line-height: 1.25; }
.inv-state .ico { width: 15px; height: 15px; }
.inv-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.inv-input input { text-align: right; font-size: 16px; font-weight: 600; }
.inv-row.is-counted { background: color-mix(in srgb, var(--ok-soft) 42%, transparent); }
.inv-row.is-counted .inv-state { color: var(--ok); }
.inv-row.is-diff { background: var(--warn-soft); }
.inv-row.is-diff .inv-state { color: var(--warn); font-weight: 600; }
.inv-row.is-saving .inv-state { color: var(--muted); }
.inv-row.is-failed { background: var(--bad-soft); }
.inv-row.is-failed .inv-state { color: var(--bad); font-weight: 600; }

/* Benutzer */
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-cell > span:last-child { min-width: 0; }

/* Konto und Einstellungen */
.theme-pick { display: inline-flex; }
.settings-layout { display: flex; flex-direction: column; gap: var(--gap); max-width: 980px; }
.settings-row { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px 24px; }
.settings-row-title h2 { font-size: 15.5px; }
.settings-row-title p { font-size: 13.5px; color: var(--muted); margin-top: 3px; }

/* Dialoge und Meldungen */
.dialog { border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); color: var(--ink); padding: 22px; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-3); }
.dialog[open] { animation: rise .16s var(--ease); }
.dialog::backdrop { background: rgba(6, 22, 28, .58); }
.dialog form { display: flex; flex-direction: column; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.search-dialog { padding: 0; width: min(640px, calc(100vw - 32px)); margin-top: 10vh; max-height: 76vh; overflow: hidden; }
.search-dialog[open] { display: flex; flex-direction: column; }
.search-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.search-head > .ico { color: var(--muted); }
.search-head input::-webkit-search-cancel-button { display: none; }
.search-head input { border: 0; background: none; min-height: 46px; font-size: 16.5px; box-shadow: none !important; }
.search-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; min-height: 0; }
.search-item { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border-radius: var(--r); }
.search-item:hover { background: var(--surface-2); }
.search-item a.search-open { flex: 1; min-width: 0; display: block; padding: 6px 0; color: inherit; text-decoration: none; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.search-item small { display: block; font: 400 12.5px var(--mono); color: var(--muted); }
.search-empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.toast-area { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; width: min(500px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; background: #0f2a33; color: #f0f7f8; border-radius: var(--r); padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 14.5px; box-shadow: var(--shadow-3); animation: rise .18s var(--ease); }
[data-theme="dark"] .toast { background: #e8f1f3; color: #0f2a33; }
.toast-text { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.toast-text .ico { margin-top: 2px; color: #4fd6d6; }
[data-theme="dark"] .toast-text .ico { color: #0a6e7c; }
.toast-error, [data-theme="dark"] .toast-error { background: var(--bad); color: var(--on-bad); }
.toast-error .toast-text .ico, [data-theme="dark"] .toast-error .toast-text .ico { color: inherit; }
.toast button { background: none; border: 1px solid currentColor; border-radius: var(--r-sm); color: inherit; font: 600 13.5px var(--font); cursor: pointer; min-height: 36px; padding: 0 10px; white-space: nowrap; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }
.toast-success .toast-text .ico { animation: pop .3s var(--ease); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Anmeldung */
.bare { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--bg); margin: 0; }
.bare-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.bare-brand { background: var(--nav); color: var(--nav-ink); padding: 44px clamp(32px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.bare-brand .brand-text { font-size: 19px; }
.bare-brand h2 { font: 700 clamp(26px, 2.6vw, 36px)/1.15 var(--display); letter-spacing: -.025em; color: #fff; max-width: 15em; }
.bare-brand p { color: var(--nav-muted); max-width: 34em; margin-top: 12px; }
.bare-gauges { display: flex; flex-direction: column; gap: 14px; max-width: 420px; list-style: none; margin: 0; padding: 0; }
.bare-gauges li { display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.bare-gauges .gauge-wrap { --sunken: var(--nav-2); --ink: #e4f1f4; --bar-ok: #4fd6d6; --bar-low: #f2c06f; --bar-crit: #f7786b; }
.bare-main { display: grid; place-items: center; padding: 28px 20px; min-width: 0; }
.bare-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-2); }
.brand-row { display: flex; }
.logo { height: 36px; width: auto; }
[data-theme="dark"] .logo { background: #fff; border-radius: 8px; padding: 4px 8px; box-sizing: content-box; }

/* Druck */
.print-page { background: #fff; color: #111; padding: 24px; --ink: #111; --surface: #fff; --surface-2: #f3f3f3; --line-strong: #999; }
.print-actions { display: flex; gap: 8px; margin-bottom: 18px; }
.print-doc { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.print-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.print-head p { color: #444; font-size: 14px; }
.print-logo { height: 48px; width: auto; }
.print-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.print-table th, .print-table td { border: 1px solid #bbb; padding: 6px 8px; text-align: left; }
.print-table th { background: #eee; }
.print-table .num { text-align: right; }
.print-mark td { background: #fff4d8; }
@media print { .no-print { display: none !important; } .print-page { padding: 0; } .print-table tr { break-inside: avoid; } }

/* Mittlere Breiten */
@media (max-width: 1320px) {
  .dash-top { grid-template-columns: minmax(0, 1fr); }
  .dash-top .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .inv-row { grid-template-columns: minmax(0, 1fr) 70px 96px 210px; }
}
@media (max-width: 1100px) {
  .main { padding: 22px 22px 56px; }
  .col-opt { display: none; }
  .col-tablet-off { display: none; }
  .stock-table .code { overflow-wrap: anywhere; }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .table th, .table td { padding-left: 10px; padding-right: 10px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .settings-row { grid-template-columns: minmax(0, 1fr); }
  .bare-split { grid-template-columns: minmax(0, 1fr); }
  .bare-brand { display: none; }
}
@media (max-width: 900px) {
  .dash-top .kpis, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inv-row { grid-template-columns: minmax(0, 1fr) 64px 170px; }
  .inv-state { grid-column: 1 / -1; order: 5; }
}

/* Smartphone: eigene Navigation unten, Module als Blatt, Listen als Karten */
@media (max-width: 759px) {
  :root { --pad: 15px; --gap: 12px; }
  h1 { font-size: 22px; }
  html { scrollbar-gutter: auto; }
  .shell { display: block; padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  .main { padding: calc(14px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 24px max(14px, env(safe-area-inset-left, 0px)); }

  .nav { position: fixed; inset: auto 0 0 0; height: auto; max-height: 86dvh; border-radius: 20px 20px 0 0; padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)); transform: translateY(102%); visibility: hidden; transition: transform .22s var(--ease), visibility 0s linear .22s; z-index: 50; }
  .nav.is-open { transform: none; visibility: visible; transition: transform .22s var(--ease); }
  .nav .nav-close { display: grid; }
  .nav-collapse, .nav-tools { display: none; }
  .nav-groups { overflow-y: auto; gap: 8px; margin: 6px 0 0; padding: 0; }
  .nav-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .nav-label { grid-column: 1 / -1; padding: 4px 2px 0; }
  .nav-link { flex-direction: column; justify-content: center; gap: 5px; padding: 8px 4px; min-height: 72px; text-align: center; font-size: 13px; line-height: 1.2; background: var(--nav-2); border-radius: 12px; }
  .nav-link .ico { width: 22px; height: 22px; }
  .nav-link.is-active::before { display: none; }
  .nav-link.is-active { box-shadow: inset 0 0 0 1.5px var(--nav-mark); background: var(--nav-active); }
  .nav-badge { position: absolute; top: 5px; right: 6px; margin: 0; }
  .nav-scrim.is-open { display: block; position: fixed; inset: 0; background: rgba(6, 22, 28, .58); z-index: 45; }

  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -4px 18px rgba(8, 28, 35, .07); }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; background: none; border: 0; color: var(--muted); font: 500 12.5px/1.1 var(--font); text-decoration: none; cursor: pointer; }
  .tab .ico { width: 23px; height: 23px; }
  .tab.is-active { color: var(--accent); font-weight: 600; }
  .tab-main { color: var(--ink); font-weight: 600; }
  .tab-main .tab-ico { display: grid; place-items: center; width: 56px; height: 46px; margin-top: -20px; border-radius: 15px; background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 0 4px var(--surface); }
  .tab-main .tab-ico .ico { width: 27px; height: 27px; }
  .tab-main.is-active { color: var(--accent); }
  .tab-badge { position: absolute; top: 5px; left: calc(50% + 7px); background: var(--warn); color: var(--surface); border-radius: 99px; min-width: 18px; padding: 0 4px; font-size: 12px; line-height: 18px; text-align: center; font-weight: 600; }

  .toast-area { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .search-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .search-item { padding: 6px 4px 6px 10px; }

  .dialog-actions .btn { flex: 1; }
  .kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 12px 13px; }
  .kpi b { font-size: 24px; }
  .spark { display: none; }
  .form-2 { grid-template-columns: minmax(0, 1fr); }
  .page-head-compact { display: none; }
  .page-actions { width: 100%; }
  .page-actions-inline { width: auto; }
  .page-actions-inline .btn { flex: 0 0 auto; }
  .page-head:has(.page-actions-inline) > div:first-child { flex: 1 1 0; }
  .btn-label { display: none; }
  .page-actions .btn { flex: 1 1 auto; }
  .page-actions .segmented { width: 100%; }
  .page-actions .segmented a { flex: 1; }
  .hello .btn-primary { flex: 1 1 100%; min-height: 48px; }
  .hello .page-actions { width: 100%; }
  .btn-opt-mobile { display: none; }
  .filter-more { display: block; flex: 1 1 100%; }
  .filter-more > summary { display: inline-flex; list-style: none; }
  .filter-more > summary::-webkit-details-marker { display: none; }
  .filter-more > .toolbar { display: flex; margin-top: 8px; }
  .toolbar select { flex: 1 1 auto; }
  .toolbar .btn { flex: 0 0 auto; }
  .date-field { flex: 1 1 140px; }
  .date-field input { width: 100%; }
  :where(input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input:not([type]), select, textarea) { font-size: 16px; min-height: 44px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .chip { min-height: 40px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 1px 14px 3px; scrollbar-width: none; }
  .segmented a, .segmented button { min-height: 40px; }
  .table-sticky .table th { position: static; }

  /* Tabellen werden zu Karten */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody { display: block; }
  .table-cards tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: start; }
  .table-cards tbody tr:first-child { border-top: 0; }
  .table-cards td { display: block; padding: 0; border: 0; min-width: 0; background: none !important; }
  .table-cards .cell-main { grid-column: 1 / -1; order: -1; }
  .table-cards .cell-status { grid-column: 1 / -1; order: 5; }
  .table-cards .cell-action { grid-column: 1 / -1; order: 6; display: flex; gap: 6px; }
  .table-cards .cell-action:empty { display: none; }
  .table-cards .cell-note-col { grid-column: 1 / -1; max-width: none; }
  .table-cards .cell-note-col:empty { display: none; }
  .table-cards .cell-action .btn { flex: 1 1 auto; }
  .table-cards .cell-meta, .table-cards .cell-stat, .table-cards .cell-qty { text-align: left; font-size: 14px; }
  .table-cards [data-label]::before { content: attr(data-label); display: block; font-size: 12.5px; color: var(--muted); font-family: var(--font); }
  .table-cards tr { position: relative; }
  .table-cards tr:has(.check) .cell-main { padding-right: 38px; }
  .table-cards .check { position: absolute; right: 12px; top: 10px; width: auto; }
  .table-cards .check input { width: 26px; height: 26px; }
  .table-cards .qty-input { width: 100%; text-align: left; }
  .col-opt { display: none !important; }
  .col-tablet-off { display: revert; }
  .only-phone { display: inline; }
  .stock-table .col-phone-off { display: none; }

  /* Bestand: kompakte Zeile mit Zahl rechts und Direktbuchung */
  .stock-table tr { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; position: relative; padding: 8px 14px; }
  .stock-table .cell-main { grid-column: 1; grid-row: 1; }
  .stock-table .cell-figure { grid-column: 2; grid-row: 1; display: block; text-align: right; }
  .stock-table .cell-gauge { grid-column: 1; grid-row: 2; display: block; width: auto; min-width: 0; }
  .stock-table .cell-action { grid-column: 2; grid-row: 2 / span 2; order: 0; align-self: center; }
  .stock-table .cell-status { grid-column: 1; grid-row: 3; order: 0; }
  .stock-table .cell-action .btn { flex: 0 0 auto; }
  .stock-table .stock-figure { justify-content: flex-end; }
  .stock-table .stock-figure b { font-size: 20px; }
  .stock-table .cell-status:has(.pill-ok) { display: none; }

  .inv-progress { top: 0; margin: 0 -14px; border-radius: 0; border-left: 0; border-right: 0; }
  .inv-row { grid-template-columns: minmax(0, 1fr) 62px; padding: 12px 14px; }
  .inv-state { grid-column: 1 / -1; order: 3; }
  .inv-input { grid-column: 1 / -1; order: 2; }
  .inv-input input { min-height: 48px; font-size: 18px; }
  .inv-input .btn { min-height: 48px; min-width: 88px; }

  /* Bleibt eine umbrechende Zeile: In einer Spalte wuerde die Breite 280px aus .receive-main zur Hoehe. */
  .result, .receive { align-items: stretch; }
  .add-form, .receive-form { width: 100%; }
  .add-form label { flex: 1; } .add-form input { width: 100%; }
  .add-form .btn { flex: 1 1 100%; min-height: 44px; }
  .add-form { flex-wrap: wrap; }
  /* Menge und Knopf stehen nebeneinander und untereinander, sobald der Platz nicht reicht. */
  .receive-form { flex-wrap: wrap; }
  .receive-form label { flex: 999 1 110px; min-width: 0; } .receive-form .qty-input { width: 100%; min-height: 44px; }
  .receive-form .btn { flex: 1 0 auto; min-height: 44px; }
  .form-actions .btn { flex: 1 1 auto; }
  .bars li { grid-template-columns: minmax(0, 1fr) 46px; }
  .bars-track { display: none; }
  .dist li { grid-template-columns: 104px minmax(0, 1fr) 40px; }
  .btn-scan span { display: none; }
  .btn-scan { width: 58px; padding: 0; }
  .btn-scan .ico { width: 25px; height: 25px; }
  .sticky-actions { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); flex-wrap: nowrap; padding: 8px 10px 8px 14px; font-size: 13.5px; line-height: 1.25; }
  .sticky-actions .btn { flex: 0 0 auto; min-height: 44px; padding: 8px 12px; font-size: 14px; }
  .task { flex-wrap: nowrap; }
  .task-action span { display: none; }
  .article-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
  .import-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure b { font-size: 26px; }
  .chart-frame { grid-template-rows: 170px auto; }
  .chart-x span:nth-child(even) { display: none; }
  .bare-card { padding: 22px; }
}
