* { box-sizing: border-box; margin: 0; }
body { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: #f2f4f7; color: #1a2733; font-size: 14px; }

header { background: #123c63; color: #fff; padding: 14px 24px; display: flex; align-items: baseline; gap: 14px; }
header h1 { font-size: 19px; font-weight: 600; }
header .sub { opacity: .75; font-size: 13px; }

nav#tabs { background: #0e3050; padding: 0 24px; display: flex; gap: 4px; }
nav#tabs button { background: none; border: none; color: #bcd0e2; padding: 11px 18px; font-size: 14px; cursor: pointer; border-bottom: 3px solid transparent; }
nav#tabs button:hover { color: #fff; }
nav#tabs button.attivo { color: #fff; border-bottom-color: #f5a623; font-weight: 600; }

main { padding: 20px 24px; max-width: 1280px; margin: 0 auto; }
.tab { display: none; }
.tab.attivo { display: block; }

.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(16,42,67,.12); padding: 16px 18px; margin-bottom: 16px; overflow-x: auto; }
.card h2 { font-size: 15px; margin-bottom: 12px; color: #123c63; }

.riga-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.riga-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #55677a; }
.riga-form label.check { flex-direction: row; align-items: center; }
input, select { padding: 6px 8px; border: 1px solid #c4cfda; border-radius: 5px; font-size: 13px; }

button { padding: 7px 14px; border: 1px solid #c4cfda; border-radius: 5px; background: #fff; cursor: pointer; font-size: 13px; }
button:hover { background: #eef2f6; }
button.primario { background: #1665a7; border-color: #1665a7; color: #fff; font-weight: 600; }
button.primario:hover { background: #12558d; }
button.primario:disabled { background: #9db8cc; border-color: #9db8cc; cursor: not-allowed; }
button.pericolo { background: #fff; border-color: #c0392b; color: #c0392b; }
button.pericolo:hover { background: #fdf0ee; }
button.mini { padding: 3px 9px; font-size: 12px; }

.stato { font-size: 13px; color: #55677a; }
.stato.errore { color: #c0392b; font-weight: 600; }
.stato.ok { color: #1e7a3c; font-weight: 600; }

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { padding: 7px 9px; text-align: left; border-bottom: 1px solid #e4e9ee; }
th { background: #f0f4f8; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: #43566a; position: sticky; top: 0; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #f6f9fc; }
tr.riga-modificata { background: #fff8e1; }
tr.riga-modificata:hover { background: #fdf2cc; }
tr.riga-esclusa { color: #98a4b0; text-decoration: line-through; }
tr.riga-totale { font-weight: 700; background: #eef4fa; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge.mod { background: #f5a623; color: #fff; }
.badge.esc { background: #7d8a97; color: #fff; }
.badge.rett1 { background: #d35400; color: #fff; }
.badge.rett2 { background: #8e44ad; color: #fff; }

h3.sezione { margin: 18px 0 8px; color: #123c63; font-size: 15px; }

dialog { border: none; border-radius: 10px; box-shadow: 0 8px 40px rgba(0,0,0,.25); padding: 20px 22px; width: 620px; max-width: 92vw; }
dialog::backdrop { background: rgba(10,30,50,.45); }
dialog h3 { color: #123c63; margin-bottom: 6px; }
dialog .nota { font-size: 12px; color: #7d8a97; margin-bottom: 12px; }
.griglia-modale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.griglia-modale label, label.blocco { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #55677a; }
label.blocco { margin-bottom: 12px; }
.originali { font-size: 12px; background: #f0f4f8; border-radius: 6px; padding: 8px 10px; margin-bottom: 14px; color: #43566a; }
.azioni-modale { display: flex; gap: 8px; flex-wrap: wrap; }
