/* =========================================================
   XL Gestionale — demo navigabile (XLLAB)
   ========================================================= */
:root {
  --ink: #0b0b0c; --ink-2: #141416; --ink-3: #1d1d20;
  --paper: #f4f1ea; --paper-2: #ebe6db; --white: #fffdf8;
  --gold: #c9a227; --gold-2: #e6c768; --gold-3: #8f7219;
  --text: #141414; --muted: #7a766d; --line: rgba(0,0,0,.09);
  --ok: #2f7d4f; --warn: #b7791f; --ko: #b3412f; --info: #3d5a80;
  --f-d: "Syne", "Arial Black", sans-serif;
  --f-b: "Inter", "Segoe UI", Arial, sans-serif;
  --r: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 15px/1.5 var(--f-b); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-d); font-weight: 800; letter-spacing: -.02em; margin: 0; line-height: 1.1; }

/* Barra demo */
.demo-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 20px; background: var(--gold); color: var(--ink); font-size: 13px; }
.demo-bar-act { display: flex; gap: 16px; align-items: center; }
.demo-bar button { background: none; border: 1px solid rgba(0,0,0,.35); border-radius: 99px; padding: 3px 12px; cursor: pointer; }
.demo-bar button:hover { background: var(--ink); color: var(--gold); border-color: var(--ink); }
.demo-bar a { font-weight: 600; text-decoration: none; }
.demo-bar a:hover { text-decoration: underline; }

/* Struttura */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 37px); }
.side { background: var(--ink); color: #fff; padding: 22px 14px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: calc(100vh - 37px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 8px; font-family: var(--f-d); font-weight: 600; font-size: 17px; letter-spacing: .02em; }
.brand b { font-weight: 800; color: var(--gold); }
.brand svg { width: 30px; height: 30px; color: #fff; }
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: rgba(255,255,255,.72); font-weight: 500; transition: background .2s, color .2s; }
.menu a i { font-style: normal; width: 18px; text-align: center; color: var(--gold); opacity: .8; }
.menu a:hover { background: var(--ink-3); color: #fff; }
.menu a.on { background: var(--gold); color: var(--ink); }
.menu a.on i { color: var(--ink); opacity: 1; }
.side-foot { margin-top: auto; font-size: 12px; color: rgba(255,255,255,.45); padding: 0 8px; }
.side-foot b { color: #fff; }

.main { min-width: 0; padding: 26px clamp(16px, 3vw, 40px) 60px; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.hello { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.top h1 { font-size: clamp(26px, 3vw, 36px); }
.top-act { display: flex; align-items: center; gap: 10px; }
.search { position: relative; }
.search input { width: min(320px, 52vw); padding: 10px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--white); outline: none; }
.search input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.18); }
.search-res { position: absolute; right: 0; top: calc(100% + 6px); width: min(380px, 86vw); background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 18px 40px rgba(0,0,0,.14); padding: 6px; z-index: 30; max-height: 360px; overflow: auto; }
.search-res a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; }
.search-res a:hover { background: var(--paper); }
.search-res small { color: var(--muted); }
.search-res p { margin: 8px 10px; color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--gold); font-family: var(--f-d); font-weight: 800; font-size: 14px; flex: none; }

