/*
  Doldur – Gestaltung der Web-Oberfläche.

  Aufbau: Design-Token, Grundlagen, Rahmen (Kopf/Navigation), Bausteine, Seiten.
  Mobil zuerst: Registerleiste unten, ab 900 px Seitenspalte. Hell und dunkel
  über `prefers-color-scheme` und einen ausdrücklichen Schalter (`data-theme`).
  Bewusst ohne Framework – die Datei bleibt klein und ohne Fremdressourcen, was
  die strenge Content-Security-Policy erlaubt.
*/

/* ------------------------------------------------------------------ Token */

:root {
  color-scheme: light dark;

  --brand-500: #075e54;
  --brand-600: #064e46;
  --brand-400: #0f8a7c;

  --status-sufficient: #16a34a;
  --status-low: #d97706;
  --status-empty: #dc2626;

  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #f0f2f4;
  --surface-raised: #ffffff;
  --border: #dfe3e8;
  --border-strong: #c6ccd4;
  --text: #16191d;
  --text-muted: #5b6570;
  --text-inverted: #ffffff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warning-soft: #fffbeb;
  --info-soft: #eff6ff;
  --success-soft: #f0fdf4;

  --radius-card: 14px;
  --radius-control: 10px;
  --radius-pill: 999px;

  --space-xs: 4px;
  --space-s: 8px;
  --space-m: 12px;
  --space-l: 16px;
  --space-xl: 24px;
  --space-xxl: 32px;

  --touch: 48px;
  --shadow-1: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 8%);
  --shadow-2: 0 8px 24px rgb(16 24 40 / 12%);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --sidebar-width: 232px;
  --topbar-height: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-2: #1c2129;
    --surface-raised: #1f252e;
    --border: #2b323c;
    --border-strong: #3a424e;
    --text: #e6edf3;
    --text-muted: #9aa4b2;
    --danger-soft: #2a1416;
    --warning-soft: #2a2113;
    --info-soft: #12203a;
    --success-soft: #10241a;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-2: 0 8px 24px rgb(0 0 0 / 50%);
  }
}

:root[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2129;
  --surface-raised: #1f252e;
  --border: #2b323c;
  --border-strong: #3a424e;
  --text: #e6edf3;
  --text-muted: #9aa4b2;
  --danger-soft: #2a1416;
  --warning-soft: #2a2113;
  --info-soft: #12203a;
  --success-soft: #10241a;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 40%);
  --shadow-2: 0 8px 24px rgb(0 0 0 / 50%);
}

/* ------------------------------------------------------------- Grundlagen */

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: var(--brand-500); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--brand-400);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Klassen wie `.field` setzen `display` und würden das Attribut `hidden`
   sonst überstimmen – Versteckte Elemente blieben sichtbar. */
[hidden] { display: none !important; }

.mono { font-family: var(--font-mono); font-size: 0.92em; }
.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.lead { font-size: 1.05rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: var(--space-m) var(--space-l); background: var(--brand-500);
  color: var(--text-inverted); border-radius: 0 0 var(--radius-control) 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------------ Rahmen */

.app-shell { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}

.topbar__inner {
  display: flex; align-items: center; gap: var(--space-m);
  height: var(--topbar-height); padding: 0 var(--space-l);
}

.brand { display: flex; align-items: center; gap: var(--space-s); color: inherit; }
.brand:hover { text-decoration: none; }
.brand__mark {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 9px; background: var(--brand-500); color: #fff;
  font-weight: 700; font-size: 15px;
}
.brand__mark--lg { width: 48px; height: 48px; font-size: 22px; border-radius: 14px; }
.brand__text { font-weight: 650; letter-spacing: -0.01em; }
@media (max-width: 480px) { .brand__text { display: none; } }

.topbar__warehouse { flex: 1; min-width: 0; }
.topbar__actions { display: flex; align-items: center; gap: var(--space-s); }

.avatar {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; background: var(--surface-2); color: var(--text);
  font-weight: 650; font-size: 14px; border: 1px solid var(--border);
}

.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border-strong); transition: background 0.2s;
}
.live-dot.is-live { background: var(--status-sufficient); }

/* Menü (details/summary statt JavaScript-Popover) */
.menu { position: relative; }
.menu__trigger {
  display: flex; align-items: center; gap: var(--space-xs);
  min-height: 36px; padding: 0 var(--space-s); cursor: pointer;
  border-radius: var(--radius-control); list-style: none;
  max-width: 100%;
}
.menu__trigger::-webkit-details-marker { display: none; }
.menu__trigger:hover { background: var(--surface-2); }
.menu__label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu__chevron {
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted); flex: none;
}
.menu__panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 240px; max-height: 70vh; overflow-y: auto;
  padding: var(--space-s); background: var(--surface-raised);
  border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-2);
}
.menu--end .menu__panel { left: auto; right: 0; }
.menu__heading { padding: var(--space-xs) var(--space-s); font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.menu__meta { padding: 0 var(--space-s) var(--space-xs); font-size: 0.85rem; color: var(--text-muted); }
.menu__item {
  display: block; width: 100%; text-align: left; padding: var(--space-s);
  min-height: 40px; border: 0; background: none; color: var(--text);
  font: inherit; border-radius: var(--radius-control); cursor: pointer;
}
.menu__item:hover { background: var(--surface-2); text-decoration: none; }
.menu__item.is-active { font-weight: 650; color: var(--brand-500); }
.menu__item--danger { color: var(--danger); }
.menu__divider { border: 0; border-top: 1px solid var(--border); margin: var(--space-xs) 0; }

/* Banner */
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-m);
  padding: var(--space-s) var(--space-l); font-size: 0.9rem;
  border-top: 1px solid var(--border);
}
.banner--warning { background: var(--warning-soft); color: var(--status-low); }
.banner--info { background: var(--info-soft); }
.banner__cta { font-weight: 650; }

/* Navigation */
.sidebar { display: none; }

@media (min-width: 900px) {
  .sidebar {
    display: flex; flex-direction: column; gap: var(--space-xs);
    position: fixed; top: var(--topbar-height); left: 0; bottom: 0; width: var(--sidebar-width);
    padding: var(--space-l) var(--space-m);
    border-right: 1px solid var(--border); background: var(--surface);
    overflow-y: auto;
  }
  .sidebar__link {
    display: flex; align-items: center; gap: var(--space-m);
    min-height: var(--touch); padding: 0 var(--space-m);
    border-radius: var(--radius-control); color: var(--text); font-weight: 550;
  }
  .sidebar__link:hover { background: var(--surface-2); text-decoration: none; }
  .sidebar__link.is-active { background: var(--surface-2); color: var(--brand-500); }
  .app-shell .main { margin-left: var(--sidebar-width); }
  .app-shell { padding-bottom: 0; }
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar__link {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 56px; color: var(--text-muted); font-size: 0.7rem;
}
.tabbar__link:hover { text-decoration: none; }
.tabbar__link.is-active { color: var(--brand-500); }
.tabbar__label { font-weight: 550; }

/* Ab Tablet-Breite übernimmt die Seitenspalte; die Registerleiste entfällt.
   Diese Regel steht bewusst nach den `.tabbar`-Regeln, damit sie gewinnt. */
@media (min-width: 900px) {
  .tabbar { display: none; }
}

/* -------------------------------------------------------------- Seitenraum */

.main { min-height: 60vh; }
.page { max-width: 1100px; margin: 0 auto; padding: var(--space-l); display: grid; gap: var(--space-l); }
.page--narrow { max-width: 720px; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-m); flex-wrap: wrap;
}
.page-header__title { font-size: 1.5rem; letter-spacing: -0.02em; }
.page-header__subtitle { color: var(--text-muted); font-size: 0.9rem; }
.page-header__actions { display: flex; gap: var(--space-s); flex-wrap: wrap; }

.section-title { font-size: 1.05rem; margin-bottom: var(--space-s); }
.back-link { font-size: 0.9rem; color: var(--text-muted); }

/* ------------------------------------------------------------- Bausteine */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: var(--space-l);
  display: grid; gap: var(--space-m); box-shadow: var(--shadow-1);
}
.card__title {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-s); font-size: 1rem;
}
.card__link { font-size: 0.85rem; font-weight: 550; }
.card__hint { color: var(--text-muted); font-size: 0.85rem; }
.card--highlight { border-color: var(--brand-400); }
.card--danger { border-color: var(--danger); }

.columns { display: grid; gap: var(--space-l); }
@media (min-width: 760px) { .columns { grid-template-columns: 1fr 1fr; } }

.card-grid { display: grid; gap: var(--space-m); }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } }
.card-grid--muted { opacity: 0.75; }

.stack { display: grid; gap: var(--space-m); }

/* Statistikkacheln */
.stat-grid { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.stat {
  display: grid; gap: 2px; padding: var(--space-l);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); color: var(--text); box-shadow: var(--shadow-1);
}
.stat:hover { text-decoration: none; border-color: var(--border-strong); }
.stat__value { font-size: 1.75rem; font-weight: 680; letter-spacing: -0.02em; }
.stat__label { font-size: 0.85rem; color: var(--text-muted); }
.stat--low .stat__value { color: var(--status-low); }
.stat--empty .stat__value { color: var(--status-empty); }

