/* Gestionale Imperial Assemblaggi — stile generale */
:root {
  --blu: #1d4ed8;
  --blu-scuro: #1e3a8a;
  --blu-chiaro: #eff6ff;
  --testo: #1f2937;
  --grigio: #6b7280;
  --bordo: #e5e7eb;
  --sfondo: #f3f4f6;
  --bianco: #ffffff;
  --verde: #15803d;
  --verde-chiaro: #dcfce7;
  --rosso: #b91c1c;
  --rosso-chiaro: #fee2e2;
  --giallo: #92400e;
  --giallo-chiaro: #fef3c7;
  --raggio: 10px;
  --menu: 240px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--testo);
  background: var(--sfondo);
}
a { color: var(--blu); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 .5rem; }
.piccolo { font-size: .875rem; }
.grigio { color: var(--grigio); }
.destra { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- struttura ---------- */
.testata {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  background: var(--blu-scuro); color: #fff;
  padding: .6rem 1rem;
}
.testata .marchio { font-weight: 700; color: #fff; white-space: nowrap; }
.testata .marchio span { font-weight: 400; opacity: .8; }
.testata form.cerca { flex: 1; max-width: 420px; margin-left: auto; }
.testata form.cerca input { width: 100%; padding: .45rem .7rem; border-radius: 8px; border: 0; font-size: .95rem; }
.testata .utente { font-size: .9rem; white-space: nowrap; }
.testata .utente a { color: #fff; }
.apri-menu { display: none; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; padding: 0 .25rem; }

.pagina { display: flex; min-height: calc(100vh - 52px); }
nav.menu {
  width: var(--menu); flex-shrink: 0;
  background: var(--bianco); border-right: 1px solid var(--bordo);
  padding: 1rem 0;
}
nav.menu .gruppo { padding: .9rem 1.25rem .3rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--grigio); }
nav.menu a { display: block; padding: .45rem 1.25rem; color: var(--testo); }
nav.menu a:hover { background: var(--blu-chiaro); text-decoration: none; }
nav.menu a.attivo { background: var(--blu-chiaro); color: var(--blu); font-weight: 600; border-left: 3px solid var(--blu); padding-left: calc(1.25rem - 3px); }
nav.menu .prossimamente { display: block; padding: .45rem 1.25rem; color: #b0b5bd; }
main { flex: 1; min-width: 0; padding: 1.5rem; max-width: 1200px; }

@media (max-width: 860px) {
  .apri-menu { display: block; }
  .testata .utente .nome { display: none; }
  nav.menu { position: fixed; top: 52px; left: 0; bottom: 0; z-index: 15; transform: translateX(-100%); transition: transform .2s; overflow-y: auto; box-shadow: 2px 0 12px rgba(0,0,0,.15); }
  nav.menu.aperto { transform: none; }
  main { padding: 1rem; }
}
@media (max-width: 560px) {
  .testata { flex-wrap: wrap; }
  .testata form.cerca { order: 3; flex-basis: 100%; max-width: none; }
  .pagina { min-height: calc(100vh - 96px); }
  nav.menu { top: 96px; }
}

/* ---------- elementi ---------- */
.intestazione { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.intestazione h1 { margin: 0; flex: 1; min-width: 200px; }
.scheda { background: var(--bianco); border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 1.25rem; margin-bottom: 1.25rem; }
.scheda > h2:first-child, .scheda > h3:first-child { margin-top: 0; }
.griglia { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.griglia-2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
/* 23/10/2026: pesatura – le pesate più larghe del disegno, la tabella non viene tagliata */
.griglia-pesatura > * { min-width: 0; }
@media (min-width: 1100px) { .griglia-pesatura { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.riquadro { background: var(--bianco); border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 1rem 1.25rem; }
.riquadro .numero { font-size: 2rem; font-weight: 700; }
.riquadro .etichetta { color: var(--grigio); font-size: .9rem; }
a.riquadro:hover { text-decoration: none; border-color: var(--blu); }

.pulsante, button, input[type=submit] {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--blu);
  background: var(--blu); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; min-height: 42px;
}
.pulsante:hover, button:hover { filter: brightness(1.08); text-decoration: none; }
.pulsante.secondario, button.secondario { background: var(--bianco); color: var(--blu); }
.pulsante.pericolo, button.pericolo { background: var(--rosso); border-color: var(--rosso); }
.pulsante.piccolo, button.piccolo { padding: .3rem .65rem; min-height: 32px; font-size: .875rem; }
.azioni { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }

.etichetta-stato { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--sfondo); color: var(--grigio); white-space: nowrap; }
.etichetta-stato.verde { background: var(--verde-chiaro); color: var(--verde); }
.etichetta-stato.rosso { background: var(--rosso-chiaro); color: var(--rosso); }
.etichetta-stato.giallo { background: var(--giallo-chiaro); color: var(--giallo); }
.etichetta-stato.blu { background: var(--blu-chiaro); color: var(--blu); }

.avviso { padding: .8rem 1rem; border-radius: var(--raggio); margin-bottom: 1rem; border: 1px solid; }
.avviso.info { background: var(--blu-chiaro); border-color: #bfdbfe; }
.avviso.successo { background: var(--verde-chiaro); border-color: #bbf7d0; }
.avviso.errore { background: var(--rosso-chiaro); border-color: #fecaca; }
.avviso.attenzione { background: var(--giallo-chiaro); border-color: #fde68a; }
.nota-importante { background: #fef2f2; border: 2px solid var(--rosso); color: var(--rosso); border-radius: var(--raggio); padding: .8rem 1rem; font-weight: 700; font-size: 1.1rem; white-space: pre-line; }

/* ---------- tabelle ---------- */
.tabella-contenitore { overflow-x: auto; background: var(--bianco); border: 1px solid var(--bordo); border-radius: var(--raggio); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--bordo); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--grigio); background: #f9fafb; }
tr:last-child td { border-bottom: 0; }
tr.spento td { color: #9ca3af; }
td.numero, th.numero { text-align: right; white-space: nowrap; }
.vuoto { padding: 1.5rem; text-align: center; color: var(--grigio); }

/* ---------- moduli ---------- */
.filtri { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.filtri input[type=search], .filtri input[type=text], .filtri select { padding: .5rem .7rem; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; min-height: 42px; }
.filtri input[type=search] { min-width: 240px; flex: 1; max-width: 420px; }
.schede-filtro a { display: inline-block; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--bordo); background: var(--bianco); color: var(--testo); font-size: .9rem; }
.schede-filtro a.attivo { background: var(--blu); border-color: var(--blu); color: #fff; }

form.modulo { max-width: 680px; }
form.modulo > div, .campo { margin-bottom: 1rem; }
form.modulo label { display: block; font-weight: 600; margin-bottom: .3rem; }
form.modulo input[type=text], form.modulo input[type=password], form.modulo input[type=email],
form.modulo input[type=number], form.modulo input[type=date], form.modulo input[type=time],
form.modulo select, form.modulo textarea, input.campo-testo {
  width: 100%; padding: .55rem .7rem; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; background: #fff; min-height: 42px;
}
form.modulo input:focus, form.modulo select:focus, form.modulo textarea:focus { outline: 2px solid #93c5fd; border-color: var(--blu); }
form.modulo .helptext, form.modulo .aiuto { display: block; color: var(--grigio); font-size: .85rem; margin-top: .25rem; }
form.modulo input[type=checkbox] { width: 1.2rem; height: 1.2rem; vertical-align: middle; margin-right: .35rem; }
form.modulo div:has(> input[type=checkbox]) { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .35rem; }
form.modulo div:has(> input[type=checkbox]) label { order: 2; margin: 0; font-weight: 600; }
form.modulo div:has(> input[type=checkbox]) input { order: 1; }
form.modulo div:has(> input[type=checkbox]) .helptext { order: 3; flex-basis: 100%; }
form.modulo ul.errorlist, .errorlist { list-style: none; padding: 0; margin: .25rem 0; color: var(--rosso); font-weight: 600; font-size: .9rem; }
form.modulo .errorlist.nonfield { background: var(--rosso-chiaro); padding: .6rem .8rem; border-radius: 8px; }
form.modulo div[id$=_tipo] > div, form.modulo #id_tipo > div { margin-bottom: .3rem; }
form.modulo div#id_tipo label, form.modulo div#id_dipendenti label { font-weight: 400; display: flex; align-items: center; }
form.modulo div#id_dipendenti { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .25rem .75rem; background: #f9fafb; border: 1px solid var(--bordo); border-radius: 8px; padding: .6rem; }
.input-codice { font-size: 1.6rem !important; letter-spacing: .3em; text-align: center; max-width: 220px; }

/* ---------- pagina di accesso ---------- */
.accesso { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: linear-gradient(160deg, var(--blu-scuro), #0f172a); }
.accesso .scheda { width: 100%; max-width: 420px; padding: 2rem; }
.accesso h1 { font-size: 1.35rem; }
.accesso .marchio { font-weight: 700; color: var(--blu-scuro); margin-bottom: 1rem; }
.accesso form.modulo button { width: 100%; }

/* ---------- calendario ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .intest { font-size: .8rem; text-transform: uppercase; color: var(--grigio); text-align: center; padding: .25rem; }
.cal .giorno { background: var(--bianco); border: 1px solid var(--bordo); border-radius: 8px; min-height: 104px; padding: .35rem; font-size: .8rem; overflow: hidden; }
.cal .giorno.fuori { opacity: .45; }
.cal .giorno.non-lavorativo { background: #f9fafb; }
.cal .giorno.chiuso { background: #fef2f2; }
.cal .giorno.oggi { border: 2px solid var(--blu); }
.cal .giorno .num { font-weight: 700; display: flex; justify-content: space-between; }
.cal .giorno .num a { font-weight: 400; color: var(--grigio); visibility: hidden; }
.cal .giorno:hover .num a { visibility: visible; }
.cal .voce { display: block; border-radius: 4px; padding: 1px 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--testo); }
.cal .voce.chiusura { background: var(--rosso-chiaro); color: var(--rosso); }
.cal .voce.assenza { background: var(--giallo-chiaro); color: var(--giallo); }
.cal .voce.straordinario { background: var(--blu-chiaro); color: var(--blu); }
@media (max-width: 700px) {
  .cal .giorno { min-height: 64px; font-size: .7rem; padding: .2rem; }
  .cal .voce { white-space: normal; }
}
.legenda { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; margin: .75rem 0; }
.legenda span::before { content: ""; display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.legenda .l-chiusura::before { background: var(--rosso-chiaro); border: 1px solid var(--rosso); }
.legenda .l-assenza::before { background: var(--giallo-chiaro); border: 1px solid var(--giallo); }
.legenda .l-straordinario::before { background: var(--blu-chiaro); border: 1px solid var(--blu); }

/* ---------- storico modifiche ---------- */
.storico .voce-storico { border-left: 3px solid var(--bordo); padding: .35rem 0 .35rem .8rem; margin-bottom: .5rem; }
.storico .modifica { font-size: .875rem; }
.storico .prima { color: var(--rosso); text-decoration: line-through; }
.storico .dopo { color: var(--verde); }

/* ---------- disegno ---------- */
.disegno-anteprima { width: 100%; height: 70vh; border: 1px solid var(--bordo); border-radius: var(--raggio); background: #fff; }

/* ---------- badge ---------- */
.badge-foglio { display: grid; grid-template-columns: repeat(auto-fill, 85.6mm); gap: 6mm; }
.badge { width: 85.6mm; height: 54mm; border: 1px dashed #9ca3af; border-radius: 3mm; padding: 4mm 5mm; display: flex; flex-direction: column; justify-content: space-between; background: #fff; break-inside: avoid; page-break-inside: avoid; }
.badge .azienda { font-size: 8pt; font-weight: 700; color: var(--blu-scuro); text-transform: uppercase; letter-spacing: .05em; }
.badge .nome { font-size: 14pt; font-weight: 700; line-height: 1.15; }
.badge .codice-barre svg { display: block; margin: 0 auto; max-width: 100%; }
.badge .codice { font-family: Consolas, monospace; font-size: 11pt; text-align: center; letter-spacing: .15em; }
.badge-singolo svg { display: block; max-width: 100%; }

@media print {
  body { background: #fff; }
  .testata, nav.menu, .non-stampare, .messaggi { display: none !important; }
  main { padding: 0; max-width: none; }
  .badge { border-style: solid; }
  @page { margin: 10mm; }
}

/* ---------- ordini ---------- */
input.numero-corto, form.modulo input.numero-corto { width: 90px; min-width: 0; text-align: right; }
.riga-componente.imballo .solo-normale, .riga-componente:not(.imballo) .solo-imballo { display: none; }
td input.numero-corto { min-height: 34px; padding: .3rem .5rem; }

/* ---------- carico DDT ---------- */
.tabella-carico td { padding: .35rem .4rem; }
.tabella-carico input { width: 100%; min-height: 36px; padding: .35rem .5rem; font-family: Consolas, monospace; }
.tabella-carico td:nth-child(1) input { min-width: 170px; }
.tabella-carico td:nth-child(2) input { min-width: 220px; font-family: inherit; }
.tabella-carico td:nth-child(3) input { min-width: 150px; }
.tabella-carico td:nth-child(4) input { min-width: 90px; text-align: right; }
.tabella-carico td:nth-child(5) input { min-width: 130px; }

/* ---------- zona per trascinare i PDF ---------- */
.zona-trascina { border: 3px dashed #93c5fd; border-radius: var(--raggio); background: var(--blu-chiaro); padding: 2rem 1rem; text-align: center; cursor: pointer; margin-bottom: 1rem; transition: background .15s; }
.zona-trascina.sopra { background: #dbeafe; border-color: var(--blu); }
.zona-trascina .grande-testo { font-size: 1.2rem; font-weight: 600; color: var(--blu-scuro); }
.zona-trascina input[type=file] { display: none; }
.zona-trascina .nome-file { margin-top: .5rem; font-weight: 600; }
.piu-vecchia { background: var(--verde-chiaro); color: var(--verde); font-weight: 700; border-radius: 4px; padding: 0 .3rem; }

/* Ordini in ritardo */
.conteggio-ritardi { display: inline-block; min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--rosso); color: #fff; font-size: .78rem; font-weight: 700; text-align: center; }
tr.riga-ritardo td { background: var(--rosso-chiaro); }
tr.riga-ritardo td:first-child { box-shadow: inset 4px 0 0 var(--rosso); }
.scheda.scheda-ritardo { border: 2px solid var(--rosso); }
.etichetta-ritardo { display: inline-block; background: var(--rosso); color: #fff; font-weight: 700; border-radius: 6px; padding: .15rem .6rem; margin-bottom: .5rem; }
.avvisi-ritardo { background: var(--rosso); color: #fff; border-radius: var(--raggio); padding: .8rem 1rem; margin-bottom: 1rem; }
.avvisi-ritardo .intestazione-avvisi { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.avvisi-ritardo ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.avvisi-ritardo li { margin: .3rem 0; }
.avvisi-ritardo a { color: #fff; font-weight: 700; }
.avvisi-ritardo .pulsante.bianco { background: #fff; color: var(--rosso); border-color: #fff; }
.attiva-suono { display: block; width: 100%; margin-bottom: 1rem; background: var(--giallo-chiaro); color: var(--testo, #1f2937); border: 1px solid #fde68a; }
[hidden] { display: none !important; }  /* niente regola di stile può mostrare un elemento nascosto */

/* Postazione pesa (PC vicino alla bilancia): caratteri grandi, sempre pronta a leggere un codice */
body.pesa { font-size: 19px; background: var(--sfondo); }
.pesa-testata { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: .7rem 1.5rem; background: #1e3a8a; color: #fff; font-size: 1.15rem; }
.pesa-testata .marchio { font-weight: 800; font-size: 1.3rem; }
.pesa-testata .orologio { text-transform: capitalize; opacity: .9; }
.pesa-esci { color: #bfdbfe; font-size: .9rem; }
.pesa-contenuto { max-width: 1400px; margin: 0 auto; padding: 1rem 1.5rem 2rem; }
.pesa-lettura input { width: 100%; font-size: 1.6rem; padding: .7rem 1rem; border: 3px solid #3b82f6; border-radius: 12px; text-align: center; margin-bottom: 1rem; }
.pesa-msg { padding: .9rem 1.2rem; border-radius: 12px; margin-bottom: 1rem; font-size: 1.2rem; border: 2px solid; }
.pesa-msg.errore { background: var(--rosso-chiaro); border-color: var(--rosso); color: var(--rosso); font-weight: 700; }
.pesa-msg.errore.grande { font-size: 1.6rem; }
.pesa-msg.ok { background: var(--verde-chiaro); border-color: var(--verde); color: var(--verde); font-weight: 700; }
.pesa-msg.info { background: var(--blu-chiaro); border-color: #93c5fd; }
.pesa-msg.piccolo-msg { font-size: 1rem; padding: .5rem 1rem; }
.pesa-istruzione { font-size: 1.7rem; text-align: center; padding: 1.5rem; background: #fff; border-radius: 16px; margin-bottom: 1.5rem; }
.pesa-intestazione { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; background: #fff; border-radius: 16px; padding: 1rem 1.4rem; margin-bottom: 1rem; }
.pesa-articolo { font-size: 2rem; font-weight: 800; }
.pesa-attesi { font-size: 1.6rem; margin-top: .4rem; }
.etichetta-stato.grande { font-size: 1.1rem; padding: .3rem .9rem; }
.pesa-griglia { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, 1.3fr); gap: 1rem; }
@media (max-width: 900px) { .pesa-griglia { grid-template-columns: 1fr; } }
.pesa-scheda { background: #fff; border-radius: 16px; padding: 1rem 1.4rem; margin-bottom: 1rem; }
.pesa-scheda h2 { margin-top: 0; }
.pesa-campi { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem 1rem; margin-bottom: .8rem; }
.pesa-campi label, .pesa-scheda details label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; }
.pesa-scheda input[type=text], .pesa-scheda input[type=number] { font-size: 1.6rem; padding: .5rem .7rem; width: 100%; }
.pesa-calcolo { display: flex; gap: 2rem; font-size: 1.4rem; background: var(--sfondo); border-radius: 12px; padding: .7rem 1rem; margin-bottom: .8rem; }
.pesa-tabella { width: 100%; background: #fff; }
.pesa-totale { font-size: 1.6rem; font-weight: 800; }
.pesa-btn { font-size: 1.4rem; font-weight: 800; padding: .9rem 1.6rem; border-radius: 14px; min-height: 64px; }
.pesa-btn.largo { width: 100%; margin-top: .8rem; }
.pesa-btn.verde { background: var(--verde); border-color: var(--verde); }
.pesa-btn.blu { background: var(--blu); border-color: var(--blu); }
.pesa-btn.grigio { background: #475569; border-color: #475569; color: #fff; }
.pesa-pulsanti { display: grid; grid-template-columns: 1fr 2fr; gap: 1rem; margin-top: .5rem; }
.bilancia-testata { display: inline-flex; align-items: center; gap: .6rem; }
.bilancia-testata button { background: #fff; color: var(--blu); border-color: #fff; }
.pesa-scheda input.da-bilancia { background: #ecfdf5; border-color: var(--verde); }
.bilancia-righe td { font-family: Consolas, monospace; font-size: .9rem; }

/* Redditività (solo Titolare) */
.griglia-numeri { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; }
.griglia-numeri > div { background: var(--sfondo); border-radius: 10px; padding: .55rem .8rem; display: flex; flex-direction: column; gap: .15rem; }
.griglia-numeri span { font-size: .8rem; color: var(--grigio); }
.griglia-numeri strong { font-size: 1.25rem; }
.valore-verde strong, td.valore-verde { color: var(--verde); }
.valore-rosso strong, td.valore-rosso { color: var(--rosso); }
.griglia-numeri .valore-rosso { background: var(--rosso-chiaro); }
.griglia-numeri .valore-verde { background: var(--verde-chiaro); }
.schede-vista { display: flex; gap: .25rem; border-bottom: 2px solid var(--bordo, #e5e7eb); margin-bottom: .8rem; }
.schede-vista a { padding: .5rem 1rem; border-radius: 8px 8px 0 0; text-decoration: none; color: var(--grigio); font-weight: 600; }
.schede-vista a.attiva { background: var(--blu); color: #fff; }

/* Guida rapida «Come si fa?» e pulsante «?» */
.pulsante-guida { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%;
  background: #fff; color: #1e3a8a; border: 0; font-weight: 800; font-size: 1.1rem; text-decoration: none; margin: 0 .4rem; flex: 0 0 auto; padding: 0; min-height: 0; cursor: pointer; }
.come-si-fa { position: relative; flex: 1; max-width: 360px; }
.come-si-fa input { width: 100%; padding: .45rem .7rem; border-radius: 8px; border: 0; font-size: .95rem; background: #fef9c3; }
.come-si-fa-pannello { position: absolute; right: 0; top: calc(100% + .4rem); width: min(520px, 92vw); max-height: 75vh; overflow: auto; z-index: 50;
  background: #fff; color: var(--testo); border-radius: 12px; padding: .8rem; box-shadow: 0 10px 30px rgba(15,23,42,.25); }
.come-si-fa-pannello .scheda-guida { margin-bottom: .6rem; }
.scheda-guida { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: .8rem 1rem; }
.scheda-guida[hidden] { display: none; }
.scheda-guida-titolo { font-weight: 700; font-size: 1.05rem; display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.scheda-guida-sezione { font-size: .75rem; font-weight: 600; color: var(--grigio); white-space: nowrap; }
.scheda-guida ol { margin: .5rem 0 .7rem; padding-left: 1.3rem; } .scheda-guida li { margin: .2rem 0; }
.griglia-schede { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
@media (max-width: 760px) { .come-si-fa { order: 4; flex-basis: 100%; max-width: none; } }

/* Ordini SAP divisi per giorno di caricamento */
tbody.gruppo-ordini.alternato td { background: #f0f6ff; }
tr.intestazione-gruppo td { background: #1e3a8a !important; color: #fff; font-weight: 700; font-size: 1.02rem; padding: .55rem .8rem; }
tr.intestazione-gruppo .data-gruppo { font-weight: 400; opacity: .85; margin-left: .4rem; }
tr.intestazione-gruppo .conta-gruppo { float: right; background: rgba(255,255,255,.18); border-radius: 999px; padding: 0 .7rem; font-weight: 600; font-size: .9rem; }
/* Menu a sinistra a tendina */
nav.menu details.gruppo-menu > summary.gruppo { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding-right: 1rem; user-select: none; }
nav.menu details.gruppo-menu > summary.gruppo::-webkit-details-marker { display: none; }
nav.menu details.gruppo-menu > summary.gruppo::after { content: "▸"; font-size: .9rem; transition: transform .15s; }
nav.menu details.gruppo-menu[open] > summary.gruppo::after { transform: rotate(90deg); }
nav.menu details.gruppo-menu > summary.gruppo:hover { color: var(--blu); }

/* Anteprima importazione: prezzo e fasi dell'articolo */
.riquadro-articolo { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 10px; padding: .8rem 1rem; margin: .8rem 0; }
.riquadro-articolo .prezzo-mancante { background: var(--rosso-chiaro); border: 2px solid var(--rosso); border-radius: 8px; padding: .5rem .8rem; margin-bottom: .6rem; }
.tabella-fasi { width: auto; min-width: 380px; }
.tabella-fasi td { padding: .25rem .6rem .25rem 0; }

/* Urgenze del cliente */
.etichetta-urgente { display: inline-block; background: #dc2626; color: #fff; font-weight: 800; font-size: .78rem; border-radius: 6px; padding: .1rem .5rem; white-space: nowrap; letter-spacing: .02em; }
.riquadro-urgenze { border: 2px solid #fca5a5; }
tr.urgenza-scaduta td { background: var(--rosso-chiaro); color: #7f1d1d; }
tr.urgenza-imminente td { background: #ffedd5; color: #7c2d12; }
tr.riga-cliccabile { cursor: pointer; }
tr.riga-cliccabile:hover td { filter: brightness(.97); }
.reparto .urgente-tablet { background: #dc2626; color: #fff; font-weight: 800; font-size: 1.5rem; border-radius: 12px; padding: .7rem 1rem; margin-bottom: 1rem; text-align: center; }

/* Posizione delle fasi nell'anteprima */
input.numero-mini { width: 3.5rem; text-align: right; }
.aggiungi-fase-nuova { margin-top: .4rem; }

/* Ordini incompleti per mancanza materiale (09/10/2026) */
.etichetta-materiale { display: inline-block; font-weight: 800; font-size: .74rem; border-radius: 6px; padding: .1rem .45rem; white-space: nowrap; letter-spacing: .02em; vertical-align: middle; }
.etichetta-materiale.manca { background: #ea580c; color: #fff; }
.etichetta-materiale.condiviso { background: #facc15; color: #422006; }
.etichetta-materiale.arrivato { background: #16a34a; color: #fff; }
.etichetta-materiale.imballo { background: #e5e7eb; color: #374151; font-weight: 600; }
.etichetta-materiale.piccola { font-size: .65rem; padding: 0 .35rem; }
.tabella-critici tr.riga-manca td { background: #ffedd5; }
.tabella-critici tr.riga-condiviso td { background: #fef9c3; }
.serve-per { background: #fff7ed; border: 1px solid #fdba74; border-radius: 8px; padding: .4rem .6rem; margin-top: .3rem; font-size: .88rem; }
.serve-per > div { margin-top: .15rem; }
.riquadro-materiale { border: 2px solid #fdba74; }
.reparto .etichetta-materiale { font-size: 1.1rem; padding: .2rem .7rem; }
.reparto .serve-per { color: #1f2937; font-size: 1.1rem; }
.reparto .materiale-tablet { border-radius: 12px; padding: .7rem 1rem; margin-bottom: 1rem; font-size: 1.2rem; font-weight: 700; }
.reparto .materiale-tablet.manca { background: #ea580c; color: #fff; }
.reparto .materiale-tablet.condiviso { background: #facc15; color: #422006; }
.reparto .materiale-tablet.arrivato { background: #16a34a; color: #fff; }
tbody.alternato td { background: #f8fafc; }
tr.riga-mancanze td { color: #9a3412; padding-top: 0; }
tr.riga-totale-ordine td { background: #eef2ff; border-bottom: 2px solid #c7d2fe; }
.gruppo-in-lavorazione { margin-bottom: 1.6rem; }
.intestazione-ordine { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .5rem .2rem; border-bottom: 2px solid var(--bordo); margin-bottom: .6rem; }
.menu .conteggio-lista { float: right; background: #e2e8f0; color: #334155; border-radius: 999px; padding: 0 .5rem; font-size: .8rem; font-weight: 700; }
.pulsante-indietro { display: inline-block; margin-bottom: .8rem; background: #fff; color: #1e3a8a; border: 2px solid #93c5fd; border-radius: 10px; padding: .45rem 1rem; font-size: 1rem; font-weight: 700; cursor: pointer; }
.pulsante-indietro:hover { background: #eff6ff; }
@media print { .pulsante-indietro { display: none; } }
tr.riga-esclusa td { color: #94a3b8; text-decoration: line-through; }
tr.riga-esclusa td:last-child { text-decoration: none; }
/* Finiti raggruppati per ordine (16/10/2026) */
.tabella-finiti tbody.blocco-ordine { border-top: 4px solid #334155; }
.tabella-finiti tbody.blocco-ordine:first-of-type { border-top: 0; }
tr.riga-totale-ordine.parziale td { background: #fff7ed; border-bottom: 2px solid #fdba74; }
.in-corso { color: #c2410c; font-weight: 700; }
/* Postazione pesa: avviso bilancia grande (16/10/2026) */
.bilancia-grande { font-size: 1.3rem; }
.bilancia-grande .grande-ricollega { display: block; margin-top: .7rem; font-size: 1.5rem; font-weight: 800; padding: .8rem 1.4rem; background: #16a34a; color: #fff; border: 0; border-radius: 12px; cursor: pointer; }
/* Pagine larghe e tabella Finiti compatta (16/10/2026): niente scorrimento a destra e sinistra */
main.largo { max-width: none; }
.tabella-finiti.compatta { font-size: 1.02rem; width: auto; }  /* larga quanto serve: niente vuoti tra le colonne */
.tabella-finiti.compatta th, .tabella-finiti.compatta td { padding: .45rem .7rem; }
.tabella-finiti.compatta th { white-space: normal; }
.tabella-finiti .etichetta-stato { font-size: .78rem; padding: .05rem .4rem; }
tr.riga-nota td { color: var(--rosso); font-size: .9rem; padding-top: 0 !important; border-top: 0; }
tr.riga-nota.parziale td { background: #fff7ed; }
/* A cosa serve il componente (16/10/2026) */
.uso-componente { background: #eff6ff; border: 2px solid #93c5fd; border-radius: 10px; padding: .6rem .9rem; margin: .6rem 0 1rem; color: #1e3a8a; }
.uso-componente .uso-titolo { font-weight: 800; margin-bottom: .2rem; }
.uso-componente > div { margin: .15rem 0; }
.reparto .uso-componente { font-size: 1.2rem; }
.uso-componente .senza-lotto { background: #ffedd5; color: #9a3412; border-radius: 6px; padding: .15rem .5rem; margin: .15rem 0 .2rem 1rem; font-weight: 700; }

/* 23/10/2026 (Blocco 3): barra delle schede AZIENDA + clienti */
.schede-clienti { display:flex; gap:.25rem; flex-wrap:wrap; padding:.4rem 1rem 0; background:var(--bianco); border-bottom:2px solid var(--blu, #1d4ed8); }
.scheda-cliente { padding:.45rem 1rem; border:1px solid var(--bordo); border-bottom:0; border-radius:8px 8px 0 0; text-decoration:none;
  font-weight:600; font-size:.9rem; color:var(--testo, #1f2937); background:#f3f4f6; }
.scheda-cliente.attiva { background:var(--blu, #1d4ed8); color:#fff; border-color:var(--blu, #1d4ed8); }
.scheda-cliente.in-preparazione { opacity:.6; font-style:italic; }
@media print { .schede-clienti { display:none; } }
