/* Cassa – Tessuti e Scampoli: l'aspetto delle schermate di lavoro (stile A
   "Sartoria", scelto da Luciano il 19/11/2026 sui bozzetti).
   Colori dal logo del negozio; caratteri Inter (testo) e Cormorant
   Garamond (titoli e marchio), salvati nel programma: nessun servizio esterno. */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("font/inter-latin-400-normal.da03732a27e1.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("font/inter-latin-500-normal.51205681a1ba.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("font/inter-latin-600-normal.2ede57db1a3a.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("font/inter-latin-700-normal.8ca0a5155296.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-display: swap; src: url("font/cormorant-garamond-latin-500-normal.efeea72c7a42.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-display: swap; src: url("font/cormorant-garamond-latin-600-normal.bf1e09fb81d7.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: italic; font-display: swap; src: url("font/cormorant-garamond-latin-500-italic.9b8a16c9964e.woff2") format("woff2"); }

:root {
  --sfondo: #F6F4EF;
  --carta: #FFFFFF;
  --menu: #1F4546;
  --menu-attivo: #2C5C5D;
  --menu-testo: #D3E3E2;
  --menu-tenue: #A9C9C9;
  --logo: #498C8D;
  --accento: #2F6B6C;
  --accento-scuro: #1F4546;
  --accento-chiaro: #E6F0EF;
  --accento-velo: #F2F7F6;
  --testo: #1D2324;
  --testo-2: #4F5A5B;
  --bordo: #D5DEDD;
  --linea: #EEF2F1;
  --verde: #1E5B3E;
  --verde-chiaro: #EAF4EE;
  --arancio: #8A4B0F;
  --arancio-chiaro: #FDF3E3;
  --rosso: #A12A16;
  --rosso-chiaro: #FDF0EC;
  --viola: #4C4494;
  --viola-chiaro: #ECEBF5;
  --ombra: 0 1px 2px rgba(31, 69, 70, 0.08);
  --ombra-alta: 0 8px 30px rgba(31, 69, 70, 0.18);
  --raggio: 14px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.45; color: var(--testo); background: var(--sfondo); }
a { color: var(--accento); }
a:hover { color: var(--accento-scuro); }
h1, h2, h3 { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.nascosto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.numero, .num { font-variant-numeric: tabular-nums; }
.destra { text-align: right; }
.tenue { color: var(--testo-2); }
:focus-visible { outline: 3px solid #7FB3B3; outline-offset: 2px; }

/* --- struttura: menu a colonna + contenuto --- */
.struttura { display: flex; min-height: 100vh; }
.menu {
  flex: 0 0 248px; background: var(--menu); color: var(--menu-testo);
  display: flex; flex-direction: column; gap: 24px; padding: 24px 16px 18px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.menu-marchio { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: #fff; padding: 4px 0 2px; }
.menu-marchio img { width: 97px; height: 150px; display: block; }
.menu-marchio span { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: 0.32em; padding-left: 0.32em; text-transform: uppercase; }
.menu-voci, .menu-altro { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.menu-altro { margin-top: auto; border-top: 1px solid #355F60; padding-top: 14px; }
.menu a.voce, .menu button.voce {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 9px;
  color: var(--menu-testo); text-decoration: none; font-size: 15px; background: none; border: 0; cursor: pointer; text-align: left;
}
.menu a.voce:hover, .menu button.voce:hover { background: #28504F; color: #fff; }
.menu a.voce[aria-current="page"] { background: var(--menu-attivo); color: #fff; font-weight: 600; }
.menu-altro a.voce, .menu-altro button.voce { font-size: 14px; color: #BFD3D2; min-height: 40px; }
.menu .voce svg { flex: 0 0 20px; }
.menu-utente { display: flex; align-items: center; gap: 10px; padding: 10px 12px 0; }
.menu-utente .iniziale { width: 32px; height: 32px; border-radius: 50%; background: var(--logo); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: 0 0 32px; }
.menu-utente .chi { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.menu-utente .chi strong { font-size: 14px; color: #fff; }
.menu-utente .chi span { font-size: 12px; color: var(--menu-tenue); }
.menu-utente .io { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; border-radius: 8px; padding: 4px; margin: -4px; }
.menu-utente .io:hover .chi strong { text-decoration: underline; }
.menu-utente .io:hover .iniziale { box-shadow: 0 0 0 2px #fff4; }
.menu-utente form { margin-left: auto; }
.menu-utente button { background: none; border: 0; color: var(--menu-tenue); cursor: pointer; padding: 6px; border-radius: 6px; display: flex; }
.menu-utente button:hover { color: #fff; background: #28504F; }

/* menu ridotto: a mano col pulsante; sugli schermi stretti parte ridotto
   (la classe la mette lo script in testa alla pagina, prima di disegnarla) */
html.menu-ridotto .menu { flex-basis: 76px; padding: 18px 10px; align-items: center; }
html.menu-ridotto .menu-marchio img { width: 40px; height: 62px; }
html.menu-ridotto .menu-marchio span,
html.menu-ridotto .menu .voce .etichetta-voce,
html.menu-ridotto .menu-utente .chi,
html.menu-ridotto .menu-utente form { display: none; }
html.menu-ridotto .menu a.voce, html.menu-ridotto .menu button.voce { width: 52px; justify-content: center; padding: 0; }
html.menu-ridotto .menu-utente { padding: 8px 0 0; justify-content: center; }
html.menu-ridotto .giro-menu svg { transform: rotate(180deg); }

.contenuto { flex: 1 1 auto; min-width: 0; padding: 32px 40px 56px; display: flex; flex-direction: column; gap: 24px; }
.contenuto > * { max-width: 1500px; width: 100%; }
@media (max-width: 800px) { .contenuto { padding: 22px 18px 40px; } }

/* --- intestazione della pagina --- */
.intestazione { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px 18px; }
.intestazione .sopra { font-size: 14px; color: var(--testo-2); display: block; margin-bottom: 4px; }
.intestazione h1 { font-family: var(--serif); font-weight: 600; font-size: 40px; line-height: 1.05; letter-spacing: 0.005em; }
.intestazione .azioni { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.briciole { font-size: 13px; color: var(--testo-2); margin-bottom: 6px; }
.briciole a { text-decoration: none; }

/* --- pulsanti --- */
.pulsante, .pulsante-secondario, .pulsante-tenue, .pulsante-pericolo {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 10px; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
}
.pulsante { background: var(--accento); color: #fff; }
.pulsante:hover { background: var(--accento-scuro); color: #fff; }
.pulsante-secondario { background: var(--carta); color: var(--accento-scuro); border-color: #C9D6D5; }
.pulsante-secondario:hover { background: var(--accento-velo); color: var(--accento-scuro); }
.pulsante-tenue { background: var(--accento-chiaro); color: var(--accento-scuro); min-height: 36px; padding: 0 12px; font-size: 13px; }
.pulsante-tenue:hover { background: #D7E7E5; color: var(--accento-scuro); }
.pulsante-pericolo { background: var(--carta); color: var(--rosso); border-color: #EBC3B8; }
.pulsante-pericolo:hover { background: var(--rosso-chiaro); color: var(--rosso); }
.pulsante[disabled], .pulsante-secondario[disabled] { opacity: .5; cursor: not-allowed; }
.pulsante-euro { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; min-width: 44px; min-height: 36px; padding: 0 12px; border-radius: 8px; background: var(--accento-chiaro); color: var(--accento-scuro); font-weight: 700; border: 0; cursor: pointer; font-size: 15px; }
.pulsante-euro:hover { background: #D7E7E5; }
.in-riga { display: inline; margin: 0; }

/* --- schede (riquadri bianchi) --- */
.scheda { background: var(--carta); border-radius: var(--raggio); box-shadow: var(--ombra); padding: 22px 24px; }
.scheda > h2, .scheda-testa h2 { font-size: 18px; font-weight: 600; }
.scheda-testa { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.scheda-testa a { font-size: 14px; font-weight: 600; text-decoration: none; }
.griglia-numeri { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.numero-grande { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
a.numero-grande:hover { box-shadow: 0 2px 10px rgba(31,69,70,0.14); color: inherit; }
.numero-grande .titoletto { font-size: 12.5px; font-weight: 600; color: var(--testo-2); text-transform: uppercase; letter-spacing: 0.06em; }
.numero-grande .valore { font-size: 30px; font-weight: 700; color: var(--accento-scuro); font-variant-numeric: tabular-nums; }
.numero-grande .valore.rosso { color: var(--rosso); }
.numero-grande .nota { font-size: 13px; color: var(--testo-2); }
.numero-grande .nota.link { color: var(--accento); font-weight: 600; }
.due-colonne { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 18px; align-items: start; }

/* --- avvisi e messaggi --- */
.avviso { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; font-size: 14px; }
.avviso svg { flex: 0 0 18px; margin-top: 1px; }
.avviso-errore { background: var(--rosso-chiaro); color: #7C2D12; }
.avviso-attenzione { background: var(--arancio-chiaro); color: #6B3A0B; }
.avviso-ok { background: var(--verde-chiaro); color: var(--verde); }
.avviso-info { background: var(--accento-velo); color: var(--accento-scuro); }
.messaggi { position: fixed; top: 18px; right: 18px; z-index: 50; display: flex; flex-direction: column; gap: 10px; max-width: min(460px, calc(100vw - 36px)); }
.messaggi .avviso { box-shadow: var(--ombra-alta); }
.messaggi .chiudi-messaggio { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; font-size: 18px; line-height: 1; padding: 0 0 0 8px; }

/* --- controlli a segmenti e pillole --- */
.barra-filtri { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.segmenti { display: inline-flex; flex-wrap: wrap; background: var(--carta); border: 1px solid var(--bordo); border-radius: 10px; padding: 4px; gap: 2px; }
.segmenti a, .segmenti button { min-height: 38px; padding: 0 16px; border-radius: 8px; border: 0; background: transparent; color: #3D4849; font-size: 14px; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.segmenti a:hover, .segmenti button:hover { background: var(--accento-velo); color: var(--accento-scuro); }
.segmenti a[aria-current="true"], .segmenti button[aria-pressed="true"] { background: var(--accento-scuro); color: #fff; font-weight: 600; }
.segmenti.piccoli a, .segmenti.piccoli button { min-height: 34px; padding: 0 12px; font-size: 13px; }
.pillole { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pillola { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid #C9D6D5; background: var(--carta); color: #3D4849; font-size: 13px; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.pillola:hover { border-color: var(--accento); color: var(--accento-scuro); }
.pillola[aria-current="true"] { border-color: var(--accento); background: var(--accento-chiaro); color: var(--accento-scuro); font-weight: 600; }
.pillola.tratteggiata { border-style: dashed; color: var(--accento); font-weight: 600; background: transparent; }

/* --- etichette di stato --- */
.etichetta { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.etichetta.verde { background: var(--verde-chiaro); color: var(--verde); }
.etichetta.arancio { background: var(--arancio-chiaro); color: var(--arancio); }
.etichetta.rosso { background: var(--rosso-chiaro); color: var(--rosso); }
.etichetta.grigio { background: #EEF1F1; color: #3D4849; }
.etichetta.viola { background: var(--viola-chiaro); color: var(--viola); }
.etichetta.acqua { background: var(--accento-chiaro); color: var(--accento-scuro); }
.testo-vendita { color: var(--accento); }
.testo-acquisto { color: var(--arancio); }
.testo-nota { color: var(--viola); }

/* --- ricerca --- */
.ricerca { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; background: var(--carta); border: 1px solid var(--bordo); min-width: 260px; }
.ricerca input { border: 0; outline: none; background: transparent; flex: 1; font-size: 14px; min-width: 0; }
.ricerca:focus-within { border-color: var(--accento); box-shadow: 0 0 0 3px #CFE3E2; }

/* --- tabelle --- */
.tabella-box { background: var(--carta); border-radius: var(--raggio); box-shadow: var(--ombra); overflow: hidden; }
.tabella-scorre { overflow-x: auto; }
table.tabella { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabella th { text-align: left; color: var(--testo-2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 13px 10px; white-space: nowrap; background: #FBFCFC; }
.tabella th a { color: inherit; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.tabella th a:hover { color: var(--accento-scuro); }
.tabella td { padding: 11px 10px; border-top: 1px solid var(--linea); vertical-align: middle; }
.tabella th:first-child, .tabella td:first-child { padding-left: 18px; }
.tabella th:last-child, .tabella td:last-child { padding-right: 18px; }
.tabella tbody tr:hover td { background: #FAFCFB; }
.tabella tr.selezionata td { background: var(--accento-velo); }
.tabella .doppia { display: flex; flex-direction: column; gap: 3px; }
.tabella .doppia small { font-size: 12px; color: var(--testo-2); }
.tabella a.forte { font-weight: 600; text-decoration: none; }
.tabella .num { text-align: right; white-space: nowrap; }
.tabella .nowrap { white-space: nowrap; }
.tabella-vuota { padding: 40px 20px; text-align: center; color: var(--testo-2); }
.piede-tabella { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--linea); font-size: 13px; color: var(--testo-2); }
.pagine { display: flex; gap: 4px; align-items: center; }
.pagine a, .pagine span { min-width: 34px; min-height: 34px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; text-decoration: none; }
.pagine a:hover { background: var(--accento-velo); }
.pagine .attuale { background: var(--accento-scuro); color: #fff; font-weight: 600; }

/* barra del pagato */
.pagato { display: flex; flex-direction: column; gap: 5px; min-width: 120px; }
.pagato .barra { height: 6px; border-radius: 999px; background: #E8EDEC; overflow: hidden; }
.pagato .barra span { display: block; height: 100%; border-radius: 999px; }
.pagato .barra span.pieno { background: #2F8F6B; }
.pagato .barra span.parziale { background: #D08A2E; }
.pagato .barra span.oltre { background: #C26A1B; }
.pagato small { font-size: 12px; font-weight: 600; }
.colore-verde { color: var(--verde); } .colore-arancio { color: var(--arancio); } .colore-rosso { color: var(--rosso); } .colore-grigio { color: var(--testo-2); }

/* --- liste nelle schede della Home --- */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--linea); }
.lista li:first-child { border-top: 0; }
.lista .chi { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lista .chi strong { font-size: 15px; }
.lista .chi span { font-size: 13px; color: var(--testo-2); }
.lista .importo { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lista-vuota { color: var(--testo-2); font-size: 14px; padding: 8px 0; }

/* --- grafico --- */
.grafico { display: flex; gap: 14px; align-items: stretch; }
.grafico .asse { display: flex; flex-direction: column; justify-content: space-between; font-size: 12px; color: var(--testo-2); padding-bottom: 24px; text-align: right; min-width: 64px; }
.grafico .area { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.grafico .barre { height: 230px; display: flex; align-items: flex-end; gap: 3px; border-bottom: 1px solid #D5DEDD; position: relative;
  background: linear-gradient(#EEF2F1 1px, transparent 1px) 0 0 / 100% 33.333%; }
.grafico .barre div { flex: 1 1 0; min-width: 1px; border-radius: 3px 3px 0 0; background: #9CC3C3; position: relative; }
.grafico .barre div:hover { background: var(--accento); }
.grafico .barre div.ultima { background: var(--accento); }
.grafico .barre div.negativa { background: #E2A08F; }
.grafico .date { display: flex; justify-content: space-between; font-size: 12px; color: var(--testo-2); }
.grafico .vuoto { color: var(--testo-2); padding: 30px 0; }

/* --- pannello laterale (pagamenti, dettaglio chiusura, ritiri, rettifiche) --- */
.pannello-fondo { position: fixed; inset: 0; background: rgba(17, 30, 31, 0.32); z-index: 40; display: none; }
.pannello {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(600px, 100vw); /* una sola larghezza per tutti i pannelli */ background: var(--carta); z-index: 41;
  box-shadow: var(--ombra-alta); display: none; flex-direction: column; overflow-y: auto;
}
body.pannello-aperto .pannello, body.pannello-aperto .pannello-fondo { display: flex; }
body.pannello-aperto .pannello-fondo { display: block; }
.pannello-dentro { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.pannello-testa { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pannello-testa .sopra { font-size: 12px; font-weight: 600; color: var(--testo-2); text-transform: uppercase; letter-spacing: 0.06em; }
.pannello-testa h2 { font-size: 21px; font-weight: 600; margin-top: 3px; }
.chiudi { width: 40px; height: 40px; border-radius: 9px; border: 0; background: #F1F4F3; color: #3D4849; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 0 0 40px; }
.chiudi:hover { background: #E3EAE9; }
.tre-numeri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.tre-numeri div { border-radius: 10px; padding: 10px 6px; display: flex; flex-direction: column; gap: 3px; background: var(--sfondo); }
.tre-numeri span { font-size: 12px; color: var(--testo-2); }
.tre-numeri strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.tre-numeri .verde { background: var(--verde-chiaro); } .tre-numeri .verde span, .tre-numeri .verde strong { color: var(--verde); }
.tre-numeri .rosso { background: var(--rosso-chiaro); } .tre-numeri .rosso span, .tre-numeri .rosso strong { color: var(--rosso); }
.tre-numeri .arancio { background: var(--arancio-chiaro); } .tre-numeri .arancio span, .tre-numeri .arancio strong { color: var(--arancio); }
.voce-pagamento { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #E5ECEB; border-radius: 10px; font-size: 14px; }
.voce-pagamento.in-modifica { border-color: var(--accento); background: var(--accento-velo); }
.voce-pagamento .azioni-voce { display: flex; gap: 10px; align-items: center; }
.voce-pagamento .azioni-voce a, .voce-pagamento .azioni-voce button { font-size: 13px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--accento); }
.voce-pagamento .azioni-voce button.elimina { color: var(--rosso); }
.titoletto { font-size: 13px; font-weight: 600; color: #3D4849; }

/* --- moduli --- */
.modulo { display: flex; flex-direction: column; gap: 16px; }
.riga-campi { display: flex; flex-wrap: wrap; gap: 14px; }
.riga-campi > .campo { flex: 1 1 180px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > label, .campo > .etichetta-campo { font-size: 13px; font-weight: 600; color: #3D4849; }
.campo input[type=text], .campo input[type=number], .campo input[type=date], .campo input[type=password], .campo select, .campo textarea {
  min-height: 44px; border: 1px solid #C9D6D5; border-radius: 9px; padding: 0 12px; background: var(--carta); font-size: 15px; width: 100%;
}
.campo textarea { padding: 10px 12px; min-height: 90px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--accento); box-shadow: 0 0 0 3px #CFE3E2; }
.campo .aiuto { font-size: 12.5px; color: var(--testo-2); }
.campo .errore, .errori-modulo { font-size: 13px; color: var(--rosso); font-weight: 500; }
.campo.con-euro { position: relative; }
.campo .euro-dentro { display: flex; align-items: center; border: 1px solid #C9D6D5; border-radius: 9px; background: var(--carta); }
.campo .euro-dentro input { border: 0; min-height: 42px; text-align: right; font-weight: 600; }
.campo .euro-dentro input:focus { box-shadow: none; }
.campo .euro-dentro:focus-within { border-color: var(--accento); box-shadow: 0 0 0 3px #CFE3E2; }
.campo .euro-dentro span { padding: 0 12px 0 4px; color: var(--testo-2); }
.campo .valore-calcolato { min-height: 44px; display: flex; align-items: center; justify-content: flex-end; padding: 0 12px; border-radius: 9px; background: var(--sfondo); font-weight: 600; font-variant-numeric: tabular-nums; }
.scelta-chip { display: flex; flex-wrap: wrap; gap: 6px; }
.scelta-chip label { cursor: pointer; }
.scelta-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scelta-chip span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid #C9D6D5; background: var(--carta); font-size: 13px; font-weight: 500; color: #3D4849; }
.scelta-chip input:checked + span { background: var(--accento-scuro); border-color: var(--accento-scuro); color: #fff; font-weight: 600; }
.scelta-chip input:focus-visible + span { outline: 3px solid #7FB3B3; outline-offset: 2px; }
.interruttore { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; min-height: 44px; }
.interruttore input { width: 20px; height: 20px; accent-color: var(--accento); }
.piede-modulo { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; border-top: 1px solid var(--linea); padding-top: 18px; }
.piede-modulo .a-destra { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
fieldset.gruppo { border: 0; padding: 0; margin: 0; }
fieldset.gruppo legend { font-size: 13px; font-weight: 600; color: #3D4849; margin-bottom: 8px; padding: 0; }
.sezione-modulo { display: flex; flex-direction: column; gap: 14px; }
.sezione-modulo + .sezione-modulo { border-top: 1px solid var(--linea); padding-top: 18px; }
.sezione-modulo h2 { font-size: 16px; font-weight: 600; }
details.altro summary { cursor: pointer; font-weight: 600; color: var(--accento); font-size: 14px; }
details.altro[open] summary { margin-bottom: 12px; }

/* filtri in piu' */
.filtri-avanzati { background: var(--carta); border-radius: var(--raggio); box-shadow: var(--ombra); padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filtri-avanzati .campo { min-width: 150px; }
.filtri-avanzati[hidden] { display: none; }

/* --- chiusura: modulo + riepilogo --- */
.chiusura-griglia { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .chiusura-griglia { grid-template-columns: 1fr; } }
.riepilogo-cassa { position: sticky; top: 20px; }
/* nel pannello laterale il riepilogo scorre con il resto (fermo, coprirebbe quello che c'e' sotto) */
.pannello .riepilogo-cassa { position: static; }
.riepilogo-cassa table { width: 100%; border-collapse: collapse; font-size: 14px; }
.riepilogo-cassa td { padding: 7px 0; border-top: 1px solid var(--linea); }
.riepilogo-cassa td.num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.riepilogo-cassa tr.totale td { border-top: 2px solid var(--testo); font-size: 16px; font-weight: 700; padding-top: 10px; }
.riepilogo-cassa tr.sotto td { color: var(--testo-2); font-size: 13px; padding-left: 14px; }
.cassa-finale { margin-top: 14px; padding: 16px; border-radius: 12px; background: var(--accento-velo); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.cassa-finale span { font-size: 14px; color: var(--accento-scuro); font-weight: 600; }
.cassa-finale strong { font-size: 26px; color: var(--accento-scuro); font-variant-numeric: tabular-nums; }
.cassa-finale.negativa { background: var(--rosso-chiaro); }
.cassa-finale.negativa span, .cassa-finale.negativa strong { color: var(--rosso); }

/* --- caricamento file --- */
.zona-file { border: 2px dashed #A9BDBC; border-radius: var(--raggio); background: var(--carta); padding: 34px 20px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.zona-file.sopra { border-color: var(--accento); background: var(--accento-velo); }

/* --- pagina di accesso --- */
.accesso { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--menu); }
.accesso .scheda { width: min(400px, 100%); padding: 32px 30px; display: flex; flex-direction: column; gap: 20px; }
.accesso .marchio { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.accesso .marchio img { width: 97px; height: 150px; }
.accesso .marchio span { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: 0.32em; padding-left: 0.32em; text-transform: uppercase; color: var(--accento-scuro); }

/* --- stampa: niente menu --- */
@media print { .menu, .messaggi, .intestazione .azioni { display: none; } .contenuto { padding: 0; } }

/* --- storico delle modifiche --- */
.storico .campi-storico { font-size: 13px; color: var(--testo); line-height: 1.5; }
.storico del { color: var(--testo-2); }

/* --- la fattura leggibile --- */
.documento { display: flex; flex-direction: column; gap: 22px; max-width: 1100px; }
.doc-testa { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 1px solid var(--linea); padding-bottom: 16px; }
.doc-etichetta { font-size: 12.5px; font-weight: 600; color: var(--testo-2); text-transform: uppercase; letter-spacing: .06em; }
.doc-numero { font-size: 22px; font-weight: 600; margin-top: 4px; }
.doc-causale { margin: 8px 0 0; color: var(--testo-2); font-size: 14px; max-width: 640px; }
.doc-totale { text-align: right; background: var(--accento-velo); border-radius: 12px; padding: 12px 18px; display: flex; flex-direction: column; }
.doc-totale span { font-size: 13px; color: var(--accento-scuro); font-weight: 600; }
.doc-totale strong { font-size: 26px; color: var(--accento-scuro); font-variant-numeric: tabular-nums; }
.doc-parti, .doc-piede { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.doc-parti h2, .doc-piede h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--testo-2); margin-bottom: 8px; font-weight: 600; }
.doc-soggetto { margin: 0; font-size: 14.5px; line-height: 1.55; }
.doc-righe td { vertical-align: top; }
@media print {
  body { background: #fff; }
  .scheda { box-shadow: none; padding: 0; }
  .briciole { display: none; }
}

/* --- rettifiche --- */
.pulsante-secondario.piccolo { min-height: 34px; padding: 0 12px; font-size: 13px; }
.nuova-rettifica { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--linea); }

/* --- nuovo pagamento: la scelta della fattura --- */
.cerca-fatture { display: flex; flex-direction: column; gap: 10px; }
.ricerca-larga { min-width: 0; width: 100%; }
.scelta-chip.piccola span { min-height: 34px; padding: 0 12px; font-size: 13px; }
.scegli-fattura li { padding: 0; }
.scegli-fattura a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; margin: 0 -8px; border-radius: 10px; color: inherit; text-decoration: none; }
.scegli-fattura a:hover, .scegli-fattura a:focus-visible { background: var(--accento-velo); }
.scegli-fattura .quanto { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.scegli-fattura .quanto small { font-size: 12.5px; }
.torna-ricerca { font-size: 13.5px; text-decoration: none; }

/* --- scelta del mese a griglia (chiusure mensili) --- */
.scegli-mese { display: flex; flex-direction: column; gap: 12px; }
.anno-frecce { display: flex; align-items: center; justify-content: space-between; max-width: 320px; }
.anno-frecce strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.anno-frecce a, .anno-frecce span { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; font-size: 22px; text-decoration: none; color: var(--accento-scuro); border: 1px solid var(--bordo); background: var(--carta); }
.anno-frecce a:hover { background: var(--accento-velo); }
.anno-frecce span { color: #C9D6D5; }
.griglia-mesi { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.griglia-mesi label { position: relative; cursor: pointer; }
.griglia-mesi input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.griglia-mesi span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 10px; border: 1px solid #C9D6D5; background: var(--carta); font-size: 14px; font-weight: 500; text-transform: capitalize; }
.griglia-mesi label:hover span { border-color: var(--accento); }
.griglia-mesi input:checked + span { background: var(--accento-scuro); border-color: var(--accento-scuro); color: #fff; font-weight: 600; }
.griglia-mesi input:focus-visible + span { box-shadow: 0 0 0 3px #CFE3E2; }
.griglia-mesi .spento { cursor: default; }
.griglia-mesi .spento span { color: #B8C2C1; background: transparent; border-style: dashed; }
@media (max-width: 560px) { .griglia-mesi { grid-template-columns: repeat(4, 1fr); } }