/* Schaltflächen */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-s);
  min-height: var(--touch); padding: 0 var(--space-l);
  font: inherit; font-weight: 600; font-size: 0.94rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-control);
  cursor: pointer; text-align: center; transition: background 0.15s, border-color 0.15s;
}
.button:hover { background: var(--surface-2); text-decoration: none; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button--primary { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.button--primary:hover { background: var(--brand-600); }
.button--ghost { background: none; border-style: dashed; }
.button--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button--danger-ghost { color: var(--danger); border-color: var(--border-strong); }
.button--block { width: 100%; }
.button--small { min-height: 34px; padding: 0 var(--space-m); font-size: 0.85rem; }
.button--icon { width: var(--touch); padding: 0; flex: none; }

/* Formularfelder */
.field { display: grid; gap: 6px; }
.field__label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.field__optional { font-style: normal; font-weight: 400; opacity: 0.7; }
.field__input {
  width: 100%; min-height: var(--touch); padding: var(--space-s) var(--space-m);
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-control);
}
.field__input:focus { border-color: var(--brand-400); }
textarea.field__input { min-height: 80px; resize: vertical; }
.field__hint { font-size: 0.8rem; color: var(--text-muted); }
.field-row { display: flex; gap: var(--space-m); align-items: flex-end; flex-wrap: wrap; }
.field--grow { flex: 1 1 160px; }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-m); display: grid; gap: var(--space-m); }
.fieldset legend { padding: 0 var(--space-s); font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }

.select {
  min-height: var(--touch); padding: 0 var(--space-m);
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-control);
}
.select--small { min-height: 34px; font-size: 0.85rem; }

.checkbox { display: flex; align-items: center; gap: var(--space-s); min-height: 36px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--brand-500); }

.toggle { display: flex; align-items: center; gap: var(--space-m); cursor: pointer; min-height: var(--touch); }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__track {
  flex: none; width: 44px; height: 26px; border-radius: var(--radius-pill);
  background: var(--border-strong); position: relative; transition: background 0.2s;
}
.toggle__thumb {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform 0.2s;
  box-shadow: var(--shadow-1);
}
.toggle input:checked + .toggle__track { background: var(--brand-500); }
.toggle input:checked + .toggle__track .toggle__thumb { transform: translateX(18px); }
.toggle input:focus-visible + .toggle__track { outline: 2px solid var(--brand-400); outline-offset: 2px; }
.toggle__text { display: grid; }
.toggle__label { font-weight: 550; }
.toggle__description { font-size: 0.8rem; color: var(--text-muted); }

.inline-form { display: flex; gap: var(--space-s); flex-wrap: wrap; }
.inline-form .field__input { flex: 1 1 160px; }
.inline-field { display: inline-flex; }

.form-actions { display: flex; gap: var(--space-s); justify-content: flex-end; flex-wrap: wrap; }
.form-actions--start { justify-content: flex-start; }

/* Listen */
.list { display: grid; }
.list__row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-m);
  min-height: var(--touch); padding: var(--space-s) 0; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.list__row:last-child { border-bottom: 0; }
.list__row:hover { text-decoration: none; }
.list__main { display: grid; gap: 2px; min-width: 0; }
.list__meta { font-size: 0.82rem; color: var(--text-muted); }

.nav-list__row {
  display: flex; align-items: center; gap: var(--space-m);
  min-height: var(--touch); padding: var(--space-s); color: var(--text);
  border-radius: var(--radius-control);
}
.nav-list__row:hover { background: var(--surface-2); text-decoration: none; }

.item-list { display: grid; gap: var(--space-s); }
.item-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-m);
  padding: var(--space-m); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-card);
  color: var(--text); box-shadow: var(--shadow-1);
}
.item-row:hover { border-color: var(--border-strong); text-decoration: none; }
.item-row__main { display: grid; gap: 6px; min-width: 0; flex: 1; }
.item-row__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row__meta { font-size: 0.82rem; color: var(--text-muted); }
.item-row__side { display: grid; gap: 4px; justify-items: end; flex: none; }
.item-row__qty { font-weight: 650; font-variant-numeric: tabular-nums; }

.qty { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Balken */
.bar {
  position: relative; height: 6px; border-radius: var(--radius-pill);
  background: var(--surface-2); overflow: hidden;
}
.bar__fill { height: 100%; border-radius: var(--radius-pill); transition: width 0.3s; }
.bar__fill--sufficient { background: var(--status-sufficient); }
.bar__fill--low { background: var(--status-low); }
.bar__fill--empty { background: var(--status-empty); }
.bar__mark { position: absolute; top: -2px; width: 2px; height: 10px; background: var(--text-muted); opacity: 0.6; }

.progress { height: 6px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.progress__fill { height: 100%; background: var(--brand-500); transition: width 0.3s; }


/*
  Balkenbreiten in 5-%-Stufen.

  Die Content-Security-Policy verbietet Inline-CSS, und eine per JavaScript
  gesetzte Breite fehlte ohne Skript. Deshalb trägt das Markup nur eine Stufe
  (`data-fill`/`data-mark`), die hier auf eine Breite abgebildet wird.
*/
.bar__fill[data-fill="0"], .progress__fill[data-fill="0"] { width: 0%; }
.bar__fill[data-fill="1"], .progress__fill[data-fill="1"] { width: 5%; }
.bar__fill[data-fill="2"], .progress__fill[data-fill="2"] { width: 10%; }
.bar__fill[data-fill="3"], .progress__fill[data-fill="3"] { width: 15%; }
.bar__fill[data-fill="4"], .progress__fill[data-fill="4"] { width: 20%; }
.bar__fill[data-fill="5"], .progress__fill[data-fill="5"] { width: 25%; }
.bar__fill[data-fill="6"], .progress__fill[data-fill="6"] { width: 30%; }
.bar__fill[data-fill="7"], .progress__fill[data-fill="7"] { width: 35%; }
.bar__fill[data-fill="8"], .progress__fill[data-fill="8"] { width: 40%; }
.bar__fill[data-fill="9"], .progress__fill[data-fill="9"] { width: 45%; }
.bar__fill[data-fill="10"], .progress__fill[data-fill="10"] { width: 50%; }
.bar__fill[data-fill="11"], .progress__fill[data-fill="11"] { width: 55%; }
.bar__fill[data-fill="12"], .progress__fill[data-fill="12"] { width: 60%; }
.bar__fill[data-fill="13"], .progress__fill[data-fill="13"] { width: 65%; }
.bar__fill[data-fill="14"], .progress__fill[data-fill="14"] { width: 70%; }
.bar__fill[data-fill="15"], .progress__fill[data-fill="15"] { width: 75%; }
.bar__fill[data-fill="16"], .progress__fill[data-fill="16"] { width: 80%; }
.bar__fill[data-fill="17"], .progress__fill[data-fill="17"] { width: 85%; }
.bar__fill[data-fill="18"], .progress__fill[data-fill="18"] { width: 90%; }
.bar__fill[data-fill="19"], .progress__fill[data-fill="19"] { width: 95%; }
.bar__fill[data-fill="20"], .progress__fill[data-fill="20"] { width: 100%; }
.bar__mark[data-mark="0"] { left: 0%; }
.bar__mark[data-mark="1"] { left: 5%; }
.bar__mark[data-mark="2"] { left: 10%; }
.bar__mark[data-mark="3"] { left: 15%; }
.bar__mark[data-mark="4"] { left: 20%; }
.bar__mark[data-mark="5"] { left: 25%; }
.bar__mark[data-mark="6"] { left: 30%; }
.bar__mark[data-mark="7"] { left: 35%; }
.bar__mark[data-mark="8"] { left: 40%; }
.bar__mark[data-mark="9"] { left: 45%; }
.bar__mark[data-mark="10"] { left: 50%; }
.bar__mark[data-mark="11"] { left: 55%; }
.bar__mark[data-mark="12"] { left: 60%; }
.bar__mark[data-mark="13"] { left: 65%; }
.bar__mark[data-mark="14"] { left: 70%; }
.bar__mark[data-mark="15"] { left: 75%; }
.bar__mark[data-mark="16"] { left: 80%; }
.bar__mark[data-mark="17"] { left: 85%; }
.bar__mark[data-mark="18"] { left: 90%; }
.bar__mark[data-mark="19"] { left: 95%; }
.bar__mark[data-mark="20"] { left: 100%; }

/* Marker */
.pill {
  display: inline-flex; align-items: center; padding: 2px 10px;
  border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 650;
  background: var(--surface-2); color: var(--text-muted);
}
.pill--sufficient { background: color-mix(in srgb, var(--status-sufficient) 16%, transparent); color: var(--status-sufficient); }
.pill--low, .pill--high { background: color-mix(in srgb, var(--status-low) 16%, transparent); color: var(--status-low); }
.pill--empty, .pill--urgent { background: color-mix(in srgb, var(--status-empty) 16%, transparent); color: var(--status-empty); }
.pill--fulfilled { background: color-mix(in srgb, var(--status-sufficient) 16%, transparent); color: var(--status-sufficient); }
.pill--partiallyFulfilled { background: color-mix(in srgb, var(--status-low) 16%, transparent); color: var(--status-low); }

.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 6px; font-size: 0.75rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-muted);
}
.badge--active { background: color-mix(in srgb, var(--status-sufficient) 16%, transparent); color: var(--status-sufficient); }
.badge--reverted, .badge--failed { background: var(--danger-soft); color: var(--danger); }

.chip {
  display: inline-flex; align-items: center; padding: 4px 10px; margin: 0 4px 4px 0;
  border-radius: var(--radius-pill); background: var(--surface-2); font-size: 0.82rem;
}
.chips { display: flex; flex-wrap: wrap; gap: var(--space-s); }

.alert { padding: var(--space-m); border-radius: var(--radius-control); font-size: 0.9rem; }
.alert--error { background: var(--danger-soft); color: var(--danger); }
.alert--warning { background: var(--warning-soft); color: var(--status-low); }
.alert--info { background: var(--info-soft); }
.alert--success { background: var(--success-soft); color: var(--status-sufficient); }

