/* Solution Retail · stile dell'applicazione (usa solo i token di tokens.css) */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--sfondo-pagina); background-attachment: fixed; color: var(--text);
  font-family: var(--font-sans); font-size: var(--fs-md); line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 0;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary-text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.num, td.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.nascosto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ───────── guscio: cornice scura, menu a sinistra, pannello chiaro ───────── */
.app {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); height: calc(100vh - 28px); margin: 14px;
  background: var(--nav-bg); border-radius: var(--r-xl); padding: 10px 10px 10px 0; box-shadow: var(--shadow-cornice);
}
.app > .colonna { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.nav { color: var(--nav-text); display: flex; flex-direction: column; padding: 14px 14px 10px; overflow: auto; }
.nav__logo { display: block; padding: 6px 6px 22px; }
.nav__logo img { width: 100%; max-width: 188px; height: auto; display: block; }
.nav__gruppo { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #7f8d9b; padding: 14px 12px 6px; font-weight: 600; }
.nav a.voce {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); margin-bottom: 2px;
  color: var(--nav-text); text-decoration: none; font-size: 14.5px; font-weight: 500; transition: background var(--dur) var(--ease), color var(--dur);
}
.nav a.voce svg.ic { width: 19px; height: 19px; stroke-width: 1.8; }
.nav a.voce:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.voce[aria-current="page"] { background: var(--nav-active); color: #fff; font-weight: 600; }
.nav a.voce[aria-current="page"] svg.ic { color: var(--evidenzia); }
.nav a.voce .etichetta-pc { margin-left: auto; font-size: 10px; letter-spacing: .06em; padding: 1px 7px; border: 1px solid rgba(255,255,255,.18); border-radius: 99px; color: #9aa8b5; }
.avviso-licenza { margin: 14px 4px 0; padding: 10px 12px; border-radius: var(--r-md); background: rgba(249, 201, 50, .12); color: #f5dc8a; font-size: 12.5px; line-height: 1.4; display: flex; gap: 8px; }
.avviso-licenza svg.ic { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--evidenzia); }
.avviso-licenza b { color: #fff; }
.nav__piede { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); display: grid; gap: 2px; }
.nav__piede button { all: unset; box-sizing: border-box; display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-radius: var(--r-md); cursor: pointer; font-size: 14px; color: var(--nav-text); }
.nav__piede button:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav__piede button svg.ic { width: 18px; height: 18px; stroke-width: 1.8; }
.utente { display: flex; align-items: center; gap: 10px; padding: 14px 8px 4px; margin-top: 8px; border-top: 1px solid rgba(255,255,255,.08); }
.utente .avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-500), var(--brand-700)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.utente b { display: block; color: #fff; font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.utente small { color: #8d9aa7; font-size: 11.5px; }
.stato-rete { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 12.5px; }
.stato-rete i { width: 8px; height: 8px; border-radius: 50%; background: var(--green-solid); box-shadow: 0 0 0 3px rgba(47,154,76,.2); }
.stato-rete.offline i { background: var(--amber-solid); box-shadow: 0 0 0 3px rgba(224,164,0,.2); }

.main { min-width: 0; min-height: 0; flex: 1; overflow: auto; background: var(--surface); border-radius: 16px; }
.pagina { padding: 26px 28px 40px; max-width: 1480px; width: 100%; }
.testata { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: 20px; }
.testata h1 { font-family: var(--font-titoli); font-weight: 800; font-size: var(--fs-2xl); letter-spacing: -.025em; line-height: 1.1; margin: 0; display: flex; align-items: center; gap: 12px; }
.testata p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.conteggio { display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 8px; border-radius: 7px; background: var(--evidenzia); color: var(--on-evidenzia); font-size: 13px; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.azioni { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }

.barra-mobile { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; margin: 0; height: 100vh; border-radius: 0; padding: 0; }
  .nav { position: fixed; inset: 0 auto 0 0; width: 268px; z-index: 50; transform: translateX(-100%); transition: transform 240ms var(--ease); background: var(--nav-bg); }
  .app.menu-aperto .nav { transform: none; box-shadow: var(--shadow-2); }
  .barra-mobile { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--nav-bg); color: #fff; }
  .barra-mobile button { background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
  .barra-mobile img { height: 28px; width: auto; }
  .main { border-radius: 0; }
  .pagina { padding: 20px 16px 40px; }
}

/* ───────── controlli ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 80ms;
}
.btn:hover { border-color: var(--text-3); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primario { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn--primario:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--accento { background: var(--accent-500); border-color: var(--accent-500); color: #fff; }
.btn--accento:hover { background: var(--accent-600); border-color: var(--accent-600); }
.btn--contorno { border-color: var(--accent-500); color: var(--accent-700); background: var(--surface-2); }
.btn--contorno:hover { background: var(--accent-soft); border-color: var(--accent-600); }
.btn--contorno[aria-pressed="true"] { background: var(--accent-500); color: #fff; }
.btn--scuro { background: var(--notte-900); border-color: var(--notte-900); color: #fff; }
.btn--scuro:hover { background: var(--notte-700); border-color: var(--notte-700); }
.btn--giallo { background: var(--evidenzia); border-color: var(--evidenzia); color: var(--on-evidenzia); font-weight: 700; }
.btn--giallo:hover { background: var(--giallo-500); border-color: var(--giallo-500); }
.btn--pericolo { color: var(--red-fg); border-color: color-mix(in srgb, var(--red-fg) 40%, transparent); background: var(--surface-2); }
.btn--pericolo:hover { background: var(--red-bg); border-color: var(--red-fg); }
.btn--piatto { background: transparent; border-color: transparent; }
.btn--piatto:hover { background: var(--surface-sunk); border-color: transparent; }
.btn--piccolo { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn--icona { width: 38px; padding: 0; }

.campo { display: grid; gap: 6px; }
.campo > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.campo > span em { font-style: normal; color: var(--accent-text); margin-left: 2px; }
.campo small { color: var(--text-3); font-size: 12px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--surface-2); transition: border-color var(--dur), box-shadow var(--dur);
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.input[aria-invalid="true"] { border-color: var(--red-solid); }
.input--cerca { padding-left: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23787570' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 11px 50%; background-size: 16px; }
.input-euro { position: relative; }
.input-euro::before { content: '€'; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-euro .input { padding-left: 26px; }
.griglia-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.griglia-form .tutta { grid-column: 1 / -1; }
@media (max-width: 640px) { .griglia-form { grid-template-columns: 1fr; } }
.sezione-form { border-top: 1px solid var(--line); padding-top: var(--sp-4); margin-top: var(--sp-5); }
.sezione-form h3 { margin: 0 0 var(--sp-3); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); font-weight: 600; }
.interruttore { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.interruttore input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line-strong); position: relative; cursor: pointer; transition: background var(--dur); margin: 0; }
.interruttore input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--dur) var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.interruttore input:checked { background: var(--primary); }
.interruttore input:checked::after { transform: translateX(16px); }

.segmenti { display: inline-flex; background: var(--surface-sunk); border-radius: var(--r-sm); padding: 3px; gap: 2px; border: 1px solid var(--line); }
.segmenti button { border: 0; background: transparent; padding: 5px 11px; border-radius: 4px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.segmenti button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-1); }

.chip-ean { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2); min-height: 38px; align-items: center; }
.chip-ean:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.chip-ean span { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 12.5px; background: var(--primary-soft); color: var(--primary-text); padding: 2px 4px 2px 8px; border-radius: 4px; }
.chip-ean span button { border: 0; background: none; cursor: pointer; color: inherit; padding: 0 4px; font-size: 14px; line-height: 1; }
.chip-ean input { border: 0; outline: 0; flex: 1; min-width: 140px; background: transparent; font-family: var(--font-mono); font-size: 13px; padding: 4px; }

/* ───────── superfici ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card__testa { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5) 0; }
.card__testa h2 { font-size: 15.5px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.card__testa p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.card__corpo { padding: var(--sp-4) var(--sp-5) var(--sp-5); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 3px 10px; border-radius: 6px; white-space: nowrap; line-height: 1.4; }
.badge--ok { background: var(--green-bg); color: var(--green-fg); }
.badge--attenzione { background: var(--amber-bg); color: var(--amber-fg); }
.badge--errore { background: var(--red-bg); color: var(--red-fg); }
.badge--info { background: var(--blue-bg); color: var(--blue-fg); }
.badge--neutro { background: var(--surface-sunk); color: var(--text-2); }
.badge svg.ic { width: 12px; height: 12px; stroke-width: 2.5; }

/* ───────── tabelle ───────── */
.tabella-box { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table.tabella { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabella th { text-align: left; font-size: 13px; color: var(--text-3); font-weight: 500; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tabella th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.tabella th button:hover { color: var(--text); }
.tabella td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabella tr:last-child td { border-bottom: 0; }
.tabella tbody tr { transition: background var(--dur); }
.tabella tbody tr.cliccabile { cursor: pointer; }
.tabella tbody tr.cliccabile:hover { background: var(--surface-sunk); }
.tabella .num { text-align: right; white-space: nowrap; }
.tabella .descr b { font-weight: 600; display: block; }
.tabella td.mono { font-family: var(--font-sans); font-weight: 500; font-size: 14px; }
.tabella .descr small { color: var(--text-3); font-size: 12px; }

.vuoto { text-align: center; padding: var(--sp-7) var(--sp-4); color: var(--text-2); }
.vuoto svg.ic { width: 36px; height: 36px; stroke-width: 1.5; color: var(--text-3); margin-bottom: 8px; }
.vuoto h3 { margin: 0 0 4px; color: var(--text); font-size: 16px; }
.vuoto p { margin: 0 auto 16px; max-width: 420px; }

.filtri { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.filtro { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 7px 12px 6px; background: var(--surface-2); transition: border-color var(--dur), box-shadow var(--dur); min-width: 0; }
.filtro:focus-within { border-color: var(--accent-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-500) 16%, transparent); }
.filtro > span { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.filtro .input { border: 0; padding: 0; min-height: 26px; box-shadow: none !important; background: transparent; font-size: 14px; }
.filtro select.input { cursor: pointer; }
.filtro--azione { justify-content: center; align-items: flex-start; padding: 0; border: 0; background: none; }
.cerca-testata { width: min(280px, 100%); }
@media (min-width: 1200px) { .testata .azioni { flex-wrap: nowrap; } }

/* ───────── pannello laterale e finestre ───────── */
.velo { position: fixed; inset: 0; background: rgba(12, 18, 20, .38); z-index: 80; animation: appari 160ms var(--ease); }
.pannello {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--surface); z-index: 81;
  display: flex; flex-direction: column; box-shadow: var(--shadow-2); animation: entraDestra 260ms var(--ease);
}
.pannello__testa { padding: var(--sp-5); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: var(--sp-3); align-items: flex-start; }
.pannello__testa h2 { margin: 0; font-family: var(--font-titoli); font-weight: 800; font-size: 24px; letter-spacing: -.02em; line-height: 1.15; }
.pannello__corpo { padding: var(--sp-5); overflow: auto; flex: 1; }
.pannello__piede { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: var(--sp-2); background: var(--surface); }
.finestra {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100% - 32px)); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--surface); border-radius: var(--r-lg); z-index: 91; box-shadow: var(--shadow-2); border: 1px solid var(--line); animation: entraSu 220ms var(--ease);
}
.finestra.larga { width: min(720px, calc(100% - 32px)); }
.finestra__corpo { padding: var(--sp-5); }
.finestra__corpo h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.01em; }
.finestra__corpo p { margin: 0 0 6px; color: var(--text-2); }
.finestra__piede { padding: var(--sp-3) var(--sp-5) var(--sp-5); display: flex; justify-content: flex-end; gap: var(--sp-2); flex-wrap: wrap; }
.finestra .icona-esito { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; }
.finestra .icona-esito svg.ic { width: 24px; height: 24px; }
.icona-esito.ok { background: var(--green-bg); color: var(--green-fg); }
.icona-esito.att { background: var(--amber-bg); color: var(--amber-fg); }
.icona-esito.err { background: var(--red-bg); color: var(--red-fg); }
.icona-esito.info { background: var(--primary-soft); color: var(--primary-text); }
.velo.alto { z-index: 90; }

.avvisi { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 120; }
.avviso { background: var(--notte-900); color: #f3f1ec; padding: 11px 16px; border-radius: var(--r-md); font-size: 14px; box-shadow: var(--shadow-2); display: flex; gap: 10px; align-items: center; animation: entraSu 220ms var(--ease); max-width: 420px; }
.avviso.errore { background: var(--red-solid); color: #fff; }
.avviso svg.ic { width: 16px; height: 16px; }

.attesa { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: gira .8s linear infinite; vertical-align: -3px; }
.scheletro { background: linear-gradient(90deg, var(--surface-sunk), var(--line), var(--surface-sunk)); background-size: 200% 100%; animation: luccica 1.2s infinite; border-radius: var(--r-sm); min-height: 14px; }

@keyframes appari { from { opacity: 0; } }
@keyframes entraDestra { from { transform: translateX(32px); opacity: 0; } }
@keyframes entraSu { from { opacity: 0; translate: 0 10px; } }
@keyframes gira { to { transform: rotate(360deg); } }
@keyframes luccica { to { background-position: -200% 0; } }
.rivela > * { animation: entraSu 520ms var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }

/* ───────── accesso ───────── */
.accesso { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); align-items: center; gap: 40px; padding: 48px 56px; position: relative; overflow: hidden; }
.accesso::before { content: ''; position: absolute; width: 640px; height: 640px; right: -220px; top: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(249,201,50,.28), transparent 65%); pointer-events: none; }
.accesso__marchio { position: relative; }
.accesso__marchio .logo-grande { width: min(360px, 80%); height: auto; display: block; margin-bottom: 36px; }
.accesso__marchio .tratto { width: 56px; height: 5px; border-radius: 3px; background: var(--evidenzia); margin-bottom: 18px; }
.accesso__marchio h1 { font-family: var(--font-titoli); font-weight: 800; font-size: clamp(36px, 4.6vw, 60px); line-height: 1.02; letter-spacing: -.035em; margin: 0 0 16px; color: var(--notte-900); max-width: 640px; }
.accesso__marchio p { max-width: 520px; color: var(--brand-600); margin: 0; font-size: 19px; line-height: 1.45; }
.vantaggi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 40px; max-width: 720px; }
.vantaggi div { display: grid; gap: 12px; font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--notte-900); }
.vantaggi .tessera-ic { width: 60px; height: 60px; border-radius: 16px; }
.vantaggi .tessera-ic svg.ic { width: 28px; height: 28px; stroke-width: 1.8; }
.accesso__modulo { position: relative; background: var(--surface); border-radius: var(--r-xl); padding: 36px 34px; box-shadow: var(--shadow-cornice); border: 1px solid var(--line); }
.accesso__modulo form { display: grid; gap: var(--sp-4); }
.accesso__modulo h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.messaggio-errore { background: var(--red-bg); color: var(--red-fg); padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; }
:root[data-theme="dark"] .accesso__marchio h1, :root[data-theme="dark"] .vantaggi div { color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .accesso__marchio h1, :root:not([data-theme="light"]) .vantaggi div { color: var(--text); } }
@media (max-width: 960px) { .accesso { grid-template-columns: 1fr; padding: 28px 18px; gap: 28px; } .vantaggi { grid-template-columns: repeat(2, 1fr); } }

/* ───────── categorie ───────── */
.albero { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.albero .card { padding: var(--sp-4); }
.albero__testa { display: flex; align-items: center; gap: 10px; }
.albero__testa h3 { margin: 0; font-size: 16px; flex: 1; }
.pallino { width: 12px; height: 12px; border-radius: 4px; flex: none; background: var(--c, var(--brand-400)); }
.albero ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.albero li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm); font-size: 14px; }
.albero li:hover { background: var(--surface-sunk); }
.albero li .conta { margin-left: auto; color: var(--text-3); font-size: 12.5px; }
.tavolozza { display: flex; gap: 6px; flex-wrap: wrap; }
.tavolozza button { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; background: var(--c); cursor: pointer; }
.tavolozza button[aria-pressed="true"] { border-color: var(--text); }

