
:root { --testo: #1b1f23; --fondo: #fafaf7; --tenue: #5f6b73; --bordo: #d5d9dc; --azione: #0b5f8a; --male: #a4262c; }
* { box-sizing: border-box; }
body { margin: 0; font: 18px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--testo); background: var(--fondo); }
main { max-width: 40rem; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.4rem; margin: 0.5rem 0 1rem; }
p { margin: 0.5rem 0; }
button { display: block; width: 100%; min-height: 3.25rem; margin: 0.5rem 0; padding: 0.75rem 1rem; font: inherit; font-weight: 600;
  color: #fff; background: var(--azione); border: 0; border-radius: 0.6rem; cursor: pointer; }
button.secondario { color: var(--azione); background: transparent; border: 2px solid var(--azione); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.piccolo { display: inline-block; width: auto; min-height: 2.5rem; margin: 0.25rem 0 0.25rem 0.5rem; padding: 0.4rem 0.8rem; font-size: 0.95rem; }
input, select, textarea { display: block; width: 100%; min-height: 3.25rem; margin: 0.5rem 0; padding: 0.6rem 0.8rem; font: inherit;
  border: 2px solid var(--bordo); border-radius: 0.6rem; background: #fff; }
input[type="password"] { font-size: 1.8rem; letter-spacing: 0.4rem; text-align: center; }
label { display: block; margin-top: 0.75rem; font-weight: 600; }
/* Un campo nascosto resta nascosto: la regola qui sopra lo mostrerebbe. */
[hidden] { display: none !important; }
.codice { font: 700 2.6rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.3rem; text-align: center; margin: 1.5rem 0; }
.nota { color: var(--tenue); }
.nota.male { color: var(--male); font-weight: 600; }
.nomi button { font-size: 1.2rem; }
nav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
nav .scheda { flex: 1 1 8rem; width: auto; margin: 0; min-height: 2.75rem; color: var(--azione); background: #fff; border: 2px solid var(--azione); }
nav .scheda.attiva { color: #fff; background: var(--azione); }
.elenco { list-style: none; margin: 0; padding: 0; }
.elenco li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--bordo); }
.elenco .voce { font-weight: 600; flex: 1 1 10rem; }
.elenco .dettaglio { color: var(--tenue); font-size: 0.95rem; }
.elenco .azioni { margin-left: auto; }
.aggiungi { margin-top: 1rem; padding-top: 0.5rem; border-top: 2px solid var(--bordo); }
h2 { font-size: 1.15rem; margin: 1rem 0 0.5rem; }
.sync { margin: -0.25rem 0 0.75rem; padding: 0.4rem 0.7rem; border-radius: 0.5rem; background: #e8f3ea; color: #1d5b2c; font-size: 0.95rem; }
.sync.attesa { background: #fff4d6; color: #6b4d00; font-weight: 600; }
.sync.male, .sync .male { background: #fde8e8; color: var(--male); }
button.compito { display: flex; flex-direction: column; align-items: flex-start; text-align: left; color: var(--testo); background: #fff; border: 2px solid var(--bordo); }
button.compito small { font-weight: 400; color: var(--tenue); }
button.compito.ritardo { border-color: var(--male); }
button.compito.ritardo small { color: var(--male); font-weight: 600; }
button.bene { background: #1d7a3a; }
button.scelta { display: inline-block; width: auto; margin: 0.25rem 0.4rem 0.25rem 0; color: var(--azione); background: #fff; border: 2px solid var(--azione); }
button.scelta.attiva { color: #fff; background: var(--azione); }
.esito { font-weight: 700; min-height: 1.4em; }
.esito.green { color: #1d7a3a; }
.esito.amber { color: #8a5a00; }
.esito.red { color: var(--male); }
label.spunta { display: flex; gap: 0.6rem; align-items: center; font-weight: 400; min-height: 2.75rem; }
label.spunta input { width: 1.6rem; min-height: 1.6rem; margin: 0; }
.promemoria { margin: 0.25rem 0 0.75rem; padding-left: 1.2rem; color: var(--tenue); }
.nascosto { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
label.fotocamera { display: flex; align-items: center; justify-content: center; min-height: 3.25rem; margin: 0.5rem 0; padding: 0.75rem 1rem;
  color: #fff; background: var(--azione); border-radius: 0.6rem; font-weight: 600; cursor: pointer; }
.stampa { display: none; }
/* La stampa della lista del banco: solo la lista, senza pulsanti né la riga della coda. */
/* L'etichetta (lotto 15): l'anteprima ha le misure del rotolo. */
.etichetta { display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; margin: 0.75rem 0; padding: 1.5mm 2mm;
  line-height: 1.15; color: #000; background: #fff; border: 1px dashed var(--tenue); }
.etichetta p { margin: 0; }
.etichetta .nome { font-weight: 700; }
.etichetta .scade { display: flex; align-items: center; justify-content: space-between; gap: 1mm; font-weight: 700; }
.etichetta .giorno { font-size: 2.4em; line-height: 1; }
@media print {
  /* Stampando un'etichetta esce solo lei, sul foglio del rotolo. */
  body.stampa-etichetta main > * { display: none !important; }
  body.stampa-etichetta main { padding: 0; }
  body.stampa-etichetta main > .etichetta { display: flex !important; margin: 0; border: 0; }
  body { background: #fff; font-size: 12pt; }
  main { max-width: none; padding: 0; }
  button, .sync, .nota[role="status"] { display: none !important; }
  .stampa { display: block; font-weight: 600; }
  .elenco li { break-inside: avoid; }
}
