/* =========================================================================
   Brennholzbuben — base.css
   Design-System nach dem apple-design-Skill (.claude/skills/apple-design):
   Systemschrift mit größenabhängiger Laufweite, ruhige warme Palette für
   Hell und Dunkel, transluzente Navigationsleisten, sofortiges Feedback beim
   Drücken, nur transform/opacity animiert, Rücksicht auf reduzierte Bewegung,
   reduzierte Transparenz und erhöhten Kontrast.

   Reihenfolge: Tokens → Grundlagen → Typografie → Layout → Komponenten
   (Buttons, Formulare, Karten, Tabellen, Badges, Hinweise, Modal, Toast,
   Combobox, Mengen-Stepper, Navigationsleisten) → Hilfsklassen → Medien.
   Kontext-Stile: shop.css, admin.css, driver.css, auth.css.

   Theme: <html data-theme="light|dark"> erzwingt ein Schema; ohne Attribut
   folgt die Seite prefers-color-scheme. Keine Webfonts, keine Fremd-Requests.
   ========================================================================= */

/* ------------------------------------------------------------- Tokens: hell */
:root {
  color-scheme: light;

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

  /* Flächen */
  --bg:          #f8f5f0;   /* warmes Papier */
  --bg-elev:     #ffffff;   /* Karten, Felder */
  --bg-sunken:   #f1ece4;   /* eingelassene Bereiche, Tabellenkopf */
  --bg-hover:    #f4efe7;
  --bg-inverse:  #221c16;
  /* Text */
  --text:        #1c1814;
  --text-2:      #574e45;   /* 8:1 auf Weiß */
  --text-3:      #766c62;   /* nur für Nebensächliches, 4.8:1 auf Weiß */
  --text-inverse:#f8f3ec;
  /* Linien */
  --line:        rgba(46, 32, 18, .12);
  --line-strong: rgba(46, 32, 18, .24);
  /* Akzent: gebranntes Orange (Glut) */
  --accent:        #c2410c;   /* 5.2:1 mit Weiß */
  --accent-hover:  #a83a0b;
  --accent-press:  #8f3108;
  --on-accent:     #ffffff;
  --accent-soft:   rgba(194, 65, 12, .10);
  --accent-softer: rgba(194, 65, 12, .06);
  --accent-text:   #ad3a0b;   /* Akzent als Textfarbe (Links) */
  /* Status */
  --ok:        #2e7d32;  --ok-soft:     rgba(46, 125, 50, .12);  --ok-text:     #1f6a26;
  --warn:      #b45309;  --warn-soft:   rgba(180, 83, 9, .13);   --warn-text:   #8a3f06;
  --danger:    #b42318;  --danger-soft: rgba(180, 35, 24, .10);  --danger-text: #96200f;
  --info:      #1d4ed8;  --info-soft:   rgba(29, 78, 216, .10);  --info-text:   #1e3a9a;
  --violet:    #6d28d9;  --violet-soft: rgba(109, 40, 217, .10); --violet-text: #5b21b6;
  --focus:     #2563eb;
  /* Materialien (transluzente Leisten, Sheets) */
  --material-bar:   rgba(248, 245, 240, .78);
  --material-sheet: rgba(255, 255, 255, .86);
  --scrim:          rgba(20, 14, 8, .38);
  /* Tiefe */
  --shadow-1: 0 1px 2px rgba(40, 26, 12, .05), 0 2px 8px rgba(40, 26, 12, .05);
  --shadow-2: 0 4px 12px rgba(40, 26, 12, .08), 0 12px 32px rgba(40, 26, 12, .08);
  --shadow-3: 0 12px 28px rgba(30, 18, 8, .16), 0 32px 72px rgba(30, 18, 8, .18);

  /* Raster */
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4rem;
  --w-content: 1180px;
  --w-wide: min(1720px, 100%);
  --w-prose: 46rem;
  --bar-h: 3.5rem;

  /* Schriftgrößen (rem → folgen der Textgröße des Nutzers) */
  --fs-cap:     .75rem;
  --fs-foot:    .8125rem;
  --fs-sub:     .9375rem;
  --fs-body:    1rem;
  --fs-callout: 1.0625rem;
  --fs-t3:      1.1875rem;
  --fs-t2:      clamp(1.3125rem, 1.15rem + .6vw, 1.625rem);
  --fs-t1:      clamp(1.75rem, 1.35rem + 1.6vw, 2.5rem);
  --fs-display: clamp(2.25rem, 1.5rem + 3.2vw, 3.75rem);

  /* Bewegung: kritisch gedämpft (kein Überschwingen), kurz, unterbrechbar */
  --ease:       cubic-bezier(.25, .9, .3, 1);
  --ease-out:   cubic-bezier(.22, 1, .36, 1);
  --dur-press:  90ms;
  --dur-1:      160ms;
  --dur-2:      240ms;
  --dur-3:      360ms;
}

