/* Gestione Agree - stile semplice e leggibile, adatto anche al telefono */
:root { --blu: #1f5f8b; --blu-chiaro: #e8f1f8; --testo: #1d2733; --grigio: #66717d; --bordo: #dde3ea; --sfondo: #f4f6f9;
  --rosso: #d93025; --giallo: #f2a900; --verde: #1e8e3e; --raggio: 10px; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--testo); background: var(--sfondo); }
a { color: var(--blu); }
h1 { font-size: 1.5rem; margin: 0 0 .8rem; } h2 { font-size: 1.12rem; margin: 0 0 .6rem; } h3 { font-size: 1rem; margin: .8rem 0 .4rem; }
.piccolo { font-size: .85rem; color: var(--grigio); }
.barra { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .8rem; background: var(--blu); color: #fff; padding: .6rem 1rem; }
.barra .logo { color: #fff; text-decoration: none; font-size: 1.1rem; } .barra .chi { margin-left: auto; font-size: .9rem; opacity: .9; }
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }
.contenitore { display: flex; min-height: calc(100vh - 48px); }
.laterale { width: 220px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--bordo); padding: 1rem .6rem; display: flex; flex-direction: column; gap: .8rem; }
.laterale a, .link-btn { display: block; padding: .45rem .7rem; border-radius: 8px; color: var(--testo); text-decoration: none; font-size: .95rem; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; font-family: inherit; }
.laterale a:hover, .link-btn:hover { background: var(--sfondo); } .laterale a.attivo { background: var(--blu-chiaro); color: var(--blu); font-weight: 600; }
.gruppo-titolo { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--grigio); padding: 0 .7rem .2rem; }
.laterale a.futura { color: var(--grigio); } .laterale a.futura small { font-size: .7rem; background: var(--sfondo); padding: 1px 6px; border-radius: 6px; }
.gruppo-fondo { margin-top: auto; border-top: 1px solid var(--bordo); padding-top: .6rem; }
.principale { flex: 1; padding: 1.3rem; min-width: 0; max-width: 1400px; }
.solo { max-width: 420px; margin: 8vh auto; padding: 0 1rem; } .logo-grande { text-align: center; font-size: 1.6rem; color: var(--blu); margin-bottom: 1rem; }
.scheda-form { background: #fff; border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 1.4rem; display: flex; flex-direction: column; gap: .7rem; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; font-weight: 500; }
input, select, textarea { font: inherit; padding: .55rem .65rem; border: 1px solid #c8d1db; border-radius: 8px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blu-chiaro); border-color: var(--blu); }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; } label.check input { width: auto; }
fieldset { border: 1px solid var(--bordo); border-radius: 8px; padding: .6rem .9rem; } legend { font-size: .9rem; padding: 0 .3rem; }
.btn { display: inline-flex; align-items: center; gap: .3rem; padding: .5rem .9rem; border-radius: 8px; border: 1px solid #c8d1db; background: #fff; color: var(--testo); text-decoration: none; font: inherit; font-size: .92rem; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--sfondo); } .btn-primario { background: var(--blu); border-color: var(--blu); color: #fff; } .btn-primario:hover { background: #184d72; }
.btn-ok { background: #e7f4ea; border-color: #b5dcbf; color: #17642c; } .btn-pericolo { color: var(--rosso); border-color: #f0b8b3; }
.btn-piccolo { padding: .3rem .6rem; font-size: .82rem; } .btn-largo { justify-content: center; width: 100%; padding: .7rem; }
form.inline { display: inline; } .impila { display: flex; flex-direction: column; gap: .5rem; margin: .6rem 0; }
.avviso { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; } .avviso-ok { background: #e7f4ea; color: #17642c; }
.avviso-errore { background: #fdecea; color: #a52714; } .avviso-info { background: var(--blu-chiaro); color: var(--blu); }
.riquadro { background: #fff; border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.intestazione { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.intestazione h1, .intestazione h2 { margin: 0; } .azioni { display: flex; gap: .4rem; flex-wrap: wrap; margin-left: auto; }
.griglia-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } .griglia-2 > .riquadro { margin-bottom: 0; } .griglia-2 { margin-bottom: 1rem; }
.semafori { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1rem; }
.semaforo { background: #fff; border: 1px solid var(--bordo); border-radius: var(--raggio); padding: .9rem; text-decoration: none; color: inherit; }
.semaforo:hover { border-color: var(--blu); } .semaforo-nome { font-weight: 600; margin-bottom: .5rem; }
.luci { display: flex; gap: .5rem; } .luce { flex: 1; text-align: center; color: #fff; font-weight: 700; font-size: 1.25rem; padding: .35rem 0; border-radius: 8px; }
.luce.rosso { background: var(--rosso); } .luce.giallo { background: var(--giallo); } .luce.verde { background: var(--verde); } .luce.spenta { opacity: .18; }
.rosso-testo { color: var(--rosso); margin-top: .3rem; } .legenda { margin-top: -.3rem; }
.pallino { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; vertical-align: middle; margin-right: .25rem; }
.pallino.rosso { background: var(--rosso); } .pallino.giallo { background: var(--giallo); } .pallino.verde { background: var(--verde); }
.giorni { font-size: .8rem; white-space: nowrap; } .giorni.rosso { color: var(--rosso); font-weight: 600; } .giorni.giallo { color: #a46f00; } .giorni.verde { color: var(--verde); }
.lista-scadenze, .lista-pagamenti { list-style: none; margin: 0; padding: 0; }
.lista-scadenze li { display: flex; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--bordo); } .lista-scadenze li:last-child { border: 0; }
.ls-data { width: 115px; flex-shrink: 0; font-size: .9rem; } .ls-testo { font-size: .92rem; }
.lista-pagamenti li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .45rem 0; border-bottom: 1px solid var(--bordo); font-size: .92rem; }
.lista-pagamenti.fatti li { color: var(--grigio); } .destra { display: flex; align-items: center; gap: .5rem; margin-left: auto; white-space: nowrap; }
.grafico { position: relative; height: 320px; margin-bottom: 1rem; }
.tabella-scroll { overflow-x: auto; } .tabella { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabella th { text-align: left; font-weight: 600; color: var(--grigio); font-size: .8rem; border-bottom: 2px solid var(--bordo); padding: .45rem .5rem; white-space: nowrap; }
.tabella td { border-bottom: 1px solid var(--bordo); padding: .45rem .5rem; vertical-align: top; }
.tabella.numeri td:not(:first-child), .tabella.numeri th:not(:first-child), .num { text-align: right; white-space: nowrap; }
.tabella tfoot td, .tabella tr.totale td { font-weight: 700; background: var(--sfondo); } tr.spento { opacity: .5; } .nowrap { white-space: nowrap; }
.carte { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.carta { background: #fff; border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 1rem; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: .4rem; }
.carta:hover { border-color: var(--blu); box-shadow: 0 2px 8px rgba(31,95,139,.08); } .carta-titolo { font-weight: 700; color: var(--blu); font-size: 1.05rem; }
.carta-stato { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: auto; }
.etichetta { font-size: .75rem; padding: 2px 8px; border-radius: 10px; font-weight: 600; } .etichetta.rosso { background: #fdecea; color: var(--rosso); }
.etichetta.giallo { background: #fff4d6; color: #8a5d00; } .etichetta.verde { background: #e7f4ea; color: var(--verde); } .etichetta.grigio { background: var(--sfondo); color: var(--grigio); }
.dati { display: grid; grid-template-columns: 150px 1fr; gap: .3rem .8rem; margin: .4rem 0 .7rem; font-size: .92rem; } .dati dt { color: var(--grigio); } .dati dd { margin: 0; }
.testo-pre { white-space: pre-wrap; } .da-verificare { background: #fff8e6; border: 1px solid #f0c36d; border-radius: 8px; padding: .7rem .9rem; margin-bottom: 1rem; }
.da-verificare h2 { color: #8a5d00; font-size: 1rem; }
details.voce { border-bottom: 1px solid var(--bordo); padding: .55rem 0; } details.voce summary { cursor: pointer; }
details.voce[open] summary { margin-bottom: .4rem; }
.allegati { display: flex; flex-direction: column; gap: .25rem; margin: .4rem 0; }
.allegato { font-size: .87rem; display: inline-flex; gap: .5rem; flex-wrap: wrap; align-items: baseline; } .allegato a { font-size: .82rem; }
td .allegato { display: flex; }
.filtri { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; background: #fff; border: 1px solid var(--bordo); border-radius: var(--raggio); padding: .8rem; margin-bottom: 1rem; }
.filtri label { min-width: 150px; } .filtri .azioni { margin-left: auto; }
.schede-vista { display: flex; border: 1px solid var(--bordo); border-radius: 8px; overflow: hidden; }
.schede-vista a { padding: .4rem .9rem; text-decoration: none; color: var(--testo); background: #fff; } .schede-vista a.attivo { background: var(--blu); color: #fff; }
.nav-mese { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: .6rem; } .nav-mese h2 { margin: 0; min-width: 200px; text-align: center; }
.calendario { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-intest { text-align: center; font-size: .8rem; color: var(--grigio); font-weight: 600; padding: .3rem 0; }
.cal-giorno { background: #fff; border: 1px solid var(--bordo); border-radius: 6px; min-height: 92px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-giorno.vuoto { background: transparent; border-color: transparent; } .cal-giorno.oggi { border: 2px solid var(--blu); }
.cal-num { font-size: .8rem; color: var(--grigio); font-weight: 600; }
.cal-voce { font-size: .72rem; line-height: 1.2; padding: 2px 4px; border-radius: 4px; text-decoration: none; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-voce.rosso { background: var(--rosso); } .cal-voce.giallo { background: var(--giallo); color: #3d2b00; } .cal-voce.verde { background: var(--verde); }
.modulo { display: flex; flex-direction: column; gap: .75rem; max-width: 640px; }
.due-colonne { display: grid; grid-template-columns: 1fr 260px; gap: 1rem; align-items: start; } .qr svg { width: 100%; height: auto; background: #fff; }
code, .chiave { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--sfondo); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
.codici { display: grid; grid-template-columns: repeat(2, max-content); gap: .4rem 1.2rem; margin: .8rem 0; font-size: 1.1rem; }
input.corto { width: 6rem; display: inline-block; }
@media (max-width: 900px) {
  .griglia-2, .due-colonne { grid-template-columns: 1fr; } .semafori { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .menu-btn { display: block; } .laterale { position: fixed; top: 48px; left: 0; bottom: 0; z-index: 15; transform: translateX(-100%); transition: transform .2s; box-shadow: 2px 0 12px rgba(0,0,0,.1); overflow-y: auto; }
  .laterale.aperto { transform: none; } .principale { padding: .9rem; } .barra .chi { display: none; }
  .dati { grid-template-columns: 1fr; } .dati dt { margin-top: .3rem; } .filtri label { min-width: 0; flex: 1 1 45%; } .filtri .azioni { margin-left: 0; }
  .cal-giorno { min-height: 64px; } .cal-voce { font-size: 0; height: 8px; padding: 0; } .ls-data { width: 95px; }
  .grafico { height: 380px; }
}
