/* ════════════════════════════════════════════════════════════════
   Raumplan-Editor (#24) — seated-events venue editor.
   Uses the app's real design tokens (redesign.css): --accent, --ink,
   --ink-2/3, --line, --line-2, --card, --field, --hover, --r-*, --shadow*,
   --grid-line, Plus Jakarta Sans. Inherits the active theme (mono/purple/dark).
   ════════════════════════════════════════════════════════════════ */

#saalplan-topbar-actions { display: flex; align-items: center; gap: 8px; }

/* empty states */
#saalplan-root .sp-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 60px 20px; text-align: center; color: var(--ink-2);
}
#saalplan-root .sp-empty p { margin: 0; max-width: 340px; color: var(--ink-2); }
.sp-empty-ic {
  width: 46px; height: 46px; border-radius: var(--r-ctl); display: grid; place-items: center;
  background: var(--hover); color: var(--ink-2); margin-bottom: 4px;
}

/* ── venue picker ─────────────────────────────────────────── */
.sp-vp { margin-bottom: 18px; max-width: 380px; }
.sp-vp-label { display: block; font-size: var(--fs-xs); letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 7px; font-weight: 600; }
.sp-vp-control { position: relative; }
.sp-vp-trigger {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--card); cursor: pointer; text-align: left; box-shadow: var(--shadow);
}
.sp-vp-trigger:hover { border-color: var(--line-2); }
.sp-vp-ic, .sp-vp-ic-sm {
  width: 38px; height: 38px; border-radius: var(--r-ctl); display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); flex: 0 0 auto;
}
.sp-vp-ic-sm { width: 30px; height: 30px; border-radius: var(--r-chip); }
.sp-vp-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sp-vp-name { font-weight: 700; font-size: var(--fs-h2); color: var(--ink); }
.sp-vp-meta { font-size: var(--fs-sm); color: var(--ink-2); }
.sp-vp-chev { color: var(--ink-3); display: grid; place-items: center; }
.sp-vp-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow-lg); padding: 6px;
}
.sp-vp-menu-h { font-size: var(--fs-xs); color: var(--ink-3); padding: 8px 10px 4px; }
.sp-vp-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: none; background: none; border-radius: var(--r-chip); cursor: pointer; text-align: left; color: var(--ink); }
.sp-vp-item:hover, .sp-vp-item.active { background: var(--hover); }
.sp-vp-item-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sp-vp-item-name { font-weight: 600; font-size: var(--fs-body); }
.sp-vp-foot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.sp-vp-mi { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; background: none; border-radius: var(--r-chip); cursor: pointer; font-size: var(--fs-sm); color: var(--ink); }
.sp-vp-mi:hover { background: var(--hover); }
.sp-vp-create { color: var(--accent); }
.sp-vp-del { color: var(--danger); }

/* ── area tabs (carded to match the venue picker + toolbar) ── */
.sp-areas {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px; border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--card); box-shadow: var(--shadow); margin-bottom: 14px;
}
.sp-areatab {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer; color: var(--ink); font-family: inherit;
}
.sp-areatab:hover { background: var(--hover); }
.sp-areatab.active { background: var(--ink); border-color: var(--ink); color: var(--card); }
.sp-areaadd { border-style: dashed; font-weight: 500; color: var(--ink-2); }

/* ── editor grid ──────────────────────────────────────────── */
.sp-grid { display: grid; grid-template-columns: 1fr 324px; gap: var(--gap); align-items: start; }
@media (max-width: 1000px) { .sp-grid { grid-template-columns: 1fr; } }

