/* === Planimetria === */
.floor-stage {
  position: relative;
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.floor-toolbar {
  display: flex; align-items: center; gap: .25rem;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--bs-border-color);
  background: #eef2f7;
}
.floor-toolbar .btn { padding: .25rem .55rem; }
.floor-toolbar .floor-info { margin-left: auto; font-size: .85rem; color: var(--bs-secondary-color); }

#floor-svg {
  display: block;
  width: 100%;
  height: 62vh;
  max-height: 720px;
  user-select: none;
  cursor: grab;
}
#floor-svg.is-panning { cursor: grabbing; }
/* Editor: niente scroll/zoom del browser sul touch → il dito trascina i tavoli */
.floor-svg[data-editable="1"] { touch-action: none; }
.floor-svg.is-adding { cursor: crosshair; }
.floor-svg.is-adding .table-group { cursor: crosshair; }

/* pavimento — superficie fredda moderna (niente parquet) */
.floor-stage .room-bg {
  fill: #e7edf4;
  stroke: #c2cedd;
  stroke-width: 3;
  filter: drop-shadow(0 4px 12px rgba(15,30,60,.08));
}

/* tavoli */
.table-group { cursor: grab; transition: filter .15s; }
.table-group:active { cursor: grabbing; }
.table-group .tbl-shadow { fill: rgba(0,0,0,.18); filter: blur(2px); }
.table-group .tbl {
  fill: #d6dfee;
  stroke: #41618f;
  stroke-width: 2.5;
}
.table-group:hover .tbl { fill: #e4ebf6; }

/* Giunzioni di un cluster di tavoli da 4 uniti (linea di contatto + lucchetto) */
.table-group .tbl-seam { stroke: #41618f; stroke-width: 1.5; opacity: .55; pointer-events: none; }
.table-group .join-lock-static { pointer-events: none; }
.table-group .join-lock-static .lock-bg { fill: #fff; stroke: #41618f; stroke-width: 1.2; filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.table-group .join-lock-static .lock-icon { stroke: #41618f; }
/* su tavoli prenotati/seduti il testo è bianco → lucchetto chiaro per contrasto */
.table-group.state-reserved .tbl-seam,
.table-group.state-seated .tbl-seam { stroke: rgba(255,255,255,.7); }
.table-group.state-reserved .join-lock-static .lock-bg,
.table-group.state-seated .join-lock-static .lock-bg { fill: #fff; stroke: #1f2a37; }
.table-group.state-reserved .join-lock-static .lock-icon,
.table-group.state-seated .join-lock-static .lock-icon { stroke: #1f2a37; }
.table-group.dragging .tbl { stroke-width: 3; filter: drop-shadow(0 6px 8px rgba(0,0,0,.18)); }
.table-group.table-inactive .tbl { fill: #ececec; stroke: #aaa; stroke-dasharray: 4 3; }
.table-group.snap-target .tbl {
  stroke: #2b7a3a;
  stroke-width: 4;
  filter: drop-shadow(0 0 12px rgba(43, 122, 58, 0.9));
  animation: snap-pulse 0.8s ease-in-out infinite;
}
@keyframes snap-pulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(43, 122, 58, 0.6)); }
  50%      { filter: drop-shadow(0 0 18px rgba(43, 122, 58, 1)); }
}

.table-group .tbl-label {
  font: 600 11px system-ui, sans-serif;
  fill: #1f2a37;
  pointer-events: none;
}
.table-group .tbl-seats {
  font: 10px system-ui, sans-serif;
  fill: #4a5765;
  pointer-events: none;
}
.table-group .tbl-name {
  font: 700 9px system-ui, sans-serif;
  fill: #1f2a37; /* nome sempre in nero, anche sui tavoli occupati */
  pointer-events: none;
}
/* Targhetta del blocco unito (numero + posti totali) — sfondo per leggibilità sopra i lucchetti */
.unit-label { pointer-events: none; }
.unit-label-bg { fill: rgba(255,255,255,.9); stroke: #9fb2cc; stroke-width: .7; }
.unit-label-txt { font: 600 9.5px system-ui, sans-serif; fill: #1f2a37; }
.table-group .tbl-effective {
  font: 700 11px system-ui, sans-serif;
  fill: #2b7a3a;
  pointer-events: none;
}

/* sedie */
.chair {
  pointer-events: none;
  transition: opacity .25s;
}
.chair .chair-seat {
  fill: #aebed3;
  stroke: #5d6b7e;
  stroke-width: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.2));
}
.chair .chair-back {
  fill: #8a9bb3;
  stroke: #5d6b7e;
  stroke-width: 1;
}
.chair.chair-hidden { opacity: 0; }
.chair.chair-removed .chair-seat { fill: #d4c0a8; stroke: #b7a48a; stroke-dasharray: 2 2; }
.chair.chair-removed .chair-back { fill: #b7a48a; stroke-dasharray: 2 2; }
.chair.chair-removed { opacity: .35; }

/* lucchetto join (interattivo: click per separare) */
.join-lock { cursor: pointer; }
/* NB: niente transform sull'hover del <g> (sovrascriverebbe il translate di posizione e
   farebbe "saltare" il lucchetto). L'evidenziazione hover agisce solo sui figli. */
.join-lock .lock-bg {
  fill: #fff;
  stroke: #41618f;
  stroke-width: 1.5;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.25));
  transition: fill .12s, stroke-width .12s;
}
.join-lock:hover .lock-bg { fill: #e4ebf6; stroke-width: 2.2; }
.join-lock .lock-icon { stroke: #41618f; }

.table-group.merge-highlighted .tbl {
  fill: #fff3cd;
  stroke: #b8860b;
  stroke-width: 3.5;
  filter: drop-shadow(0 0 8px rgba(255,193,7,.7));
}

/* stati live (Fase 2/3) */
.table-group.state-considering .tbl {
  fill: #fff5b1;
  stroke: #d39e00;
  animation: rp-flicker 1.2s infinite ease-in-out;
}
.table-group.state-considering .tbl-shadow { display: none; }
.table-group.state-reserved .tbl {
  fill: #f5a8a0;
  stroke: #962a1a;
}
.table-group.state-seated .tbl {
  fill: #a5d6b1;
  stroke: #1e6b35;
}
@keyframes rp-flicker {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255,193,7,.0));  fill: #fff5b1; }
  50%      { filter: drop-shadow(0 0 14px rgba(255,193,7,1)); fill: #ffe066; }
}

/* Flash quando un tavolo passa a "reserved" (conferma AI o admin) */
.table-group.flash-confirm .tbl {
  animation: rp-flash-confirm 1.8s ease-out 1;
}
@keyframes rp-flash-confirm {
  0%   { filter: drop-shadow(0 0 0 rgba(231, 76, 60, 0)); }
  15%  { filter: drop-shadow(0 0 22px rgba(231, 76, 60, 1)); }
  100% { filter: drop-shadow(0 0 0 rgba(231, 76, 60, 0)); }
}

/* Flash su "seated" (cliente arrivato) — verde */
.table-group.flash-seated .tbl {
  animation: rp-flash-seated 1.6s ease-out 1;
}
@keyframes rp-flash-seated {
  0%   { filter: drop-shadow(0 0 0 rgba(30, 107, 53, 0)); }
  15%  { filter: drop-shadow(0 0 20px rgba(30, 107, 53, 1)); }
  100% { filter: drop-shadow(0 0 0 rgba(30, 107, 53, 0)); }
}

.floor-status {
  padding: .35rem .75rem;
  background: var(--bs-tertiary-bg);
  font-size: .85rem;
  color: var(--bs-secondary-color);
  border-top: 1px solid var(--bs-border-color);
}
.floor-status.is-saving { color: var(--rp-accent); }
.floor-status.is-saved  { color: #2b7a3a; }
.floor-status.is-error  { color: #a30000; }
.floor-status.is-snap-hint {
  background: #d1f0d4;
  color: #155724;
  font-weight: 600;
  border: 1px solid #2b7a3a;
}

/* legend (vista live) */
.live-legend {
  display: flex; gap: 1rem; flex-wrap: wrap;
  font-size: .85rem;
}
.live-legend .ll {
  display: inline-flex; align-items: center; gap: .35rem;
}
.live-legend .swatch {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px;
  border: 1.5px solid #8a4a2b;
}
.swatch.free       { background: #f4e3c1; }
.swatch.considering{ background: #ffe066; border-color: #d39e00; }
.swatch.reserved   { background: #f5a8a0; border-color: #962a1a; }
.swatch.seated     { background: #a5d6b1; border-color: #1e6b35; }

/* tab stanze nella vista live */
.room-tabs .nav-link {
  color: var(--bs-body-color);
  background: #fff;
  border: 1px solid var(--bs-border-color);
  margin-right: .35rem;
  border-radius: 999px;
  padding: .25rem .85rem;
  font-size: .9rem;
}
.room-tabs .nav-link.active {
  background: var(--rp-accent);
  color: #fff;
  border-color: var(--rp-accent);
}

/* === Vista live pubblica — sidebar + main fullscreen, font moderno ===
   Layout 16:9 friendly: sidebar 300px a sinistra con tutti i controlli,
   planimetria a destra che riempie tutto. */

:root {
  --lv-bg: #0b0e13;
  --lv-surface: #11161e;
  --lv-surface-2: #181d27;
  --lv-surface-3: #1f2531;
  --lv-border: #252b36;
  --lv-border-soft: #1c2230;
  --lv-fg: #e9edf3;
  --lv-fg-dim: #b8c0cc;
  --lv-muted: #7a8392;
  --lv-accent: #ee6e3a;
  --lv-accent-soft: rgba(238, 110, 58, 0.15);
  --lv-live: #34d399;
  --lv-considering: #fbbf24;
  --lv-reserved: #ef4444;
  --lv-seated: #a855f7;
}

/* === Tema CHIARO MODERNO (blu/slate) della vista live ===
   Ridefinisce solo le variabili di "chrome" (sfondo, superfici, testo, bordi, accento):
   gli stati tavolo (reserved/seated/considering) restano vividi e leggibili. */
.live-public {
  --lv-bg: #eef2f7;
  --lv-surface: #ffffff;
  --lv-surface-2: #e9eef5;
  --lv-surface-3: #ffffff;
  --lv-border: #d4dde8;
  --lv-border-soft: #e4eaf1;
  --lv-fg: #1f2a37;
  --lv-fg-dim: #455262;
  --lv-muted: #8593a3;
  --lv-accent: #2563eb;
  --lv-accent-soft: rgba(37, 99, 235, 0.12);
}
.live-public .sb-input { color-scheme: light; }
html:has(.live-public) { background: #eef2f7; }
/* Niente angoli arrotondati: tutto a spigolo, coerente con la planimetria */
.live-public .sb-input,
.live-public .sb-btn,
.live-public .sb-icon-btn,
.live-public .cal-day,
.live-public .cal-shift,
.live-public .cal-shift-bar,
.live-public .live-pill,
.live-public .sb-logo,
.live-public .sb-legend .swatch,
.live-public .room-card,
.live-public .floor-stage,
.live-public .floor-toolbar { border-radius: 0; }

html { background: var(--lv-bg); }
.live-public, .live-public * { box-sizing: border-box; }
.live-public {
  margin: 0 auto;
  max-width: 1900px;
  /* 100dvh = dynamic viewport height: tiene conto della barra URL di Chrome mobile/tablet
     che appare e scompare in fase di scroll. Su browser vecchi fallback a 100vh. */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--lv-bg);
  color: var(--lv-fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: grid;
  grid-template-columns: 300px 1fr;
  /* margine attorno a sidebar e sala (stesso respiro su entrambe) */
  padding: 16px;
  gap: 14px;
}

/* === SIDEBAR sinistra (pannello con margine, come la sala) === */
.live-public .sidebar {
  background: var(--lv-surface);
  border: 1px solid var(--lv-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.sb-brand {
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--lv-border-soft);
}
.sb-brand .sb-logo {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--lv-accent-soft);
  color: var(--lv-accent);
  display: grid; place-items: center;
  font-size: 18px;
}
.sb-brand .sb-name {
  flex: 1; min-width: 0;
}
.sb-brand .sb-name h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--lv-fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sb-brand .sb-name .sb-sub {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--lv-muted); margin-top: 2px;
}

.live-pill {
  display: inline-flex;
  align-items: center; gap: 5px;
  background: rgba(52, 211, 153, 0.15);
  color: var(--lv-live);
  border: 1px solid rgba(52, 211, 153, 0.4);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.8px;
  padding: 1px 7px;
  border-radius: 999px;
  line-height: 1.5;
}
.live-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lv-live);
  box-shadow: 0 0 5px var(--lv-live);
  animation: rp-pulse 1.4s ease-in-out infinite;
}
@keyframes rp-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.8); }
}
.live-pill.live-pill-snapshot {
  background: rgba(122, 131, 146, 0.18);
  color: var(--lv-muted);
  border-color: rgba(122, 131, 146, 0.4);
}
.live-pill.live-pill-snapshot::before {
  background: var(--lv-muted);
  box-shadow: none; animation: none; opacity: 0.7;
}

/* Sezioni della sidebar */
.sb-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--lv-border-soft);
}
.sb-section:last-of-type { border-bottom: none; }
.sb-section .sb-label {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--lv-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.sb-controls { display: flex; flex-direction: column; gap: 8px; }
.sb-field { display: flex; flex-direction: column; gap: 4px; }
.sb-field label {
  font-size: 11px;
  color: var(--lv-muted);
  margin: 0;
}
.sb-input {
  background: var(--lv-surface-3);
  color: var(--lv-fg);
  border: 1px solid var(--lv-border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  color-scheme: dark;
  width: 100%;
}
.sb-input:focus {
  outline: none;
  border-color: var(--lv-accent);
  box-shadow: 0 0 0 3px var(--lv-accent-soft);
}

.sb-row { display: flex; gap: 8px; }
.sb-row > * { min-width: 0; }

/* Riga "Quando" compatta: data (riempie) + ora (stretta) + iconcina "adesso" */
.sb-when-row { display: flex; gap: 5px; align-items: stretch; }
.sb-when-row .sb-input-date { flex: 1 1 auto; min-width: 0; padding-left: 8px; padding-right: 6px; }
.sb-when-row .sb-input-time { flex: 0 0 78px; padding-left: 8px; padding-right: 4px; }
.sb-icon-btn {
  flex: 0 0 auto;
  width: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--lv-surface-3);
  color: var(--lv-fg-dim);
  border: 1px solid var(--lv-border);
  cursor: pointer;
  font-size: 15px;
  transition: all .15s ease;
}
.sb-icon-btn:hover { color: var(--lv-accent); border-color: var(--lv-accent); }

.sb-btn {
  background: var(--lv-surface-3);
  color: var(--lv-fg);
  border: 1px solid var(--lv-border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition: all .15s ease;
  font-family: inherit;
}
.sb-btn:hover {
  border-color: var(--lv-muted);
  color: var(--lv-fg);
  background: var(--lv-surface-2);
}
.sb-btn.active {
  background: var(--lv-accent);
  color: #fff;
  border-color: var(--lv-accent);
}
.sb-btn-block { display: flex; width: 100%; }

.sb-shifts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }

/* Tab stanze come bottoni a piena larghezza */
.sb-rooms {
  display: flex; flex-direction: column; gap: 4px;
  list-style: none; padding: 0; margin: 0;
}
.sb-rooms li { width: 100%; }
.sb-rooms .nav-link {
  display: flex; align-items: center; justify-content: space-between;
  background: transparent;
  color: var(--lv-fg-dim);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.sb-rooms .nav-link:hover {
  background: var(--lv-surface-3);
  color: var(--lv-fg);
}
.sb-rooms .nav-link.active {
  background: var(--lv-accent-soft);
  color: var(--lv-accent);
  border-color: rgba(238, 110, 58, 0.25);
  font-weight: 600;
}
.sb-rooms .room-cap-badge {
  font-size: 11px;
  color: var(--lv-muted);
  font-variant-numeric: tabular-nums;
}
.sb-rooms .nav-link.active .room-cap-badge { color: var(--lv-accent); }

/* Calendario sidebar */
.sb-calendar {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sb-calendar .cal-grid {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}
.sb-calendar .cal-grid::-webkit-scrollbar { width: 6px; }
.sb-calendar .cal-grid::-webkit-scrollbar-thumb { background: var(--lv-border); border-radius: 3px; }

.cal-day {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--lv-surface-3);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s ease;
}
.cal-day:hover { border-color: var(--lv-border); background: var(--lv-surface-2); }
.cal-day.is-today { border-color: rgba(238, 110, 58, 0.4); background: rgba(238, 110, 58, 0.08); }
.cal-day.is-today .cal-num { color: var(--lv-accent); }
.cal-day.selected { border-color: var(--lv-accent); background: var(--lv-accent-soft); }
.cal-day.is-closed { opacity: 0.5; }

.cal-day-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  flex: 0 0 38px;
}
.cal-wd {
  font-size: 10px;
  color: var(--lv-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.cal-num {
  font-size: 17px;
  font-weight: 700;
  color: var(--lv-fg);
}
.cal-mon {
  font-size: 9px;
  color: var(--lv-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 1px;
}

.cal-shifts {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cal-shift {
  position: relative;
  height: 18px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}
.cal-shift:hover { outline: 1px solid var(--lv-muted); }
.cal-shift-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: rgba(52, 211, 153, 0.3);
  transition: width .25s ease;
}
.cal-shift.empty .cal-shift-bar { background: rgba(122, 131, 146, 0.18); }
.cal-shift.low   .cal-shift-bar { background: rgba(52, 211, 153, 0.35); }
.cal-shift.mid   .cal-shift-bar { background: rgba(251, 191, 36, 0.45); }
.cal-shift.high  .cal-shift-bar { background: rgba(239, 68, 68, 0.55); }
.cal-shift-txt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  height: 100%;
  font-size: 11px;
  font-weight: 500;
  color: var(--lv-fg);
  font-variant-numeric: tabular-nums;
  gap: 8px;
}
.cal-shift-time { font-weight: 600; }
.cal-shift-people {
  background: rgba(255, 255, 255, 0.7);
  color: #1f2a37;
  padding: 1px 6px;
  border-radius: 0;
  font-size: 10px;
  min-width: 18px;
  text-align: center;
}

.cal-closed-note {
  flex: 1 1 auto;
  font-size: 11px;
  color: var(--lv-muted);
  font-style: italic;
}

/* Legenda */
.sb-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.sb-legend .ll {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--lv-fg-dim);
}
.sb-legend .swatch {
  width: 12px; height: 12px; border-radius: 3px;
  display: inline-block; flex: 0 0 12px;
}
.sb-legend .swatch.free { background: #d6dfee; border: 1px solid #41618f; }
.sb-legend .swatch.considering { background: var(--lv-considering); }
.sb-legend .swatch.reserved { background: var(--lv-reserved); }
.sb-legend .swatch.seated { background: var(--lv-seated); }

/* Footer della sidebar — sempre visibile, non shrink */
.sb-footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 14px 20px;
  border-top: 1px solid var(--lv-border-soft);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  background: var(--lv-surface);
}
.sb-footer .clock {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--lv-muted);
}
.sb-footer .admin-link {
  background: transparent;
  color: var(--lv-muted);
  border: 1px solid var(--lv-border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
}
.sb-footer .admin-link:hover { color: var(--lv-fg); border-color: var(--lv-muted); }

/* === MAIN destra === */
.live-public .main {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.rooms-grid {
  flex: 1 1 auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 14px;
  min-height: 0;
}
.live-public.single-room .rooms-grid {
  grid-auto-flow: row;
  grid-template-columns: 1fr;
}

.room-card {
  background: var(--lv-surface);
  border: 1px solid var(--lv-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
              0 12px 32px -16px rgba(0, 0, 0, 0.6);
}
.room-card .room-head {
  padding: 14px 18px;
  background: linear-gradient(180deg, var(--lv-surface-2), var(--lv-surface));
  border-bottom: 1px solid var(--lv-border);
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}
.room-card .room-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--lv-fg);
}
.room-card .room-head .capacity-info {
  font-size: 12px;
  color: var(--lv-muted);
}
.room-card .room-head .occupancy {
  margin-left: auto;
  font-weight: 600;
  color: var(--lv-fg);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  padding: 4px 10px;
  background: var(--lv-surface-3);
  border: 1px solid var(--lv-border);
  border-radius: 999px;
}
.room-card .room-head .occupancy.has-override {
  color: var(--lv-accent);
  border-color: rgba(238, 110, 58, 0.3);
  background: var(--lv-accent-soft);
}

/* Floor stage = la "stanza" — è chiaramente DENTRO la card */
.room-card .floor-stage {
  flex: 1 1 auto;
  min-height: 0;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 60%),
    var(--lv-bg);
  position: relative;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.room-card .floor-svg {
  height: 100%;
  width: 100%;
  max-height: 100%;
  cursor: default;
  background: transparent;
}

/* Il pavimento/tavoli/sedie della vista live ereditano la palette FREDDA globale
   (.floor-stage .room-bg, .table-group .tbl, .chair) — niente override qui. */

/* Sedie occupate — colorate in base allo stato del tavolo (vale ovunque ci sia una pianta) */
.floor-svg .chair.chair-occupied .chair-seat { fill: #ee6e3a; }
.floor-svg .chair.chair-occupied .chair-back { fill: #b8421f; }
.table-group.state-considering .chair.chair-occupied .chair-seat { fill: #fbbf24; }
.table-group.state-considering .chair.chair-occupied .chair-back { fill: #b8910a; }
.table-group.state-reserved .chair.chair-occupied .chair-seat { fill: #ef4444; }
.table-group.state-reserved .chair.chair-occupied .chair-back { fill: #a83020; }
.table-group.state-seated .chair.chair-occupied .chair-seat { fill: #a855f7; }
.table-group.state-seated .chair.chair-occupied .chair-back { fill: #5e2d76; }

/* Stati live */
.live-public .table-group.state-considering .tbl {
  fill: var(--lv-considering);
  stroke: #b8910a;
  animation: lv-consider-pulse 1s ease-in-out infinite;
}
.live-public .table-group.state-considering .tbl-label,
.live-public .table-group.state-considering .tbl-seats { fill: #2a1f00; }
.live-public .table-group.state-reserved .tbl {
  fill: var(--lv-reserved);
  stroke: #a83020;
}
.live-public .table-group.state-reserved .tbl-label,
.live-public .table-group.state-reserved .tbl-seats { fill: #fff; }
.live-public .table-group.state-seated .tbl {
  fill: var(--lv-seated);
  stroke: #5e2d76;
}
.live-public .table-group.state-seated .tbl-label,
.live-public .table-group.state-seated .tbl-seats { fill: #fff; }

@keyframes lv-consider-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .55; }
}

/* Lampeggio di "vista cambiata per chiamata AI": giorno+turno nel calendario e selettori */
@keyframes rp-hold-flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(238, 110, 58, 0); }
  50%      { box-shadow: 0 0 0 3px var(--lv-accent); }
}
.cal-day.cal-flash,
.cal-shift.cal-shift-flash,
.sb-input.hold-flash,
.sb-btn.hold-flash {
  animation: rp-hold-flash 1s ease-in-out infinite;
  border-color: var(--lv-accent) !important;
}
.cal-shift.cal-shift-flash .cal-shift-bar { background: var(--lv-accent-soft); }

/* Toolbar zoom minimal in overlay */
.live-public .floor-toolbar {
  background: rgba(11, 14, 19, 0.7);
  backdrop-filter: blur(6px);
  border: 1px solid var(--lv-border);
  border-radius: 8px;
  padding: 4px;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  display: flex;
  gap: 2px;
}
.live-public .floor-toolbar .btn {
  background: transparent;
  color: var(--lv-muted);
  border: none;
  padding: 4px 8px;
  border-radius: 5px;
}
.live-public .floor-toolbar .btn:hover { color: var(--lv-fg); background: rgba(0, 0, 0, 0.05); }
.live-public .floor-toolbar .floor-info { display: none; }
.live-public .floor-status { display: none; }

/* Responsive: schermi stretti → sidebar in alto */
@media (max-width: 900px) {
  .live-public { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .live-public .sidebar { border-right: none; border-bottom: 1px solid var(--lv-border); max-height: 50vh; overflow-y: auto; }
  .live-public .rooms-grid { grid-auto-flow: row; grid-template-columns: 1fr; overflow-y: auto; }
  .room-card { min-height: 320px; }
}