/* ----------------------------------------------- Tokens: dunkel (Werte) --- */
/* Zweimal dieselben Werte: einmal für die Systemeinstellung (ohne
   data-theme), einmal für die explizite Wahl. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #151210; --bg-elev: #1f1b17; --bg-sunken: #110f0d; --bg-hover: #29231e; --bg-inverse: #f4eee6;
    --text: #f3eee7; --text-2: #c7bcae; --text-3: #9b9084; --text-inverse: #1c1814;
    --line: rgba(255, 238, 214, .10); --line-strong: rgba(255, 238, 214, .19);
    --accent: #ff7a3d; --accent-hover: #ff9260; --accent-press: #ec672c; --on-accent: #1b0d04;
    --accent-soft: rgba(255, 122, 61, .16); --accent-softer: rgba(255, 122, 61, .09); --accent-text: #ff9563;
    --ok: #5cc06a; --ok-soft: rgba(92, 192, 106, .16); --ok-text: #8fdc99;
    --warn: #f0a24b; --warn-soft: rgba(240, 162, 75, .16); --warn-text: #f8c486;
    --danger: #ff6b5e; --danger-soft: rgba(255, 107, 94, .15); --danger-text: #ff9a90;
    --info: #6ea8ff; --info-soft: rgba(110, 168, 255, .15); --info-text: #a6c8ff;
    --violet: #b794f6; --violet-soft: rgba(183, 148, 246, .16); --violet-text: #cfb6fb;
    --focus: #6ea8ff;
    --material-bar: rgba(21, 18, 16, .74); --material-sheet: rgba(31, 27, 23, .86); --scrim: rgba(0, 0, 0, .55);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .25);
    --shadow-2: 0 4px 12px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
    --shadow-3: 0 12px 28px rgba(0, 0, 0, .5), 0 32px 72px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151210; --bg-elev: #1f1b17; --bg-sunken: #110f0d; --bg-hover: #29231e; --bg-inverse: #f4eee6;
  --text: #f3eee7; --text-2: #c7bcae; --text-3: #9b9084; --text-inverse: #1c1814;
  --line: rgba(255, 238, 214, .10); --line-strong: rgba(255, 238, 214, .19);
  --accent: #ff7a3d; --accent-hover: #ff9260; --accent-press: #ec672c; --on-accent: #1b0d04;
  --accent-soft: rgba(255, 122, 61, .16); --accent-softer: rgba(255, 122, 61, .09); --accent-text: #ff9563;
  --ok: #5cc06a; --ok-soft: rgba(92, 192, 106, .16); --ok-text: #8fdc99;
  --warn: #f0a24b; --warn-soft: rgba(240, 162, 75, .16); --warn-text: #f8c486;
  --danger: #ff6b5e; --danger-soft: rgba(255, 107, 94, .15); --danger-text: #ff9a90;
  --info: #6ea8ff; --info-soft: rgba(110, 168, 255, .15); --info-text: #a6c8ff;
  --violet: #b794f6; --violet-soft: rgba(183, 148, 246, .16); --violet-text: #cfb6fb;
  --focus: #6ea8ff;
  --material-bar: rgba(21, 18, 16, .74); --material-sheet: rgba(31, 27, 23, .86); --scrim: rgba(0, 0, 0, .55);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .25);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
  --shadow-3: 0 12px 28px rgba(0, 0, 0, .5), 0 32px 72px rgba(0, 0, 0, .5);
}

/* ------------------------------------------------------------- Grundlagen */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 1rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* Theme-Wechsel weich überblenden (nur Farben, nur ohne reduzierte Bewegung) */
@media (prefers-reduced-motion: no-preference) {
  html.theme-xfade, html.theme-xfade * {
    transition: background-color var(--dur-3) var(--ease), color var(--dur-3) var(--ease),
                border-color var(--dur-3) var(--ease), fill var(--dur-3) var(--ease) !important;
  }
}
[hidden] { display: none !important; }
img, svg, video { max-width: 100%; }
img { height: auto; }
::selection { background: var(--accent-soft); }

