:root {
  /* Hauptfarbe #dd052b; --blau = dunkle Variante davon (historischer Name, überall als "Brand-Dunkel" genutzt) */
  --blau: #8f031c;
  --blau-hell: #dd052b;
  --akzent: #dd052b;
  --gruen: #16a34a;
  --rot: #a61b1b;
  --gelb: #d97706;
  --grau: #6b7280;
  --bg: #f3f4f6;
  --karte: #ffffff;
  --rand: #e5e7eb;
  --text: #111827;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45;
  overflow-x: hidden;
}
.loading { padding: 40px; text-align: center; color: var(--grau); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  background: var(--karte); border-radius: var(--radius); padding: 32px 26px;
  width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,.12);
}
.login-card .logo { font-size: 30px; font-weight: 800; color: var(--akzent); text-align: center; }
.login-card .sub { text-align: center; color: var(--grau); margin-bottom: 22px; font-size: 13px; }
.login-card .demo { margin-top: 18px; font-size: 12px; color: var(--grau); border-top: 1px solid var(--rand); padding-top: 14px; }
.login-card .demo b { color: var(--text); }

/* ---------- Impersonation-Banner ---------- */
.imp-banner {
  background: #d97706; color: #fff; padding: 9px 14px; font-size: 13px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
}
.imp-banner button {
  background: #fff; color: #b45309; border: none; border-radius: 7px;
  padding: 5px 12px; font-size: 13px; font-weight: 700; cursor: pointer; margin-left: auto;
}

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--akzent); color: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 12px 16px;
}
.topbar .brand { font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.topbar .brand-logo { height: 26px; width: auto; display: block; }
.topbar .user { font-size: 12px; opacity: .85; text-align: right; }
.topbar .user .rolle { display: inline-block; background: rgba(255,255,255,.18); padding: 1px 8px; border-radius: 20px; margin-top: 2px; }

nav.tabs {
  position: sticky; top: 49px; z-index: 25; background: var(--karte);
  border-bottom: 1px solid var(--rand); display: flex; overflow-x: auto; gap: 2px; padding: 0 8px;
}
nav.tabs button {
  background: none; border: none; padding: 13px 14px; font-size: 14px; color: var(--grau);
  white-space: nowrap; border-bottom: 3px solid transparent; cursor: pointer; font-weight: 600;
}
nav.tabs button.active { color: var(--blau); border-bottom-color: var(--akzent); }

main { padding: 18px 24px 70px; max-width: 100%; margin: 0; }

/* ---------- Badges offener Aufgaben (Tabs + Seitenleiste) ---------- */
.nav-badge { display: none; margin-left: 6px; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--akzent); color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
.nav-badge.sichtbar { display: inline-block; }

/* ---------- Seitenleiste (Admin): Bereiche nach Funktionen gegliedert ---------- */
.layout-seite { display: flex; align-items: flex-start; }
.layout-seite > main { flex: 1; min-width: 0; }
.seitenleiste {
  position: sticky; top: var(--topbar-h, 58px); flex: 0 0 220px; height: calc(100vh - var(--topbar-h, 58px)); overflow-y: auto;
  background: var(--karte); border-right: 1px solid var(--rand); padding: 10px 8px 30px;
}
.nav-gruppe { margin-bottom: 4px; }
.nav-gruppe-kopf {
  display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: none; cursor: pointer;
  padding: 10px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--grau); font-family: inherit;
}
.nav-pfeil { transition: transform .15s; font-size: 10px; }
.nav-gruppe.zu .nav-pfeil { transform: rotate(-90deg); }
.nav-gruppe.zu .nav-eintraege { display: none; }
.nav-eintraege button {
  display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: none; cursor: pointer;
  padding: 8px 10px 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text); text-align: left; font-family: inherit;
}
.nav-eintraege button:hover { background: var(--bg); }
.nav-eintraege button.active { background: #fde8eb; color: var(--blau); box-shadow: inset 3px 0 0 var(--akzent); }
.nav-mobil { display: none; }

@media (max-width: 900px) {
  .layout-seite { display: block; }
  .nav-mobil {
    display: flex; align-items: center; gap: 8px; position: sticky; top: var(--topbar-h, 58px); z-index: 26; width: 100%;
    background: var(--karte); border: none; border-bottom: 1px solid var(--rand); padding: 12px 16px; font-size: 15px; font-weight: 700; color: var(--blau); cursor: pointer; font-family: inherit;
  }
  .seitenleiste {
    display: none; position: fixed; z-index: 40; left: 0; top: calc(var(--topbar-h, 58px) + 46px); bottom: 0; width: min(300px, 85vw); height: auto;
    box-shadow: 6px 0 24px rgba(0,0,0,.18);
  }
  .seitenleiste.offen { display: block; }
}
@media (max-width: 600px) { main { padding: 14px 14px 70px; } }
h2.view-titel { font-size: 20px; margin-bottom: 14px; color: var(--blau); }

/* ---------- Dashboard ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius); padding: 14px 16px; position: relative; overflow: hidden; }
.kpi.klick { cursor: pointer; transition: box-shadow .15s, transform .05s; }
.kpi.klick:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.kpi .kpi-num { font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--blau); }
.kpi .kpi-label { font-size: 13px; color: var(--grau); margin-top: 2px; font-weight: 600; }
.kpi .kpi-sub { font-size: 12px; color: var(--grau); margin-top: 4px; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--akzent); }
.kpi.warn::before { background: var(--gelb); } .kpi.warn .kpi-num { color: var(--gelb); }
.kpi.bad::before { background: var(--rot); } .kpi.bad .kpi-num { color: var(--rot); }
.kpi.good::before { background: var(--gruen); }
.kpi.neutral::before { background: #94a3b8; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; margin-bottom: 14px; }
.dash-karte { background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius); padding: 16px; }
.dash-karte h3 { font-size: 15px; color: var(--blau); margin-bottom: 4px; }
.dash-karte .h3-sub { font-size: 12px; color: var(--grau); margin-bottom: 10px; }
.chart-legende { display: flex; gap: 16px; font-size: 12px; color: var(--grau); margin-bottom: 8px; }
.chart-legende span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legende i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.chart svg { width: 100%; height: auto; display: block; }

.rw-bar { height: 7px; background: #eef1f6; border-radius: 4px; overflow: hidden; min-width: 60px; }
.rw-bar i { display: block; height: 100%; border-radius: 4px; }

/* ---------- Kanban-Board ---------- */
.kb-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.kb-toolbar .kb-tt { font-size: 13px; color: var(--grau); font-weight: 600; }
.kb-toolbar label { font-size: 13px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: var(--karte); border: 1px solid var(--rand); padding: 6px 11px; border-radius: 20px; }
.kb-toolbar input { width: auto; }
.kb-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: stretch; min-height: calc(100vh - 210px); }
.kb-col { flex: 1 0 240px; min-width: 240px; max-width: 360px; background: #eceff4; border-radius: 12px; padding: 8px; display: flex; flex-direction: column; }
.kb-cards { flex: 1; }
.kb-col-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 10px; font-weight: 700; font-size: 13px; color: var(--blau); }
.kb-col-head .kb-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.kb-col-head .kb-count { background: #fff; border-radius: 20px; padding: 1px 9px; font-size: 12px; color: var(--grau); font-weight: 700; }
.kb-cards { display: flex; flex-direction: column; gap: 8px; min-height: 24px; max-height: calc(100vh - 250px); overflow-y: auto; padding: 2px; }
.kb-card { background: #fff; border: 1px solid var(--rand); border-left: 4px solid var(--akzent); border-radius: 9px; padding: 10px 12px; cursor: pointer; transition: box-shadow .12s, transform .04s; }
.kb-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.1); }
.kb-card:active { transform: scale(.99); }
.kb-card-nr { font-weight: 700; font-size: 14px; color: var(--text); }
.kb-card-meta { font-size: 12px; color: var(--grau); margin-top: 2px; }
.kb-col-leer { font-size: 12px; color: #9ca3af; text-align: center; padding: 16px 0; }

/* ---------- Karten / Listen ---------- */
.karte { background: var(--karte); border-radius: var(--radius); border: 1px solid var(--rand); padding: 14px; margin-bottom: 12px; }
.karte.klick { cursor: pointer; transition: box-shadow .15s; }
.karte.klick:active { box-shadow: 0 2px 12px rgba(0,0,0,.1); }
.zeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--grau); font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.grid-artikel { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

/* Shop-Filter */
.shop-filter { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.shop-filter input { flex: 1; max-width: 520px; padding: 11px 14px; border: 1px solid var(--rand); border-radius: 10px; font-size: 15px; background: var(--karte); }
.shop-filter input:focus { outline: none; border-color: var(--akzent); }
.shop-gruppe { margin-bottom: 4px; }

/* Warenkorb-Übersicht */
.wk-liste { display: flex; flex-direction: column; }
.wk-zeile { display: grid; grid-template-columns: 56px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rand); }
.wk-bild { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: #fff; }
.wk-bild.platzhalter { display: flex; align-items: center; justify-content: center; color: #b9c0cc; font-size: 22px; }
.wk-info { min-width: 0; font-size: 14px; }
.wk-info .muted { font-size: 12px; margin-top: 2px; }
.wk-zeile .menge-step { width: auto; gap: 6px; }
.wk-zeile .menge-step button { flex: 0 0 30px; width: 30px; height: 30px; }
.wk-zeile .menge-step input.menge { flex: 0 0 46px; width: 46px; padding: 6px; }
.wk-remove { background: none; border: none; color: var(--grau); font-size: 18px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.wk-remove:hover { background: #f7eef0; color: var(--rot); }

/* Warenkorb-Seite (mobil-first) */
.wk-seite { padding-bottom: 100px; }  /* Platz für die fixe Bestell-Leiste */
.wk-zurueck { background: none; border: none; color: var(--akzent); font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px 0; }
.wk-fixbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--karte); border-top: 1px solid var(--rand); box-shadow: 0 -3px 14px rgba(0,0,0,.1); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.wk-fixbar .wk-fixbar-summe { text-align: center; font-size: 14px; color: var(--text); }
.wk-fixbar .btn { width: 100%; padding: 15px; font-size: 16px; }
@media (min-width: 600px) {
  .wk-fixbar { flex-direction: row; align-items: center; padding: 12px 20px; }
  .wk-fixbar .wk-fixbar-summe { flex: 1; text-align: left; font-size: 15px; }
  .wk-fixbar .btn { width: auto; flex: 0 0 auto; padding: 13px 28px; }
}
@media (max-width: 560px) {
  .wk-zeile { grid-template-columns: 44px 1fr auto; grid-template-areas: "bild info remove" "bild step step"; row-gap: 6px; }
  .wk-bild { grid-area: bild; width: 44px; height: 44px; }
  .wk-info { grid-area: info; }
  .wk-remove { grid-area: remove; align-self: start; }
  .wk-zeile .menge-step { grid-area: step; justify-content: flex-start; }
}

/* Bestell-Bestätigung */
.bestell-ok { text-align: center; padding: 8px 4px 4px; }
.bestell-ok .ok-kreis { width: 64px; height: 64px; margin: 4px auto 14px; border-radius: 50%; background: var(--gruen); color: #fff; font-size: 36px; line-height: 64px; }
.bestell-ok h3 { color: var(--gruen); margin-bottom: 8px; }
.bestell-ok p { font-size: 14px; line-height: 1.6; max-width: 460px; margin: 0 auto; }

.artikel-bild { width: 100%; height: 160px; object-fit: contain; border-radius: 8px; background: #fff; padding: 4px; }
.artikel-bild.platzhalter { display: flex; align-items: center; justify-content: center; color: #b9c0cc; font-size: 30px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.b-grau { background: #e5e7eb; color: #374151; }
.b-blau { background: #dbeafe; color: #1e40af; }
.b-gelb { background: #fef3c7; color: #92400e; }
.b-gruen { background: #dcfce7; color: #166534; }
.b-rot { background: #fee2e2; color: #991b1b; }
.b-orange { background: #ffedd5; color: #9a3412; }
.b-lila { background: #ede9fe; color: #5b21b6; }

/* ---------- Buttons ---------- */
button.btn, a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--akzent); color: #fff; border: none; border-radius: 10px;
  padding: 11px 16px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
}
button.btn:active { opacity: .85; }
button.btn:disabled { background: #c7cdd6; cursor: not-allowed; }
.btn.sek { background: #f7eef0; color: var(--blau); }
.btn.gruen { background: var(--gruen); }
.btn.rot { background: var(--rot); }
.btn.gelb { background: var(--gelb); }
.btn.klein { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-reihe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn.block { width: 100%; }

/* ---------- Formulare ---------- */
label.feld { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: #374151; }
label.feld input, label.feld select, label.feld textarea {
  width: 100%; margin-top: 5px; padding: 11px 12px; border: 1px solid var(--rand);
  border-radius: 9px; font-size: 15px; font-family: inherit; background: #fff;
}
input.menge { width: 78px; text-align: center; padding: 8px; border: 1px solid var(--rand); border-radius: 8px; font-size: 15px; }

/* Admin-Freigabe eines Auftrags */
/* Bestand: optionale Fotospalte (Toggle) */
.bestand-tab .foto-col { display: none; }
.bestand-tab.zeige-fotos .foto-col { display: table-cell; }
.bestand-foto { width: 42px; height: 42px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--rand); cursor: zoom-in; vertical-align: middle; }
.foto-leer { color: #c3c9d4; font-size: 18px; }

/* Tabelle bei Bedarf horizontal scrollen (schmale Fenster/viele Spalten) */
.tab-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tab-scroll table.tab { min-width: max-content; }
.freigabe-tab .freigabe-input { width: 70px; text-align: center; padding: 7px; border: 1px solid var(--rand); border-radius: 8px; font-size: 15px; font-weight: 700; }
.freigabe-tab td, .freigabe-tab th { vertical-align: middle; }
.ablehn-hinweis { margin: 4px 0 8px; }
.ablehn-hinweis b { color: var(--blau); }
.ablehn-hinweis p { font-size: 13px; margin-top: 4px; line-height: 1.5; }
textarea.gross-feld { width: 100%; padding: 11px 13px; border: 1px solid var(--rand); border-radius: 10px; font-size: 15px; font-family: inherit; resize: vertical; min-height: 96px; }
textarea.gross-feld:focus { outline: none; border-color: var(--akzent); }
.btn.ablehnen { background: #fff; color: var(--rot); border: 1px solid var(--rot); }
.btn.ablehnen:hover { background: #fdf0f0; }

/* Sticky-Aktionsleiste am unteren Rand eines Modals */
.modal-aktionen { position: sticky; bottom: 0; z-index: 2; margin: 16px -18px -18px; padding: 12px 18px; background: var(--karte); border-top: 1px solid var(--rand); box-shadow: 0 -3px 12px rgba(0,0,0,.08); }
/* füllt den Innenabstand unter der Leiste, damit kein Inhalt durchscheint */
.modal-aktionen::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 30px; background: var(--karte); }
.modal.gross .modal-aktionen { margin: 16px -28px -24px; padding: 14px 28px; }
.modal-aktionen .bar-reihe { display: flex; gap: 10px; justify-content: flex-end; }
@media (max-width: 560px) { .modal-aktionen .bar-reihe .btn { flex: 1; } }
.fehler { background: #fee2e2; color: #991b1b; padding: 10px 12px; border-radius: 9px; margin-bottom: 12px; font-size: 14px; }
.erfolg { background: #dcfce7; color: #166534; padding: 10px 12px; border-radius: 9px; margin-bottom: 12px; font-size: 14px; }

/* ---------- Tabelle ---------- */
table.tab { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tab th, table.tab td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--rand); }
table.tab th { font-size: 12px; color: var(--grau); text-transform: uppercase; letter-spacing: .03em; }
table.tab td.num, table.tab th.num { text-align: right; }
.abw-pos { color: var(--gruen); font-weight: 700; }
.abw-neg { color: var(--rot); font-weight: 700; }

/* ---------- Warenkorb ---------- */
.korb-bar {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--blau); color: #fff;
  padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; z-index: 40;
}
.variante-zeile { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--rand); }
.variante-zeile .variante-info { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 13px; min-width: 0; }
.variante-zeile .variante-info .verf { white-space: nowrap; color: var(--grau); }
.variante-zeile .menge-step { width: auto; flex: 0 0 auto; gap: 6px; }
.variante-zeile .menge-step button { flex: 0 0 30px; width: 30px; height: 30px; font-size: 17px; }
.variante-zeile .menge-step input.menge { flex: 0 0 46px; width: 46px; padding: 6px; }
.menge-step { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; width: 100%; }
.menge-step button { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--rand); background: #fff; font-size: 18px; cursor: pointer; }
.menge-step input.menge { flex: 1 1 auto; width: auto; min-width: 0; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal { background: var(--karte); width: 100%; max-width: 560px; border-radius: 16px 16px 0 0; padding: 18px; max-height: 92vh; overflow-y: auto; }
.modal.gross { max-width: 880px; padding: 24px 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .voll { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-abschnitt { grid-column: 1 / -1; font-weight: 700; font-size: 13px; color: var(--blau); border-bottom: 1px solid var(--rand); padding-bottom: 4px; margin: 10px 0 10px; }

.nutzer-karte { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nutzer-karte .nutzer-info { flex: 1; min-width: 0; }
.nutzer-karte .nutzer-verwandeln { flex: 0 0 auto; white-space: nowrap; }

.kat-titel { font-size: 15px; color: var(--blau); margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--akzent); display: inline-block; }
.kat-titel:first-of-type { margin-top: 4px; }

/* ---------- Handbuch (Hilfe) ---------- */
.hb-layout { display: flex; gap: 20px; min-height: 420px; }
.hb-nav { flex: 0 0 220px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--rand); padding-right: 12px; max-height: 68vh; overflow-y: auto; }
.hb-nav button { text-align: left; background: none; border: none; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; line-height: 1.3; }
.hb-nav button:hover { background: #f7eef0; }
.hb-nav button.aktiv { background: var(--akzent); color: #fff; font-weight: 700; }
.hb-inhalt { flex: 1; min-width: 0; max-height: 68vh; overflow-y: auto; font-size: 14px; line-height: 1.65; padding-right: 6px; }
.hb-inhalt h4 { color: var(--blau); font-size: 18px; margin-bottom: 10px; }
.hb-inhalt h5 { color: var(--blau); font-size: 14px; margin: 14px 0 4px; }
.hb-inhalt p { margin: 0 0 10px; }
.hb-inhalt ul, .hb-inhalt ol { margin: 0 0 10px 20px; }
.hb-inhalt li { margin-bottom: 4px; }
.hb-inhalt table.tab { margin: 6px 0 12px; }
.hb-inhalt .muted { font-size: 13px; }
@media (max-width: 700px) {
  .hb-layout { flex-direction: column; min-height: 0; }
  .hb-nav { flex: none; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--rand); padding: 0 0 10px; max-height: none; }
  .hb-inhalt { max-height: 60vh; }
}
@media (min-width: 600px) { .modal-bg { align-items: center; } .modal { border-radius: 16px; } }
.modal h3 { margin-bottom: 12px; color: var(--blau); }
.modal-close { float: right; font-size: 22px; color: var(--grau); background: none; border: none; cursor: pointer; }

/* ---------- Signatur ---------- */
.sig-wrap { border: 2px dashed var(--rand); border-radius: 10px; background: #fafbfc; touch-action: none; }
canvas#sig { width: 100%; height: 180px; display: block; }

.leer { text-align: center; color: var(--grau); padding: 40px 10px; }
.pill-link { color: var(--akzent); font-size: 13px; text-decoration: none; font-weight: 600; }

/* ---------- Typ-Umschalter (Verbrauchsware / Equipment) ---------- */
.typ-switch { display: inline-flex; background: #e9ecf1; border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.typ-switch button { border: none; background: transparent; padding: 9px 16px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--grau); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.typ-switch button.aktiv { background: var(--karte); color: var(--blau); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.typ-switch .typ-anz { background: #d5d9e0; color: #374151; border-radius: 20px; padding: 0 7px; font-size: 11px; }
.typ-switch button.aktiv .typ-anz { background: var(--akzent); color: #fff; }
.typ-switch.klein { margin-bottom: 0; }
.typ-switch.klein button { padding: 6px 11px; font-size: 13px; }
.kb-toolbar-label { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: var(--karte); border: 1px solid var(--rand); padding: 6px 11px; border-radius: 20px; }
.kb-toolbar-label input { width: auto; }
.schwelle-box { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--grau); margin-left: auto; }
.schwelle-box input { width: 72px; padding: 6px 8px; border: 1px solid var(--rand); border-radius: 8px; font-size: 14px; text-align: center; }

/* ---------- Niedriger Bestand / Archiv ---------- */
.karte.niedrig { border-color: #fca5a5; background: #fff7f7; }
table.tab tr.niedrig td { background: #fff1f2; }
.archiv-bereich { opacity: .8; }
table.tab tr.nach-erfasst td { background: #fff7ed; }

/* ---------- Lieferadresse (Warenkorb) ---------- */
.adr-option { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--rand); border-radius: 9px; margin-bottom: 6px; cursor: pointer; font-size: 14px; }
.adr-option.aktiv { border-color: var(--akzent); background: #fff5f6; }
.adr-option input { width: auto; margin-top: 4px; }
.adr-block { border: 1px solid var(--rand); border-radius: 10px; padding: 10px 12px 0; margin-bottom: 10px; background: #fafbfc; }

/* ---------- Lager-Haken (bereit / versendet) ---------- */
.karte.mit-haken { display: flex; align-items: center; gap: 12px; }
.karte.mit-haken .karte-inhalt { flex: 1; min-width: 0; }
.haken-box { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; padding-left: 12px; border-left: 1px solid var(--rand); }
.haken-box label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.haken-box input { width: 18px; height: 18px; accent-color: var(--gruen); cursor: pointer; }
.haken-box input:disabled { cursor: default; }
.neue-pos { margin-top: 6px; }

/* ---------- Wochenverbrauch ---------- */
.kw-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 16px; }
.tv-scroll { max-height: 70vh; overflow: auto; }
.tv-tab th, .tv-tab td { white-space: nowrap; padding: 5px 5px; font-size: 13px; }
.tv-tab th.fix, .tv-tab td.fix { position: sticky; left: 0; background: var(--karte); z-index: 1; min-width: 160px; white-space: normal; }
.tv-tab th { position: sticky; top: 0; background: var(--karte); z-index: 2; }
.tv-tab th.fix { z-index: 3; }
.tv-tab th.kw.heute { background: #fef3c7; color: #92400e; }
.tv-in { width: 56px; padding: 5px 4px; text-align: center; border: 1px solid var(--rand); border-radius: 6px; font-size: 13px; }
.tv-in.anf { width: 64px; }
.tv-in.hat { background: #eef7ff; font-weight: 700; }
.tv-in.dirty { border-color: var(--gelb); background: #fffbeb; }
.tv-in:disabled { background: #f3f4f6; color: #c3c9d4; }
/* Fixe Aktionsleiste: Vollbreiten-Button füllt die Leiste */
.modal-aktionen .bar-reihe .btn.block { flex: 1; }

/* Promoter & Umbuchen */
.promoter-karte { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.umb-eingabe { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.umb-eingabe input.menge { width: 54px; padding-left: 6px; padding-right: 4px; }
.umb-eingabe { font-size: 13px; }
.klein { font-size: 12px; }

/* Projektnummer (fester Präfix DE23-P + 8 Ziffern) */
label.feld .pflicht { color: var(--akzent); }
.pn-feld { display: flex; align-items: stretch; margin-top: 4px; max-width: 280px; }
.pn-praefix { display: flex; align-items: center; white-space: nowrap; padding: 0 10px; background: var(--bg); border: 1px solid var(--rand); border-right: 0; border-radius: 9px 0 0 9px; font-family: ui-monospace, Menlo, monospace; font-weight: 700; color: var(--text); }
label.feld .pn-feld input { margin-top: 0; border-radius: 0 9px 9px 0; font-family: ui-monospace, Menlo, monospace; letter-spacing: .05em; }
label.feld input.ungueltig { border-color: var(--rot); box-shadow: 0 0 0 2px rgba(166, 27, 27, .15); }
label.feld .klein-text { display: block; font-weight: 400; font-size: 12px; margin-top: 3px; }

/* Kunden: Tag-Badge + Kunden-Tags im Artikel-Formular */
.b-tuerkis { background: #ccfbf1; color: #115e59; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag-chip { border: 1px solid var(--rand); background: #fff; color: var(--text); border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.tag-chip:hover { border-color: #115e59; }
.tag-chip.aktiv { background: #ccfbf1; border-color: #14b8a6; color: #115e59; }
.tag-chip.aktiv::before { content: '✓ '; }

/* Marke: DO IT!-Logo (weiß) auf roter Fläche — Login, Einstellungs-Vorschau */
.topbar .brand-logo { height: 22px; }
.login-marke { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--akzent); border-radius: 12px; padding: 14px 18px; margin-bottom: 8px; color: #fff; font-weight: 800; font-size: 22px; }
.login-marke img { height: 28px; width: auto; display: block; }
.marke-vorschau { display: inline-flex; align-items: center; gap: 8px; background: var(--akzent); color: #fff; font-weight: 800; font-size: 18px; padding: 10px 16px; border-radius: 10px; margin-bottom: 10px; }
.marke-vorschau img { height: 22px; width: auto; display: block; }

/* Filterleisten (Nutzer, Kunden) + Menü-Suche */
.liste-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.liste-filter input[type=search] { flex: 1; min-width: 220px; padding: 10px 12px; border: 1px solid var(--rand); border-radius: 9px; font-size: 14px; font-family: inherit; background: #fff; }
.liste-filter select { padding: 10px 12px; border: 1px solid var(--rand); border-radius: 9px; font-size: 14px; font-family: inherit; background: #fff; }
.liste-filter .filter-info { font-size: 13px; white-space: nowrap; }
.nav-filter { padding: 2px 4px 8px; }
.nav-filter input { width: 100%; padding: 8px 10px; border: 1px solid var(--rand); border-radius: 8px; font-size: 13px; font-family: inherit; background: var(--bg); }
.nav-filter input:focus { background: #fff; outline: 2px solid #fbcfd6; border-color: var(--akzent); }
.seitenleiste.gefiltert .nav-gruppe.zu .nav-eintraege { display: block; }
.lager-wahl { padding: 10px 12px; border: 1px solid var(--rand); border-radius: 9px; font-size: 14px; font-weight: 600; font-family: inherit; background: #fff; }

/* Breites Modal (Artikel bearbeiten), Umbuchen, Lager-gebundene Artikellisten, Shop-Lagerwahl */
.modal.breit { max-width: 1100px; }
.umbuch-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 5px; }
.umbuch-zeile select { padding: 8px 10px; border: 1px solid var(--rand); border-radius: 8px; font-family: inherit; }
label.feld select[data-merkmal], label.feld input[data-merkmal] { width: 100%; margin-top: 5px; padding: 11px 12px; border: 1px solid var(--rand); border-radius: 9px; font-size: 15px; font-family: inherit; background: #fff; }
#artListe .zeile.anderes-lager { display: none !important; }
.shop-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.shop-lager { font-size: 13px; font-weight: 600; color: var(--grau); display: flex; align-items: center; gap: 8px; }
.shop-lager select { padding: 9px 12px; border: 1px solid var(--rand); border-radius: 9px; font-size: 15px; font-weight: 600; font-family: inherit; background: #fff; color: var(--text); }
.merkmal-zeile { display: grid; grid-template-columns: 1.3fr .8fr 2fr auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.merkmal-zeile input, .merkmal-zeile select { padding: 9px 10px; border: 1px solid var(--rand); border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; }
.merkmal-zeile input:disabled { background: var(--bg); }
@media (max-width: 700px) { .merkmal-zeile { grid-template-columns: 1fr 1fr; } }
.bestand-tab th.sortierbar { cursor: pointer; user-select: none; }
.bestand-tab th.sortierbar:hover { color: var(--blau); }
.bestand-tab .bestand-foto { display: block; }
.spalten-zeile { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rand); font-size: 14px; }
.spalten-zeile label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.merkmal-bereich { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .merkmal-bereich { grid-template-columns: 1fr; } }
.merkmal-feld > span { font-size: 13px; font-weight: 600; color: #374151; }
.merkmal-eingabe { display: flex; gap: 6px; align-items: center; margin-top: 5px; }
.merkmal-eingabe [data-merkmal] { flex: 1; padding: 11px 12px; border: 1px solid var(--rand); border-radius: 9px; font-size: 15px; font-family: inherit; background: #fff; }
.merkmal-hinzu { padding: 10px 12px; border: 1px dashed var(--rand); border-radius: 9px; font-size: 14px; font-weight: 600; font-family: inherit; background: #fff; color: var(--blau); cursor: pointer; margin-bottom: 12px; }
.kat-kunde { padding: 5px 8px; border: 1px solid var(--rand); border-radius: 7px; font-size: 12px; font-family: inherit; margin-right: 6px; }

/* Kategorien-Matrix (Kategorie × Kunde) */
.kat-neu { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; margin-bottom: 12px; }
.kat-neu input, .kat-neu select { padding: 9px 10px; border: 1px solid var(--rand); border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; }
.kat-neu input { flex: 1; min-width: 180px; }
.kat-matrix-wrap { max-height: calc(100vh - 260px); overflow: auto; border: 1px solid var(--rand); border-radius: 10px; background: var(--karte); }
.kat-matrix { border-collapse: separate; border-spacing: 0; }
.kat-matrix th { position: sticky; top: 0; z-index: 2; background: var(--karte); }
.kat-matrix .kat-name { position: sticky; left: 0; z-index: 1; background: var(--karte); min-width: 220px; white-space: normal; }
.kat-matrix th.kat-name { z-index: 3; }
.kat-matrix tr.kat-unter .kat-name { padding-left: 28px; font-weight: 400; }
.kat-matrix tr.kat-unter .kat-name b { font-weight: 500; }
.kat-kunde-kopf { text-align: center; min-width: 96px; max-width: 140px; white-space: normal; line-height: 1.25; font-size: 11px; }
.kat-kunde-kopf span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kat-schalter { text-align: center; }
.schalter { min-width: 52px; padding: 5px 0; border-radius: 20px; border: 1px solid var(--rand); background: #f3f4f6; color: #9ca3af; font-size: 11px; font-weight: 800; letter-spacing: .04em; cursor: pointer; font-family: inherit; }
.schalter.an { background: #14b8a6; border-color: #0f9488; color: #fff; }
.schalter:not([disabled]):hover { border-color: #14b8a6; }
.schalter[disabled] { cursor: default; opacity: .55; }
.kat-aktionen { white-space: nowrap; text-align: right; }
.klein-text-inline { font-size: 12px; font-weight: 400; }
.kat-kunde-kopf { text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--text); }
.text-filter { display: flex; align-items: center; gap: 10px; margin: -4px 0 12px; }
.text-filter input { flex: 1; min-width: 200px; max-width: 520px; padding: 10px 12px; border: 1px solid var(--rand); border-radius: 9px; font-size: 14px; font-family: inherit; background: #fff; }
.text-filter .filter-info { font-size: 13px; white-space: nowrap; }

/* Drag & Drop: Spalten (Tabellenkopf) und Zeilen (Spalten-Dialog) */
.bestand-tab th[draggable="true"] { cursor: grab; }
.wird-gezogen { opacity: .45; }
th.ziel-vor { box-shadow: inset 3px 0 0 var(--akzent); }
th.ziel-nach { box-shadow: inset -3px 0 0 var(--akzent); }
.spalten-zeile { cursor: grab; }
.spalten-zeile.ziel-vor { box-shadow: inset 0 3px 0 var(--akzent); }
.spalten-zeile.ziel-nach { box-shadow: inset 0 -3px 0 var(--akzent); }
.zieh-griff { color: var(--grau); margin-right: 8px; font-size: 16px; cursor: grab; user-select: none; }
.spalten-zeile label { flex: 1; }

/* ---------- Artikel-Dialog mit Tabs ---------- */
.art-modal { display: flex; flex-direction: column; }
.art-modal .modal-aktionen { margin-top: auto; }
.art-kopf { display: flex; gap: 14px; align-items: center; padding-right: 36px; margin-bottom: 12px; }
.art-kopf-bild { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; background: #f3f4f6; border: 1px solid var(--rand); }
.art-kopf-bild.platzhalter { display: grid; place-items: center; font-size: 26px; }
.art-kopf-text { flex: 1; min-width: 0; }
.art-kopf-text h3 { margin: 0 0 3px; font-size: 19px; overflow-wrap: anywhere; }
.art-kopf-text .muted { font-size: 13px; }
.punkt-rot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--akzent); vertical-align: 1px; }
.art-menue-wrap { position: relative; flex: 0 0 auto; }
.art-menue-wrap > .btn { font-size: 18px; line-height: 1; padding: 6px 12px; }
.art-menue { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; background: var(--karte); border: 1px solid var(--rand); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); min-width: 210px; padding: 6px; display: flex; flex-direction: column; }
.art-menue button { text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 7px; font: inherit; font-size: 14px; cursor: pointer; color: var(--text); }
.art-menue button:hover { background: var(--bg); }
.art-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rand); margin: 0 -28px 16px; padding: 0 28px; overflow-x: auto; scrollbar-width: none; position: sticky; top: -24px; background: var(--karte); z-index: 3; }
.art-tabs::-webkit-scrollbar { display: none; }
.art-tab { position: relative; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px 9px; font: inherit; font-size: 14px; font-weight: 600; color: var(--grau); cursor: pointer; white-space: nowrap; }
.art-tab:hover { color: var(--text); }
.art-tab.aktiv { color: var(--blau); border-bottom-color: var(--akzent); }
.art-tab-zahl { font-weight: 500; color: var(--grau); }
.art-tab.fehler::after { content: ''; position: absolute; top: 8px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--akzent); }
.art-form { min-height: 300px; }
.art-pane .form-abschnitt { margin-top: 18px; }
.info-tipp { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; font-size: 11px; font-weight: 700; color: var(--grau); border: 1px solid var(--rand); cursor: help; vertical-align: 1px; margin-left: 2px; }
.info-tipp:focus-visible { outline: 2px solid var(--akzent); }
.lagerplatz-felder { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 5px; }
.check-zeile { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; }
.check-zeile input { width: auto; }
.art-var-tab td, .art-var-tab th { padding: 8px 10px; }
.code-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.code-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--rand); background: #f9fafb; border-radius: 8px; padding: 4px 4px 4px 10px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; max-width: 100%; }
.code-chip.eigen { background: #fff5f6; border-color: #f7c6cf; }
.code-chip .code-text { overflow-wrap: anywhere; }
.code-chip button { border: 0; background: none; cursor: pointer; color: var(--grau); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.code-chip button:hover { background: var(--rand); color: var(--rot); }
.code-neu { display: flex; gap: 8px; margin-bottom: 10px; }
.code-neu input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--rand); border-radius: 9px; font: inherit; font-family: ui-monospace, Menlo, Consolas, monospace; }
.etikett-zeile { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--rand); }
.etikett-zeile .feld { margin: 0; }
.etikett-zeile .feld input { width: 80px; }
.verlauf { display: flex; flex-direction: column; }
.verlauf-zeile { display: flex; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--rand); font-size: 14px; }
.verlauf-zeile > span:first-child { flex: 0 0 auto; min-width: 120px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .art-tabs { margin: 0 -18px 14px; padding: 0 18px; top: -18px; }
  .art-kopf-bild { width: 48px; height: 48px; }
}
.art-modal { position: relative; }
.art-modal > .modal-close { position: absolute; top: 14px; right: 16px; float: none; z-index: 6; }
.art-pane[hidden], .art-menue[hidden] { display: none !important; }
.lagerplatz-felder input { width: 100%; padding: 11px 12px; border: 1px solid var(--rand); border-radius: 9px; font-size: 15px; font-family: inherit; background: #fff; }
/* Feste Dialoghöhe (80 % des Bildschirms): Kopf + Tabs + Fußleiste stehen, nur der Tab-Inhalt scrollt */
.modal.art-modal { height: 80vh; height: 80dvh; overflow: hidden; }
.art-modal .art-kopf, .art-modal .art-tabs, .art-modal .modal-aktionen { flex: 0 0 auto; }
.art-modal .art-tabs { position: static; }
.art-modal .art-form { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -28px; padding: 2px 28px 16px; }
.art-modal .modal-aktionen { position: static; margin-top: 0; }
.art-modal .modal-aktionen::after { display: none; }
@media (max-width: 600px) {
  .modal.art-modal { height: 92vh; height: 92dvh; }
  .art-modal .art-form { margin: 0 -18px; padding: 2px 18px 16px; }
}
/* Sichtbarkeit: Kunden als Tabelle mit Anzeigen-Knopf */
.kunden-sicht { width: 100%; margin-top: 6px; }
.kunden-sicht td { padding: 10px 12px; vertical-align: middle; }
.kunden-sicht td:first-child { font-weight: 600; }
.kunden-sicht tr:has(.sicht-knopf.aktiv) td { background: #f0fdfa; }
.sicht-knopf { min-width: 160px; border: 1px solid var(--rand); background: #fff; color: var(--text); border-radius: 8px; padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.sicht-knopf:hover { border-color: #14b8a6; }
.sicht-knopf.aktiv { background: #ccfbf1; border-color: #14b8a6; color: #115e59; }
@media (max-width: 600px) { .sicht-knopf { min-width: 0; } }

/* ---------- Varianten-Editor ---------- */
.vk { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.vk-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.vk-aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
.vk-aktionen select { padding: 7px 10px; border: 1px solid var(--rand); border-radius: 8px; font: inherit; font-size: 14px; background: #fff; }
.vk-leer { margin: 0; }
.vk-achse { border: 1px solid var(--rand); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: #fcfcfd; }
.vk-achse-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.vk-name { flex: 1 1 180px; min-width: 0; padding: 9px 11px; border: 1px solid var(--rand); border-radius: 9px; font: inherit; font-weight: 700; }
.vk-foto { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--grau); }
.vk-foto input { width: auto; }
.vk-achse-btns { display: flex; gap: 4px; margin-left: auto; }
.vk-werte { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vk-wert { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rand); background: #fff; border-radius: 9px; padding: 4px 4px 4px 10px; font-size: 14px; font-weight: 600; cursor: grab; }
.vk-wert img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; margin-left: -4px; }
.vk-wert-foto-leer { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; background: var(--bg); font-size: 13px; margin-left: -4px; opacity: .6; }
.vk-wert button, .vk-foto-upload { border: 0; background: none; cursor: pointer; color: var(--grau); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.vk-wert button:hover, .vk-foto-upload:hover { background: var(--rand); color: var(--text); }
.vk-wert.ziel-vor { box-shadow: inset 3px 0 0 var(--akzent); }
.vk-wert.ziel-nach { box-shadow: inset -3px 0 0 var(--akzent); }
.vk-neu { width: 150px; padding: 7px 10px; border: 1px dashed #cbd0d6; border-radius: 9px; font: inherit; font-size: 14px; background: #fff; }
.klein-text { font-size: 12px; }
.vk-kombi-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.vk-kombi-btns { margin-left: auto; display: flex; gap: 6px; }
.vk-kombis td, .vk-kombis th { padding: 7px 10px; }
.vk-kombis td:first-child { width: 36px; }
.vk-kombis input { width: auto; }
.vk-kombis tr.aus td { color: var(--grau); text-decoration: line-through; background: #fafafa; }
.vk-kombis tr.aus td:first-child, .vk-kombis tr.aus td:last-child { text-decoration: none; }

/* ---------- Shop: Produkte mit Varianten, Bestell-Raster, Warenkorb-Gruppen ---------- */
.karte-swatches { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.karte-swatches img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; border: 1px solid var(--rand); }
.karte-swatches span { font-size: 12px; border: 1px solid var(--rand); border-radius: 7px; padding: 3px 7px; }
.karte-auswahl { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.karte-auswahl .btn { flex: 1; }
.im-korb { font-weight: 700; color: var(--gruen); white-space: nowrap; }
.vr-modal { max-width: 980px; }
.vr { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 22px; align-items: start; }
.vr-bild img, .vr-bild .platzhalter { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 14px; background: #f6f7f9; border: 1px solid var(--rand); }
.vr-bild .platzhalter { display: grid; place-items: center; font-size: 48px; }
.vr-rechts { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.vr-rechts h3 { margin: 0; }
.vr-swatch-titel { margin-top: 4px; font-size: 14px; }
.vr-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.vr-swatch { position: relative; border: 2px solid var(--rand); background: #fff; border-radius: 12px; padding: 3px; cursor: pointer; min-width: 52px; min-height: 52px; display: grid; place-items: center; font: inherit; }
.vr-swatch img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; display: block; }
.vr-swatch-name { padding: 0 8px; font-weight: 600; font-size: 14px; }
.vr-swatch.aktiv { border-color: var(--akzent); box-shadow: 0 0 0 2px rgba(221,5,43,.15); }
.vr-swatch-n { position: absolute; top: -8px; right: -8px; background: var(--gruen); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 2px 7px; }
.vr-tab { border-collapse: separate; border-spacing: 6px; margin: 0 -6px; }
.vr-tab th { font-size: 13px; color: var(--grau); font-weight: 700; text-align: center; padding: 2px 4px; white-space: nowrap; }
.vr-tab tbody th { text-align: left; color: var(--text); font-size: 15px; padding-right: 10px; }
.vr-zelle { text-align: center; vertical-align: top; }
.vr-zelle input { width: 72px; padding: 9px 6px; text-align: center; border: 1px solid var(--rand); border-radius: 9px; font: inherit; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vr-zelle.gefuellt input { border-color: var(--gruen); background: #f0fdf4; }
.vr-zelle input:disabled { background: #f3f4f6; }
.vr-verf { display: block; font-size: 11px; color: var(--grau); margin-top: 3px; white-space: nowrap; }
.vr-zelle.vergriffen .vr-verf { color: var(--rot); }
.vr-zelle, .vr-nicht { vertical-align: top; }
.vr-nicht { text-align: center; color: #c4c8ce; }
.vr-fuss { align-items: center; justify-content: space-between !important; }
.wk-gruppe { display: flex; flex-direction: column; gap: 0; }
.wk-gruppe + .wk-gruppe { margin-top: 14px; }
.wk-gruppe-kopf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 2px 8px; border-bottom: 2px solid var(--rand); }
.wk-gruppe-kopf .btn { margin-left: auto; }
@media (max-width: 700px) {
  .vr { grid-template-columns: 1fr; }
  .vr-bild img, .vr-bild .platzhalter { max-height: 240px; }
  .vr-zelle input { width: 60px; }
}
.vk-wert.datei-ziel { outline: 2px dashed var(--akzent); outline-offset: 2px; background: #fff5f6; }
.vk-wert.laedt { opacity: .5; pointer-events: none; }
/* Foto-Spalte in der Variantenliste */
.vk-foto-zelle { width: 64px; position: relative; white-space: nowrap; }
.vk-foto-klein { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px dashed #cbd0d6; border-radius: 8px; cursor: pointer; background: #fff; overflow: hidden; font-size: 16px; }
.vk-foto-klein img { width: 100%; height: 100%; object-fit: cover; }
.vk-foto-klein:hover { border-color: var(--akzent); }
.vk-foto-x { position: absolute; top: 2px; left: 44px; border: 0; background: #fff; color: var(--grau); border-radius: 50%; width: 18px; height: 18px; font-size: 10px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2); padding: 0; }
.vk-foto-leer { color: #c4c8ce; }
.vk-kombis tr.datei-ziel td { background: #fff5f6; }
.vk-kombis tr.datei-ziel td:first-child { box-shadow: inset 3px 0 0 var(--akzent); }
.vk-kombis tr.laedt { opacity: .5; }
/* Mehrfach-Upload: Zuordnung über Dateinamen */
.vk-kombi-btns label.btn { cursor: pointer; }
[data-foto-liste].datei-ziel { outline: 2px dashed var(--akzent); outline-offset: 4px; border-radius: 8px; background: #fff5f6; }
.vk-zuordnung { border: 1px solid var(--rand); border-radius: 12px; padding: 12px; margin: 8px 0 12px; background: #fcfcfd; display: flex; flex-direction: column; gap: 10px; }
.vk-zuordnung-kopf { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.vk-zuordnung-kopf code { background: #eef0f3; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.vk-zuordnung-tab td { padding: 6px 8px; vertical-align: middle; }
.vk-zuordnung-tab img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rand); display: block; }
.vk-zu-datei { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.vk-zuordnung-tab select { padding: 7px 9px; border: 1px solid var(--rand); border-radius: 8px; font: inherit; font-size: 14px; background: #fff; max-width: 260px; }
.vk-zuordnung-tab tr.ok td { background: #f0fdf4; }
.vk-zuordnung-tab tr.fehler td { background: #fff1f2; }
.vk-zu-status { width: 120px; font-weight: 700; color: var(--gruen); }
.vk-kombis tr.gruppe-start td { border-top: 2px solid #d9dde2; }
.vk-kombis tr:first-child td { border-top: 0; }
.vk-foto-zelle { vertical-align: top; }
/* Artikelbild-Zone: Drag & Drop, Einfügen, Klick */
.bild-zone { display: flex; align-items: center; gap: 14px; margin-top: 5px; padding: 12px; border: 2px dashed #cbd0d6; border-radius: 12px; background: #fafafa; cursor: pointer; min-height: 72px; }
.bild-zone:hover, .bild-zone:focus-visible { border-color: var(--akzent); outline: none; }
.bild-zone.datei-ziel { border-color: var(--akzent); background: #fff5f6; }
.bild-zone img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--rand); background: #fff; flex: 0 0 auto; }
.bild-zone.neu-gewaehlt img { outline: 3px solid var(--gruen); outline-offset: 1px; }
.bild-zone-text { color: var(--grau); font-size: 14px; }
.bild-zone-fuss { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 13px; color: var(--gruen); flex-wrap: wrap; }
.bild-zone-fuss[hidden], #bildVorschau[hidden] { display: none !important; }
/* Codes je Variante */
.code-neu select { padding: 9px 10px; border: 1px solid var(--rand); border-radius: 9px; font: inherit; font-size: 14px; background: #fff; max-width: 220px; }
.code-tab th { text-align: left; white-space: nowrap; width: 1%; padding-right: 14px; font-weight: 600; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--text); }
.code-tab tr.ohne th { color: var(--grau); }
.code-tab td { vertical-align: middle; }
.code-tab .code-chip { margin: 2px 0; }
.code-plus { border: 1px dashed #cbd0d6; background: none; color: var(--blau); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; margin: 2px 0; vertical-align: middle; }
.code-plus:hover { border-color: var(--akzent); background: #fff5f6; }
.code-tab .code-chip + .code-plus { margin-left: 6px; }
.code-alle { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.res-seite .shop-kopf { margin-top: 6px; }
.res-seite .shop-kopf { margin-top: 6px; }

/* Excel-Import */
.imp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.imp-neu { margin: 0 0 10px; background: #fffbeb; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.imp-tab td { vertical-align: top; font-size: 13px; }
.imp-tab td.code { font-family: ui-monospace, Menlo, Consolas, monospace; white-space: nowrap; }
.imp-tab tr.vorhanden td { color: var(--grau); }
.imp-warn { margin: 0; padding-left: 16px; color: #b45309; }
.tab-scroll table.imp-tab { min-width: 0; width: 100%; }
.imp-tab th:nth-child(2), .imp-tab td:nth-child(2) { min-width: 180px; }
.imp-tab td:nth-child(3) { max-width: 320px; }
.imp-tab td:nth-child(7) { max-width: 260px; }
