﻿:root {
  --dark: #2b2926;
  --cream: #faf8f5;
  --sand: #f1ece4;
  --ink: #26231f;
  --muted: #7b756c;
  --line: #e6dfd4;
  --accent: #9a6b3d;
  --ok: #3f7d4e;
  --danger: #c0392b;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
/* L'attributo hidden deve vincere sui display: flex/grid dei componenti
   (senza, il mese espanso del calendario e il banner non si nascondevano). */
[hidden] { display: none !important; }
body { margin: 0; background: var(--cream); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* Home */
.home { --home-bg: #14120f; min-height: 100vh; max-width: 560px; margin: 0 auto; color: #faf6f0; padding: 1.25rem 1.5rem 2.25rem;
  display: flex; flex-direction: column; align-items: center;
  background: radial-gradient(120% 78% at 50% -8%, #37312a 0%, #211e1a 46%, #100f0d 100%); }
.langs { display: flex; gap: .4rem; align-self: flex-end; }
.langs button { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16); color: #f0e8db;
  border-radius: 999px; padding: .3rem .8rem; font-weight: 700; letter-spacing: .04em; }
.langs button.on { background: #faf6f0; border-color: #faf6f0; color: #16130f; }
.brand { text-align: center; margin: 2.5rem 0 1.9rem; }
.mark { width: 88px; height: 88px; margin: 0 auto 1rem; border: 1px solid rgba(255, 255, 255, .25); border-radius: 28px;
  display: grid; place-items: center; font-size: 2.2rem; font-weight: 700;
  background: linear-gradient(160deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .02)); box-shadow: 0 18px 38px #0007; }
.brand h1 { margin: 0 0 .55rem; font-size: clamp(1.6rem, 6vw, 2.1rem); letter-spacing: .13em; text-transform: uppercase; line-height: 1.15; }
.tag { display: inline-block; margin: 0; padding: .42rem .9rem; border-radius: 999px; color: #ecdfcb; font-size: .86rem;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .13); }
.home.has-cover { padding-top: 0; position: relative; }
.cover { margin: 0 -1.5rem; width: calc(100% + 3rem); height: 230px; position: relative; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 50%, var(--home-bg)); }
.home.has-cover .langs { position: absolute; top: 1.25rem; right: 1.5rem; z-index: 2; }
.home.has-cover .brand { margin-top: 0; }
.thumb { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; flex: none; }
.hero-img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 14px; margin-bottom: 1rem; display: block; }
.home.has-logo .brand { margin: 1rem 0 1.5rem; }
/* Il logo del locale ha il fondo nero: `lighten` lo fonde con il gradiente (il nero prende il
   colore dello sfondo e i colori del marchio restano quelli veri). */
.logo { width: min(360px, 84vw); height: auto; display: block; margin: 0 auto .9rem;
  mix-blend-mode: lighten; filter: drop-shadow(0 18px 34px rgba(0, 0, 0, .55)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.home-actions { width: 100%; display: grid; gap: .75rem; }
/* Azioni in vetro: leggere sul gradiente e con il bordo che si accende al passaggio. */
.pill { display: block; text-align: center; text-decoration: none; padding: 1rem; border-radius: 999px; font-weight: 700;
  color: #faf6f0; background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .25); transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.pill:hover { transform: translateY(-1px); background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .3); }
.pill:active { transform: translateY(0) scale(.995); }
.pill.primary { background: #faf6f0; border-color: #faf6f0; color: #16130f; font-weight: 800;
  box-shadow: 0 16px 32px rgba(0, 0, 0, .38); }
.pill.primary:hover { background: #fff; border-color: #fff; }
.note { color: #b7ab99; font-size: .9rem; margin: 1rem 0 0; letter-spacing: .01em; }
.ghost-pill { margin-top: 2rem; background: none; border: 1px solid #fff3; color: #b3a896; border-radius: 10px; padding: .6rem 1.2rem; }
/* Il pulsante diventa più evidente quando il browser offre davvero l'installazione. */
.ghost-pill.pronto { border-color: #f5efe6; color: #f5efe6; }
.home-installa { display: block; width: 100%; max-width: 420px; }
/* In fondo alla home: aggiunta alla schermata Home e indicazioni come sola icona. */
.home-piede { width: 100%; max-width: 420px; margin-top: 1.9rem; display: flex; flex-direction: column;
  align-items: center; gap: 1rem; }
.installa-pill { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  background: #0a0a0a; color: #fff; border: 1px solid rgba(255, 255, 255, .22); font-weight: 800;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08); }
.installa-pill:hover { background: #161616; border-color: rgba(255, 255, 255, .4); }
.installa-pill.pronto { border-color: #faf6f0; }
.installa-icona { display: inline-flex; }
/* Solo icona: cerchio in vetro con il segnaposto disegnato, in fondo alla pagina. */
.pill-icona { width: 58px; height: 58px; padding: 0; border-radius: 50%; color: #faf6f0;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .2); display: grid; place-items: center;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .38); transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.pill-icona:hover, .pill-icona:focus-visible { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .38); transform: translateY(-1px); }
.icona-svg { display: inline-flex; }
.icona-svg svg { display: block; }
/* "Sono qui": porta al navigatore, non solo alla mappa. */
.pill-luogo { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; background: none; width: 100%; }
/* Avviso quando il sito è aperto nel browser di un'altra app (WhatsApp, Facebook…). */
.avviso-inapp { background: #fff3cd; color: #6b4f00; border-radius: 12px; padding: .75rem .9rem; font-size: .9rem; }
.copia-link { margin: .75rem 0 0; padding: .7rem 1rem; width: 100%; border-radius: 999px; border: 1.5px solid var(--dark);
  background: none; color: var(--dark); font-weight: 700; text-decoration: none; text-align: center; display: block; }
/* Foglio delle indicazioni: indirizzo e scelta del navigatore. */
.mappa-indirizzo { margin: 0 0 1rem; font-weight: 700; }
.mappa-scelte { display: grid; gap: .6rem; }
.mappa-voce { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem;
  padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; background: #fff; }
.mappa-voce span { color: var(--muted); font-size: .82rem; }
.mappa-voce:hover { border-color: var(--dark); }
/* Passi di installazione manuale (iOS, Firefox, desktop). */
.install-passi { margin: .5rem 0 0; padding-left: 1.2rem; display: grid; gap: .45rem; }

/* ------------------------------------------------------------------------------------------
   Home su schermi larghi: logo in alto, funzioni sotto, tutto in una schermata.
   Stesso impianto delle web-app di ordinazione (riferimento verificato: Convivio su NetFood
   Delivery e la demo NetFood): logo grande centrato in alto, azioni in colonna stretta
   (~340 px) subito sotto, note e installazione in coda. Il resto dello schermo resta sfondo,
   quindi la pagina si adatta sia in larghezza sia in altezza senza mai andare a due colonne.
   ------------------------------------------------------------------------------------------ */
@media (min-width: 900px) {
  body.home-page { background: radial-gradient(120% 78% at 50% -8%, #37312a 0%, #211e1a 46%, #100f0d 100%); }
  .home {
    position: relative;
    max-width: 720px;
    min-height: 100svh;
    padding: clamp(2rem, 5vh, 4rem) 2rem clamp(1.5rem, 4vh, 3rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
  }
  .home .langs { position: absolute; top: 1.5rem; right: 2rem; }
  .home .brand { margin: 0 0 2.25rem; }
  .home .brand .logo { width: min(430px, 58vw); margin-bottom: 1.25rem; }
  .home .brand .mark { width: 108px; height: 108px; font-size: 2.6rem; border-radius: 32px; }
  .home .brand h1 { font-size: clamp(2rem, 2.4vw, 2.6rem); }
  .home .brand .tag { font-size: 1rem; }
  .home .home-actions { width: min(100%, 340px); }
  .home .pill { padding: 1.05rem 1rem; font-size: 1.02rem; }
  .home .note { margin-top: 1.1rem; }
  .home .home-piede { width: min(100%, 340px); margin-top: 1.9rem; }
  .home .pill-icona { width: 60px; height: 60px; }
  .home .cover { width: min(100%, 640px); height: 260px; margin: 0 0 2rem; border-radius: 18px; overflow: hidden; }
  .home.has-cover { justify-content: flex-start; padding-top: clamp(3.5rem, 8vh, 5rem); }
  .home.has-cover .langs { position: static; align-self: flex-end; margin-bottom: 1rem; }
  .home.has-logo .brand { margin: 0 0 2.25rem; }
}

/* Schermi larghi ma bassi (portatili 1366×768, finestre ridotte): si stringe il ritmo. */
@media (min-width: 900px) and (max-height: 780px) {
  .home .brand { margin-bottom: 1.5rem; }
  .home .brand .logo { width: min(340px, 52vw); margin-bottom: .9rem; }
  .home .brand h1 { font-size: clamp(1.7rem, 2vw, 2.1rem); }
  .home .pill { padding: .85rem 1rem; }
  .home .home-piede { margin-top: 1.1rem; }
  .home .pill-icona { width: 52px; height: 52px; }
  .home .cover { height: 200px; margin-bottom: 1.5rem; }
}

/* Schermate */
.screen { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--cream); padding-bottom: 6rem; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; background: #fff; border-bottom: 1px solid var(--line); }
.tb-title { flex: 1; text-align: center; display: flex; flex-direction: column; text-transform: uppercase; letter-spacing: .04em; }
.tb-title small { color: var(--muted); text-transform: none; letter-spacing: 0; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; font-size: 1.5rem; text-decoration: none; }
.icon-btn:disabled { opacity: .25; cursor: default; }
.icon-btn.ghost { visibility: hidden; }
.content { padding: 1.25rem 1rem; }
.sec { margin: 1.5rem 0 .75rem; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.step-title { text-align: center; text-transform: uppercase; letter-spacing: .1em; margin: 1rem 0 1.25rem; }

.inp { width: 100%; padding: .75rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.inp:focus { outline: 2px solid var(--dark); border-color: transparent; }
/* Campo password con l'occhio per mostrare quello che si scrive. */
.campo-pass { position: relative; display: flex; align-items: center; }
.campo-pass .inp { flex: 1; min-width: 0; padding-right: 2.9rem; }
.occhio-pass { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); width: 2.15rem; height: 2.15rem;
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent;
  font-size: 1.05rem; line-height: 1; cursor: pointer; opacity: .55; }
.occhio-pass:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
.occhio-pass.attivo { opacity: 1; }
.search { margin-bottom: 1rem; }
.field { display: block; margin-bottom: .9rem; }
.field > span { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .3rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: .6rem 0; font-size: .9rem; }
.check input { margin-top: .2rem; width: 1.1rem; height: 1.1rem; flex: none; }
.error { background: #fdecea; color: var(--danger); padding: .7rem .9rem; border-radius: 10px; margin: .75rem 0; }

.btn { display: block; width: 100%; text-align: center; text-decoration: none; border: 0; border-radius: 14px; background: var(--dark); color: #fff; padding: .95rem 1rem; font-weight: 700; }
.btn:disabled { opacity: .6; cursor: wait; }
.link { background: none; border: 0; color: var(--accent); font-weight: 700; padding: .25rem; }

/* Menu */
.cat-tile { display: flex; align-items: center; gap: 1rem; padding: .6rem; margin-bottom: .75rem; background: var(--sand); border-radius: 16px; text-decoration: none; text-transform: uppercase; }
.initial { width: 54px; height: 54px; border-radius: 12px; background: var(--dark); color: #fff; display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; }
.cat-tile strong { flex: 1; }
.chev { font-size: 1.5rem; padding-right: .5rem; }
.product { display: flex; gap: .75rem; align-items: center; padding: 1rem; margin-bottom: .75rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.product strong { text-transform: uppercase; }
.product p { margin: .25rem 0; font-size: .85rem; color: var(--muted); text-transform: uppercase; }
.price { font-weight: 700; color: var(--accent); }
.plus { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--dark); color: #fff; font-size: 1.3rem; line-height: 1; }
.cart-fab { position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem; width: min(520px, calc(100% - 2rem)); z-index: 30; display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1.1rem; border: 0; border-radius: 16px; background: var(--dark); color: #fff; box-shadow: 0 8px 24px #0004; text-align: left; }
.cart-fab .count { background: #fff; color: var(--dark); border-radius: 999px; min-width: 28px; height: 28px; display: grid; place-items: center; font-weight: 700; }
.fab-cats { position: fixed; left: 1rem; bottom: 5.2rem; z-index: 25; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .5rem 1rem; text-decoration: none; font-weight: 700; box-shadow: 0 4px 12px #0002; }

/* Sheet */
.sheet { border: 0; padding: 0; width: min(560px, 100%); max-height: 88vh; margin: auto auto 0; border-radius: 22px 22px 0 0; background: #fff; flex-direction: column; overflow: hidden; }
.sheet[open] { display: flex; }
.sheet::backdrop { background: #0007; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem .75rem 1.25rem; border-bottom: 1px solid var(--line); }
.sheet-head h3 { margin: 0; }
.sheet-body { padding: 1rem 1.25rem; overflow-y: auto; flex: 1; }
.sheet-foot { display: flex; gap: .75rem; align-items: center; padding: .9rem 1.25rem; border-top: 1px solid var(--line); background: #fff; }
.sheet-foot .btn { flex: 1; }
.sheet-body .field { margin-top: 1rem; }
.sheet-price small { font-size: .85rem; font-weight: 400; color: var(--muted); }
.sheet-price { font-size: 1.5rem; font-weight: 800; margin: 0 0 .5rem; }
.desc { text-transform: uppercase; color: var(--muted); font-size: .9rem; }
.label { margin: 1.25rem 0 .5rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: block; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
/* Orario scritto a mano nella Nuova Prenotazione: niente orologio di sistema,
   si digitano i numeri ("2130") e il campo li legge come 21:30.
   Il suggerimento sta dentro la casella, così la scheda resta compatta. */
.ora-scritta { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.ora-scritta::placeholder { font-size: .82rem; letter-spacing: 0; opacity: .75; }
.ora-scritta.invalido { border-color: var(--danger); color: var(--danger); }
.ora-scritta.fuori-turno { border-color: #d39e00; }
/* Avviso quando l'orario scritto non è tra i turni del giorno. */
.ora-nota { display: block; margin-top: .3rem; font-size: .76rem; font-style: normal;
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #b45309; }
.ora-nota[hidden] { display: none; }
/* "✓ tra le 12:00 e le 15:00" oppure "Fuori orario": il colore dice subito com'è andata. */
.ora-nota.ok { color: #15803d; }
.ora-nota.errore { color: var(--danger); }
/* Sito pubblico: orario di apertura scelto e ora scritta a mano. */
.ora-blocco { margin-top: 1rem; }
.ora-blocco .btn { width: 100%; }
.muted.errore { color: var(--danger); }
.num:disabled { opacity: .45; }
/* Scelte rapide dell'orario: i turni del giorno, sotto il campo per scriverlo a mano. */
.turni-blocco { margin: 0 0 .7rem; }
.turni-titolo { display: block; font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: .3rem; }
.turni-rapidi { margin: 0; }
.turni-rapidi .chip { padding: .45rem .85rem; font-size: .95rem; }
.tag-chip { background: var(--sand); border-radius: 999px; padding: .25rem .7rem; font-size: .82rem; }
/* Allergene toccabile nel foglio del piatto: apre l'elenco dei 14 allergeni. */
button.tag-chip.tap { border: 0; font: inherit; font-size: .82rem; color: inherit; cursor: pointer; transition: background .15s, color .15s; }
button.tag-chip.tap:hover, button.tag-chip.tap:active { background: var(--dark); color: #fff; }
/* Allergene scelto: resta evidenziato nell'elenco. */
.allergen.on { border-color: var(--accent); background: #fff8ef; box-shadow: 0 0 0 2px #9a6b3d26; }
.allergen.on .num { background: var(--accent); color: #fff; }
.collapse { width: 100%; display: flex; align-items: center; gap: .6rem; padding: .75rem 0; margin-top: 1rem; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; text-transform: uppercase; }
.collapse small { flex: 1; color: var(--muted); text-transform: none; }
.opt { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; margin-top: .5rem; border: 1px solid var(--line); border-radius: 12px; text-transform: uppercase; font-weight: 600; }
.opt input { width: 1.2rem; height: 1.2rem; accent-color: var(--ok); }
.allergen { display: flex; gap: .75rem; align-items: center; padding: .7rem; margin-bottom: .5rem; border: 1px solid var(--line); border-radius: 12px; }
.allergen small { display: block; color: var(--muted); }
.num { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--sand); display: grid; place-items: center; font-size: .8rem; font-weight: 700; }

.qty { display: inline-flex; align-items: center; gap: .6rem; background: var(--sand); border-radius: 999px; padding: .25rem; flex: none; }
.qty button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: #fff; font-size: 1.1rem; }
.qty button:disabled { opacity: .35; }
.line { display: flex; gap: .75rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.line .grow { display: flex; flex-direction: column; gap: .15rem; }
.line small { color: var(--muted); }
.total { margin: 1rem 0; }
.total > div { display: flex; justify-content: space-between; padding: .3rem 0; }
.total .grand { border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .7rem; font-size: 1.15rem; }
.card-row { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.card-row small { display: block; color: var(--muted); }
.card-row.selected { border-color: var(--dark); }
.sticky-action { position: sticky; bottom: 0; padding: .9rem 0; background: linear-gradient(transparent, var(--cream) 30%); }
.done { text-align: center; padding-top: 3rem; }
.done .btn { margin-top: 1.25rem; }
.big-icon { width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 2.2rem; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 6rem; background: var(--dark); color: #fff; padding: .6rem 1.1rem; border-radius: 999px; z-index: 100; }

/* Prenotazione */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-bottom: 1px solid var(--line); }
.step { background: none; border: 0; padding: .7rem .25rem; display: flex; flex-direction: column; align-items: center; color: #b5aea3; }
.step b { font-size: 1.1rem; }
.step span { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.step.on { color: var(--ink); }
.step:disabled { cursor: default; opacity: .55; }
.num-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.num-grid .num, .time-grid .num { width: auto; height: auto; border-radius: 14px; padding: .9rem 0; font-size: 1rem; background: #fff; border: 1px solid var(--line); }
.num-grid .num.on, .time-grid .num.on { background: var(--dark); color: #fff; }
.callout { display: block; margin: 1.25rem 0; padding: .9rem 1rem; border-radius: 12px; background: var(--sand); text-decoration: none; font-weight: 600; text-align: center; }
.hours { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.hours ul { list-style: none; padding: 0; margin: .5rem 0; }
.hours li { display: flex; justify-content: space-between; padding: .25rem 0; font-size: .92rem; }
.cal { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: .75rem; }
.calhead { display: flex; align-items: center; justify-content: space-between; text-transform: capitalize; margin-bottom: .5rem; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; text-align: center; }
.grid b { font-size: .7rem; color: var(--muted); text-transform: uppercase; padding: .3rem 0; }
.day { aspect-ratio: 1; border-radius: 12px; border: 1px solid transparent; background: none; font-weight: 700; }
.day:disabled { color: #c9c2b7; font-weight: 400; cursor: default; }
.day.today { border-color: var(--line); }
.day.on { background: var(--dark); color: #fff; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1.25rem; }
.summary span { background: var(--dark); color: #fff; text-align: center; padding: .6rem .25rem; border-radius: 10px; font-weight: 700; font-size: .85rem; }

/* Admin */
.admin { max-width: 1040px; margin: 0 auto; padding: 1rem; }

/* Barra in alto sempre visibile: titolo, utente, aggiorna, esci.
   Resta appiccicata in cima insieme alle schede, così non si perde mai l'uscita.
   Margine negativo + padding uguale: la barra arriva al bordo superiore (così il blocco
   appiccicoso che sta sotto non si sposta di qualche pixel quando inizia lo scorrimento). */
.appbar { position: sticky; top: 0; z-index: 45; background: var(--cream);
  margin: -1rem -1rem 0; padding: calc(1rem + env(safe-area-inset-top)) 1rem .9rem; }
.apphead { display: flex; align-items: center; gap: .5rem; padding: .2rem 0 .45rem; }
.apphead h1 { margin: 0; font-size: 1.45rem; letter-spacing: -.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apphead-actions { display: flex; align-items: center; gap: .4rem; flex: none; }
.apphead .chip { padding: .45rem .8rem; }
.user-chip { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; font-size: 1.15rem; line-height: 1; }
.iconbtn:active { background: var(--sand); }

/* Schede: su desktop vanno a capo, su telefono scorrono in orizzontale.
   Lo spazio sotto è padding di .appbar: il margine lascerebbe un vuoto sopra i blocchi appiccicosi. */
.tabs { display: flex; gap: .45rem; margin: 0; padding-bottom: .35rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: .5rem 1.1rem; }
.chip.on { background: var(--dark); border-color: var(--dark); color: #fff; }
.tabs .chip.on { background: linear-gradient(135deg, #1d4ed8, #7c3aed); border: 0; color: #fff; }
.panel { background: #fff; border: 1px solid #e7ded0; border-radius: 14px; padding: 1rem; margin-bottom: 1rem; box-shadow: 0 1px 2px #0000000f, 0 4px 14px #0000000c; }
.panel h3 { margin-top: 0; }
.panel h4 { margin: 1rem 0 .5rem; }
.meta { color: var(--muted); font-size: .9rem; }
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; background: var(--sand); font-size: .8rem; font-weight: 700; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .inp { padding: .35rem .5rem; }
.inline { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .4rem 0; }
.inline .inp { width: auto; flex: 1 1 140px; }
.inline .btn { width: auto; padding: .5rem 1rem; font-size: .95rem; }
.btn.danger { background: var(--danger); }
.btn.ghost { background: #e5e7eb; color: var(--ink); }
.product-edit { border-top: 1px solid var(--line); padding: .75rem 0; }
.product-edit summary { cursor: pointer; font-weight: 600; }

/* Scheda Menu: aggiunte a pagamento su una riga sola (nome, prezzo, elimina). */
.extra-lista { display: grid; }
.extra-riga { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; border-top: 1px solid var(--line); }
.extra-lista > .extra-riga:first-child { border-top: 0; }
.extra-nome { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.extra-prezzo { flex: none; white-space: nowrap; font-weight: 600; color: var(--muted); }
.extra-form, .nuova-cat { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: .45rem 0 0; }
.extra-form .inp, .nuova-cat .inp { min-width: 0; }
.extra-form .inp.nome, .nuova-cat .inp { flex: 1 1 120px; }
.extra-form .inp.prezzo { flex: 0 0 78px; width: 78px; }
.extra-form .btn, .nuova-cat .btn { flex: none; width: auto; }
.extra-lista > .extra-modifica { margin: 0; padding: .3rem 0; border-top: 1px solid var(--line); }
.extra-lista > .extra-modifica:first-child { border-top: 0; }
.nuova-cat .check { white-space: nowrap; }
.cat-riga { display: flex; align-items: center; gap: .4rem; }
.cat-riga .pizza-flag { flex: 1 1 auto; min-width: 0; padding: 0; }
.cat-riga .drinks-flag { flex: 1 1 auto; min-width: 0; padding: 0; white-space: nowrap; }
@media (max-width: 720px) {
  .cat-riga .check { font-size: .8rem; }
  .cat-riga .drinks-flag span { font-size: .8rem; }
}
.cat-riga .tav-ico { flex: none; }
/* Scheda prodotto: prezzo e disponibilità sulla stessa riga. */
.prezzo-riga { display: flex; align-items: flex-end; gap: .6rem; }
.prezzo-riga .field { flex: 1 1 auto; min-width: 0; }
.prezzo-riga .check.disponibile { flex: none; margin: 0 0 .9rem; white-space: nowrap; }

/* Azioni della prenotazione: Proponi · Sala · Stato sulla stessa riga. */
.res-azioni { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.res-stato-mobile { display: none; }
.modale-azioni { display: flex; gap: .5rem; margin-top: .9rem; }
.modale-azioni .btn { flex: 1 1 auto; width: auto; }

/* Riga dei recapiti: il primo contatto a sinistra, i pulsanti a destra. */
.res-riga { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }

/* Menu a tendina personalizzati (sostituiscono i <select>): tutto chiaro, voci alte e pallino di scelta. */
.dd { position: relative; width: 100%; }
.dd-btn { display: flex; align-items: center; gap: .5rem; text-align: left; cursor: pointer; }
.dd-etichetta { flex: 1 1 0%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-etichetta.barrata { color: var(--danger); text-decoration: line-through; }
.dd-freccia { flex: 0 0 auto; color: var(--muted); }
.dd-btn.tono-confermata { border-color: #1d4ed8; color: #1d4ed8; }
.dd-btn.tono-nuova { border-color: #d39e00; color: #8a6d00; }
.dd-btn.tono-non_presentato { border-color: #b91c1c; color: #b91c1c; }
.dd-btn.tono-annullata { border-color: #9ca3af; color: #6b7280; }
.dd-velo { display: none; position: fixed; inset: 0; z-index: 59; background: #0f111533; }
.dd.aperto .dd-velo { display: block; }
.dd-lista { display: none; position: fixed; z-index: 60; background: #fff; color: var(--ink, #1f2937);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 44px #0000002e;
  overflow-y: auto; overscroll-behavior: contain; max-height: min(58vh, 420px); }
.dd.aperto .dd-lista { display: block; }
.dd-voce { --dd-tono: #94a0ad; display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; width: 100%; min-height: 3.35rem; padding: .85rem 1.1rem; background: none;
  border: 0; text-align: left; font-size: 1.02rem; font-weight: 600; color: inherit; cursor: pointer; }
.dd-voce + .dd-voce { box-shadow: inset 0 1px 0 var(--line); }
.dd-voce .dd-testo { flex: 1 1 0%; min-width: 0; }
.dd-radio { position: relative; flex: 0 0 auto; width: 1.35rem; height: 1.35rem;
  border-radius: 50%; border: 2px solid var(--dd-tono); }
.dd-voce.scelta .dd-radio::after { content: ''; position: absolute; inset: .17rem;
  border-radius: 50%; background: var(--dd-tono); }
.dd-voce.tono-confermata { --dd-tono: #1d4ed8; }
.dd-voce.tono-nuova { --dd-tono: #b45309; }
.dd-voce.tono-non_presentato { --dd-tono: #b91c1c; }
.dd-voce.tono-annullata { --dd-tono: #6b7280; }
.dd-voce.scelta { background: var(--sand); --dd-tono: #1d4ed8; }
.dd-voce:not(.occupata):hover, .dd-voce:not(.occupata):active { background: var(--sand); }
.dd-voce.occupata { color: var(--danger); text-decoration: line-through; cursor: not-allowed; }
.dd-voce.occupata .dd-radio { --dd-tono: #e3b4b4; border-style: dashed; }

/* Tavoli: barra, calendario dei giorni e schede (come nella scheda dell'app). */
.tav-barra { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: 0 .1rem .5rem; }
.tav-conteggio { font-size: .78rem; font-weight: 600; color: var(--muted); }
.tav-barra-azioni { display: flex; align-items: center; gap: .35rem; }
.tav-ico { display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid transparent; border-radius: 10px; background: none; color: var(--muted); }
.tav-ico.on { color: var(--dark); border-color: var(--line); background: #fff; }
.tav-ico.pericolo { color: var(--danger); width: 36px; height: 39px; }
.tav-nuovo { display: inline-flex; align-items: center; gap: .3rem; width: auto; }

.tav-cal { padding: .45rem .35rem .55rem; display: grid; gap: .2rem; }
.tav-cal-testa { display: flex; align-items: center; gap: .1rem; }
.tav-freccia-btn { display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 0; background: none; color: var(--muted); border-radius: 8px; }
.tav-freccia-btn:active { background: var(--sand); }
.tav-mese { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start;
  gap: 0; padding: .1rem .25rem; border: 0; background: none; text-align: left; }
.tav-mese-titolo { display: flex; align-items: center; gap: .15rem; }
.tav-mese-titolo strong { font-size: .9rem; font-weight: 700; }
.tav-freccia { display: inline-flex; color: var(--muted); }
.tav-cal-conteggio { font-size: .68rem; color: var(--muted); }
.tav-oggi { padding: .25rem .35rem; border: 0; background: none; color: var(--accent);
  font-size: .75rem; font-weight: 700; }

.tav-striscia { position: relative; display: flex; gap: 4px; overflow-x: auto; padding: 2px;
  scrollbar-width: none; overscroll-behavior-x: contain; }
.tav-striscia::-webkit-scrollbar { display: none; }
.tav-giorno { flex: 0 0 auto; width: 42px; height: 56px; padding: 0; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px solid transparent; border-radius: 10px; background: none; color: var(--ink); }
.tav-giorno .g-sett { font-size: .6rem; color: var(--muted); }
.tav-giorno .g-num { font-size: .92rem; line-height: 1.1; }
.tav-giorno .g-punto { width: 6px; height: 6px; border-radius: 999px; background: transparent;
  font-size: .56rem; font-weight: 700; line-height: 1; color: #fff;
  display: flex; align-items: center; justify-content: center; }
/* Giorni con prenotazioni: verde vivo e pallino con il numero delle prenotazioni. */
.tav-giorno.pren { background: #9ee6b8; border-color: #16a34a; }
.tav-giorno.pren .g-sett { color: #0f6b33; }
.tav-giorno.pren .g-num { font-weight: 800; color: #064e2b; }
.tav-giorno.pren .g-punto { width: auto; min-width: 13px; height: 13px; padding: 0 3px; background: #0f7a3d; }
/* Oggi: bordo marcato e giorno della settimana in celeste. */
.tav-giorno.oggi { border-color: #0284c7; border-width: 2px; }
.tav-giorno.oggi:not(.pren) { background: #e0f2fe; }
.tav-giorno.oggi .g-sett { color: #0369a1; font-weight: 700; }
/* Giorno scelto: blu; se ha prenotazioni resta riconoscibile dal bordo verde e dal pallino. */
.tav-giorno.scelto { background: #0f3d63; border-color: #0f3d63; color: #fff; }
.tav-giorno.scelto .g-sett { color: #ffffffc9; }
.tav-giorno.scelto .g-num { color: #fff; }
.tav-giorno.scelto.pren { background: #0b5d33; border-color: #4ade80; }
.tav-giorno.scelto.pren .g-sett { color: #c9f7d8; }
.tav-giorno.scelto.pren .g-punto { background: #4ade80; color: #06331a; }
.tav-griglia { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding-top: .3rem;
  /* Lo scorrimento verticale resta al browser, quello orizzontale serve allo swipe tra i mesi. */
  touch-action: pan-y; }
.tav-sett { font-size: .62rem; color: var(--muted); text-align: center; }
.tav-giorno.tondo { width: 36px; height: 36px; border-radius: 50%; justify-self: center; }
.tav-giorno.tondo .g-num { font-size: .8rem; }

.tav-riepilogo { margin: .1rem .2rem .55rem; font-size: .76rem; color: var(--muted); }
.tavoli-elenco { display: grid; gap: .7rem; }
.tav-scheda { display: grid; gap: .35rem; }
.tav-scheda.focus-row { border-color: #f9a825; box-shadow: 0 0 0 2px #f9a82555; }
.tav-testa { display: flex; flex-direction: column; gap: .05rem; }
.tav-testa strong { font-size: 1rem; }
.tav-sotto { font-size: .74rem; color: var(--muted); }
.tav-mod { display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-end; }
.tav-mod .field { flex: 1 1 90px; min-width: 0; margin-bottom: 0; }
.tav-mod .field.posti { flex: 0 0 72px; }
.tav-mod .btn { flex: 0 0 auto; width: auto; height: 39px; min-height: 39px; padding: 0 14px; }
.tav-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.tav-form .field { flex: 1 1 90px; min-width: 0; margin-bottom: 0; }
.tav-form .field.posti { flex: 0 0 72px; }
.tav-forma-riga { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; width: 100%; }
.tav-etichetta { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); }
.tav-forma { width: auto; padding: .32rem .75rem; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; font-size: .8rem; }
.tav-forma.on { background: var(--dark); border-color: var(--dark); color: #fff; font-weight: 600; }
.tav-aggiungi { flex: 0 0 auto; width: auto; height: 39px; min-height: 39px; padding: 0 14px; }
.tav-nota { margin: .5rem 0 0; font-size: .72rem; color: var(--muted); }
.tav-accorpato { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  font-size: .74rem; color: var(--muted); }
.tav-pren-testa { display: flex; align-items: center; justify-content: space-between; gap: .4rem;
  flex-wrap: wrap; padding-top: .5rem; border-top: 1px solid var(--line); }
.tav-pren-testa > span { font-size: .72rem; font-weight: 600; color: var(--muted); }
.tav-pren-azioni { display: flex; gap: .25rem; }
.tav-pren-lista { display: grid; gap: .4rem; }
.tav-pren-riga { display: grid; gap: .25rem; }
.tav-pren-testo { font-size: .84rem; }
.tav-pren-riga .dd { width: 100%; max-width: 100%; }
.tav-pren-riga .dd-btn { height: 34px; min-height: 34px; padding: .2rem .55rem; font-size: .8rem; }
.tav-vuoto { display: flex; align-items: baseline; gap: .45rem; font-size: .84rem; color: var(--muted); }
@media (min-width: 1080px) {
  .tavoli-elenco { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); align-items: start; }
}

/* Rubrica: schede dei clienti con recapiti e azioni rapide. */
.rubrica { display: grid; gap: .7rem; }
/* Titolo della ricerca e conteggio sulla stessa riga. */
.rubrica-etichetta-riga { display: flex; align-items: baseline; justify-content: space-between;
  gap: .6rem; margin-bottom: .3rem; }
.rubrica-etichetta-riga > span { font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; }
.rubrica-conteggio { font-style: normal; font-size: .78rem; font-weight: 600; color: var(--muted);
  white-space: nowrap; }
/* Filtro per tipo: tutti i contatti, chi ha prenotazioni, chi ha ordini. */
.rubrica-filtro { display: flex; gap: .5rem; align-items: center; }
.rubrica-filtro .dd { width: auto; max-width: 100%; }
.rubrica-filtro .dd-btn { height: 38px; min-height: 38px; padding: .35rem .6rem;
  font-size: .85rem; gap: .35rem; }
.rubrica-filtro .dd-freccia { font-size: .7rem; }
/* Bottone delle statistiche, compatto come il filtro. */
.rubrica-filtro button.stats-btn {
  height: 38px; min-height: 38px; padding: 0 .7rem; font-size: .85rem; line-height: 1;
}
/* Riquadri della finestra Statistiche: 2 colonne, 4 numeri chiave. */
.stats-filtri { margin-bottom: .8rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.stats-filtri .dettaglio-filtro-riga { justify-content: flex-start; }
.stats-periodo { margin-top: .45rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
.stats-kpi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.stats-kpi-cella { border: 1px solid var(--line); border-radius: 14px; padding: .6rem .7rem;
  background: #fff; border-left-width: 4px; }
.stats-kpi-cella > span { display: block; font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); }
.stats-kpi-cella > strong { display: block; font-size: 1.4rem; line-height: 1.15; margin: .1rem 0 .12rem; }
.stats-kpi-cella .meta { font-size: .74rem; line-height: 1.25; }
.stats-kpi-cella.blu { border-left-color: #1d4ed8; }
.stats-kpi-cella.blu > strong { color: #1d4ed8; }
.stats-kpi-cella.verde { border-left-color: #15803d; }
.stats-kpi-cella.verde > strong { color: #15803d; }
.stats-kpi-cella.ambra { border-left-color: #b45309; }
.stats-kpi-cella.ambra > strong { color: #b45309; }
.stats-vuoto { margin: .6rem 0 0; font-size: .85rem; }
/* Sezioni con titolo, barra proporzionale e legenda. */
.stats-sezione { margin-top: 1rem; }
.stats-sezione h4 { margin: 0 0 .45rem; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); }
.stats-barra { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--sand); }
.stats-barra i { display: block; height: 100%; }
.stats-barra.vuota i { background: #e2e8f0; }
.stats-legenda { display: flex; flex-wrap: wrap; gap: .3rem .8rem; margin-top: .45rem; }
.stats-voce { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--muted); }
.stats-voce i { width: 9px; height: 9px; border-radius: 50%; }
.stats-voce b { color: var(--ink, #1f2937); }
/* Classifica dei clienti. */
.stats-top { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.stats-top li { display: flex; align-items: center; gap: .5rem; padding: .35rem 0;
  border-top: 1px solid var(--line); }
.stats-top li:first-child { border-top: 0; }
.stats-pos { flex: none; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--sand);
  font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.stats-top .grow { flex: 1 1 50%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-conteggi { flex: none; font-size: .74rem; color: var(--muted); white-space: nowrap; }
.stats-top strong { flex: none; font-size: .85rem; }
.rubrica-scheda { display: grid; gap: .3rem; }
.rubrica-testa { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.rubrica-testa strong { font-size: 1.02rem; }
.rubrica-recapiti { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-weight: 600; }
.rubrica-recapiti a { color: inherit; text-decoration: none; }
/* Totali del cliente: prenotazioni, confermate, ordini e importo speso. */
.rubrica-stats { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .45rem; }
.rubrica-stats .meta { font-size: .8rem; }
.rubrica-azioni { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .2rem; }
/* Storico nel pannello Dettagli. */
.rubrica-dettaglio h4 { margin: .9rem 0 .3rem; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); }
.rubrica-elenco { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.rubrica-elenco li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  padding: .35rem 0; border-top: 1px solid var(--line); }
.rubrica-elenco li:first-child { border-top: 0; }
.rubrica-elenco .grow { flex: 1 1 60%; min-width: 0; }

/* Finestra sopra la pagina (dettagli della rubrica): non allunga la scheda sottostante. */
body.modale-aperta { overflow: hidden; }
.modale { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center;
  justify-content: center; padding: 1rem; background: #0f11159e; }
/* Finestre con campi da compilare: restano in alto, così i pulsanti non finiscono sotto la tastiera. */
.modale.modale-alta { align-items: flex-start; padding-top: .5rem; }
.modale.modale-alta .modale-pannello { max-height: calc(100vh - 1rem); }
@supports (height: 100dvh) {
  .modale.modale-alta .modale-pannello { max-height: calc(100dvh - 1rem); }
}
/* Il numero di persone si cambia col doppio tocco proprio sul numero. */
.res-persone { cursor: pointer; touch-action: manipulation; border-radius: 6px;
  padding: .2rem .25rem; margin: -.2rem -.25rem; }
.res-persone:hover { text-decoration: underline dotted; }
.modale-pannello { display: flex; flex-direction: column; width: min(560px, 100%);
  max-height: min(86vh, 720px); background: #fff; border-radius: 18px;
  box-shadow: 0 24px 60px #0000004d; overflow: hidden; }
.modale-testa { display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.modale-testa h3 { margin: 0; font-size: 1rem; }
.modale-corpo { padding: 1rem; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; }
.modale-corpo h4:first-child { margin-top: 0; }
/* Nella finestra l'elenco sta sopra al pannello e resta un po' più stretto. */
.modale .dd-velo { z-index: 95; background: #0f11151f; }
.modale .dd-lista { z-index: 96; }
/* Filtro del periodo nei dettagli: menu compatto a sinistra, numero di movimenti a destra. */
.dettaglio-filtri { margin-bottom: .9rem; }
.dettaglio-filtro-riga { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.dettaglio-filtro-riga .dd { width: auto; flex: 0 1 auto; min-width: 0; max-width: 62%; }
.dettaglio-filtro-riga .dd-btn {
  height: 38px; min-height: 38px; padding: .35rem .6rem; font-size: .85rem; gap: .35rem;
}
.dettaglio-filtro-riga .dd-freccia { font-size: .7rem; }
.dettaglio-filtro-riga .meta { flex: none; white-space: nowrap; }
.dettaglio-date { display: flex; gap: .5rem; margin-top: .5rem; }
.dettaglio-date label { flex: 1 1 0; min-width: 0; }
.dettaglio-date span { display: block; font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: .2rem; }
.dettaglio-date[hidden] { display: none; }
/* Due righe di totali: prenotazioni/confermate, poi ordini/importo. */
.dettaglio-totali { display: grid; gap: .4rem; }

/* Filtri della tab Prenotazioni: sempre visibili, allineati sulla stessa riga. */
.filtri-campi { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.filtri-campi .field { flex: 1 1 150px; min-width: 0; margin-bottom: 0; }
.filtri-campi .field .inp { width: 100%; }

/* Prenotazioni: la barra dei filtri resta appiccicata sotto l'intestazione mentre si scorre. */
.res-filtri { position: sticky; top: var(--appbar-h, 96px); z-index: 40; margin-bottom: .6rem;
  padding: .55rem .65rem; box-shadow: 0 2px 10px #00000014; }
.res-filtri-riga { display: flex; align-items: flex-end; gap: .5rem; flex-wrap: wrap; }
.res-filtri .filtri-campi { flex: 1 1 380px; gap: .4rem; }
.res-filtri .filtri-campi .field > span { font-size: .62rem; line-height: 1.1; margin-bottom: .15rem; }
.res-filtri .filtri-campi .field .inp { height: 40px; min-height: 40px; padding: 0 .5rem; }
.res-cerca { display: flex; align-items: center; gap: .45rem; flex: 1 1 240px; min-width: 0; }
.res-cerca .inp { flex: 1 1 auto; width: 100%; height: 40px; min-height: 40px; padding: 0 .6rem 0 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M16.5 16.5 21 21'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: .55rem center; background-size: 15px;
  -webkit-appearance: none; appearance: none; }
.res-conteggio { flex: none; font-size: .72rem; color: var(--muted); white-space: nowrap; }

/* Riepilogo "data · ora · persone" sotto il nome: serve solo sul telefono, dove le colonne
   Data/Ora/Persone sono nascoste. Su computer ci sono già le colonne dedicate. */
.res-sub { display: none; }
/* Quando è arrivata la richiesta (data e ora italiane): riga piccola, sempre visibile. */
.res-ricevuta { display: block; margin-top: .1rem; font-size: .68rem; color: var(--muted); }

/* Prenotazioni rimaste senza tavolo: non sono confermate e vanno gestite a mano. */
.res-avviso { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .15rem .6rem;
  background: #fff8e1; border: 1px solid #f0d48a; border-left: 4px solid #d99b00;
  border-radius: 12px; padding: .45rem .6rem; margin-bottom: .55rem; }
.res-avviso strong { font-size: .88rem; color: #7a5600; }
.res-avviso p { grid-column: 1 / -1; margin: 0; font-size: .76rem; line-height: 1.25; color: #7a5600; }
.res-avviso .btn { width: auto; flex: 0 0 auto; }
/* Arrivo dal "Dettaglio" di un tavolo: giorno e tavolo scelti, con le due uscite. */
.res-giorno { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-bottom: .5rem;
  padding: .35rem .5rem; border-radius: 10px; background: var(--sand); }
.res-giorno-testo { flex: 1 1 auto; font-size: .78rem; font-weight: 600; }
.res-giorno .btn { width: auto; flex: 0 0 auto; }
/* Simbolo dell'app accanto al testo: WhatsApp e busta della posta.
   Il disegno prende il colore del pulsante, così segue anche lo stato
   (rosso = messaggio da mandare, verde = già  mandato). */
.btn.wa, .btn.mail {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; border-radius: 999px;
}
/* Il pulsante è un cerchietto: niente padding, larghezza e altezza uguali. */
.btn.sm.wa, .btn.sm.mail { width: 30px; height: 30px; min-width: 30px; min-height: 30px; padding: 0; }
.btn.wa::before, .btn.mail::before {
  content: ''; width: 15px; height: 15px; flex: none; background-color: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.btn.wa::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z'/%3E%3C/svg%3E");
}
.btn.mail::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555ZM0 4.697v7.104l5.803-3.558L0 4.697ZM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757Zm3.436-.586L16 11.801V4.697l-5.803 3.546Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555ZM0 4.697v7.104l5.803-3.558L0 4.697ZM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757Zm3.436-.586L16 11.801V4.697l-5.803 3.546Z'/%3E%3C/svg%3E");
}
.badge.warn { background: #fdecea; color: var(--danger); }
.badge.info { background: #dbeafe; color: #1d4ed8; }
.badge.ok { background: #dcfce7; color: #15803d; }
td.unassigned { border-left: 3px solid var(--danger); }
.btn.sm { width: auto; padding: .3rem .7rem; font-size: .85rem; }
/* Messaggi al cliente: rosso = da mandare, verde = già  mandato. */
.btn.todo { background: #fdecea; color: var(--danger); border: 1px solid var(--danger); }
.btn.done { background: #e6f4ea; color: #1b5e20; border: 1px solid #2e7d32; }
/* Utente in sola lettura: i controlli si vedono ma non si possono usare. */
.read-only select, .read-only input, .read-only textarea, .read-only button { pointer-events: none; opacity: .55; }
.stack { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; margin-bottom: .4rem; }
.allergen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .15rem .75rem; }
.turni { display: flex; flex-direction: column; gap: .3rem; }
.turno { display: flex; align-items: center; gap: .4rem; }
.turno span:first-child { font-size: .72rem; color: var(--muted); min-width: 52px; }
.turno .inp { max-width: 110px; padding: .35rem .4rem; }
/* Fascia oraria a metà: la riga si segna in rosso e non viene salvata. */
.turno.invalido > span:first-child { color: var(--danger); }
.turno.invalido .inp { border-color: var(--danger); }
/* "+ Fascia" e "+ Turno" larghi quanto il testo, sotto le righe. */
.turni > .btn { align-self: flex-start; width: auto; }
.turni > .btn:disabled { opacity: .5; cursor: not-allowed; }
.mode-switch { display: flex; gap: 1.2rem; margin-bottom: .4rem; }

.imgctl { display: flex; gap: 1rem; align-items: flex-start; margin: .75rem 0; }
.imgctl .preview { width: 140px; height: 100px; flex: none; object-fit: contain; border-radius: 10px; background: var(--sand); }
.imgctl .preview.empty { display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.imgctl .btn { margin-top: .5rem; width: auto; padding: .4rem .9rem; }

/* Sala */
.floor-canvas { position: relative; container-type: inline-size; height: 560px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff repeating-linear-gradient(0deg, transparent, transparent 39px, #f0ece4 40px) repeating-linear-gradient(90deg, transparent, transparent 39px, #f0ece4 40px); }
/* Barra della Sala: data e turno su una riga, modalità  sulla successiva, comandi in modifica compatti. */
.floor-toolbar { display: grid; gap: .3rem; grid-template-columns: minmax(0, 1fr); }
.floor-riga, .floor-modi, .floor-edit, .floor-nota { min-width: 0; }
.floor-riga { display: flex; align-items: center; gap: .3rem; }
/* Data: frecce e campo in un unico blocco, senza etichetta sopra. */
.floor-data { flex: 1 1 auto; min-width: 0; display: flex; align-items: stretch;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.floor-data .floor-step { flex: 0 0 30px; width: 30px; height: 34px; padding: 0; border: 0;
  background: var(--sand); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.floor-data .floor-step:active { background: #e7e1d6; }
.floor-data-inp.inp { flex: 1 1 auto; min-width: 0; width: auto; height: 34px; min-height: 34px;
  margin: 0; padding: 0 .3rem; border: 0; border-radius: 0; background: transparent;
  font-size: .84rem; text-align: center; }
.floor-oggi.chip { flex: 0 0 auto; height: 34px; padding: 0 .55rem; font-size: .78rem; white-space: nowrap; }
.floor-oggi.chip:disabled { opacity: 1; cursor: default; }
.floor-riga-modi { flex-wrap: wrap; }
.floor-turno.inp { flex: 1 1 110px; min-width: 0; width: auto; height: 34px; min-height: 34px;
  padding: 0 .45rem; font-size: .82rem; }
.floor-modi { flex: 1 1 170px; display: flex; gap: .3rem; }
.floor-modi .chip { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 .3rem; font-size: .74rem; white-space: nowrap; }
.floor-edit { display: grid; gap: .3rem; grid-template-columns: minmax(0, 1fr); }
.floor-aggiungi { display: flex; gap: .3rem; align-items: stretch; min-width: 0; }
.floor-aggiungi .inp { height: 34px; min-height: 34px; padding: 0 .45rem; font-size: .84rem; width: auto; }
.floor-aggiungi .inp[name="name"] { flex: 1 1 90px; min-width: 0; max-width: 280px; }
.floor-aggiungi .inp[name="seats"] { flex: 0 0 58px; width: 58px; }
.floor-aggiungi .btn { flex: 0 0 auto; width: auto; height: 34px; min-height: 34px; padding: 0 10px; font-size: .82rem; }
.floor-azioni { display: flex; gap: .3rem; }
.floor-azioni .btn { flex: 1 1 0; width: auto; max-width: 170px; height: 32px; min-height: 32px; padding: 0 8px; font-size: .8rem; }
.floor-azioni .btn:disabled { opacity: .45; }
.floor-nota { margin: 0; font-size: .72rem; color: var(--muted); }
.ftile { position: absolute; border: 2px solid #94a3b8; border-radius: 12px; padding: .2rem .4rem; cursor: grab; user-select: none; touch-action: none; display: flex; flex-direction: column; justify-content: center; gap: 0; box-shadow: 0 1px 4px #0002; }
.ftile strong { font-size: .88rem; line-height: 1.1; }
.ftile small { font-size: .7rem; color: var(--muted); line-height: 1.1; }
.ftile.sel { outline: 3px solid #1f2937; }
/* Ruotato di 90°: tessera verticale; le dimensioni arrivano dallo stile inline. */
.ftile.ruotato { min-width: 0; min-height: 0; text-align: center; align-items: center; overflow-wrap: anywhere; }
.ftile.combo { border-style: dashed; border-color: #7c3aed; background: #f5f3ff; }
.t-free { background: #e8f5e9; border-color: #43a047; }
.t-nuova { background: #fff8e1; border-color: #f9a825; }
.t-confermata { background: #e3f2fd; border-color: #1e88e5; }
.t-non_presentato { background: #ffe0e0; border-color: #d81b60; }
/* Occupato solo in alcune fasce: metà verde (libero) e metà celeste (occupato). */
.ftile.t-misto { background: linear-gradient(90deg, #e8f5e9 0 50%, #e3f2fd 50% 100%);
  border-color: #1e88e5; }
/* Dettagli del tavolo, nella finestra che si apre tenendo premuto. */
.sala-dettaglio-data { margin: 0 0 .5rem; text-transform: capitalize; }
.sala-dettaglio { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.sala-dettaglio li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  padding: .45rem 0; border-top: 1px solid var(--line); }
.sala-dettaglio li:first-child { border-top: 0; }
.sala-dettaglio .grow { flex: 1 1 150px; min-width: 0; }
.legend { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.legend .chip { padding: .3rem .8rem; font-size: .85rem; }
.floor-view .ftile { cursor: pointer; }
.tbl tr.focus-row td { background: #fff3cd; }

/* Ogni prenotazione prende il colore del suo stato (stessi toni del badge e della Sala):
   si capisce a colpo d'occhio cosa è confermato, cosa è ancora da gestire e cosa è saltato. */
.tbl tr.res-row { border-left: 5px solid transparent; }
.tbl tr.res-nuova { background: #fff4d6; border-color: #f0d48a; border-left-color: #e0a800; }
.tbl tr.res-confermata { background: #e9f3ff; border-color: #a9cdf8; border-left-color: #3b82f6; }
.tbl tr.res-non_presentato { background: #ffecec; border-color: #f3bcbc; border-left-color: #dc2626; }
.tbl tr.res-annullata { background: #eef0f3; border-color: #d7dbe0; border-left-color: #9ca3af; }
.tbl tr.res-annullata td { color: #6b7280; }
.tbl tr.res-annullata td.res-cliente strong { text-decoration: line-through; text-decoration-thickness: 1px; }
/* Annullata: il menu del tavolo si vede ma non si apre. */
.dd-btn.bloccato, .dd-btn:disabled { background: #f1f3f5; color: #8a929c; border-color: #dfe3e8; cursor: not-allowed; }
.dd-btn.bloccato .dd-freccia, .dd-btn:disabled .dd-freccia { opacity: .4; }
/* Elimina: compare solo sulle prenotazioni annullate; su computer sta nella colonna Stato,
   su telefono nella riga dei pulsanti. */
.res-elimina { width: auto; }
.tbl tr.res-row .res-azioni .res-elimina-mobile { display: none; }
@media (max-width: 720px) {
  .tbl tr.res-row .res-azioni .res-elimina-mobile { display: inline-flex; align-items: center; justify-content: center; }
}

/* Categorie del menu: chiuse si vede solo l'intestazione, così la pagina non diventa lunghissima. */
.cat-panel { padding: .85rem 1rem; }
.cat-panel > summary { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.cat-panel > summary strong { flex: 1; min-width: 0; }
.cat-panel[open] > summary { margin-bottom: .5rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.cat-body h4 { margin: 1rem 0 .5rem; }
/* Categoria: intestazione sempre visibile (anche spenta) con interruttori e riordino. */
.cat-scheda { padding: .8rem 1rem; }
.cat-scheda.spenta { background: #fdfbf7; }
.cat-scheda.dragging { opacity: .55; }
.cat-testa { display: flex; align-items: center; gap: .45rem .7rem; flex-wrap: wrap; }
.cat-titolo { display: flex; align-items: baseline; gap: .4rem; min-width: 0; flex: 1 1 220px; flex-wrap: wrap; }
.cat-titolo strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-titolo .meta { flex: 1 1 100%; font-size: .78rem; line-height: 1.2; }
.cat-canali { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.cat-azioni { display: flex; align-items: center; gap: .15rem; flex: none; }
.cat-azioni .tav-ico { width: 30px; height: 32px; }
.cat-drag { cursor: grab; font-size: 1rem; touch-action: none; }
.cat-drag:active { cursor: grabbing; }
.cat-dettaglio > summary { cursor: pointer; font-weight: 600; padding: .5rem 0 0; margin-top: .45rem; border-top: 1px solid var(--line); }
.cat-dettaglio[open] > summary { margin-bottom: .35rem; }
.tipo-categoria-box { margin-bottom: .35rem; }
.tipo-categoria-box .field { margin-bottom: .45rem; }
.tipo-categoria-box .legacy-flag { color: #8a4b00; }
.avviso-categoria { background: #fff4d6; border: 1px solid #f0d48a; border-radius: 10px; padding: .45rem .6rem; color: #7a5600; }
.switch { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); border-radius: 999px; padding: .22rem .5rem; background: #fff; font-size: .78rem; font-weight: 600; cursor: pointer; white-space: nowrap; user-select: none; }
.switch input { width: 1.05rem; height: 1.05rem; flex: none; margin: 0; }
.switch.mini { padding: .18rem .42rem; font-size: .72rem; }
.product-riga { display: flex; align-items: center; gap: .45rem; border-top: 1px solid var(--line); }
.product-riga > .product-edit { flex: 1 1 auto; min-width: 0; border-top: 0; }
.product-riga .disponibilita-piatto { flex: none; margin: .2rem 0; }
@media (max-width: 720px) {
  .cat-testa { gap: .35rem .45rem; }
  .cat-titolo { flex-basis: 100%; }
  .cat-titolo strong { flex: 1 1 100%; font-size: .95rem; }
  .cat-canali { flex: 1 1 100%; }
  .cat-azioni { margin-left: auto; }
  .cat-scheda { padding: .55rem .65rem; }
  .switch { font-size: .72rem; padding: .18rem .42rem; }
  .product-riga { gap: .3rem; }
}
/* Carrello pubblico: righe non più ammesse per il tipo di ordine scelto. */
.line.invalid { background: #fdf3f2; border-radius: 10px; padding-left: .45rem; padding-right: .45rem; }
.line.invalid .price { color: var(--danger); }
.line .invalid-note { color: var(--danger); font-size: .78rem; }
.cart-warning { background: #fdecea; color: var(--danger); border-radius: 12px; padding: .7rem .85rem; margin: .75rem 0; font-size: .86rem; }
.cart-warning .btn { margin-top: .5rem; }
.invalid-cart-block { opacity: .6; }

/* Ordini: stesse tinte e stesso ritmo delle schede prenotazione.
   Bordo sinistro e sfondo dicono a colpo d'occhio a che punto è l'ordine. */
.ord { display: grid; gap: .45rem; border-left: 5px solid transparent; padding: .6rem .7rem .65rem; }
/* Ordini del sito: tre stati, stessi colori delle prenotazioni (nuova, inviata, annullata). */
.ord-nuovo { background: #fff4d6; border-color: #f0d48a; border-left-color: #e0a800; }
.ord-in_preparazione { background: #e9f3ff; border-color: #a9cdf8; border-left-color: #3b82f6; }
.ord-annullato { background: #eef0f3; border-color: #d7dbe0; border-left-color: #9ca3af; }
.ord-testa { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; }
.ord-titolo { display: flex; align-items: baseline; gap: .35rem; }
.ord-titolo strong { font-size: 1.05rem; line-height: 1.1; }
.ord-tipo { font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.ord-quando { font-size: .78rem; font-weight: 600; background: #ffffffb0; border: 1px solid var(--line);
  border-radius: 999px; padding: .12rem .55rem; white-space: nowrap; }
/* Il menu dello stato sta a destra e resta stretto anche dentro la riga. */
.ord-stato { margin-left: auto; }
.ord-stato .dd { width: auto; }
.ord-stato .dd-btn { height: 32px; padding: 0 .55rem; font-size: .8rem; border-radius: 999px; }
.ord-cliente { display: grid; gap: .15rem; }
.ord-cliente > strong { font-size: .95rem; }
.ord-recapiti { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .5rem; }
.ord-recapiti .res-tel { font-weight: 600; font-size: .92rem; text-decoration: none; }
.ord-recapiti .res-mail { font-size: .85rem; color: var(--accent); text-decoration: none; word-break: break-word; }
.ord-indirizzo { margin: 0; font-size: .85rem; }
.ord-piatti { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.ord-piatti li { display: grid; gap: .05rem; padding-top: .25rem; border-top: 1px solid #00000012; }
.ord-piatti li:first-child { border-top: 0; padding-top: 0; }
.ord-piatto-testo { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; font-size: .9rem; }
.ord-piatto-testo strong { white-space: nowrap; font-weight: 600; }
.ord-piatto-nota { font-size: .78rem; color: var(--muted); }
/* Modifiche del cliente: tolto in rosso, aggiunta in blu, modifica libera in viola (come nell'app). */
.ord-piatto-nota .senza { color: var(--danger); font-weight: 600; }
.ord-piatto-nota .aggiunte { color: var(--accent); font-weight: 600; }
.ord-piatto-nota .modifica { color: #6D28D9; font-weight: 600; }
.cmd-nota { margin: .15rem 0 0; font-size: .8rem; color: #8A4B00; background: #FFF1DC;
  border-radius: 6px; padding: .25rem .45rem; }
.ord-nota-ordine { margin: 0; font-size: .85rem; background: #ffffff90; border-radius: 8px; padding: .3rem .45rem; }
.ord-totale { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem;
  padding-top: .35rem; border-top: 1px solid #00000018; }
.ord-totale strong { font-size: 1rem; }
/* Cambio dell'orario di ritiro di un ordine del sito. */
.ord-orario { display: flex; align-items: center; gap: .4rem; margin-top: .35rem; flex-wrap: wrap; }
.ord-ora-campo { width: auto; max-width: 130px; min-height: 32px; padding: .25rem .4rem; font-size: .9rem; }

/* Comande: riepilogo dei conti aperti e blocco di ogni invio in cucina. */
.comande-riepilogo { display: grid; gap: .3rem; }
.comande-riepilogo .badge { font-size: .78rem; }
.comande-nota { margin: .2rem 0 0; }
.cmd-blocco { display: grid; gap: .3rem; margin-top: .5rem; padding-top: .5rem; border-top: 1px solid #00000014; }
.cmd-testa { gap: .4rem .5rem; align-items: center; }
.cmd-stato { margin-left: auto; }
/* Coperto nella scheda Menu: due prezzi affiancati e l'interruttore. */
.coperto-campo { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted); }
.coperto-campo .inp { width: 86px; }
/* Stato comanda: ambra se ancora da inviare, blu quando è in cucina. */
.cmd-stato .badge.cmd-attesa { background: #FFF4D6; color: #8A4B00; border-color: #F0D48A; }
.cmd-stato .badge.cmd-inviata { background: #E3ECFB; color: #1D4ED8; border-color: #BFD4F7; }
/* Stampa non riuscita: badge rosso, errore leggibile e conto segnalato. */
.badge.err { background: #FDE7E6; color: #B3261E; border-color: #F2C4C0; }
.cmd-errore { color: #B3261E; font-size: .78rem; }
.panel.stampa-errore { border-color: #B3261E; background: #FDF3F2; }
.stampa-verifica { display: grid; gap: .4rem; margin-top: .5rem; }
.stampa-elenco { display: grid; gap: .3rem; }
.stampa-riga { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .85rem; }
.stampa-avviso {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  margin-top: .5rem; padding: .4rem .55rem; border-radius: 8px;
  background: #FDE7E6; color: #B3261E; font-size: .82rem; font-weight: 600;
}
.cmd-stato .dd { width: auto; }
.cmd-stato .dd-btn { height: 30px; padding: 0 .5rem; font-size: .78rem; border-radius: 999px; }
.cmd-azioni { justify-content: flex-end; margin-top: .25rem; }
/* Righe del conto: comande, coperto e totale del tavolo. */
.cmd-righe-conto { display: grid; gap: .15rem; margin-top: .45rem; padding-top: .4rem; border-top: 1px solid #00000014; }
.cmd-riga-conto { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; font-size: .86rem; }
.cmd-riga-conto strong { font-variant-numeric: tabular-nums; }
.cmd-coperto { color: var(--muted); font-size: .8rem; }
.cmd-totale { padding-top: .3rem; border-top: 1px dashed #00000022; font-weight: 700; }
.cmd-riepilogo { display: grid; gap: .2rem; margin: .3rem 0 .6rem; }
.comande-bottoni { margin-top: .45rem; gap: .4rem; }
/* Storico comande: elenco delle giornate e dettaglio dei conti chiusi. */
.storico-lista { display: grid; gap: .4rem; margin-top: .4rem; }
/* Su telefono: data e importo sulla prima riga, i numeri sotto, orari e allerta in fondo.
   Su desktop le stesse celle diventano colonne allineate (media query più sotto). */
.storico-riga { display: grid; gap: .12rem .6rem; width: 100%; text-align: left;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "giorno importo" "dati dati" "orari stampa";
  align-items: center;
  background: var(--sand); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .65rem;
  font: inherit; color: inherit; cursor: pointer; }
.storico-riga > * { min-width: 0; }
.storico-riga:hover { border-color: var(--accent); }
.storico-riga.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.storico-giorno { grid-area: giorno; font-weight: 700; }
.storico-riga-dati { grid-area: dati; font-size: .74rem; color: var(--muted); line-height: 1.25; }
.storico-riga-orari { grid-area: orari; font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.storico-riga-stampa { grid-area: stampa; justify-self: end; }
.storico-riga-stampa:empty { display: none; }
.storico-importo { grid-area: importo; justify-self: end; font-variant-numeric: tabular-nums; }
.storico-filtro { margin-top: .5rem; }
.storico-dettaglio { margin-top: .7rem; }
.storico-dettaglio-testa { flex-wrap: wrap; gap: .4rem; margin-bottom: .35rem; }
.storico-dettaglio-testa strong { margin-right: auto; }
.storico-conto { margin-top: .5rem; padding: .1rem .6rem; }
.storico-conto > summary { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .5rem 0; cursor: pointer; }
.storico-conto > summary .storico-importo { margin-left: auto; }
.storico-righe { display: grid; gap: .15rem; padding: .1rem 0 .4rem; }
.storico-righe > div { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.storico-righe .storico-tot { border-top: 1px dashed #00000022; margin-top: .2rem; padding-top: .25rem; font-weight: 700; }
.storico-comanda { border-top: 1px solid var(--line); padding-top: .45rem; margin-top: .45rem; }
.storico-comanda-testa { flex-wrap: wrap; gap: .4rem; }
.cmd-storico-conto { display: grid; gap: .2rem; margin-top: .5rem; }
/* Tessera della Sala con conto aperto: bordo tratteggiato e totale al posto dei posti. */
.ftile.conto { outline: 2px dashed #b45309; outline-offset: -3px; }
.ftile-conto { font-weight: 800; }

/* Ordini: titolo, stato e contatti su righe che vanno a capo senza schiacciarsi. */
.order-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.order-head .inp { flex: 1 1 160px; }

/* Barra "Salva" che resta in vista in fondo alla pagina. */
.save-bar { position: sticky; bottom: 0; z-index: 30; display: flex; gap: .5rem; align-items: center; padding: .7rem 0 calc(.7rem + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--cream) 35%); }
.save-bar .btn { box-shadow: 0 8px 20px #0002; }

/* Avviso breve in basso, al posto degli alert. */
/* Con un foglio aperto la pagina sotto resta ferma. */
body.sheet-open { overflow: hidden; }
.toast { position: fixed; left: 50%; transform: translateX(-50%) translateY(1rem); bottom: calc(1.25rem + env(safe-area-inset-bottom)); max-width: calc(100% - 2rem); background: var(--dark); color: #fff; padding: .7rem 1.2rem; border-radius: 999px; z-index: 100; box-shadow: 0 8px 24px #0003; opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--danger); }

/* Testi di aiuto lunghi: restano su desktop, su telefono sono solo ingombro. */
.hint { color: var(--muted); font-size: .9rem; }

/* Telefono: schede impilate, tocchi comodi, niente sbordature. */
.table-wrap { overflow-x: auto; }
@media (max-width: 720px) {
  .admin-body { overscroll-behavior-y: contain; -webkit-tap-highlight-color: transparent; }
  .admin { padding: .4rem .55rem 2rem; }
  .appbar { margin: -.4rem -.55rem 0; padding: calc(.5rem + env(safe-area-inset-top)) .55rem .7rem; }
  .apphead { padding: .3rem 0 .3rem; }
  .apphead h1 { font-size: 1.05rem; }
  .apphead .chip { padding: .45rem .65rem; }
  .user-chip { max-width: 5.5rem; }
  /* Le schede scorrono di lato: ci stanno tutte senza andare a capo. */
  .tabs { margin: 0 -.55rem; padding: .1rem .55rem .45rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; box-shadow: 0 1px 6px #00000012; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .chip { flex: none; white-space: nowrap; min-height: 42px; display: inline-flex; align-items: center; scroll-snap-align: start; }

  .panel { padding: .7rem; border-radius: 14px; }
  .panel h3 { font-size: 1.05rem; }
  /* Scheda Menu sul telefono: meno spazio sprecato e bottoni più piccoli. */
  .menu-tab .panel { padding: .5rem .65rem; margin-bottom: .55rem; }
  .menu-tab .panel h3 { font-size: .98rem; margin-bottom: .15rem; }
  .menu-tab .panel h4 { font-size: .88rem; margin: .55rem 0 .2rem; }
  .menu-tab .meta { font-size: .74rem; margin: .2rem 0; }
  .menu-tab .inp { min-height: 36px; padding: .3rem .5rem; }
  .menu-tab .btn { min-height: 36px; padding: .3rem .8rem; font-size: .85rem; border-radius: 11px; }
  .menu-tab .btn.sm { min-height: 30px; padding: 0 .6rem; font-size: .82rem; }
  .menu-tab .tav-ico.pericolo { width: 30px; height: 30px; }
  .menu-tab .check { font-size: .85rem; padding: .15rem 0; }
  .menu-tab .cat-panel { padding: .45rem .65rem; }
  .menu-tab .cat-panel > summary { min-height: 34px; padding: .2rem 0; }
  .menu-tab .cat-panel[open] > summary { margin-bottom: .35rem; padding-bottom: .35rem; }
  .menu-tab .product-edit { padding: .3rem 0; }
  .menu-tab .product-edit summary { min-height: 32px; padding: .2rem 0; font-size: .92rem; }
  .menu-tab .cat-riga { min-height: 34px; }
  .menu-tab .extra-riga { padding: .2rem 0; }
  .menu-tab .extra-nome { font-size: .9rem; }
  .menu-tab .extra-prezzo { font-size: .82rem; }
  .menu-tab .extra-form, .menu-tab .nuova-cat { gap: .3rem; margin-top: .3rem; }
  /* Scheda prodotto compatta: campi ravvicinati, foto piccola accanto ai comandi. */
  .menu-tab .product-form { padding-top: .1rem; }
  .menu-tab .field { margin-bottom: .4rem; }
  .menu-tab .field > span { font-size: .6rem; letter-spacing: .04em; margin-bottom: .1rem; }
  .menu-tab textarea.inp { min-height: 54px; padding: .3rem .45rem; line-height: 1.35; }
  .menu-tab .check { margin: .1rem 0; font-size: .8rem; gap: .4rem; }
  .menu-tab .allergen-grid { grid-template-columns: 1fr 1fr; gap: 0 .4rem; }
  .menu-tab .allergen-grid .check { font-size: .72rem; }
  .menu-tab .allergen-grid .check input { width: 18px; height: 18px; }
  .menu-tab .prezzo-riga { gap: .45rem; }
  .menu-tab .prezzo-riga .check.disponibile { margin-bottom: .45rem; }
  .menu-tab .imgctl { flex-direction: row; align-items: center; gap: .5rem; margin: .2rem 0 .5rem; }
  .menu-tab .imgctl .preview { width: 58px; height: 58px; border-radius: 10px; font-size: .55rem; line-height: 1.1; text-align: center; }
  .menu-tab .imgctl .btn { min-height: 28px; padding: .15rem .55rem; font-size: .78rem; margin-top: .25rem; }
  .menu-tab .imgctl input[type="file"] { min-width: 0; max-width: 100%; font-size: .7rem; }
  .menu-tab .imgctl input[type="file"]::file-selector-button { padding: .2rem .5rem; margin-right: .4rem; font-size: .72rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
  .menu-tab .imgctl strong { font-size: .82rem; }
  .menu-tab .product-form .azioni { margin-top: .45rem; gap: .35rem; }
  .menu-tab .product-form .azioni .btn { min-height: 32px; padding: .25rem .8rem; font-size: .85rem; }
  .inline { gap: .5rem; }
  .inline .inp { flex: 1 1 130px; min-width: 0; }
  .inline .field { flex: 1 1 150px; min-width: 0; }
  .inp, .btn { min-height: 46px; }
  .btn.sm { min-height: 40px; }
  /* WhatsApp ed email restano quadratini col solo simbolo. */
  .admin .btn.wa, .admin .btn.mail { width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; }
  .field { margin-bottom: .65rem; }
  .field > span { font-size: .7rem; }
  /* 16px: sotto questa misura il telefono ingrandisce la pagina a ogni tocco nel campo. */
  .admin input, .admin select, .admin textarea, .admin .inp { font-size: 16px; }
  .admin input[type="checkbox"], .admin input[type="radio"] { width: 22px; height: 22px; flex: none; }
  .check { align-items: center; padding: .35rem 0; font-size: .95rem; }
  .product-edit summary { display: flex; align-items: center; min-height: 44px; padding: .5rem 0; }
  .hint { display: none; }

  /* Ogni riga di tabella diventa una scheda: etichetta a sinistra, valore a destra. */
  .table-wrap { overflow: visible; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .25rem .7rem .45rem; margin-bottom: .7rem; }
  .tbl td { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; flex-wrap: wrap; border: 0; padding: .35rem 0; font-size: .95rem; min-width: 0; }
  .tbl td::before { content: attr(data-label); font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); flex: none; padding-top: .2rem; }
  .tbl td[data-label=""]::before { content: none; }
  .tbl td > * { min-width: 0; }
  /* La scheda mostra prima il cliente; data, ora e persone stanno su una riga sola. */
  .tbl tr { display: flex; flex-wrap: wrap; }
  .tbl td { flex: 1 1 100%; }
  .tbl tr.res-row td[data-label="Cliente"] { order: -5; }
  .tbl td[data-label="Data"], .tbl td[data-label="Ora"], .tbl td[data-label="Persone"] { flex: 0 0 auto; width: auto; order: -2; gap: .35rem; padding-right: .9rem; }
  .tbl td[data-label="Contatti"] { order: -1; }

  /* ---- Scheda prenotazione: nome in evidenza, contatti e pulsanti in ordine ---- */
  .tbl tr.res-row { padding: .45rem .75rem .55rem; }
  .tbl tr.res-row td { justify-content: flex-start; gap: .5rem; padding: .22rem 0; }
  .tbl tr.res-row td::before { min-width: 4.4rem; padding-top: 0; }
  /* L'intestazione della scheda contiene già  data, ora e persone. */
  .tbl tr.res-row td[data-label="Data"],
  .tbl tr.res-row td[data-label="Ora"],
  .tbl tr.res-row td[data-label="Persone"] { display: none; }
  .tbl tr.res-row td.res-cliente { display: block; padding-top: .1rem; }
  .tbl tr.res-row td.res-cliente::before { content: none; }
  .tbl tr.res-row td.res-cliente strong { font-size: 1.05rem; }
  .res-sub { display: block; font-size: .88rem; color: var(--muted); }

  .tbl tr.res-row td.res-contatti { display: block; order: -4; }  .tbl tr.res-row td.res-contatti::before { content: none; }
  .res-recapiti { gap: .15rem; margin-bottom: 0; }
  .res-recapiti a { text-decoration: none; word-break: break-word; }
  .res-tel { font-weight: 600; font-size: 1rem; }
  .res-mail { color: var(--accent); font-size: .92rem; }
  /* WhatsApp ed Email: solo il simbolo, in un cerchietto. */
  .tbl tr.res-row .res-bottoni { display: flex; margin: 0; gap: .25rem; }
  .tbl tr.res-row .res-bottoni .btn {
    flex: 0 0 auto; width: 32px; height: 32px; min-width: 32px; min-height: 32px;
    padding: 0; border-radius: 999px;
  }

  /* Filtri: menu su una riga, sotto la ricerca; il blocco resta appiccicato in cima. */
  .res-filtri { padding: .4rem .55rem .45rem; margin-bottom: .5rem; }
  .res-filtri-riga { flex-direction: column; align-items: stretch; gap: .3rem; }
  .res-filtri .filtri-campi { flex: 1 1 auto; flex-wrap: nowrap; gap: .3rem; }
  .res-filtri .filtri-campi .field { flex: 1 1 0; min-width: 0; }
  .res-filtri .filtri-campi .field:nth-child(2) { flex: 1.2 1 0; }
  .res-filtri .filtri-campi .field:nth-child(3) { flex: 1.32 1 0; }
  .res-filtri .filtri-campi .field > span { font-size: .55rem; line-height: 1; margin-bottom: .1rem; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .res-filtri .filtri-campi .field .inp { font-size: 14px; height: 34px; min-height: 34px; padding: 0 .4rem; border-radius: 10px; }
  .res-cerca { flex: none; gap: .35rem; }
  .res-cerca .inp { font-size: 16px; height: 36px; min-height: 36px; border-radius: 10px; padding: 0 .5rem 0 1.85rem; background-size: 14px; background-position: .5rem center; }
  .res-conteggio { font-size: .68rem; }

  /* Note e contatti vuoti non occupano spazio. */
  .tbl tr.res-row td.res-vuota { display: none; }
  /* Note: etichetta sopra il testo, così il testo parte dallo stesso bordo di
     telefono, email e menu del tavolo (prima era rientrato di 70px). */
  .tbl tr.res-row td[data-label="Note"]:not(.res-vuota) { display: block; }
  .tbl tr.res-row td[data-label="Note"]::before { display: block; margin-bottom: .05rem; }
  /* Tavolo: etichetta, menu, poi una riga con i pulsanti e lo stato. */
  .tbl tr.res-row td[data-label="Tavolo"] { display: block; }
  .tbl tr.res-row td[data-label="Tavolo"]::before { display: block; min-width: 0; margin-bottom: .1rem; }
  .tbl tr.res-row td[data-label="Tavolo"] .stack { width: 100%; gap: 0; }
  .tbl tr.res-row .res-azioni { display: flex; flex-wrap: nowrap; gap: .3rem; align-items: center; margin-top: .35rem; }
  .tbl tr.res-row .res-azioni .btn {
    flex: 0 0 auto; width: auto; height: 34px; min-height: 34px;
    padding: 0 .55rem; font-size: .82rem; align-self: center;
  }
  .tbl tr.res-row .res-azioni .res-stato-mobile { display: flex; flex: 1 1 auto; min-width: 0; }
  .tbl tr.res-row .res-azioni .res-stato-mobile .dd { width: 100%; }
  .tbl tr.res-row .res-azioni .res-stato-mobile .dd-btn {
    height: 34px; min-height: 34px; padding: 0 .45rem; font-size: .82rem;
  }
  .tbl tr.res-row .res-azioni .inp { flex: 1 1 auto; width: 100%; height: 34px; min-height: 34px; }
  /* Lo stato è nella riga delle azioni: la colonna "Stato" non serve più. */
  .tbl tr.res-row td[data-label="Stato"] { display: none; }
  .tbl tr.res-row .res-azioni .dd-btn { font-weight: 700; }
  .tbl td .inp { flex: 1 1 auto; min-width: 0; max-width: 100%; }
  /* I pulsanti di una scheda stanno affiancati, il menu a tendina su tutta la riga. */
  .tbl td .stack { align-items: stretch; width: 100%; flex-direction: row; flex-wrap: wrap; gap: .4rem; }
  .tbl td .stack .inp { flex: 1 1 100%; }
.tbl td .stack .dd { flex: 1 1 100%; min-width: 0; }
  .tbl td .stack .btn { flex: 1 1 45%; width: auto; }
  .tbl tr.focus-row td { background: transparent; }
  .tbl tr.focus-row { border-color: #f9a825; box-shadow: 0 0 0 2px #f9a82555; }

  /* Orari: il riquadro del giorno occupa tutta la riga, i campi vanno a capo. */
  .giorno-testa { gap: .5rem; }
  .giorno-riepilogo { font-size: .7rem; }
  .turno { flex-wrap: wrap; }
  .turno span:first-child { min-width: 44px; }
  .turno .inp { flex: 1 1 78px; max-width: none; width: auto; }
  .mode-switch { gap: .6rem; }
  .mode-switch .check { flex: 1; }

  .allergen-grid { grid-template-columns: 1fr 1fr; gap: .1rem .6rem; }
  .imgctl { flex-direction: column; align-items: stretch; }
  .imgctl .preview { width: 110px; height: 80px; }
  .imgctl .btn { width: 100%; }
  input, select, textarea { max-width: 100%; }
  .imgctl input[type="file"] { width: 100%; min-width: 0; }

  /* Sala: piantina più alta, tessere mai più strette di così. */
  .floor-toolbar { padding: .45rem .5rem; margin-bottom: .45rem; gap: .3rem; }
  .floor-canvas { height: 56vh; min-height: 330px; }
  .legend { margin-bottom: .45rem; gap: .35rem; }
  .ftile { min-height: 42px; min-width: 74px; padding: .22rem .38rem; }
  .ftile strong { font-size: .84rem; }
  .ftile small { font-size: .68rem; }
  .legend .chip { font-size: .78rem; padding: .25rem .6rem; }
  .floor-nota { display: none; }

  .cat-panel { padding: .7rem; }
  .cat-panel > summary { padding: .4rem 0; }
  .order-head .inp { flex: 1 1 100%; }
  .save-bar { padding-top: .5rem; }
}

/* Menu di consultazione (mode=view): pagina unica, categorie che seguono la lettura. */
.screen.vm { max-width: 760px; padding-bottom: 3rem; background: var(--cream); }
.vm-hero { position: relative; display: grid; align-content: end; min-height: 190px; padding: 1.25rem 1.25rem 1.6rem;
  color: #f5efe6; background: radial-gradient(120% 140% at 15% 0%, #4a443d 0%, var(--dark) 60%, #1c1a18 100%); overflow: hidden; }
.vm-hero.has-img { background: linear-gradient(180deg, #0000 30%, #1c1a18f0 100%), var(--hero) center / cover, var(--dark); }
.vm-hero.has-logo:not(.has-img) { background: #000; }
.vm-hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 22px; background: var(--cream); border-radius: 22px 22px 0 0; }
.vm-hero .icon-btn { position: absolute; top: .75rem; right: .75rem; z-index: 2; color: #f5efe6; background: #ffffff1f; backdrop-filter: blur(6px); text-decoration: none; }
.vm-hero .vm-back { right: auto; left: .75rem; font-size: 2rem; line-height: 1; padding-bottom: .15rem; }
.vm-brand { position: relative; z-index: 1; text-align: center; padding-bottom: .9rem; }

/* Impostazioni: sezioni richiudibili (come il Menu), campi in griglia e turni su una riga. */
.imp-form { padding-bottom: 3.5rem; }
.imp-sezione { padding: .55rem .85rem; background: #fff; border: 1px solid #ddd2c0; box-shadow: 0 1px 2px #00000012, 0 6px 18px #00000010; }
.imp-sezione[open] { padding-bottom: .8rem; }
.imp-sezione > summary { gap: .55rem; flex-wrap: wrap; padding: .3rem 0; min-height: 42px; align-items: center; }
.imp-sezione[open] > summary { padding-bottom: .45rem; border-bottom: 1px solid var(--line); margin-bottom: .55rem; }
/* Freccia di apertura: grande e scura, così si vede che la card si apre. */
.imp-sezione > summary::before { content: '▸'; color: var(--ink); font-size: 1.15rem; font-weight: 700; line-height: 1; width: 1.15rem; text-align: center; }
.imp-sezione[open] > summary::before { content: '▾'; }
.imp-riepilogo { margin-left: auto; font-size: .76rem; text-align: right; }
.imp-corpo { display: grid; gap: .5rem; margin-top: .45rem; }
.imp-corpo .field { margin-bottom: 0; }
.imp-corpo h4 { margin: .25rem 0 0; }
.imp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .45rem .7rem; align-items: end; }
.imp-check { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 .9rem; }
.imp-check .check { margin: .22rem 0; font-size: .86rem; }
.imp-corpo .hint, .imp-sezione .meta.hint { font-size: .78rem; line-height: 1.35; margin: 0; }
/* Sezione sempre aperta (Sincronizzazione): stessa veste delle altre, senza freccia. */
.imp-sezione.imp-fissa { padding-bottom: .8rem; }
.imp-testa-fissa { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; min-height: 42px; padding: .3rem 0 .45rem; border-bottom: 1px solid var(--line); margin-bottom: .55rem; }
.imp-testa-fissa strong { font-size: 1rem; }
/* Orari di apertura: un riquadro per giorno, con il riepilogo a destra. Su schermo largo i giorni vanno su più colonne. */
.giorni-orari { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.giorno-card { border: 1px solid var(--line); border-radius: 12px; padding: .5rem .7rem .6rem; background: #fff; }
.giorno-testa { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; margin-bottom: .35rem; }
.giorno-testa strong { font-size: .95rem; }
.giorno-riepilogo { font-size: .74rem; color: var(--muted); text-align: right; }
.imp-azioni { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.imp-azioni .btn { width: auto; }
.imp-fascia { display: flex; flex-wrap: wrap; gap: .25rem; }
/* Versione del progetto in cima alle impostazioni. */
.imp-versione { margin: 0 0 .4rem; font-size: .78rem; text-align: right; }
.imp-fascia .badge { font-size: .72rem; padding: .1rem .35rem .1rem .45rem; display: inline-flex; align-items: center; gap: .1rem; }
/* Fascia con un massimo deciso a mano: bordo scuro, così si vede subito che non è il generale. */
.imp-fascia .badge.pers { box-shadow: inset 0 0 0 1.5px var(--ink); }
.imp-fascia .badge .mini { width: auto; padding: 0 .12rem; min-height: 0; background: none; border: 0; color: inherit; font-size: .78rem; line-height: 1; cursor: pointer; opacity: .65; }
.imp-fascia .badge .mini:hover { opacity: 1; }
/* Riga aperta dalla matita: campo massimo + Salva + ritorno al generale. */
.imp-fascia-edit { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: .3rem; }
.imp-fascia-edit:empty { display: none; }
.imp-fascia-edit .inp { max-width: 76px; min-height: 32px; padding: .28rem .35rem; font-size: .9rem; }
.imp-fascia-edit .btn { width: auto; padding: .25rem .6rem; font-size: .82rem; min-height: 0; }
/* Turni e fasce di ritiro: righe strette, "+ Turno" accanto ai campi. */
.turni { flex-direction: column; align-items: stretch; gap: .22rem; }
.turno { gap: .3rem; white-space: nowrap; }
.turno span:first-child { min-width: 46px; }
.turno .inp { max-width: 76px; min-height: 32px; padding: .28rem .35rem; font-size: .9rem; }
.turni .btn { width: auto; align-self: flex-start; padding: .22rem .6rem; font-size: .82rem; min-height: 0; }
@media (max-width: 720px) {
  .imp-sezione { padding: .5rem .7rem; }
  .imp-riepilogo { width: 100%; margin-left: 0; text-align: left; }
  .imp-check { grid-template-columns: 1fr; }
  .imp-grid { grid-template-columns: 1fr 1fr; }
  .imp-grid .field.wide { grid-column: 1 / -1; }
}
.vm-brand h1 { margin: 0; font: 700 1.9rem/1.1 Georgia, 'Times New Roman', serif; letter-spacing: .08em; text-transform: uppercase; }
.vm-logo { display: block; max-width: min(260px, 70%); max-height: 84px; width: auto; height: auto; margin: 0 auto; }
.vm-brand p { margin: .5rem 0 0; font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; color: #d9c9ae; }
.vm-bar { position: sticky; top: 0; z-index: 20; padding: .55rem 1rem .6rem; background: #faf8f5eb; backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.vm-search.inp { height: 42px; padding-left: 2.4rem; border-radius: 999px; border-color: transparent; background: #fff no-repeat .9rem center / 16px
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b756c' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M16.5 16.5 21 21'/%3E%3C/svg%3E");
  box-shadow: 0 1px 4px #0000001a; -webkit-appearance: none; appearance: none; }
.vm-nav { display: flex; gap: .45rem; margin-top: .55rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.vm-nav::-webkit-scrollbar { display: none; }
.vm-chip { flex: none; padding: .42rem .95rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .82rem; font-weight: 600;
  color: var(--ink); white-space: nowrap; transition: background .18s, color .18s, border-color .18s; }
.vm-chip.on { background: var(--dark); border-color: var(--dark); color: #fff; }
.vm-main { padding: .4rem 1rem 0; }
.vm-sec { scroll-margin-top: 112px; padding-top: 1.35rem; }
.vm-sec-head { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .75rem; }
.vm-sec-head h2 { margin: 0; font: 700 1.55rem/1.15 Georgia, 'Times New Roman', serif; color: var(--ink); }
.vm-sec-head h2::after { content: ''; display: block; width: 38px; height: 3px; margin-top: .4rem; border-radius: 3px; background: var(--accent); }
.vm-sec-head small { color: var(--muted); font-size: .78rem; }
.vm-grid { display: grid; gap: .7rem; }
.vm-item { display: flex; gap: .9rem; align-items: flex-start; padding: .95rem 1rem; background: #fff; border: 1px solid #efe9de; border-radius: 18px;
  box-shadow: 0 1px 2px #2b292608, 0 6px 16px -8px #2b292626; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.vm-item:active { transform: scale(.992); }
.vm-info { flex: 1; min-width: 0; }
.vm-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.vm-head h3 { margin: 0; font-size: 1.02rem; line-height: 1.25; font-weight: 700; }
.vm-price { flex: none; padding: .12rem .6rem; border-radius: 999px; background: #f4ece1; color: var(--accent); font-weight: 800; font-size: .88rem; font-variant-numeric: tabular-nums; }
.vm-plus { flex: none; width: 30px; height: 30px; margin-left: .1rem; padding: 0; border: 0; border-radius: 50%; background: var(--dark); color: #fff; font-size: 1.15rem; line-height: 1; display: grid; place-items: center; box-shadow: 0 3px 10px #00000026; }
.vm-plus:active { transform: scale(.94); }
.vm-desc { margin: .3rem 0 0; color: var(--muted); font-size: .86rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.vm-all { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .5rem; }
.vm-all span { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--sand); color: #6b5d4a; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.vm-img { flex: none; width: 92px; height: 92px; border-radius: 14px; object-fit: cover; background: var(--sand); }
.vm-empty { padding: 3rem 0; }
.vm-foot { margin: 2rem 0 .5rem; padding: 1rem 0 0; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .8rem; }
.vm-foot p { margin: 0 0 .25rem; }
/* Nei fogli aperti dal menu di consultazione i testi seguono la lettura normale, non il maiuscolo. */
[data-mode="view"] .desc, [data-mode="view"] .sheet-body .desc,
[data-mode="pickup"] .desc, [data-mode="delivery"] .desc { text-transform: none; font-size: .95rem; line-height: 1.5; }
[data-mode="view"] .sheet, [data-mode="pickup"] .sheet, [data-mode="delivery"] .sheet { margin: auto; border-radius: 24px; max-height: min(82vh, 640px); box-shadow: 0 24px 64px #0000004d; }
[data-mode="view"] .hero-img, [data-mode="pickup"] .hero-img, [data-mode="delivery"] .hero-img { border-radius: 18px; }
/* Piede del foglio piatto: quantità a sinistra, pulsante compatto a destra. */
.sheet-foot.compact { justify-content: space-between; }
.sheet-foot.compact .btn { flex: 0 1 auto; width: auto; padding: .6rem 1.15rem; border-radius: 999px; font-size: .92rem; white-space: nowrap; }
@media (min-width: 720px) {
  .vm-grid { grid-template-columns: 1fr 1fr; }
  .vm-img { width: 84px; height: 84px; }
}
/* ---------- Scheda Utenti: permessi per gruppi, una scheda per utente ---------- */
.utente-elenco { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); align-items: start; }
.utente-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .7rem .8rem; box-shadow: 0 2px 10px #0000000d; }
.utente-testa { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.utente-nome { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.utente-nome strong { font-size: 1rem; }
.utente-distintivi { display: flex; gap: .25rem; flex-wrap: wrap; justify-content: flex-end; }
.utente-permessi { margin-top: .45rem; }
.perm-chips { display: flex; flex-wrap: wrap; gap: .2rem; }
.perm-chips .badge { font-size: .72rem; padding: .1rem .45rem; }
.utente-meta { margin-top: .35rem; font-size: .74rem; color: var(--muted); }
.utente-modifica { margin-top: .5rem; }
.utente-modifica > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .7rem; border-radius: 999px; background: var(--sand); color: var(--ink);
  font-size: .84rem; font-weight: 700;
}
.utente-modifica > summary::-webkit-details-marker { display: none; }
.utente-modifica > summary::before { content: '▸'; font-size: .8rem; }
.utente-modifica[open] > summary::before { content: '▾'; }
.utente-modulo { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.utente-dati { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.utente-azioni { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.utente-nuovo > summary { cursor: pointer; display: flex; align-items: center; gap: .4rem; }
.utente-nuovo > summary::-webkit-details-marker { display: none; }

/* ---------- Server locali (abbinamento nodi) ---------- */
.server-locali-lista { margin-top: .6rem; display: grid; gap: .4rem; }
.server-locali-riga {
  display: flex; gap: .6rem; align-items: center; flex-wrap: wrap;
  padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.server-locali-riga > div:first-child { min-width: 150px; flex: 1 1 150px; }
.server-locali-riga > .btn { margin-left: auto; }

/* ---------- Coda di sincronizzazione (solo amministratori) ---------- */
.coda-sync { display: flex; flex-direction: column; gap: .55rem; }
.coda-sync-conteggi { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.coda-sync-retention { display: flex; flex-direction: column; gap: .3rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 12px; background: #fffdfa; }
.coda-sync-righe { display: flex; flex-wrap: wrap; gap: .3rem .8rem; }
.coda-sync-nodi { display: grid; gap: .4rem; }
.coda-sync-nodo {
  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.coda-sync-tabella-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.coda-sync-tabella { width: 100%; border-collapse: collapse; font-size: .82rem; }
.coda-sync-tabella th, .coda-sync-tabella td { padding: .4rem .55rem; text-align: left; vertical-align: top; border-bottom: 1px solid #efe8dc; }
.coda-sync-tabella th { font-size: .74rem; text-transform: uppercase; letter-spacing: .02em; color: #6b665d; background: #f7f3ec; white-space: nowrap; }
.coda-sync-tabella tbody tr:last-child td { border-bottom: 0; }
.coda-sync-tabella td:nth-child(3) { max-width: 22rem; overflow-wrap: anywhere; }
.coda-sync-tabella .coda-azioni { display: flex; gap: .3rem; flex-wrap: wrap; white-space: nowrap; }
.coda-sync-archivio > summary { cursor: pointer; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.coda-sync-archivio > summary::-webkit-details-marker { display: none; }

/* Su telefono la tabella diventa un elenco di schede: niente scorrimento orizzontale. */
@media (max-width: 720px) {
  .coda-sync-tabella-wrap { overflow-x: visible; border: 0; background: none; }
  .coda-sync-tabella, .coda-sync-tabella thead, .coda-sync-tabella tbody, .coda-sync-tabella tr, .coda-sync-tabella td { display: block; width: 100%; }
  .coda-sync-tabella thead { display: none; }
  .coda-sync-tabella tbody tr {
    border: 1px solid var(--line); border-radius: 12px; background: #fff;
    padding: .45rem .55rem; margin-bottom: .45rem;
  }
  .coda-sync-tabella td { border: 0; padding: .12rem 0; display: flex; gap: .5rem; justify-content: space-between; }
  .coda-sync-tabella td::before { content: attr(data-etichetta); font-weight: 700; color: #6b665d; flex: 0 0 42%; }
  .coda-sync-tabella td:nth-child(3) { max-width: none; }
  .coda-sync-tabella td.coda-azioni { justify-content: flex-start; padding-top: .35rem; }
  .coda-sync-tabella td.coda-azioni::before { content: none; display: none; }
}


/* Permessi: un gruppo di sezioni con la scelta "Nessuno / Lettura / Modifica". */
.perm-box { display: flex; flex-direction: column; gap: .35rem; margin-top: .2rem; }
.perm-rapidi-tutti { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.perm-gruppo { border: 1px solid var(--line); border-radius: 12px; padding: .45rem .55rem; background: #fffdfa; }
.perm-testata { display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap; }
.perm-testata strong { font-size: .86rem; }
.perm-rapidi { display: flex; gap: .25rem; flex-wrap: wrap; }
.perm-rapidi .btn, .perm-rapidi-tutti .btn { width: auto; padding: .18rem .5rem; font-size: .74rem; min-height: 0; }
.perm-riga { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .18rem 0; border-bottom: 1px dashed #efe8dc; }
.perm-riga:last-child { border-bottom: 0; }
.perm-nome { font-size: .86rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #f7f3ec; flex: 0 0 auto; }
.seg-btn { border: 0; background: none; padding: .22rem .55rem; font: inherit; font-size: .76rem; font-weight: 700; color: #6b665d; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.on { background: var(--dark); color: #fff; }
.seg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

@media (max-width: 720px) {
  .utente-elenco { grid-template-columns: 1fr; }
  .utente-dati { grid-template-columns: 1fr; }
  .utente-card { padding: .6rem .65rem; }
  .utente-distintivi { justify-content: flex-start; }
  .utente-testa { flex-direction: column; align-items: flex-start; gap: .3rem; }
  .perm-riga { flex-wrap: wrap; }
  .seg { width: 100%; }
  .seg-btn { flex: 1 1 0; text-align: center; padding: .32rem .3rem; }
  .perm-nome { font-size: .9rem; }
}


/* Storico: colonne allineate quando c'è spazio (desktop e tablet orizzontale). */
@media (min-width: 721px) {
  .storico-riga {
    grid-template-columns: 9.5rem minmax(0, 1.9fr) 7.5rem 9rem 7rem;
    grid-template-areas: "giorno dati orari stampa importo";
    gap: .3rem .9rem;
    padding: .6rem .85rem;
  }
  .storico-riga-dati, .storico-riga-orari { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .storico-riga-stampa { justify-self: start; }
  .storico-conto { padding: 0 .8rem; }
}

/* Storico: su telefono testi compatti, così i numeri non vanno a capo a ogni parola. */
@media (max-width: 720px) {
  .storico-riepilogo .badge { font-size: .72rem; padding: .16rem .45rem; }
  .storico-riepilogo .chip { font-size: .78rem; }
  .storico-filtro { gap: .3rem; }
  .storico-giorno, .storico-importo { font-size: .95rem; }
  .storico-conto { padding: 0 .55rem; }
  .storico-conto > summary .badge { font-size: .68rem; padding: .12rem .4rem; }
  .storico-righe > div { font-size: .85rem; }
  .storico-dettaglio-testa strong { font-size: .95rem; }
}

/* Statistiche: schede del pannello (mobile e desktop). */
.stat-filtri { display: grid; gap: .35rem; }
.stat-filtri .inline { flex-wrap: wrap; gap: .3rem; }
.stat-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-sezione { display: grid; gap: .45rem; margin-top: 0; }
.stat-testa { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.stat-testa > strong, .stat-sezione > strong { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.stat-cerca { width: 100%; }
.stat-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
/* Riga classifica: nome e numeri sopra, barra a tutta larghezza sotto. */
.stat-riga { display: grid; gap: .22rem .6rem; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nome numeri" "barra barra"; align-items: center; }
.stat-riga + .stat-riga { border-top: 1px solid var(--line); padding-top: .45rem; }
.stat-nome { grid-area: nome; min-width: 0; display: flex; flex-direction: column; }
.stat-nome strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; }
.stat-nome .meta { font-size: .72rem; }
.stat-numeri { grid-area: numeri; display: flex; align-items: baseline; gap: .4rem; justify-self: end; }
.stat-numeri b { font-size: .95rem; font-variant-numeric: tabular-nums; }
.stat-numeri .meta { font-size: .75rem; font-variant-numeric: tabular-nums; }
/* La barra della classifica: fondo tondo e riempimento proporzionale. */
.stat-barra { grid-area: barra; display: flex; height: 7px; border-radius: 999px; overflow: hidden; background: var(--sand); }
.stat-barra i { display: block; height: 100%; background: #1d4ed8; }
.stat-sezione:nth-of-type(2n) .stat-barra i { background: #15803d; }
.stat-due { display: grid; gap: 1rem; margin-top: 1rem; }
.stat-due .panel { margin-bottom: 0; }

@media (max-width: 720px) {
  .stat-filtri .chip { font-size: .78rem; }
  .stat-kpi { gap: .4rem; }
  .stats-kpi-cella > strong { font-size: 1.15rem; }
  .stats-kpi-cella { padding: .5rem .55rem; }
  .stat-nome strong { font-size: .88rem; }
}

/* Desktop: più colonne e numeri in fila, come una tabella di report. */
@media (min-width: 721px) {
  .stat-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-due { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .stat-riga { grid-template-columns: minmax(0, 1fr) 11rem; }
  .stat-nome { flex-direction: row; align-items: baseline; gap: .5rem; }
  .stat-nome .meta { white-space: nowrap; }
}

/* Conti e clienti: numero, nome e importo. Su telefono il dettaglio va sotto il nome,
   così i nomi lunghi non schiacciano né l'importo né i conteggi. */
.stat-classifica-riga { display: grid; align-items: center; gap: .1rem .55rem;
  grid-template-columns: 1.45rem minmax(0, 1fr) auto; grid-template-areas: "pos nome importo"; }
.stat-classifica-riga + .stat-classifica-riga { border-top: 1px solid var(--line); padding-top: .45rem; }
.stat-pos { grid-area: pos; display: inline-flex; align-items: center; justify-content: center;
  width: 1.45rem; height: 1.45rem; border-radius: 999px; background: var(--sand);
  font-size: .72rem; font-weight: 700; color: var(--muted); }
.stat-classifica-riga:nth-child(1) .stat-pos { background: #fde9b8; color: #8a6d00; }
.stat-classifica-riga .stat-nome { grid-area: nome; display: flex; flex-direction: column; min-width: 0; }
.stat-classifica-riga .stat-nome strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-classifica-riga .stat-nome .meta { font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-importo { grid-area: importo; justify-self: end; font-variant-numeric: tabular-nums; font-size: .9rem; white-space: nowrap; }

@media (max-width: 720px) {
  .stat-classifica-riga { grid-template-columns: 1.4rem minmax(0, 1fr) auto; }
  .stat-classifica-riga .stat-nome strong { font-size: .86rem; }
  .stat-importo { font-size: .86rem; }
}

@media (min-width: 721px) {
  .stat-classifica-riga .stat-nome { flex-direction: row; align-items: baseline; gap: .5rem; }
  .stat-classifica-riga .stat-nome .meta { white-space: nowrap; }
}