a { color: var(--accent-text); text-decoration: none; text-underline-offset: .18em; }
a:hover { text-decoration: underline; }
p { margin: 0 0 var(--s-3); }
p:last-child { margin-bottom: 0; }
code, kbd, pre { font-family: var(--font-mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-5) 0; }
small { font-size: var(--fs-foot); }
strong, b { font-weight: 650; }

/* Fokus: immer sichtbar für Tastatur, eigene Farbe (nicht Akzent) */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-xs); }
:focus:not(:focus-visible) { outline: none; }

/* ------------------------------------------------------------- Typografie */
/* Laufweite nach Größe: groß = enger, klein = leicht weiter (Skill §15). */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); margin: 0; text-wrap: balance; }
h1 { font-size: var(--fs-t1); line-height: 1.1;  letter-spacing: -.022em; font-weight: 700; margin: var(--s-2) 0 var(--s-4); }
h2 { font-size: var(--fs-t2); line-height: 1.2;  letter-spacing: -.016em; font-weight: 650; margin: var(--s-6) 0 var(--s-3); }
h3 { font-size: var(--fs-t3); line-height: 1.3;  letter-spacing: -.008em; font-weight: 620; margin: var(--s-4) 0 var(--s-2); }
h4 { font-size: var(--fs-body); line-height: 1.4; font-weight: 620; margin: var(--s-3) 0 var(--s-1); }
.headline { font-family: var(--font-display); letter-spacing: -.016em; font-weight: 650; }
.page-title { margin-top: var(--s-4); }
.lead { font-size: var(--fs-callout); line-height: 1.55; color: var(--text-2); max-width: var(--w-prose); }
.meta, .muted { color: var(--text-2); font-size: var(--fs-sub); }
.empty { color: var(--text-2); }
.req { color: var(--accent-text); }
.eyebrow { display: inline-block; font-size: var(--fs-cap); font-weight: 650; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent-text); }
.accent, .gradient-text { color: var(--accent-text); }          /* früher Verlaufstext */
.num, td.num, th.num, .price, .money { font-variant-numeric: tabular-nums; }
td.num, th.num, td.right, th.right, .right { text-align: right; }
.nowrap, .price, .money { white-space: nowrap; }

/* ------------------------------------------------------------- Layout */
.container { width: 100%; max-width: var(--w-content); margin: 0 auto;
  padding: var(--s-4) clamp(1rem, 3vw, 1.5rem) var(--s-7); position: relative; }
.container-wide { max-width: var(--w-wide); }
.narrow { max-width: 40rem; }
.full { display: block; width: 100%; }
.inline { display: inline; }
section { margin-bottom: var(--s-5); }
.grid-2, .grid-3 { display: grid; gap: var(--s-3) var(--s-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-3) var(--s-4);
  margin: var(--s-4) 0 var(--s-5); }
.page-head h1 { margin: 0; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--fs-sub); color: var(--text-2); }
.back-link:hover { color: var(--accent-text); text-decoration: none; }

/* ------------------------------------------------------------- Icons */
.icon { display: inline-block; flex: none; width: 1.25em; height: 1.25em; vertical-align: -.25em; }
.icon-sm { width: 1.1em; height: 1.1em; }
.icon-md { width: 1.5em; height: 1.5em; }
/* frühere Emoji-Effekte: ruhig gestellt (keine Endlos-Animationen) */
.icon-action-hover, .icon-action-bounce, .icon-state-pulse { animation: none; }