/* ───────── statistiche ───────── */
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4); }
.kpi__box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; position: relative; box-shadow: var(--shadow-1); }
.kpi__box .tessera-ic { position: absolute; top: 14px; right: 14px; }
.tessera-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--tono-blu-bg); color: var(--tono-blu-fg); flex: none; }
.tessera-ic svg.ic { width: 20px; height: 20px; }
.tessera-ic.giallo { background: var(--tono-giallo-bg); color: var(--tono-giallo-fg); }
.tessera-ic.verde { background: var(--tono-verde-bg); color: var(--tono-verde-fg); }
.tessera-ic.ciano { background: var(--tono-ciano-bg); color: var(--tono-ciano-fg); }
.kpi__box > span { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.kpi__box strong { display: block; font-size: 27px; letter-spacing: -.025em; font-weight: 800; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi__box small { font-size: 12.5px; color: var(--text-3); display: flex; gap: 6px; align-items: center; }
.delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.su { color: var(--green-fg); }
.delta.giu { color: var(--red-fg); }
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-3); }
.bento > .s12 { grid-column: span 12; } .bento > .s8 { grid-column: span 8; } .bento > .s7 { grid-column: span 7; }
.bento > .s6 { grid-column: span 6; } .bento > .s5 { grid-column: span 5; } .bento > .s4 { grid-column: span 4; }
@media (max-width: 1100px) { .bento > [class^="s"] { grid-column: span 12; } }
.grafico { position: relative; width: 100%; }
.grafico svg { display: block; width: 100%; height: auto; overflow: visible; }
.grafico text { fill: var(--text-3); font-size: 11px; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.grafico .asse { stroke: var(--chart-grid); stroke-width: 1; }
.grafico .griglia { stroke: var(--chart-grid); stroke-width: 1; stroke-dasharray: 2 4; }
.suggerimento { position: absolute; pointer-events: none; background: var(--notte-900); color: #f3f1ec; font-size: 12.5px; padding: 8px 10px; border-radius: 8px; white-space: nowrap; z-index: 5; transform: translate(-50%, calc(-100% - 10px)); box-shadow: var(--shadow-2); line-height: 1.4; }
.suggerimento b { font-variant-numeric: tabular-nums; }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 10px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.barre-h { display: grid; gap: 10px; }
.barre-h__riga { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13.5px; }
.barre-h__riga .nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre-h__riga .val { font-variant-numeric: tabular-nums; color: var(--text-2); }
.barre-h__traccia { grid-column: 1 / -1; height: 8px; background: var(--surface-sunk); border-radius: 4px; overflow: hidden; }
.barre-h__traccia i { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; transform-origin: left; animation: cresci 700ms var(--ease) both; }
@keyframes cresci { from { transform: scaleX(0); } }
.mappa-calore { display: grid; grid-template-columns: 34px repeat(var(--colonne), minmax(0, 1fr)); gap: 2px; font-size: 11px; color: var(--text-3); }
.mappa-calore .cella { aspect-ratio: 1.6; border-radius: 3px; background: var(--surface-sunk); position: relative; cursor: default; }
.mappa-calore .cella:hover { outline: 2px solid var(--text); outline-offset: 0; z-index: 2; }
.mappa-calore .etic { display: flex; align-items: center; }
.mappa-calore .etic-ora { text-align: center; }
.scala-seq { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); margin-top: 10px; }
.scala-seq i { width: 18px; height: 10px; border-radius: 2px; display: inline-block; }
.barra-quota { display: flex; height: 14px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface); }
.barra-quota i { display: block; height: 100%; }
.lista-semplice { list-style: none; margin: 0; padding: 0; }
.lista-semplice li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.lista-semplice li:last-child { border-bottom: 0; }

