/* ── Pasticceria App — design system ──────────────────────────────────
   Palette aziendale Forno Rizzo (dal logo): marrone bronzo #574628 per azioni
   e intestazioni, nero per i testi, beige "grano" (la spiga) per selezioni ed
   evidenze, fondo chiaro come quello del logo. I nomi dei token restano
   "espresso"/"gold" per non toccare i template. */
:root {
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --surface-2: #FAF8F3;
  --ink: #17140F;
  --ink-2: #463E31;
  --muted: #8A8172;
  --line: #E9E4D9;
  --line-2: #DCD4C4;

  --espresso: #574628;
  --espresso-2: #6A5634;
  --gold: #B8975A;
  --gold-2: #D4BC8C;
  --gold-soft: #F3ECDD;
  --gold-ink: #6E5523;

  --ok: #1D8457;      --ok-bg: #E2F4EA;
  --info: #3466C9;    --info-bg: #E8EFFC;
  --warn: #B26A00;    --warn-bg: #FFF2D9;
  --danger: #CF4040;  --danger-bg: #FDEBEB;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(87,70,40,.06);
  --shadow: 0 1px 2px rgba(87,70,40,.05), 0 6px 20px -8px rgba(87,70,40,.14);
  --shadow-lg: 0 18px 50px -18px rgba(87,70,40,.35);
  --ease: cubic-bezier(.2,.8,.2,1);
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
.hidden { display: none !important; }
svg.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ── Topbar (desktop) ───────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246,244,239,.86); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; white-space: nowrap; }
.brand-logo { width: 42px; height: 42px; border-radius: 50%; background: #fff; display: block; box-shadow: 0 0 0 1px var(--line), 0 4px 12px -6px rgba(87,70,40,.5); object-fit: cover; }
.topnav { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.topnav a { display: flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.topnav a svg.ico { width: 17px; height: 17px; }
.topnav a:hover { color: var(--ink); background: var(--surface-2); }
.topnav a.active { background: var(--espresso); color: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.btn-esci { background: none; border: none; color: var(--muted); font: inherit; font-size: .85rem; cursor: pointer; padding: 6px; }
.btn-esci:hover { color: var(--ink); }

/* ── Bottom nav (telefono) ──────────────────────────────── */
.bottomnav { display: none; }

.container { max-width: 1180px; margin: 0 auto; padding: 22px 20px 40px; }
.container.narrow { max-width: 780px; }

/* ── Tipografia / layout ────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.75rem; margin: 0; letter-spacing: -.025em; font-weight: 800; }
.page-head .sub { color: var(--muted); font-size: .92rem; margin-top: 2px; }
.muted { color: var(--muted); font-size: .86rem; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.card h2 { font-size: .74rem; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }

/* ── Bottoni ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: 12px; cursor: pointer; font: inherit; font-size: .92rem; font-weight: 700;
  text-decoration: none; transition: transform .12s var(--ease), background .15s, box-shadow .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--espresso); border-color: var(--espresso); color: #fff; box-shadow: 0 6px 16px -8px rgba(87,70,40,.6); }
.btn-primary:hover { background: var(--espresso-2); border-color: var(--espresso-2); }
.btn-gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); border-color: transparent; color: #2E2412; box-shadow: 0 8px 20px -10px rgba(140,110,60,.8); }
.btn-gold:hover { filter: brightness(1.04); background: linear-gradient(135deg, var(--gold-2), var(--gold)); border-color: transparent; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #17704a; border-color: #17704a; }
.btn-danger { color: var(--danger); border-color: #F2C4C4; background: var(--surface); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(87,70,40,.05); border-color: transparent; }
.btn-link-muted { background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px 0; font: inherit; font-size: .86rem; font-weight: 600; text-decoration: none; }
.btn-link-muted:hover { color: var(--ink); }
.btn-sm { padding: 7px 12px; font-size: .84rem; border-radius: 10px; }
.btn-lg { padding: 14px 22px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn svg.ico { width: 18px; height: 18px; }

/* ── Form ───────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label, .label { display: block; margin-bottom: 6px; font-size: .82rem; color: var(--ink-2); font-weight: 700; }
.form-group input, .form-group select, .form-group textarea, .input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 12px;
  font: inherit; font-size: 16px; background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #B5A79C; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(184,151,90,.22); }
.form-row { display: flex; gap: 12px; }
.form-row > .form-group { flex: 1; min-width: 0; }
.input-icon { position: relative; }
.input-icon svg.ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input, .input-icon input { padding-left: 44px; }

.segmented { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; }
.segmented button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border: none; background: transparent; padding: 10px; border-radius: 10px; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; color: var(--muted); }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ── Badge ──────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.no-dot::before { display: none; }
.badge-ricevuto { background: var(--info-bg); color: var(--info); }
.badge-in_preparazione, .badge-pronto { background: var(--info-bg); color: var(--info); }
.badge-consegnato { background: var(--ok-bg); color: var(--ok); }
.badge-annullato { background: var(--danger-bg); color: var(--danger); }
.badge-saldato { background: var(--ok-bg); color: var(--ok); }
.badge-da-saldare { background: var(--warn-bg); color: var(--warn); }
.badge-consegna { background: var(--gold-soft); color: var(--gold-ink); }

/* Stato unico dell'ordine (statoOrdine() in base.html) */
.stato-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.stato-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.s-blu { background: var(--info-bg); color: var(--info); }
.s-rosso { background: var(--danger-bg); color: var(--danger); }
.s-ambra { background: var(--warn-bg); color: #8A5200; }
.s-teal { background: #DDF2F1; color: #11706B; }
.s-verde { background: var(--ok-bg); color: #156B45; }
.s-grigio { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* ── Tabs / chip ────────────────────────────────────────── */
.tabs-bar { display: inline-flex; gap: 4px; margin-bottom: 12px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs-bar::-webkit-scrollbar { display: none; }
.tab-btn { border: none; background: transparent; padding: 8px 14px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 700; font-size: .88rem; color: var(--muted); white-space: nowrap; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { background: var(--espresso); color: #fff; }
.chip-filtri { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1.5px solid var(--line-2); background: var(--surface); padding: 7px 13px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .84rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: all .15s; }
.chip:hover { border-color: var(--muted); }
.chip.active { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }

/* ── Contatori ──────────────────────────────────────────── */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.stat { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .15s; overflow: hidden; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .ico-wrap { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 12px; }
.stat .v { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.stat .l { font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: 4px; }
.stat.hero { background: linear-gradient(145deg, var(--espresso), #3F3219); border-color: transparent; color: #fff; }
.stat.hero .l { color: rgba(255,255,255,.7); }
.stat.hero .ico-wrap { background: rgba(255,255,255,.12); color: var(--gold-2); }
.stat.alert .v { color: var(--danger); }

/* ── Card ordine ────────────────────────────────────────── */
.ordini-lista { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.ordine-card {
  display: flex; gap: 14px; align-items: stretch; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; cursor: pointer; box-shadow: var(--shadow-sm);
  text-decoration: none; color: inherit; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s;
}
.ordine-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.ordine-quando { flex: 0 0 66px; text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 8px 4px; display: flex; flex-direction: column; justify-content: center; }
.ordine-quando .g { font-size: .66rem; text-transform: uppercase; color: var(--muted); font-weight: 800; letter-spacing: .06em; }
.ordine-quando .o { font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; }
.ordine-quando.oggi { background: var(--gold-soft); border-color: #F5D9A6; }
.ordine-quando.oggi .g { color: var(--gold-ink); }
.ordine-quando.ritardo { background: var(--danger-bg); border-color: #F5C9C9; }
.ordine-quando.ritardo .g { color: var(--danger); }
.ordine-corpo { flex: 1; min-width: 0; }
.ordine-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ordine-cliente { font-weight: 800; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.ordine-totale { font-weight: 800; white-space: nowrap; }
.ordine-prodotti { color: var(--muted); font-size: .85rem; margin: 3px 0 9px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ordine-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.vuoto { text-align: center; padding: 48px 16px; color: var(--muted); background: var(--surface); border: 1.5px dashed var(--line-2); border-radius: var(--radius); }
.vuoto .vuoto-ico { width: 56px; height: 56px; border-radius: 18px; background: var(--gold-soft); color: var(--gold-ink); display: grid; place-items: center; margin: 0 auto 12px; }
.vuoto strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }

/* ── Toast / modali ─────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: calc(100% - 32px); }
.toast { background: var(--espresso); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: .9rem; font-weight: 600; box-shadow: var(--shadow-lg); animation: toastIn .3s var(--ease); }
.toast.err { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }

.modal-overlay { position: fixed; inset: 0; background: rgba(40,32,18,.45); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; animation: fadeIn .2s; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 22px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: modalIn .28s var(--ease); }
.modal h3 { margin: 0 0 14px; font-size: 1.2rem; letter-spacing: -.02em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }

/* ── Agenda ─────────────────────────────────────────────── */
.agenda-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.agenda-mese-label { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; margin-right: auto; }
.cal-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: .72rem; color: var(--muted); margin-bottom: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 6px; }
.cal-day { background: var(--surface-2); border-radius: 12px; padding: 8px; min-height: 84px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; border: 1.5px solid transparent; transition: border-color .15s, background .15s; }
.cal-day:hover { border-color: var(--gold); background: var(--surface); }
.cal-day.altro-mese { opacity: .38; }
.cal-day.oggi { background: var(--gold-soft); border-color: var(--gold); }
.cal-day-num { font-size: .85rem; font-weight: 800; }
.cal-ev-indicatore { align-self: flex-start; background: var(--espresso); color: #fff; border-radius: 999px; padding: 2px 9px; font-size: .72rem; font-weight: 700; }
.popup-riga { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 10px; border-radius: 12px; cursor: pointer; }
.popup-riga:hover { background: var(--surface-2); }
.popup-riga + .popup-riga { border-top: 1px solid var(--line); }

/* ── Tabelle ────────────────────────────────────────────── */
table.tabella { width: 100%; border-collapse: collapse; }
table.tabella th, table.tabella td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: .92rem; }
table.tabella tr:last-child td { border-bottom: none; }
table.tabella th { color: var(--muted); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; }
table.tabella tr.cliccabile { cursor: pointer; transition: background .12s; }
table.tabella tr.cliccabile:hover { background: var(--surface-2); }
.num { text-align: right !important; white-space: nowrap; }
.table-responsive { overflow-x: auto; }
.card.flush { padding: 6px 8px; }

/* ── Login ──────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1200px 600px at 10% -10%, #7A6440 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #3E321C 0%, transparent 55%), var(--espresso); }
.login-card { background: var(--surface); border-radius: 26px; padding: 34px 30px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); animation: modalIn .4s var(--ease); }
.login-card .brand-logo { width: 132px; height: 132px; margin: 0 auto 18px; box-shadow: 0 0 0 1px var(--line), 0 14px 34px -14px rgba(87,70,40,.55); }
.login-card { text-align: center; }
.login-card .form-group { text-align: left; }
.login-card h1 { font-size: 1.6rem; margin: 0 0 4px; letter-spacing: -.03em; }
.login-card .muted { margin-bottom: 22px; }

.avviso-box { background: var(--warn-bg); border: 1px solid #F3D9A8; color: #6B4600; border-radius: 12px; padding: 12px 14px; font-size: .88rem; margin-bottom: 12px; }
.avviso-box a { color: inherit; font-weight: 700; }
.info-box { background: var(--ok-bg); border: 1px solid #BFE6CF; color: #135C3C; border-radius: 12px; padding: 10px 14px; font-size: .88rem; display: flex; gap: 8px; align-items: flex-start; }

/* ── Finestra "Come ha pagato?" (chiediPagamento in base.html) ── */
.paga-rapido { max-width: 420px; text-align: center; }
.paga-rapido h3 { margin-bottom: 10px; }
.pr-importo { font-size: 2.4rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.pr-chiedi { color: var(--muted); font-weight: 700; margin: 4px 0 14px; }
.pr-metodi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pr-metodo { height: 60px; font-size: 1.05rem; border-width: 2px; }
.pr-metodo:hover { border-color: var(--espresso); }
.paga-rapido .pr-ok { width: 100%; margin-top: 4px; }
.paga-rapido .pr-dopo { width: 100%; margin-top: 10px; }
.paga-rapido .pr-annulla { width: 100%; margin-top: 8px; }

/* ── Menu "Altro" (telefono) ────────────────────────────── */
.menu-altro { padding: 10px; }
.menu-altro a { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: 14px; text-decoration: none; color: var(--ink); font-weight: 700; }
.menu-altro a:hover { background: var(--surface-2); }
.menu-altro a svg.ico { width: 22px; height: 22px; color: var(--ink-2); }
.menu-altro small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; }

/* ── Striscia giorni (Giornata, Nuovo ordine) ───────────── */
.giorni { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 18px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.giorni::-webkit-scrollbar { display: none; }
.giorno { position: relative; flex: 0 0 66px; scroll-snap-align: start; border: 1.5px solid var(--line); background: var(--surface); border-radius: 16px; padding: 10px 4px; text-align: center; cursor: pointer; font: inherit; color: var(--ink); transition: all .15s; text-decoration: none; }
.giorno .gs { font-size: .68rem; text-transform: uppercase; font-weight: 800; color: var(--muted); letter-spacing: .05em; }
.giorno .gn { font-size: 1.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.giorno .gm { font-size: .7rem; color: var(--muted); font-weight: 600; }
.giorno:hover { border-color: var(--line-2); }
.giorno.sel { background: var(--espresso); border-color: var(--espresso); color: #fff; }
.giorno.sel .gs, .giorno.sel .gm { color: var(--gold-2); }
.giorno.passato { opacity: .6; }
.giorno .n-ord { display: block; font-size: .62rem; font-weight: 800; color: var(--gold-ink); margin-top: 2px; }
.giorno.sel .n-ord { color: var(--gold-2); }
.giorno .pallino-aperti { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--gold); color: var(--espresso); font-size: .68rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }

/* ── Stampa ─────────────────────────────────────────────── */
/* ── Invito a installare l'app (static/js/installa.js) ── */
.installa-banner { position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 80; max-width: 460px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 40px -16px rgba(40,32,18,.45); transform: translateY(140%); opacity: 0; transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .25s; }
.installa-banner.visibile { transform: none; opacity: 1; }
.installa-banner img { width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 1px var(--line); }
.installa-testo { flex: 1; min-width: 0; font-size: .82rem; line-height: 1.35; color: var(--ink-2); }
.installa-testo strong { display: block; color: var(--ink); font-size: .92rem; margin-bottom: 2px; }
.installa-testo svg.ico { width: 15px; height: 15px; vertical-align: -2px; color: #2F6FD6; }
.installa-banner .installa-si { flex: 0 0 auto; }
.installa-chiudi { flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.installa-chiudi:hover { background: var(--surface-2); }
.installa-chiudi svg.ico { width: 18px; height: 18px; }
@media (max-width: 720px) {
  body:has(.bottomnav) .installa-banner { bottom: calc(92px + env(safe-area-inset-bottom)); }
}

@media print {
  .topbar, .bottomnav, .no-print, .toast-container { display: none !important; }
  body { background: #fff; }
  .container { padding: 0; max-width: none; }
  .card, .ticket { box-shadow: none !important; break-inside: avoid; }
}

/* ── Responsive ─────────────────────────────────────────── */
.topbar-right .btn-gold { white-space: nowrap; }
@media (max-width: 900px) {
  .topbar-right .btn-gold .nome-utente { display: none; }
  .topnav a { padding: 7px 11px; }
}
@media (max-width: 900px) {
  .ordini-lista { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .topnav, .topbar-right .nome-utente, .topbar-right .btn-gold { display: none; }
  .topbar-inner { padding: 10px 16px; }
  .container { padding: 16px 16px 110px; }
  .page-head h1 { font-size: 1.45rem; }
  .stat-row { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat .v { font-size: 1.6rem; }
  .stat .ico-wrap { width: 30px; height: 30px; border-radius: 9px; margin-bottom: 8px; }
  .stat .ico-wrap svg.ico { width: 17px; height: 17px; }
  .cal-day { min-height: 54px; padding: 5px; border-radius: 10px; }
  .cal-grid { gap: 4px; }
  .cal-wrap { padding: 8px; }
  .cal-ev-indicatore { padding: 1px 6px; font-size: .68rem; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { max-width: 100%; border-radius: 24px 24px 0 0; max-height: 92vh; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
  .form-row { flex-direction: column; gap: 0; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .toast-container { bottom: 100px; }

  .bottomnav {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60;
    background: rgba(87,70,40,.95); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-radius: 22px; padding: 6px; box-shadow: var(--shadow-lg); align-items: center; justify-content: space-around;
  }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; color: rgba(255,255,255,.6); text-decoration: none; font-size: .66rem; font-weight: 700; border-radius: 14px; }
  .bottomnav a.active { color: var(--gold-2); }
  .bottomnav a svg.ico { width: 22px; height: 22px; }
  .bottomnav .fab { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 17px; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #2E2412; justify-content: center; margin: -2px 4px 0; box-shadow: 0 8px 20px -6px rgba(140,110,60,.75); }
  .bottomnav .fab svg.ico { width: 26px; height: 26px; stroke-width: 2.4; }
}