/* Pulsanti */
.b { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--white); border-radius: 99px; padding: 9px 16px; cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .2s, border-color .2s, color .2s; text-decoration: none; }
.b:hover { border-color: var(--ink); }
.b-gold { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.b-gold:hover { background: var(--ink); border-color: var(--ink); color: var(--gold); }
.b-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.b-dark:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.b-sm { padding: 5px 11px; font-size: 13px; }
.b-ko:hover { border-color: var(--ko); color: var(--ko); }
.link { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(0,0,0,.25); }
.link:hover { text-decoration-color: var(--gold); }

/* Schede */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card h2 { font-size: 17px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card h2 small { font-family: var(--f-b); font-weight: 400; font-size: 13px; color: var(--muted); letter-spacing: 0; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.kpi { position: relative; overflow: hidden; cursor: pointer; transition: transform .25s, box-shadow .25s; text-align: left; font: inherit; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi b { display: block; font-family: var(--f-d); font-size: 34px; line-height: 1.1; margin-top: 6px; }
.kpi em { font-style: normal; font-size: 12px; color: var(--muted); }
.kpi::after { content: ""; position: absolute; right: -18px; top: -18px; width: 64px; height: 64px; border-radius: 50%; background: rgba(201,162,39,.14); }
.kpi.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi.dark span, .kpi.dark em { color: rgba(255,255,255,.6); }
.kpi.dark b { color: var(--gold); }
.cols-2 { grid-template-columns: 1.5fr 1fr; }
.cols-even { grid-template-columns: 1fr 1fr; }

/* Grafico */
.chart { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding-top: 10px; }
.chart div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.chart i { display: block; width: 100%; max-width: 46px; background: var(--paper-2); border-radius: 8px 8px 3px 3px; transition: height .8s cubic-bezier(.16,1,.3,1); position: relative; }
.chart div.cur i { background: var(--gold); }
.chart i b { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; white-space: nowrap; }
.chart small { color: var(--muted); font-size: 12px; }

/* Liste */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .t { min-width: 0; }
.list .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .t small { color: var(--muted); }
.date-chip { flex: none; width: 46px; text-align: center; border-radius: 10px; background: var(--paper); padding: 4px 0; line-height: 1.15; }
.date-chip b { display: block; font-family: var(--f-d); font-size: 18px; }
.date-chip small { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.row-l { display: flex; gap: 12px; align-items: center; min-width: 0; }

/* Etichette di stato */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--paper); }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.t-ok { color: var(--ok); background: rgba(47,125,79,.1); }
.t-warn { color: var(--warn); background: rgba(183,121,31,.12); }
.t-ko { color: var(--ko); background: rgba(179,65,47,.1); }
.t-info { color: var(--info); background: rgba(61,90,128,.1); }
.t-gold { color: var(--gold-3); background: rgba(201,162,39,.16); }
.t-mute { color: var(--muted); }

/* Tabelle */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { border: 1px solid var(--line); background: var(--white); border-radius: 99px; padding: 6px 13px; cursor: pointer; font-size: 13px; }
.filters button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.filters button span { opacity: .55; margin-left: 4px; }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(201,162,39,.06); }
tbody tr[data-open] { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .sub { display: block; color: var(--muted); font-size: 13px; }
.acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
.ini { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: var(--gold); font-family: var(--f-d); font-size: 12px; font-weight: 800; flex: none; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--paper-2); border-radius: var(--r); padding: 12px; min-height: 300px; transition: background .2s, box-shadow .2s; }
.col.drop { background: rgba(201,162,39,.2); box-shadow: inset 0 0 0 2px var(--gold); }
.col h2 { font-size: 14px; display: flex; justify-content: space-between; margin: 2px 4px 12px; }
.col h2 span { font-family: var(--f-b); color: var(--muted); font-weight: 500; }
.pcard { background: var(--white); border-radius: 11px; padding: 13px; margin-bottom: 10px; border: 1px solid var(--line); cursor: grab; transition: transform .2s, box-shadow .2s; }
.pcard:hover { box-shadow: 0 10px 22px rgba(0,0,0,.08); }
.pcard.drag { opacity: .4; }
.pcard b { display: block; font-weight: 600; margin-bottom: 2px; }
.pcard small { color: var(--muted); }
.bar { height: 6px; border-radius: 6px; background: var(--paper-2); margin: 10px 0 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 6px; }
.pcard-f { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pcard-f .mv { display: flex; gap: 4px; }
.pcard-f .mv button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); cursor: pointer; line-height: 1; }
.pcard-f .mv button:hover { background: var(--ink); color: var(--gold); }
.late { color: var(--ko) !important; font-weight: 600; }

/* Calendario */
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-head h2 { font-size: 20px; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 104px; padding: 6px; background: var(--white); min-width: 0; }
.cal > .dow { min-height: 0; background: var(--paper); font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--muted); text-align: center; }
.cal > .out { background: var(--paper); color: var(--muted); }
.cal .d { font-size: 13px; font-weight: 600; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; }
.cal .today .d { background: var(--gold); color: var(--ink); }
.ev { display: block; width: 100%; text-align: left; font-size: 12px; border: 0; border-left: 3px solid var(--gold); background: rgba(201,162,39,.12); padding: 2px 6px; border-radius: 4px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.ev.consegna { border-color: var(--info); background: rgba(61,90,128,.1); }
.ev.fattura { border-color: var(--ko); background: rgba(179,65,47,.08); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--gold); vertical-align: -1px; }
.legend .l-c::before { background: var(--info); }
.legend .l-f::before { background: var(--ko); }