/* ------------------------------------------------------------- Buttons */
/* Feedback beim Drücken sofort (:active, kein Warten auf click), nur transform. */
.btn, a.btn, button.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: 0 1.1rem;
  font: inherit; font-size: var(--fs-sub); font-weight: 600; line-height: 1.2; letter-spacing: -.005em;
  color: var(--text); background: var(--bg-elev);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  cursor: pointer; text-align: center; text-decoration: none; white-space: nowrap;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  touch-action: manipulation;
}
.btn:hover { background: var(--bg-hover); text-decoration: none; color: var(--text); }
.btn:active { transform: scale(.97); }
.btn-primary, .btn-fire, a.btn-primary, button.btn-primary {
  background: var(--accent); border-color: transparent; color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.btn-primary:hover, .btn-fire:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-primary:active, .btn-fire:active { background: var(--accent-press); }
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-danger:hover { background: var(--danger); color: #fff; filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent-text); }
.btn-ghost:hover { background: var(--accent-softer); color: var(--accent-text); }
.btn-small { min-height: 36px; padding: 0 .8rem; font-size: var(--fs-foot); border-radius: var(--r-sm); }
@media (pointer: coarse) { .btn-small { min-height: 44px; } }
.btn.big, .btn-lg { min-height: 52px; padding: 0 1.6rem; font-size: var(--fs-callout); border-radius: 14px; }
.btn[disabled], .btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn .icon { width: 1.15em; height: 1.15em; }
.btn-busy { opacity: .7; cursor: progress; }
.btn-added { background: var(--ok) !important; border-color: transparent !important; color: #fff !important; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; min-height: 0;
  padding: 0; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-elev); color: var(--text-2);
  cursor: pointer; transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-1) var(--ease); }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn + .icon-btn { margin-left: 4px; }
@media (pointer: coarse) { .icon-btn { width: 44px; height: 44px; } }

/* ------------------------------------------------------------- Formulare */
label { display: block; margin: var(--s-2) 0; color: var(--text); font-size: var(--fs-sub); font-weight: 500; }
label > input, label > select, label > textarea { margin-top: .3rem; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search], input[type=url],
input[type=date], input[type=time], input[type=number], input:not([type]), select, textarea {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; min-height: 44px; padding: .6rem .8rem;
  font: inherit; font-size: 1rem; line-height: 1.35; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
textarea { min-height: 6rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: var(--bg-sunken); color: var(--text-2); }
select { padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a7f74' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; }
select[multiple], select.multi { background-image: none; padding-right: .8rem; min-height: 8rem; }
select option { color: initial; }
input[type=checkbox], input[type=radio] { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--accent); flex: none; cursor: pointer; }
input[type=file] { font: inherit; font-size: var(--fs-sub); max-width: 100%; }
input[type=number] { -moz-appearance: textfield; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); margin: var(--s-3) 0; }
legend { padding: 0 .4rem; font-weight: 600; font-size: var(--fs-sub); }
.radio, .check { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; margin: 0; font-weight: 500; cursor: pointer; }
.radio input, .check input { margin: 0; }
.chk-inline { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: .45rem !important; }
.field { margin: var(--s-3) 0; }
.field-label { display: block; font-size: var(--fs-sub); font-weight: 600; margin-bottom: .3rem; }
/* Feldbreiten nach Zweck */
input.w-plz { width: 8ch; } input.w-qty { width: 7ch; text-align: center; }
input.w-time, select.w-time { width: 10ch; } input.w-eur { width: 11ch; } input.w-min { width: 8ch; } input.w-zip4 { width: 7ch; }
input.w-short, select.w-short { width: 16ch; max-width: 100%; } input.w-med, select.w-med { width: 26ch; max-width: 100%; }
select.w-auto { width: auto; min-width: 8ch; max-width: 100%; }
input[name="zip"], input[name="bill_zip"], input[name="ship_zip"] { width: 9ch; }
input[name="city"] { width: 26ch; max-width: 100%; }
@media (max-width: 560px) {
  input[name="zip"], input[name="bill_zip"], input[name="ship_zip"], input[name="city"],
  input.w-short, select.w-short, input.w-med, select.w-med { width: 100%; }
}
/* Pflichtfeld-Hinweis auch für Screenreader */
label .req::after { content: " (Pflichtfeld)"; position: absolute; left: -9999px; }

