/* Stile di dashboard (app.) e back-office (admin.): glassmorphism chiaro. Nessuno stile inline: tutto qui.
 * Varianti: body.v-app (ristorante, toni caldi) e body.v-admin (M&P, toni freddi). */
:root {
  --text: #17181c;
  --muted: #4f525c;
  --line: rgba(23, 24, 28, 0.1);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.75);
  --shadow: 0 12px 32px -14px rgba(30, 30, 60, 0.22), 0 2px 6px -2px rgba(30, 30, 60, 0.08);
  --primary: #9a3412;
  --primary-2: #c2410c;
  --primary-text: #ffffff;
  --primary-soft: rgba(194, 65, 12, 0.12);
  --ok: #166534;
  --ok-bg: rgba(22, 163, 74, 0.14);
  --warn: #854d0e;
  --warn-bg: rgba(234, 179, 8, 0.2);
  --danger: #b91c1c;
  --danger-bg: rgba(220, 38, 38, 0.12);
  --info: #1e40af;
  --info-bg: rgba(59, 130, 246, 0.14);
  --radius: 14px;
  --radius-lg: 20px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body.v-admin {
  --primary: #4338ca;
  --primary-2: #6366f1;
  --primary-soft: rgba(99, 102, 241, 0.14);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: #f6efe9;
  background-image:
    radial-gradient(1200px 600px at -10% -10%, rgba(244, 162, 97, 0.45), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgba(231, 111, 81, 0.32), transparent 60%),
    radial-gradient(900px 700px at 60% 120%, rgba(129, 178, 154, 0.4), transparent 60%);
  background-attachment: fixed;
}
body.v-admin {
  background-color: #eef0fb;
  background-image:
    radial-gradient(1100px 600px at -10% -10%, rgba(129, 140, 248, 0.45), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgba(34, 211, 238, 0.3), transparent 60%),
    radial-gradient(900px 700px at 60% 120%, rgba(244, 114, 182, 0.3), transparent 60%);
}
a { color: var(--primary); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 10; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--primary-2); outline-offset: 2px; }

/* ── superfici in vetro ─────────────────────────────────────────────── */
.glass, .card, .stat, .kpi, .side, .tl-item, .tcard, .auth-card, table {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* ── struttura: barra laterale + contenuto ──────────────────────────── */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); border-top: 0;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: var(--text); }
.brand-mark {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 12px; font-size: 0.8rem;
  background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; font-weight: 800; letter-spacing: 0.02em;
  box-shadow: 0 6px 16px -6px var(--primary);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--muted); font-size: 0.75rem; }
.side { min-width: 0; }
.side nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.side nav::-webkit-scrollbar { display: none; }
.side nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; text-decoration: none;
  color: var(--text); font-weight: 500; white-space: nowrap; transition: background-color 0.15s, color 0.15s;
}
.side nav a:hover { background: rgba(255, 255, 255, 0.6); }
.side nav a[aria-current='page'] {
  background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; font-weight: 600;
  box-shadow: 0 8px 18px -10px var(--primary);
}
.side .nav-label { display: none; }
.side-foot { display: flex; align-items: center; gap: 8px; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.content { min-width: 0; }
main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 6px 0 18px; }
.page-head h1 { margin: 0; flex: 1 1 auto; }
h1 { font-size: 1.65rem; margin: 0.3em 0 0.6em; letter-spacing: -0.02em; }
h1::first-letter { text-transform: uppercase; }
h2 { font-size: 1.1rem; margin: 0 0 0.7em; letter-spacing: -0.01em; }
.card h2:not(:first-child) { margin-top: 1.2em; }

@media (min-width: 960px) {
  .shell { grid-template-columns: 252px minmax(0, 1fr); }
  .side {
    flex-direction: column; align-items: stretch; height: calc(100vh - 24px); margin: 12px 0 12px 12px; top: 12px;
    padding: 18px 14px; border-radius: var(--radius-lg); border-top: 1px solid var(--glass-border);
  }
  .brand { padding: 0 4px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
  .side nav { flex-direction: column; overflow: visible; }
  .side nav a { padding: 10px 12px; }
  .side .nav-label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 10px 12px 4px; }
  .side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
  .side-foot form, .side-foot button { width: 100%; }
  main { padding: 26px 28px 48px; }
}
@media (max-width: 959px) {
  .brand-text { display: none; }
  .side nav a { padding: 8px 10px; }
}