/* toolbar (horizontal, icon + label) */
.sp-toolbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 6px; border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--card); margin-bottom: 14px; box-shadow: var(--shadow);
}
.sp-tool {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px;
  border: none; background: none; border-radius: var(--r-ctl); cursor: pointer;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink); font-family: inherit;
}
.sp-tool:hover { background: var(--hover); }
.sp-tool.active { background: var(--ink); color: var(--card); }
.sp-tool-danger.active { background: var(--danger); color: #fff; }
.sp-tool svg { flex: 0 0 auto; }

/* paint bar */
.sp-paintbar { display: none; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sp-paint-l { font-size: var(--fs-sm); color: var(--ink-2); }
.sp-zchip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer; color: var(--ink); font-family: inherit;
}
.sp-zchip.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.sp-zdot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

/* canvas — sized to fill the remaining viewport so the editor fits on one
   screen (no page scroll); the chrome above it is ~320px. */
.sp-canvas {
  position: relative; min-height: 360px; height: calc(100vh - 360px);
  border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden;
  background:
    radial-gradient(var(--grid-line) 1.1px, transparent 1.1px) 0 0 / 22px 22px,
    var(--field);
}
.sp-canvas.sp-placing { cursor: crosshair; }
.sp-canvas.sp-painting { cursor: copy; }
.sp-canvas.sp-deleting { cursor: not-allowed; }
.sp-canvas-hint { position: absolute; left: 14px; bottom: 12px; font-size: var(--fs-sm); color: var(--ink-3); pointer-events: none; }

/* placed nodes */
.sp-node { position: absolute; user-select: none; }
.sp-tool-select .sp-node { cursor: grab; }
.sp-node.sp-dragging { cursor: grabbing; z-index: 6; }
.sp-node.sp-sel { z-index: 5; }
.sp-node.sp-sel .sp-table,
.sp-node.sp-sel .sp-chair,
.sp-node.sp-sel .sp-decor { box-shadow: 0 0 0 2px var(--accent), var(--shadow-lg); }

.sp-table {
  position: relative; width: 56px; height: 56px; border-radius: var(--r-card); border: 2px solid;
  display: grid; place-items: center;
}
.sp-table-lbl { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); line-height: 1; }
.sp-table-seats { font-size: 9px; color: var(--ink-2); font-weight: 600; }
.sp-seatdot { position: absolute; width: 10px; height: 10px; border-radius: 50%; border: 2px solid; background: var(--card); }

.sp-chair {
  width: 30px; height: 30px; border-radius: var(--r-chip); border: 2px solid;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
}

.sp-decor {
  border: 1px dashed var(--line-2); border-radius: var(--r-chip); display: grid; place-items: center;
  font-size: 10px; color: var(--ink-2);
  background: var(--hover-2);
}
.sp-decor.sp-stage {
  border: none; background: var(--ink); color: var(--card);
  font-weight: 800; letter-spacing: 0.16em; font-size: var(--fs-sm); border-radius: var(--r-ctl);
}

/* ── right panel ──────────────────────────────────────────── */
.sp-panel { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); padding: var(--pad-card); position: sticky; top: 12px; box-shadow: var(--shadow); }
.sp-seg { display: flex; gap: 4px; padding: 4px; background: var(--hover-2); border-radius: var(--r-ctl); margin-bottom: 16px; }
.sp-seg-i { flex: 1; padding: 8px; border: none; background: none; border-radius: var(--r-chip); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; color: var(--ink-2); font-family: inherit; }
.sp-seg-i.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.sp-seg-sm { margin-bottom: 0; }

.sp-empty-insp { text-align: center; padding: 28px 8px; color: var(--ink-2); }
.sp-empty-insp p { margin: 6px 0 0; font-size: var(--fs-sm); }
.sp-empty-insp .sp-empty-ic { margin: 0 auto 8px; }

.sp-insp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sp-insp-type { font-weight: 700; font-size: var(--fs-body); }
.sp-quiet { display: inline-flex; align-items: center; gap: 5px; border: none; background: none; color: var(--ink-2); font-size: var(--fs-sm); cursor: pointer; padding: 4px 6px; border-radius: var(--r-chip); font-family: inherit; }
.sp-quiet:hover { background: var(--hover); color: var(--danger); }

.sp-field { margin-bottom: 14px; }
.sp-field > label { display: block; font-size: var(--fs-xs); color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.sp-lbl-row { display: flex; justify-content: space-between; }
.sp-muted { color: var(--ink-3); font-weight: 500; }
.sp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sp-stepper { display: flex; align-items: center; gap: 8px; }
.sp-stepper button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: var(--r-chip); background: var(--card); cursor: pointer; font-size: 16px; color: var(--ink); }
.sp-stepper span { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.sp-zone-picker { display: flex; flex-direction: column; gap: 6px; }
.sp-zopt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-chip); background: var(--card); cursor: pointer; font-family: inherit; }
.sp-zopt.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.sp-zopt-name { flex: 1; text-align: left; font-size: var(--fs-sm); color: var(--ink); }
.sp-zopt-price { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 600; }

