* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; margin: 0; background: #f4f5f7; color: #1d1d1f; }
.wrap { max-width: 820px; margin: 0 auto; padding: 16px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px 16px; font-weight: 600; }
.topbar a { color: #555; text-decoration: none; font-weight: 400; }
.card { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.login { max-width: 360px; margin: 12vh auto; text-align: center; }
label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
input, textarea { width: 100%; padding: 10px; margin-top: 6px; border: 1px solid #ccd; border-radius: 8px; font: inherit; font-weight: 400; }
button, .btn { background: #2563eb; color: #fff; border: 0; border-radius: 8px; padding: 11px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: #1d4ed8; }
.err { color: #b91c1c; font-weight: 600; }
.ok { color: #15803d; font-weight: 600; }
table { width: 100%; border-collapse: collapse; margin: 8px 0; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #eee; }
.r { text-align: right; }
tfoot th { border-top: 2px solid #333; border-bottom: 0; font-size: 1.05em; }
.box { background: #f8f9fb; border-radius: 8px; padding: 12px 14px; margin-top: 12px; font-size: 14px; }
.box ul { margin: 6px 0 0; padding-left: 18px; }
.ris-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.esito { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: 14px; }
.esito button { padding: 7px 14px; }
.ghost { background: #fff; color: #b91c1c; border: 1px solid #e2c4c4; }
.ghost:hover { background: #fef2f2; }
.storico a, .wrap a { color: #2563eb; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hint { color: #666; font-size: 13px; margin: 0 0 8px; }
.layout { list-style: none; margin: 0 0 14px; padding: 0; }
.layout li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 6px; background: #f8f9fb; border: 1px solid #e6e8ee; border-radius: 8px; cursor: grab; }
.layout li.dragging { opacity: .5; }
.layout .grip { color: #9aa; cursor: grab; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; }
label.inline input { width: auto; margin: 0; }

/* Vista stampa / PDF */
.print { background: #fff; max-width: 720px; margin: 0 auto; padding: 32px; }
.intestazione { display: flex; gap: 16px; align-items: center; border-bottom: 2px solid #333; padding-bottom: 12px; margin-bottom: 8px; }
.logo { max-height: 64px; }
.data { color: #666; }
@media print {
    body.print { padding: 0; }
    .btn, .topbar { display: none; }
}
