/* Backoffice (Phase 2b) – übernommen vom freigegebenen Prototyp (kassen-prototyp:
   style.css/base.css). Navy + Orange wie die Staff-App, helles Thema. */

:root {
  --font-body: 'General Sans', 'Segoe UI', system-ui, sans-serif;
  --text-xs: 13px;
  --text-sm: 15px;
  --text-base: 17px;
  --text-lg: 21px;
  --text-xl: 28px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 22px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-interactive: 160ms var(--ease);

  --navy-950: oklch(0.17 0.035 260);
  --navy-900: oklch(0.21 0.045 260);
  --navy-800: oklch(0.26 0.055 260);
  --navy-700: oklch(0.32 0.06 260);
  --navy-600: oklch(0.40 0.06 260);
  --orange: oklch(0.70 0.175 48);
  --orange-hover: oklch(0.65 0.18 45);
  --orange-ink: oklch(0.22 0.05 45);
  --red: oklch(0.58 0.19 25);
  --green: oklch(0.62 0.13 155);

  --color-bg: oklch(0.965 0.006 260);
  --color-surface: oklch(1 0 0);
  --color-surface-2: oklch(0.945 0.008 260);
  --color-surface-3: oklch(0.90 0.012 260);
  --color-border: oklch(0.25 0.05 260 / 0.10);
  --color-border-strong: oklch(0.25 0.05 260 / 0.20);
  --color-text: oklch(0.22 0.045 260);
  --color-text-muted: oklch(0.42 0.035 260);
  --color-text-faint: oklch(0.52 0.03 260);
  --color-sidebar: var(--navy-900);
  --shadow: 0 8px 24px oklch(0.25 0.05 260 / 0.10);
  --color-primary: var(--orange);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: none; text-size-adjust: none; -webkit-font-smoothing: antialiased; }
body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg);
  font-variant-numeric: tabular-nums;
}
img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
table { border-collapse: collapse; width: 100%; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; }
a, button, input, textarea, select { transition: color var(--transition-interactive), background var(--transition-interactive), border-color var(--transition-interactive), box-shadow var(--transition-interactive); }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.muted { color: var(--color-text-muted); }
.faint { color: var(--color-text-faint); }
.r { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, monospace; font-size: 12.5px; }
[hidden] { display: none !important; }

/* ---------- Staging-Banner ---------- */
#staging-banner {
  display: flex; align-items: center; gap: 14px;
  background: var(--orange); color: var(--orange-ink);
  font-size: 13px; font-weight: 600; padding: 6px 16px;
}
#staging-banner small { font-weight: 500; }

