:root {
  --ink: #0f2137; --ink-2: #1c3350; --text: #1e293b; --muted: #5b6b80; --line: #dde3ec; --line-2: #c9d2df;
  --bg: #f4f6f9; --card: #ffffff; --soft: #eef2f7; --accent: #b7791f; --accent-soft: #fdf3e0; --link: #1d4ed8;
  --ok: #17694a; --ok-bg: #e4f4ec; --err: #a3212e; --err-bg: #fbe9eb; --warn: #8a5a00; --warn-bg: #fdf3d8;
  --critical: #7a1232; --high: #c8371f; --medium: #d98a00; --low: #2c7a7b; --info: #64748b;
  --radius: 8px; --shadow: 0 1px 2px rgba(15, 33, 55, .06), 0 1px 3px rgba(15, 33, 55, .05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; line-height: 1.2; margin: 0; color: var(--ink); letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; color: var(--ink); }
h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 1.2rem 0 .4rem; font-weight: 600; }
p { margin: 0 0 .7rem; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 10; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 3px; }

/* struttura */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #c8d3e0; display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.15rem; padding: 4px 8px 18px; letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.mark { width: 30px; height: 30px; border-radius: 7px; background: #e2a03f; color: var(--ink); display: grid; place-items: center; font-weight: 800; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: #c8d3e0; padding: 8px 10px; border-radius: 6px; font-weight: 500; font-size: .95rem; }
.side nav a:hover { background: var(--ink-2); text-decoration: none; color: #fff; }
.side nav a.on { background: var(--ink-2); color: #fff; box-shadow: inset 3px 0 0 #e2a03f; }
.side .sep { margin: 14px 10px 6px; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #7f93ab; }
.side-foot { margin-top: auto; border-top: 1px solid #2a4260; padding: 12px 8px 0; font-size: .85rem; }
.side-foot strong { color: #fff; display: block; } .side-foot a { color: #c8d3e0; }
.side-foot form { margin-top: 8px; }
.linkbtn { background: none; border: 0; padding: 0; color: #c8d3e0; cursor: pointer; font: inherit; text-decoration: underline; }
.vendor { font-size: .74rem; color: #7f93ab; padding: 12px 8px 0; line-height: 1.5; } .vendor a { color: #c8d3e0; }
.vendor img { display: block; height: 54px; width: auto; margin-bottom: 8px; background: #fff; padding: 6px 9px; border-radius: 6px; }
.auth-col { width: 100%; max-width: 420px; }
.auth .vendor { text-align: center; color: #9fb3c8; padding: 22px 0 0; font-size: .82rem; } .auth .vendor a { color: #fff; }
.auth .vendor img { margin: 0 auto 10px; height: 74px; background: #fff; padding: 8px 12px; border-radius: 8px; }
.logo-preview { background: var(--ink); padding: 8px 12px; border-radius: 6px; }
main { padding: 26px 34px 60px; max-width: 1240px; width: 100%; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head .sub { color: var(--muted); margin-top: 4px; font-size: .93rem; }
.crumb { font-size: .85rem; color: var(--muted); margin-bottom: 6px; } .crumb a { color: var(--muted); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* componenti */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; } .card.flush > h2 { padding: 16px 20px 0; }
.grid { display: grid; gap: 18px; } .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.g-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .n { font-size: 1.7rem; font-weight: 700; color: var(--ink); line-height: 1.1; } .stat .l { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); padding: 7px 13px; border-radius: 6px; font: 600 .9rem var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; } .btn.primary:hover { background: var(--ink-2); }
.btn.danger { color: var(--err); border-color: #e6b9be; } .btn.danger:hover { background: var(--err-bg); }
.btn.small { padding: 4px 9px; font-size: .82rem; } .btn.ok { color: var(--ok); border-color: #b5dcc8; } .btn.ok:hover { background: var(--ok-bg); }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-weight: 500; border: 1px solid; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: #b5dcc8; } .flash.err { background: var(--err-bg); color: var(--err); border-color: #e6b9be; }
.notice { padding: 12px 14px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); border: 1px solid #ecd9a0; margin-bottom: 16px; }
.notice strong { color: #6b4500; } .notice.info { background: #eaf1fb; color: #24456f; border-color: #c5d6ee; } .notice.good { background: var(--ok-bg); color: var(--ok); border-color: #b5dcc8; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .mono { font-family: var(--mono); font-size: .82rem; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); } .empty strong { display: block; color: var(--ink); font-size: 1.02rem; margin-bottom: 4px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--soft); color: var(--ink-2); white-space: nowrap; }
.chip.st-draft { background: #e9edf3; color: #4a5a70; } .chip.st-authorized { background: #e3ecfb; color: #1e4a8f; } .chip.st-in_progress { background: var(--accent-soft); color: #7a4d00; }
.chip.st-reporting { background: #efe7fb; color: #55329a; } .chip.st-delivered { background: var(--ok-bg); color: var(--ok); } .chip.st-retest { background: #e0f2f3; color: #1d5c5d; } .chip.st-closed { background: #e9edf3; color: #4a5a70; }
.chip.to_verify { background: var(--warn-bg); color: var(--warn); } .chip.confirmed { background: var(--ok-bg); color: var(--ok); } .chip.false_positive { background: #e9edf3; color: #4a5a70; }
.chip.fixed { background: var(--ok-bg); color: var(--ok); } .chip.open, .chip.not_fixed { background: var(--err-bg); color: var(--err); } .chip.partial { background: var(--warn-bg); color: var(--warn); }
.sev { display: inline-block; min-width: 86px; text-align: center; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: #fff; }
.sev-critical { background: var(--critical); } .sev-high { background: var(--high); } .sev-medium { background: var(--medium); } .sev-low { background: var(--low); } .sev-info { background: var(--info); }
.bar-critical { fill: var(--critical); } .bar-high { fill: var(--high); } .bar-medium { fill: var(--medium); } .bar-low { fill: var(--low); } .bar-info { fill: var(--info); }
.chart { width: 100%; max-width: 460px; height: auto; display: block; } .chart text { font: 13px var(--font); fill: var(--text); } .chart .v { font-weight: 700; }

/* tabelle */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfd; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; } tbody tr:hover { background: #fafbfd; }
td .t { font-weight: 600; color: var(--ink); } td form { display: inline; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; margin: 0; } .kv dt { color: var(--muted); font-size: .88rem; } .kv dd { margin: 0; }

/* moduli */
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 4px; color: var(--ink); }
.field { margin-bottom: 14px; } .hint { font-size: .8rem; color: var(--muted); margin-top: 3px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 6px; font: inherit; color: var(--text); background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9db7ef; outline-offset: 0; border-color: var(--link); }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; } textarea.code { font-family: var(--mono); font-size: .85rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; } .row.r3 { grid-template-columns: 1fr 1fr 1fr; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .inline input, .inline select { width: auto; }
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; } .filters input[type=search] { max-width: 300px; } .filters select { width: auto; }
.formfoot { display: flex; gap: 8px; align-items: center; padding-top: 6px; }

/* schede e fasi */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; } .tabs a.on { color: var(--ink); border-bottom-color: #e2a03f; }
.tabs .cnt { background: var(--soft); border-radius: 999px; padding: 0 7px; font-size: .78rem; margin-left: 4px; } .tabs .cnt.hot { background: var(--warn-bg); color: var(--warn); }
.steps { display: flex; list-style: none; padding: 0; margin: 0 0 18px; gap: 4px; }
.steps li { flex: 1; padding: 8px 10px; background: #e6ebf2; color: var(--muted); font-size: .8rem; font-weight: 600; text-align: center; border-radius: 4px; }
.steps li.done { background: #cfdcea; color: var(--ink-2); } .steps li.now { background: var(--ink); color: #fff; }
.pills { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.pills a { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: .85rem; font-weight: 600; background: #fff; }
.pills a.on { background: var(--ink); color: #fff; border-color: var(--ink); } .pills a:hover { text-decoration: none; }
.checklist { list-style: none; padding: 0; margin: 0; } .checklist li { padding: 6px 0 6px 26px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 12px; height: 12px; border-radius: 50%; background: var(--medium); }
.checklist li.ok::before { background: #2f9e6e; } .checklist li.bad::before { background: var(--high); }

/* CVSS */
.cvss-score { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cvss-score .num { font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1; min-width: 58px; }
.metric { margin-bottom: 9px; } .metric .name { font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.seg { display: flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg label { flex: 1; margin: 0; text-align: center; padding: 5px 4px; font-size: .78rem; font-weight: 600; cursor: pointer; background: #fff; border-right: 1px solid var(--line-2); color: var(--ink-2); }
.seg label:last-child { border-right: 0; } .seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--ink); color: #fff; } .seg label:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: -2px; }

/* contenuti */
.prose { overflow-wrap: anywhere; } .prose pre { background: var(--soft); padding: 10px 12px; border-radius: 6px; overflow-x: auto; font: .82rem/1.45 var(--mono); }
.prose code { font-family: var(--mono); font-size: .85em; background: var(--soft); padding: 1px 4px; border-radius: 3px; } .prose pre code { background: none; padding: 0; }
.prose table { margin-bottom: .7rem; } .prose td, .prose th { border: 1px solid var(--line); padding: 5px 9px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.shot { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.shot img { width: 100%; height: 130px; object-fit: cover; display: block; background: var(--soft); } .shot .cap { padding: 7px 9px; font-size: .82rem; display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pick a { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; color: var(--text); }
.pick a:hover { border-color: var(--ink); text-decoration: none; box-shadow: var(--shadow); } .pick .t { font-weight: 600; color: var(--ink); margin: 5px 0 2px; }
.danger-zone { border-color: #e6b9be; }
dialog { border: 0; border-radius: 10px; padding: 22px; max-width: 420px; box-shadow: 0 20px 50px rgba(15, 33, 55, .3); } dialog::backdrop { background: rgba(15, 33, 55, .45); }
dialog p { font-size: 1rem; color: var(--ink); font-weight: 500; } dialog .formfoot { justify-content: flex-end; }

/* accesso */
.auth { min-height: 100vh; display: grid; place-items: center; background: var(--ink); padding: 20px; }
.auth .box { background: #fff; border-radius: 12px; padding: 30px 32px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.auth .brand { color: var(--ink); padding: 0 0 6px; font-size: 1.35rem; } .auth .lead { color: var(--muted); margin-bottom: 20px; }
.auth .btn { width: 100%; justify-content: center; padding: 10px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; gap: 6px; }
  .brand { padding: 0 8px; } .side nav { flex-direction: row; flex-wrap: wrap; } .side .sep, .side .vendor { display: none; } .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; gap: 10px; align-items: center; } .side-foot form { margin: 0; }
  main { padding: 18px 14px 40px; } .g2, .g3, .g4, .g-main, .row, .row.r3 { grid-template-columns: 1fr; } .steps { flex-wrap: wrap; } .steps li { flex: 1 1 30%; }
  .card.flush { overflow-x: auto; } .kv { grid-template-columns: 1fr; gap: 0 0; } .kv dd { margin-bottom: 8px; }
}
@media print { .side, .actions, .tabs { display: none; } .shell { display: block; } }

/* "In parole semplici": testo per il cliente non tecnico, sopra al dettaglio tecnico */
.card.plain { border-left: 4px solid var(--accent); background: var(--accent-soft); }
.plain-k { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--warn); margin-bottom: 6px; }
.plain-t { margin: 0; font-size: 1.05rem; line-height: 1.65; color: var(--text); max-width: 75ch; }
