/* Portale spedizioni Globo Express — grafica
   Menu laterale con icone (come i portali di spedizione più diffusi), schede bianche su fondo chiaro,
   un solo colore principale (blu Globo) per le azioni, colori di stato coerenti in tutte le pagine. */
:root {
  --blu: #0b3a8c; --blu-scuro: #072a66; --blu-medio: #2453b3; --blu-chiaro: #eaf0fc; --blu-bordo: #b9cbf0;
  --testo: #172033; --muted: #667085; --bordo: #e3e7ee; --bordo-forte: #cfd6e2;
  --sfondo: #f4f6fa; --card: #fff; --hover: #f7f9fd;
  --rosso: #c62828; --rosso-chiaro: #fdecec; --verde: #1e7b3a; --verde-chiaro: #e7f5ec;
  --giallo: #fdb143; --arancio-scuro: #e8962a; --rosso-logo: #d42125; --notte: #0f1b33; --ambra: #8a5a00; --ambra-chiaro: #fff4dc;
  --raggio: 10px; --raggio-s: 7px;
  --ombra: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --ombra-alta: 0 12px 32px rgba(16, 24, 40, .16);
  --menu: 216px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
       color: var(--testo); background: var(--sfondo); -webkit-font-smoothing: antialiased; }
a { color: var(--blu-medio); }
::selection { background: #cddcfb; }

/* ---------- impaginazione: menu laterale + contenuto */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--menu); flex: none; background: var(--notte); color: #c9d6f2; transition: width .18s; display: flex; flex-direction: column;
           position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 20; }