/* ------------------------------------------------------------- Karten */
/* Alte Klassennamen (.glass, .panel, .card-pad) bleiben gültig — gleiche Fläche. */
.card, .glass, .panel, .address-card, .offer-card, .order-card, .stat {
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1);
}
.card-pad { padding: clamp(1rem, 2.4vw, 1.5rem); margin: 0 0 var(--s-4); }
.card-pad > h2:first-child, .card-pad > .headline:first-child, .glass > h2:first-child { margin-top: 0; }
.card-pad h2.headline, .glass h2.headline { font-size: var(--fs-t3); letter-spacing: -.01em; margin-bottom: var(--s-3); }
.fire-glow { box-shadow: none; }
.section-fade { opacity: 1; transform: none; }   /* früheres Scroll-Reveal: Inhalt ist immer sichtbar */

/* ------------------------------------------------------------- Tabellen */
table { width: 100%; border-collapse: collapse; margin: var(--s-3) 0; font-variant-numeric: tabular-nums; }
th, td { padding: .6rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-size: var(--fs-foot); font-weight: 600; color: var(--text-2); white-space: nowrap; }
thead th { border-bottom-color: var(--line-strong); }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap > table { margin: 0; }
.table-compact th, .table-compact td { padding: .35rem .6rem !important; font-size: var(--fs-foot); }
.kv { width: 100%; }
.kv th { width: 38%; color: var(--text-2); font-weight: 500; padding-left: 0; white-space: nowrap; }
.kv td { padding-right: 0; }
.th-sort { cursor: pointer; user-select: none; }
.th-sort::after { content: "↕"; margin-left: .35em; opacity: .35; font-size: .85em; }
.th-sort[data-dir="asc"]::after  { content: "▲"; opacity: .8; }
.th-sort[data-dir="desc"]::after { content: "▼"; opacity: .8; }
.divider-row td { background: var(--bg-sunken); padding: .4rem .75rem !important; }
.divider-row span { font-size: var(--fs-cap); font-weight: 650; letter-spacing: .04em; color: var(--text-2); }
.row-inactive { opacity: .55; }
tr.row-new td { background: var(--ok-soft) !important; }
.scrollbox { max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); }

/* ------------------------------------------------------------- Badges */
.badge { display: inline-flex; align-items: center; gap: .3em; padding: .15em .6em; border-radius: var(--r-pill);
  font-size: var(--fs-cap); font-weight: 650; line-height: 1.5; letter-spacing: .01em; white-space: nowrap;
  background: var(--bg-sunken); color: var(--text-2); }
.badge-pending_payment, .badge-warn            { background: var(--warn-soft);   color: var(--warn-text); }
.badge-paid, .badge-delivered, .badge-picked_up,
.badge-accepted, .badge-completed, .badge-ship  { background: var(--ok-soft);     color: var(--ok-text); }
.badge-confirmed, .badge-proposed               { background: var(--info-soft);   color: var(--info-text); }
.badge-in_delivery, .badge-unloaded             { background: var(--violet-soft); color: var(--violet-text); }
.badge-cancelled, .badge-declined               { background: var(--danger-soft); color: var(--danger-text); }
.badge-expired, .badge-bill                     { background: var(--bg-sunken);   color: var(--text-2); }
.badge-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-cap); font-weight: 650; letter-spacing: .04em; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 .8rem; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--text); font-size: var(--fs-foot);
  font-weight: 550; text-decoration: none; transition: background-color var(--dur-1) var(--ease), transform var(--dur-press) var(--ease-out); }
.chip:hover { background: var(--bg-hover); text-decoration: none; }
.chip:active { transform: scale(.96); }
.chip.is-active, .chip[aria-current] { background: var(--text); color: var(--bg); border-color: transparent; }