/* ---------- Schaltflächen / Bausteine ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 600;
  background: var(--color-surface-2); color: var(--color-text); border: 1px solid var(--color-border);
  white-space: nowrap;
}
.btn:hover { background: var(--color-surface-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
/* Hauptknöpfe Navy – Orange bleibt Hinweisen (Badges, Warn-Chips, Testserver-Balken) vorbehalten */
.btn-primary { background: #1d3a5f; color: #fff; border-color: transparent; }
.btn-primary:hover { background: #274973; }
.btn-danger { background: transparent; color: var(--red); border-color: oklch(from var(--red) l c h / 0.45); }
.btn-danger:hover { background: oklch(from var(--red) l c h / 0.12); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: var(--text-xs); font-weight: 600; background: var(--color-surface-2); color: var(--color-text-muted);
}
.chip.ok::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.chip.accent { background: oklch(from var(--orange) l c h / 0.16); color: var(--orange); }
.chip.warn { background: oklch(0.85 0.12 85 / 0.35); color: oklch(0.42 0.09 70); }
.chip.bad { background: oklch(from var(--red) l c h / 0.14); color: var(--red); }

.seg { display: inline-flex; background: var(--color-surface-2); border-radius: 12px; padding: 3px; border: 1px solid var(--color-border); flex-wrap: wrap; }
.seg button { padding: 8px 14px; border-radius: 9px; font-size: var(--text-sm); font-weight: 500; color: var(--color-text-muted); white-space: nowrap; }
.seg button:hover { color: var(--color-text); }
.seg button[aria-current='true'] { background: #1d3a5f; color: #fff; font-weight: 600; box-shadow: 0 1px 3px oklch(0 0 0 / 0.2); }

.search {
  width: 100%; height: 46px; border-radius: 12px; padding: 0 16px; font-size: var(--text-sm);
  background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text);
}
.selbox {
  width: 100%; height: 44px; border-radius: 10px; padding: 0 10px; background: var(--color-surface-2);
  border: 1px solid var(--color-border); color: var(--color-text); font-size: var(--text-sm);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 600; font-size: 13px; color: white; background: var(--navy-600);
}

/* ---------- Toast / Modal ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; z-index: 90; pointer-events: none; max-width: 560px; }
.toast {
  background: var(--navy-900); color: white; padding: 12px 18px; border-radius: 12px; font-size: var(--text-sm);
  font-weight: 500; box-shadow: 0 12px 30px oklch(0 0 0 / 0.35); border: 1px solid oklch(1 0 0 / 0.1);
  animation: pop 220ms var(--ease);
}
.toast.warn { background: oklch(0.35 0.1 30); }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }

.overlay { position: fixed; inset: 0; background: oklch(0.1 0.02 260 / 0.55); display: grid; place-items: center; z-index: 80; animation: fade 180ms var(--ease); padding: 20px; }
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--color-surface); color: var(--color-text); border-radius: var(--radius-xl); width: 620px; max-width: 100%;
  max-height: 86dvh; display: flex; flex-direction: column; box-shadow: 0 30px 80px oklch(0 0 0 / 0.45);
  border: 1px solid var(--color-border); animation: pop 220ms var(--ease);
}
.modal.modal-wide { width: 980px; }
.modal-head { padding: var(--space-5) var(--space-6) var(--space-3); display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.modal-head h3 { font-size: var(--text-lg); font-weight: 600; }
.modal-head p { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: 4px; }
.modal-body { padding: 0 var(--space-6) var(--space-5); overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { padding: var(--space-4) var(--space-6) var(--space-5); display: flex; gap: 10px; justify-content: flex-end; }
.close { width: 38px; height: 38px; border-radius: 10px; font-size: 20px; color: var(--color-text-muted); flex: none; }
.close:hover { background: var(--color-surface-2); color: var(--color-text); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-karte {
  width: 420px; max-width: 100%; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-xl); padding: var(--space-8); display: flex; flex-direction: column; gap: 18px;
  box-shadow: var(--shadow);
}
.login-marke { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 11px; background: var(--navy-900); color: var(--orange);
  display: grid; place-items: center; font-weight: 700; font-size: 18px; letter-spacing: -.02em;
}
.login-karte h1 { font-size: var(--text-lg); font-weight: 700; }
.login-karte .lead { color: var(--color-text-muted); font-size: var(--text-sm); }
.login-fehler { background: oklch(from var(--red) l c h / 0.12); color: var(--red); border-radius: 10px; padding: 10px 14px; font-size: var(--text-sm); font-weight: 500; }

/* ---------- Grundgerüst: dunkle Seitenleiste + Inhalt ---------- */
.bo { display: flex; min-height: 100dvh; }
.seitenleiste {
  width: 248px; flex: none; display: flex; flex-direction: column;
  background: #0f2747; color: #e8eef6; padding: 12px 12px 10px;
  position: sticky; top: 0; height: 100dvh;
}
/* Oranger Testserver-Balken: Seitenleiste entsprechend kürzer */
body.mit-banner .seitenleiste { height: calc(100dvh - 34px); }
.sl-oben { display: flex; align-items: center; gap: 6px; flex: none; }
.sl-logo { display: flex; align-items: center; gap: 10px; padding: 4px 6px 10px; flex: 1; min-width: 0; }
.sl-logo img { height: 30px; width: auto; }
.sl-standort {
  margin-left: auto; font-size: 12.5px; font-weight: 600; color: #9db0c6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sl-standorte { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 2px 4px 10px; flex: none; }
.st {
  padding: 5px 2px; border-radius: 999px; font-size: 11px; font-weight: 600; text-align: center;
  color: #9db0c6; background: rgba(255, 255, 255, 0.06);
}
.st:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.st.aktiv { background: rgba(255, 255, 255, 0.16); color: #fff; }
.sl-nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.sl-titel {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: #5f7b99; padding: 12px 8px 4px;
}
.sl-eintrag {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 9px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: #c9d6e6; text-align: left; white-space: nowrap;
}
.sl-eintrag svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.sl-eintrag:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sl-eintrag.aktiv { background: #233c5b; color: #fff; font-weight: 700; }
.sl-eintrag.aktiv svg { opacity: 1; }
.sl-pfeil { margin-left: auto; font-size: 9px; line-height: 1; color: #5f7b99; transition: transform var(--transition-interactive); }
.sl-gruppe.offen .sl-pfeil { transform: rotate(90deg); }
.sl-gruppe { display: flex; flex-direction: column; }
.sl-unter {
  display: none; margin-left: 21px; padding-left: 9px; border-left: 1px solid #2b4663;
  flex-direction: column; gap: 1px;
}
.sl-gruppe.offen .sl-unter { display: flex; }
.sl-unter .sl-eintrag { padding: 5px 9px; font-size: 12.5px; color: #9db0c6; }
.sl-unter .sl-eintrag:hover { color: #fff; }
.sl-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #e65a1e; color: #fff; font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
}
.sl-fuss { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 10px; flex: none; }
.sl-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.sl-user .avatar { width: 32px; height: 32px; font-size: 12px; background: #233c5b; flex: none; }
.sl-user b { font-size: 13px; font-weight: 600; display: block; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-user small { font-size: 11px; color: #9db0c6; }
.sl-user-text { min-width: 0; }
.sl-abmelden { padding: 8px; font-size: 12.5px; color: #9db0c6; display: flex; align-items: center; gap: 8px; width: 100%; }
.sl-abmelden:hover { color: #fff; }
.sl-abmelden svg { width: 14px; height: 14px; flex: none; }
.burger { display: none; color: #fff; font-size: 20px; padding: 4px 8px; border-radius: 8px; flex: none; }
.burger:hover { background: rgba(255, 255, 255, 0.08); }

/* Inhalt mit schmaler Kopfzeile (Titel + Pfad, bei Details «Zurück zur Liste») */
.inhalt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kopfzeile {
  flex: none; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 20px; min-height: 54px;
  background: var(--color-surface); border-bottom: 1px solid var(--color-border);
}
.zurueck {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 9px; font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--color-surface-2); color: var(--color-text); border: 1px solid var(--color-border);
}
.zurueck:hover { background: var(--color-surface-3); }
.pfad { font-size: 13.5px; color: var(--color-text-muted); min-width: 0; }
.pfad b { color: var(--color-text); font-weight: 700; }
.pfad-sep { color: var(--color-text-faint); }
.bo-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---------- Seitenbausteine ---------- */
.bo-page { padding: 22px 26px 40px; display: flex; flex-direction: column; gap: 16px; flex: 1; min-height: 0; }
.bo-split { flex-direction: row; align-items: stretch; }
.bo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.bo-side {
  width: 340px; flex: none; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; overflow: auto;
  max-height: calc(100dvh - 120px); position: sticky; top: 70px;
}
/* Panel-Inhalte (Karten) dürfen nicht gestaucht werden: Die Karte in der
   Seitenleiste hat overflow:hidden – ohne flex:none schrumpft sie bei
   begrenzter Panelhöhe und schneidet Fusszeile/Knöpfe ab. Mit flex:none
   behält die Karte ihre Höhe, das Panel scrollt bis zum letzten Element. */
.bo-side > * { flex: none; }
.bo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.bo-head h1 { font-size: 24px; font-weight: 700; }
.bo-lead { color: var(--color-text-muted); font-size: 14px; margin-top: 4px; max-width: 80ch; }
.bo-scroll { overflow: auto; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; max-height: 62dvh; }
.bo-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.bo-card h2 { font-size: 17px; font-weight: 700; }
.bo-card .bo-scroll { max-height: 480px; border: none; border-radius: 0; }
.bo-todo { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.bo-f { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); }
.bo-f input, .bo-f select { font: inherit; font-size: 14px; font-weight: 500; color: var(--color-text); padding: 8px 10px; border-radius: 8px; border: 1px solid var(--color-border-strong); background: white; }
.bo-f2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.bo-f input, .bo-f select { width: 100%; min-width: 0; }
/* Rezept (A10): Zeile = Zutat-Auswahl + Gramm + entfernen */
.rezept-zeile { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rezept-zeile select { flex: 1 1 180px; min-width: 0; }
.rezept-zeile input { width: 90px; flex: none; }
.bo-h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); margin-top: 6px; }
.bo-shakes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bo-shakes label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
/* Kompakte Shake-Guthaben-Karte je Box (Paket 3) */
.bo-shake-karte { display: flex; align-items: center; gap: 8px; border: 1px solid var(--color-border); border-radius: 8px; padding: 6px 10px; }
.bo-shake-karte .bo-shake-box { font-weight: 600; min-width: 2.2em; }
.bo-shake-karte input { width: 70px; flex: none; }

/* Guthaben aus Gutscheinen (Teil B): Bar/Abo-Umschalter in der Kundentabelle */
.gs-um { display: inline-flex; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; }
.gs-um-b { padding: 4px 12px; font-size: 12px; font-weight: 600; color: var(--color-text-muted); background: var(--color-surface); border: 0; cursor: pointer; }
.gs-um-b + .gs-um-b { border-left: 1px solid var(--color-border); }
.gs-um-b.an { background: var(--navy-900, #1c2b3a); color: #fff; }
.gs-um.gesperrt .gs-um-b { cursor: default; opacity: .75; }
#shake-feld { display: grid; grid-template-columns: 1fr; gap: 8px; }
.bo-pin { background: oklch(from var(--orange) l c h / 0.12); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.bo-moves { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.bo-moves > div { padding: 8px 10px; border-radius: 8px; background: oklch(0.975 0.004 260); }
.bo-moves span { display: block; font-size: 11.5px; color: var(--color-text-muted); }
.bo-subnote { font-size: 12.5px; color: var(--color-text-muted); max-width: 56ch; }
.leer { padding: 36px 20px; text-align: center; color: var(--color-text-faint); font-size: 14px; }
.lade { padding: 36px 20px; text-align: center; color: var(--color-text-muted); font-size: 14px; }
.seitenhelfer { display: flex; gap: 8px; align-items: center; }

/* ---------- Kassenlayout-Editor ---------- */

/* Editor auf Fensterhöhe begrenzt: die Seite selbst scrollt nicht, dafür
   Bibliothek, Raster und Eigenschaften einzeln (body.editor-offen, siehe editor.js).
   Auf schmalen Screens (unter 1024 px) bleibt der normale Seiten-Scroll. */
body.editor-offen { overflow: hidden; }
body.editor-offen .bo { height: 100dvh; min-height: 0; }
body.editor-offen .inhalt { min-height: 0; }
body.editor-offen .bo-body { overflow: hidden; }
.kassen-root { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.editor-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.editor { flex: 1; min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); gap: 0; }
.ed-col { min-height: 0; display: flex; flex-direction: column; }
.ed-lib { background: var(--color-surface); border-right: 1px solid var(--color-border); padding: var(--space-4); gap: 10px; }
.ed-lib h3, .ed-props h3 { font-size: var(--text-base); font-weight: 600; }
.ed-lib .search { height: 42px; font-size: var(--text-sm); }
.ed-lib-fix { flex: none; display: flex; flex-direction: column; gap: 10px; }
.lib-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; min-height: 120px; }
.lib-group { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-faint); margin: 10px 2px 2px; }
.lib-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 10px;
  background: var(--color-surface-2); border: 1px solid var(--color-border); cursor: grab; font-size: var(--text-sm);
}
.lib-item:hover { border-color: var(--color-border-strong); }
.lib-item small { color: var(--color-text-faint); font-size: 12px; white-space: nowrap; }
.lib-fn { display: inline-flex; align-items: center; gap: 8px; }
.ed-center { padding: var(--space-4) var(--space-5); gap: 12px; overflow: hidden; }
.ed-grid-bereich { flex: 1; min-height: 0; overflow: auto; }

/* Kopfzeile Variante B (Paket 1): Box-Segment, Kasse|Self-Checkout, Versions-Badge,
   rechts Vorschau / Veröffentlichen (navy) / ⋯ – alles in einer Zeile. */
.ed-kopf { flex: none; position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px var(--space-5); background: var(--color-surface);
  border-bottom: 1px solid var(--color-border); }
.ed-kopf-links, .ed-kopf-rechts { display: flex; align-items: center; gap: 10px; }
.ed-kopf .seg button { padding: 7px 12px; white-space: nowrap; font-weight: 600; }
.ed-kopf-label { font-size: 13px; color: var(--color-text-muted); white-space: nowrap; }
.ed-badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; }
.ed-badge.ok { background: oklch(0.55 0.14 150); color: #fff; }
.ed-badge.accent { background: var(--orange); color: oklch(0.2 0.03 260); }
.ed-badge-info { width: 24px; height: 24px; border-radius: 999px; border: 1px solid var(--color-border-strong);
  background: var(--color-surface-2); font-style: italic; font-weight: 700; font-size: 13px; color: var(--color-text-muted); }
.ed-menue-knopf { width: 38px; height: 34px; border-radius: 9px; background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong); font-size: 17px; font-weight: 700; letter-spacing: .04em; }

/* Popovers an der Kopfzeile (⋯-Menü, ⓘ-Hinweis, Raster-Stepper) */
.ed-pop { position: absolute; top: calc(100% - 1px); right: var(--space-5); z-index: 40; min-width: 260px;
  background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: 12px;
  box-shadow: 0 12px 34px oklch(0.2 0.02 260 / .18); padding: 8px; }
.ed-pop-menue { display: flex; flex-direction: column; }
.ed-pop-menue button { text-align: left; padding: 9px 12px; border-radius: 8px; font-size: var(--text-sm); font-weight: 500; }
.ed-pop-menue button:hover { background: var(--color-surface-2); }
.ed-pop-menue button.gefaehrlich { color: var(--color-danger, #b3261e); font-weight: 600; }
.ed-menue-trenn { height: 1px; background: var(--color-border); margin: 6px 4px; }
.ed-pop-raster { display: flex; flex-direction: column; gap: 10px; padding: 14px; min-width: 300px; }
.ed-pop-hinweis { max-width: 380px; padding: 14px 16px; font-size: 13px; color: var(--color-text-muted); display: flex; flex-direction: column; gap: 8px; }
.ed-pop-hinweis b { color: var(--color-text); }
.dim { display: inline-flex; align-items: center; gap: 6px; }
.dim button { width: 30px; height: 30px; border-radius: 8px; background: var(--color-surface); border: 1px solid var(--color-border-strong); font-weight: 700; font-size: 16px; }
.dim button:disabled { opacity: .35; }
.dim b { min-width: 20px; text-align: center; }
.ed-pop .faint { font-size: 12px; color: var(--color-text-faint); }

/* Modals des Editors (kopieren, Gerätetasten, Versionen) */
.ed-modal-bereich { position: relative; }
.ed-modal-overlay { position: fixed; inset: 0; z-index: 60; background: oklch(0.2 0.02 260 / .45);
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; }
.ed-modal { width: min(560px, 100%); background: var(--color-surface); border: 1px solid var(--color-border-strong);
  border-radius: 14px; box-shadow: 0 18px 50px oklch(0.2 0.02 260 / .25); }
.ed-modal-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: var(--space-4) var(--space-5) var(--space-3); border-bottom: 1px solid var(--color-border); }
.ed-modal-kopf h3 { font-size: var(--text-lg); font-weight: 600; }
.ed-modal-kopf button { width: 30px; height: 30px; border-radius: 8px; background: var(--color-surface-2); font-size: 14px; }
.ed-modal-koerper { padding: var(--space-4) var(--space-5) var(--space-5); max-height: 60vh; overflow: auto;
  display: flex; flex-direction: column; gap: 10px; }
.ed-kopie-ziel { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--color-border); background: var(--color-surface-2); }
.ed-kopie-ziel:hover { border-color: var(--color-border-strong); }
.ed-kopie-ziel small { display: block; color: var(--color-text-faint); font-size: 12px; margin-top: 2px; }
.ed-geraet { border: 1px solid var(--color-border); border-radius: 10px; padding: 10px 12px; }
.ed-geraet h4 { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ed-geraet-zeile { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 0; font-size: 13px; border-top: 1px solid var(--color-border); }
.ed-geraet-zeile:first-of-type { border-top: none; }
.ed-grid {
  min-width: 0;
  display: grid; gap: 5px; padding: 8px; min-height: 340px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); position: relative;
}
.cell { border-radius: 10px; border: 1.5px dashed var(--color-border); }
.cell.over { border-color: var(--orange); background: oklch(from var(--orange) l c h / 0.10); }
.ed-grid .tile { cursor: grab; z-index: 1; user-select: none; }
.ed-grid .tile.sel { outline: 3px solid var(--orange); outline-offset: 2px; }
.ed-grid .tile.dragging { opacity: .4; }
.ed-props { background: var(--color-surface); border-left: 1px solid var(--color-border); padding: var(--space-4); gap: 12px; overflow: auto; }
.prop { display: flex; flex-direction: column; gap: 6px; }
.prop label { font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .05em; }
.prop input[type='text'], .prop input[type='number'] { width: 100%; height: 42px; border-radius: 10px; padding: 0 12px; background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text); font-size: var(--text-sm); }
.swatches { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.swatches button { height: 26px; border-radius: 7px; background: var(--sw); box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.12); }
.swatches button[aria-current='true'] { outline: 3px solid var(--orange); outline-offset: 2px; }
/* Regler und Hex-Feld unter den Grundfarben (Paket 2) */
.farbe-werkzeuge { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.farbe-werkzeuge input[type='range'] { flex: 1; accent-color: var(--orange); height: 26px; }
.hex-feld { width: 92px; height: 30px; border-radius: 8px; padding: 0 10px; background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text); font-size: var(--text-sm); font-family: var(--font-mono, monospace); }
.prop .seg { display: flex; }
.prop .seg button { flex: 1; padding: 8px 6px; }
.prop-hint { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: 6px; line-height: 1.4; }
.versions { display: flex; flex-direction: column; gap: 6px; }
.ver { display: flex; justify-content: space-between; gap: 8px; font-size: var(--text-xs); padding: 8px 10px; border-radius: 8px; background: var(--color-surface-2); }
.ver b { font-weight: 600; color: var(--color-text); }
.ed-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ed-actions .btn-primary { grid-column: 1 / -1; }
.ed-actions .btn { min-height: 42px; font-size: var(--text-sm); }
.empty-props { color: var(--color-text-faint); font-size: var(--text-sm); line-height: 1.5; }
.divider { height: 1px; background: var(--color-border); margin: 2px 0; }
.fo-note { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: oklch(0.70 0.175 48 / 0.12); border: 1px solid oklch(0.70 0.175 48 / 0.4); font-size: 13px; flex-wrap: wrap; }
.tile.fo-mark { box-shadow: 0 0 0 3px var(--orange), inset 0 0 0 2px white; cursor: pointer; }
.tile.fo-mark::after { content: 'Kasse'; position: absolute; bottom: 4px; right: 4px; font-size: 10px; font-weight: 700; background: var(--orange); color: var(--orange-ink); padding: 1px 6px; border-radius: 6px; }
.fo-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--orange); font-size: 14px; }
.fo-card span { font-size: 12.5px; color: var(--color-text-muted); }

/* Kassen-Tasten (Editor/Vorschau) – Schrift wie im Prototyp: Raster-Taste 13 px,
   Tastentext 11 px auf max. 2 Zeilen, keine Silbentrennung im Wort (Paket 2):
   Wörter bleiben ganz, Ellipse nur am Ende. Preis 11 px in einer Zeile. */
.tile {
  border-radius: 10px; padding: 8px 10px; text-align: left; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2px;
  color: var(--tile-fg, #111); font-weight: 600; font-size: 12.5px; line-height: 1.2;
  background: var(--tile, #c9d0d6); box-shadow: inset 0 0 0 1px oklch(0 0 0 / 0.06);
}
.tile .t-label {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  hyphens: none; -webkit-hyphens: none; overflow-wrap: break-word; word-break: normal; min-width: 0;
}
.tile .t-foot { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 11px; white-space: nowrap; }
.tile .price { font-size: 11px; font-weight: 500; opacity: .85; white-space: nowrap; }
.tile.is-group { box-shadow: inset 0 0 0 2px oklch(0 0 0 / 0.10); }
.tile.is-fn { align-items: center; justify-content: center; text-align: center; gap: 4px; font-size: 12px; }
.ed-grid .tile { font-size: 13px; padding: 6px 7px; }
.ed-grid .tile .t-label { font-size: 11px; line-height: 1.15; }
.ed-grid .tile .price { font-size: 11px; }
.tile .rs { position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; border-radius: 5px 0 8px 0; background: var(--orange); cursor: nwse-resize; z-index: 3; box-shadow: 0 0 0 2px white; }
.vorschau-hinweis { padding: 10px 14px; border-radius: 12px; background: oklch(from var(--orange) l c h / 0.14); border: 1px solid oklch(from var(--orange) l c h / 0.4); font-size: 13.5px; }

/* ---------- Responsiv ---------- */
@media (max-width: 1279px) {
  .editor { grid-template-columns: 230px minmax(0, 1fr) 270px; }
}

/* Unter 1100 px: Seitenleiste klappt auf Symbole zusammen (Titel als Tooltip),
   ☰ klapppt sie als Overlay aus. */
@media (max-width: 1099px) {
  .burger { display: block; }
  .bo:not(.sl-auf) .seitenleiste { width: 64px; padding: 12px 8px 10px; }
  .bo:not(.sl-auf) .sl-logo { justify-content: center; padding-left: 0; padding-right: 0; }
  .bo:not(.sl-auf) .sl-standort, .bo:not(.sl-auf) .sl-standorte,
  .bo:not(.sl-auf) .sl-titel, .bo:not(.sl-auf) .sl-label,
  .bo:not(.sl-auf) .sl-pfeil, .bo:not(.sl-auf) .sl-badge,
  .bo:not(.sl-auf) .sl-user-text, .bo:not(.sl-auf) .sl-unter { display: none; }
  .bo:not(.sl-auf) .sl-eintrag, .bo:not(.sl-auf) .sl-user,
  .bo:not(.sl-auf) .sl-abmelden { justify-content: center; padding-left: 0; padding-right: 0; }
  .bo.sl-auf .seitenleiste {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
    box-shadow: 0 0 48px oklch(0 0 0 / 0.4);
  }
}

/* Unter 1024 px (gestapelte Spalten): normaler Seiten-Scroll statt Fensterhöhe */
@media (max-width: 1023px) {
  body.editor-offen { overflow: auto; }
  body.editor-offen .bo { height: auto; min-height: 100dvh; }
  body.editor-offen .bo-body { overflow: visible; }
  .bo-split { flex-direction: column; }
  .bo-side { width: 100%; max-height: none; position: static; }
  .bo-kpis { grid-template-columns: repeat(2, 1fr); }
  .bo-cols, .bo-cols-wide { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; }
  .ed-lib { border-right: none; border-bottom: 1px solid var(--color-border); max-height: 260px; }
  .ed-props { border-left: none; border-top: 1px solid var(--color-border); max-height: none; }
  .bo-scroll { max-height: none; }
  /* Abo-Rechnungen: Tabellen auf Mobil horizontal scrollbar (keine Abschneidung) */
  .bo-table { min-width: 540px; }
}

/* Zwischen 1024 und 1400 px: Neben- und zweispaltige Layouts untereinander,
   damit Tabellen neben der Seitenleiste nicht rechts abgeschnitten werden */
@media (min-width: 1024px) and (max-width: 1399px) {
  .bo-split { flex-direction: column; }
  .bo-side { width: 100%; max-height: none; position: static; }
  .bo-cols, .bo-cols-wide { grid-template-columns: 1fr; }
  .bo-zwei, .bo-zwei-w { grid-template-columns: 1fr; }
}

/* Paket 2: Tastentexte maximal 2 Zeilen (statt 3), damit Titel und Preis
   nicht übereinander liegen; Silbentrennung aus, Ellipse am Ende. */
.tile .t-label { -webkit-line-clamp: 2; overflow-wrap: break-word; word-break: normal; hyphens: none; -webkit-hyphens: none; }
.ed-grid .tile .t-label { font-size: 10px; line-height: 1.15; }
.tile.is-fn .t-label { -webkit-line-clamp: 2; }

/* Artikelmaske (Paket 2): Formularspalte breiter, damit die Preiszeile
   VK | EK | Personal auf einer Linie Platz hat. */
.bo-split.artikel-seite .bo-side { width: 460px; }
/* ---------- Artikelmaske (Paket 2) ---------- */
/* Block-Überschriften/Labels in der rechten Spalte */
.bo-f-label { display: block; font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
/* Preiszeile: VK | EK | Personalpreis auf einer Linie */
.bo-preiszeile { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 6px; }
/* VK | EK | Personal auf einer Linie (Paket 2); erst auf schmalen
   Bildschirmen bricht der Personalpreis in die zweite Zeile. */
@media (max-width: 1150px) { .bo-preiszeile { grid-template-columns: 1fr 1fr; } .bo-preiszeile .personal-feld { grid-column: 1 / -1; } }
/* Automatischer Personal-Preis: grau mit ✎; eigener Preis schwarz mit ↺ */
.personal-zeile { position: relative; display: flex; align-items: center; }
.personal-zeile .fg-knopf { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--navy, #1b2a41); cursor: pointer; padding: 4px 8px; font-size: 14px; }
.personal-zeile input { padding-right: 32px; }
.personal-zeile input { flex: 1; min-width: 0; }
.personal-zeile input::-webkit-outer-spin-button, .personal-zeile input::-webkit-inner-spin-button { display: none; }
.personal-zeile input.auto { color: var(--color-text-muted); background: var(--color-surface-3); }
.fg-knopf { flex: none; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--color-border); background: var(--color-surface-2); color: var(--color-text-muted); font-size: 15px; cursor: pointer; display: grid; place-items: center; }
.fg-knopf:hover { color: var(--color-text); border-color: var(--color-border-strong); }
.fg-hinweis { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--color-text-faint); }
/* Barcode-Chips: Eingabefeld mit entnehmbaren Chips */
.chips-feld { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 42px; padding: 5px 10px; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 10px; }
.chips-feld:focus-within { border-color: var(--orange); }
.barcode-chip { display: inline-flex; align-items: center; gap: 5px; }
.barcode-chip button { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: oklch(0 0 0 / 0.08); color: inherit; font-size: 12px; line-height: 1; cursor: pointer; }
.barcode-eingabe { flex: 1; min-width: 120px; border: none; background: transparent; color: var(--color-text); font-size: var(--text-sm); outline: none; height: 30px; }
/* «Erhältlich in»: eine Zeile, Chips je Box */
.box-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.box-chips button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--color-border-strong); background: var(--color-surface-2); color: var(--color-text); font-size: var(--text-sm); font-weight: 600; cursor: pointer; }
.box-chips button { padding: 5px 12px; background: #e8eef6; border-color: #c9d6e6; color: var(--navy, #1b2a41); }
.box-chips button .chk { font-size: 12px; }
.box-chips button.aus .chk { display: none; }
.box-chips button.aus { background: transparent; color: var(--color-text-faint); text-decoration: line-through; border-style: dashed; }

/* ---------- Einstellungen / Krankenkassen-Belege: Karten-Bausteine (bo-) ----------
   Übernommen aus den freigegebenen Entwürfen: Karte mit Kopf (Titel links,
   Status-Punkt rechts), Zeilen «Bezeichnung links (mit Erklärung), Feld rechts»,
   Fusszeile mit Speichern rechts, technische Angaben eingeklappt. Navy #1d3a5f,
   Orange nur als Hinweis. Präfix bo-, kein Konflikt mit .st (Standort-Pillen). */

.bo-set { max-width: 900px; display: flex; flex-direction: column; gap: 16px; }
.bo-set-titel { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.bo-set-titel h1 { font-size: 21px; font-weight: 700; }
.bo-set-titel p { font-size: 14px; color: var(--color-text-muted); margin-top: 2px; max-width: 60ch; }
.bo-boxwahl { display: inline-flex; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.bo-boxwahl button { padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--color-text-muted); white-space: nowrap; }
.bo-boxwahl button:hover { color: var(--color-text); }
.bo-boxwahl button.akt { background: #1d3a5f; color: #fff; font-weight: 600; }

/* Karte */
.bo-k { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; }
.bo-k-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--color-border); flex-wrap: wrap; }
.bo-k-kopf h2 { font-size: 16px; font-weight: 600; }
.bo-k-kopf .bo-unter { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }
.bo-k-inhalt { display: flex; flex-direction: column; }
.bo-k-fuss { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--color-border); background: var(--color-surface-2); border-radius: 0 0 12px 12px; flex-wrap: wrap; }
.bo-k-fuss .rechts { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }

/* Status-Punkt: grün verbunden, orange Hinweis, grau neutral */
.bo-stat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--color-text-muted); white-space: nowrap; }
.bo-stat::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--color-text-faint); flex: none; }
.bo-stat.ok::before { background: var(--green); }
.bo-stat.ok { color: #2d6a45; }
.bo-stat.hin::before { background: var(--orange); }
.bo-stat.hin { color: #8a4b12; }

/* Zeile: Bezeichnung links (mit kleiner Erklärung), Feld rechts */
.bo-z { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--color-border); align-items: center; }
.bo-z:last-of-type { border-bottom: 0; }
.bo-z .l { font-size: 14.5px; font-weight: 500; }
.bo-z .l small { display: block; font-size: 13px; font-weight: 400; color: var(--color-text-muted); line-height: 1.4; margin-top: 2px; }
.bo-eingabe { height: 38px; border: 1px solid var(--color-border-strong); border-radius: 8px; padding: 0 12px; font-size: 14.5px; color: var(--color-text); background: #fff; width: 100%; max-width: 420px; min-width: 0; }
.bo-eingabe-kurz { max-width: 110px; }
.bo-einheit { display: flex; align-items: center; gap: 10px; max-width: 420px; }
.bo-einheit .bo-eingabe { max-width: 90px; flex: none; }
.bo-einheit .e { font-size: 14px; color: var(--color-text-muted); white-space: nowrap; }
textarea.bo-eingabe { height: auto; min-height: 110px; align-items: flex-start; padding: 9px 12px; line-height: 1.5; max-width: none; white-space: pre-line; }
select.bo-eingabe { max-width: 200px; }

/* Ein/Aus-Schalter statt Checkbox */
.bo-swz { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--color-text-muted); }
.bo-swz input { position: absolute; opacity: 0; pointer-events: none; }
.bo-sw { width: 40px; height: 22px; border-radius: 11px; background: var(--color-surface-3); position: relative; flex: none; transition: background var(--transition-interactive); cursor: pointer; }
.bo-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: left var(--transition-interactive); }
.bo-swz input:checked ~ .bo-sw { background: #1d3a5f; }
.bo-swz input:checked ~ .bo-sw::after { left: 21px; }
.bo-swz input:focus-visible ~ .bo-sw { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.bo-swz .an { color: #1d3a5f; font-weight: 600; }
.bo-swz .aus { color: var(--color-text-faint); }

/* Technische Angaben eingeklappt */
.bo-tech { border-top: 1px solid var(--color-border); }
.bo-tech summary { padding: 10px 18px; font-size: 13.5px; color: var(--color-text-muted); cursor: pointer; user-select: none; }
.bo-tech summary::before { content: '›'; display: inline-block; margin-right: 8px; color: var(--color-text-faint); transition: transform var(--transition-interactive); }
.bo-tech[open] summary::before { transform: rotate(90deg); }
.bo-tech-inhalt { padding: 0 18px 14px; display: flex; flex-direction: column; gap: 12px; }

/* Oranger Hinweis-Kasten */
.bo-hin-box { background: #fdf3e8; border-left: 3px solid var(--orange); border-radius: 6px; padding: 10px 14px; font-size: 14px; color: #7c4a17; }

/* Tabelle in Karten (Ziffern, Klassentypen) */
.bo-tab2 { width: 100%; font-size: 14px; }
.bo-tab2 th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 18px; border-bottom: 1px solid var(--color-border); white-space: nowrap; }
.bo-tab2 td { padding: 9px 18px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.bo-tab2 tr:last-child td { border-bottom: 0; }
.bo-tab2 td.akt { text-align: right; white-space: nowrap; }
.bo-tab2 td.akt .btn + .btn { margin-left: 6px; }
.bo-tab2 .bo-eingabe { height: 32px; max-width: 90px; }

/* Kennzahlen (4 Spalten), Zu-erledigen orange hinterlegt */
.bo-kz { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.bo-kz > div { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 12px 16px; }
.bo-kz b { display: block; font-size: 24px; font-weight: 700; color: #1d3a5f; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bo-kz span { font-size: 13px; color: var(--color-text-muted); }
.bo-kz > div.or { border-color: #f0c79c; background: #fdf6ee; }
.bo-kz > div.or b { color: #b35f12; }

/* Suchfeld und rechte Kopf-Gruppe */
.bo-such { height: 36px; width: 240px; border: 1px solid var(--color-border-strong); border-radius: 8px; padding: 0 12px; font-size: 14px; color: var(--color-text); background: #fff; }
.bo-kopfr { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Detailansicht: Angaben links (380px), Belege rechts */
.bo-zwei { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; align-items: start; }
.bo-zwei-w { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
@media (min-width: 1024px) and (max-width: 1399px) { .bo-zwei-w { grid-template-columns: 1fr; } }
.bo-ang .bo-z { grid-template-columns: 130px minmax(0, 1fr); padding: 9px 18px; }
.bo-ang .bo-z .w { font-size: 14.5px; overflow-wrap: anywhere; }
/* Fusszeile Angaben: beide Knöpfe auf einer Zeile, kein Umbruch */
.bo-ang-fuss { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--color-border); background: var(--color-surface-2); border-radius: 0 0 12px 12px; white-space: nowrap; }

@media (max-width: 1023px) {
  .bo-zwei, .bo-zwei-w { grid-template-columns: 1fr; }
  .bo-z { grid-template-columns: 1fr; gap: 8px; }
  .bo-kz { grid-template-columns: repeat(2, 1fr); }
  .bo-ang-fuss { flex-wrap: wrap; white-space: normal; }
  .bo-such { width: 100%; }
}

/* Erhältlich-Spalte: kleine Badges OE / LY / LT */
.badge-box { display: inline-block; min-width: 26px; text-align: center; padding: 1px 5px; margin-right: 3px; border-radius: 6px; background: var(--color-surface-3); border: 1px solid var(--color-border); font-size: 11px; font-weight: 700; letter-spacing: .03em; }
/* «Besonderes Verhalten»: standardmässig zugeklappt */
.bo-details { border: 1px solid var(--color-border); border-radius: 10px; padding: 10px 12px; background: var(--color-surface-2); }
.bo-details summary { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); cursor: pointer; }
.bo-details[open] summary { margin-bottom: 8px; }
.bo-details-inhalt { display: flex; flex-direction: column; gap: 10px; }
/* Editor: Tastentext max. 2 Zeilen, keine Silbentrennung */
.ed-grid .tile { overflow: hidden; padding: 4px 5px; }
.ed-grid .tile .t-label { font-size: 10px; line-height: 1.15; hyphens: none; word-break: normal; overflow-wrap: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ed-grid .tile .t-foot, .ed-grid .tile .price { font-size: 9.5px; }
/* Editor: Raster über die volle Breite, «Taste bearbeiten» darunter (mehr Platz für 16 Spalten).
   Beide Zeilen sind begrenzt: Das Raster scrollt intern (ed-grid-bereich), damit
   «Taste bearbeiten» nie vom Bildschirm geschoben oder abgeschnitten wird. */
.editor { grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(180px, 42%); }
.editor > .ed-lib { grid-column: 1; grid-row: 1 / span 2; }
.editor > .ed-center { grid-column: 2; grid-row: 1; overflow: hidden; padding-bottom: 8px; min-height: 0; }
.editor > .ed-center .ed-grid-bereich { flex: 1 1 0; min-height: 0; overflow: auto; }
.editor > .ed-props { grid-column: 2; grid-row: 2; border-left: 0; border-top: 1px solid var(--color-border); overflow: auto; }
.ed-grid { min-height: 0; }
@media (max-width: 1279px) { .editor { grid-template-columns: 220px minmax(0, 1fr); } }
.bo-tab2 td.nw, .bo-tab2 th.nw { white-space: nowrap; }
.bo-wert { font-size: 14.5px; color: var(--color-text); }
.bo-fuss-text { font-size: 13px; color: var(--color-text-muted); }
/* Zeilenzustände in bo-tab2 (ehemals .bo-table): Auswahl, inaktiv, storniert,
   negativer Bestand, Zwischenüberschriften, klickbare Zeilen */
.bo-tab2.hover tbody tr { cursor: pointer; }
.bo-tab2.hover tbody tr:hover { background: oklch(0.97 0.01 260); }
.bo-tab2 tbody tr[data-act="sel"] { cursor: pointer; }
.bo-tab2 tbody tr[data-act="sel"]:hover { background: oklch(0.97 0.01 260); }
.bo-tab2 tr.sel td { background: oklch(from var(--orange) l c h / 0.12); }
.bo-tab2 tr.off td { color: var(--color-text-muted); }
.bo-tab2 tr.void td { background: oklch(from var(--red) l c h / 0.06); }
.bo-tab2 .neg { color: var(--red); font-weight: 700; }
.bo-tab2 tr.sub-h td { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); background: oklch(0.975 0.004 260); }
/* Farb-Vorschau in der Artikelgruppen-Tabelle */
.farb-punkt { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; border: 1px solid oklch(0 0 0 / 0.15); }
.bo-set-titel { max-width: 900px; margin-bottom: 16px; }

/* Formularfelder im Modal (Benutzer bearbeiten) */
.bo-feld { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.bo-feld > span { font-size: 13.5px; font-weight: 600; color: var(--color-text); }
.bo-feld small { font-weight: 400; color: var(--color-text-muted, #6b7280); margin-left: 4px; }
.bo-feld input[type="checkbox"] { margin-right: 6px; vertical-align: -2px; }
#bb-fehler:empty { display: none; }

/* ---------- Listen (Paket A): Suche links, Filter rechts, Seitenwechsel ---------- */

/* Kopfzeile über der Liste: Suchfeld überall gleich gross, links; Filter rechts. */
.bo-liste-kopf { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bo-liste-kopf .bo-such { width: 260px; max-width: 100%; }
.bo-liste-filter { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Sortierbare Spaltenüberschriften: Pfeil zeigt Spalte und Richtung. */
.bo-tab2 th[data-sort] { cursor: pointer; user-select: none; }
.bo-tab2 th[data-sort]:hover { color: var(--color-text); }
.sort-pfeil { margin-left: 5px; font-size: 9px; opacity: .45; }
.bo-tab2 th[aria-sort] .sort-pfeil { opacity: 1; color: var(--color-text); }

/* Fusszeile: Zeilenzahl links, Seitenwechsel und Seitengrösse rechts. */
.bo-liste-fuss { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--color-border); background: var(--color-surface-2); border-radius: 0 0 12px 12px; flex-wrap: wrap; }
.bo-seiten { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.bo-seiten button { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--color-border-strong); border-radius: 8px; background: var(--color-surface); color: var(--color-text); font-size: 13px; font-weight: 500; cursor: pointer; }
.bo-seiten button:hover:not(:disabled) { background: var(--color-surface-2); }
.bo-seiten button.akt { background: #1d3a5f; border-color: #1d3a5f; color: #fff; font-weight: 600; }
.bo-seiten button:disabled { opacity: .4; cursor: default; }
.bo-seitengroesse { height: 30px; border: 1px solid var(--color-border-strong); border-radius: 8px; background: var(--color-surface); color: var(--color-text); font-size: 13px; padding: 0 6px; cursor: pointer; }

/* Auswahl-Kästchen der Krankenkassen-Belege (Paket A5, ZIP-Auswahl) */
.bo-tab2 th.kk-check, .bo-tab2 td.kk-check { width: 34px; padding-left: 12px; padding-right: 0; }
.bo-tab2 .kk-check input { width: 16px; height: 16px; cursor: pointer; }

/* Paket A7: Reiter der Bibliothek (Artikel | Gruppen | Funktionen) in einer Zeile */
.lib-tabs { display: flex; width: 100%; flex-wrap: nowrap; box-sizing: border-box; }
.lib-tabs button { flex: 1 1 auto; min-width: 0; padding: 7px 6px; font-size: 12.5px; white-space: nowrap; }

/* Zusatz Paket A (Editor): Tastennamen auf max. 2 Zeilen mit Ellipsis kürzen,
   Preis darunter ohne Überlappung – Label schrumpft, Preis bleibt sichtbar */
.tile .t-label { flex: 1 1 0; min-height: 0; }
.tile .t-foot { flex: none; }

/* Schwebende gezogene Taste (A8): leicht geneigt, mit Schatten; das kleine
   rote Abfall-Symbol sitzt oben rechts an der Taste (rund, weisses Icon). */
.ed-geist { position: fixed; width: 120px; height: 66px; z-index: 9999; pointer-events: none; transform: rotate(-3deg); box-shadow: 0 10px 24px oklch(0 0 0 / 0.28); }
.ed-muell {
  position: absolute; top: -11px; right: -11px; width: 30px; height: 30px; border-radius: 999px;
  background: #d64545; color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px oklch(0 0 0 / 0.35);
}

/* A8 (Editor): gezogene Taste am alten Platz mit gestrichenem Rahmen */
.ed-grid .tile.dragging { opacity: .4; outline: 2px dashed #d64545; outline-offset: 2px; }

/* ---------- C6: Inventur, handytauglich (grosse Felder, Touch) ---------- */
.inv-eingabe {
  font-size: 18px;
  padding: 10px 12px;
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%;
  box-sizing: border-box;
}
select.inv-eingabe { padding-right: 28px; }
.inv-f {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  flex: 1;
  min-width: 120px;
}
.inv-k .bo-k-inhalt { padding: 0; }
@media (max-width: 640px) {
  .inv-k { margin: 0 -14px; border-radius: 0; }
  .inv-eingabe { font-size: 19px; }
}