/* ── banner ─────────────────────────────────────────────────────────── */
.banner { margin: 12px 16px 0; padding: 12px 16px; font-weight: 600; border-radius: var(--radius); border: 1px solid var(--glass-border); }
.banner-imp { background: rgba(254, 240, 138, 0.85); color: #3f2d00; }
.banner-ro { background: rgba(219, 234, 254, 0.9); color: #1b2f66; }
.banner-maint { background: rgba(254, 226, 226, 0.92); color: #6b1410; }
@media (min-width: 960px) { .banner { margin: 12px 28px 0; } }

/* ── schede, griglie, testo ─────────────────────────────────────────── */
.card { border-radius: var(--radius-lg); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cols { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1100px) { .cols { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); } }
label { display: block; font-weight: 600; margin: 10px 0 4px; }
.hint { color: var(--muted); font-size: 0.88rem; font-weight: 400; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88rem; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.inline { display: inline; }
.hidden { display: none; }
.muted { color: var(--muted); }

/* ── campi ──────────────────────────────────────────────────────────── */
input[type='text'], input[type='email'], input[type='password'], input[type='tel'], input[type='number'],
input[type='date'], input[type='time'], input[type='url'], input[type='search'], select, textarea {
  width: 100%; padding: 10px 12px; min-height: 42px; font: inherit; color: var(--text);
  background: rgba(255, 255, 255, 0.78); border: 1px solid rgba(23, 24, 28, 0.16); border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; background: #fff; border-color: var(--primary-2); box-shadow: 0 0 0 4px var(--primary-soft); }
textarea { min-height: 120px; }
input[type='checkbox'], input[type='radio'] { accent-color: var(--primary); width: 18px; height: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 2px; flex: none; }
.row > label { margin: 0; }
.row > label > input, .row > label > select { margin-top: 4px; }

/* ── pulsanti ───────────────────────────────────────────────────────── */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; min-height: 42px;
  border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  color: var(--primary-text); background: linear-gradient(135deg, var(--primary-2), var(--primary));
  box-shadow: 0 8px 18px -10px var(--primary); transition: transform 0.12s, box-shadow 0.15s, filter 0.15s;
}
button:hover, .btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
button:active, .btn:active { transform: none; }
button.secondary, .btn.secondary {
  color: var(--primary); background: rgba(255, 255, 255, 0.75); border-color: rgba(23, 24, 28, 0.12); box-shadow: none;
}
button.secondary:hover, .btn.secondary:hover { background: #fff; }
button.danger, .btn.danger { background: linear-gradient(135deg, #dc2626, #991b1b); box-shadow: 0 8px 18px -10px #991b1b; }
button.ok, .btn.ok { background: linear-gradient(135deg, #16a34a, #166534); box-shadow: 0 8px 18px -10px #166534; }
button.small, .btn.small { padding: 5px 10px; min-height: 32px; font-size: 0.84rem; border-radius: 10px; }
button.big, .btn.big { padding: 14px 20px; font-size: 1.02rem; }

/* ── tabelle ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: rgba(255, 255, 255, 0.45); }
tbody tr { transition: background-color 0.12s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.55); }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }

/* ── etichette di stato ─────────────────────────────────────────────── */
.tag, .pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line); color: var(--text); white-space: nowrap;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-confirmed, .st-live, .st-active { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.st-arrived { color: var(--info); background: var(--info-bg); border-color: transparent; }
.st-requested, .st-held, .st-draft, .st-invited { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.st-cancelled_guest, .st-cancelled_venue, .st-declined, .st-no_show, .st-suspended, .st-offboarding, .st-disabled {
  color: var(--danger); background: var(--danger-bg); border-color: transparent;
}

/* ── messaggi ───────────────────────────────────────────────────────── */
.msg { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); margin-bottom: 12px; border: 1px solid var(--glass-border); font-weight: 500; }
.msg-ok { background: rgba(220, 252, 231, 0.9); color: #11401f; }
.msg-err { background: rgba(254, 226, 226, 0.92); color: #6b1410; }
.msg-warn { background: rgba(254, 243, 199, 0.92); color: #4a3500; }

/* ── indicatori (KPI) ───────────────────────────────────────────────── */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); }
a.kpi:hover { transform: translateY(-2px); }
.kpi-ico { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; margin-bottom: 6px; color: #fff; }
.kpi-a .kpi-ico { background: linear-gradient(135deg, #fb923c, #c2410c); }
.kpi-b .kpi-ico { background: linear-gradient(135deg, #34d399, #047857); }
.kpi-c .kpi-ico { background: linear-gradient(135deg, #60a5fa, #1d4ed8); }
.kpi-d .kpi-ico { background: linear-gradient(135deg, #fbbf24, #b45309); }
.kpi-e .kpi-ico { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.kpi-f .kpi-ico { background: linear-gradient(135deg, #f87171, #b91c1c); }
.kpi-num { font-size: 2rem; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-label { font-weight: 600; }
.kpi-sub { font-size: 0.82rem; color: var(--muted); }
.kpi.alert { box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.65), var(--shadow); }
.progress { height: 8px; border-radius: 99px; background: rgba(23, 24, 28, 0.08); overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #34d399, #047857); }

/* vecchi riquadri statistici (statistiche) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { border-radius: var(--radius-lg); padding: 16px; }
.stat b { display: block; font-size: 1.8rem; letter-spacing: -0.02em; }
.bar { display: block; height: 10px; background: linear-gradient(90deg, var(--primary-2), var(--primary)); border-radius: 99px; }
.w-0 { width: 0; } .w-10 { width: 10%; } .w-20 { width: 20%; } .w-30 { width: 30%; } .w-40 { width: 40%; } .w-50 { width: 50%; }
.w-60 { width: 60%; } .w-70 { width: 70%; } .w-80 { width: 80%; } .w-90 { width: 90%; } .w-100 { width: 100%; }

/* ── barra azioni rapide e walk-in ──────────────────────────────────── */
.quick { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.walkin { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.walkin form { display: block; }
.walkin button { width: 100%; min-height: 54px; font-size: 1.2rem; font-weight: 800; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); }
.live::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55); } 70% { box-shadow: 0 0 0 9px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }

/* ── linea del tempo di oggi ────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.tl-item {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 14px;
  border-radius: var(--radius); transition: transform 0.12s, box-shadow 0.15s;
}
.tl-item:hover { transform: translateX(2px); }
.tl-time {
  display: grid; place-items: center; height: 48px; border-radius: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.8); border: 1px solid var(--line);
}
.tl-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.tl-name { font-weight: 700; font-size: 1.02rem; text-decoration: none; color: var(--text); }
.tl-name:hover { text-decoration: underline; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 0.85rem; }
.tl-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.tl-item.past { opacity: 0.72; }
.tl-item.next { box-shadow: 0 0 0 2px var(--primary-2), var(--shadow); }
.tl-item.next .tl-time { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; border-color: transparent; }
.tl-item.done .tl-time { color: var(--ok); }
.badge-next { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ico { width: 40px; height: 40px; margin-bottom: 6px; color: var(--primary-2); }
@media (min-width: 720px) {
  .tl-item { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .tl-actions { grid-column: auto; justify-content: flex-end; }
}

/* ── schede ristorante (admin) ──────────────────────────────────────── */
.tgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tcard { border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.tcard-head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.avatar {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 14px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
}
.tcard-title { display: flex; flex-direction: column; min-width: 0; }
.tcard-title a { font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; }
.tcard-title a:hover { text-decoration: underline; }
.tcard .row { margin-top: auto; }

/* ── pagine di accesso ──────────────────────────────────────────────── */
body.auth main { max-width: 460px; padding-top: 8vh; }
body.auth main > h1 { text-align: center; }
body.auth .auth-card { border-radius: var(--radius-lg); padding: 22px; }
body.auth .auth-brand { display: flex; justify-content: center; margin-bottom: 10px; }
body.auth .auth-brand .brand-mark { width: 52px; height: 52px; font-size: 1.2rem; border-radius: 16px; }
body.auth button[type='submit'] { width: 100%; margin-top: 8px; }
body.auth .card { padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }

.danger-zone { border-color: rgba(220, 38, 38, 0.45); }
.codes { columns: 2; font-family: ui-monospace, monospace; }
.qr { word-break: break-all; }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  table { font-size: 0.9rem; }
  h1 { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { transition: none !important; animation: none !important; } }
@media print {
  .side, .noprint, form, .banner, .quick { display: none !important; }
  body { background: #fff; }
  .shell { display: block; }
  main { padding: 0; }
  .card, table, .tl-item, .kpi { border: none; box-shadow: none; background: #fff; backdrop-filter: none; }
  table { font-size: 11pt; }
}
.tag .ico, .pill .ico { width: 14px; height: 14px; }
.btn .ico, button .ico { width: 18px; height: 18px; }
ol.timeline { list-style: none; margin: 0; padding: 0; }

/* ── sala in tempo reale ────────────────────────────────────────────── */
.room-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 14px; padding-bottom: 2px; }
.room-tabs a {
  display: flex; flex-direction: column; min-width: 130px; padding: 10px 14px; border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--shadow);
}
.room-tabs a span { font-weight: 700; }
.room-tabs a small { color: var(--muted); font-size: 0.78rem; }
.room-tabs a[aria-current='page'] { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; border-color: transparent; }
.room-tabs a[aria-current='page'] small { color: rgba(255, 255, 255, 0.85); }
.floor-cols { grid-template-columns: minmax(0, 1fr); }
.floor-cols > * { min-width: 0; }
@media (min-width: 1100px) { .floor-cols { grid-template-columns: minmax(0, 2.2fr) minmax(320px, 1fr); } }
.floor-tools { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.floor-tools button[aria-pressed='true'] { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; border-color: transparent; }
#pannello { scroll-margin-top: 80px; }
.floor-wrap { border-radius: 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 760px) {
  .floor-svg { min-width: 720px; }
  .kpis-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .kpis-compact .kpi { padding: 10px 8px; }
  .kpis-compact .kpi-ico, .kpis-compact .kpi-sub { display: none; }
  .kpis-compact .kpi-num { font-size: 1.25rem; }
  .kpis-compact .kpi-label { font-size: 0.72rem; line-height: 1.2; }
}
.floor-svg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.floor-bg { fill: rgba(255, 255, 255, 0.6); stroke: rgba(23, 24, 28, 0.14); stroke-width: 2; }
.floor-grid { pointer-events: none; }
.fgrid-line { fill: none; stroke: rgba(23, 24, 28, 0.07); stroke-width: 1; }
.floor-svg.moving .floor-bg { stroke: var(--primary-2); stroke-width: 3; stroke-dasharray: 12 8; }
.ft { cursor: pointer; }
.ft:focus { outline: none; }
.ft-top { stroke-width: 2.5; transition: fill 0.2s, stroke 0.2s; }
.ft-chair { fill: rgba(255, 255, 255, 0.95); stroke: rgba(23, 24, 28, 0.28); stroke-width: 1.5; }
.ft-label { font: 800 15px Inter, system-ui, sans-serif; fill: #17181c; pointer-events: none; }
.ft-sub { font: 600 11px Inter, system-ui, sans-serif; fill: #3f424b; pointer-events: none; }
.ft:hover .ft-top { filter: drop-shadow(0 4px 8px rgba(30, 30, 60, 0.25)); }
.ft:focus-visible .ft-top, .ft.sel .ft-top { stroke: #17181c; stroke-width: 4.5; }
.ft-free .ft-top { fill: #dcfce7; stroke: #16a34a; }
.ft-reserved .ft-top { fill: #ede9fe; stroke: #7c3aed; }
.ft-soon .ft-top { fill: #fef3c7; stroke: #d97706; animation: ft-soon 1.6s ease-in-out infinite; }
.ft-occupied .ft-top { fill: #ffedd5; stroke: #c2410c; }
.ft-occupied .ft-chair { fill: #fdba74; stroke: #c2410c; }
.ft-long .ft-top { fill: #fee2e2; stroke: #dc2626; }
.ft-long .ft-chair { fill: #fca5a5; stroke: #dc2626; }
.ft-cleaning .ft-top { fill: #f1f5f9; stroke: #64748b; stroke-dasharray: 7 5; }
.ft-blocked { opacity: 0.6; }
.ft-blocked .ft-top { fill: #e5e7eb; stroke: #6b7280; stroke-dasharray: 3 4; }
@keyframes ft-soon { 50% { stroke-width: 5; } }
.floor-svg.moving .ft { cursor: grab; touch-action: none; }
.ft.dragging { cursor: grabbing; }
.ft.dragging .ft-top { filter: drop-shadow(0 10px 16px rgba(30, 30, 60, 0.35)); }
.ft.saving { opacity: 0.7; }
.ft.save-err .ft-top { stroke: #dc2626; stroke-dasharray: 4 3; }
.pill.fs-free { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.pill.fs-reserved { color: #5b21b6; background: rgba(139, 92, 246, 0.15); border-color: transparent; }
.pill.fs-soon { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.pill.fs-occupied { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.pill.fs-long { color: var(--danger); background: var(--danger-bg); border-color: transparent; }
.pill.fs-cleaning { color: #334155; background: rgba(100, 116, 139, 0.16); border-color: transparent; }
.pill.fs-blocked { color: #374151; background: rgba(107, 114, 128, 0.16); border-color: transparent; }
.panel h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 1.3em 0 0.6em; }
.panel-close { margin-left: auto; }
.seated { padding: 12px 14px; border-radius: var(--radius); background: rgba(255, 237, 213, 0.75); border: 1px solid rgba(194, 65, 12, 0.2); margin: 10px 0; }
.seated p { margin: 0 0 8px; }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plist li { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.6); border: 1px solid var(--line); }
.plist .tl-time { height: 38px; font-size: 0.92rem; }
.plist-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.walkin button.over { opacity: 0.72; border-style: dashed; }
.movepad { display: inline-flex; gap: 4px; }
details.join, details.edit { margin-top: 14px; }
details > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.edit-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 14px; }
.sub { border-radius: var(--radius); padding: 14px; }
.sub h3 { margin: 0 0 6px; font-size: 1rem; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.card h2 .ico { vertical-align: -4px; margin-right: 6px; }
@media print { .ft-soon .ft-top { animation: none; } }
fieldset.shapes { border: 0; padding: 0; margin: 10px 0 0; min-width: 0; }
fieldset.shapes legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
fieldset.shapes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.shape-opt { position: relative; margin: 0; font-weight: 500; }
.shape-opt input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.shape-tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; text-align: center;
  font-size: 0.78rem; line-height: 1.2; background: rgba(255, 255, 255, 0.7); border: 1.5px solid var(--line); transition: border-color 0.15s, background-color 0.15s;
}
.shape-prev { width: 64px; height: 32px; }
.shape-prev rect, .shape-prev ellipse { fill: #dcfce7; stroke: #16a34a; stroke-width: 1.5; }
.shape-opt input:checked + .shape-tile { border-color: var(--primary-2); background: var(--primary-soft); font-weight: 700; }
.shape-opt input:checked + .shape-tile rect, .shape-opt input:checked + .shape-tile ellipse { fill: #ffedd5; stroke: var(--primary-2); }
.shape-opt input:focus-visible + .shape-tile { outline: 3px solid var(--primary-2); outline-offset: 2px; }
@media (min-width: 900px) { .edit-grid > .add-table { grid-column: span 2; } }

/* ── agenda (attività su appuntamento): griglia operatori × quarti d'ora, posizioni con classi (niente stili inline) ── */
.agenda-wrap { overflow-x: auto; border-radius: var(--radius); }
.agenda { display: grid; grid-auto-rows: 18px; grid-template-rows: auto; column-gap: 6px; position: relative; min-width: 100%; }
.ag-cols-1 { grid-template-columns: 56px repeat(1, minmax(150px, 1fr)); }
.ag-cols-2 { grid-template-columns: 56px repeat(2, minmax(150px, 1fr)); }
.ag-cols-3 { grid-template-columns: 56px repeat(3, minmax(150px, 1fr)); }
.ag-cols-4 { grid-template-columns: 56px repeat(4, minmax(150px, 1fr)); }
.ag-cols-5 { grid-template-columns: 56px repeat(5, minmax(150px, 1fr)); }
.ag-cols-6 { grid-template-columns: 56px repeat(6, minmax(150px, 1fr)); }
.ag-cols-7 { grid-template-columns: 56px repeat(7, minmax(150px, 1fr)); }
.ag-cols-8 { grid-template-columns: 56px repeat(8, minmax(150px, 1fr)); }
.ag-cols-9 { grid-template-columns: 56px repeat(9, minmax(150px, 1fr)); }
.ag-cols-10 { grid-template-columns: 56px repeat(10, minmax(150px, 1fr)); }
.ag-cols-11 { grid-template-columns: 56px repeat(11, minmax(150px, 1fr)); }
.gr-1{grid-row-start:1}.gr-2{grid-row-start:2}.gr-3{grid-row-start:3}.gr-4{grid-row-start:4}.gr-5{grid-row-start:5}.gr-6{grid-row-start:6}.gr-7{grid-row-start:7}.gr-8{grid-row-start:8}.gr-9{grid-row-start:9}.gr-10{grid-row-start:10}.gr-11{grid-row-start:11}.gr-12{grid-row-start:12}.gr-13{grid-row-start:13}.gr-14{grid-row-start:14}.gr-15{grid-row-start:15}.gr-16{grid-row-start:16}.gr-17{grid-row-start:17}.gr-18{grid-row-start:18}.gr-19{grid-row-start:19}.gr-20{grid-row-start:20}.gr-21{grid-row-start:21}.gr-22{grid-row-start:22}.gr-23{grid-row-start:23}.gr-24{grid-row-start:24}.gr-25{grid-row-start:25}.gr-26{grid-row-start:26}.gr-27{grid-row-start:27}.gr-28{grid-row-start:28}.gr-29{grid-row-start:29}.gr-30{grid-row-start:30}.gr-31{grid-row-start:31}.gr-32{grid-row-start:32}.gr-33{grid-row-start:33}.gr-34{grid-row-start:34}.gr-35{grid-row-start:35}.gr-36{grid-row-start:36}.gr-37{grid-row-start:37}.gr-38{grid-row-start:38}.gr-39{grid-row-start:39}.gr-40{grid-row-start:40}.gr-41{grid-row-start:41}.gr-42{grid-row-start:42}.gr-43{grid-row-start:43}.gr-44{grid-row-start:44}.gr-45{grid-row-start:45}.gr-46{grid-row-start:46}.gr-47{grid-row-start:47}.gr-48{grid-row-start:48}.gr-49{grid-row-start:49}.gr-50{grid-row-start:50}.gr-51{grid-row-start:51}.gr-52{grid-row-start:52}.gr-53{grid-row-start:53}.gr-54{grid-row-start:54}.gr-55{grid-row-start:55}.gr-56{grid-row-start:56}.gr-57{grid-row-start:57}.gr-58{grid-row-start:58}.gr-59{grid-row-start:59}.gr-60{grid-row-start:60}.gr-61{grid-row-start:61}.gr-62{grid-row-start:62}.gr-63{grid-row-start:63}.gr-64{grid-row-start:64}.gr-65{grid-row-start:65}.gr-66{grid-row-start:66}.gr-67{grid-row-start:67}.gr-68{grid-row-start:68}.gr-69{grid-row-start:69}.gr-70{grid-row-start:70}.gr-71{grid-row-start:71}.gr-72{grid-row-start:72}.gr-73{grid-row-start:73}.gr-74{grid-row-start:74}.gr-75{grid-row-start:75}.gr-76{grid-row-start:76}.gr-77{grid-row-start:77}.gr-78{grid-row-start:78}.gr-79{grid-row-start:79}.gr-80{grid-row-start:80}.gr-81{grid-row-start:81}.gr-82{grid-row-start:82}.gr-83{grid-row-start:83}.gr-84{grid-row-start:84}.gr-85{grid-row-start:85}.gr-86{grid-row-start:86}.gr-87{grid-row-start:87}.gr-88{grid-row-start:88}.gr-89{grid-row-start:89}.gr-90{grid-row-start:90}.gr-91{grid-row-start:91}.gr-92{grid-row-start:92}.gr-93{grid-row-start:93}.gr-94{grid-row-start:94}.gr-95{grid-row-start:95}.gr-96{grid-row-start:96}.gr-97{grid-row-start:97}.gr-98{grid-row-start:98}.gr-99{grid-row-start:99}.gr-100{grid-row-start:100}
.gs-1{grid-row-end:span 1}.gs-2{grid-row-end:span 2}.gs-3{grid-row-end:span 3}.gs-4{grid-row-end:span 4}.gs-5{grid-row-end:span 5}.gs-6{grid-row-end:span 6}.gs-7{grid-row-end:span 7}.gs-8{grid-row-end:span 8}.gs-9{grid-row-end:span 9}.gs-10{grid-row-end:span 10}.gs-11{grid-row-end:span 11}.gs-12{grid-row-end:span 12}.gs-13{grid-row-end:span 13}.gs-14{grid-row-end:span 14}.gs-15{grid-row-end:span 15}.gs-16{grid-row-end:span 16}.gs-17{grid-row-end:span 17}.gs-18{grid-row-end:span 18}.gs-19{grid-row-end:span 19}.gs-20{grid-row-end:span 20}.gs-21{grid-row-end:span 21}.gs-22{grid-row-end:span 22}.gs-23{grid-row-end:span 23}.gs-24{grid-row-end:span 24}.gs-25{grid-row-end:span 25}.gs-26{grid-row-end:span 26}.gs-27{grid-row-end:span 27}.gs-28{grid-row-end:span 28}.gs-29{grid-row-end:span 29}.gs-30{grid-row-end:span 30}.gs-31{grid-row-end:span 31}.gs-32{grid-row-end:span 32}.gs-33{grid-row-end:span 33}.gs-34{grid-row-end:span 34}.gs-35{grid-row-end:span 35}.gs-36{grid-row-end:span 36}.gs-37{grid-row-end:span 37}.gs-38{grid-row-end:span 38}.gs-39{grid-row-end:span 39}.gs-40{grid-row-end:span 40}.gs-41{grid-row-end:span 41}.gs-42{grid-row-end:span 42}.gs-43{grid-row-end:span 43}.gs-44{grid-row-end:span 44}.gs-45{grid-row-end:span 45}.gs-46{grid-row-end:span 46}.gs-47{grid-row-end:span 47}.gs-48{grid-row-end:span 48}.gs-49{grid-row-end:span 49}.gs-50{grid-row-end:span 50}.gs-51{grid-row-end:span 51}.gs-52{grid-row-end:span 52}.gs-53{grid-row-end:span 53}.gs-54{grid-row-end:span 54}.gs-55{grid-row-end:span 55}.gs-56{grid-row-end:span 56}.gs-57{grid-row-end:span 57}.gs-58{grid-row-end:span 58}.gs-59{grid-row-end:span 59}.gs-60{grid-row-end:span 60}.gs-61{grid-row-end:span 61}.gs-62{grid-row-end:span 62}.gs-63{grid-row-end:span 63}.gs-64{grid-row-end:span 64}.gs-65{grid-row-end:span 65}.gs-66{grid-row-end:span 66}.gs-67{grid-row-end:span 67}.gs-68{grid-row-end:span 68}.gs-69{grid-row-end:span 69}.gs-70{grid-row-end:span 70}.gs-71{grid-row-end:span 71}.gs-72{grid-row-end:span 72}.gs-73{grid-row-end:span 73}.gs-74{grid-row-end:span 74}.gs-75{grid-row-end:span 75}.gs-76{grid-row-end:span 76}.gs-77{grid-row-end:span 77}.gs-78{grid-row-end:span 78}.gs-79{grid-row-end:span 79}.gs-80{grid-row-end:span 80}.gs-81{grid-row-end:span 81}.gs-82{grid-row-end:span 82}.gs-83{grid-row-end:span 83}.gs-84{grid-row-end:span 84}.gs-85{grid-row-end:span 85}.gs-86{grid-row-end:span 86}.gs-87{grid-row-end:span 87}.gs-88{grid-row-end:span 88}.gs-89{grid-row-end:span 89}.gs-90{grid-row-end:span 90}.gs-91{grid-row-end:span 91}.gs-92{grid-row-end:span 92}.gs-93{grid-row-end:span 93}.gs-94{grid-row-end:span 94}.gs-95{grid-row-end:span 95}.gs-96{grid-row-end:span 96}.gs-97{grid-row-end:span 97}.gs-98{grid-row-end:span 98}.gs-99{grid-row-end:span 99}.gs-100{grid-row-end:span 100}
.gc-1{grid-column-start:1}.gc-2{grid-column-start:2}.gc-3{grid-column-start:3}.gc-4{grid-column-start:4}.gc-5{grid-column-start:5}.gc-6{grid-column-start:6}.gc-7{grid-column-start:7}.gc-8{grid-column-start:8}.gc-9{grid-column-start:9}.gc-10{grid-column-start:10}.gc-11{grid-column-start:11}.gc-12{grid-column-start:12}
.ag-head { display: flex; align-items: center; gap: 8px; padding: 8px 6px 10px; font-size: 0.92rem; position: sticky; top: 0; z-index: 3; }
.ag-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-time { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; transform: translateY(-8px); }
.ag-col { border-radius: 10px; background: repeating-linear-gradient(to bottom, rgba(23, 24, 28, 0.1) 0 1px, transparent 1px 72px), rgba(148, 163, 184, 0.2); z-index: 0; }
.ag-work { background: repeating-linear-gradient(to bottom, rgba(23, 24, 28, 0.08) 0 1px, transparent 1px 72px), rgba(255, 255, 255, 0.92); border-radius: 8px; z-index: 1; }
.ag-off { z-index: 1; display: grid; place-items: center; text-align: center; padding: 8px; border-radius: 10px; color: var(--muted); font-weight: 600;
  background: repeating-linear-gradient(45deg, rgba(107, 114, 128, 0.12) 0 8px, transparent 8px 16px); }
.ag-free { z-index: 2; display: flex; align-items: center; padding: 0 8px; border-radius: 8px; font-size: 0.75rem; color: transparent; text-decoration: none; margin: 1px 0; }
.ag-free:hover, .ag-free:focus-visible { color: var(--primary); background: var(--primary-soft); }
.ag-appt {
  z-index: 3; display: flex; flex-wrap: wrap; align-content: flex-start; column-gap: 6px; overflow: hidden; padding: 3px 8px; margin: 1px 0; border-radius: 10px; text-decoration: none;
  color: var(--text); font-size: 0.8rem; line-height: 1.2; border-left: 4px solid var(--sc); background: var(--sc-bg); box-shadow: 0 4px 10px -6px rgba(30, 30, 60, 0.4);
}
.ag-appt b { font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.ag-appt span { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 100%; }
.ag-appt small { flex-basis: 100%; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-appt:hover { filter: brightness(0.97); }
.ag-appt.ast-requested, .ag-appt.ast-held { border-left-style: dashed; background: rgba(254, 243, 199, 0.95); }
.ag-appt.ast-arrived { box-shadow: inset 0 0 0 2px var(--sc), 0 4px 10px -6px rgba(30, 30, 60, 0.4); }
.ag-appt.ast-no_show { opacity: 0.55; text-decoration: line-through; }
.ag-now { grid-column: 2 / -1; z-index: 4; height: 2px; background: #dc2626; align-self: start; position: relative; pointer-events: none; }
.ag-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #dc2626; }
/* colori degli operatori (nomi chiusi da STAFF_COLORS) */
.sc-blue { --sc: #2563eb; --sc-bg: rgba(219, 234, 254, 0.95); }
.sc-green { --sc: #16a34a; --sc-bg: rgba(220, 252, 231, 0.95); }
.sc-violet { --sc: #7c3aed; --sc-bg: rgba(237, 233, 254, 0.95); }
.sc-orange { --sc: #ea580c; --sc-bg: rgba(255, 237, 213, 0.95); }
.sc-pink { --sc: #db2777; --sc-bg: rgba(252, 231, 243, 0.95); }
.sc-teal { --sc: #0d9488; --sc-bg: rgba(204, 251, 241, 0.95); }
.sc-amber { --sc: #b45309; --sc-bg: rgba(254, 243, 199, 0.95); }
.sc-slate { --sc: #475569; --sc-bg: rgba(226, 232, 240, 0.95); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--sc, var(--primary)); flex: none; }
.tag .dot { width: 8px; height: 8px; }
.staff-av { background: var(--sc, var(--primary)); }
.tcard[class*='sc-'] { border-top: 4px solid var(--sc); }
.plist li.who { grid-template-columns: auto minmax(0, 1fr) auto; }
/* impostazioni: orari settimanali e caselle */
fieldset.hours, fieldset.checks { border: 0; padding: 0; margin: 12px 0 0; min-width: 0; }
fieldset.hours legend, fieldset.checks legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
fieldset.checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
fieldset.checks label { margin: 0; font-weight: 500; }
.hours-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); }
.hours-pair { display: flex; align-items: center; gap: 4px; min-width: 0; }
.hours-pair input { min-width: 0; padding: 6px; }
@media (max-width: 640px) { .hours-row { grid-template-columns: 1fr; } }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* admin: scelta del tipo di attività */
fieldset.verticals legend { font-weight: 700; font-size: 1.1rem; padding: 0; }
.vgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 8px; }
.vopt { position: relative; margin: 0; }
.vopt input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.vtile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--radius); border: 1.5px solid var(--line); background: rgba(255, 255, 255, 0.7); height: 100%; }
.vtile small { color: var(--muted); font-weight: 400; }
.vopt input:checked + .vtile { border-color: var(--primary-2); background: var(--primary-soft); }
.vopt input:focus-visible + .vtile { outline: 3px solid var(--primary-2); outline-offset: 2px; }

/* ── sala a tutto schermo: barra in alto (giorni, sale, numeri, matita, opzioni), pianta e pannello ── */
body.wide main { max-width: none; }
body.wide .page-head { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); }
.floor-app { display: flex; flex-direction: column; gap: 12px; }
.floor-top { margin: 0; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 6; }
.day-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.day-chips { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.day-chips::-webkit-scrollbar { display: none; }
.day-chip {
  flex: 1 0 58px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; border-radius: 12px;
  text-decoration: none; color: var(--text); background: rgba(255, 255, 255, 0.65); border: 1px solid var(--line); transition: transform 0.12s, background-color 0.15s;
}
.day-chip:hover { transform: translateY(-1px); background: #fff; }
.day-chip small { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.day-chip b { font-size: 1.25rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.day-count { min-width: 20px; padding: 0 6px; border-radius: 99px; font-size: 0.7rem; font-weight: 700; text-align: center; background: var(--primary-soft); color: var(--primary); }
.day-chip.is-past { opacity: 0.72; }
.day-chip.is-today small { color: var(--primary); }
.day-chip[aria-current='date'] { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -10px var(--primary); opacity: 1; }
.day-chip[aria-current='date'] small { color: rgba(255, 255, 255, 0.9); }
.day-chip[aria-current='date'] .day-count { background: rgba(255, 255, 255, 0.25); color: #fff; }
.day-nav { padding: 8px 10px; }
.day-pick { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.day-pick input[type='date'] { width: auto; padding: 7px 8px; }
.floor-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.floor-bar .room-tabs { margin: 0; padding: 0; flex: 0 1 auto; }
.floor-bar .room-tabs a { min-width: 0; padding: 6px 12px; box-shadow: none; }
.floor-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 340px; min-width: 0; }
.floor-stats li { padding: 4px 10px; border-radius: 99px; font-size: 0.82rem; background: rgba(255, 255, 255, 0.75); border: 1px solid var(--line); white-space: nowrap; }
.floor-stats li.fs-free { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.floor-stats li.fs-occupied { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.floor-stats li.fs-reserved { color: #5b21b6; background: rgba(139, 92, 246, 0.15); border-color: transparent; }
.floor-stats li.fs-soon { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.floor-bar .floor-tools { align-items: center; margin-left: auto; }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 270px; padding: 6px; border-radius: 14px;
  display: flex; flex-direction: column; gap: 2px; background: var(--glass-strong);
}
.menu-pop form { margin: 0; }
.menu-pop .menu-item {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; border: 0; box-shadow: none;
  background: transparent; color: var(--text); font: inherit; font-size: 0.92rem; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer;
}
.menu-pop .menu-item:hover, .menu-pop .menu-item:focus-visible { background: var(--primary-soft); filter: none; transform: none; }
.floor-body { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.floor-stage { margin: 0; padding: 12px; min-width: 0; overflow: auto; }
.floor-side { min-width: 0; }
.floor-panel { margin: 0; }
.floor-panel .sub { margin: 10px 0; padding: 12px; }
details.sub > summary { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.is-editing .floor-stage { box-shadow: 0 0 0 2px var(--primary-2), var(--shadow); }
.is-editing .floor-svg .floor-bg { stroke: var(--primary-2); stroke-width: 3; stroke-dasharray: 12 8; }
@media (min-width: 1100px) {
  body.wide main { height: 100vh; display: flex; flex-direction: column; padding: 14px 18px; }
  body.wide main > .floor-app { flex: 1; min-height: 0; }
  .floor-body { flex: 1; min-height: 0; grid-template-columns: minmax(0, 1fr) 360px; }
  .floor-stage { display: flex; align-items: center; justify-content: center; }
  .floor-stage .floor-svg { width: 100%; height: 100%; min-width: 0; }
  .floor-side { overflow: auto; }
}
@media (max-width: 760px) {
  .floor-stage .floor-svg { min-width: 720px; }
  .day-chips { flex: 1 1 calc(100% - 100px); }
  .day-chip { flex: 0 0 54px; }
  .day-pick { flex: 1 0 100%; }
  .day-pick input[type='date'] { flex: 1; }
}

/* admin, nuova attività: si vedono solo i campi del tipo scelto (senza JS, con :has; senza :has si vedono tutti) */
.newtenant:has(input[name='vertical'][value='restaurant']:checked) .only-appt { display: none; }
.newtenant:has(input[name='vertical']:checked):not(:has(input[name='vertical'][value='restaurant']:checked)) .only-rest { display: none; }
.demo-creds { border: 2px solid var(--primary-2); }

/* ── colori dei tavoli (richiesta soci 2026-10-29): libero bianco, prenotato giallo, occupato verde,
      occupato con la prenotazione successiva entro 20 minuti rosso ── */
.ft-free .ft-top { fill: #ffffff; stroke: #94a3b8; }
.ft-free .ft-chair { fill: #ffffff; stroke: #cbd5e1; }
.ft-reserved .ft-top { fill: #fef9c3; stroke: #ca8a04; }
.ft-soon .ft-top { fill: #fde68a; stroke: #d97706; }
.ft-occupied .ft-top { fill: #bbf7d0; stroke: #16a34a; }
.ft-occupied .ft-chair { fill: #86efac; stroke: #16a34a; }
.ft-long .ft-top { fill: #bbf7d0; stroke: #15803d; stroke-dasharray: 8 4; stroke-width: 3.5; }
.ft-long .ft-chair { fill: #86efac; stroke: #15803d; }
.ft-turnover .ft-top { fill: #fecaca; stroke: #dc2626; animation: ft-soon 1.2s ease-in-out infinite; }
.ft-turnover .ft-chair { fill: #fca5a5; stroke: #dc2626; }
.pill.fs-free { color: #334155; background: #ffffff; border-color: #cbd5e1; }
.pill.fs-reserved { color: #854d0e; background: #fef9c3; border-color: transparent; }
.pill.fs-soon { color: #92400e; background: #fde68a; border-color: transparent; }
.pill.fs-occupied, .pill.fs-long { color: #166534; background: #bbf7d0; border-color: transparent; }
.pill.fs-turnover { color: #991b1b; background: #fecaca; border-color: transparent; }
.floor-stats li.fs-free { color: #334155; background: #fff; border-color: #cbd5e1; }
.floor-stats li.fs-reserved { color: #854d0e; background: #fef9c3; }
.floor-stats li.fs-occupied { color: #166534; background: #bbf7d0; }
@media print { .ft-turnover .ft-top { animation: none; } }

/* ── menu accanto al tavolo (popover) ── */
.tpop { position: fixed; inset: auto; margin: 0; width: min(380px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto; padding: 16px;
  background: #fffdfb; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 24px 60px -20px rgba(30, 30, 60, 0.45); }
.tpop::backdrop { background: rgba(23, 24, 28, 0.08); }
.tpop h2 { margin: 0; }
@media (max-width: 639px) { .tpop { left: 8px; right: 8px; bottom: 8px; top: auto; width: auto; max-height: 75vh; } }
/* unione di tavoli con pressione lunga */
.floor-svg:not(.moving) .ft { -webkit-touch-callout: none; touch-action: none; }
.link-line { stroke: var(--primary-2); stroke-width: 5; stroke-dasharray: 10 8; stroke-linecap: round; pointer-events: none; }
.ft.link-src .ft-top, .ft.link-target .ft-top { stroke: var(--primary-2); stroke-width: 6; }
.floor-svg.linking { cursor: crosshair; }

/* ── Oggi: gruppi da arrivare / in sala / usciti ── */
@media (min-width: 1100px) { .today-cols { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); } }
.kpis-side { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .kpis-side { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpis-side .kpi { padding: 12px; }
.kpis-side .kpi-num { font-size: 1.6rem; }
.tgroup { border-radius: var(--radius); margin: 10px 0; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.45); }
.tgroup > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.tgroup > summary::-webkit-details-marker { display: none; }
.tgroup > summary::after { content: '▾'; margin-left: auto; color: var(--muted); transition: transform 0.15s; }
.tgroup:not([open]) > summary::after { transform: rotate(-90deg); }
.tgroup > summary b { font-size: 1.02rem; }
.tg-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--tg); }
.tg-count { min-width: 26px; padding: 1px 8px; border-radius: 99px; text-align: center; font-weight: 800; color: #fff; background: var(--tg); }
.tg-sub { color: var(--muted); font-size: 0.85rem; }
.tgroup .timeline { padding: 0 10px 10px; }
.tgroup .tl-item { border-left: 4px solid var(--tg); }
.tg-empty { margin: 0; padding: 0 14px 12px; }
.tg-come { --tg: #ca8a04; }
.tg-room { --tg: #16a34a; }
.tg-left { --tg: #64748b; }
.tg-noshow { --tg: #dc2626; }
.tg-left .tl-item, .tg-noshow .tl-item { opacity: 0.75; }
.tag-table { text-decoration: none; color: #166534; background: #dcfce7; border-color: transparent; }
.tag-notable { color: #854d0e; background: #fef9c3; border-color: transparent; }
/* pop-up del walk-in */
.walkin-card .walkin-open, .appt-walkin .walkin-open { width: 100%; justify-content: center; }
.pop { position: fixed; inset: 0; margin: auto; width: min(420px, calc(100vw - 24px)); height: fit-content; max-height: calc(100vh - 24px); overflow: auto;
  padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--glass-border); background: #fffdfb; box-shadow: 0 30px 80px -20px rgba(30, 30, 60, 0.5); }
.pop::backdrop { background: rgba(23, 24, 28, 0.4); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.pop h2 { margin-top: 0; }

/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   TEMA iOS (2026-10-29): vetro chiaro e sfocato, angoli ampi, controlli a pillola, pochi bordi,
   tipografia di sistema, meno testo e più icone. Sta in fondo: prevale sulle regole precedenti.
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
:root {
  --text: #1c1c1e;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, 0.12);
  --glass: rgba(255, 255, 255, 0.6);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-border: rgba(255, 255, 255, 0.7);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -14px rgba(30, 30, 60, 0.18);
  --radius: 16px;
  --radius-lg: 22px;
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.07);
  --primary: #c2410c;
  --primary-2: #ea580c;
  --primary-soft: rgba(234, 88, 12, 0.12);
  --ok: #248a3d;
  --ok-bg: rgba(52, 199, 89, 0.16);
  --warn: #a05a00;
  --warn-bg: rgba(255, 204, 0, 0.22);
  --danger: #d70015;
  --danger-bg: rgba(255, 59, 48, 0.13);
  --info: #0040dd;
  --info-bg: rgba(0, 122, 255, 0.13);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, sans-serif;
  letter-spacing: -0.01em;
}
body.v-admin { --primary: #3634a3; --primary-2: #5856d6; --primary-soft: rgba(88, 86, 214, 0.13); }
body {
  background-color: #f2f2f7;
  background-image:
    radial-gradient(900px 620px at -5% -10%, rgba(255, 149, 0, 0.2), transparent 62%),
    radial-gradient(760px 520px at 105% 0%, rgba(255, 45, 85, 0.12), transparent 60%),
    radial-gradient(900px 700px at 55% 115%, rgba(52, 199, 89, 0.14), transparent 62%);
}
body.v-admin {
  background-color: #f2f2f7;
  background-image:
    radial-gradient(900px 620px at -5% -10%, rgba(88, 86, 214, 0.2), transparent 62%),
    radial-gradient(760px 520px at 105% 0%, rgba(90, 200, 250, 0.18), transparent 60%),
    radial-gradient(900px 700px at 55% 115%, rgba(255, 45, 85, 0.1), transparent 62%);
}
.glass, .card, .stat, .kpi, .side, .tl-item, .tcard, .auth-card, table {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 0.5px solid var(--glass-border);
  box-shadow: var(--shadow);
}
h1 { font-size: 2.05rem; font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
h3 .ico { width: 16px; height: 16px; }
.hint { font-size: 0.82rem; color: var(--muted); }
label { font-weight: 600; font-size: 0.86rem; color: #3a3a3c; }
label .ico { width: 15px; height: 15px; vertical-align: -3px; }
.ico { stroke-width: 1.8; }

/* barra laterale */
.side nav a { border-radius: 12px; font-weight: 500; }
.side nav a .ico { width: 28px; height: 28px; padding: 5px; border-radius: 8px; background: var(--fill); }
.side nav a[aria-current='page'] { background: rgba(255, 255, 255, 0.9); color: var(--text); font-weight: 650; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.side nav a[aria-current='page'] .ico { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; }
.brand-mark { border-radius: 12px; }

/* campi in stile iOS: riempimento grigio, niente bordo */
input[type='text'], input[type='email'], input[type='password'], input[type='tel'], input[type='number'],
input[type='date'], input[type='time'], input[type='url'], input[type='search'], select, textarea {
  background: var(--fill); border: 1px solid transparent; border-radius: 12px; min-height: 44px;
}
input:focus, select:focus, textarea:focus { background: #fff; border-color: var(--primary-2); box-shadow: 0 0 0 4px var(--primary-soft); }

/* pulsanti a pillola */
button, .btn { border-radius: 999px; min-height: 44px; padding: 10px 18px; box-shadow: none; background: var(--primary-2); }
button:hover, .btn:hover { transform: none; filter: brightness(1.06); }
button:active, .btn:active { transform: scale(0.97); }
button.secondary, .btn.secondary { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
button.secondary:hover, .btn.secondary:hover { background: rgba(234, 88, 12, 0.18); }
body.v-admin button.secondary:hover, body.v-admin .btn.secondary:hover { background: rgba(88, 86, 214, 0.2); }
button.ok, .btn.ok { background: #34c759; box-shadow: none; }
button.danger, .btn.danger { background: #ff3b30; box-shadow: none; }
button.small, .btn.small { min-height: 34px; padding: 6px 12px; border-radius: 999px; font-size: 0.84rem; }
.icon-btn, button.icon-btn, .btn.icon-btn { width: 34px; min-width: 34px; padding: 0; }
.danger-ico { color: #ff3b30; background: var(--danger-bg); }
button.danger-ico:hover { background: rgba(255, 59, 48, 0.2); }

/* etichette */
.tag, .pill { border-radius: 999px; font-weight: 600; font-size: 0.78rem; padding: 3px 10px; border: 0; }
.tag { background: var(--fill); }
.pill::before { width: 6px; height: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--fill); color: #3a3a3c; white-space: nowrap; }
.chip .ico { width: 14px; height: 14px; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.warn-ico { display: inline-grid; place-items: center; color: var(--warn); }
.warn-ico .ico { width: 18px; height: 18px; }

/* tabelle: righe alternate bianca / grigina */
table { border-radius: var(--radius-lg); }
th { background: rgba(255, 255, 255, 0.7); font-size: 0.72rem; }
tbody tr:nth-child(odd) { background: rgba(255, 255, 255, 0.92); }
tbody tr:nth-child(even) { background: rgba(229, 229, 234, 0.75); }
tbody tr:hover { background: rgba(234, 88, 12, 0.08); }
th, td { border-bottom: 0; }

/* indicatori */
.kpi-ico { border-radius: 10px; width: 34px; height: 34px; }
.kpi-num { font-size: 1.8rem; letter-spacing: -0.04em; }
.kpi-label { font-size: 0.86rem; color: #3a3a3c; }

/* liste e linea del tempo */
.tl-item { border-radius: 16px; background: rgba(255, 255, 255, 0.85); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.tl-time { border-radius: 12px; background: var(--fill); border: 0; }
.tl-meta .ico { width: 14px; height: 14px; }
.plist li { background: rgba(255, 255, 255, 0.88); border: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); border-radius: 14px; }
.tgroup { background: rgba(255, 255, 255, 0.35); border: 0; }
.tg-sub { display: inline-flex; align-items: center; gap: 4px; }
.tg-sub .ico { width: 14px; height: 14px; }

/* pop-up (foglio iOS) */
.pop, .tpop { border-radius: 24px; border: 0; background: rgba(255, 255, 255, 0.95); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); }
.pop-wide { width: min(640px, calc(100vw - 24px)); }
.pop h2 .ico { width: 20px; height: 20px; vertical-align: -3px; }
.tpop h3 { margin: 14px 0 8px; }
.tpop .walkin button { min-height: 46px; border-radius: 14px; }

/* controllo segmentato */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--fill); }
.seg a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 9px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 0.88rem; }
.seg a .ico { width: 16px; height: 16px; }
.seg a[aria-current='page'] { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.page-seg { margin-bottom: 14px; }

/* interruttori iOS */
.switch { position: relative; display: flex; align-items: center; gap: 12px; margin: 8px 0; font-weight: 500; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 51px; height: 31px; margin: 0; cursor: pointer; z-index: 1; }
.switch-ui { position: relative; flex: none; width: 51px; height: 31px; border-radius: 999px; background: rgba(120, 120, 128, 0.16); transition: background-color 0.2s; }
.switch-ui::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16); transition: transform 0.2s; }
.switch input:checked + .switch-ui { background: #34c759; }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--primary-2); outline-offset: 2px; }
.perm-list { border: 0; padding: 0; margin: 6px 0 12px; display: grid; gap: 2px; }
.switches { display: flex; flex-wrap: wrap; gap: 4px 20px; }

/* caselle a gettone (servizi, operatori) */
.chip-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { position: relative; display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 7px 12px; border-radius: 999px; background: var(--fill); font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.chip-check input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.chip-check:has(input:checked) { background: var(--primary-2); color: #fff; }
.chip-check:has(input:checked) .dot { background: #fff; }
.chip-check:has(input:focus-visible) { outline: 3px solid var(--primary-2); outline-offset: 2px; }
.grid3 { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .grid3 { grid-template-columns: 1fr 1fr; } }
details.more > summary, details.usec > summary { cursor: pointer; font-weight: 600; color: var(--primary); padding: 8px 0; display: flex; align-items: center; gap: 8px; }

/* servizi */
.svc-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 14px; }
.svc-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 20px; }
.svc-card.is-off { opacity: 0.6; }
.svc-head { display: flex; align-items: center; gap: 8px; }
.svc-head b { font-size: 1.02rem; flex: 1; min-width: 0; }
.svc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.svc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.avatars { display: inline-flex; align-items: center; }
.av { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: -6px; border-radius: 50%; font-size: 0.68rem; font-weight: 800; color: #fff; background: var(--sc, var(--primary)); border: 2px solid #fff; }
.av:first-child { margin-left: 0; }
.svc-new, .staff-new { min-height: 140px; border: 2px dashed rgba(60, 60, 67, 0.2); background: rgba(255, 255, 255, 0.4); color: var(--primary); flex-direction: column; justify-content: center; align-items: center; gap: 8px; font-weight: 700; box-shadow: none; border-radius: 20px; }
.svc-new .ico, .staff-new .ico { width: 30px; height: 30px; }
.svc-new:hover, .staff-new:hover { background: rgba(255, 255, 255, 0.75); }

/* operatori */
.staff-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.staff-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 22px; }
.staff-card.is-off { opacity: 0.6; }
.staff-head { display: flex; align-items: center; gap: 12px; }
.staff-title { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.staff-title b { font-size: 1.05rem; }
.staff-av { width: 46px; height: 46px; border-radius: 50%; font-size: 1rem; }
.week-dots { display: flex; gap: 5px; }
.wd { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 0.74rem; font-weight: 700; color: var(--muted); background: var(--fill-2); }
.wd.on { color: #fff; background: var(--sc, var(--primary-2)); }
.wd.today { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--sc, var(--primary-2)); }
.off-line { display: flex; align-items: center; gap: 6px; margin: 0; }
.off-line .ico { width: 15px; height: 15px; color: #ff9500; }
.staff-actions { display: flex; gap: 8px; margin-top: auto; }
.op-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.op-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; min-height: 36px; border-radius: 999px; background: rgba(255, 255, 255, 0.75); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.88rem; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); border: 0; }
button.op-chip:hover { background: #fff; filter: none; }
.op-chip[aria-current='page'] { background: var(--sc, var(--primary-2)); color: #fff; }
.op-chip[aria-current='page'] .dot { background: #fff; }
.op-chip .ico { width: 16px; height: 16px; }

/* utenti */
.ugrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-bottom: 16px; }
.ucard { padding: 16px; border-radius: 22px; display: flex; flex-direction: column; gap: 6px; }
.ucard-head { display: flex; align-items: center; gap: 12px; }
.ucard-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ucard-title .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usec-count { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.usec form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.usec input[type='password'] { max-width: 280px; }
.ucard-del { margin-top: 6px; }
.new-user h2 .ico, .card h2 .ico { width: 20px; height: 20px; vertical-align: -4px; margin-right: 4px; }

/* recensioni */
.review-mode { display: flex; align-items: center; gap: 14px; }
.review-mode > div { flex: 1; }
.review-mode p { margin: 2px 0 0; }
.kpi-icon-sm { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #ffcc00, #ff9500); }
.review-list label { width: 100%; align-items: center; margin: 0; }

/* agenda: barra, settimana, assenze, riposo */
.ag-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; }
.ag-toolbar .live { margin-left: auto; }
.ag-day { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--text); line-height: 1.1; flex: 1; }
.ag-day small { font-size: 0.68rem; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.ag-day b { font-size: 1.15rem; }
.ag-day.is-today b { color: #fff; background: #ff3b30; border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; }
.ag-off { flex-direction: column; gap: 6px; color: #a05a00; background: repeating-linear-gradient(45deg, rgba(255, 204, 0, 0.16) 0 8px, rgba(255, 255, 255, 0.4) 8px 16px); }
.ag-off .ico { width: 26px; height: 26px; color: #ff9500; }
.ag-rest { z-index: 1; display: grid; place-items: center; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 0.85rem; background: var(--fill-2); }
.ag-now-col { z-index: 4; height: 2px; background: #ff3b30; align-self: start; pointer-events: none; }
.ag-head .pill { font-size: 0.68rem; padding: 1px 7px; }

/* azioni rapide a icone */
.quick-icons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 10px; }
.qi { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; text-decoration: none; color: var(--text); font-size: 0.78rem; font-weight: 600; }
.qi .ico { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-2); }
.qi:hover { background: rgba(255, 255, 255, 0.7); }
.walkin-card { padding: 10px; }
.walkin-card .walkin-open { width: 100%; min-height: 54px; font-size: 1rem; }

/* sala */
.ft-label { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif; font-weight: 700; }
.floor-bg { fill: rgba(255, 255, 255, 0.7); stroke: rgba(60, 60, 67, 0.1); }
.room-tabs a { border-radius: 14px; border: 0; }
.day-chip { border: 0; background: rgba(255, 255, 255, 0.7); }
.pop-confirm { width: min(340px, calc(100vw - 24px)); text-align: center; } .pop-confirm .row { justify-content: center; }
/* contrasto AA (4.5:1) con testo bianco: tinte iOS scurite dove servono */
:root { --primary: #9a3412; --primary-2: #c2410c; }
button.ok, .btn.ok { background: #1a7431; }
button.danger, .btn.danger { background: #d70015; }
.danger-ico { color: #d70015; }
.sc-blue { --sc: #1d4ed8; }
.sc-green { --sc: #15803d; }
.sc-violet { --sc: #6d28d9; }
.sc-orange { --sc: #c2410c; }
.sc-pink { --sc: #be185d; }
.sc-teal { --sc: #0f766e; }
.sc-amber { --sc: #b45309; }
.sc-slate { --sc: #475569; }
.ag-day.is-today b { background: #d70015; }

/* ── Sala v3: comandi sopra la pianta (giorni in alto a sx, matita in alto a dx, sale in basso al centro) ── */
.floor-stage { position: relative; padding: 0; overflow: hidden; }
.floor-scroll { overflow: auto; -webkit-overflow-scrolling: touch; padding: 64px 12px 72px; width: 100%; height: 100%; }
.floor-stage .empty { padding: 80px 16px; }
.fo { position: absolute; z-index: 5; display: flex; align-items: center; gap: 6px; }
.fo-tl { top: 10px; left: 10px; right: 150px; flex-wrap: wrap; }
.fo-tr { top: 10px; right: 10px; }
.fo-bc { bottom: 10px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 20px); }
.glass { -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.daynav { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.78); box-shadow: 0 4px 16px -8px rgba(30, 30, 60, 0.35); }
.daynav a, .daynav button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 30px; border: 0; box-shadow: none; text-decoration: none; color: var(--text); font: inherit; background: transparent; cursor: pointer; }
.dn-day { padding: 4px 11px; border-radius: 99px; font-size: 0.82rem; font-weight: 600; }
.dn-arrow { width: 30px; border-radius: 50%; padding: 0; }
.dn-cal { min-width: 30px; padding: 0 8px; border-radius: 99px; font-size: 0.8rem; font-weight: 600; }
.daynav .ico { width: 16px; height: 16px; }
.daynav a:hover, .daynav button:hover { background: rgba(120, 120, 128, 0.14); transform: none; filter: none; }
.daynav .dn-day[aria-current='date'], .daynav .dn-cal.on { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; }
.day-pop { width: min(300px, calc(100vw - 24px)); }
.day-pop .day-pick { display: flex; gap: 8px; align-items: center; margin: 0; }
.day-pop input[type='date'] { flex: 1; }
.day-tag { background: rgba(255, 255, 255, 0.8); }
.round { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.round .ico { width: 18px; height: 18px; margin: 0; }
a.round.secondary, button.round.secondary, summary.round.secondary { background: rgba(255, 255, 255, 0.85); color: var(--text); border: 0; box-shadow: 0 4px 16px -8px rgba(30, 30, 60, 0.4); }
.round.on, a.round.on, button.round.on { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; border-color: transparent; }
.rooms-dock { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 18px; background: rgba(255, 255, 255, 0.62); box-shadow: 0 8px 24px -12px rgba(30, 30, 60, 0.45); overflow-x: auto; scrollbar-width: none; }
.rooms-dock::-webkit-scrollbar { display: none; }
.rooms-dock a { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 14px; text-decoration: none; color: var(--text); font-size: 0.86rem; font-weight: 600; white-space: nowrap; }
.rooms-dock a small { color: var(--muted); font-size: 0.72rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.rooms-dock a:hover { background: rgba(120, 120, 128, 0.14); }
.rooms-dock a[aria-current='page'] { background: #fff; box-shadow: 0 2px 8px -3px rgba(30, 30, 60, 0.35); }
.rd-add { width: 30px; height: 30px; min-height: 30px; padding: 0; border-radius: 50%; border: 0; background: transparent; color: var(--muted); box-shadow: none; }
.rd-add .ico { width: 16px; height: 16px; margin: 0; }
.floor-panel .floor-stats { margin: 4px 0 10px; }
.icon-only { padding-left: 9px; padding-right: 9px; }
.icon-only .ico { margin: 0; }
.pick-banner { position: absolute; z-index: 6; top: 58px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 16px; background: rgba(255, 251, 235, 0.94); box-shadow: 0 8px 24px -12px rgba(30, 30, 60, 0.45); font-weight: 600; font-size: 0.9rem; white-space: nowrap; max-width: calc(100% - 20px); }
.pick-banner span { overflow: hidden; text-overflow: ellipsis; }
.floor-svg.picking .ft { cursor: crosshair; }
.floor-svg.picking .ft:hover .ft-top { stroke: var(--primary-2); stroke-width: 6; }
@media (min-width: 1100px) {
  .floor-stage { display: block; }
  .floor-scroll { display: flex; align-items: center; justify-content: center; }
  .floor-scroll .floor-svg { width: 100%; height: 100%; min-width: 0; }
}
@media (max-width: 760px) {
  .floor-scroll .floor-svg { min-width: 720px; }
  .fo-tl { right: 96px; }
  .dn-day { padding: 4px 8px; }
}

/* elementi fissi: entrata, cassa, passaggio, bagno (freccia con la base contro il muro) */
.fx { --fxc: #2563eb; }
.fx-entrance { --fxc: #15803d; }
.fx-cashier { --fxc: #1d4ed8; }
.fx-door { --fxc: #7c3aed; }
.fx-wc { --fxc: #0e7490; }
.fx-hit { fill: color-mix(in srgb, var(--fxc) 10%, transparent); stroke: none; }
.fx-base { fill: var(--fxc); }
.fx-arrow { fill: none; stroke: var(--fxc); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.fx-label { font: 700 12px -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif; fill: #17181c; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
a.fx { cursor: pointer; }
.fx.sel .fx-hit, .fx:focus-visible .fx-hit { stroke: #17181c; stroke-width: 3; }
.floor-svg.moving .fx { cursor: grab; touch-action: none; }

/* modifica: barra di aggiunta, selezione, trascinamento */
.palette { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px; border-radius: 16px; background: rgba(255, 255, 255, 0.82); box-shadow: 0 6px 20px -10px rgba(30, 30, 60, 0.45); }
.palette form { display: contents; }
.palette .hint { margin: 0 8px; }
.pal-item { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 40px; padding: 3px 5px; border-radius: 11px; border: 0; background: transparent; box-shadow: none; color: var(--text); cursor: grab; touch-action: none; }
.pal-item:hover, .pal-item:focus-visible { background: var(--primary-soft); transform: none; filter: none; }
.pal-item .shape-prev { width: 40px; height: 22px; }
.pal-item .fx-prev { width: 22px; height: 22px; }
.pal-fx span { font-size: 0.64rem; font-weight: 700; line-height: 1; }
.pal-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: rgba(60, 60, 67, 0.18); }
.pal-ghost { position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, -50%); padding: 6px; border-radius: 12px; background: rgba(255, 255, 255, 0.9); box-shadow: 0 10px 24px -8px rgba(30, 30, 60, 0.5); }
.pal-ghost svg { display: block; width: 56px; height: 32px; }
.floor-svg.drop-on .floor-bg { stroke: var(--ok); stroke-width: 4; stroke-dasharray: none; }
.sel-band { fill: color-mix(in srgb, var(--primary-2) 10%, transparent); stroke: var(--primary-2); stroke-width: 2; stroke-dasharray: 6 4; pointer-events: none; }
.floor-svg.moving .ft.sel .ft-top { stroke: var(--primary-2); stroke-width: 5; }
.ft.dragging, .fx.dragging { cursor: grabbing; opacity: 0.9; }
.save-state { margin-left: auto; font-size: 0.82rem; font-weight: 600; color: var(--ok); }
.save-state.err { color: var(--danger); }
.insp-tools { margin-top: 10px; gap: 8px; }
.insp-tools .seg button { min-height: 34px; }
.insp-tools [data-delete] { margin-left: auto; }
button.armed { animation: armed 0.8s ease-in-out infinite; }
@keyframes armed { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 35%, transparent); } }
fieldset.shapes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
fieldset.shapes .shape-tile { padding: 6px 2px; }
fieldset.sides { border: 0; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; min-width: 0; }
fieldset.sides legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.side-opt { position: relative; margin: 0; }
.side-opt input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.side-tile { display: flex; justify-content: center; padding: 6px; border-radius: 12px; border: 2px solid var(--line); background: rgba(255, 255, 255, 0.7); }
.side-prev { width: 36px; height: 36px; --fxc: #475569; }
.side-opt input:checked + .side-tile { border-color: var(--primary-2); background: var(--primary-soft); }
.side-opt input:checked + .side-tile .side-prev { --fxc: var(--primary-2); }
.side-opt input:focus-visible + .side-tile { outline: 3px solid var(--primary-2); outline-offset: 2px; }
@media print { .fo, .pick-banner { display: none; } button.armed { animation: none; } }
@media (prefers-reduced-motion: reduce) { button.armed { animation: none; } }

/* Oggi: pulsanti in alto a destra, approva (giallo), fai uscire */
.today-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.today-actions button { min-height: 42px; }
button.approve { background: #facc15; color: #422006; border-color: transparent; }
button.approve:hover { background: #eab308; }
button.leave { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pop-form .grid2 { margin-top: 2px; }
.pop-form label { margin-top: 8px; }

/* menu laterale richiudibile (tablet/computer): pulsante accanto al nome del locale, resta solo la colonna di icone */
.brand-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.brand-row .brand { flex: 1 1 auto; min-width: 0; }
.side-toggle { display: none; }
@media (min-width: 960px) {
  .shell { transition: grid-template-columns 0.2s ease; }
  .brand-row { padding: 0 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
  .brand-row .brand { padding: 0 4px; border-bottom: 0; margin-bottom: 0; }
  .side-toggle:not([hidden]) { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 10px; border: 0; background: transparent; color: var(--muted); box-shadow: none; }
  .side-toggle:hover { background: var(--fill); color: var(--text); transform: none; filter: none; }
  .side-toggle .ico { width: 20px; height: 20px; margin: 0; }
  body.nav-min .shell { grid-template-columns: 84px minmax(0, 1fr); }
  body.nav-min .side { padding: 18px 10px; }
  body.nav-min .brand-row { flex-direction: column; gap: 10px; }
  body.nav-min .brand { justify-content: center; }
  body.nav-min .brand-text, body.nav-min .side nav a span, body.nav-min .side-foot .hide-sm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  body.nav-min .side nav a { justify-content: center; padding: 8px; }
  body.nav-min .side-toggle .ico { transform: scaleX(-1); }
  body.nav-min .side-foot button { padding-left: 0; padding-right: 0; justify-content: center; }
}

/* Sala: elenco delle sale un po' più in alto, livelli in basso a destra */
.fo-bc { bottom: 28px; }
.fo-br { bottom: 28px; right: 14px; }
.floor-scroll { padding-bottom: 96px; }
.layers-pop, .decor-pop { inset: auto; margin: 0; }
.layers-pop { width: min(320px, calc(100vw - 24px)); padding: 16px; }
.layers-pop::backdrop, .decor-pop::backdrop { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.layers-pop h2 { margin-bottom: 8px; }
.ly-opts { border: 0; padding: 0; margin: 0 0 6px; display: grid; gap: 2px; min-width: 0; }
.ly-opts legend { padding: 0; margin-bottom: 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.ly-opt { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 7px 10px; border-radius: 12px; cursor: pointer; font-weight: 500; }
.ly-opt input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary-2); }
.ly-opt span { display: flex; flex-direction: column; min-width: 0; }
.ly-opt small { color: var(--muted); font-size: 0.76rem; line-height: 1.3; }
.ly-opt:has(input:checked) { background: var(--primary-soft); }
.layers-pop .switches { border-top: 1px solid var(--line); padding-top: 6px; }
.layers-pop .switch { margin: 6px 0; }

/* livelli sulla pianta */
.floor-svg .ft .ly-orari, .floor-svg .ft .ly-nomi, .floor-svg .ft .ly-coperti, .ft-dur { display: none; }
.lbl-orari .ft .ly-stato, .lbl-nomi .ft .ly-stato, .lbl-coperti .ft .ly-stato { display: none; }
.lbl-orari .ft .ly-orari, .lbl-nomi .ft .ly-nomi, .lbl-coperti .ft .ly-coperti, .show-dur .ft-dur { display: inline; }
.lbl-orari .ft .ly-orari { font-variant-numeric: tabular-nums; font-weight: 700; }
.no-chairs .ft-chair, .no-grid .floor-grid, .no-decor .fx-decor:not(.fx-wall) { display: none; }
.ft-dur-bg { fill: rgba(23, 24, 28, 0.14); }
.ft-dur-fill { fill: #16a34a; }
.ft-dur-fill.near { fill: #d97706; }
.ft-dur-fill.late { fill: #dc2626; }

/* arredi: muri, divani, poltrone, piante, bancone, colonne */
.fx-decor .fx-hit { fill: transparent; }
.fx-wall { fill: #3f3f46; }
.fx-soft { fill: #e2d4c3; stroke: #a8927a; stroke-width: 1.5; }
.fx-soft-dark { fill: #c9b49b; }
.fx-seam { stroke: #a8927a; stroke-width: 1.5; }
.fx-leaf { fill: #86efac; stroke: #15803d; stroke-width: 1.2; }
.fx-leaf-dark { fill: #15803d; }
.fx-counter { fill: #92400e; }
.fx-counter-top { fill: #d97706; }
.fx-column { fill: #71717a; }
.fx-decor.sel .fx-hit, .fx-decor:focus-visible .fx-hit { fill: color-mix(in srgb, var(--primary-2) 12%, transparent); stroke: var(--primary-2); stroke-width: 2.5; stroke-dasharray: 6 4; }
.floor-svg.walling { cursor: crosshair; }
.floor-svg.walling .ft, .floor-svg.walling .fx { pointer-events: none; }
.wall-draft { fill: color-mix(in srgb, var(--primary-2) 70%, transparent); pointer-events: none; }
.pal-item.on { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary-2); }
.pal-item .fx-prev.wide { width: 34px; height: 22px; }
.decor-pop { width: min(380px, calc(100vw - 24px)); padding: 14px; }
.decor-pop h2 { margin-bottom: 4px; }
.decor-pop .hint { margin: 0 0 10px; }
.decor-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; }
.decor-grid .pal-item { min-height: 70px; gap: 4px; padding: 6px 4px; background: var(--fill); }
.decor-grid .pal-item span { font-size: 0.7rem; text-align: center; }
.fx-prev.deco { width: 54px; height: 30px; }
.decor-pop.drag-out { opacity: 0.2; }

/* menu del tavolo: intestazione con i comandi, righe compatte, gruppi */
.tpop { width: min(400px, calc(100vw - 16px)); padding: 14px 14px 16px; }
.tpop:focus, .tpop:focus-visible { outline: none; }
.tp-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.tp-title { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.tp-title h2 { margin: 0; font-size: 1.15rem; }
.tp-sub { flex-basis: 100%; font-size: 0.8rem; color: var(--muted); }
.tp-tools { display: flex; gap: 6px; flex: none; }
.tp-tools form { margin: 0; }
.tp-tools button, .tp-tools .btn { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.tp-tools button.on { background: #374151; color: #fff; }
.tp h3 { margin: 0 0 6px; font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.tp-sec { margin-top: 14px; }
.tp-sec .hint { margin: 0 0 6px; }
.plist2 { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.prow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 8px 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.9); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.pr-time { font-weight: 700; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.pr-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pr-name { font-weight: 650; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.pr-name:hover { text-decoration: underline; }
.pr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 0.76rem; color: var(--muted); }
.pr-meta > * + *::before { content: '·'; margin-right: 6px; color: var(--muted); font-weight: 400; }
.pr-meta .pr-st { background: none; font-weight: 700; }
.pr-meta .st-requested { color: #a16207; }
.pr-meta .st-arrived { color: var(--info); }
.pr-tb { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: #166534; }
.pr-warn { display: inline-flex; color: #b45309; }
.pr-tb .ico, .pr-warn .ico { width: 13px; height: 13px; }
.pr-act { display: flex; align-items: center; gap: 4px; }
.pr-act form { margin: 0; }
.pr-act button, .pr-act .btn { min-height: 34px; }
.tp-seated { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; padding: 12px; border-radius: 16px; background: rgba(187, 247, 208, 0.55); }
.tp-seated .pr-name { font-size: 1.02rem; }
.tp-seated .hint { margin: 4px 0 0; }
.tp-seated-act { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.tp-seated-act .grow { flex: 1 1 auto; }
.tp-seated-act .grow button { width: 100%; }
.tp-more summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--fill); cursor: pointer; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.tp-more summary::-webkit-details-marker { display: none; }
.tp-more summary .count { margin-left: auto; padding: 1px 8px; border-radius: 99px; background: #fff; color: var(--text); letter-spacing: 0; }
.tp-more summary::after { content: '›'; font-size: 1.1rem; line-height: 1; transition: transform 0.15s; }
.tp-more[open] summary::after { transform: rotate(90deg); }
.tp-more[open] summary { margin-bottom: 6px; }
.wide-btn { width: 100%; justify-content: center; }
.tp .walkin { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.tp .walkin button { min-height: 40px; font-size: 1rem; border-radius: 12px; }
@media (max-width: 639px) { .tp .walkin { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 639px) { .tpop { width: auto; } .layers-pop { left: 8px; right: 8px; bottom: 8px; width: auto; } }
@media (max-width: 760px) {
  .fo-bc { left: 12px; transform: none; max-width: calc(100% - 76px); }
}
@media (max-width: 440px) {
  .daynav .dn-arrow { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   Tema scuro. Segue il sistema (`color-scheme: light dark`); il tasto nel menu laterale lo forza con
   `data-theme` su <html> (cookie di preferenza `mep_tema`, letto dal server). Ogni colore è scritto una volta
   con light-dark(chiaro, scuro): il browser sceglie in base al tema. Sta in fondo: prevale su tutto.
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
:root { color-scheme: light dark; }
:root[data-theme='light'] { color-scheme: light; }
:root[data-theme='dark'] { color-scheme: dark; }
:root {
  --text: light-dark(#1c1c1e, #f2f2f7);
  --muted: light-dark(#6e6e73, #a1a1aa);
  --line: light-dark(rgba(60, 60, 67, 0.12), rgba(255, 255, 255, 0.1));
  --glass: light-dark(rgba(255, 255, 255, 0.6), rgba(30, 30, 34, 0.7));
  --glass-strong: light-dark(rgba(255, 255, 255, 0.86), rgba(40, 40, 46, 0.9));
  --glass-border: light-dark(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.08));
  --shadow: 0 1px 2px light-dark(rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.4)), 0 12px 32px -14px light-dark(rgba(30, 30, 60, 0.18), rgba(0, 0, 0, 0.7));
  --fill: light-dark(rgba(118, 118, 128, 0.12), rgba(118, 118, 128, 0.26));
  --fill-2: light-dark(rgba(118, 118, 128, 0.07), rgba(118, 118, 128, 0.16));
  /* superfici "bianche" (righe, schede, pop-up) e il loro equivalente scuro */
  --surface: light-dark(rgba(255, 255, 255, 0.9), rgba(44, 44, 50, 0.92));
  --surface-2: light-dark(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.06));
  --surface-solid: light-dark(#ffffff, #2c2c32);
  --sheet: light-dark(rgba(255, 255, 255, 0.95), rgba(30, 30, 34, 0.96));
  --primary-soft: light-dark(rgba(234, 88, 12, 0.12), rgba(234, 88, 12, 0.24));
  /* colore primario usato come TESTO (link, pulsanti secondari): più chiaro sul fondo scuro */
  --primary-ink: light-dark(var(--primary), #ffa463);
  --ok: light-dark(#248a3d, #4ade80);
  --ok-bg: light-dark(rgba(52, 199, 89, 0.16), rgba(52, 199, 89, 0.2));
  --warn: light-dark(#a05a00, #fbbf24);
  --warn-bg: light-dark(rgba(255, 204, 0, 0.22), rgba(255, 204, 0, 0.16));
  --danger: light-dark(#d70015, #ff6961);
  --danger-bg: light-dark(rgba(255, 59, 48, 0.13), rgba(255, 69, 58, 0.2));
  --info: light-dark(#0040dd, #7cb2ff);
  --info-bg: light-dark(rgba(0, 122, 255, 0.13), rgba(10, 132, 255, 0.22));
}
body.v-admin { --primary-soft: light-dark(rgba(88, 86, 214, 0.13), rgba(88, 86, 214, 0.28)); --primary-ink: light-dark(var(--primary), #b4b2ff); }
body {
  background-color: light-dark(#f2f2f7, #0c0c0f);
  background-image:
    radial-gradient(900px 620px at -5% -10%, light-dark(rgba(255, 149, 0, 0.2), rgba(255, 149, 0, 0.1)), transparent 62%),
    radial-gradient(760px 520px at 105% 0%, light-dark(rgba(255, 45, 85, 0.12), rgba(255, 45, 85, 0.07)), transparent 60%),
    radial-gradient(900px 700px at 55% 115%, light-dark(rgba(52, 199, 89, 0.14), rgba(52, 199, 89, 0.07)), transparent 62%);
}
body.v-admin {
  background-color: light-dark(#f2f2f7, #0c0c12);
  background-image:
    radial-gradient(900px 620px at -5% -10%, light-dark(rgba(88, 86, 214, 0.2), rgba(88, 86, 214, 0.14)), transparent 62%),
    radial-gradient(760px 520px at 105% 0%, light-dark(rgba(90, 200, 250, 0.18), rgba(90, 200, 250, 0.08)), transparent 60%),
    radial-gradient(900px 700px at 55% 115%, light-dark(rgba(255, 45, 85, 0.1), rgba(255, 45, 85, 0.06)), transparent 62%);
}

/* testo nel colore primario */
a, button.secondary, .btn.secondary, .badge-next, .pill.fs-occupied, .day-chip.is-today small, .floor-stats li.fs-occupied,
details.more > summary, details.usec > summary, .svc-new, .staff-new, .ag-free:hover, .ag-free:focus-visible { color: var(--primary-ink); }
label, .chip, .kpi-label { color: light-dark(#3a3a3c, #d1d1d6); }

/* superfici chiare → scure */
.skip:focus, .seg a[aria-current='page'], .rooms-dock a[aria-current='page'], .tp-more summary .count { background: var(--surface-solid); }
.side nav a:hover, .qi:hover, .svc-new:hover, .staff-new:hover, button.op-chip:hover, .day-chip:hover { background: var(--surface-2); }
.side nav a[aria-current='page'] { background: light-dark(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.1)); }
input:focus, select:focus, textarea:focus { background: light-dark(#fff, #1c1c20); }
th { background: light-dark(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.05)); }
tbody tr:nth-child(odd) { background: light-dark(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.04)); }
tbody tr:nth-child(even) { background: light-dark(rgba(229, 229, 234, 0.75), rgba(255, 255, 255, 0.08)); }
.tl-item, .plist li, .prow, .floor-stats li, .vtile, .shape-tile, .side-tile, .day-chip, .op-chip, .day-tag, .tl-time { background: var(--surface); }
.tl-time { background: var(--fill); }
.tgroup { background: light-dark(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.03)); }
.svc-new, .staff-new { background: light-dark(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.03)); border-color: light-dark(rgba(60, 60, 67, 0.2), rgba(255, 255, 255, 0.16)); }
.pop, .tpop { background: var(--sheet); }
.daynav, .palette, .pal-ghost, a.round.secondary, button.round.secondary, summary.round.secondary { background: light-dark(rgba(255, 255, 255, 0.82), rgba(44, 44, 50, 0.88)); }
.rooms-dock { background: light-dark(rgba(255, 255, 255, 0.62), rgba(44, 44, 50, 0.72)); }
.tp-tools button.on { background: light-dark(#374151, #e5e7eb); color: light-dark(#fff, #111); }
.av { border-color: var(--surface-solid); }
.wd.today { box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px var(--sc, var(--primary-2)); }
.ag-work { background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 72px), light-dark(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.04)); }
.ag-off { color: var(--warn); background: repeating-linear-gradient(45deg, rgba(255, 204, 0, 0.16) 0 8px, light-dark(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.03)) 8px 16px); }

/* messaggi, banner, stati */
.msg-ok { background: light-dark(rgba(220, 252, 231, 0.9), rgba(22, 101, 52, 0.35)); color: light-dark(#11401f, #bbf7d0); }
.msg-err { background: light-dark(rgba(254, 226, 226, 0.92), rgba(153, 27, 27, 0.35)); color: light-dark(#6b1410, #fecaca); }
.msg-warn { background: light-dark(rgba(254, 243, 199, 0.92), rgba(133, 77, 14, 0.35)); color: light-dark(#4a3500, #fde68a); }
.banner-imp { background: light-dark(rgba(254, 240, 138, 0.85), rgba(133, 77, 14, 0.6)); color: light-dark(#3f2d00, #fef9c3); }
.banner-ro { background: light-dark(rgba(219, 234, 254, 0.9), rgba(30, 64, 175, 0.45)); color: light-dark(#1b2f66, #dbeafe); }
.banner-maint { background: light-dark(rgba(254, 226, 226, 0.92), rgba(153, 27, 27, 0.45)); color: light-dark(#6b1410, #fee2e2); }
.pill.fs-free, .floor-stats li.fs-free { color: light-dark(#334155, #e2e8f0); background: var(--surface-solid); border-color: light-dark(#cbd5e1, #475569); }
.pill.fs-reserved, .floor-stats li.fs-reserved { color: light-dark(#854d0e, #fde68a); background: light-dark(#fef9c3, rgba(202, 138, 4, 0.25)); }
.pill.fs-soon { color: light-dark(#92400e, #fcd34d); background: light-dark(#fde68a, rgba(217, 119, 6, 0.3)); }
.pill.fs-occupied, .pill.fs-long, .floor-stats li.fs-occupied { color: light-dark(#166534, #86efac); background: light-dark(#bbf7d0, rgba(22, 163, 74, 0.25)); }
.pill.fs-turnover { color: light-dark(#991b1b, #fca5a5); background: light-dark(#fecaca, rgba(220, 38, 38, 0.28)); }
.pill.fs-cleaning, .pill.fs-blocked { color: light-dark(#334155, #cbd5e1); }
.pr-meta .st-requested { color: light-dark(#a16207, #fcd34d); }
.pr-tb { color: light-dark(#166534, #86efac); }
.tp-seated { background: light-dark(rgba(187, 247, 208, 0.55), rgba(22, 163, 74, 0.18)); }
.seated { background: light-dark(rgba(255, 237, 213, 0.75), rgba(194, 65, 12, 0.18)); }

/* agenda: colori degli operatori su fondo scuro */
.sc-blue { --sc-bg: light-dark(rgba(219, 234, 254, 0.95), rgba(37, 99, 235, 0.28)); }
.sc-green { --sc-bg: light-dark(rgba(220, 252, 231, 0.95), rgba(22, 163, 74, 0.28)); }
.sc-violet { --sc-bg: light-dark(rgba(237, 233, 254, 0.95), rgba(124, 58, 237, 0.3)); }
.sc-orange { --sc-bg: light-dark(rgba(255, 237, 213, 0.95), rgba(234, 88, 12, 0.28)); }
.sc-pink { --sc-bg: light-dark(rgba(252, 231, 243, 0.95), rgba(219, 39, 119, 0.28)); }
.sc-teal { --sc-bg: light-dark(rgba(204, 251, 241, 0.95), rgba(13, 148, 136, 0.28)); }
.sc-amber { --sc-bg: light-dark(rgba(254, 243, 199, 0.95), rgba(180, 83, 9, 0.3)); }
.sc-slate { --sc-bg: light-dark(rgba(226, 232, 240, 0.95), rgba(71, 85, 105, 0.4)); }
.ag-appt.ast-requested, .ag-appt.ast-held { background: light-dark(rgba(254, 243, 199, 0.95), rgba(180, 83, 9, 0.3)); }

/* sala: pianta scura, tavoli liberi grigio scuro, gli altri stati restano colorati con testo scuro */
.floor-bg { fill: light-dark(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.03)); stroke: var(--line); }
.fgrid-line { stroke: light-dark(rgba(23, 24, 28, 0.07), rgba(255, 255, 255, 0.06)); }
.ft-free .ft-top { fill: light-dark(#ffffff, #2c2c32); stroke: light-dark(#94a3b8, #64748b); }
.ft-free .ft-chair, .ft-cleaning .ft-chair, .ft-blocked .ft-chair, .ft-chair { fill: light-dark(#ffffff, #3a3a42); stroke: light-dark(#cbd5e1, #64748b); }
.ft-occupied .ft-chair, .ft-long .ft-chair { fill: #86efac; stroke: #16a34a; }
.ft-turnover .ft-chair { fill: #fca5a5; stroke: #dc2626; }
.ft-cleaning .ft-top { fill: light-dark(#f1f5f9, #33333a); }
.ft-blocked .ft-top { fill: light-dark(#e5e7eb, #2a2a30); }
.ft-free .ft-label, .ft-cleaning .ft-label, .ft-blocked .ft-label { fill: var(--text); }
.ft-free .ft-sub, .ft-cleaning .ft-sub, .ft-blocked .ft-sub { fill: var(--muted); }
.ft:focus-visible .ft-top, .ft.sel .ft-top { stroke: light-dark(#17181c, #f2f2f7); }
.fx-label { fill: light-dark(#17181c, #f2f2f7); stroke: light-dark(#fff, #1c1c20); }
.fx.sel .fx-hit, .fx:focus-visible .fx-hit { stroke: light-dark(#17181c, #f2f2f7); }
.fx-wall { fill: light-dark(#3f3f46, #d4d4d8); }
.ft-dur-bg { fill: light-dark(rgba(23, 24, 28, 0.14), rgba(255, 255, 255, 0.18)); }

/* tasto del tema nel menu laterale: un'icona per stato (automatico, scuro, chiaro) */
.theme-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; }
.theme-btn .ico { margin: 0; }
.theme-btn .th-dark, .theme-btn .th-light, .theme-btn[data-pref='dark'] .th-auto, .theme-btn[data-pref='light'] .th-auto { display: none; }
.theme-btn[data-pref='dark'] .th-dark, .theme-btn[data-pref='light'] .th-light { display: inline-flex; }
.side-foot form { flex: 1 1 auto; }
body.nav-min .side-foot { flex-direction: column; }
@media print { :root { color-scheme: light; } }
.tag-table { color: light-dark(#166534, #86efac); }
.tag-notable { color: light-dark(#854d0e, #fde68a); }
.pr-warn { color: light-dark(#b45309, #fbbf24); }
.danger-ico { color: var(--danger); }
.side-foot button.theme-btn { width: 40px; flex: none; }
.st-left { color: var(--muted); background: var(--fill); border-color: transparent; }

/* campo «Ora» delle prenotazioni a mano: «Altro orario» compare solo se scelto */
.time-pick .time-other { display: none; margin-top: 6px; padding: 10px; border-radius: 12px; background: var(--fill-2); }
.time-pick:has(option[value='altro']:checked) .time-other { display: block; }
.time-pick .time-other .switch { margin: 8px 0 0; font-weight: 500; }

/* Cerca: risultati mentre si scrive */
.search-form input[type='search'] { flex: 1 1 260px; }
.search-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sr-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); transition: transform 0.15s ease, box-shadow 0.15s ease; animation: rise 0.22s ease both; }
.sr-row:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(30, 30, 60, 0.3); }
.sr-when, .sr-main { display: flex; flex-direction: column; min-width: 0; }
.sr-when small, .sr-main small { color: var(--muted); font-size: 0.78rem; }
.sr-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) { .sr-row { grid-template-columns: 1fr auto; } .sr-when { grid-column: 1 / -1; flex-direction: row; gap: 8px; } }

/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   Movimento: entrate morbide di pagine, schede e pop-up; menu a semicerchio della sala. Solo opacità e
   trasformazioni (leggere per il browser); con «riduci movimento» tutto si ferma (regola in alto). Dopo un
   aggiornamento automatico della pagina (`html.soft`, da app.js) le entrate non si ripetono.
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
html:not(.soft) main > * { animation: rise 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
html:not(.soft) main > *:nth-child(2) { animation-delay: 0.04s; }
html:not(.soft) main > *:nth-child(3) { animation-delay: 0.08s; }
html:not(.soft) main > *:nth-child(4) { animation-delay: 0.12s; }
html:not(.soft) main > *:nth-child(n + 5) { animation-delay: 0.16s; }
html:not(.soft) .tl-item, html:not(.soft) .kpi, html:not(.soft) .qi { animation: rise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
html:not(.soft) .tl-item:nth-child(2), html:not(.soft) .kpi:nth-child(2) { animation-delay: 0.04s; }
html:not(.soft) .tl-item:nth-child(3), html:not(.soft) .kpi:nth-child(3) { animation-delay: 0.08s; }
html:not(.soft) .tl-item:nth-child(n + 4), html:not(.soft) .kpi:nth-child(n + 4) { animation-delay: 0.12s; }
.kpi, .qi, .tl-item, .prow, .plist li, .tcard, .svc-card { transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.2s ease; }
.kpi:hover, .qi:hover, .tl-item:hover, .tcard:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(30, 30, 60, 0.45); }
.prow:hover { transform: translateX(2px); }
.side nav a .ico { transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.4), background-color 0.2s; }
.side nav a:hover .ico { transform: scale(1.08); }
.msg { animation: rise 0.28s ease both; }

/* pop-up: entrano e escono in dissolvenza con un leggero zoom (niente JS) */
.pop { opacity: 0; transform: translateY(10px) scale(0.97); transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.15), overlay 0.22s allow-discrete, display 0.22s allow-discrete; }
.pop:popover-open { opacity: 1; transform: none; }
@starting-style { .pop:popover-open { opacity: 0; transform: translateY(10px) scale(0.97); } }
.pop::backdrop { transition: background-color 0.2s ease, overlay 0.2s allow-discrete, display 0.2s allow-discrete; }
details[open] > :not(summary) { animation: fade-in 0.2s ease both; }

/* pianta: i tavoli entrano a cascata, i colori di stato sfumano */
html:not(.soft) .floor-svg .ft-top, html:not(.soft) .floor-svg .fx-body { transform-box: fill-box; transform-origin: center; animation: pop-in 0.36s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
html:not(.soft) .floor-svg .ft-chair { animation: fade-in 0.4s ease 0.18s both; }
html:not(.soft) .floor-svg .ft:nth-child(3n + 2) .ft-top { animation-delay: 0.05s; }
html:not(.soft) .floor-svg .ft:nth-child(3n) .ft-top { animation-delay: 0.1s; }
.ft-chair { transition: fill 0.3s ease, stroke 0.3s ease; }
.ft-top { transition: fill 0.35s ease, stroke 0.35s ease, filter 0.2s ease; }
.ft:hover .ft-top { filter: drop-shadow(0 6px 10px rgba(30, 30, 60, 0.28)); }
.rooms-dock a, .daynav a, .round { transition: background-color 0.18s ease, transform 0.18s ease, color 0.18s ease; }
.round:hover { transform: scale(1.06); }
.pick-banner:not([hidden]) { animation: rise 0.22s ease both; }

/* ── menu del tavolo: semicerchio a 4 spicchi accanto al tavolo + pannello delle prenotazioni ── */
.tpop.tp-wrap {
  --R: 96px;
  width: auto; max-height: none; overflow: visible; padding: 0 0 0 calc(var(--R) + 6px);
  background: transparent; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.tpop.tp-wrap.flip { padding: 0 calc(var(--R) + 6px) 0 0; }
.tpop.tp-wrap::backdrop { background: rgba(23, 24, 28, 0.06); }
.tp-panel { width: min(360px, calc(100vw - 140px)); min-height: calc(var(--R) * 2); max-height: calc(100vh - 16px); overflow: auto; padding: 14px 14px 16px; border-radius: 22px;
  background: var(--sheet); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); box-shadow: 0 24px 60px -20px rgba(30, 30, 60, 0.45); }
.tp-radial { position: absolute; left: 0; top: calc(50% - var(--R)); width: var(--R); height: calc(var(--R) * 2); border-radius: 0 var(--R) var(--R) 0; overflow: hidden;
  filter: drop-shadow(0 10px 22px rgba(30, 30, 60, 0.35)); transform-origin: 0 50%; }
.flip .tp-radial { left: auto; right: 0; border-radius: var(--R) 0 0 var(--R); transform-origin: 100% 50%; }
.tr-w { position: absolute; inset: 0; margin: 0; padding: 0; min-height: 0; border: 0; border-radius: 0; box-shadow: none; cursor: pointer;
  background: var(--surface-solid); color: var(--text); transition: background-color 0.16s ease, color 0.16s ease; }
.tr-w:nth-child(even) { background: light-dark(#f4f1ee, #36363d); }
.tr-1 { clip-path: polygon(0% 50%, 0% -50%, 141% -21%); }
.tr-2 { clip-path: polygon(0% 50%, 141% -21%, 200% 50%); }
.tr-3 { clip-path: polygon(0% 50%, 200% 50%, 141% 121%); }
.tr-4 { clip-path: polygon(0% 50%, 141% 121%, 0% 150%); }
.flip .tr-1 { clip-path: polygon(100% 50%, 100% -50%, -41% -21%); }
.flip .tr-2 { clip-path: polygon(100% 50%, -41% -21%, -100% 50%); }
.flip .tr-3 { clip-path: polygon(100% 50%, -100% 50%, -41% 121%); }
.flip .tr-4 { clip-path: polygon(100% 50%, -41% 121%, 100% 150%); }
.tr-ico { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 1px; transform: translate(-50%, -50%); pointer-events: none; }
.tr-ico .ico { width: 20px; height: 20px; margin: 0; }
.tr-ico small { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }
.tr-1 .tr-ico { left: 23px; top: 40px; }
.tr-2 .tr-ico { left: 56px; top: 74px; }
.tr-3 .tr-ico { left: 56px; top: 118px; }
.tr-4 .tr-ico { left: 23px; top: 152px; }
.flip .tr-1 .tr-ico, .flip .tr-4 .tr-ico { left: 73px; }
.flip .tr-2 .tr-ico, .flip .tr-3 .tr-ico { left: 40px; }
.tr-w:not(:disabled):hover, .tr-w:focus-visible { background: color-mix(in srgb, var(--primary-2) 16%, var(--surface-solid)); color: var(--primary-ink); filter: none; transform: none; }
.tr-w:focus-visible { outline: none; }
.tr-w:disabled { cursor: default; }
.tr-w:disabled .tr-ico { opacity: 0.35; }
.tr-3.on { background: #374151; color: #fff; }
[data-tp-view='walkin'] .tr-1, [data-tp-view='cambio'] .tr-2 { background: var(--primary-2); color: #fff; }
.tp-view { display: none; }
[data-tp-view='main'] .tp-view[data-view='main'], [data-tp-view='walkin'] .tp-view[data-view='walkin'], [data-tp-view='cambio'] .tp-view[data-view='cambio'] { display: block; animation: rise 0.2s ease both; }
[data-tp-view='main'] [data-tp-back] { display: none; }
.tp-view > h3:first-child { margin-top: 12px; }
@keyframes radial-in { from { opacity: 0; transform: scale(0.35) rotate(-20deg); } to { opacity: 1; transform: none; } }
@keyframes radial-in-flip { from { opacity: 0; transform: scale(0.35) rotate(20deg); } to { opacity: 1; transform: none; } }
@keyframes panel-in { from { opacity: 0; transform: translateX(-14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes panel-in-flip { from { opacity: 0; transform: translateX(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.tpop.tp-wrap:popover-open .tp-radial { animation: radial-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.tpop.tp-wrap.flip:popover-open .tp-radial { animation-name: radial-in-flip; }
.tpop.tp-wrap:popover-open .tp-panel { animation: panel-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1) 0.05s both; }
.tpop.tp-wrap.flip:popover-open .tp-panel { animation-name: panel-in-flip; }
.tpop.tp-wrap:popover-open .tr-ico { animation: fade-in 0.25s ease both; }
.tpop.tp-wrap:popover-open .tr-2 .tr-ico { animation-delay: 0.05s; }
.tpop.tp-wrap:popover-open .tr-3 .tr-ico { animation-delay: 0.1s; }
.tpop.tp-wrap:popover-open .tr-4 .tr-ico { animation-delay: 0.15s; }
@media (max-width: 639px) {
  .tpop.tp-wrap, .tpop.tp-wrap.flip { left: 8px; right: 8px; bottom: 8px; top: auto; padding: 0; display: flex; flex-direction: column; gap: 8px; }
  .tpop.tp-wrap:not(:popover-open) { display: none; }
  .tp-radial, .flip .tp-radial { position: static; width: auto; height: auto; overflow: visible; border-radius: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; filter: none; }
  .tr-w, .flip .tr-w { position: relative; inset: auto; clip-path: none; border-radius: 16px; min-height: 58px; }
  .tr-ico, .flip .tr-ico { position: static; transform: none; padding-top: 8px; }
  .tp-panel { width: auto; min-height: 0; max-height: 62vh; }
}
@media print { .tp-wrap { display: none; } }

/* notifiche delle nuove prenotazioni (in basso a destra) e tasto del suono */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 10px; width: min(340px, calc(100vw - 32px)); pointer-events: none; }
.toast { position: relative; pointer-events: auto; display: flex; align-items: flex-start; border-radius: 18px; background: var(--sheet); box-shadow: 0 18px 40px -16px rgba(30, 30, 60, 0.5);
  border-left: 5px solid var(--ok); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); animation: toast-in 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
.toast-req { border-left-color: #eab308; }
.toast.out { animation: toast-out 0.22s ease both; }
.toast-link { flex: 1; display: flex; flex-direction: column; gap: 1px; padding: 12px 8px 12px 14px; color: var(--text); text-decoration: none; min-width: 0; }
.toast-link b { font-size: 0.92rem; }
.toast-link span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-link small { color: var(--muted); }
.toast-x { min-height: 32px; width: 32px; padding: 0; margin: 8px 8px 0 0; border-radius: 50%; background: var(--fill); color: var(--text); font-size: 1.1rem; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }
.sound-btn .s-off, .sound-btn[data-muted='1'] .s-on { display: none; }
.sound-btn[data-muted='1'] .s-off { display: inline-flex; }
.side-foot button.sound-btn, .side-foot button.split-btn { width: 40px; flex: none; }

/* vista divisa: seconda sezione a destra o sotto (iframe della dashboard stessa) */
.split-none { display: contents; }
.split-wrap { display: grid; gap: 14px; padding: 0 12px 12px 0; }
body.split-destra .split-wrap { grid-template-columns: minmax(0, 1fr) minmax(360px, 46%); align-items: start; }
body.split-sotto .split-wrap { grid-template-columns: minmax(0, 1fr); }
.split-wrap main { max-width: none; margin: 0; min-width: 0; }
.split-frame { width: 100%; border: 0; border-radius: 22px; background: var(--glass); box-shadow: var(--shadow); animation: rise 0.35s ease both; }
body.split-destra .split-frame { position: sticky; top: 12px; height: calc(100vh - 24px); margin-top: 12px; }
body.split-sotto .split-frame { height: 70vh; margin: 0 0 12px 16px; width: calc(100% - 16px); }
@media (max-width: 1099px) { body.split-destra .split-wrap { grid-template-columns: minmax(0, 1fr); } body.split-destra .split-frame { position: static; height: 70vh; } }
.split-pop { width: min(460px, calc(100vw - 24px)); }
.split-opts { border: 0; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.split-opts legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.split-btn.on { background: var(--primary-2); color: #fff; }
/* pagina dentro la vista divisa: niente menu laterale, margini ridotti */
body.in-pane .side, body.in-pane .banner { display: none; }
body.in-pane .shell { grid-template-columns: minmax(0, 1fr); }
body.in-pane main { padding: 12px 14px 20px; }
body.in-pane h1 { font-size: 1.35rem; }

/* Impostazioni → Modulo di prenotazione: link della pagina pubblica e anteprima a destra */
.form-link { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; }
.fl-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.fl-url { flex: 1 1 260px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .form-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, 420px); } .form-preview { position: sticky; top: 16px; } }
.form-preview h2 { margin-bottom: 2px; }
.fp-frame { display: block; width: 100%; height: min(780px, calc(100vh - 140px)); border: 0; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.tr-lines { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.tr-lines path { fill: none; stroke: var(--line); stroke-width: 1.5; }
.flip .tr-lines { transform: scaleX(-1); }
@media (max-width: 639px) { .tr-lines { display: none; } }
/* con la vista divisa a destra la pagina principale è più stretta: colonne interne una sotto l'altra */
body.split-destra main .today-cols, body.split-destra main .cols, body.split-destra main .floor-cols, body.split-destra main .form-grid { grid-template-columns: minmax(0, 1fr); }

/* Recensioni: consenso sì/no accanto a ogni prenotazione con email */
.tag-ok { color: light-dark(#166534, #86efac); background: light-dark(#dcfce7, rgb(22 101 52 / 0.35)); }
.tag-muted { color: var(--muted); }
.review-list li { grid-template-columns: minmax(0, 1fr); }
.review-list label { display: flex; gap: 10px; }
.review-list .plist-main { flex: 1; flex-wrap: wrap; gap: 6px; }
.rv-mail { font-size: 0.82rem; color: var(--muted); overflow-wrap: anywhere; }
.rv-pad { display: inline-block; width: 18px; flex: none; }
.cf-opts { display: block; font-size: 0.8rem; }

/* Pulsante «indietro» accanto al titolo delle sotto-pagine e «Ricarica» su Oggi */
.back-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--fill); color: inherit; text-decoration: none; flex: none; transition: transform 0.15s ease, background-color 0.15s ease; }
.back-btn:hover { transform: translateX(-2px); }
.back-btn .ico { width: 20px; height: 20px; }
.page-head h1 { min-width: 0; }
.reload-btn:hover .ico { transform: rotate(180deg); }
.reload-btn .ico { transition: transform 0.4s ease; }
.walkin form.walkin-other { grid-column: 1 / -1; display: flex; gap: 6px; }
.walkin-other input { flex: 1; min-width: 0; text-align: center; font-weight: 700; }
.walkin .walkin-other button { width: auto; min-width: 52px; min-height: 0; }

/* ── utilità ─────────────────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tag-warn { color: light-dark(#92400e, #fde68a); background: light-dark(#fef3c7, rgba(146, 64, 14, 0.35)); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

/* ── Dipendenti ──────────────────────────────────────────────────────── */
.seg-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 14px; background: var(--fill); width: fit-content; max-width: 100%; }
.seg-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: background-color 0.15s ease; }
.seg-tabs a .ico { width: 17px; height: 17px; }
.seg-tabs a.on { background: var(--surface-solid); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.sp-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sp-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.sp-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sp-period { font-size: 1.05rem; min-width: 11ch; text-align: center; text-transform: capitalize; }
.sp-gen button { white-space: nowrap; }
.sp-week { padding: 6px; }
.sp-grid { width: 100%; border-collapse: separate; border-spacing: 6px; min-width: 860px; table-layout: fixed; }
.sp-grid thead th { font-size: 0.8rem; color: var(--muted); font-weight: 600; text-align: center; padding: 6px 4px; border: 0; background: none; }
.sp-grid thead th .sp-dn { color: var(--text); font-size: 1.05rem; font-weight: 800; }
.sp-grid thead th.sp-today .sp-dn { color: var(--primary-2); }
.sp-grid th.sp-shift { width: 130px; text-align: left; vertical-align: top; padding: 10px 8px; border: 0; background: none; }
.sp-shift b, .sp-shift .hint { display: block; }
.sp-shift .tag { margin-top: 4px; display: inline-block; }
.sp-cell { vertical-align: top; padding: 8px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); position: relative; }
.sp-cell.sp-today { box-shadow: inset 0 0 0 2px light-dark(rgba(194, 65, 12, 0.35), rgba(251, 146, 60, 0.45)); }
.sp-cell.sp-off { background: repeating-linear-gradient(135deg, transparent 0 8px, var(--fill-2) 8px 16px); border-style: dashed; }
.sp-cell.sp-short { background: light-dark(rgba(254, 226, 226, 0.7), rgba(127, 29, 29, 0.28)); border-color: light-dark(rgba(220, 38, 38, 0.3), rgba(248, 113, 113, 0.35)); }
.sp-need { position: absolute; top: 6px; right: 8px; font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.sp-need.bad { color: light-dark(#b91c1c, #fca5a5); }
.sp-chips { list-style: none; margin: 14px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sp-chip { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; border-radius: 9px; background: var(--sc-bg); font-size: 0.82rem; font-weight: 600; min-width: 0; }
.sp-chip .ico { width: 13px; height: 13px; flex: none; color: var(--muted); }
.sp-chip.warn { box-shadow: inset 0 0 0 1.5px light-dark(#d97706, #fbbf24); }
.sp-chip.warn .ico { color: light-dark(#b45309, #fbbf24); }
.sp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sc); flex: none; }
.sp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-chip form { margin: 0; display: flex; }
.sp-x { padding: 2px; min-height: 0; width: 20px; height: 20px; border-radius: 6px; background: transparent; color: var(--muted); border: 0; box-shadow: none; opacity: 0.6; }
.sp-x:hover { opacity: 1; background: var(--fill); }
.sp-x .ico { width: 12px; height: 12px; }
.sp-add { display: flex; gap: 4px; margin: 0; }
.sp-add select { flex: 1; min-width: 0; padding: 4px 6px; font-size: 0.78rem; min-height: 0; height: 30px; border-radius: 8px; }
.sp-add button { min-height: 0; height: 30px; width: 30px; padding: 0; justify-content: center; }
.sp-add button .ico { width: 14px; height: 14px; }
.sp-month { padding: 10px; }
.sp-matrix { border-collapse: separate; border-spacing: 2px; font-size: 0.78rem; }
.sp-matrix th, .sp-matrix td { border: 0; padding: 0; }
.sp-matrix thead th { text-align: center; color: var(--muted); font-weight: 600; min-width: 28px; padding-bottom: 4px; background: none; }
.sp-matrix thead th span { display: block; line-height: 1.2; }
.sp-matrix thead th .sp-dn { color: var(--text); font-weight: 700; }
.sp-matrix thead th.we .sp-dn { color: var(--primary-2); }
.sp-matrix tbody th { text-align: left; padding-right: 10px; white-space: nowrap; background: none; }
.sp-person { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.85rem; }
.sp-matrix td { height: 28px; min-width: 28px; text-align: center; font-weight: 800; border-radius: 7px; background: var(--fill-2); }
.sp-matrix td.mx-on { background: var(--sc-bg); color: var(--sc); }
.sp-matrix td.mx-free { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--fill) 4px 8px); }
.sp-matrix td.mx-abs { color: light-dark(#7c2d12, #fed7aa); background: light-dark(#ffedd5, rgba(154, 52, 18, 0.35)); }
.sp-matrix td.sp-today { box-shadow: inset 0 0 0 2px var(--primary-2); }
.sp-matrix .mx-total th { color: var(--muted); font-weight: 600; font-size: 0.75rem; }
.sp-matrix .mx-total td { font-size: 0.68rem; font-weight: 700; background: none; }
.sp-matrix .mx-total td.bad { color: light-dark(#b91c1c, #fca5a5); }
.sp-matrix .mx-total td.good { color: light-dark(#15803d, #86efac); }
.mx-legend { margin: 10px 4px 0; }
.sp-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 20px; }
.sp-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.sp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.sp-card-top { display: flex; align-items: center; gap: 10px; }
.sp-card-top > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.sp-card .avatar, .person-card .avatar { background: var(--sc); width: 38px; height: 38px; border-radius: 12px; }
.sp-bar { height: 8px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.sp-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--sc); transition: width 0.5s ease; }
.sp-stats { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 0.85rem; color: var(--muted); }
.sp-stats b { color: var(--text); }
.empty-state { text-align: center; padding: 30px 20px; }
.empty-state > .ico { width: 40px; height: 40px; color: var(--primary-2); }
.steps { text-align: left; max-width: 520px; margin: 14px auto 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 10px; }
.steps li.done { color: var(--muted); text-decoration: line-through; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 18px; }
.person-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.person-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.person-card.inactive { opacity: 0.6; }
.person-card > .ico { color: var(--muted); }
.pc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.person-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar-lg { width: 64px; height: 64px; border-radius: 20px; font-size: 1.6rem; background: var(--sc); }
.mini-stats { flex: 1; margin: 0; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.mini-stats .stat { padding: 8px 12px; background: var(--fill-2); color: var(--muted); font-size: 0.85rem; }
.mini-stats .stat b { font-size: 1.35rem; color: var(--text); }
.days-pick, .color-pick { border: 0; padding: 0; margin: 12px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.days-pick legend, .color-pick legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; padding: 0; }
.swatch { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--sc); cursor: pointer; margin: 0; transition: transform 0.15s ease; }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 3px var(--surface-solid), 0 0 0 5px var(--sc); transform: scale(1.05); }
.swatch:has(input:focus-visible) { outline: 3px solid var(--primary-2); outline-offset: 4px; }
.abs-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.abs-ferie { color: light-dark(#1d4ed8, #93c5fd); }
.abs-malattia { color: light-dark(#b91c1c, #fca5a5); }
.shift-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.shift-card.inactive { opacity: 0.65; }
.rules-card label:not(.check) { display: block; margin-top: 12px; }
.recal-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin: 14px 0; }
@media (max-width: 760px) { .recal-cols { grid-template-columns: minmax(0, 1fr); } }
.recal-h { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.recal-h .ico { width: 22px; height: 22px; padding: 3px; border-radius: 8px; }
.recal-h.out .ico { color: #fff; background: light-dark(#dc2626, #b91c1c); }
.recal-h.in .ico { color: #fff; background: light-dark(#16a34a, #15803d); }

/* ── Calendario ──────────────────────────────────────────────────────── */
.cal-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-month { margin: 0 6px; font-size: 1.25rem; min-width: 9ch; text-align: center; text-transform: capitalize; }
.cal-layers { display: flex; flex-wrap: wrap; gap: 6px; }
.layer-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--fill-2); color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.82rem; border: 1px solid transparent; transition: background-color 0.15s ease, color 0.15s ease; }
.layer-chip .ico { width: 15px; height: 15px; }
.layer-chip.on { color: var(--lc); background: var(--lc-bg); border-color: color-mix(in srgb, var(--lc) 30%, transparent); }
.lc-p, .cp-p { --lc: light-dark(#c2410c, #fdba74); --lc-bg: light-dark(#ffedd5, rgba(194, 65, 12, 0.25)); }
.lc-o, .cp-o { --lc: light-dark(#0f766e, #5eead4); --lc-bg: light-dark(#ccfbf1, rgba(15, 118, 110, 0.28)); }
.lc-t, .cp-t { --lc: light-dark(#4338ca, #a5b4fc); --lc-bg: light-dark(#e0e7ff, rgba(67, 56, 202, 0.3)); }
.lc-a, .cp-a { --lc: light-dark(#be185d, #f9a8d4); --lc-bg: light-dark(#fce7f3, rgba(190, 24, 93, 0.28)); }
.lc-s, .cp-s { --lc: light-dark(#475569, #cbd5e1); --lc-bg: light-dark(#e2e8f0, rgba(71, 85, 105, 0.4)); }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: minmax(0, 1fr); } }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 12px; }
.cal-wd { text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 0 6px; }
.cal-day { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 104px; padding: 8px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; overflow: hidden; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.cal-day:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.cal-day.out { opacity: 0.45; }
.cal-day.past .cd-num { color: var(--muted); }
.cal-day.today .cd-num { background: var(--primary-2); color: #fff; }
.cal-day.sel { border-color: var(--primary-2); box-shadow: 0 0 0 2px light-dark(rgba(194, 65, 12, 0.25), rgba(251, 146, 60, 0.3)); }
.cal-day.closed { background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, var(--fill-2) 10px 20px); }
/* intensità dei coperti: una velatura calda dal basso */
.cal-day::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(to top, light-dark(rgba(234, 88, 12, 0.16), rgba(251, 146, 60, 0.22)), transparent); pointer-events: none; transition: height 0.4s ease; }
.cal-day.heat-1::after { height: 20%; }
.cal-day.heat-2::after { height: 38%; }
.cal-day.heat-3::after { height: 56%; }
.cal-day.heat-4::after { height: 76%; }
.cal-day.heat-5::after { height: 100%; }
.cd-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; font-weight: 800; font-size: 0.92rem; }
.cd-items { display: flex; flex-direction: column; gap: 3px; position: relative; z-index: 1; }
.cd-pill { display: inline-flex; align-items: center; gap: 4px; width: fit-content; max-width: 100%; padding: 2px 7px; border-radius: 7px; font-size: 0.72rem; font-weight: 600; color: var(--lc); background: var(--lc-bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-pill .ico { width: 12px; height: 12px; }
.cp-closed { color: light-dark(#7f1d1d, #fecaca); background: light-dark(#fee2e2, rgba(127, 29, 29, 0.4)); }
.cal-detail { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 32px); overflow-y: auto; }
.cd-title { margin: 0 0 6px; text-transform: capitalize; font-size: 1.2rem; }
.cal-detail section { padding: 12px 0; border-top: 1px solid var(--line); }
.cal-detail h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 0.95rem; }
.cal-detail h3 .ico { width: 18px; height: 18px; color: var(--primary-2); }
.cal-detail h3 .hint { font-weight: 500; margin-left: auto; }
.cd-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cd-list li, .cd-list li a { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cd-list li a { flex: 1; padding: 6px 8px; border-radius: 10px; color: var(--text); text-decoration: none; }
.cd-list li a:hover { background: var(--fill-2); }
.cd-list li:not(:has(a)) { padding: 4px 8px; }
.cd-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.85rem; min-width: 3.2em; }
.cd-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 0.88rem; }
.cd-meta { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.cd-list li.st-cancelled_guest, .cd-list li.st-cancelled_venue, .cd-list li.st-no_show { opacity: 0.5; }
.cd-list li.st-cancelled_guest .cd-name, .cd-list li.st-cancelled_venue .cd-name { text-decoration: line-through; }
.cd-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sc); flex: none; }
.cd-closed { color: light-dark(#b91c1c, #fca5a5); font-weight: 700; margin: 0 0 8px; }
.cd-shifts { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cd-shifts li { padding: 10px; border-radius: 12px; background: var(--fill-2); }
.cd-shifts li.short { background: light-dark(rgba(254, 226, 226, 0.7), rgba(127, 29, 29, 0.28)); }
.cd-shift-h { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cd-people { display: flex; flex-wrap: wrap; gap: 4px; }
.cd-people .sp-chip { padding: 3px 8px; }
.cd-tables { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cd-tables li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.cd-tl { font-weight: 700; font-size: 0.85rem; }
.cd-tbar { height: 8px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.cd-tbar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, light-dark(#94a3b8, #64748b), light-dark(#475569, #cbd5e1)); }
@media (max-width: 640px) {
  .cal-grid { gap: 3px; padding: 6px; }
  .cal-day { min-height: 64px; padding: 4px; border-radius: 10px; gap: 3px; }
  .cd-num { width: 22px; height: 22px; font-size: 0.78rem; border-radius: 7px; }
  .cd-pill { font-size: 0.62rem; padding: 1px 4px; }
  .cd-pill .ico { display: none; }
  .cal-month { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cal-day, .sp-card, .person-card, .back-btn { transition: none; }
}

.sp-grid tbody tr, .sp-grid tbody tr:nth-child(n), .sp-matrix tbody tr, .sp-matrix tbody tr:nth-child(n) { background: none; }
.sp-grid tbody th, .sp-matrix tbody th { background: none; }
.sp-cell.sp-past { opacity: 0.6; background: var(--fill-2); }
.sp-cell.sp-past .sp-x { display: none; }
.sp-grid th.sp-shift b { text-transform: none; font-size: 0.92rem; color: var(--text); letter-spacing: 0; }
.sp-matrix tbody th { text-transform: none; letter-spacing: 0; }
.sp-matrix td.mx-abs { font-style: italic; }
.plist.moves li { grid-template-columns: minmax(0, 1fr); }
.plist.moves .plist-main { gap: 4px 8px; }

/* ── App installata (PWA) ────────────────────────────────────────────── */
/* con viewport-fit=cover il contenuto evita tacca, angoli e barra «home» di iPhone/iPad */
body { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
html.standalone .content { padding-bottom: env(safe-area-inset-bottom, 0px); }
html.standalone .side { padding-top: max(10px, env(safe-area-inset-top, 0px)); }
/* nell'app a schermo intero niente rimbalzo della pagina oltre i bordi */
html.standalone, html.standalone body { overscroll-behavior-y: none; }
.install-card { display: flex; gap: 16px; align-items: flex-start; }
.install-card h2 { margin-top: 0; }
.install-icon { width: 56px; height: 56px; border-radius: 14px; flex: none; box-shadow: var(--shadow); }
.install-steps { margin: 12px 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.offline-card { text-align: center; }
@media (max-width: 520px) { .install-card { flex-direction: column; } }

/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   Spaziature dei pulsanti (2026-10-31): i gruppi di pulsanti a pillola erano a 4–8px, sembravano attaccati.
   Un solo valore per tutti i gruppi (--btn-gap), un po' meno per i pulsanti piccoli e le icone tonde.
   Sta in fondo: prevale sulle regole precedenti.
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
:root { --btn-gap: 12px; --btn-gap-sm: 10px; }
.row { gap: var(--btn-gap); }
.quick, .today-actions, .staff-actions, .sp-nav, .cal-nav, .sp-banner, .tp-seated-act, .insp-tools, .ag-toolbar, .form-link { gap: var(--btn-gap); }
.tl-actions, .pr-act, .tp-tools, .floor-tools, .svc-foot, .op-chips, .cal-layers, .walkin, .tp .walkin, .movepad, .sp-add, .fo { gap: var(--btn-gap-sm); }
.side-foot { gap: var(--btn-gap-sm); }
.tl-actions { margin-top: 4px; }
/* pulsanti uno sotto l'altro (form diversi nella stessa scheda) */
.card > form + form, .card > form + .row, .card > .row + form, .card > .row + .row, .sub > form + form, .ucard > form + form { margin-top: var(--btn-gap); }
.card > button + button, .card > .btn + .btn, .card > form > button + button { margin-left: var(--btn-gap-sm); }
.ucard-del { margin-top: var(--btn-gap); }
.usec form { gap: var(--btn-gap-sm); }
/* pulsanti in linea dentro un contenitore non flessibile (testo, celle di tabella) */
td > form.inline + form.inline, td > .btn + form.inline, td > form.inline + .btn, td > .btn + .btn { margin-left: var(--btn-gap-sm); }
td.row, .tcard .row { gap: var(--btn-gap-sm); }
@media (max-width: 640px) { :root { --btn-gap: 10px; --btn-gap-sm: 8px; } }

/* Sala: tavoli uniti collegati da una retta (sotto i tavoli, da centro a centro). Piena = gruppo seduto,
   tratteggiata = solo prenotato. L'alone chiaro la stacca da griglia e arredi. */
.ft-links { pointer-events: none; }
.ft-link-halo { stroke: light-dark(rgba(255, 255, 255, 0.85), rgba(12, 12, 15, 0.8)); stroke-width: 12; stroke-linecap: round; }
.ft-link-line { stroke: light-dark(#ca8a04, #facc15); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 12 9; }
.ft-link.seated .ft-link-line { stroke: light-dark(#16a34a, #4ade80); stroke-dasharray: none; }
html:not(.soft) .ft-link-line { animation: fade-in 0.4s ease 0.25s both; }

/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   Calendario v2 (2026-10-31): mese pulito in stile agenda. Ogni giorno: numero, coperti in grande, una barra per
   turno (pranzo/cena) riempita sui posti della sala; fine settimana appena velati; chiuso a righe. A destra il
   giorno scelto con i numeri e le prenotazioni divise per turno.
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
.cal-bar { padding: 14px 18px; gap: 14px 24px; }
.cal-nav { gap: 14px; }
.cal-month { margin: 0; min-width: 0; text-align: left; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; text-transform: capitalize; }
.cal-month span { color: var(--muted); font-weight: 600; }
.cal-arrows { display: inline-flex; align-items: center; gap: 6px; }
.cal-sum { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; justify-content: flex-end; }
.cal-sum li { display: flex; flex-direction: column; padding: 6px 14px; border-radius: 14px; background: var(--fill-2); line-height: 1.15; }
.cal-sum b { font-size: 1.1rem; font-variant-numeric: tabular-nums; text-transform: capitalize; }
.cal-sum small { color: var(--muted); font-size: 0.74rem; font-weight: 600; }
.cal-layers { flex-basis: 100%; }
.cal-wrap { grid-template-columns: minmax(0, 1fr) 360px; }
.cal-grid { gap: 8px; padding: 14px; }
.cal-wd { padding: 0 0 4px; font-size: 0.72rem; }
.cal-wd.we { color: var(--primary-ink); }
.cal-day {
  min-height: 118px; padding: 8px 9px 9px; gap: 6px; border-radius: 16px; border: 1px solid transparent;
  background: var(--surface); box-shadow: 0 1px 2px light-dark(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.3));
}
.cal-day.we:not(.out) { background: light-dark(rgba(255, 247, 237, 0.92), rgba(251, 146, 60, 0.07)); }
.cal-day:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -14px rgba(30, 30, 60, 0.45); }
.cal-day.out { opacity: 0.38; background: transparent; box-shadow: none; border-color: var(--line); }
.cal-day.past:not(.today) { opacity: 0.72; }
.cal-day.out.past { opacity: 0.32; }
.cal-day.sel { border-color: var(--primary-2); box-shadow: 0 0 0 3px light-dark(rgba(194, 65, 12, 0.18), rgba(251, 146, 60, 0.25)); opacity: 1; }
.cal-day.closed { background: repeating-linear-gradient(135deg, var(--surface) 0 9px, var(--fill-2) 9px 18px); }
.cd-top { display: flex; align-items: center; gap: 6px; min-height: 28px; }
.cd-num { width: 28px; height: 28px; border-radius: 50%; font-size: 0.95rem; }
.cal-day.today .cd-num { background: #d70015; color: #fff; }
.cd-flag { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 99px; font-size: 0.68rem; font-weight: 700; color: var(--lc, var(--muted)); background: var(--fill); --lc: light-dark(#0f766e, #5eead4); }
.cd-flag .ico { width: 12px; height: 12px; }
.cd-flag.closed { color: light-dark(#991b1b, #fecaca); background: light-dark(#fee2e2, rgba(127, 29, 29, 0.45)); }
.cd-covers { display: flex; align-items: baseline; gap: 6px; line-height: 1; }
.cd-covers b { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cd-covers small { color: var(--muted); font-size: 0.7rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-turns { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.cd-turn { display: grid; grid-template-columns: 12px minmax(0, 1fr) 22px; align-items: center; gap: 5px; font-size: 0.66rem; font-weight: 700; color: var(--muted); }
.cd-turn-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.cd-meter { height: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.cd-meter > span { display: block; height: 100%; border-radius: inherit; transition: width 0.5s ease; }
.cd-meter .lv-1 { background: light-dark(#34c759, #4ade80); }
.cd-meter .lv-2 { background: light-dark(#ff9500, #fbbf24); }
.cd-meter .lv-3 { background: light-dark(#ff3b30, #f87171); }
.cd-items:empty { display: none; }
.cd-items { flex-direction: row; flex-wrap: wrap; gap: 3px; }
.cd-pill { padding: 1px 6px; font-size: 0.66rem; }
/* dettaglio del giorno */
.cal-detail { gap: 0; padding: 16px; }
.cd-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; }
.cd-big { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 54px; height: 58px; flex: none; border-radius: 16px; background: linear-gradient(160deg, var(--primary-2), var(--primary)); color: #fff; line-height: 1; }
.cd-big small { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.9; }
.cd-big b { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; }
.cd-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cd-head .cd-title { margin: 0; font-size: 1.05rem; }
.cd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; margin-bottom: 12px; }
.cd-kpis span { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 14px; background: var(--fill-2); line-height: 1.1; }
.cd-kpis b { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.cd-kpis small { color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.cd-turn-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 12px 0 6px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cd-turn-h .hint { text-transform: none; letter-spacing: 0; font-weight: 600; }
.cd-list { gap: 2px; }
.cd-list li a { gap: 10px; padding: 8px 10px; border-radius: 12px; }
.cd-pax { min-width: 28px; padding: 2px 6px; border-radius: 8px; text-align: center; font-size: 0.78rem; font-weight: 800; background: var(--fill); font-variant-numeric: tabular-nums; }
.cd-st { font-size: 0.68rem; padding: 2px 8px; }
.cd-st::before { display: none; }
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: minmax(0, 1fr); } .cal-detail { position: static; max-height: none; } }
@media (max-width: 640px) {
  .cal-bar { padding: 12px; }
  .cal-month { font-size: 1.25rem; }
  .cal-sum { justify-content: flex-start; }
  .cal-sum li { padding: 5px 10px; }
  .cal-grid { gap: 4px; padding: 8px; }
  .cal-day { min-height: 66px; padding: 5px; border-radius: 12px; gap: 3px; }
  .cd-top { min-height: 22px; }
  .cd-flag:not(.closed) { padding: 2px 4px; }
  .cd-flag.closed { font-size: 0; padding: 0; width: 8px; height: 8px; background: #d70015; }
  .cd-covers b { font-size: 1.05rem; }
  .cd-covers small, .cd-turn-name, .cd-turn-n { display: none; }
  .cd-turn { grid-template-columns: minmax(0, 1fr); }
  .cd-meter { height: 4px; }
}
.cd-flag.rest { color: var(--muted); background: transparent; font-weight: 600; }
.cal-day:has(.cd-flag.rest) { background: var(--fill-2); box-shadow: none; }
@media (max-width: 640px) { .cd-flag.rest { display: none; } }
.cd-list li[class*='st-'] { background: none; color: inherit; }
.cd-list li a:hover { background: var(--fill); }

/* Operatori (con le funzioni dei Dipendenti): nome cliccabile, ore a settimana, tipi di assenza, scheda */
.staff-name { font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; }
.staff-name:hover { text-decoration: underline; }
.week-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.staff-actions { flex-wrap: wrap; }
.abs-ferie { color: light-dark(#1d4ed8, #93c5fd); background: light-dark(#dbeafe, rgba(29, 78, 216, 0.3)); }
.abs-malattia { color: light-dark(#b91c1c, #fca5a5); background: light-dark(#fee2e2, rgba(185, 28, 28, 0.3)); }
.abs-permesso { color: light-dark(#a16207, #fde68a); background: light-dark(#fef9c3, rgba(161, 98, 7, 0.3)); }
.abs-formazione { color: light-dark(#6d28d9, #c4b5fd); background: light-dark(#ede9fe, rgba(109, 40, 217, 0.3)); }
.off-list li.off-row { grid-template-columns: minmax(0, 1fr) auto; }
.sp-matrix td.mx-hours { min-width: 56px; padding: 0 6px; font-size: 0.72rem; background: none; color: var(--muted); white-space: nowrap; }
.sp-matrix td.mx-on { font-size: 1rem; }
.person-head .pc-main { gap: 6px; min-width: 180px; }
.person-head .sp-bar { width: 100%; max-width: 240px; }
.person-head .sp-bar > span { background: var(--sc, var(--primary-2)); }

/* ── Admin: pagamenti del servizio ─────────────────────────────────────── */
.bs-ok, .bs-free { color: var(--ok); background: var(--ok-bg); }
.bs-soon { color: var(--warn); background: var(--warn-bg); }
.bs-grace { color: light-dark(#9a3412, #fdba74); background: light-dark(#ffedd5, rgba(154, 52, 18, 0.35)); }
.bs-overdue { color: var(--danger); background: var(--danger-bg); }
.bs-none { color: var(--muted); background: var(--fill); }
.bill-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.bill-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.bill-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.bill-stats span { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--fill-2); }
.bill-stats b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.bill-stats small { color: var(--muted); font-size: 0.76rem; font-weight: 600; }
.bill-stats .bad b { color: var(--danger); }
.bill-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.bill-forms .sub { margin: 0; background: var(--surface-2); border-radius: var(--radius); }
.bill-forms h3 { margin: 0 0 6px; }
.bill-forms .row { margin-top: 12px; }
.bill-pay { box-shadow: inset 0 0 0 2px light-dark(rgba(26, 116, 49, 0.25), rgba(74, 222, 128, 0.25)); }
.bill-h { margin: 18px 0 8px; }
.bill-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bill-table tr.voided td { opacity: 0.55; }
.bill-table tr.voided td:not(:last-child) { text-decoration: line-through; }
.bill-table tr.br-overdue td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
.bill-table tr.br-grace td:first-child { box-shadow: inset 4px 0 0 #ea580c; }
.bill-table tr.br-due_soon td:first-child { box-shadow: inset 4px 0 0 #eab308; }
.bill-who { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 180px; }
.bill-who .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 0.8rem; }
.bill-who > span:last-child { display: flex; flex-direction: column; }
.bill-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.tcard-bill { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; }
.tcard-bill .ico { width: 16px; height: 16px; }
.kpi-num { overflow-wrap: anywhere; }

/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   RESTYLING 2026-11 (richiesta soci, video di riferimento): fondo grigio chiaro, «foglio» arrotondato,
   barra laterale scura a pillola con sole icone (nome in un'etichetta al passaggio), schede bianche pulite,
   accenti pastello (lilla, menta, rosa, azzurro), controlli a pillola con l'elemento attivo nero.
   Ultimo strato del file: prevale su tutto quello sopra. Chiaro/scuro con light-dark().
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
:root {
  --bg: light-dark(#e7e7eb, #09090b);
  --canvas: light-dark(#f6f6f8, #121215);
  --card: light-dark(#ffffff, #1b1b20);
  --rail: light-dark(#111114, #1b1b20);
  --ink: light-dark(#111114, #f2f2f5);
  --ink-text: light-dark(#ffffff, #111114);
  --text: light-dark(#111114, #f2f2f5);
  --muted: light-dark(#63636c, #a3a3ad);
  --line: light-dark(rgba(17, 17, 20, 0.07), rgba(255, 255, 255, 0.08));
  --line-strong: light-dark(#dedee4, rgba(255, 255, 255, 0.14));
  --fill: light-dark(#eeeef2, rgba(255, 255, 255, 0.07));
  --fill-2: light-dark(#f4f4f7, rgba(255, 255, 255, 0.04));
  --lav: light-dark(#e3defd, #36305e);
  --lav-ink: light-dark(#4a3dc4, #cdc6ff);
  --mint: light-dark(#d8f3e4, #1d3a2b);
  --rose: light-dark(#fbdce7, #4a2432);
  --sky: light-dark(#dce9fc, #1e3047);
  --sun: light-dark(#fcf0cc, #45391a);
  --primary: light-dark(#4a3dc4, #cdc6ff);
  --primary-2: light-dark(#6c5ce7, #a99cff);
  --primary-soft: var(--lav);
  --primary-ink: var(--lav-ink);
  --glass: var(--card);
  --glass-strong: var(--card);
  --glass-border: var(--line);
  --surface: var(--card);
  --surface-2: var(--fill-2);
  --surface-solid: var(--card);
  --sheet: var(--card);
  --shadow: 0 1px 2px light-dark(rgba(17, 17, 40, 0.04), rgba(0, 0, 0, 0.4)), 0 8px 24px -14px light-dark(rgba(17, 17, 40, 0.14), rgba(0, 0, 0, 0.6));
  --radius: 14px;
  --radius-lg: 18px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
body.v-admin { --primary-soft: var(--lav); --primary-ink: var(--lav-ink); }
body, body.v-admin { background: var(--bg); background-image: none; color: var(--text); }
a { color: var(--lav-ink); }

/* superfici: bianche, bordo sottile, ombra leggera, niente vetro */
.glass, .card, .stat, .kpi, .tl-item, .tcard, .auth-card, table, .staff-card, .svc-card, .ucard, .sp-card, .person-card, .tgroup, .sub {
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.card, .tcard, .staff-card, .svc-card, .ucard, .kpi, table, .sp-card, .person-card { border-radius: var(--radius-lg); }
.sub, .tgroup { box-shadow: none; background: var(--fill-2); }
.stat { box-shadow: none; }

/* ── struttura: foglio arrotondato + barra a pillola ── */
@media (min-width: 960px) {
  .shell, body.nav-min .shell { grid-template-columns: 96px minmax(0, 1fr); }
  .side, body.nav-min .side {
    position: sticky; top: 12px; align-self: start; height: auto; min-height: calc(100vh - 24px); max-height: calc(100vh - 24px);
    width: 64px; margin: 12px 0 12px 16px; padding: 12px 0; gap: 4px; align-items: center;
    background: var(--rail); border: 1px solid light-dark(transparent, rgba(255, 255, 255, 0.06)); border-radius: 34px; box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.55);
  }
  .brand-row, body.nav-min .brand-row { flex-direction: column; padding: 0 0 10px; margin: 0 0 4px; border: 0; gap: 0; }
  .brand, body.nav-min .brand { padding: 0; border: 0; margin: 0; justify-content: center; }
  .brand-text, .side-toggle:not([hidden]), .side .nav-label { display: none; }
  .side nav, body.nav-min .side nav { flex: 0 1 auto; flex-direction: column; align-items: center; gap: 2px; overflow: visible; }
  .side nav a, body.nav-min .side nav a {
    position: relative; justify-content: center; width: 42px; height: 42px; padding: 0; border-radius: 50%;
    color: #9898a3; background: transparent; box-shadow: none; font-weight: 500;
  }
  .side nav a .ico { width: 20px; height: 20px; padding: 0; border-radius: 0; background: none; color: inherit; }
  .side nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
  .side nav a:hover .ico { transform: none; }
  .side nav a[aria-current='page'] { background: #dcd6fd; color: #111114; box-shadow: none; }
  .side nav a[aria-current='page'] .ico { background: none; color: #111114; }
  /* tacca a destra della voce attiva, fuori dalla barra */
  .side nav a[aria-current='page']::after { content: ''; position: absolute; right: -18px; top: 50%; width: 6px; height: 16px; margin-top: -8px; border-radius: 0 6px 6px 0; background: var(--rail); }
  /* nome della voce: etichetta scura accanto all'icona, al passaggio o col focus da tastiera */
  .side nav a span, body.nav-min .side nav a span {
    position: absolute; left: calc(100% + 16px); top: 50%; z-index: 40; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none;
    transform: translate(-4px, -50%); padding: 5px 10px; border-radius: 8px; background: var(--rail); color: #fff; font-size: 0.78rem; font-weight: 600;
    white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.15s ease, transform 0.15s ease; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.5);
  }
  .side nav a:hover span, .side nav a:focus-visible span { opacity: 1; transform: translate(0, -50%); }
  .side-foot, body.nav-min .side-foot { flex-direction: column; align-items: center; gap: 2px; margin-top: auto; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.1); width: 42px; }
  .side-foot form { flex: none; width: auto; }
  .content { margin: 12px 12px 12px 0; min-height: calc(100vh - 24px); background: var(--canvas); border-radius: 28px; border: 1px solid light-dark(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.05)); }
  main { padding: 30px 34px 48px; }
  .banner { margin: 14px 34px 0; }
  body.wide main { height: calc(100vh - 26px); }
}
/* schermi bassi: la barra scorre (il nome resta nel suggerimento del browser) */
@media (min-width: 960px) and (max-height: 740px) {
  .side, body.nav-min .side { overflow-y: auto; scrollbar-width: none; }
  .side nav a, body.nav-min .side nav a { width: 36px; height: 36px; }
  .side nav a span, .side nav a[aria-current='page']::after { display: none; }
}
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: #fff; color: #111114; box-shadow: none; font-size: 0.78rem; }
.side-foot button, .side-foot button.theme-btn, .side-foot button.sound-btn, .side-foot button.split-btn, .side-foot form button {
  width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 50%; background: transparent; color: #9898a3; border: 0; box-shadow: none;
}
.side-foot button:hover { background: rgba(255, 255, 255, 0.08); color: #fff; filter: none; }
.side-foot .split-btn.on { background: #dcd6fd; color: #111114; }
.side-foot form button .hide-sm { display: none; }
/* telefono e tablet piccolo: barra scura in alto, solo icone (il nome della pagina attiva resta) */
@media (max-width: 959px) {
  .side { margin: 8px; padding: 6px 8px; border-radius: 24px; background: var(--rail); border: 0; box-shadow: 0 12px 30px -18px rgba(0, 0, 0, 0.6); top: 8px; }
  .side nav a { color: #9898a3; padding: 8px 10px; border-radius: 999px; }
  .side nav a .ico { width: 20px; height: 20px; padding: 0; background: none; }
  .side nav a:not([aria-current='page']) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .side nav a[aria-current='page'] { background: #dcd6fd; color: #111114; box-shadow: none; }
  .side nav a[aria-current='page'] .ico { background: none; color: #111114; }
  .content { background: var(--canvas); border-radius: 24px 24px 0 0; margin-top: 4px; min-height: calc(100vh - 70px); }
}
body.in-pane .content { margin: 0; border-radius: 0; border: 0; min-height: 100vh; }
body.in-pane main { padding: 14px 16px 24px; }

/* ── tipografia ── */
h1 { font-size: 2.1rem; font-weight: 750; letter-spacing: -0.04em; line-height: 1.1; }
h2 { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.02em; }
h3 { color: var(--muted); }
.hint, .kpi-sub { color: var(--muted); }
label { color: light-dark(#3b3b42, #d4d4da); }
.page-head { margin: 0 0 22px; gap: 14px; }

/* ── pulsanti a pillola: principale nero, secondario grigio ── */
button, .btn { background: var(--ink); color: var(--ink-text); border: 0; border-radius: 999px; min-height: 40px; padding: 9px 18px; font-size: 0.9rem; font-weight: 600; box-shadow: none; }
button:hover, .btn:hover { filter: none; box-shadow: 0 0 0 3px var(--lav); }
button.secondary:hover, .btn.secondary:hover, .side-foot button:hover { box-shadow: none; }
button.secondary, .btn.secondary { background: var(--fill); color: var(--text); border: 0; }
button.secondary:hover, .btn.secondary:hover, body.v-admin button.secondary:hover, body.v-admin .btn.secondary:hover { background: light-dark(#e3e3e8, rgba(255, 255, 255, 0.12)); }
button.ok, .btn.ok { background: light-dark(#15803d, #86efac); color: light-dark(#ffffff, #0b2414); }
button.danger, .btn.danger { background: light-dark(#c9353b, #ff8a8f); color: light-dark(#ffffff, #2a0a0c); }
button.small, .btn.small { min-height: 32px; padding: 5px 13px; font-size: 0.82rem; }
.icon-btn, button.icon-btn, .btn.icon-btn { width: 32px; min-width: 32px; border-radius: 10px; }
.danger-ico, button.danger-ico { color: light-dark(#d1343a, #ff8a8f); background: light-dark(#fdecec, rgba(255, 99, 105, 0.16)); }
button.approve { background: light-dark(#fbe7a6, #6b5a1c); color: light-dark(#3d2f00, #fff4cf); }
button.leave { background: var(--mint); color: light-dark(#14532d, #b7f2cf); }
.back-btn { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }

/* testo «salvato» e celle passate dei turni: contrasto AA sul foglio chiaro */
.save-state { color: light-dark(#17702f, #86efac); }
.sp-cell.sp-past { opacity: 1; }

/* ── campi ── */
input[type='text'], input[type='email'], input[type='password'], input[type='tel'], input[type='number'],
input[type='date'], input[type='time'], input[type='url'], input[type='search'], select, textarea {
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 12px; min-height: 42px; color: var(--text);
}
input:focus, select:focus, textarea:focus { background: var(--card); border-color: var(--primary-2); box-shadow: 0 0 0 4px var(--lav); }
input[type='checkbox'], input[type='radio'] { accent-color: light-dark(#111114, #cdc6ff); }
.switch input:checked + .switch-ui { background: light-dark(#111114, #a99cff); }

/* ── filtri e sezioni: pillole, attivo nero ── */
.seg, .seg-tabs { padding: 4px; gap: 2px; border-radius: 999px; background: var(--fill); }
.seg a, .seg-tabs a { border-radius: 999px; padding: 7px 15px; color: var(--muted); }
.seg a[aria-current='page'], .seg-tabs a.on { background: var(--ink); color: var(--ink-text); box-shadow: none; }
.seg a[aria-current='page'] .ico, .seg-tabs a.on .ico { color: var(--ink-text); }
.chip-check:has(input:checked) { background: var(--ink); color: var(--ink-text); }
.op-chip { background: var(--card); border: 1px solid var(--line); box-shadow: none; }
.daynav .dn-day[aria-current='date'], .daynav .dn-cal.on, .day-chip[aria-current='date'], .round.on, a.round.on, button.round.on { background: var(--ink); color: var(--ink-text); box-shadow: none; }
.rooms-dock a[aria-current='page'] { background: var(--ink); color: var(--ink-text); }
.rooms-dock a[aria-current='page'] small { color: var(--ink-text); opacity: 0.75; }

/* ── etichette: grigie, stati pastello ── */
.tag, .chip { background: var(--fill); color: var(--text); border: 0; }
.pill { border: 0; }
.st-confirmed, .st-live, .st-active, .bs-ok, .bs-free { background: var(--mint); color: light-dark(#166534, #a7f3c6); }
.st-requested, .st-held, .st-draft, .st-invited, .bs-soon { background: var(--sun); color: light-dark(#7a5300, #fde68a); }
.st-arrived { background: var(--sky); color: light-dark(#1d4ed8, #b4d0ff); }

/* ── indicatori: icona in un quadrato pastello, numeri grandi ── */
.kpi { padding: 18px; gap: 4px; }
.kpi-ico { width: 38px; height: 38px; border-radius: 12px; color: var(--text); }
.kpi-a .kpi-ico, .kpi-f .kpi-ico { background: var(--rose); }
.kpi-b .kpi-ico { background: var(--mint); }
.kpi-c .kpi-ico { background: var(--sky); }
.kpi-d .kpi-ico { background: var(--sun); }
.kpi-e .kpi-ico { background: var(--lav); }
.kpi-num { font-size: 1.9rem; font-weight: 750; letter-spacing: -0.04em; }
.kpi.alert { box-shadow: 0 0 0 2px light-dark(#f2b8bf, #7a2a35), var(--shadow); }
.qi .ico { background: var(--lav); color: var(--lav-ink); }

/* ── tabelle: righe separate da una linea, niente righe alterne ── */
th { background: transparent; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; border-bottom: 1px solid var(--line); }
tbody tr, tbody tr:nth-child(odd), tbody tr:nth-child(even) { background: transparent; }
tbody tr:hover { background: var(--fill-2); }
td { border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
.sp-grid td, .sp-matrix td, .sp-grid th, .sp-matrix th { border-bottom: 0; }

/* ── elenchi e linee del tempo ── */
.tl-item { border-radius: 16px; box-shadow: none; }
.tl-time { background: var(--fill); }
.tl-item.next { box-shadow: 0 0 0 2px var(--ink); }
.tl-item.next .tl-time { background: var(--ink); color: var(--ink-text); }
.plist li, .prow { background: var(--card); border: 1px solid var(--line); box-shadow: none; }
.tcard .avatar, .bill-who .avatar { background: var(--lav); color: var(--lav-ink); }
.tcard:hover, .kpi:hover, .tl-item:hover { box-shadow: 0 14px 30px -18px light-dark(rgba(17, 17, 40, 0.3), rgba(0, 0, 0, 0.8)); }
.svc-new, .staff-new { background: transparent; border: 2px dashed var(--line-strong); color: var(--muted); }

/* ── pop-up e menu ── */
.pop, .tpop, .tp-panel, .menu-pop { background: var(--card); border: 1px solid var(--line); border-radius: 22px; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 30px 70px -28px rgba(10, 10, 30, 0.45); }
.tpop.tp-wrap { background: transparent; border: 0; box-shadow: none; }
.pop::backdrop { background: rgba(10, 10, 14, 0.32); }
.toast { background: var(--card); border: 1px solid var(--line); }

/* ── messaggi e banner pastello ── */
.msg { border: 0; border-radius: 14px; }
.msg-ok { background: var(--mint); color: light-dark(#14532d, #c9f7dd); }
.msg-err { background: var(--rose); color: light-dark(#7f1d1d, #ffd5df); }
.msg-warn { background: var(--sun); color: light-dark(#5c4300, #fff1c2); }
.banner { border: 0; border-radius: 14px; }

/* ── sala e calendario sul foglio chiaro ── */
.floor-bg { fill: var(--card); stroke: var(--line); }
.daynav, .palette, .rooms-dock, a.round.secondary, button.round.secondary, summary.round.secondary { background: var(--card); box-shadow: 0 8px 22px -14px rgba(10, 10, 30, 0.35); border: 1px solid var(--line); }
.cal-day { background: var(--card); box-shadow: none; border: 1px solid var(--line); }
.cal-day.we:not(.out) { background: light-dark(#fbfaff, rgba(169, 156, 255, 0.06)); }
/* giorni fuori mese e passati: attenuati col colore, non con l'opacità (contrasto AA) */
.cal-day.out, .cal-day.past:not(.today), .cal-day.out.past { opacity: 1; }
.cal-day.out { background: transparent; border-style: dashed; color: var(--muted); }
.cal-day.out .cd-num, .cal-day.past .cd-num { color: var(--muted); }
.cal-day.today .cd-num { background: var(--ink); color: var(--ink-text); }
.cal-day.sel { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.cd-big { background: var(--ink); color: var(--ink-text); }
.cal-sum li, .cd-kpis span, .bill-stats span { background: var(--card); border: 1px solid var(--line); }

/* ── pagine di accesso ── */
body.auth { background: var(--bg); }
body.auth main { padding-top: 10vh; }
body.auth .auth-card { border-radius: 24px; padding: 26px; }
body.auth .auth-brand .brand-mark { background: var(--ink); color: var(--ink-text); }

/* ── vista divisa ridimensionabile: maniglia tra le due pagine (trascina col mouse/dito o frecce da tastiera).
      --split-a = quota della pagina principale (a sinistra o sopra), impostata da nav.js e ricordata in un cookie ── */
.split-wrap { --split-a: 54%; gap: 0; padding: 0; }
.split-frame { width: 100%; border: 1px solid var(--line); border-radius: 22px; background: var(--card); }
body.split-destra .split-wrap { grid-template-columns: minmax(0, var(--split-a)) 18px minmax(0, 1fr); padding-right: 12px; }
body.split-destra .split-frame { margin: 12px 0 0; }
body.split-sotto .split-wrap { height: calc(100vh - 26px); grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, var(--split-a)) 18px minmax(0, 1fr); padding: 0 0 12px; }
body.split-sotto .split-wrap main { overflow: auto; height: auto; }
body.split-sotto .split-frame { height: 100%; margin: 0 12px; width: calc(100% - 24px); }
.split-handle { position: relative; display: flex; align-items: center; justify-content: center; cursor: col-resize; touch-action: none; outline: none; }
body.split-destra .split-handle { position: sticky; top: 12px; height: calc(100vh - 24px); margin-top: 12px; }
body.split-sotto .split-handle { cursor: row-resize; margin: 0 12px; }
.split-handle::before { content: ''; width: 5px; height: 44px; border-radius: 99px; background: var(--line-strong); transition: background-color 0.15s ease, transform 0.15s ease; }
body.split-sotto .split-handle::before { width: 44px; height: 5px; }
.split-handle:hover::before, .split-handle:focus-visible::before, body.split-dragging .split-handle::before { background: var(--ink); transform: scale(1.15); }
.split-handle:focus-visible { box-shadow: inset 0 0 0 2px var(--primary-2); border-radius: 8px; }
/* durante il trascinamento la pagina nell'iframe non «ruba» il puntatore */
body.split-dragging { cursor: col-resize; user-select: none; -webkit-user-select: none; }
body.split-sotto.split-dragging { cursor: row-resize; }
body.split-dragging .split-frame { pointer-events: none; }
@media (max-width: 1099px) {
  body.split-destra .split-wrap { grid-template-columns: minmax(0, 1fr); padding-right: 0; }
  body.split-destra .split-handle { display: none; }
  body.split-destra .split-frame { position: static; height: 70vh; margin: 0 12px 12px; width: calc(100% - 24px); }
}
@media (max-width: 959px) { body.split-sotto .split-wrap { height: calc(100vh - 90px); } }
@media print { .split-handle { display: none; } }
@media (prefers-reduced-motion: reduce) { .side nav a span { transition: none; } }

/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   Menu e navigazione (2026-11-01, seconda richiesta dei soci): menu allargabile con i nomi delle sezioni,
   selezione lilla al posto del nero, voci che si ingrandiscono e scorrono a destra al passaggio del mouse,
   passaggio fluido da una sezione all'altra (View Transitions tra pagine: il menu resta fermo, la selezione
   scivola sulla voce nuova, il contenuto entra in dissolvenza). Senza supporto del browser: navigazione normale.
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
:root {
  --rail: light-dark(#111114, #24242b);
  --sel: light-dark(#e3defd, #3d3670);
  --sel-ink: light-dark(#3a2fa8, #e2ddff);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* selezione: lilla tenue con testo lilla scuro, non più nero (menu, barre delle sezioni, filtri) */
.seg a[aria-current='page'], .seg-tabs a.on, .chip-check:has(input:checked),
.daynav .dn-day[aria-current='date'], .daynav .dn-cal.on, .day-chip[aria-current='date'], .rooms-dock a[aria-current='page'],
.round.on, a.round.on, button.round.on, .side-foot .split-btn.on {
  background: var(--sel); color: var(--sel-ink); font-weight: 700; box-shadow: none;
}
.seg a[aria-current='page'] .ico, .seg-tabs a.on .ico, .rooms-dock a[aria-current='page'] small { color: var(--sel-ink); opacity: 1; }
.side nav a[aria-current='page'], .side nav a[aria-current='page'] .ico { background: var(--sel); color: var(--sel-ink); }
.side nav a[aria-current='page'] { background: light-dark(#dcd6fd, #4a4285); }
.side nav a[aria-current='page'] .ico { background: none; }
@media (min-width: 960px) {
  .side, body.nav-wide .side { border: 1px solid light-dark(transparent, rgba(255, 255, 255, 0.09)); }
  .side nav a[aria-current='page']::after { background: light-dark(#111114, #a99cff); }
}

/* voci del menu: al passaggio si ingrandiscono e scorrono a destra; le vicine seguono un poco (effetto «dock») */
.side nav a { transition: transform 0.28s var(--spring), background-color 0.18s ease, color 0.18s ease, width 0.28s var(--ease), padding 0.28s var(--ease); }
@media (min-width: 960px) {
  .side nav a:hover { transform: translateX(6px) scale(1.12); }
  .side nav a:hover + a, .side nav a:has(+ a:hover) { transform: translateX(3px) scale(1.05); }
  body.nav-wide .side nav a:hover { transform: translateX(6px) scale(1.03); }
  body.nav-wide .side nav a:hover + a, body.nav-wide .side nav a:has(+ a:hover) { transform: translateX(2px); }
}
@media (max-width: 959px) { .side nav a:hover { transform: scale(1.06); } }

/* ── menu allargabile: pulsante sotto il logo; allargato mostra nome dell'attività e nomi delle sezioni ── */
@media (min-width: 960px) {
  .shell, body.nav-min .shell { transition: grid-template-columns 0.3s var(--ease); }
  .side { transition: width 0.3s var(--ease), padding 0.3s var(--ease), border-radius 0.3s var(--ease); }
  /* linguetta tonda sul bordo destro della barra: non ruba spazio alle voci */
  .side-toggle:not([hidden]) {
    position: absolute; top: 20px; right: -13px; z-index: 41; display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; min-height: 26px; padding: 0; border-radius: 50%;
    background: var(--card); color: var(--text); border: 1px solid var(--line-strong); box-shadow: 0 4px 12px -4px rgba(10, 10, 30, 0.35);
    transition: transform 0.2s var(--spring), background-color 0.15s ease;
  }
  .side-toggle:hover { transform: scale(1.12); background: var(--card); color: var(--text); box-shadow: 0 4px 12px -4px rgba(10, 10, 30, 0.35); }
  .side-toggle .ico { width: 14px; height: 14px; margin: 0; transform: scaleX(-1); transition: transform 0.3s var(--ease); }
  body.nav-wide .shell { grid-template-columns: 268px minmax(0, 1fr); }
  body.nav-wide .side { width: 236px; padding: 14px 12px; align-items: stretch; border-radius: 28px; }
  body.nav-wide .brand-row { flex-direction: row; align-items: center; gap: 10px; padding: 0 4px 12px; }
  body.nav-wide .brand { flex: 1 1 auto; justify-content: flex-start; gap: 10px; }
  body.nav-wide .brand-text { display: flex; color: #fff; }
  body.nav-wide .brand-text small { color: #9898a3; }
  body.nav-wide .side-toggle:not([hidden]) { top: 26px; }
  body.nav-wide .side-toggle .ico { transform: none; }
  body.nav-wide .side nav { align-items: stretch; }
  body.nav-wide .side nav a { width: auto; height: 42px; justify-content: flex-start; gap: 12px; padding: 0 14px; border-radius: 14px; transform-origin: left center; }
  body.nav-wide .side nav a span {
    position: static; display: inline; opacity: 1; transform: none; padding: 0; background: none; box-shadow: none;
    color: inherit; font-size: 0.9rem; font-weight: 500; pointer-events: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  body.nav-wide .side nav a[aria-current='page'] span { font-weight: 700; }
  body.nav-wide .side-foot { flex-direction: row; justify-content: space-between; width: auto; padding: 10px 4px 0; }
}
@media (min-width: 960px) and (max-height: 740px) {
  body.nav-wide .side nav a { height: 36px; }
  body.nav-wide .side nav a span { display: inline; }
}

/* ── passaggio fluido tra le sezioni (View Transitions tra documenti dello stesso sito) ── */
@view-transition { navigation: auto; }
.side { view-transition-name: mep-rail; }
.side nav a[aria-current='page'] { view-transition-name: mep-active; }
main { view-transition-name: mep-main; }
body.in-pane main { view-transition-name: none; }
::view-transition-group(mep-active) { animation-duration: 0.38s; animation-timing-function: var(--spring); }
::view-transition-old(mep-main) { animation: mep-out 0.16s ease both; }
::view-transition-new(mep-main) { animation: mep-in 0.34s var(--ease) both; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.2s; }
@keyframes mep-out { to { opacity: 0; transform: translateX(-14px); } }
@keyframes mep-in { from { opacity: 0; transform: translateX(22px) scale(0.995); } }
/* con il passaggio animato l'entrata a cascata del contenuto sarebbe doppia: resta solo quella delle schede */
@supports (view-transition-name: none) { html:not(.soft) main > * { animation: none; } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .side nav a, .side nav a:hover, .side nav a:hover + a, .side nav a:has(+ a:hover) { transition: none; transform: none; }
}