/* Definitionslisten */
.detail-list { display: grid; gap: var(--space-s); }
.detail-list > div { display: flex; justify-content: space-between; gap: var(--space-m); padding-bottom: var(--space-s); border-bottom: 1px solid var(--border); }
.detail-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.detail-list dt { color: var(--text-muted); font-size: 0.85rem; }
.detail-list dd { margin: 0; text-align: right; }
.detail-list--inline { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.detail-list--inline > div { flex-direction: column; gap: 2px; border: 0; }
.detail-list--inline dd { text-align: left; font-weight: 600; }

/* Kennzahlen */
.metric-row { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.metric { display: grid; gap: 4px; justify-items: start; }
.metric__label { font-size: 0.8rem; color: var(--text-muted); }
.metric__value { font-size: 1.35rem; font-weight: 680; font-variant-numeric: tabular-nums; }
.metric__hint { font-size: 0.82rem; color: var(--text-muted); }

.action-grid { display: grid; gap: var(--space-s); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* Leerzustand */
.empty { display: grid; gap: var(--space-s); justify-items: center; text-align: center; padding: var(--space-xxl) var(--space-l); }
.empty__icon { width: 40px; height: 40px; opacity: 0.4; }
.empty__title { font-size: 1.05rem; }
.empty__message { color: var(--text-muted); max-width: 40ch; }

/* Filterleiste */
.filterbar { display: grid; gap: var(--space-s); }
.filterbar__search { position: relative; display: flex; align-items: center; }
.filterbar__search .icon { position: absolute; left: var(--space-m); opacity: 0.5; }
.filterbar__input {
  width: 100%; min-height: var(--touch); padding: var(--space-s) var(--space-m) var(--space-s) 42px;
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-control);
}
.filterbar__controls { display: flex; gap: var(--space-s); flex-wrap: wrap; align-items: center; }

/* Zeitachse */
.timeline { display: grid; gap: var(--space-m); }
.timeline__entry { display: flex; gap: var(--space-m); }
.timeline__dot { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--brand-400); }
.timeline__text { font-size: 0.92rem; }
.timeline__meta { font-size: 0.8rem; color: var(--text-muted); }
.timeline--full .timeline__entry { padding-bottom: var(--space-m); border-bottom: 1px solid var(--border); }

/* Bewegungen */
.movements { display: grid; }
.movements__row {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-m);
  align-items: center; padding: var(--space-s) 0; border-bottom: 1px solid var(--border);
}
.movements__row:last-child { border-bottom: 0; }
.movements__delta { font-variant-numeric: tabular-nums; font-weight: 680; min-width: 60px; }
.movements__delta.is-positive { color: var(--status-sufficient); }
.movements__delta.is-negative { color: var(--status-empty); }
.movements__main { display: grid; gap: 2px; min-width: 0; }
.movements__after { font-variant-numeric: tabular-nums; color: var(--text-muted); }

/* Auffüllen */
.order-card {
  display: grid; gap: var(--space-s); padding: var(--space-l);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); color: var(--text); box-shadow: var(--shadow-1);
}
.order-card:hover { border-color: var(--border-strong); text-decoration: none; }
.order-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-s); }
.order-card__meta { font-size: 0.82rem; color: var(--text-muted); }

/* Lager-Schnellansicht */
.stock-preview { width: min(620px, calc(100vw - 32px)); }
.stock-preview__header { display: grid; justify-items: start; gap: 3px; padding-right: 44px; }
.stock-preview__brand { margin: 0; color: var(--brand-500); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; }
.stock-preview__title { margin: 0; padding: 0; font-size: clamp(1.3rem, 4vw, 1.7rem); }
.stock-preview__alias { margin: 0; color: var(--text-muted); font-size: 0.82rem; }
.stock-preview__header .pill { margin-top: var(--space-xs); }
.stock-preview__metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-s);
  margin: var(--space-l) 0; padding: var(--space-m); background: var(--surface-2); border-radius: var(--radius-card);
}
.stock-preview__metrics div { display: grid; gap: 3px; min-width: 0; }
.stock-preview__metrics span { color: var(--text-muted); font-size: 0.74rem; }
.stock-preview__metrics strong { overflow: hidden; font-size: clamp(1rem, 4vw, 1.3rem); font-variant-numeric: tabular-nums; text-overflow: ellipsis; }
.stock-preview__details { margin-bottom: var(--space-l); }
.stock-preview__actions { flex-wrap: wrap; }
.stock-preview__actions > [data-preview-actions-toggle] { min-width: 180px; }
.stock-preview__action-panel {
  position: fixed; inset: auto; width: min(320px, calc(100vw - 24px)); min-width: 0;
  max-height: min(70vh, 520px); margin: 0; overflow-y: auto;
}

@media (max-width: 480px) {
  .stock-preview__metrics { grid-template-columns: 1fr; }
  .stock-preview__metrics div { grid-template-columns: 1fr auto; align-items: baseline; }
  .stock-preview__actions > [data-preview-actions-toggle] { width: 100%; }
}

.refill-lines { display: grid; gap: var(--space-m); }
.refill-line { display: grid; gap: var(--space-s); padding: var(--space-m); background: var(--surface-2); border-radius: var(--radius-card); }
.refill-line__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-s); }
.refill-identity, .refill-chosen__name { display: grid; gap: 1px; min-width: 0; }
.refill-identity__brand { color: var(--brand-500); font-size: 0.75rem; font-weight: 750; letter-spacing: 0.02em; }
.refill-identity__name { overflow: hidden; text-overflow: ellipsis; }
.refill-identity__alias { color: var(--text-muted); font-size: 0.76rem; }
.refill-line__metrics { display: flex; gap: var(--space-l); flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.refill-line__metrics .label { display: block; font-size: 0.75rem; color: var(--text-muted); }
.refill-line__actions { display: flex; gap: var(--space-s); flex-wrap: wrap; }
.refill-workflow {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-l); align-items: center;
  padding: var(--space-l); color: var(--text); background: color-mix(in srgb, var(--brand-500) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand-500) 24%, var(--border)); border-radius: var(--radius-card);
}
.refill-workflow h2 { margin: 2px 0 4px; font-size: 1.15rem; }
.refill-workflow p { margin: 0; color: var(--text-muted); }
.refill-workflow__eyebrow { color: var(--brand-500) !important; font-size: 0.78rem; font-weight: 750; }
.refill-workflow__step { display: flex; align-items: center; }
.refill-workflow__step span {
  display: grid; width: 30px; height: 30px; place-items: center; flex: none;
  color: var(--text-muted); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 50%; font-size: 0.8rem; font-weight: 750;
}
.refill-workflow__step span.is-done { color: #fff; background: var(--status-sufficient); border-color: var(--status-sufficient); }
.refill-workflow__step span.is-current { color: #fff; background: var(--brand-500); border-color: var(--brand-500); }
.refill-workflow__step i { width: 16px; height: 2px; background: var(--border-strong); }
.refill-workflow__actions { display: grid; gap: var(--space-s); justify-items: stretch; }
.refill-workflow__more > summary { cursor: pointer; color: var(--text-muted); font-size: 0.84rem; text-align: center; }
.refill-workflow__more > div { display: grid; gap: var(--space-s); margin-top: var(--space-s); }
.form-guide { margin: calc(var(--space-s) * -1) 0 0; color: var(--text-muted); }
.form-error { padding: var(--space-s) var(--space-m); color: var(--danger); background: var(--danger-soft); border-radius: var(--radius-control); }
.fieldset--invalid { border-color: var(--danger); }
.refill-chosen { padding: var(--space-s); background: var(--surface-2); border-radius: var(--radius-control); }
.refill-chosen__name { flex: 1; min-width: 120px; }
.refill-chosen__quantity { display: flex; align-items: center; gap: var(--space-xs); color: var(--text-muted); }
.refill-chosen__quantity .field__input { width: 82px; text-align: right; font-variant-numeric: tabular-nums; }
.refill-chosen__step {
  display: grid; width: 36px; height: 36px; place-items: center; flex: none; cursor: pointer;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 50%;
  font: inherit; font-size: 1.15rem; font-weight: 700;
}
.refill-options { border: 1px solid var(--border); border-radius: var(--radius-control); }
.refill-options > summary { min-height: var(--touch); padding: 12px var(--space-m); cursor: pointer; color: var(--text-muted); font-weight: 600; }
.refill-options__body { display: grid; gap: var(--space-m); padding: 0 var(--space-m) var(--space-m); }
.refill-line__manual > summary { cursor: pointer; color: var(--text-muted); font-size: 0.82rem; }
.refill-line__manual .refill-line__actions { margin-top: var(--space-s); }
.completion-summary { padding: var(--space-m); color: var(--status-sufficient); background: color-mix(in srgb, var(--status-sufficient) 10%, transparent); border-radius: var(--radius-control); }
.completion-summary p { margin: 4px 0 0; color: var(--text-muted); }
.completion-summary--warning { color: var(--status-low); background: color-mix(in srgb, var(--status-low) 11%, transparent); }

@media (max-width: 640px) {
  .refill-workflow { grid-template-columns: 1fr; }
  .refill-workflow__actions { width: 100%; }
  .refill-line__actions .button--primary { flex: 1 1 100%; }
  .refill-chosen { flex-wrap: wrap; }
  .refill-chosen__name { flex-basis: calc(100% - var(--touch) - var(--space-s)); }
}

/* Bestelltafel */
.board { display: grid; gap: var(--space-m); }
@media (min-width: 900px) { .board { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; } }
.board__column { background: var(--surface-2); border-radius: var(--radius-card); padding: var(--space-m); display: grid; gap: var(--space-s); }
.board__header { display: flex; align-items: center; justify-content: space-between; }
.board__header h2 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.board__count { font-size: 0.8rem; color: var(--text-muted); }
.board__list { display: grid; gap: var(--space-s); }
.board__empty { font-size: 0.85rem; color: var(--text-muted); padding: var(--space-s); }
.purchase { display: grid; gap: var(--space-s); padding: var(--space-m); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); }
.purchase__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-s); }
.purchase__meta { font-size: 0.8rem; color: var(--text-muted); }
.purchase__actions { display: flex; gap: var(--space-xs); flex-wrap: wrap; }