/* ------------------------------------------------------------- Hinweise */
.notice { display: block; padding: var(--s-3) var(--s-4); margin: var(--s-4) 0; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--bg-elev); }
.notice p { margin: .2rem 0; }
.notice-good { background: var(--ok-soft);   border-color: transparent; color: var(--ok-text); }
.notice-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn-text); }
.notice-info { background: var(--info-soft); border-color: transparent; color: var(--info-text); }
.notice-good a, .notice-warn a, .notice-info a { color: inherit; text-decoration: underline; }
.error { background: var(--danger-soft); color: var(--danger-text); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.errors { color: var(--danger-text); }
.legal-note { color: var(--text-2); font-size: var(--fs-foot); }

/* ------------------------------------------------------------- Modal */
/* app.js baut .modal-back > .modal-box; .is-open blendet ein (opacity +
   scale aus 0.96), Rückweg spiegelt den Hinweg. */
.modal-back { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center;
  padding: var(--s-4); background: var(--scrim); }
.modal-box { position: relative; width: min(560px, 100%); max-height: min(88vh, 900px); overflow: auto;
  padding: var(--s-5); background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-3); }
@media (prefers-reduced-motion: no-preference) {
  .modal-back { animation: bhb-fade var(--dur-2) var(--ease-out) both; }
  .modal-box  { animation: bhb-sheet var(--dur-3) var(--ease-out) both; }
}
@keyframes bhb-fade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes bhb-sheet { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-x { position: absolute; top: .6rem; right: .6rem; width: 36px; height: 36px; min-height: 0; border: 0; border-radius: var(--r-pill);
  background: var(--bg-sunken); color: var(--text-2); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.modal-x:hover { color: var(--text); }
.modal-title { margin: 0 2.5rem var(--s-3) 0; font-size: var(--fs-t3); }
.modal-box label { margin: var(--s-3) 0; font-weight: 600; }
.modal-actions { margin-top: var(--s-4); display: flex; justify-content: flex-end; gap: var(--s-2); flex-wrap: wrap; }

/* ------------------------------------------------------------- Toast */
.bhb-toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); z-index: 2500;
  transform: translate(-50%, 12px) scale(.98); opacity: 0; pointer-events: none;
  padding: .7rem 1.1rem; border-radius: var(--r-pill); background: var(--bg-inverse); color: var(--text-inverse);
  font-weight: 600; font-size: var(--fs-sub); box-shadow: var(--shadow-2);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.bhb-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ------------------------------------------------------------- Combobox */
.combo { position: relative; }
.combo-native { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.combo-input { width: 100%; }
.combo-list { position: absolute; z-index: 1400; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .3rem;
  list-style: none; max-height: 16rem; overflow-y: auto; background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); }
.combo-opt { padding: .55rem .7rem; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; font-size: var(--fs-sub); }
.combo-opt:hover, .combo-opt.active { background: var(--accent-softer); }
.combo-opt[aria-selected="true"] { font-weight: 650; color: var(--accent-text); }
.combo-list:empty::after { content: "Kein Treffer"; display: block; padding: .55rem .7rem; color: var(--text-2); font-size: var(--fs-sub); }
@media (pointer: coarse) { .combo-opt { min-height: 44px; display: flex; align-items: center; } }

/* ------------------------------------------------------------- Mengen-Stepper */
.qty-stepper { display: inline-flex; align-items: stretch; height: 44px; border: 1px solid var(--line-strong);
  border-radius: var(--r-md); overflow: hidden; background: var(--bg-elev); }
.qty-btn { width: 40px; min-height: 0; border: 0; background: transparent; color: var(--text); font: inherit;
  font-size: 1.15rem; font-weight: 600; cursor: pointer; transition: background-color var(--dur-1) var(--ease); }
.qty-btn:hover { background: var(--bg-hover); }
.qty-btn:active { background: var(--accent-soft); }
.qty-stepper .qty-input, .qty-input { width: 3.5rem; min-height: 0; height: 100%; padding: 0; border: 0; border-radius: 0;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font-weight: 650;
  background: transparent; box-shadow: none; }
.qty-input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper-lg { height: 52px; }
.qty-stepper-lg .qty-btn { width: 48px; font-size: 1.3rem; }
.qty-stepper-lg .qty-input { width: 4.5rem; font-size: 1.05rem; }
.qty-unit { margin-left: .6rem; font-weight: 600; color: var(--text-2); align-self: center; }

/* ------------------------------------------------------------- Navigationsleisten */
/* Transluzente Leiste (Skill §12): Inhalt läuft darunter durch; Kante erst,
   wenn gescrollt wird (.is-scrolled setzt app.js). */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 3000; padding: .6rem 1rem; border-radius: 0 0 var(--r-md) 0;
  background: var(--accent); color: var(--on-accent); font-weight: 650; }
