/* Stile dell'app: base, area admin, dashboard del cliente. */
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: #1f2933; background: #f5f7fa; line-height: 1.5; }
.testata { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1.25rem; background: #fff; border-bottom: 1px solid #e4e7eb; }
.testata nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.marchio { font-weight: 600; text-decoration: none; color: inherit; }
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem; }
.scheda { background: #fff; border: 1px solid #e4e7eb; border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; }
.stretta { max-width: 420px; margin: 2rem auto; }
.schede { list-style: none; padding: 0; }
label { display: block; margin-bottom: .9rem; font-weight: 500; }
input, select { display: block; width: 100%; margin-top: .25rem; padding: .55rem .65rem; font: inherit; border: 1px solid #cbd2d9; border-radius: 6px; }
button { padding: .55rem 1rem; font: inherit; border: 0; border-radius: 6px; background: #1f5fbf; color: #fff; cursor: pointer; }
button.link { background: none; color: #1f5fbf; padding: 0; text-decoration: underline; }
button.pericolo { color: #b42318; }
form.in-linea { display: inline; margin: 0 .5rem 0 0; }
.errore { color: #b42318; background: #fef3f2; border: 1px solid #fecdca; padding: .6rem .8rem; border-radius: 6px; }
.evidenza { border-color: #84adff; background: #eff4ff; }
.nota { color: #616e7c; font-size: .925rem; }
table { width: 100%; border-collapse: collapse; background: #fff; margin-bottom: 1.5rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid #e4e7eb; vertical-align: top; }
@media (max-width: 768px) { table { font-size: .9rem; } }
.esito-ok { color: #067647; font-weight: 600; }
.esito-errore { color: #b42318; font-weight: 600; }
.esito-parziale, .esito-in_corso { color: #b54708; font-weight: 600; }
code { font-size: .85rem; background: #eef2f6; padding: .1rem .3rem; border-radius: 4px; }

/* --- Dashboard del cliente --- */
.dashboard-testata { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.dashboard-testata h1 { margin: 0; }
.dashboard-testata .nota { margin: .25rem 0 0; }
.scelta-mese label { margin: 0; }
.scelta-mese select { min-width: 13rem; }
.avviso-mese { background: #fffaeb; border: 1px solid #fedf89; color: #93370d; padding: .6rem .8rem; border-radius: 6px; }
.griglia-numeri { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.colonna-blocchi { margin-bottom: 1rem; }
.blocco { background: #fff; border: 1px solid #e4e7eb; border-radius: 8px; padding: 1rem 1.25rem; }
.blocco[hidden] { display: none; }
.blocco-titolo { font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; color: #3e4c59; }
.valore-grande { font-size: 2rem; font-weight: 700; margin: 0; line-height: 1.2; font-variant-numeric: tabular-nums; }
.dettaglio { margin: .25rem 0 0; color: #3e4c59; }
.valore-frase { font-size: 1.15rem; font-weight: 600; margin: 0; line-height: 1.35; }
.confronti { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .925rem; color: #616e7c; }
.variazione { font-weight: 600; }
.esito-meglio .variazione { color: #067647; }
.esito-peggio .variazione { color: #b42318; }
.voci { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; margin: 0; }
.voci dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.grafico { position: relative; height: 260px; }
.tabella-scorrevole { overflow-x: auto; }
.tabella-scorrevole table { margin: 0; }
td.numero, th.numero { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.etichetta { word-break: break-word; }
tr.totale td { font-weight: 600; border-top: 2px solid #cbd2d9; }
.blocco-commento h3 { font-size: .95rem; margin: .75rem 0 .25rem; }
.testo-commento { margin: 0; white-space: pre-line; }
.blocco-testo summary { cursor: pointer; }
@media (max-width: 768px) {
  .griglia-numeri { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .valore-grande { font-size: 1.6rem; }
  .grafico { height: 220px; }
}
@media (max-width: 420px) {
  main { padding: 1rem .75rem; }
  .blocco { padding: .85rem; }
}
label.in-linea-check { display: flex; gap: .5rem; align-items: center; }
label.in-linea-check input { width: auto; margin: 0; }

/* Piè di pagina e pagine di solo testo (informativa privacy). */
.piede { text-align: center; padding: 1.5rem 1rem 2rem; font-size: .875rem; }
.piede a { color: #616e7c; }
.testo-lungo { max-width: 46rem; line-height: 1.55; }
.testo-lungo h2 { font-size: 1.1rem; margin-top: 1.5rem; }

/* Tabella delle pagine: sotto i 768 px nome leggibile e solo utenti e contatti. */
.solo-stretto { display: none; }
@media (max-width: 767.98px) {
  .solo-largo { display: none; }
  .solo-stretto { display: inline; }
}