/* Mitglieder */
.member-list { display: grid; gap: var(--space-m); }
.member { display: grid; gap: var(--space-m); padding: var(--space-l); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.member__head { display: flex; align-items: center; gap: var(--space-m); }
.member__identity { display: grid; gap: 2px; flex: 1; min-width: 0; }
.member__actions { display: flex; gap: var(--space-s); flex-wrap: wrap; align-items: center; }
.member__permissions { display: grid; gap: var(--space-xs); padding-top: var(--space-s); border-top: 1px solid var(--border); }

.invitation-list { display: grid; gap: var(--space-m); }
.invitation { display: grid; gap: var(--space-s); padding: var(--space-l); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.invitation.is-inactive { opacity: 0.6; }
.invitation__code { display: flex; align-items: center; gap: var(--space-m); flex-wrap: wrap; }
.invitation__code code { font-size: 1.1rem; font-weight: 650; letter-spacing: 0.06em; }

.warehouse-list { display: grid; gap: var(--space-s); }
.warehouse-card { display: flex; align-items: center; justify-content: space-between; gap: var(--space-m); padding: var(--space-m) var(--space-l); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.warehouse-card.is-active { border-color: var(--brand-400); }

.edit-list { display: grid; }
.edit-list__row { display: flex; align-items: center; gap: var(--space-m); min-height: var(--touch); border-bottom: 1px solid var(--border); }
.edit-list__row:last-child { border-bottom: 0; }
.edit-list__name { flex: 1; }

.permission-list { display: grid; gap: var(--space-xs); }

/* Daten / Import */
.export-grid { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.export-card { display: grid; gap: var(--space-s); padding: var(--space-m); background: var(--surface-2); border-radius: var(--radius-card); }
.export-card--sensitive { border: 1px solid var(--status-low); }
.export-card__label { font-weight: 600; }
.export-card__note { font-size: 0.78rem; color: var(--text-muted); }
.export-card__actions { display: flex; gap: var(--space-s); flex-wrap: wrap; }

.steps { display: flex; gap: var(--space-s); flex-wrap: wrap; font-size: 0.82rem; }
.steps__item { padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-muted); }
.steps__item.is-current { background: var(--brand-500); color: #fff; }
.steps__item.is-done { background: color-mix(in srgb, var(--status-sufficient) 16%, transparent); color: var(--status-sufficient); }

.dropzone {
  display: grid; gap: var(--space-s); place-items: center; padding: var(--space-xxl);
  border: 2px dashed var(--border-strong); border-radius: var(--radius-card);
  cursor: pointer; color: var(--text-muted);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--brand-400); color: var(--brand-500); }

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th, .table td { padding: var(--space-s); text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.table tr.is-invalid td { background: var(--danger-soft); }
.table tr.is-new td:first-child { border-left: 3px solid var(--status-sufficient); }
.table tr.is-update td:first-child { border-left: 3px solid var(--brand-400); }

.summary { display: flex; gap: var(--space-m); flex-wrap: wrap; font-size: 0.88rem; }
.summary span { padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface-2); }

.job-list { display: grid; gap: var(--space-m); }
.job { display: grid; gap: var(--space-s); padding: var(--space-l); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.job__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-s); }
.job__stats { display: flex; gap: var(--space-m); flex-wrap: wrap; font-size: 0.82rem; color: var(--text-muted); }

.plan-list { display: grid; gap: var(--space-m); }
.plan { display: flex; align-items: center; justify-content: space-between; gap: var(--space-m); padding-bottom: var(--space-m); border-bottom: 1px solid var(--border); }
.plan:last-child { border-bottom: 0; padding-bottom: 0; }
.plan__price { font-weight: 680; font-variant-numeric: tabular-nums; white-space: nowrap; }

.disclosure summary { cursor: pointer; padding: var(--space-s) 0; font-weight: 600; }

.pager { display: flex; gap: var(--space-s); justify-content: center; }

/* Auswahl (Artikelpicker) */
.picker { position: relative; }
.picker__results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 10;
  max-height: 260px; overflow-y: auto; padding: var(--space-xs);
  background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: var(--radius-control); box-shadow: var(--shadow-2);
}
.picker__results li button {
  display: block; width: 100%; text-align: left; padding: var(--space-s);
  border: 0; background: none; color: var(--text); font: inherit;
  border-radius: 6px; cursor: pointer; min-height: 40px;
}
.picker__results li button:hover { background: var(--surface-2); }
.picker__input-row { display: flex; align-items: stretch; gap: var(--space-s); }
.picker__input-row .field__input { min-width: 0; flex: 1; }
.picker__scan { min-height: var(--touch); flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 640px) {
  .picker__scan { width: var(--touch); min-width: var(--touch); padding: 0; }
  .picker__scan span:last-child { display: none; }
}
.picker__chosen { display: grid; gap: var(--space-xs); }
.picker__chosen li { display: flex; align-items: center; gap: var(--space-s); }
.picker__chosen input { width: 90px; }

.package-row { display: flex; align-items: center; gap: var(--space-s); margin-bottom: var(--space-s); }
.barcode-row { display: flex; align-items: center; gap: var(--space-s); margin-bottom: var(--space-s); }
.barcode-row > .field__input { flex: 1 1 auto; min-width: 0; }
.package-row__equals { color: var(--text-muted); }

/* Dialoge */
.dialog {
  width: min(560px, calc(100vw - 32px)); padding: var(--space-xl);
  border: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-2);
}
.dialog--wide { width: min(760px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgb(0 0 0 / 45%); }
.dialog__close-form { position: absolute; top: var(--space-s); right: var(--space-s); margin: 0; }
.dialog__close {
  width: 36px; height: 36px; border: 0; background: none; color: var(--text-muted);
  font-size: 22px; line-height: 1; cursor: pointer; border-radius: 50%;
}
.dialog__close:hover { background: var(--surface-2); }
.dialog__title { font-size: 1.15rem; margin-bottom: var(--space-l); padding-right: 40px; }
.dialog__body { display: grid; gap: var(--space-m); }
.dialog__actions { display: flex; gap: var(--space-s); justify-content: flex-end; }

@media (max-width: 560px) {
  .dialog {
    width: 100vw; max-width: 100vw; max-height: 92vh;
    margin: auto 0 0; border-radius: var(--radius-card) var(--radius-card) 0 0;
    padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom));
  }
}