/* Riepilogo importi */
.sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.sum .card span { color: var(--muted); font-size: 13px; }
.sum .card b { display: block; font-family: var(--f-d); font-size: 26px; margin-top: 4px; }

/* Finestra */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(11,11,12,.55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.modal[hidden] { display: none; }
.modal-box { position: relative; background: var(--white); border-radius: 18px; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.3); animation: up .3s cubic-bezier(.16,1,.3,1); }
.modal-box.wide { width: min(820px, 100%); }
.modal-x { position: absolute; right: 14px; top: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--paper); font-size: 20px; cursor: pointer; line-height: 1; }
.modal-x:hover { background: var(--ink); color: var(--gold); }
.modal h2 { font-size: 22px; margin: 0 40px 18px 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { opacity: 0; transform: translateY(16px); } }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); }
.form .full { grid-column: 1 / -1; }
.form input, .form select, .form textarea { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; color: var(--text); outline: none; font-size: 14px; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.18); }
.form-f { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.righe { grid-column: 1 / -1; }
.riga { display: grid; grid-template-columns: 1fr 70px 110px 34px; gap: 8px; margin-bottom: 8px; }
.riga input { min-width: 0; }
.riga button { border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; }
.riga button:hover { color: var(--ko); border-color: var(--ko); }
.tot { grid-column: 1 / -1; text-align: right; font-size: 14px; color: var(--muted); }
.tot b { color: var(--text); font-family: var(--f-d); font-size: 20px; margin-left: 8px; }

/* Scheda dettaglio */
.det { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin-bottom: 18px; }
.det div span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.det-sec { margin-top: 16px; }
.det-sec h3 { font-size: 14px; margin-bottom: 6px; }

/* Documento (preventivo / fattura) */
.doc { border: 1px solid var(--line); border-radius: 12px; padding: 30px; background: #fff; }
.doc-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 18px; border-bottom: 2px solid var(--ink); margin-bottom: 18px; }
.doc-logo { display: flex; align-items: center; gap: 10px; font-family: var(--f-d); font-weight: 800; font-size: 20px; }
.doc-logo svg { width: 40px; height: 40px; color: var(--ink); }
.doc-logo small { display: block; font-family: var(--f-b); font-weight: 400; font-size: 11px; color: var(--muted); letter-spacing: 0; }
.doc-n { text-align: right; font-size: 13px; color: var(--muted); }
.doc-n b { display: block; font-family: var(--f-d); font-size: 18px; color: var(--text); }
.doc table { min-width: 0; margin: 14px 0; }
.doc .tot-doc { margin-left: auto; width: min(260px, 100%); font-size: 14px; }
.doc .tot-doc div { display: flex; justify-content: space-between; padding: 4px 0; }
.doc .tot-doc .g { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px; font-family: var(--f-d); font-weight: 800; font-size: 18px; }
.doc .tot-doc .g b { color: var(--gold-3); }
.doc-note { font-size: 12px; color: var(--muted); margin-top: 18px; }

/* Avviso */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); opacity: 0; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 99px; font-size: 14px; z-index: 60; transition: opacity .3s, transform .3s; pointer-events: none; border: 1px solid rgba(201,162,39,.5); }
.toast.in { opacity: 1; transform: translate(-50%, 0); }

#vista { outline: none; animation: fade .25s; }

/* Telefono e tablet */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cols-2, .cols-even { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; padding: 6px; z-index: 40; flex-direction: row; gap: 0; }
  .brand, .side-foot { display: none; }
  .menu { flex-direction: row; justify-content: space-around; width: 100%; }
  .menu a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 10.5px; flex: 1; text-align: center; }
  .menu a i { font-size: 16px; }
  .main { padding-bottom: 96px; }
  .top-act { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .sum { grid-template-columns: 1fr; }
  .cal > div { min-height: 64px; padding: 3px; }
  .ev { font-size: 0; height: 6px; padding: 0; margin-top: 2px; }
  .form, .det { grid-template-columns: 1fr; }
  .riga { grid-template-columns: 1fr 56px 86px 30px; }
  .doc { padding: 18px; }
  .demo-bar { padding: 8px 14px; font-size: 12px; }
}

/* Stampa: solo il documento */
@media print {
  body * { visibility: hidden; }
  .doc, .doc * { visibility: visible; }
  .doc { position: absolute; left: 0; top: 0; width: 100%; border: 0; }
}