.sidebar .logo { display: flex; justify-content: center; background: #fff; margin: 14px 14px 10px; padding: 8px 10px; border-radius: 8px; }
.sidebar .logo img { height: 22px; display: block; max-width: 100%; }
.sidebar .nuova { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 14px 14px; padding: 10px 12px;
                  background: var(--giallo); color: #1b1300; font-weight: 700; border-radius: 8px; text-decoration: none; }
.sidebar .nuova:hover { background: #ffc266; }
.sidebar .nuova.on { box-shadow: 0 0 0 2px #fff inset; }
.sidebar nav { display: flex; flex-direction: column; padding: 0 8px; gap: 1px; }
.sidebar .gruppo { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #9aabd0; padding: 14px 10px 6px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: #dbe3f5; text-decoration: none; font-size: 13.5px; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar nav a.on { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--giallo); }
.sidebar nav a .badge { margin-left: auto; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sidebar .piede { margin-top: auto; padding: 10px 8px 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar .riduci { width: 100%; justify-content: flex-start; gap: 10px; background: transparent; border: 0; box-shadow: none; color: #9aabd0;
                   font-size: 12.5px; padding: 8px 10px; min-height: 0; }
.sidebar .riduci:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar .riduci .ico { transition: transform .18s; }
.contenuto { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.barra { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 10px 24px; background: var(--card);
         border-bottom: 1px solid var(--bordo); position: sticky; top: 0; z-index: 15; min-height: 56px; }
.barra .dove { margin-right: auto; color: var(--muted); font-size: 13px; }
main { padding: 20px 24px 48px; width: 100%; max-width: 1560px; margin: 0 auto; }
.senza-menu main { max-width: 480px; padding-top: 8vh; }

/* scelta stampante e utente nella barra in alto */
.utente-box { display: flex; align-items: center; gap: 10px; white-space: nowrap; margin: 0; }
.scelta-stampante { flex-direction: row; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin: 0; }
.scelta-stampante select { font-size: 13px; padding: 5px 8px; height: 32px; max-width: 160px; }
.utente { display: flex; align-items: center; gap: 8px; color: var(--testo); text-decoration: none; font-weight: 600; padding: 4px 8px 4px 4px; border-radius: 20px; }
.utente:hover { background: var(--sfondo); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--blu); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; text-transform: uppercase; }

/* ---------- testi */
h1 { font-size: 22px; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15.5px; margin: 0 0 12px; letter-spacing: -.005em; }
h3 { font-size: 14px; margin: 16px 0 6px; }
.sub, .muted, small { color: var(--muted); font-weight: normal; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.page-head h1 .sub { font-size: 14px; margin-left: 6px; }
.page-head h2 { margin: 0; }
.hint { color: var(--muted); font-size: 12.5px; }
kbd { font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; background: #f1f3f7; border: 1px solid var(--bordo); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; color: var(--muted); }

/* ---------- schede (card) */
.card { background: var(--card); border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--ombra); }
.card > h2:first-child { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 .card { margin-bottom: 0; }
.grid2 + .card { margin-top: 16px; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }
a.card { text-decoration: none; color: inherit; display: block; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card:hover { border-color: var(--blu-bordo); box-shadow: var(--ombra-alta); transform: translateY(-1px); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.cards .card { margin-bottom: 0; }
details.card > summary { cursor: pointer; font-weight: 600; }

/* passi numerati nella nuova spedizione */
#fsped { counter-reset: passo; }
#fsped .card > h2:first-child::before { counter-increment: passo; content: counter(passo); display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--blu-chiaro); color: var(--blu); font-size: 12.5px; font-weight: 700; flex: none; }

/* ---------- moduli */
.row { display: flex; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; align-items: flex-end; }
label { display: flex; flex-direction: column; font-size: 12px; font-weight: 500; color: #475467; gap: 4px; position: relative; }
.w100 { flex: 1 1 100%; } .w50 { flex: 1 1 calc(50% - 12px); } .w33 { flex: 1 1 calc(33% - 12px); } .w25 { flex: 1 1 calc(25% - 12px); }
.w30 { flex: 1 1 28%; } .w20 { flex: 0 1 18%; } .w15 { flex: 0 1 12%; } .w10 { flex: 0 1 9%; min-width: 80px; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--testo); padding: 7px 10px; min-height: 36px; border: 1px solid var(--bordo-forte);
  border-radius: var(--raggio-s); background: #fff; min-width: 0; transition: border-color .12s, box-shadow .12s; }
input::placeholder { color: #98a2b3; }
input:hover, select:hover { border-color: #b3bdcc; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blu-medio); box-shadow: 0 0 0 3px rgba(36, 83, 179, .18); }
input.err, select.err { border-color: var(--rosso); background: #fff7f7; box-shadow: 0 0 0 3px rgba(198, 40, 40, .1); }
input:disabled, select:disabled, input[readonly] { background: #f2f4f7; color: #475467; }
input[type=checkbox], input[type=radio] { min-height: 0; width: 16px; height: 16px; accent-color: var(--blu); margin: 0; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--testo); font-size: 13.5px; font-weight: 400; margin: 6px 16px 6px 0; cursor: pointer; }

/* ---------- pulsanti */
.btn, button { font: inherit; font-size: 13.5px; font-weight: 500; padding: 7px 14px; min-height: 36px; border: 1px solid var(--bordo-forte); background: #fff;
  border-radius: var(--raggio-s); cursor: pointer; text-decoration: none; color: var(--testo); display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: background .12s, border-color .12s, box-shadow .12s; white-space: nowrap; }
.btn:hover, button:hover { border-color: #aab4c4; background: var(--hover); }
.btn:focus-visible, button:focus-visible, a:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(36, 83, 179, .28); }
.primary, .btn.primary, button.primary { background: var(--blu); border-color: var(--blu); color: #fff; font-weight: 600; }
.primary:hover, .btn.primary:hover { background: var(--blu-scuro); border-color: var(--blu-scuro); }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
.danger { color: var(--rosso); }
button.danger:hover, .mini.danger:hover { background: var(--rosso-chiaro); border-color: #f1b4b4; }
.link { border: 0; background: none; box-shadow: none; color: var(--blu-medio); padding: 0 6px; min-height: 0; font-size: 12.5px; }
.link:hover { background: none; text-decoration: underline; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mini { font-size: 12px; font-weight: 500; padding: 3px 9px; min-height: 26px; border: 1px solid var(--bordo-forte); border-radius: 6px; background: #fff;
        text-decoration: none; color: var(--blu-medio); display: inline-flex; align-items: center; box-shadow: none; }
.mini:hover { background: var(--blu-chiaro); border-color: var(--blu-bordo); }

/* ---------- avvisi */
.alert { background: var(--ambra-chiaro); border: 1px solid #f3d38c; border-left: 4px solid var(--giallo); color: #5c3d00;
         padding: 11px 14px; border-radius: var(--raggio-s); margin-bottom: 14px; }
.alert.ok { background: var(--verde-chiaro); border-color: #a9dbb8; border-left-color: var(--verde); color: #14532d; }
.alert.da-stampare { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--blu-chiaro); border-color: var(--blu-bordo); border-left-color: var(--blu); color: var(--testo); }
.alert.da-stampare .btn { margin-left: auto; }
.errori { color: var(--rosso); font-size: 13px; flex-basis: 100%; }
.errori:empty { display: none; }
.note-estero { background: var(--blu-chiaro); border-radius: var(--raggio-s); padding: 8px 12px; font-size: 12.5px; margin: 6px 0; }
b.ok { color: var(--verde); } b.ko, .ko { color: var(--rosso); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--rosso-logo); color: #fff;
         font-size: 11px; font-weight: 700; line-height: 1; }

/* ---------- menu a tendina dei suggerimenti */
.dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--bordo); border-radius: var(--raggio-s);
            box-shadow: var(--ombra-alta); z-index: 30; max-height: 320px; overflow-y: auto; padding: 4px; }
.dropdown .opt { padding: 8px 10px; color: var(--testo); font-size: 13.5px; cursor: pointer; border-radius: 6px; }
.dropdown .opt.on, .dropdown .opt:hover { background: var(--blu-chiaro); }

/* ---------- filtri */
.filtri { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; }
.filtri input[type=text], .filtri input:not([type]) { width: 140px; }
.filtri label { font-size: 11.5px; }

/* ---------- tabelle */
.tab { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--bordo); border-radius: var(--raggio);
       font-size: 13px; box-shadow: var(--ombra); }
.tab th { text-align: left; background: #f8f9fc; color: #475467; padding: 9px 10px; font-weight: 600; font-size: 12px; white-space: nowrap;
          border-bottom: 1px solid var(--bordo); position: sticky; top: 56px; z-index: 5; }
.tab thead th:first-child { border-top-left-radius: var(--raggio); }
.tab thead th:last-child { border-top-right-radius: var(--raggio); }
.tab tbody tr:last-child td:first-child { border-bottom-left-radius: var(--raggio); }
.tab tbody tr:last-child td:last-child { border-bottom-right-radius: var(--raggio); }
.card .tab thead th, dialog .tab thead th { position: static; }
.tab td { padding: 9px 10px; border-top: 1px solid #eef1f5; vertical-align: middle; }
.tab tbody tr:first-child td { border-top: 0; }
.tab .r { text-align: right; font-variant-numeric: tabular-nums; }
.tab tr.click { cursor: pointer; }
.tab tbody tr:hover td { background: var(--hover); }
.tab tr.annullata td { color: #98a2b3; text-decoration: line-through; }
.tab tr.annullata td.azioni, .tab tr.annullata td .stato { text-decoration: none; }
.vuoto { text-align: center; color: var(--muted); padding: 32px !important; }
.azioni { white-space: nowrap; }
.azioni .mini { margin: 1px 0; }
.tab.stretta { font-size: 12px; }
.tab.stretta th { padding: 8px 5px; white-space: normal; font-size: 11.5px; }
.tab.stretta td { padding: 7px 5px; overflow-wrap: break-word; }
.tab.stretta td.r { overflow-wrap: normal; white-space: nowrap; }
.tab.stretta td:first-child { white-space: nowrap; overflow-wrap: normal; }
.tab.stretta .azioni { white-space: normal; width: 112px; }
.tab.stretta .mini { font-size: 11px; padding: 1px 6px; min-height: 22px; }
.tab.stretta .stato { white-space: normal; }
.tab.stretta td.tracking .mini { max-width: 96px; }
.stato { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.stato.creata { background: var(--ambra-chiaro); color: var(--ambra); }
.stato.trasmessa { background: var(--verde-chiaro); color: var(--verde); }
.stato.annullata { background: #f2f4f7; color: #667085; }
.cerca { width: 340px; margin-bottom: 12px; }

/* ---------- nuova spedizione: confronto corrieri e barra in basso */
.comparatore { margin-bottom: 12px; box-shadow: none; }
.comparatore tbody tr { cursor: pointer; }
.comparatore td:first-child { width: 36px; text-align: center; }
.comparatore .nome kbd { margin-right: 6px; }
.comparatore tr.migliore td[data-k=costo], .comparatore tr.migliore td[data-k=note] { color: var(--verde); font-weight: 700; }
.comparatore tr.migliore td:first-child { box-shadow: inset 4px 0 0 var(--verde); }
.comparatore tr:has(input:checked) td { background: var(--blu-chiaro); }
.comparatore tr:has(input:checked) td:first-child { box-shadow: inset 4px 0 0 var(--blu); }
.comparatore tr:has(input:checked) .nome { font-weight: 700; color: var(--blu); }
#servizi { display: flex; flex-wrap: wrap; }
#servizi_box .lbl { font-size: 12px; color: var(--muted); align-self: center; }
#mostra_costi { margin-left: auto; }
form.costi-nascosti .privato { display: none !important; }
.actionbar { position: sticky; bottom: 0; z-index: 12; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); margin: 0 -24px -48px; padding: 12px 24px;
             display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--bordo); box-shadow: 0 -6px 16px rgba(16, 24, 40, .06); }
.actionbar .primary { padding: 11px 26px; font-size: 15px; margin-left: auto; border-radius: 8px; }
.calc { font-size: 13.5px; color: #344054; }
.calc b { color: var(--testo); }

/* ---------- verifica della via sotto l'indirizzo */
.verifica { font-size: 13px; padding: 7px 11px; margin: 2px 0 10px; border-radius: var(--raggio-s); background: #f2f4f7; color: #475467; }
.verifica.v-ok { background: var(--verde-chiaro); color: #14532d; }
.verifica.v-warn { background: var(--ambra-chiaro); color: #6b4500; }
.verifica.v-err { background: var(--rosso-chiaro); color: #8f1d1d; }
.verifica .link { font-size: 13px; }

/* ---------- dashboard */
.dash-num { font-size: 28px; font-weight: 700; color: var(--blu); letter-spacing: -.02em; line-height: 1.1; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.cards > .card, .cards > a.card { color: #475467; font-size: 13px; }
.dash-mesi { width: 100%; height: auto; display: block; }
.dash-mesi .barra { fill: var(--blu-medio); }
.dash-mesi g:hover .barra { fill: var(--blu); }
.dash-mesi text { font-size: 11px; fill: var(--muted); }
.dash-mesi text.val { fill: var(--testo); font-weight: 600; }
.dash-mesi .griglia { stroke: #eceff4; stroke-width: 1; }
.big { font-size: 28px; font-weight: 700; color: var(--blu); letter-spacing: -.02em; }

/* ---------- schede di pagina (listini, ecc.) */
.schede { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.schede a { padding: 6px 14px; border: 1px solid var(--bordo-forte); border-radius: 20px; text-decoration: none; background: #fff; color: #344054; font-size: 13px; }
.schede a:hover { border-color: var(--blu-bordo); background: var(--blu-chiaro); }
.schede a.on { background: var(--blu); color: #fff; border-color: var(--blu); }
.prezzi-gruppo { margin-bottom: 14px; }
.prezzi-gruppo h3 { margin: 8px 0 6px; font-size: 13.5px; }
.fasce { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.regole input { width: 100px; }
.regole th { font-size: 12px; color: var(--muted); text-align: left; font-weight: normal; }
.inline { display: inline; }
form.inline { display: inline-flex; gap: 6px; align-items: center; }
.docs li { margin: 6px 0; }

/* ---------- trasmissione */
.mini-card { display: flex; flex-direction: column; }
.mini-card h2 { margin-bottom: 4px; }
.mini-card.vuota { background: #fafbfd; box-shadow: none; }
.mini-card.vuota .big { color: #98a2b3; }
.mini-card form { display: flex; flex-direction: column; flex: 1; }
.mini-card form > button.primary { margin-top: auto; }
.lista-trasmetti { list-style: none; padding: 0; margin: 8px 0 12px; max-height: 320px; overflow: auto; border: 1px solid var(--bordo); border-radius: var(--raggio-s); }
.lista-trasmetti li { padding: 6px 10px; border-top: 1px solid #eef1f5; font-size: 12.5px; }
.lista-trasmetti li:first-child { border-top: 0; }
.lista-trasmetti li:has(input:checked) { background: var(--blu-chiaro); }
.lista-trasmetti label.check { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 12.5px; }
.lista-trasmetti input { margin-top: 2px; }
.scelta-tutte { display: flex; gap: 6px; margin-top: 6px; }

/* ---------- finestre e messaggi */
dialog { border: 0; border-radius: 14px; padding: 24px 28px; box-shadow: var(--ombra-alta); min-width: 440px; max-width: 94vw; }
dialog::backdrop { background: rgba(10, 20, 40, .45); backdrop-filter: blur(2px); }
dialog h2 { font-size: 18px; }
dialog .ok { color: var(--verde); } dialog .warn { color: #a15c00; }
#toast { position: fixed; bottom: 24px; right: 24px; background: #172033; color: #fff; padding: 12px 18px; border-radius: 10px; opacity: 0;
         transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none; max-width: 440px; box-shadow: var(--ombra-alta); z-index: 50; }
#toast.show { opacity: 1; transform: none; } #toast.err { background: var(--rosso); }
[hidden] { display: none !important; }

/* ---------- tracking */
td.tracking .mini { max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; display: inline-block; }
td.tracking .mini.ok { color: var(--verde); border-color: #a9dbb8; background: var(--verde-chiaro); }
.tracking-dlg { width: min(760px, 94vw); }
.tracking-dlg .trk-stato { font-weight: 600; }
.tracking-dlg .trk-stato.ok { color: var(--verde); }
.tracking-dlg tbody td:first-child { white-space: nowrap; }

/* ---------- accesso */
.card.accesso { max-width: 440px; margin: 0 auto 16px; padding: 28px 30px; }
.senza-menu .card.accesso { box-shadow: var(--ombra-alta); }
.card.accesso h1 { margin-bottom: 18px; }
.card.accesso label { display: flex; margin-bottom: 12px; }
.card.accesso input:not([type=checkbox]) { width: 100%; }
.card.accesso button.primary { width: 100%; min-height: 42px; font-size: 15px; }
.logo-accesso { display: block; margin: 0 auto 22px; height: 34px; }

/* ---------- schermi più piccoli: menu solo icone con etichetta corta */
/* menu ridotto: solo icone con un'etichetta corta (pulsante «Riduci menu», automatico sotto 1400 px) */
html.menu-ridotto { --menu: 84px; }
html.menu-ridotto .sidebar .logo { margin: 12px 8px 8px; padding: 6px; }
html.menu-ridotto .sidebar .logo img { height: 14px; }
html.menu-ridotto .sidebar .nuova { flex-direction: column; gap: 2px; margin: 4px 8px 8px; padding: 8px 4px; font-size: 10.5px; text-align: center; line-height: 1.15; }
html.menu-ridotto .sidebar .gruppo { display: none; }
html.menu-ridotto .sidebar nav { padding: 0 6px; gap: 2px; }
html.menu-ridotto .sidebar nav a { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 10.5px; text-align: center; line-height: 1.15; position: relative; }
html.menu-ridotto .sidebar nav a.on { box-shadow: inset 0 -2px 0 var(--giallo); }
html.menu-ridotto .sidebar nav a .badge { position: absolute; top: 2px; right: 8px; min-width: 17px; height: 17px; font-size: 10px; margin: 0; }
html.menu-ridotto .sidebar .piede { padding: 8px 6px; }
html.menu-ridotto .sidebar .riduci { flex-direction: column; justify-content: center; gap: 3px; font-size: 10.5px; padding: 7px 2px; }
html.menu-ridotto .sidebar .riduci .ico { transform: rotate(180deg); }
.se-ridotto { display: none; }
html.menu-ridotto .se-ridotto { display: inline; }
html.menu-ridotto .se-largo { display: none; }
@media (max-width: 760px) {
  .layout { flex-direction: column; overflow-x: clip; }
  .sidebar { max-width: 100vw; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; }
  .sidebar nav { flex-direction: row; }
  .sidebar .logo, .sidebar .piede { display: none; }
  .barra { padding: 8px 12px; flex-wrap: wrap; }
  .utente-box { flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 0; }
  .scelta-stampante select { max-width: 120px; }
  .utente { padding-right: 4px; }
  main { padding: 14px 12px 40px; }
  .actionbar { margin: 0 -12px -40px; padding: 10px 12px; }
  .w50, .w33, .w25, .w30, .w20, .w15, .w10 { flex: 1 1 100%; }
  dialog { min-width: 0; }
  .tab { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .filtri label { flex: 1 1 calc(50% - 10px); }
  .filtri input { width: 100% !important; }
}

/* ---------- documenti: anteprime grandi */
.docs-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.doc { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--testo); background: var(--card); border: 1px solid var(--bordo);
       border-radius: var(--raggio); padding: 12px; box-shadow: var(--ombra); transition: border-color .15s, box-shadow .15s, transform .15s; }
.doc:hover { border-color: var(--blu-bordo); box-shadow: var(--ombra-alta); transform: translateY(-2px); }
.doc-anteprima { position: relative; aspect-ratio: 3 / 4; border-radius: 6px; background: #f2f4f7; overflow: hidden; display: grid; place-items: center;
                 border: 1px solid #eceff4; }
.doc-anteprima img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.doc-tipo { font-size: 26px; font-weight: 800; letter-spacing: .04em; color: #98a2b3; }
.doc-anteprima img + .doc-tipo { position: absolute; right: 6px; bottom: 6px; font-size: 10.5px; padding: 2px 6px; border-radius: 4px; color: #fff; background: #667085; }
.tipo-pdf .doc-tipo { color: #c62828; } .tipo-pdf img + .doc-tipo { background: #c62828; color: #fff; }
.tipo-doc .doc-tipo, .tipo-docx .doc-tipo { color: #2b579a; } .tipo-doc img + .doc-tipo, .tipo-docx img + .doc-tipo { background: #2b579a; color: #fff; }
.tipo-xls .doc-tipo, .tipo-xlsx .doc-tipo, .tipo-csv .doc-tipo { color: #217346; } .tipo-xls img + .doc-tipo, .tipo-xlsx img + .doc-tipo, .tipo-csv img + .doc-tipo { background: #217346; color: #fff; }
.doc-nome { font-size: 13px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