/* Mengeneingabe */
.stepper { display: flex; align-items: center; gap: var(--space-m); justify-content: center; }
.stepper__button {
  width: 52px; height: 52px; flex: none; font-size: 24px; font-weight: 600;
  border: 1px solid var(--border-strong); border-radius: var(--radius-control);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.stepper__button:hover { background: var(--surface-2); }
.stepper__input {
  width: 130px; height: 60px; text-align: center; font-size: 1.75rem; font-weight: 650;
  font-variant-numeric: tabular-nums; border: 1px solid var(--border-strong);
  border-radius: var(--radius-control); background: var(--surface); color: var(--text);
}
.stepper__unit { text-align: center; color: var(--text-muted); }

/* Scanner */
.scanner { display: grid; gap: var(--space-m); }
.scanner__viewport {
  position: relative; aspect-ratio: 4 / 3; background: #000;
  border-radius: var(--radius-card); overflow: hidden;
}
.scanner__video { width: 100%; height: 100%; object-fit: cover; }
.scanner__frame {
  position: absolute; inset: 22% 12%; border: 2px solid rgb(255 255 255 / 80%);
  border-radius: var(--radius-control);
}
.scanner__status { text-align: center; color: var(--text-muted); font-size: 0.88rem; min-height: 1.4em; }
.scanner__actions { display: flex; gap: var(--space-s); justify-content: center; }
.scanner__manual { border-top: 1px solid var(--border); padding-top: var(--space-m); }

/* Toasts */
.toast-region {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 60;
  display: grid; gap: var(--space-s); width: min(420px, calc(100vw - 32px));
}
@media (min-width: 900px) { .toast-region { bottom: var(--space-xl); } }
.toast {
  padding: var(--space-m) var(--space-l); border-radius: var(--radius-control);
  background: var(--surface-raised); border: 1px solid var(--border);
  box-shadow: var(--shadow-2); font-size: 0.9rem;
  animation: toast-in 0.2s ease-out;
}
.toast--error { border-color: var(--danger); color: var(--danger); }
.toast--success { border-color: var(--status-sufficient); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Anmeldeseiten */
.auth-page { display: grid; place-items: center; min-height: 100vh; padding: var(--space-l); }
.auth-card {
  width: min(420px, 100%); display: grid; gap: var(--space-l);
  padding: var(--space-xl); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-1);
}
.auth-card--wide { width: min(760px, 100%); }
.auth-card__brand { display: grid; gap: var(--space-s); justify-items: center; text-align: center; }
.auth-card__brand h1 { font-size: 1.35rem; }
.auth-card__brand p { color: var(--text-muted); font-size: 0.9rem; }
.auth-card__switch { text-align: center; font-size: 0.9rem; }
.onboarding-grid { display: grid; gap: var(--space-l); }
@media (min-width: 640px) { .onboarding-grid { grid-template-columns: 1fr 1fr; } }

/* Symbole – als Masken aus einem einzigen SVG-Sprite-freien Datensatz */
.icon {
  display: inline-block; width: 20px; height: 20px; flex: none;
  background-color: currentColor;
  mask-repeat: no-repeat; mask-position: center; mask-size: contain;
  -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: contain;
}
.icon--grid { mask-image: url("/static/icons/grid.svg"); -webkit-mask-image: url("/static/icons/grid.svg"); }
.icon--box { mask-image: url("/static/icons/box.svg"); -webkit-mask-image: url("/static/icons/box.svg"); }
.icon--refresh { mask-image: url("/static/icons/refresh.svg"); -webkit-mask-image: url("/static/icons/refresh.svg"); }
.icon--cart { mask-image: url("/static/icons/cart.svg"); -webkit-mask-image: url("/static/icons/cart.svg"); }
.icon--dots { mask-image: url("/static/icons/dots.svg"); -webkit-mask-image: url("/static/icons/dots.svg"); }
.icon--search { mask-image: url("/static/icons/search.svg"); -webkit-mask-image: url("/static/icons/search.svg"); }
.icon--scan { mask-image: url("/static/icons/scan.svg"); -webkit-mask-image: url("/static/icons/scan.svg"); }
.icon--clock { mask-image: url("/static/icons/clock.svg"); -webkit-mask-image: url("/static/icons/clock.svg"); }
.icon--people { mask-image: url("/static/icons/people.svg"); -webkit-mask-image: url("/static/icons/people.svg"); }
.icon--mail { mask-image: url("/static/icons/mail.svg"); -webkit-mask-image: url("/static/icons/mail.svg"); }
.icon--pin { mask-image: url("/static/icons/pin.svg"); -webkit-mask-image: url("/static/icons/pin.svg"); }
.icon--shield { mask-image: url("/static/icons/shield.svg"); -webkit-mask-image: url("/static/icons/shield.svg"); }
.icon--swap { mask-image: url("/static/icons/swap.svg"); -webkit-mask-image: url("/static/icons/swap.svg"); }
.icon--list { mask-image: url("/static/icons/list.svg"); -webkit-mask-image: url("/static/icons/list.svg"); }
.icon--card { mask-image: url("/static/icons/card.svg"); -webkit-mask-image: url("/static/icons/card.svg"); }
.icon--gear { mask-image: url("/static/icons/gear.svg"); -webkit-mask-image: url("/static/icons/gear.svg"); }
.icon--upload { mask-image: url("/static/icons/upload.svg"); -webkit-mask-image: url("/static/icons/upload.svg"); }

/* ------------------------------------------------- Plattformverwaltung */

/* Eine Leiste unter der Kopfzeile statt der Lagernavigation: Die Verwaltung
   hat vier Bereiche und kein aktives Lager, an dem eine Seitenspalte hinge. */
.admin-nav {
  display: flex; gap: var(--space-s); overflow-x: auto;
  padding: 0 var(--space-l) var(--space-s);
  border-top: 1px solid var(--border);
}
.admin-nav__link {
  display: inline-flex; align-items: center; gap: var(--space-s);
  padding: var(--space-s) var(--space-m); white-space: nowrap;
  color: var(--text-muted); font-size: 0.9rem; font-weight: 600;
  border-radius: var(--radius-control);
}
.admin-nav__link:hover { background: var(--surface-2); text-decoration: none; }
.admin-nav__link.is-active { color: var(--brand-500); background: var(--surface-2); }
.admin-nav__link .icon { width: 18px; height: 18px; }

.log-table td { vertical-align: top; }
.log-table__message { white-space: pre-wrap; word-break: break-word; max-width: 60ch; }
.log-table__message pre { margin-top: var(--space-s); white-space: pre-wrap; }

/* ------------------------------------------------ Bedienoberfläche 2026 */

/* Der zweite Layer vereinheitlicht alle bestehenden Seiten, ohne ihre
   serverseitigen Abläufe oder data-Hooks zu verändern. */
body { font-size: 17px; line-height: 1.55; }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 3px; }
a, button, summary, input, select, textarea { -webkit-tap-highlight-color: transparent; }

.main { scroll-padding-bottom: 100px; }
.icon--sparkles::before { content: "✦"; font-size: 1.25rem; }
.page { gap: 20px; padding: 20px 16px 104px; }
.page-header { align-items: flex-start; gap: 12px; }
.page-header__title { font-size: clamp(1.65rem, 6vw, 2.15rem); font-weight: 780; }
.page-header__subtitle { margin-top: 3px; font-size: 0.95rem; }
.page-header__actions .button:not(.button--primary) { background: transparent; }

