:root {
    --sfondo: #f6f7f9; --carta: #fff; --testo: #1c2330; --tenue: #5b6575; --bordo: #d9dde4;
    --primario: #1d5fd1; --si: #1b7a3e; --si-sfondo: #e3f4e9; --no: #b3261e; --no-sfondo: #fbe7e5;
}
@media (prefers-color-scheme: dark) {
    :root {
        --sfondo: #12161c; --carta: #1b212a; --testo: #e8ecf2; --tenue: #9aa5b5; --bordo: #323b49;
        --primario: #6aa3ff; --si: #6fd394; --si-sfondo: #17331f; --no: #ff8f87; --no-sfondo: #3b1b19;
    }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, sans-serif; background: var(--sfondo); color: var(--testo); }
header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1rem; background: var(--carta); border-bottom: 1px solid var(--bordo); }
header nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.marchio { font-weight: 700; text-decoration: none; color: var(--testo); }
main { max-width: 60rem; margin: 0 auto; padding: 1rem; }
a { color: var(--primario); }
h1 { font-size: 1.4rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
h2.fermata { margin-top: 1.25rem; color: var(--tenue); }
.scheda { background: var(--carta); border: 1px solid var(--bordo); border-radius: .5rem; padding: .75rem 1rem; margin-bottom: .75rem; }
.scheda.escluso { border-left: 4px solid var(--no); }
.voce { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .4rem 0; }
.voce > span:first-child { min-width: 5rem; color: var(--tenue); }
.nota { color: var(--tenue); font-size: .9rem; margin: .25rem 0; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 1rem; font-size: .85rem; font-weight: 600; }
.badge.si { color: var(--si); background: var(--si-sfondo); }
.badge.no { color: var(--no); background: var(--no-sfondo); }
.azione { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .25rem 0; }
.filtri { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-bottom: 1rem; }
.modulo { background: var(--carta); border: 1px solid var(--bordo); border-radius: .5rem; padding: 1rem; margin-bottom: 1rem; display: grid; gap: .75rem; max-width: 36rem; }
label { display: grid; gap: .25rem; font-size: .9rem; }
label.inline { display: flex; gap: .4rem; align-items: center; }
fieldset { border: 1px solid var(--bordo); border-radius: .4rem; display: flex; flex-wrap: wrap; gap: .75rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], select, textarea {
    font: inherit; padding: .5rem; border: 1px solid var(--bordo); border-radius: .4rem; background: var(--carta); color: var(--testo); min-height: 2.5rem;
}
button { font: inherit; padding: .5rem .9rem; min-height: 2.5rem; border: 0; border-radius: .4rem; background: var(--primario); color: #fff; cursor: pointer; }
@media (prefers-color-scheme: dark) { button { color: #0b1220; } }
button.link { background: none; color: var(--primario); padding: 0; text-decoration: underline; }
.avviso { padding: .6rem .9rem; border-radius: .4rem; margin: 0 0 1rem; }
.avviso.ok { color: var(--si); background: var(--si-sfondo); }
.avviso.ko { color: var(--no); background: var(--no-sfondo); }
.sottomenu { display: flex; gap: 1rem; margin-bottom: .5rem; }
.colonne { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.elenco { padding-left: 1.2rem; }
.tabella { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--carta); }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--bordo); vertical-align: top; }
th { font-size: .85rem; color: var(--tenue); }
@media (max-width: 40rem) {
    table, thead, tbody, tr, td { display: block; }
    thead { display: none; }
    tr { border: 1px solid var(--bordo); border-radius: .5rem; margin-bottom: .75rem; padding: .25rem 0; }
    td { border: 0; padding: .2rem .75rem; }
    td[data-l]::before { content: attr(data-l) ": "; color: var(--tenue); font-size: .85rem; }
}
button.chip { padding: .15rem .65rem; min-height: 2rem; border-radius: 1rem; font-size: .85rem; font-weight: 600; border: 1px solid transparent; }
button.chip.si { color: var(--si); background: var(--si-sfondo); }
button.chip.no { color: var(--no); background: var(--no-sfondo); }
button.chip:hover { border-color: currentColor; }
.motivo { max-width: 36rem; margin-bottom: .25rem; }
td small { color: var(--tenue); }
