:root{--blu:#1f4e79;--blu2:#2e6da4;--grigio:#f3f5f8;--bordo:#d9dee6;--testo:#1d2733;--rosso:#c0392b;--verde:#2e8b57;--arancio:#d98324}
*{box-sizing:border-box}
body{margin:0;font-family:Segoe UI,Arial,sans-serif;background:var(--grigio);color:var(--testo);font-size:15px}
header.top{background:var(--blu);color:#fff;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;padding:10px 20px}
header.top .brand{font-weight:600;font-size:18px}
header.top a{color:#fff;text-decoration:none;margin-left:16px;opacity:.9}
header.top a:hover{opacity:1;text-decoration:underline}
main{max-width:1100px;margin:24px auto;padding:0 16px}
.card{background:#fff;border:1px solid var(--bordo);border-radius:8px;padding:20px;margin-bottom:20px}
h1{font-size:22px;margin:0 0 16px}h2{font-size:17px;margin:0 0 12px}
label{display:block;font-weight:600;margin:12px 0 4px}
input[type=text],input[type=password],input[type=email],select,textarea{width:100%;padding:8px 10px;border:1px solid var(--bordo);border-radius:6px;font:inherit;background:#fff}
textarea{min-height:90px}
.row{display:grid;grid-template-columns:1fr 1fr;gap:0 20px}
@media(max-width:700px){.row{grid-template-columns:1fr}}
.btn{display:inline-block;background:var(--blu2);color:#fff;border:0;border-radius:6px;padding:9px 18px;font:inherit;cursor:pointer;text-decoration:none}
.btn:hover{background:var(--blu)}
.btn.sec{background:#fff;color:var(--blu);border:1px solid var(--blu2)}
.btn.ok{background:var(--verde)}.btn.ko{background:var(--rosso)}
.btn.small{padding:4px 10px;font-size:13px}
table.grid{width:100%;border-collapse:collapse}
table.grid th{text-align:left;background:var(--grigio);padding:8px;border-bottom:2px solid var(--bordo);font-size:13px}
table.grid td{padding:8px;border-bottom:1px solid var(--bordo);vertical-align:top}
table.grid tr.pri-urgente td:first-child{border-left:4px solid var(--rosso)}
.badge{display:inline-block;padding:2px 9px;border-radius:12px;font-size:12px;font-weight:600;background:#e6e9ee}
.st-aperto{background:#fde8c8;color:#8a5200}
.st-in-lavorazione{background:#d6e8fa;color:#1a4f86}
.st-preventivo-inviato{background:#e3dafa;color:#4b2f97}
.st-ordinato{background:#d5f0df;color:#1d6b3f}
.st-chiuso{background:#e6e9ee;color:#555}
.pri-urgente-b{background:var(--rosso);color:#fff}
.pri-normale-b{background:#e6e9ee;color:#444}
.msg{padding:10px 14px;border-radius:6px;margin-bottom:14px}
.msg.err{background:#fdecea;color:#8c1d12;border:1px solid #f3b9b2}
.msg.okk{background:#e6f5ec;color:#1d6b3f;border:1px solid #b5dfc7}
.kpi{display:flex;gap:14px;flex-wrap:wrap;margin-bottom:20px}
.kpi div{flex:1;min-width:150px;background:#fff;border:1px solid var(--bordo);border-radius:8px;padding:14px}
.kpi b{display:block;font-size:26px}
.filters{display:flex;gap:12px;flex-wrap:wrap;align-items:end}
.filters>div{flex:1;min-width:170px}
.muted{color:#6b7785;font-size:13px}
.val{color:var(--rosso);font-size:13px}
dl.det{display:grid;grid-template-columns:200px 1fr;gap:8px 16px;margin:0}
dl.det dt{font-weight:600;color:#4a5663}dl.det dd{margin:0}
@media(max-width:700px){dl.det{grid-template-columns:1fr}}
.narrow{max-width:460px;margin:40px auto}