.topbar { box-shadow: 0 1px 0 var(--border); }
.brand__text { display: grid; line-height: 1.05; }
.brand__text strong { font-size: 1rem; }
.brand__text small { margin-top: 4px; color: var(--text-muted); font-size: 0.67rem; font-weight: 500; }
.sidebar__heading { margin: 6px 14px 8px; color: var(--text-muted); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; }
.sidebar__copy { display: grid; min-width: 0; }
.sidebar__copy strong { font-size: 0.95rem; }
.sidebar__copy small { overflow: hidden; color: var(--text-muted); font-size: 0.72rem; font-weight: 450; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__link.is-active .sidebar__copy small { color: currentColor; opacity: 0.78; }

.tabbar { min-height: 72px; padding: 7px 4px calc(7px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(14px); }
.tabbar__link { min-height: 54px; border-radius: 12px; }
.tabbar__link.is-active { background: color-mix(in srgb, var(--brand-500) 11%, transparent); font-weight: 750; }

.card, .order-card, .item-list, .board__column { border-width: 1px; box-shadow: 0 1px 2px rgb(16 24 40 / 5%); }
.card { padding: 18px; }
.card__title { font-size: 1.08rem; }
.card__link { min-height: 40px; display: inline-flex; align-items: center; padding: 0 8px; }

.button { min-height: 48px; padding: 0 17px; border-radius: 12px; font-size: 0.95rem; font-weight: 720; }
.button--large { min-height: 54px; padding-inline: 22px; font-size: 1rem; }
.button--primary { box-shadow: 0 4px 12px color-mix(in srgb, var(--brand-500) 25%, transparent); }
.button--danger, .button--danger-ghost { margin-top: 8px; }
.button--small { min-height: 44px; font-size: 0.9rem; }

.field { gap: 7px; }
.field__label { color: var(--text); font-size: 0.92rem; font-weight: 700; }
.field__input, .select, .filterbar__input { min-height: 52px; padding: 11px 13px; border-width: 2px; border-radius: 12px; font-size: 1rem; }
.field__input:focus, .select:focus, .filterbar__input:focus { border-color: var(--brand-400); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-400) 17%, transparent); outline: none; }
.field__hint { font-size: 0.85rem; line-height: 1.45; }
.field--invalid .field__input, [aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
.stack { gap: 18px; }
.form-actions { position: static; margin: 4px 0 0; padding: 0; background: none; }
.form-actions--sticky { position: sticky; bottom: 82px; z-index: 5; padding: 12px 8px 8px; background: var(--surface); border-top: 1px solid var(--border); }

.task-intro { display: grid; gap: 9px; padding: 20px; color: #fff; background: linear-gradient(135deg, #075e54, #0b776b); border-radius: 18px; box-shadow: 0 10px 26px rgb(7 94 84 / 20%); }
.task-intro__eyebrow { margin: 0; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; opacity: 0.82; }
.task-intro__content { display: grid; gap: 18px; }
.task-intro__title { font-size: clamp(1.25rem, 5vw, 1.65rem); }
.task-intro__message { max-width: 54ch; margin: 6px 0 0; color: rgb(255 255 255 / 86%); }
.task-intro .button--primary { color: var(--brand-600); background: #fff; border-color: #fff; box-shadow: none; }
.task-intro__actions { display: flex; align-items: center; }

.help-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; color: var(--text); background: var(--info-soft); border: 1px solid color-mix(in srgb, #2563eb 24%, var(--border)); border-radius: 14px; }
.help-note__icon { display: grid; flex: 0 0 26px; height: 26px; place-items: center; color: #fff; background: #2563eb; border-radius: 50%; font-weight: 800; }
.help-note strong, .help-note strong + span { display: block; }
.help-note strong + span { margin-top: 2px; color: var(--text-muted); font-size: 0.88rem; }

.stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { min-height: 102px; justify-content: center; padding: 16px; border-radius: 16px; }
.stat__value { font-size: 2rem; font-weight: 800; }
.stat__label { font-size: 0.86rem; line-height: 1.3; }
.stat--low { border-left: 5px solid var(--status-low); }
.stat--empty { border-left: 5px solid var(--status-empty); }

.filterbar { gap: 10px; }
.filterbar__search .icon { left: 16px; }
.filterbar__input { min-height: 58px; padding-left: 48px; background: var(--surface); }
.filter-details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.filter-details > summary { min-height: 48px; padding: 11px 14px; cursor: pointer; font-weight: 700; }
.filter-details[open] > summary { border-bottom: 1px solid var(--border); }
.filter-details .filterbar__controls { padding: 12px; }

.item-row { min-height: 92px; padding: 15px; }
.item-row__name { font-size: 1.02rem; font-weight: 750; }
.item-row__qty { font-size: 1.12rem; font-weight: 800; }
.pill::before { content: "●"; margin-right: 5px; font-size: 0.72em; }

.disclosure { padding: 0; overflow: clip; }
.disclosure__summary { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; cursor: pointer; font-weight: 760; list-style-position: inside; }
.disclosure__summary span { color: var(--text-muted); font-size: 0.78rem; font-weight: 550; }
.disclosure__body { display: grid; gap: 18px; padding: 2px 18px 18px; border-top: 1px solid var(--border); }
.disclosure[open] .disclosure__summary { color: var(--brand-500); }

.order-card { min-height: 116px; padding: 17px; border-radius: 16px; }
.order-card__head strong { font-size: 1.05rem; }
.board { scroll-snap-type: x mandatory; }
.board__column { min-width: min(88vw, 330px); scroll-snap-align: start; }
.board__header > div { display: flex; align-items: center; gap: 9px; }
.board__step { display: grid; width: 28px; height: 28px; place-items: center; color: #fff; background: var(--brand-500); border-radius: 50%; font-size: 0.78rem; font-weight: 800; }
.board__hint { min-height: 60px; margin: 0; padding: 0 14px 12px; color: var(--text-muted); font-size: 0.82rem; border-bottom: 1px solid var(--border); }
.purchase { padding: 15px; }
.purchase__actions { display: grid; grid-template-columns: 1fr; }

.dialog { width: min(560px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); padding: 22px 18px; border-radius: 18px; }
.dialog__title { font-size: 1.35rem; }
.dialog__actions { position: sticky; bottom: -22px; margin: 10px -18px -22px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); background: var(--surface-raised); border-top: 1px solid var(--border); }
.dialog__actions .button--primary { flex: 1; }
.empty { min-height: 230px; align-content: center; border: 1px dashed var(--border-strong); border-radius: 16px; background: var(--surface); }
.empty__message { font-size: 0.95rem; }

.auth-page { padding: 16px; background: radial-gradient(circle at top, color-mix(in srgb, var(--brand-400) 14%, var(--bg)), var(--bg) 45%); }
.auth-card { padding: 22px; border-radius: 20px; box-shadow: 0 18px 50px rgb(16 24 40 / 12%); }
.auth-card__brand h1 { font-size: 1.7rem; }
.auth-step { justify-self: center; margin: 0; padding: 5px 11px; color: var(--brand-500); background: color-mix(in srgb, var(--brand-500) 10%, transparent); border-radius: 999px; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.choice-badge { display: inline-flex; width: fit-content; margin-bottom: 10px; padding: 4px 9px; color: var(--brand-500); background: color-mix(in srgb, var(--brand-500) 11%, transparent); border-radius: 999px; font-size: 0.75rem; font-weight: 750; }

@media (min-width: 640px) {
  .task-intro__content { grid-template-columns: 1fr auto; align-items: end; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .purchase__actions { display: flex; }
  .form-actions > .button { width: auto; }
}

@media (min-width: 900px) {
  .page { padding: 30px 34px 48px; gap: 24px; }
  .form-actions--sticky { bottom: 0; }
  .task-intro { padding: 25px 28px; }
  .board__column { min-width: 270px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------------- Smarter Assistent */
.assistant-page { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 16px; width: min(100%, 980px); height: calc(100dvh - var(--topbar-height)); min-height: 0; margin: 0 auto; padding: 24px 20px 28px; }
.assistant-hero { display: flex; align-items: center; gap: 14px; padding: 0 4px; }
.assistant-hero__icon { display: grid; flex: 0 0 52px; height: 52px; place-items: center; color: #fff; background: linear-gradient(145deg, var(--brand-400), var(--brand-600)); border-radius: 16px; box-shadow: 0 8px 20px color-mix(in srgb, var(--brand-500) 26%, transparent); font-size: 1.45rem; }
.assistant-hero__copy h1 { margin: 1px 0 0; font-size: clamp(1.3rem, 3vw, 1.7rem); line-height: 1.2; }
.assistant-hero__copy p { margin: 3px 0 0; color: var(--text-muted); font-size: .88rem; }
.assistant-hero__eyebrow { display: flex; align-items: center; gap: 7px; color: var(--brand-500); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.assistant-status-dot { width: 7px; height: 7px; background: #22a06b; border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, #22a06b 16%, transparent); }
.assistant-workspace { display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 14px 40px rgb(16 24 40 / 9%); }
.assistant-chat { overflow-y: auto; padding: 28px clamp(16px, 4vw, 36px); scroll-behavior: smooth; background: linear-gradient(180deg, color-mix(in srgb, var(--brand-500) 3%, var(--surface)), var(--surface) 130px); border: 0; border-radius: 0; }
.assistant-message { align-items: flex-end; max-width: min(78%, 680px); margin: 0 0 22px; animation: assistant-in .22s ease-out; }
.assistant-message--user { margin-left: auto; }
.assistant-message__content, .assistant-message > div:last-child { min-width: 0; padding: 13px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px 18px 18px 5px; box-shadow: 0 2px 6px rgb(16 24 40 / 5%); }
.assistant-message--user > div:last-child { color: #fff; background: linear-gradient(145deg, var(--brand-400), var(--brand-600)); border: 0; border-radius: 18px 18px 5px 18px; box-shadow: 0 5px 14px color-mix(in srgb, var(--brand-500) 20%, transparent); }
.assistant-message p { line-height: 1.55; overflow-wrap: anywhere; }
.assistant-message__author { display: block; margin-bottom: 3px; color: var(--brand-500); font-size: .72rem; font-weight: 800; }
.assistant-avatar { flex-basis: 34px; height: 34px; color: #fff; background: linear-gradient(145deg, var(--brand-400), var(--brand-600)); border-radius: 11px; box-shadow: 0 3px 8px color-mix(in srgb, var(--brand-500) 20%, transparent); }
.assistant-message--user .assistant-avatar { display: none; }
.assistant-bottom { padding: 12px clamp(12px, 3vw, 24px) 14px; background: var(--surface); border-top: 1px solid var(--border); }
.assistant-prompts { position: relative; margin-bottom: 10px; padding-bottom: 2px; scrollbar-width: thin; scroll-snap-type: x proximity; overscroll-behavior-inline: contain; }
.assistant-prompts::-webkit-scrollbar { display: none; }
.assistant-prompts button { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; min-height: 38px; padding: 7px 12px; color: var(--text-muted); background: transparent; border: 1px solid var(--border); border-radius: 999px; font-size: .78rem; font-weight: 650; scroll-snap-align: start; cursor: pointer; transition: .16s ease; }
.assistant-prompts button:hover { color: var(--brand-500); background: color-mix(in srgb, var(--brand-500) 7%, var(--surface)); border-color: var(--brand-400); transform: translateY(-1px); }
.assistant-prompts button span { color: var(--brand-500); font-size: .95rem; }
.assistant-composer { gap: 8px; padding: 7px 7px 7px 15px; background: var(--surface-2); border: 2px solid transparent; border-radius: 18px; transition: .16s; }
.assistant-composer > .visually-hidden { position: absolute !important; }
.assistant-composer:focus-within { background: var(--surface); border-color: var(--brand-400); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-400) 13%, transparent); }
.assistant-composer textarea { min-height: 42px; max-height: 130px; padding: 9px 0; color: var(--text); resize: none; font: inherit; line-height: 1.45; }
.assistant-send { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; color: #fff; background: var(--brand-500); border: 0; border-radius: 13px; cursor: pointer; font-size: 1.35rem; font-weight: 800; }
.assistant-send:hover { background: var(--brand-400); transform: translateY(-1px); }
.assistant-send:disabled { cursor: wait; opacity: .55; transform: none; }
.assistant-disclaimer { margin: 7px 4px 0; font-size: .67rem; }
.assistant-confirmation { padding: 14px; background: var(--warning-soft); border-color: color-mix(in srgb, #d99b18 45%, var(--border)); border-radius: 13px; }
.assistant-confirmation > strong { display: flex; align-items: center; gap: 7px; font-size: .88rem; }
.assistant-confirmation > strong::before { content: "!"; display: grid; width: 22px; height: 22px; place-items: center; color: #fff; background: #d99b18; border-radius: 50%; font-size: .75rem; }
.assistant-confirmation dl { display: grid; grid-template-columns: max-content 1fr; gap: 5px 12px; margin: 12px 0; font-size: .78rem; }
.assistant-confirmation dt { color: var(--text-muted); }
.assistant-confirmation dd { margin: 0; overflow-wrap: anywhere; font-weight: 650; }
.assistant-confirmation.is-accepted { background: var(--success-soft); }
@keyframes assistant-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .assistant-page { gap: 10px; height: calc(100dvh - var(--topbar-height) - 72px - env(safe-area-inset-bottom)); min-height: 0; padding: 10px 0 0; }
  .assistant-hero { padding: 0 12px; }
  .assistant-hero__icon { flex-basis: 42px; height: 42px; border-radius: 12px; }
  .assistant-hero__copy h1 { font-size: 1.25rem; }
  .assistant-hero__copy p { display: none; }
  .assistant-workspace { border-width: 1px 0 0; border-radius: 18px 18px 0 0; }
  .assistant-chat { padding: 18px 12px; }
  .assistant-message { max-width: 94%; margin-bottom: 16px; }
  .assistant-message__content, .assistant-message > div:last-child { padding: 11px 13px; }
  .assistant-avatar { flex-basis: 30px; width: 30px; height: 30px; border-radius: 9px; }
  .assistant-bottom { padding: 9px 10px 10px; }
  .assistant-disclaimer { display: none; }
}

@media (max-height: 650px) and (max-width: 600px) {
  .assistant-hero__icon { display: none; }
  .assistant-hero__eyebrow { font-size: .62rem; }
  .assistant-page { gap: 6px; padding-top: 6px; }
  .assistant-chat { padding-block: 12px; }
}

/* ------------------------------------------ Mobile Stabilität und Formulare */
body { overflow-x: clip; }
.main, .page, .card, .field, .toggle__text { min-width: 0; }
.button { max-width: 100%; white-space: normal; line-height: 1.25; }
.table-scroll { max-width: 100%; border-radius: 10px; overscroll-behavior-inline: contain; scrollbar-gutter: stable; }
.table-scroll > .table { min-width: 640px; }
.admin-nav { scrollbar-width: thin; scroll-snap-type: x proximity; }
.admin-nav__link { min-height: 44px; scroll-snap-align: start; }

.plan-list { gap: 0; }
.plan { align-items: flex-start; padding: 15px 0; }
.plan:first-child { padding-top: 0; }
.plan__price { padding-left: 10px; font-size: 1.05rem; }
.plan--lifetime { margin-top: 4px; padding: 15px; background: color-mix(in srgb, var(--brand-500) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand-500) 22%, var(--border)); border-radius: 14px; }
.subscription-contact { padding: 13px 15px; color: var(--text-muted); background: var(--surface-2); border-radius: 12px; font-size: .9rem; }
.plan-comparison { display: grid; gap: 12px; }
.plan-comparison__plan { min-width: 0; padding: 14px; background: var(--surface-2); border-radius: 13px; }
.plan-comparison__plan h3 { margin-bottom: 9px; font-size: .95rem; }
.plan-comparison__plan dl { display: grid; gap: 6px; }
.plan-comparison__plan dl div { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; }
.plan-comparison__plan dt { color: var(--text-muted); }
.plan-comparison__plan dd { margin: 0; text-align: right; font-weight: 700; }

.gemini-form { display: grid; gap: 18px; }
.gemini-form__section { display: grid; gap: 16px; min-width: 0; padding: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; }
.gemini-form__load { justify-self: start; }
.gemini-form__actions { padding-top: 2px; }
.billing-plans-form { display: grid; gap: 20px; }
.billing-plan-columns { display: grid; gap: 16px; }
.billing-plan-card--lifetime { border-color: color-mix(in srgb, var(--brand-500) 45%, var(--border)); }
.quota-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.quota-grid--prices { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

@media (min-width: 900px) {
  .billing-plan-columns, .plan-comparison { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
  .page { padding-inline: 12px; }
  .card { padding: 16px; }
  .form-actions { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
  .form-actions > .button { width: 100%; }
  .field-row > .field, .field-row > .button { flex-basis: 100%; width: 100%; }
  .plan { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .plan--lifetime { grid-template-columns: minmax(0, 1fr); }
  .plan--lifetime .plan__price { padding-left: 0; }
  .gemini-form__section { margin-inline: -4px; padding: 14px; }
  .gemini-form__load { width: 100%; }
}

@media (max-width: 480px) {
  .topbar__inner { gap: 8px; padding-inline: 12px; }
  .brand__text { display: grid; }
  .brand__text small { display: none; }
  .topbar__warehouse { display: flex; justify-content: center; }
  .topbar__warehouse .menu { min-width: 0; }
  .topbar__warehouse .menu__trigger { padding-inline: 6px; }
  .topbar__actions { gap: 6px; }
  .topbar__actions > .button { min-height: 40px; padding-inline: 10px; font-size: .8rem; }
  .tabbar { justify-content: stretch; }
  .tabbar__link { min-width: 0; padding-inline: 2px; }
  .tabbar__label { width: 100%; overflow: hidden; font-size: .62rem; line-height: 1.15; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
  .admin-nav { gap: 4px; padding-inline: 8px; }
}

@media (max-width: 350px) {
  .brand__text { display: none; }
  .page-header__title { font-size: 1.5rem; }
  .tabbar__label { font-size: .58rem; }
}

@media print {
  .topbar, .sidebar, .tabbar, .page-header__actions, .toast-region { display: none !important; }
  .app-shell .main { margin: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}


/* ========================================================================
   UX v2 – task-first interface
   ======================================================================== */
.ux-v2 {
  --surface-raised: color-mix(in srgb, var(--surface) 96%, var(--primary) 4%);
  --surface-soft: color-mix(in srgb, var(--surface) 92%, var(--primary) 8%);
  --text-subtle: color-mix(in srgb, var(--text) 62%, transparent);
  --radius-card: 18px;
}
.ux-v2 .page { max-width: 1180px; }
.sidebar__divider { width: calc(100% - 24px); margin: 12px; border: 0; border-top: 1px solid var(--border); }
.topbar__scan { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 12px; padding: 0 14px; color: white; background: var(--primary); font: inherit; font-weight: 750; cursor: pointer; }
.home-page { display: grid; gap: 28px; }
.next-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: clamp(24px, 4vw, 42px); border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border)); border-radius: 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 11%, var(--surface)), var(--surface)); box-shadow: 0 16px 50px rgb(15 23 42 / .08); }
.next-action--urgent { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--danger) 9%, var(--surface)), var(--surface)); }
.next-action--attention { border-color: color-mix(in srgb, var(--status-low) 38%, var(--border)); }
.next-action__eyebrow, .task-card__eyebrow { margin: 0 0 6px; color: var(--primary); font-size: .76rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.next-action h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.35rem); line-height: 1.12; letter-spacing: -.035em; }
.next-action p:last-child { max-width: 60ch; margin: 10px 0 0; color: var(--text-subtle); font-size: 1rem; }
.quick-actions h2, .section-heading h2 { margin: 0; font-size: 1.2rem; }
.quick-actions__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.quick-action { min-height: 92px; display: grid; grid-template-columns: 42px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 12px; padding: 16px; color: var(--text); text-align: left; text-decoration: none; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); font: inherit; cursor: pointer; }
.quick-action:hover { border-color: var(--primary); background: var(--surface-soft); transform: translateY(-1px); }
.quick-action .icon { grid-row: 1 / 3; width: 42px; height: 42px; border-radius: 13px; background-color: color-mix(in srgb, var(--primary) 12%, transparent); background-size: 22px; }
.quick-action strong { align-self: end; }
.quick-action small { align-self: start; color: var(--text-subtle); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.section-heading p { margin: 3px 0 0; color: var(--text-subtle); }
.section-heading > a { flex: none; color: var(--primary); font-weight: 750; text-decoration: none; }
.status-summary__grid { display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.status-summary__grid a { min-height: 110px; display: flex; flex-direction: column; justify-content: center; padding: 18px 22px; color: var(--text); text-decoration: none; border-right: 1px solid var(--border); }
.status-summary__grid a:last-child { border: 0; }
.status-summary__grid strong { font-size: 2rem; letter-spacing: -.04em; }
.status-summary__grid span { color: var(--text-subtle); }
.status-summary__grid .is-warning strong { color: var(--status-low); }
.status-summary__grid .is-danger strong { color: var(--danger); }
.work-list__items { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.work-list__items > a { min-height: 72px; display: grid; grid-template-columns: 110px 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 14px; padding: 12px 18px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.work-list__items > a:last-child { border: 0; }
.work-list__type { grid-row: 1 / 3; width: fit-content; padding: 5px 8px; color: var(--primary); background: var(--surface-soft); border-radius: 7px; font-size: .73rem; font-weight: 800; }
.work-list__items small { color: var(--text-subtle); }
.work-list__items > a > span:last-child { grid-column: 3; grid-row: 1 / 3; color: var(--primary); font-size: 1.25rem; }

.task-hub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.task-card { position: relative; min-height: 220px; display: grid; grid-template-columns: 58px 1fr auto; grid-template-rows: 1fr auto; gap: 18px; padding: 28px; color: var(--text); text-decoration: none; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: 0 14px 40px rgb(15 23 42 / .07); }
.task-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.task-card__icon { width: 58px; height: 58px; border-radius: 18px; background-color: var(--surface-soft); background-size: 28px; }
.task-card__body { display: flex; flex-direction: column; gap: 7px; }
.task-card__body strong { font-size: 1.35rem; }
.task-card__body > span:last-child { color: var(--text-subtle); line-height: 1.5; }
.task-card__count { min-width: 42px; height: 42px; display: grid; place-items: center; color: white; background: var(--primary); border-radius: 50%; font-size: 1.05rem; font-weight: 850; }
.task-card__arrow { grid-column: 2 / 4; justify-self: end; color: var(--primary); font-size: 1.5rem; }
.plain-help { margin-top: 18px; padding: 18px 20px; border-left: 4px solid var(--primary); border-radius: 0 12px 12px 0; background: var(--surface-soft); }
.plain-help p { margin: 4px 0 0; color: var(--text-subtle); }

.settings-home { display: grid; gap: 18px; }
.settings-group { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.settings-group > header { display: flex; gap: 13px; align-items: center; padding: 18px 20px; background: var(--surface-raised); border-bottom: 1px solid var(--border); }
.settings-group > header h2, .settings-group > header p { margin: 0; }
.settings-group > header h2 { font-size: 1.05rem; }
.settings-group > header p { margin-top: 3px; color: var(--text-subtle); font-size: .88rem; }
.settings-group__number { width: 31px; height: 31px; display: grid; place-items: center; flex: none; color: var(--primary); background: var(--surface-soft); border-radius: 10px; font-size: .8rem; font-weight: 900; }
.settings-group ul { list-style: none; margin: 0; padding: 0; }
.settings-link { min-height: 70px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 12px 18px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.settings-group li:last-child .settings-link { border-bottom: 0; }
.settings-link:hover { background: var(--surface-soft); }
.settings-link__icon { width: 42px; height: 42px; border-radius: 12px; background-color: var(--surface-soft); background-size: 21px; }
.settings-link strong, .settings-link small { display: block; }
.settings-link small { margin-top: 3px; color: var(--text-subtle); line-height: 1.3; }
.settings-link__arrow { color: var(--primary); font-size: 1.15rem; }

.welcome-dialog { width: min(520px, calc(100vw - 28px)); padding: clamp(24px, 5vw, 38px); border: 0; border-radius: 24px; color: var(--text); background: var(--surface); box-shadow: 0 30px 100px rgb(0 0 0 / .28); }
.welcome-dialog::backdrop { background: rgb(15 23 42 / .64); backdrop-filter: blur(5px); }
.welcome-dialog__visual { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 16px; color: white; background: var(--primary); border-radius: 18px; font-size: 1.8rem; font-weight: 900; }
.welcome-dialog h2 { margin: 0; font-size: 1.7rem; }
.welcome-dialog > p { color: var(--text-subtle); line-height: 1.5; }
.welcome-steps { display: grid; gap: 10px; margin: 22px 0; padding: 0; list-style: none; counter-reset: steps; }
.welcome-steps li { display: grid; grid-template-columns: 32px 1fr; padding: 12px; border-radius: 12px; background: var(--surface-raised); }
.welcome-steps li::before { content: counter(steps); counter-increment: steps; grid-row: 1 / 3; width: 25px; height: 25px; display: grid; place-items: center; color: var(--primary); background: var(--surface-soft); border-radius: 50%; font-size: .74rem; font-weight: 900; }
.welcome-steps span { color: var(--text-subtle); font-size: .86rem; }

@media (max-width: 760px) {
  .topbar__scan span:last-child { display: none; }
  .topbar__scan { width: 42px; padding: 0; justify-content: center; }
  .next-action { grid-template-columns: 1fr; padding: 22px; border-radius: 18px; }
  .next-action .button { width: 100%; }
  .quick-actions__grid { grid-template-columns: 1fr; }
  .quick-action { min-height: 76px; }
  .status-summary__grid { grid-template-columns: repeat(2, 1fr); }
  .status-summary__grid a { min-height: 88px; border-bottom: 1px solid var(--border); }
  .status-summary__grid a:nth-child(2) { border-right: 0; }
  .status-summary__grid a:nth-child(n+3) { border-bottom: 0; }
  .work-list__items > a { grid-template-columns: 1fr auto; }
  .work-list__type { grid-row: auto; grid-column: 1; margin-bottom: 4px; }
  .work-list__items strong, .work-list__items small { grid-column: 1; }
  .task-hub { grid-template-columns: 1fr; }
  .task-card { min-height: 174px; padding: 22px; }
  .board { display: grid; grid-auto-flow: row; grid-template-columns: 1fr; overflow: visible; }
  .board__column { width: auto; min-width: 0; }
  .board__header { position: static; }
  .purchase__actions .button { min-height: 44px; }
  .page-header { align-items: flex-start; }
  .page-header__actions { width: 100%; }
  .page-header__actions .button { flex: 1; }
}

@media (max-width: 400px) {
  .status-summary__grid strong { font-size: 1.65rem; }
  .settings-link { padding-inline: 14px; }
}


.form-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 18px; }
.form-progress button { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font: inherit; font-size: .84rem; font-weight: 750; cursor: pointer; }
.form-progress button span { width: 25px; height: 25px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--surface-2); font-size: .72rem; }
.form-progress button.is-active { color: var(--primary); border-color: var(--primary); background: var(--surface-soft); }
.form-progress button.is-active span { color: white; background: var(--primary); }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; padding-top: 4px; }
.wizard-actions .button:last-child { margin-left: auto; }
[data-product-form] > [hidden] { display: none !important; }
@media (max-width: 520px) {
  .form-progress button { flex-direction: column; min-height: 68px; font-size: .72rem; }
  .wizard-actions .button { flex: 1; }
}


/* UX hotfix: account menus must remain fully opaque above page content. */
.topbar { z-index: 900; }
.topbar__inner, .topbar__actions, details.menu { overflow: visible; }
details.menu[open] { position: relative; z-index: 1100; }
.menu__panel {
  z-index: 1200 !important;
  opacity: 1 !important;
  color: #16191d;
  background: #ffffff !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid #dfe3e8;
  box-shadow: 0 20px 55px rgb(0 0 0 / 32%) !important;
  isolation: isolate;
}
.menu__panel::before, .menu__panel::after { display: none !important; }
.menu__item { background-color: #ffffff; }
.menu__item:hover, .menu__item:focus-visible, .menu__item.is-active {
  background-color: #f0f2f4 !important;
}
:root[data-theme="dark"] .menu__panel,
:root[data-theme="dark"] .menu__item {
  color: #e6edf3;
  background-color: #161b22 !important;
}
:root[data-theme="dark"] .menu__item:hover,
:root[data-theme="dark"] .menu__item:focus-visible,
:root[data-theme="dark"] .menu__item.is-active {
  background-color: #252c35 !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .menu__panel,
  :root:not([data-theme="light"]) .menu__item {
    color: #e6edf3;
    background-color: #161b22 !important;
  }
  :root:not([data-theme="light"]) .menu__item:hover,
  :root:not([data-theme="light"]) .menu__item:focus-visible,
  :root:not([data-theme="light"]) .menu__item.is-active {
    background-color: #252c35 !important;
  }
}
@media (max-width: 600px) {
  .menu--end .menu__panel {
    position: fixed;
    top: calc(var(--topbar-height) + env(safe-area-inset-top) + 8px);
    right: 12px;
    left: auto;
    width: min(330px, calc(100vw - 24px));
    max-height: calc(100dvh - var(--topbar-height) - 32px);
    overflow-y: auto;
  }
  .menu__item { min-height: 52px; padding: 12px 16px; font-size: 1rem; line-height: 1.25; }
  .menu__heading, .menu__meta { padding-inline: 16px; }
}


.filter-control { min-width: 150px; display: grid; gap: 5px; color: var(--text-muted); font-size: .75rem; font-weight: 750; }
.filter-control .select { width: 100%; color: var(--text); font-size: .9rem; font-weight: 500; }
@media (max-width: 760px) {
  .filterbar__controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .filter-control { min-width: 0; }
  .filter-control:nth-of-type(1) { grid-column: 1 / -1; }
  .filterbar__controls > .checkbox { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .filterbar__controls { grid-template-columns: 1fr; }
  .filter-control:nth-of-type(1), .filterbar__controls > .checkbox { grid-column: auto; }
}


.product-edit-dialog { width: min(760px, calc(100vw - 24px)); max-height: min(880px, calc(100dvh - 24px)); padding: 0; overflow: hidden; }
.product-edit-dialog__header { padding: 24px 28px 18px; border-bottom: 1px solid var(--border); background: var(--surface-raised); }
.product-edit-dialog__header h2, .product-edit-dialog__header p { margin: 0; }
.product-edit-dialog__header > p:last-child { margin-top: 6px; color: var(--text-muted); }
.product-edit-dialog__eyebrow { margin-bottom: 5px !important; color: var(--primary); font-size: .74rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.product-edit-form { max-height: calc(100dvh - 155px); overflow-y: auto; padding: 22px 28px 28px; }
.product-edit-section { margin: 0 0 16px; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.product-edit-section h3 { margin: 0 0 14px; font-size: 1rem; }
.product-edit-section.disclosure { padding: 0; }
.product-edit-section .disclosure__summary { padding: 18px; }
.product-edit-section .disclosure__body { padding: 0 18px 18px; }
.product-edit-dialog__actions { position: sticky; bottom: -28px; margin: 18px -28px -28px; padding: 16px 28px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); box-shadow: 0 -8px 24px rgb(0 0 0 / 8%); }
@media (max-width: 600px) {
  .product-edit-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .product-edit-dialog__header { padding: 20px 18px 15px; }
  .product-edit-form { max-height: calc(100dvh - 125px); padding: 16px 16px 24px; }
  .product-edit-section .field-row { display: grid; grid-template-columns: 1fr; }
  .product-edit-dialog__actions { bottom: -24px; margin: 16px -16px -24px; padding-inline: 16px; }
  .product-edit-dialog__actions .button { flex: 1; }
}

/* Verbrauchsstatistik */
.period-switcher { display: flex; gap: var(--space-s); flex-wrap: wrap; }
.period-switcher .chip { min-height: 40px; display: inline-flex; align-items: center; color: var(--text); }
.period-switcher .chip.is-active { color: var(--text-inverted); background: var(--brand-500); border-color: var(--brand-500); }
.analytics-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-m); flex-wrap: wrap; }
.analytics-table-wrap { overflow-x: auto; margin-inline: calc(-1 * var(--space-l)); }
.analytics-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.analytics-table th, .analytics-table td { padding: var(--space-m) var(--space-l); text-align: left; border-top: 1px solid var(--border); vertical-align: middle; }
.analytics-table th { color: var(--text-muted); font-size: .8rem; font-weight: 650; }
.analytics-table td small { display: block; color: var(--text-muted); }
.analytics-disclaimer { color: var(--text-muted); font-size: .85rem; }
@media (max-width: 640px) {
  .analytics-table { min-width: 0; }
  .analytics-table thead { display: none; }
  .analytics-table, .analytics-table tbody, .analytics-table tr, .analytics-table td { display: block; width: 100%; }
  .analytics-table tr { padding: var(--space-m) var(--space-l); border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-s); }
  .analytics-table td { padding: 0; border: 0; }
  .analytics-table td:first-child, .analytics-table td:last-child { grid-column: 1 / -1; }
}

.analytics-filter-grid { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.analytics-filters .form-actions { margin-top: 0; }
@media (max-width: 640px) {
  .analytics-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 2px;
  }
}

.analytics-filter-disclosure { padding: 0; gap: 0; overflow: hidden; }
.analytics-filter-summary {
  min-height: var(--touch);
  padding: var(--space-l);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  cursor: pointer;
  list-style: none;
}
.analytics-filter-summary::-webkit-details-marker { display: none; }
.analytics-filter-summary::after { content: "⌄"; color: var(--text-muted); font-size: 1.2rem; transition: transform .18s ease; }
.analytics-filter-disclosure[open] .analytics-filter-summary::after { transform: rotate(180deg); }
.analytics-filter-summary > span:first-child { display: grid; }
.analytics-filter-summary small { color: var(--text-muted); font-weight: 400; }
.analytics-filter-summary .chip { margin-left: auto; }
.analytics-filters { padding: 0 var(--space-l) var(--space-l); border-top: 1px solid var(--border); }
.analytics-filters .analytics-filter-grid { padding-top: var(--space-l); }

.subscription-checkout-actions { display: flex; gap: var(--space-s); flex-wrap: wrap; }
.subscription-checkout-actions form { flex: 1 1 220px; }
.subscription-checkout-actions .button { width: 100%; }