/* Rifiniture */
.card h2 { font-family: var(--f-b); font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.link { font-family: var(--f-b); font-size: 13px; font-weight: 500; }
.col h2, .cal-head h2, .modal h2 { font-family: var(--f-d); }
.cols-2 > .card:first-child { display: flex; flex-direction: column; }
.cols-2 > .card:first-child .chart { flex: 1; min-height: 190px; height: auto; }
.grid > *, .main > * { min-width: 0; }
.card h2 { flex-wrap: wrap; }
html, body { overflow-x: clip; }
@media (max-width: 820px) {
  .kpi b { font-size: 26px; }
  .kpi.dark b { font-size: 22px; }
  .chart { gap: 6px; }
  .chart i b { font-size: 9.5px; }
  .card { padding: 16px; }
}
.chart div { min-width: 0; }
@media (max-width: 1100px) { .cols-2, .cols-even { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi b { overflow-wrap: anywhere; }
.kpi.dark b { font-size: clamp(22px, 2.1vw, 30px); white-space: nowrap; overflow-wrap: normal; margin-top: 12px; }

/* Stampa: documenti lunghi aperti nella finestra non vengono tagliati */
@media print {
  .app, .demo-bar, .toast, .modal-x, .modal .form-f, .modal h2 { display: none !important; }
  .modal { position: static; display: block; background: none; backdrop-filter: none; padding: 0; animation: none; }
  .modal-box { position: static; width: 100% !important; max-height: none; overflow: visible; box-shadow: none; padding: 0; animation: none; }
  .doc { position: static !important; }
  .doc .tbl-wrap { overflow: visible; }
}

/* =========================================================
   Correzioni condivise (tutte le demo) · v8
   ========================================================= */
/* Marchio nel menu: segno + nome su due righe ("XLLAB" piccolo sopra, nome del prodotto sotto) */
.brand { gap: 11px; line-height: 1; }
.brand svg { flex: none; }
.brand span { display: flex; flex-direction: column; gap: 3px; min-width: 0; white-space: nowrap; font-family: var(--f-d); font-weight: 600; font-size: 11px; letter-spacing: .2em; color: rgba(255,255,255,.62); }
.brand span b { display: block; font-size: 19px; font-weight: 800; letter-spacing: .01em; color: var(--gold); }

/* Moduli: colonne che non si allargano oltre la finestra (select con voci lunghe) */
.form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.form label, .form > * { min-width: 0; }
.form input, .form select, .form textarea { min-width: 0; max-width: 100%; }
.form select { width: 100%; text-overflow: ellipsis; }
.det { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.det > div { min-width: 0; overflow-wrap: anywhere; }
.riga { grid-template-columns: minmax(0, 1fr) 70px 110px 34px; }
.modal-box { overflow-x: hidden; }

/* Avviso con azione (es. Annulla dopo un'eliminazione) */
.toast { display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100vw - 32px); }
.toast.con-azione { pointer-events: auto; }
.toast button { flex: none; background: none; border: 0; padding: 2px 0; color: var(--gold-2); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.toast button:hover { color: #fff; }

/* Testi diversi per mouse e touch */
.solo-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .solo-desk { display: none; }
  .solo-touch { display: inline; }
}
.scorri { margin: -4px 0 10px; font-size: 13px; font-weight: 600; color: var(--gold-3); }
.scorri[hidden] { display: none; }
.nota-i { margin: 14px 2px 0; font-size: 13px; color: var(--muted); }

@media (max-width: 820px) {
  /* 16px nei campi: evita lo zoom automatico di iOS */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }
  .form, .det { grid-template-columns: minmax(0, 1fr); }
  .riga { grid-template-columns: minmax(0, 1fr) 56px 92px 30px; }
  .toast { bottom: 84px; border-radius: 16px; }
}

@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .toast { display: none !important; }
}
@media (max-width: 820px) {
  /* Documento (preventivo/fattura) nella finestra: tabella compatta, niente uscite a destra */
  .doc { padding: 14px; }
  .doc th, .doc td { padding: 7px 5px; font-size: 12.5px; letter-spacing: 0; }
  .doc td { overflow-wrap: anywhere; }
  .doc td.num, .doc th.num { white-space: nowrap; }
  .doc-h { flex-wrap: wrap; }
  .doc-n { text-align: left; }
}