/* zones panel */
.sp-zone-intro { font-size: var(--fs-sm); color: var(--ink-2); margin: 0 0 14px; line-height: 1.5; }
.sp-zonecard { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 13px; margin-bottom: 10px; }
.sp-zonecard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sp-zonename { flex: 1; min-width: 0; border: none; background: none; font-weight: 700; font-size: var(--fs-body); color: var(--ink); padding: 2px 0; font-family: inherit; }
.sp-zonename:focus { outline: none; border-bottom: 1px solid var(--line); }
.sp-swatches { display: flex; gap: 7px; }
.sp-swatch { width: 18px; height: 18px; border-radius: 50%; border: none; cursor: pointer; padding: 0; }
.sp-zoneprice { display: flex; align-items: center; gap: 8px; }
.sp-zoneprice label { font-size: var(--fs-sm); color: var(--ink); }
.sp-spacer { flex: 1; }
.sp-priceinput { width: 86px; height: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.sp-eur { font-weight: 700; color: var(--ink); }
.sp-zonedel { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: var(--r-chip); background: var(--card); color: var(--danger); cursor: pointer; display: grid; place-items: center; }
.sp-addzone { width: 100%; justify-content: center; }

/* ── modal (Reihe + venue) ────────────────────────────────── */
.sp-modal { position: fixed; inset: 0; background: rgba(14, 14, 20, 0.45); display: grid; place-items: center; z-index: 1000; }
.sp-modal-card { background: var(--card); border-radius: var(--r-card); width: min(440px, 92vw); box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--line); }
.sp-modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 22px 6px; }
.sp-modal-head h3 { margin: 0; font-size: var(--fs-h1); }
.sp-modal-head p { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--ink-2); }
.sp-modal-x { border: none; background: none; cursor: pointer; color: var(--ink-2); padding: 4px; border-radius: var(--r-chip); }
.sp-modal-x:hover { background: var(--hover); }
.sp-modal-body { padding: 12px 22px; }
.sp-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 22px; }
.sp-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 0 12px; }
.sp-toggle-row .sp-muted { font-size: var(--fs-sm); margin-top: 2px; }
.sp-tgl { width: 44px; height: 26px; border-radius: var(--r-pill); border: none; background: var(--line-2); position: relative; cursor: pointer; transition: background 0.15s; }
.sp-tgl span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.sp-tgl.on { background: var(--accent); }
.sp-tgl.on span { transform: translateX(18px); }
.sp-rowpreview { display: flex; align-items: center; gap: 5px; min-height: 48px; padding: 10px; border: 1px dashed var(--line); border-radius: var(--r-ctl); overflow: hidden; }
.sp-rp-chair { position: relative; flex: 0 0 auto; }
.sp-rp-more { font-size: var(--fs-sm); color: var(--ink-2); }

/* ── editor actions hosted in the global top-right controls cluster ── */
.sp-gc-actions { display: flex; align-items: center; gap: 8px; margin-right: 8px; }
.sp-gc-actions .lp-btn { white-space: nowrap; }
/* pull the editor's title/description up onto the top controls band */
#section-saalplan .lp-topbar { padding-top: 6px; padding-bottom: 10px; }

/* ── multi-select marquee box ─────────────────────────────── */
.sp-marquee {
  position: absolute; z-index: 4; pointer-events: none;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 3px;
}

/* ── Saalplan·Verkauf (admin seat-sales dot-grid) ───────────────── */
.spv-card { max-width: 820px; width: 96vw; }
.spv-body { max-height: 78vh; overflow: auto; }
.spv-kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.spv-kpi { flex: 1 1 90px; border: 1px solid var(--line); border-radius: var(--r-chip); padding: 8px 10px; }
.spv-kpi-v { font-weight: 800; font-size: 18px; }
.spv-kpi-l { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.spv-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; font-size: 13px; color: var(--ink-2); }
.spv-zleg { display: inline-flex; align-items: center; gap: 6px; }
.spv-zdot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.spv-zcount { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.spv-dot-checked { background: var(--success, #16a34a); }
.spv-dot-held { background: #d9870e; }
/* read-only spatial map — reuses the editor's .sp-node/.sp-table/.sp-chair/.sp-decor,
   one scaled stage per Bereich, seats tinted inline by sales state. */
.spv-area-name { font-size: 12px; font-weight: 700; color: var(--ink-2); margin: 4px 0 6px; }
.spv-stagewrap {
  position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 10px;
  background:
    radial-gradient(var(--grid-line) 1.1px, transparent 1.1px) 0 0 / 22px 22px,
    var(--field);
}
.spv-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.spv-node { cursor: default; }
.spv-clickable { cursor: pointer; }
.spv-clickable:hover .sp-table,
.spv-clickable:hover .sp-chair { box-shadow: 0 0 0 2px var(--ink); }
.spv-st-available .sp-table,
.spv-st-available .sp-chair { opacity: .92; }
.spv-checked { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--success, #16a34a); }
.spv-hint { margin-top: 10px; font-size: 12px; }
