/* Stile semplice, leggibile, nessuna dipendenza esterna */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; background: #f5f6f8; color: #222; line-height: 1.5; }

header.topbar {
    background: #1a2d4a;
    color: white;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
header.topbar .brand { font-weight: 600; font-size: 1.1rem; letter-spacing: 0.2px; }
header.topbar .brand a { color: white; text-decoration: none; }
header.topbar nav a {
    color: #c5d5ef;
    text-decoration: none;
    margin-left: 18px;
    font-size: 0.95rem;
}
header.topbar nav a:hover, header.topbar nav a.active { color: white; }
header.topbar .user { font-size: 0.9rem; color: #c5d5ef; }
header.topbar .user a { color: white; margin-left: 12px; text-decoration: none; font-size: 0.85rem; }

main.container { max-width: 1100px; margin: 24px auto; padding: 0 20px; }

.card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}
.card h1 { margin-top: 0; font-size: 1.3rem; color: #1a2d4a; }
.card h2 { font-size: 1.05rem; margin-top: 28px; margin-bottom: 10px; color: #1a2d4a; }

.card-login {
    max-width: 400px;
    margin: 80px auto;
}
.card-login h1 { text-align: center; margin-bottom: 24px; }

label { display: block; font-size: 0.9rem; color: #555; margin-bottom: 4px; margin-top: 14px; font-weight: 500; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd4db;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #3c71c7; outline-offset: -1px; border-color: #3c71c7; }

button, .btn {
    display: inline-block;
    background: #1a2d4a;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
button:hover, .btn:hover { background: #263f66; }
button.secondary, .btn.secondary { background: #e8edf4; color: #1a2d4a; }
button.secondary:hover, .btn.secondary:hover { background: #d5deec; }
button.danger, .btn.danger { background: #c13a3a; }
button.danger:hover, .btn.danger:hover { background: #a82e2e; }
button.small, .btn.small { padding: 5px 10px; font-size: 0.85rem; }

.btn-block { display: block; width: 100%; margin-top: 20px; }

.flash { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.flash.error { background: #fde5e5; color: #8b1a1a; border: 1px solid #f4b2b2; }
.flash.success { background: #e0f4e0; color: #1a6f2a; border: 1px solid #9adba0; }
.flash.info { background: #e0ecf9; color: #1a3d6f; border: 1px solid #a3c3e8; }

table { width: 100%; border-collapse: collapse; margin-top: 12px; }
table th, table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eee; }
table th { background: #f8f9fb; font-weight: 600; font-size: 0.88rem; color: #555; }
table tr:hover td { background: #fafbfc; }
table .num { text-align: right; }

.search-box { display: flex; gap: 8px; margin-bottom: 16px; }
.search-box input { flex: 1; }

.stato { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.8rem; font-weight: 500; }
.stato-in_attesa_ricevimento { background: #ffe4c2; color: #8b4d00; }
.stato-pending { background: #fef3c7; color: #8b6100; }
.stato-in_progress { background: #e0ecf9; color: #1a3d6f; }
.stato-completato { background: #e0f4e0; color: #1a6f2a; }
.stato-errore { background: #fde5e5; color: #8b1a1a; }
.stato-esterno { background: #ece0f4; color: #5d3580; }
.stato-bozza { background: #f0f0f0; color: #666; }

.muted { color: #888; font-size: 0.88rem; }
.right { text-align: right; }
.center { text-align: center; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stats .stat { background: white; padding: 16px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.stats .stat .label { font-size: 0.82rem; color: #888; text-transform: uppercase; letter-spacing: 0.3px; }
.stats .stat .value { font-size: 1.6rem; font-weight: 600; color: #1a2d4a; margin-top: 4px; }

footer { text-align: center; padding: 24px; color: #888; font-size: 0.85rem; }

@media (max-width: 640px) {
    header.topbar { flex-direction: column; gap: 8px; padding: 12px 16px; }
    header.topbar nav a { margin-left: 0; margin-right: 14px; }
    main.container { padding: 0 12px; }
}