.skip-link:focus { left: 0; }
.navbar, .topbar {
  position: sticky; top: 0; z-index: 900;
  background: var(--material-bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.navbar.is-scrolled, .topbar.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 18px -12px rgba(0, 0, 0, .25); }
.navbar-inner { max-width: var(--w-content); margin: 0 auto; min-height: var(--bar-h);
  display: flex; align-items: center; gap: var(--s-3); padding: .45rem clamp(1rem, 3vw, 1.5rem); position: relative; }
.navbar-inner.glass { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; min-height: 44px; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand .icon { width: 1.6rem; height: 1.6rem; color: var(--accent); }
.brand-text { display: inline-flex; flex-direction: column; line-height: 1.1; }
.brand-text .headline { font-size: 1.0625rem; font-weight: 700; letter-spacing: -.012em; color: var(--text); }
.brand-company { font-size: var(--fs-cap); color: var(--text-2); font-weight: 500; letter-spacing: 0; }
.nav-links { display: flex; align-items: center; gap: .15rem; margin-left: auto; }
.nav-links a, .topbar nav a { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: 0 .75rem;
  border-radius: var(--r-sm); color: var(--text-2); font-size: var(--fs-sub); font-weight: 550; text-decoration: none;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.nav-links a:hover, .topbar nav a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav-links a[aria-current], .topbar nav a[aria-current] { color: var(--text); background: var(--bg-hover); font-weight: 650; }
.nav-links .icon, .topbar nav .icon { width: 1.1rem; height: 1.1rem; opacity: .85; }
.nav-links a.nav-cta { background: var(--accent); color: var(--on-accent); padding: 0 1rem; }
.nav-links a.nav-cta:hover { background: var(--accent-hover); color: var(--on-accent); }
.nav-actions { display: flex; align-items: center; gap: .3rem; order: 3; }
.navbar .nav-links { order: 2; }
.navbar .brand { order: 1; }
.cart-link { position: relative; }
.cart-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem;
  border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-size: .6875rem; font-weight: 700;
  line-height: 1; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) { .cart-badge.badge-pop, .is-bumped { animation: bhb-pop var(--dur-3) var(--ease-out); } }
@keyframes bhb-pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
.cart-pill { display: none; align-items: center; gap: .4rem; min-height: 40px; padding: 0 .75rem 0 .6rem;
  border-radius: var(--r-pill); border: 1px solid var(--line-strong); color: var(--text); text-decoration: none; white-space: nowrap; }
.cart-pill:hover { background: var(--bg-hover); text-decoration: none; }
.cart-pill .cart-sum { font-size: var(--fs-foot); font-weight: 650; font-variant-numeric: tabular-nums; }
.cart-pill:not(:has(.cart-sum:not([hidden]))) { width: 40px; padding: 0; justify-content: center; }
.theme-toggle, .nav-burger { display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; min-height: 0; padding: 0; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--text-2); cursor: pointer;
  transition: background-color var(--dur-1) var(--ease), transform var(--dur-press) var(--ease-out); }
.theme-toggle:hover, .nav-burger:hover { background: var(--bg-hover); color: var(--text); }
.theme-toggle:active, .nav-burger:active { transform: scale(.92); }
.theme-toggle .icon { width: 1.2rem; height: 1.2rem; }
/* Sonne im dunklen, Mond im hellen Schema (zeigt, wohin umgeschaltet wird) */
.theme-toggle .tt-sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .tt-sun { display: inline-block; }
                                      :root:not([data-theme="light"]) .theme-toggle .tt-moon { display: none; } }