/* ───────── cassa ───────── */
.cassa { display: grid; grid-template-columns: 230px minmax(0, 1fr) 390px; height: 100vh; overflow: hidden; background: var(--nav-bg); padding: 10px 10px 10px 0; gap: 10px; }
.cassa__categorie { background: var(--nav-bg); color: var(--nav-text); overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.cassa__categorie h2 { color: #7f8d9b !important; }
.cassa__categorie .btn--piatto { color: var(--nav-text); }
.cassa__categorie .btn--piatto:hover { background: rgba(255,255,255,.06); color: #fff; }
.cassa__categorie h2, .cassa__carrello h2 { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin: 8px 8px 6px; font-weight: 600; }
.cat-btn { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); cursor: pointer; font-weight: 600; font-size: 15px; min-height: 54px; color: var(--nav-text); }
.cat-btn:hover { background: rgba(255,255,255,.05); color: #fff; }
.cat-btn[aria-pressed="true"] { background: var(--nav-active); color: #fff; }
.cat-btn .pallino { width: 10px; height: 28px; border-radius: 4px; }
.cat-btn small { margin-left: auto; font-weight: 600; color: #8d9aa7; font-size: 12px; }
.cat-btn[aria-pressed="true"] small { background: var(--evidenzia); color: var(--on-evidenzia); border-radius: 6px; padding: 1px 7px; }
.cassa__centro { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--bg); border-radius: 16px; }
.cassa__barra { display: flex; gap: var(--sp-2); padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface); align-items: center; }
.cassa__barra .input { min-height: 46px; font-size: 16px; }
.cassa__sotto { display: flex; gap: 6px; padding: var(--sp-3) var(--sp-4) 0; flex-wrap: wrap; }
.cassa__sotto button { border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 99px; padding: 6px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.cassa__sotto button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.cassa__articoli { flex: 1; overflow: auto; padding: var(--sp-4); display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: var(--sp-3); align-content: start; }
.art-btn {
  all: unset; box-sizing: border-box; cursor: pointer; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 14px; min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; position: relative;
  transition: border-color var(--dur), box-shadow var(--dur), transform 80ms; user-select: none;
}
.art-btn::before { content: ''; position: absolute; left: 14px; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--c, var(--brand-400)); }
.art-btn:hover { border-color: var(--line-strong); box-shadow: 0 2px 10px rgba(20, 18, 14, .05); }
.art-btn:active { transform: scale(.97); }
.art-btn b { font-size: 14.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.art-btn .riga { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.art-btn .prezzo { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.art-btn small { font-size: 11.5px; color: var(--text-3); }
.art-btn small.basso { color: var(--amber-fg); font-weight: 600; }
.art-btn.flash { animation: flash 420ms var(--ease); }
@keyframes flash { 30% { border-color: var(--accent-500); box-shadow: 0 0 0 3px var(--accent-soft); } }

.cassa__carrello { background: var(--surface); border-radius: 16px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.carrello__testa { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.carrello__righe { flex: 1; overflow: auto; padding: var(--sp-2) var(--sp-3); }
.riga-carrello { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 8px; border-bottom: 1px solid var(--line); animation: entraSu 200ms var(--ease); }
.riga-carrello b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.riga-carrello .tot { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.riga-carrello .ctrl { display: flex; align-items: center; gap: 6px; }
.riga-carrello .ctrl button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); cursor: pointer; display: grid; place-items: center; }
.riga-carrello .ctrl button:hover { border-color: var(--text-3); }
.riga-carrello .ctrl span { min-width: 28px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.riga-carrello .unit { color: var(--text-3); font-size: 12.5px; align-self: center; text-align: right; }
.carrello__totali { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 14px; }
.carrello__totali div { display: flex; justify-content: space-between; color: var(--text-2); }
.carrello__totali .grande { color: var(--text); font-size: 15px; font-weight: 600; align-items: baseline; margin-top: 4px; }
.carrello__totali .grande strong { font-size: 36px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pagamenti { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); padding: 0 var(--sp-4) var(--sp-4); }
.pag-btn { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; justify-content: center; padding: 12px 14px; min-height: 72px; border-radius: var(--r-md); cursor: pointer; font-weight: 700; font-size: 15px; border: 1px solid var(--line-strong); background: var(--surface-2); transition: background var(--dur), transform 80ms; }
.pag-btn small { font-weight: 500; font-size: 12px; opacity: .75; }
.pag-btn:active { transform: scale(.98); }
.pag-btn:hover { border-color: var(--text-3); }
.pag-btn.contanti { background: var(--primary); color: var(--on-primary); border-color: var(--primary); grid-column: 1 / -1; min-height: 84px; font-size: 18px; flex-direction: row; justify-content: space-between; align-items: center; }
.pag-btn.contanti:hover { background: var(--primary-hover); }
.pag-btn.carta { background: var(--accent-500); color: #fff; border-color: var(--accent-500); }
.pag-btn.carta:hover { background: var(--accent-600); }
.pag-btn.contanti small { background: rgba(255,255,255,.14); padding: 2px 8px; border-radius: 6px; opacity: 1; }
.pag-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.pag-btn svg.ic { width: 22px; height: 22px; }
.cassa__stato { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 var(--sp-4) var(--sp-3); font-size: 12px; }
.tastierino { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.tastierino button { min-height: 52px; font-size: 20px; font-weight: 600; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.tastierino button:active { background: var(--surface-sunk); }
.importi-rapidi { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.display-importo { font-size: 40px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-align: right; padding: 8px 12px; background: var(--surface-sunk); border-radius: var(--r-md); }
.resto { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; font-size: 15px; }
.resto strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.passi { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.passi li { display: flex; gap: 10px; align-items: center; font-size: 14.5px; color: var(--text-3); }
.passi li.attivo { color: var(--text); font-weight: 600; }
.passi li.fatto { color: var(--green-fg); }
.passi li.errore { color: var(--red-fg); }
.passi li i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; flex: none; }
.passi li.attivo i { border-right-color: transparent; animation: gira .9s linear infinite; }
.cassa .torna { position: absolute; }
@media (max-width: 1200px) { .cassa { grid-template-columns: 190px minmax(0, 1fr) 340px; } }

/* ───────── impostazioni ───────── */
.impostazioni { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.impostazioni nav { display: grid; gap: 2px; position: sticky; top: 16px; }
.impostazioni nav a { padding: 8px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--text-2); font-weight: 500; font-size: 14px; }
.impostazioni nav a:hover { background: var(--surface-sunk); color: var(--text); }
.impostazioni section.card { margin-bottom: var(--sp-4); scroll-margin-top: 16px; }
.esito-prova { margin-top: var(--sp-3); font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-sunk); border-radius: var(--r-sm); padding: 10px 12px; white-space: pre-wrap; max-height: 260px; overflow: auto; }
.reparti { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); }
@media (max-width: 900px) { .impostazioni { grid-template-columns: 1fr; } .impostazioni nav { position: static; display: flex; flex-wrap: wrap; } }

.solo-pc { display: grid; place-items: center; min-height: 60vh; text-align: center; }
.solo-pc > div { max-width: 520px; }
.solo-pc h2 { font-family: var(--font-titoli); font-weight: 800; font-size: 30px; letter-spacing: -.02em; margin: 16px 0 8px; }
