body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f5f7;
    margin: 0;
    color: #222;
}
header {
    background: #1b3a5c;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
header a { color: #fff; text-decoration: none; }
header .logout { font-size: 0.9em; opacity: 0.85; }
main {
    max-width: 960px;
    margin: 24px auto;
    background: #fff;
    padding: 24px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
h1, h2 { color: #1b3a5c; }
details.mese-dettaglio {
    margin-bottom: 12px;
}
details.mese-dettaglio > summary {
    cursor: pointer;
    color: #1b3a5c;
    font-size: 1.5em;
    font-weight: bold;
    padding: 10px 0;
    list-style: none;
    user-select: none;
}
details.mese-dettaglio > summary::-webkit-details-marker {
    display: none;
}
details.mese-dettaglio > summary::before {
    content: '\25B6';
    display: inline-block;
    margin-right: 10px;
    font-size: 0.7em;
    transition: transform 0.15s;
    vertical-align: middle;
}
details.mese-dettaglio[open] > summary::before {
    transform: rotate(90deg);
}
table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 24px;
}
.tabella-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tabella-scroll > table {
    margin: 0;
}
th, td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    font-size: 0.95em;
}
th { background: #eef1f5; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85em;
    color: #fff;
}
.badge-in_attesa { background: #b8860b; }
.badge-approvata { background: #2e7d32; }
.badge-rifiutata { background: #c62828; }
.box-saldo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.saldo-mini {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 2px 8px;
    background: #eef1f5;
    border-radius: 6px;
    padding: 8px 12px;
}
.saldo-etichetta { font-size: 0.85em; color: #555; }
.saldo-numero { font-size: 1.15em; font-weight: bold; color: #1b3a5c; }
.saldo-su { font-size: 0.8em; color: #777; }
form.riquadro {
    background: #f9fafb;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 24px;
}
label { display: block; margin: 10px 0 4px; font-weight: bold; }
input[type=text], input[type=password], input[type=date], input[type=number], select {
    width: 100%;
    max-width: 320px;
    padding: 7px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
button, input[type=submit] {
    margin-top: 14px;
    background: #1b3a5c;
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}
button:hover, input[type=submit]:hover { background: #14304c; }
.msg-errore {
    background: #fdecea;
    border: 1px solid #f5c2c0;
    color: #8a1f1a;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
}
.msg-ok {
    background: #e8f5e9;
    border: 1px solid #b6ddb8;
    color: #1b5e20;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
}
.msg-nuove {
    background: #ffe0e0;
    border: 1px solid #f5b5b5;
    color: #8a1f1a;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-weight: bold;
}
.msg-comunicazione {
    background: #e6f1fb;
    border: 1px solid #b5d4f4;
    color: #0c447c;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}
tr.riga-nuova { background: #ffecec; }
.layout-due-colonne {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 24px;
}
.layout-due-colonne > * {
    flex: 1 1 320px;
    margin-bottom: 0;
}
.riepilogo-metriche {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.riepilogo-metriche .metrica {
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
}
.riepilogo-metriche .metrica .numero-grande {
    display: block;
    font-size: 1.6em;
    font-weight: bold;
}
.riepilogo-metriche .metrica .etichetta {
    font-size: 0.85em;
}
.metrica-nuove {
    background: #ffe0e0;
    color: #8a1f1a;
}
.metrica-attesa {
    background: #fff3b0;
    color: #6b5900;
}
.login-box {
    max-width: 340px;
    margin: 80px auto;
    background: #fff;
    padding: 28px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.azioni form { display: inline; }
.azioni button, .azioni a.btn-modifica {
    padding: 5px 10px;
    font-size: 0.85em;
    margin: 0 2px;
    display: inline-block;
    border-radius: 4px;
    text-decoration: none;
    vertical-align: middle;
}
.btn-approva { background: #2e7d32; }
.btn-rifiuta { background: #c62828; }
.btn-modifica { background: #f9a825; color: #fff; }
.btn-modifica:hover { background: #f57f17; }
