/* 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;
}
.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-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bo-tools .search { flex: 1; max-width: 420px; min-width: 200px; }
.bo-tools .selbox { width: 220px; }
.bo-scroll { overflow: auto; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; max-height: 62dvh; }
.bo-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.bo-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); padding: 10px 12px; border-bottom: 1px solid var(--color-border); position: sticky; top: 0; background: var(--color-surface); z-index: 1; }
.bo-table td { padding: 9px 12px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.bo-table.hover tbody tr { cursor: pointer; }
.bo-table.hover tbody tr:hover { background: oklch(0.97 0.01 260); }
.bo-table tr.sel { background: oklch(from var(--orange) l c h / 0.12) !important; }
.bo-table tr.off td { color: var(--color-text-muted); }
.bo-table tr.void td { text-decoration: line-through; color: var(--color-text-muted); }
.bo-table tr.void td:last-child { text-decoration: none; }
.bo-table .neg { color: var(--red); font-weight: 700; }
.bo-table td.nw, .bo-table th.nw { white-space: nowrap; }
.bo-table 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); }
.bo-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.bo-kpi { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.bo-kpi span { font-size: 13px; color: var(--color-text-muted); }
.bo-kpi b { font-size: 24px; font-variant-numeric: tabular-nums; }
.bo-kpi.warn b { color: oklch(0.55 0.13 60); }
.bo-kpi small { font-size: 12px; color: var(--color-text-faint); }
.bo-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.bo-cols-wide { grid-template-columns: 1.6fr 1fr; }
.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-inline { 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-inline { width: 90px; padding: 5px 8px; }
.bo-inline.acc { width: 80px; font-family: ui-monospace, monospace; }
.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; }
.bo-check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.bo-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.bo-kv { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; border-bottom: 1px dashed var(--color-border); gap: 12px; }
.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; }
.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-subnav { flex: none; display: flex; align-items: center; gap: 14px; padding: 10px 26px; background: var(--color-surface); border-bottom: 1px solid var(--color-border); flex-wrap: wrap; }
.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; }
.ed-kopieren { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-muted); }
.ed-kopieren label { white-space: nowrap; }
.ed-kopieren .selbox { min-width: 150px; }
.ed-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px 10px; flex-wrap: wrap; }
.ed-toolbar .seg button { padding: 7px 10px; white-space: nowrap; }
.ed-toolbar .ed-kopieren { flex-wrap: nowrap; }
.ed-info { font-size: var(--text-sm); color: var(--color-text-muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ed-dims { display: flex; align-items: center; gap: 14px; font-size: 13px; flex-wrap: wrap; }
.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-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(10, 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; }
.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.5 px auf max. 2 Zeilen mit Silbentrennung, 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, white); font-weight: 600; font-size: 12.5px; line-height: 1.2;
  background: var(--tile, var(--navy-600)); 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: auto; -webkit-hyphens: auto; overflow-wrap: break-word; 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: 11.5px; }
.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; }
}

/* 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; }
}

/* Nachbesserung: Tastentexte bis 3 Zeilen, damit z. B. «Coca-Cola Zero» und «Position löschen» ganz lesbar sind */
.tile .t-label { -webkit-line-clamp: 3; overflow-wrap: normal; word-break: normal; }
.ed-grid .tile .t-label { font-size: 11px; line-height: 1.15; }
.tile.is-fn .t-label { -webkit-line-clamp: 3; }