:root[data-theme="dark"] .theme-toggle .tt-sun { display: inline-block; }
:root[data-theme="dark"] .theme-toggle .tt-moon { display: none; }
.nav-burger { display: none; }
.burger-bars { display: inline-flex; flex-direction: column; gap: 4px; width: 18px; }
.burger-bars span { display: block; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-1) var(--ease); }
.nav-open .burger-bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .burger-bars span:nth-child(2) { opacity: 0; }
.nav-open .burger-bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Admin/Fahrer-Leiste: Marke links, Navigation rechts */
.topbar { display: flex; align-items: center; gap: var(--s-3); min-height: var(--bar-h); padding: .4rem clamp(1rem, 3vw, 1.5rem); }
.topbar .brand { font-weight: 700; letter-spacing: -.01em; }
.topbar nav { display: flex; align-items: center; gap: .1rem; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.topbar .user { color: var(--text-2); font-size: var(--fs-foot); padding: 0 .6rem; }
.topbar .role-switch { color: var(--accent-text); }

/* Mobil: ausklappbares Menü als Sheet unter der Leiste */
@media (max-width: 860px) {
  .nav-burger { display: inline-flex; }
  .cart-pill { display: inline-flex; }
  .nav-actions { margin-left: auto; }
  .navbar .nav-links, .topbar nav {
    position: absolute; left: .6rem; right: .6rem; top: calc(100% + .4rem); z-index: 950;
    display: flex; flex-direction: column; align-items: stretch; gap: .15rem; padding: .5rem;
    background: var(--material-sheet);
    -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
    visibility: hidden; opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right;
    transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2);
    margin: 0;
  }
  .navbar.nav-open .nav-links, .topbar.nav-open nav {
    visibility: visible; opacity: 1; transform: none; transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
  }
  .navbar .nav-links a, .topbar nav a { min-height: 48px; padding: 0 .9rem; font-size: var(--fs-body); color: var(--text); }
  .navbar .nav-links .cart-link { display: none; }
  .navbar .nav-links a.nav-cta { justify-content: center; }
  .topbar { position: sticky; }
  .topbar .user { padding: .5rem .9rem; }
  .topbar nav .theme-toggle { align-self: flex-start; margin: .2rem .4rem; }
}
@media (max-width: 400px) { .brand-company { display: none; } }

/* ------------------------------------------------------------- Footer */
.footer { margin-top: var(--s-7); padding: var(--s-6) var(--s-4) calc(var(--s-6) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); color: var(--text-2); text-align: center; font-size: var(--fs-foot); }
.legal-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem 1rem; margin-bottom: var(--s-3); }
.legal-nav a { color: var(--text-2); display: inline-flex; min-height: 32px; align-items: center; }
.legal-nav a:hover { color: var(--text); }
.footer-tagline { margin: 0; }

/* ------------------------------------------------------------- Medien-Präferenzen */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .btn:active, .chip:active, .icon-btn:active, .theme-toggle:active, .nav-burger:active { transform: none; }
}
/* Weniger Transparenz: Leisten und Sheets massiv statt Glas (Skill §14) */
@media (prefers-reduced-transparency: reduce) {
  .navbar, .topbar, .navbar .nav-links, .topbar nav { background: var(--bg-elev) !important;
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
/* Mehr Kontrast: kräftige Linien und Texte */
@media (prefers-contrast: more) {
  :root { --line: rgba(0, 0, 0, .45); --line-strong: rgba(0, 0, 0, .7); --text-2: #2f2a25; --text-3: #463f38; }
  :root[data-theme="dark"] { --line: rgba(255, 255, 255, .45); --line-strong: rgba(255, 255, 255, .7); --text-2: #e6ddd2; --text-3: #d2c8bc; }
  .navbar, .topbar { background: var(--bg-elev); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: var(--line-strong); }
}
@media (forced-colors: active) {
  .btn, .chip, .badge, .notice { border: 1px solid CanvasText; }
}

/* ------------------------------------------------------------- Druck */
@media print {
  .navbar, .topbar, .footer, .chat-widget, .cookie-banner, .nav-burger, .theme-toggle, .skip-link, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .glass, .panel { box-shadow: none; border-color: #ccc; }
  a { color: #000; text-decoration: underline; }
}

/* Schmale Bildschirme: Tabellen scrollen in sich, die Seite nie waagerecht */
@media (max-width: 640px) {
  main table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  main .table-wrap > table { display: table; }
}
