:root {
  --brand: #C92A24; --brand-d: #A9211C; --brand-50: #FCEFEE; --brand-100: #F7D9D7;
  --ink: #171B21; --ink-2: #48505A; --ink-3: #7B838D; --ink-4: #A9B0B8;
  --line: #E4E7EB; --line-2: #EEF0F3; --bg: #F4F5F7; --bg-2: #FAFAFB; --white: #fff;
  --blue: #2F6FDE; --blue-50: #EAF1FD; --green: #1F8A5B; --green-50: #E7F5EE; --amber: #A86A0B; --amber-50: #FCF3E2;
  --orange: #C2611A; --orange-50: #FCEEE3; --violet: #6B4FD8; --violet-50: #F0ECFD; --teal: #0E8A94; --teal-50: #E3F4F5; --red: #C92A24; --red-50: #FCEFEE;
  --r: 10px; --r-s: 6px;
  --top: 56px; --side: 228px;
  --sh: 0 1px 2px rgba(16, 24, 40, .04);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 13.5px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 600; }
.ic { flex: none; display: block; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.r { text-align: right !important; justify-content: flex-end; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

/* ---------- Shell ---------- */
.top { position: fixed; inset: 0 0 auto 0; height: var(--top); background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 20px; z-index: 30; }
.brand { width: calc(var(--side) - 20px); display: flex; align-items: center; }
.brand img { height: 24px; display: block; }
.app-name { color: var(--ink-2); font-weight: 500; padding-left: 20px; border-left: 1px solid var(--line); height: 24px; display: flex; align-items: center; }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 16px; position: relative; }
.persona { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 8px; cursor: pointer; color: var(--ink-3); }
.persona:hover { background: var(--bg); }
.persona-t { display: flex; flex-direction: column; line-height: 1.2; }
.persona-t b { color: var(--ink); font-weight: 600; font-size: 13px; }
.persona-t span { font-size: 12px; }
.menu { position: absolute; right: 0; top: 50px; width: 280px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(16, 24, 40, .12); padding: 6px; display: none; }
.menu.open { display: block; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--bg); }
.menu button div { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.menu button span { font-size: 12px; color: var(--ink-3); }
.menu button .ic { color: var(--brand); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--line-2); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.brand { background: var(--brand); color: #fff; }
.call { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 6px 0 12px; border-radius: 8px; background: var(--green-50); color: var(--green); font-size: 13px; }
.call b { color: var(--ink); font-weight: 600; }
.call.on { padding: 0 12px; }
.call-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 138, 91, .5); } 100% { box-shadow: 0 0 0 8px rgba(31, 138, 91, 0); } }

.side { position: fixed; top: var(--top); left: 0; bottom: 0; width: var(--side); background: var(--white); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; z-index: 20; }
.side a { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.side a:hover { background: var(--bg); color: var(--ink); }
.side a.on { background: var(--brand-50); color: var(--brand); }
.side a em { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 600; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--line-2); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; }
.side a.on em { background: var(--brand); color: #fff; }
.side-foot { margin-top: auto; padding: 12px; font-size: 11.5px; color: var(--ink-4); line-height: 1.5; }
.main { margin-left: var(--side); padding: calc(var(--top) + 24px) 28px 48px; min-width: 1180px; }

/* ---------- Page ---------- */
.page-h { display: flex; align-items: center; gap: 16px; height: 40px; margin-bottom: 20px; }
.page-h .muted { margin-top: 4px; }
.page-h .actions { margin-left: auto; display: flex; gap: 8px; }
.page-h .call { margin-left: auto; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; height: 88px; display: flex; flex-direction: column; justify-content: space-between; }
.kpi-l { color: var(--ink-3); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.kpi b { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.t-blue { background: var(--blue); } .dot.t-grey { background: var(--ink-4); } .dot.t-violet { background: var(--violet); } .dot.t-green { background: var(--green); } .dot.t-amber { background: #E0A12B; }

/* ---------- Card ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); min-width: 0; }
.card-h { height: 52px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); flex: none; }
.card-h .muted { font-size: 12.5px; }
.card-b { padding: 16px 18px; }
.card-b.flush { padding: 0; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: none; }
.card-f > .muted:first-child { margin-right: auto; font-size: 12.5px; }
.col-card { display: flex; flex-direction: column; min-height: 0; }
.col-card .scroll, .grow .scroll { flex: 1; overflow: auto; min-height: 0; }
.col-stack { display: flex; flex-direction: column; gap: 16px; min-height: 0; min-width: 0; }
.grow { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sticky { position: sticky; top: calc(var(--top) + 16px); }
.sec-t { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 4px 0 8px; }
.sec-t:not(:first-child) { margin-top: 20px; }
.empty { padding: 40px; text-align: center; color: var(--ink-3); }

/* ---------- Grids ---------- */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.g2.tight { gap: 24px; }
.g3 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 320px; gap: 16px; height: calc(100vh - var(--top) - 226px); min-height: 600px; }
.g3 > .card, .g3 > .col-stack { min-height: 0; }
.g-side { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 16px; align-items: start; }
.g-side-l { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; align-items: start; }
.g-offer { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; height: calc(100vh - var(--top) - 226px); min-height: 640px; }
.g-offer > .card { display: flex; flex-direction: column; min-height: 0; }
.g-kb { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 16px; height: calc(100vh - var(--top) - 108px); min-height: 560px; }
.g-cat { display: grid; grid-template-columns: 292px minmax(0, 1fr); gap: 16px; align-items: start; }

/* ---------- Buttons & form ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--white); font-weight: 550; cursor: pointer; white-space: nowrap; color: var(--ink); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.link { border: 0; background: none; color: var(--brand); font-weight: 550; cursor: pointer; padding: 0; }
.icon-btn { width: 30px; height: 30px; border-radius: 6px; border: 0; background: none; color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn.ghost { pointer-events: none; }
input, select, textarea { border: 1px solid var(--line); border-radius: 7px; background: var(--white); height: 36px; padding: 0 10px; outline: none; width: 100%; }
textarea { height: auto; padding: 10px 12px; line-height: 1.55; resize: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 111, 222, .12); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg-2); color: var(--ink-2); }
.seg { display: inline-flex; background: var(--line-2); border-radius: 8px; padding: 3px; gap: 2px; }
.seg a, .seg button { height: 28px; padding: 0 12px; border-radius: 6px; display: inline-flex; align-items: center; color: var(--ink-2); font-weight: 500; border: 0; background: none; cursor: pointer; font-size: 12.5px; }
.seg .on { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg.wide { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
.seg.wide button { justify-content: center; height: 30px; }
.search { position: relative; display: flex; align-items: center; width: 100%; max-width: 340px; color: var(--ink-3); }
.search .ic { position: absolute; left: 10px; }
.search input { padding-left: 32px; height: 34px; }
.card-h .search { max-width: 340px; }
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fld label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; display: flex; gap: 4px; }
.fld label i, .prow label i { color: var(--brand); font-style: normal; }
.fld label span { color: var(--ink-4); margin-left: auto; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
.bar-f { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 8px; }
.switch { position: relative; display: inline-block; width: 34px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 10px; transition: .15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { left: 16px; }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 550; white-space: nowrap; }
.b-fixed { width: 148px; }
.tbl td .b-fixed { max-width: 100%; }
.t-grey { background: var(--line-2); color: var(--ink-2); }
.t-blue { background: var(--blue-50); color: var(--blue); }
.t-green { background: var(--green-50); color: var(--green); }
.t-amber { background: var(--amber-50); color: var(--amber); }
.t-orange { background: var(--orange-50); color: var(--orange); }
.t-violet { background: var(--violet-50); color: var(--violet); }
.t-teal { background: var(--teal-50); color: var(--teal); }
.t-red, .t-brand { background: var(--red-50); color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 500; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tbl th { height: 40px; padding: 0 14px; font-size: 12px; font-weight: 550; color: var(--ink-3); text-align: left; background: var(--bg-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { height: 52px; padding: 0 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl.click tbody tr { cursor: pointer; }
.tbl.click tbody tr:hover td { background: var(--bg-2); }
.tbl tr.unread td:nth-child(2) { font-weight: 650; }
.tbl tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.tbl tr.cur td { background: var(--blue-50); }
.tbl tr.diff td { background: #FFFBF2; }
.tbl tr.sum td { background: var(--bg-2); }
.tbl .ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl .warn { color: var(--amber); font-weight: 600; }
.cell-2 { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.cell-2 b { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-2 span { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan { color: var(--ink-3); display: inline-flex; }
.tabs-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 18px 0 8px; height: 52px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; height: 100%; gap: 4px; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--ink-3); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }
.tabs em { font-style: normal; font-size: 11.5px; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--line-2); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; }
.tabs-h { padding: 0 8px; }

/* ---------- Dettaglio ---------- */
.det-h { margin-bottom: 16px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-weight: 500; font-size: 12.5px; height: 20px; margin-bottom: 6px; }
.back:hover { color: var(--ink); }
.det-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.det-badges { display: flex; gap: 8px; }
.det-badges .b-fixed { width: auto; }
.meta { display: flex; align-items: center; gap: 0; color: var(--ink-3); font-size: 12.5px; margin-top: 8px; flex-wrap: wrap; }
.meta > span { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-left: 1px solid var(--line); height: 16px; }
.meta > span:first-child { padding-left: 0; border-left: 0; color: var(--ink-2); }
.stepper { list-style: none; margin: 0 0 16px; padding: 0; display: grid; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stepper li { height: 46px; display: flex; align-items: center; border-left: 1px solid var(--line); color: var(--ink-4); font-weight: 550; position: relative; }
.stepper li:first-child { border-left: 0; }
.stepper li { gap: 10px; padding-left: 16px; }
.stepper li > a { display: flex; align-items: center; gap: 10px; height: 100%; width: calc(100% + 16px); margin-left: -16px; padding-left: 16px; }
.stepper li > a:hover { background: var(--bg-2); }
.st-n { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; flex: none; }
.stepper li.done { color: var(--ink-2); }
.stepper li.done .st-n { background: var(--green); border-color: var(--green); color: #fff; }
.stepper li.cur { color: var(--ink); }
.stepper li.cur .st-n { border-color: var(--brand); color: var(--brand); }
.stepper li.sel::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--brand); }
.thread { padding: 0; }
.msg { padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.msg.out { background: var(--bg-2); }
.msg-h { display: flex; align-items: center; gap: 10px; }
.msg-who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.msg-who span { font-size: 12px; color: var(--ink-3); }
.msg-who b { font-weight: 600; }
.msg-t { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.msg-s { font-weight: 600; margin: 12px 0 4px; }
.msg-b { white-space: pre-wrap; line-height: 1.6; margin-top: 8px; color: var(--ink); }
.msg-b mark { background: #FFEFC2; color: inherit; border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -1px 0 #F0C64D; }
.thread.compact { max-height: 360px; overflow: auto; }
.thread.compact .msg-b { font-size: 12.5px; }
.atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.att { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--white); font-size: 12px; color: var(--ink-2); }
.prow { display: grid; grid-template-columns: 136px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 40px; }
.prow label { display: flex; align-items: center; gap: 4px; }
.prow .upd { width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-left: 2px; }
.prow label { font-size: 12.5px; color: var(--ink-2); }
.prow.miss label { color: var(--amber); font-weight: 600; }
.pval { position: relative; display: flex; align-items: center; }
.pval input, .pval select { height: 32px; border-color: transparent; background: var(--bg-2); }
.pval input:hover, .pval select:hover { border-color: var(--line); }
.pval input:disabled, .pval select:disabled { background: none; padding-left: 0; color: var(--ink); opacity: 1; -webkit-appearance: none; appearance: none; }
.prow.miss .pval input, .prow.miss .pval select { background: var(--amber-50); border-color: #F1D9A8; }
.pval.has-u input { padding-right: 38px; }
.unit { position: absolute; right: 10px; color: var(--ink-3); font-size: 12px; pointer-events: none; }
.act { display: flex; flex-direction: column; gap: 10px; }
.act-k { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.act-k:not(:first-child) { margin-top: 6px; }
.act-v { display: flex; align-items: center; gap: 8px; font-weight: 550; }
.act-big { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 650; height: 44px; padding: 0 14px; border-radius: 8px; background: var(--bg); }
.act-big.ok { background: var(--green-50); color: var(--green); }
.act-big.ko { background: var(--amber-50); color: var(--amber); }
.btn-col { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.btn-col .btn { width: 100%; }
.miss-l { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.miss-l li { display: flex; align-items: center; gap: 8px; color: var(--amber); font-weight: 550; }
.draft-prev { white-space: pre-wrap; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; max-height: 168px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv > span { color: var(--ink-3); }
.kv > b { font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.kv a { color: var(--brand); }
.act .kv { grid-template-columns: 110px 1fr; }
.wait { display: flex; align-items: center; gap: 8px; color: var(--ink-3); height: 40px; padding: 0 12px; background: var(--bg); border-radius: 8px; }
.kb-ref { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.kb-ref:hover { border-color: var(--ink-4); }
.kb-ref b { font-weight: 600; }
.kb-ref span:last-child:not(.mono) { font-size: 12px; color: var(--ink-3); }
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.log li:last-child { border-bottom: 0; }
.log li span { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.log.ev li { grid-template-columns: 72px 160px 1fr; padding: 12px 18px; }

/* ---------- Opzioni ---------- */
.opts { display: flex; flex-direction: column; }
.opt { display: grid; grid-template-columns: 28px minmax(0, 1fr) 84px 72px 104px 64px 96px 20px; gap: 12px; align-items: center; height: 92px; padding: 0 18px 0 15px; border-bottom: 1px solid var(--line-2); border-left: 3px solid transparent; cursor: pointer; }
.opt:last-child { border-bottom: 0; }
.opt:hover { background: var(--bg-2); }
.opt.sel { background: var(--brand-50); border-left-color: var(--brand); }
.opt-rank { width: 28px; height: 28px; border-radius: 50%; background: var(--line-2); color: var(--ink-2); font-weight: 650; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.opt-rank.sm { width: 24px; height: 24px; font-size: 12px; }
.opt:first-child .opt-rank, .sim:first-child .opt-rank { background: var(--ink); color: #fff; }
.opt-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.opt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-name b { font-weight: 600; }
.opt-sub { display: flex; gap: 10px; color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; }
.opt-sub span + span::before { content: '·'; margin-right: 10px; }
.opt-main .chips { margin-top: 4px; flex-wrap: nowrap; overflow: hidden; }
.opt-c { display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.opt-c span { font-size: 11.5px; color: var(--ink-3); }
.opt-c b { font-weight: 600; white-space: nowrap; }
.opt-c.r { align-items: flex-end; }
.opt-score { display: flex; flex-direction: column; gap: 6px; }
.score-n { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1; }
.sbar { display: flex; height: 6px; width: 100%; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.sbar i { display: block; height: 100%; }
.opt-sel { color: var(--brand); display: flex; justify-content: center; }
.wrow { margin-bottom: 14px; }
.wrow-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 13px; }
.wrow-h span { display: flex; align-items: center; gap: 8px; }
.wrow-h b { font-variant-numeric: tabular-nums; display: flex; gap: 8px; align-items: baseline; }
.wrow-h small { color: var(--ink-3); font-weight: 500; min-width: 32px; text-align: right; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 20px; padding: 0; border: 0; background: none; box-shadow: none !important; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--c, var(--brand)); margin-top: -6px; cursor: pointer; }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--c, var(--brand)); }

/* ---------- BOM ---------- */
.tbl.bom td { height: 56px; }
.qty { height: 32px; width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.row-act { display: flex; justify-content: flex-end; gap: 2px; }
.bom-f { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 16px 18px; border-top: 1px solid var(--line); }
.add { display: flex; gap: 8px; align-items: center; width: 520px; position: relative; }
.add-ic { position: absolute; left: 10px; color: var(--ink-3); }
.add input { padding-left: 32px; }
.tot { margin: 0; width: 340px; }
.tot div { display: flex; justify-content: space-between; height: 28px; align-items: center; color: var(--ink-2); }
.tot dt { margin: 0; } .tot dd { margin: 0; font-variant-numeric: tabular-nums; }
.tot .big { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; height: 40px; color: var(--ink); font-size: 16px; font-weight: 650; }

/* ---------- Offerta ---------- */
.a4-wrap { background: var(--bg); flex: 1; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 24px; min-height: 0; }
.a4-pages { display: flex; flex-direction: column; gap: 20px; flex: none; }
.a4 { zoom: .74; width: 794px; height: 1123px; overflow: hidden; background: #fff; box-shadow: 0 4px 24px rgba(16, 24, 40, .12); padding: 56px 60px; font-size: 12.5px; color: #1B1F24; display: flex; flex-direction: column; flex: none; }
.a4-h { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 20px; border-bottom: 2px solid var(--brand); }
.a4-h img { height: 34px; }
.a4-co { text-align: right; font-size: 11px; color: #4A525C; line-height: 1.6; }
.a4-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin: 28px 0; line-height: 1.6; }
.a4-k { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #7B838D; margin-bottom: 4px; }
.a4-big { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.a4-t { width: 100%; border-collapse: collapse; }
.a4-t th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #7B838D; font-weight: 600; padding: 8px 6px; border-bottom: 1px solid #1B1F24; }
.a4-t td { padding: 8px 6px; border-bottom: 1px solid #E4E7EB; vertical-align: top; font-variant-numeric: tabular-nums; }
.a4-t td:first-child { font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.a4-t .r { text-align: right; white-space: nowrap; }
.a4-tot { margin: 16px 0 0 auto; width: 280px; }
.a4-tot div { display: flex; justify-content: space-between; padding: 5px 0; font-variant-numeric: tabular-nums; }
.a4-tot .g { border-top: 1px solid #1B1F24; margin-top: 4px; padding-top: 8px; font-size: 15px; font-weight: 700; }
.a4-cond { margin-top: 32px; }
.a4-cg { display: grid; grid-template-columns: 150px 1fr; row-gap: 6px; }
.a4-cg span { color: #7B838D; }
.a4-cg b { font-weight: 600; }
.a4-f { margin-top: auto; padding-top: 16px; border-top: 1px solid #E4E7EB; font-size: 10px; color: #7B838D; display: flex; justify-content: space-between; gap: 24px; }
.a4-pg { white-space: nowrap; font-weight: 600; color: #4A525C; }
.a4-cont { margin: 20px 0 16px; color: #4A525C; }
.g-offer2 .a4-pages { gap: 14px; }
.compose { display: flex; flex-direction: column; gap: 10px; }
.col-fill { flex: 1; min-height: 0; }
.col-fill textarea { flex: 1; min-height: 200px; }
.frow { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; }
.frow label { color: var(--ink-3); font-size: 12.5px; }
.frow input { height: 34px; }

/* ---------- Tecnico ---------- */
.notice { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 8px 0 16px; background: var(--amber-50); border: 1px solid #F1D9A8; border-radius: var(--r); color: var(--amber); font-weight: 550; margin-bottom: 16px; }
.notice .btn { margin-left: auto; }
.sims { display: flex; flex-direction: column; }
.sim { display: grid; grid-template-columns: 32px minmax(0, 1fr) 72px 156px 20px; cursor: pointer; border-left: 3px solid transparent; gap: 16px; align-items: center; height: 96px; padding: 0 18px; border-bottom: 1px solid var(--line-2); }
.sim:last-child { border-bottom: 0; }
.sim:hover { background: var(--bg-2); }
.sim-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sim-main { gap: 10px; }
.sim-t { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; overflow: hidden; color: var(--ink-3); font-size: 12px; }
.sim-t b { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.sim-t span + span::before { content: '·'; margin-right: 10px; }
.sim-parts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
.sim-c-h { display: flex; justify-content: space-between; gap: 8px; }
.sim-c { display: grid; grid-template-columns: 1fr; gap: 3px; font-size: 11.5px; }
.sim-c span { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-c b { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12px; }
.sim-c.row { grid-template-columns: 120px 1fr 44px; align-items: center; padding: 6px 0; font-size: 12.5px; }
.sim-c.row b { text-align: right; }
.mini { height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.mini i { display: block; height: 100%; background: var(--violet); }
.sim-tot { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.sim-tot small { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.sim .opt-sel { color: var(--ink-4); }
.big-score { display: flex; align-items: baseline; gap: 8px; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.big-score b { font-size: 32px; font-weight: 650; letter-spacing: -.02em; }
.big-score span { color: var(--ink-3); }
.delta { list-style: none; margin: 0; padding: 0; }
.delta li { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.delta li:first-child { padding-top: 0; }
.delta li span { font-weight: 600; }
.delta li p { margin: 0; color: var(--ink-2); }
.note { display: flex; gap: 10px; align-items: center; margin-top: 16px; padding: 12px 14px; border-radius: 8px; background: var(--bg-2); color: var(--ink-2); }
.drawing { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.drawing svg { display: block; width: 100%; height: auto; }
.files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chk { list-style: none; margin: 0; padding: 0; }
.chk li { display: flex; align-items: center; gap: 10px; height: 36px; border-bottom: 1px solid var(--line-2); }
.chk li .ic { color: var(--green); }
.chk li.no { color: var(--amber); font-weight: 550; }
.chk li.no .ic { color: var(--amber); }
.prj-new { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 16px; align-items: center; }
.prj-new > div { display: flex; flex-direction: column; gap: 2px; }
.prj-new .muted { font-size: 12px; }
.lineage { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 12px; color: var(--ink-4); }
.lineage > div { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.lineage > div span:last-child { font-size: 12px; color: var(--ink-3); }
.lineage > div.cur { border-color: var(--violet); background: var(--violet-50); }
.lineage > .ic { margin-left: 16px; }
.todo { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.todo:last-child { border-bottom: 0; }
.todo input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--violet); }
.todo div { display: flex; flex-direction: column; gap: 2px; }
.todo b { font-weight: 600; font-size: 13px; }
.todo span { font-size: 12.5px; color: var(--ink-2); }
.todo.ok b, .todo.ok span { color: var(--ink-4); text-decoration: line-through; }
.tent { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.tent:last-child { border-bottom: 0; }
.tent-h { display: flex; align-items: center; gap: 10px; }
.tent-h span { color: var(--ink-3); font-size: 12px; margin-right: auto; }
.tent p { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-2); }

/* ---------- KB / Catalogo / Regole ---------- */
.kb-row { display: flex; flex-direction: column; gap: 3px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); border-left: 3px solid transparent; }
.kb-row:hover { background: var(--bg-2); }
.kb-row.on { background: var(--brand-50); border-left-color: var(--brand); }
.kb-row-h { display: flex; justify-content: space-between; align-items: center; }
.kb-row b { font-weight: 600; }
.kb-row > span { font-size: 12px; color: var(--ink-3); }
.kb-t { font-size: 18px; font-weight: 650; margin-bottom: 16px; }
.kb-meta { margin-bottom: 20px; }
.kb-meta .kv { grid-template-columns: 160px 1fr; }
.kb-meta .kv > b { text-align: left; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); line-height: 1.55; }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.cats { display: flex; flex-direction: column; padding: 6px; }
.cats a { display: flex; justify-content: space-between; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 6px; color: var(--ink-2); }
.cats a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cats a:hover { background: var(--bg); }
.cats a.on { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.cats em { font-style: normal; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.prev-h { display: flex; gap: 10px; color: var(--ink-3); font-size: 12.5px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.prev-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 44px 140px 36px; gap: 12px; align-items: center; height: 60px; border-bottom: 1px solid var(--line-2); }
.prev-row:last-child { border-bottom: 0; }
.prev-row > b { text-align: right; font-size: 15px; }
.status { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--green); box-shadow: 0 0 0 3px var(--green-50); }
.status.warn { background: #E0A12B; box-shadow: 0 0 0 3px var(--amber-50); }

/* ---------- Modal & toast ---------- */
#modal { display: none; }
#modal.open { display: block; }
.modal-bg { position: fixed; inset: 0; background: rgba(16, 20, 26, .38); z-index: 50; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 680px; max-height: 88vh; background: var(--white); border-radius: 12px; z-index: 51; display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(16, 24, 40, .24); }
.modal.wide { width: 760px; }
.modal-h { height: 56px; padding: 0 12px 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); flex: none; }
.modal-b { padding: 16px 20px; overflow: auto; }
.modal-b .tbl { border: 1px solid var(--line); border-radius: 8px; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex: none; }
.modal-f > div { display: flex; gap: 8px; }
.modal-f .muted { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
#toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { display: flex; align-items: center; gap: 12px; min-width: 300px; padding: 12px 16px; background: var(--ink); color: #fff; border-radius: 10px; box-shadow: 0 12px 32px rgba(16, 24, 40, .24); animation: tin .2s ease-out; }
.toast div { display: flex; flex-direction: column; line-height: 1.35; }
.toast span { font-size: 12px; color: rgba(255, 255, 255, .7); }
.toast.info .ic { color: #8FB4FF; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Print ---------- */
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; left: 0; top: 0; zoom: 1; gap: 0; }
  #print-area .a4 { zoom: 1; box-shadow: none; width: 210mm; height: 297mm; break-after: page; }
  #print-area .a4:last-child { break-after: auto; }
}
.tbl td.nw { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-stack.sticky .kv { grid-template-columns: 112px minmax(0, 1fr); }
.col-stack.sticky .kv > b { text-align: left; }

/* =================== v2 =================== */
.t-amb { color: var(--amber); font-weight: 600; }
.muted.sm { font-size: 12px; }
.btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.card-h-r { display: flex; align-items: center; gap: 12px; }
.bar-r { display: flex; align-items: center; gap: 16px; }
.bar-r .muted b { color: var(--ink); font-weight: 600; }

/* ---------- Filtri stile Excel ---------- */
.xf-bar { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.xf-bar > .muted { font-size: 12.5px; margin-right: 6px; }
.xf-hint { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-4); font-size: 12px; }
.xf-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 9px; border-radius: 13px; background: var(--blue-50); color: var(--blue); font-size: 12px; font-weight: 550; }
.xf-chip button { border: 0; background: none; color: inherit; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.xf-chip button:hover { background: rgba(47, 111, 222, .14); }
.xf-bar .link { font-size: 12.5px; }
.tbl th:has(.xf-th) { padding: 0 6px; }
.xf-th { display: flex; align-items: center; gap: 6px; width: 100%; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: none; font: inherit; font-size: 12px; font-weight: 550; color: var(--ink-3); cursor: pointer; text-align: left; }
.xf-th > span { overflow: hidden; text-overflow: ellipsis; }
.xf-th:hover { background: var(--white); border-color: var(--line); color: var(--ink); }
.xf-ic { margin-left: auto; width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--line); background: var(--white); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); }
.xf-th.on { color: var(--blue); }
.xf-th.on .xf-ic { background: var(--blue); border-color: var(--blue); color: #fff; }
.xf-th.sorted { color: var(--ink); }
.xf-pop { position: absolute; z-index: 45; width: 280px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px rgba(16, 24, 40, .16); padding: 6px; font-size: 13px; }
.xf-op { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 8px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; color: var(--ink); }
.xf-op:hover:not(:disabled) { background: var(--bg); }
.xf-op:disabled { color: var(--ink-4); cursor: default; }
.xf-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.xf-search { position: relative; display: flex; align-items: center; margin: 6px 2px; color: var(--ink-3); }
.xf-search .ic { position: absolute; left: 9px; }
.xf-search input { height: 32px; padding-left: 28px; }
.xf-list { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; margin: 0 2px; padding: 4px 0; }
.xf-list label { display: flex; align-items: center; gap: 8px; padding: 5px 10px; cursor: pointer; }
.xf-list label:hover { background: var(--bg-2); }
.xf-list input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); flex: none; }
.xf-list span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xf-list em { font-style: normal; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.xf-all { border-bottom: 1px solid var(--line-2); margin-bottom: 2px; font-weight: 550; }
.xf-f { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 2px 2px; }

/* ---------- Analisi: email | parametri, sotto Prossimo passo ---------- */
.g-an { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; height: calc(100vh - var(--top) - 400px); min-height: 400px; }
.g-an > .card { min-height: 0; }
.prow .upd.man { background: var(--blue); }
.next { margin-top: 16px; }
.next .card-h { height: 46px; }
.next-b { display: flex; align-items: center; gap: 24px; padding: 16px 18px; }
.next-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.next-act { display: flex; align-items: center; gap: 8px; flex: none; }
.next-row { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.lbl-v { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lbl-v > b { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.lbl-v.grow { flex: 1; }
.lbl-v .act-k { display: flex; align-items: center; gap: 8px; }
.lbl-v .act-k .badge { text-transform: none; letter-spacing: 0; }
.next-note { margin: 0; display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12.5px; }
.next.warn { border-color: #F1D9A8; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; }
.banner.ko { background: var(--amber-50); color: var(--amber); }
.banner.ko b { color: var(--ink); }
.next-b.miss { display: grid; grid-template-columns: 260px minmax(0, 1fr) 200px; align-items: start; }
.next-b.miss .next-act { flex-direction: column; align-items: stretch; }
.next-b.miss .next-act .muted { text-align: center; }
.next-mail textarea { min-height: 200px; }
.kv-inline { display: grid; grid-template-columns: auto auto; column-gap: 12px; row-gap: 4px; font-size: 12.5px; }
.kv-inline span { color: var(--ink-3); }
.kv-inline b { font-weight: 550; }

/* ---------- Configurazione con BOM interna ---------- */
.opts-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); background: var(--bg-2); font-size: 12px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.opt.has-bom { grid-template-columns: 28px minmax(0, 1fr) 84px 72px 104px 64px 96px 136px 20px; }
.opt-wrap { border-bottom: 1px solid var(--line-2); }
.opt-wrap:last-child { border-bottom: 0; }
.opt-wrap .opt { border-bottom: 0; }
.opt-wrap.sel .opt { background: var(--brand-50); border-left-color: var(--brand); }
.radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ink-4); display: inline-block; position: relative; background: var(--white); }
.radio.on { border-color: var(--brand); }
.radio.on::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }
.opt-bom { padding: 0 18px 18px 46px; background: var(--brand-50); }
.bom-in { background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.bom-in-h { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.bom-in-h .muted { font-size: 12.5px; }
.card > .bom-in { border: 0; border-radius: 0 0 var(--r) var(--r); }

/* ---------- Preventivo: email principale, anteprima secondaria ---------- */
.g-offer2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; height: calc(100vh - var(--top) - 210px); min-height: 640px; }
.g-offer2 > .card { min-height: 0; }
.g-offer2 .a4 { zoom: .6; }
.g-offer2 .a4-wrap { padding: 20px; }

/* ---------- Risoluzione con fonti ---------- */
.ris { list-style: none; margin: 0; padding: 4px 18px; }
.ris li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.ris li:last-child { border-bottom: 0; }
.ris-n { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.ris-b p { margin: 2px 0 8px; line-height: 1.55; }
.refs { display: flex; flex-wrap: wrap; gap: 6px; }
.ref { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink-2); font-size: 11.5px; cursor: pointer; }
.ref:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-50); }
.doc-t { display: flex; align-items: center; gap: 12px; min-width: 0; }
.doc-t > div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.doc-t span { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.doc-t .ic { color: var(--ink-3); }
.doc-bg { background: var(--bg); padding: 24px; }
.docpage { background: #fff; max-width: 620px; margin: 0 auto; padding: 36px 44px 28px; box-shadow: 0 4px 18px rgba(16, 24, 40, .1); font-family: Georgia, 'Times New Roman', serif; font-size: 14px; line-height: 1.65; color: #23272E; }
.doc-run { display: flex; justify-content: space-between; font-family: var(--font); font-size: 10.5px; color: var(--ink-4); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.docpage h4 { font-family: var(--font); font-size: 15px; margin: 0 0 12px; }
.docpage p { margin: 0 0 12px; }
.docpage mark { background: #FFE58A; color: inherit; padding: 1px 2px; border-radius: 2px; box-shadow: 0 0 0 2px #FFE58A; }
.doc-pg { text-align: center; font-family: var(--font); font-size: 11px; color: var(--ink-4); margin-top: 20px; }
.modal.xl { width: 960px; }
.modal-h-r { display: flex; align-items: center; gap: 10px; }
.sim-pill { height: 24px; padding: 0 10px; border-radius: 12px; background: var(--violet-50); color: var(--violet); font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; }
.modal-tabs { height: 46px; padding: 0 12px; border-bottom: 1px solid var(--line); flex: none; align-items: stretch; }
.modal-tabs .no-dw { margin-left: auto; align-self: center; font-size: 12px; }

/* ---------- Esito ---------- */
.g-esito { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; height: calc(100vh - var(--top) - 210px); min-height: 520px; }
.g-esito > .card { min-height: 0; }
.wait.big { height: 48px; font-weight: 550; color: var(--ink-2); }
.esito-p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.quote { margin: 0; padding: 10px 12px; border-left: 3px solid var(--line); background: var(--bg-2); border-radius: 0 6px 6px 0; font-size: 12.5px; color: var(--ink-2); font-style: italic; }

/* ---------- Reparto Tecnico ---------- */
.sim.sel { background: var(--violet-50); border-left-color: var(--violet); }
.sim .radio.on { border-color: var(--violet); }
.sim .radio.on::after { background: var(--violet); }
.prog { height: 4px; background: var(--line-2); }
.prog i { display: block; height: 100%; background: var(--violet); transition: width .2s; }
.prj-check .card-b { padding-top: 4px; }
.prj-check .todo { padding: 14px 0; }
.mats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 16px 18px; }
.mat { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); cursor: pointer; text-align: left; color: var(--ink-3); }
.mat:hover { border-color: var(--ink-4); background: var(--bg-2); }
.mat-ic { width: 36px; height: 36px; border-radius: 8px; background: var(--violet-50); color: var(--violet); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mat-t { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.mat-t b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mat-t span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tents { padding: 4px 18px 12px; border-top: 1px solid var(--line-2); }
.tents .act-k { margin: 10px 0 2px; }
textarea.todo-fill { background: linear-gradient(var(--white), var(--white)) padding-box; border-color: #F1D9A8; }
.kv-doc .kv > b { text-align: left; }
.kv-doc .kv { grid-template-columns: 180px 1fr; }
.img-ph { height: 320px; border-radius: 8px; background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 12px, var(--bg-2) 12px, var(--bg-2) 24px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--ink-3); }
.img-ph b { color: var(--ink); }
.log li > div { line-height: 1.5; }

/* ---------- Cruscotto Direzione ---------- */
.kpi.tall { height: 104px; }
.kpi small { color: var(--ink-3); font-size: 12px; }
.sec-h { display: flex; align-items: baseline; gap: 12px; margin: 24px 0 12px; }
.sec-h .muted { font-size: 12.5px; }
.g-grp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grp { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.grp-h { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.grp-h b { margin-left: auto; font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.grp-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--bg); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; }
.stack { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--line-2); }
.stack i { display: block; height: 100%; }
.grp-l { display: flex; flex-direction: column; }
.grp-r { display: flex; justify-content: space-between; align-items: center; height: 34px; border-top: 1px solid var(--line-2); }
.grp-r span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.grp-r b { font-variant-numeric: tabular-nums; font-weight: 600; }
.dot.t-orange { background: var(--orange); } .dot.t-teal { background: var(--teal); }
.t-blue-s { background: var(--blue); } .t-violet-s { background: var(--violet); } .t-orange-s { background: var(--orange); } .t-amber-s { background: #E0A12B; }
.t-teal-s { background: var(--teal); } .t-grey-s { background: var(--ink-4); } .t-green-s { background: var(--green); } .t-line-s { background: #D5DAE0; }
.hbar { display: grid; grid-template-columns: 190px minmax(0, 1fr) 36px; align-items: center; gap: 12px; height: 38px; font-size: 13px; }
.hbar > span { color: var(--ink-2); }
.hbar > b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hbar-t { height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; display: flex; }
.hbar-t i { display: block; height: 100%; }
.hbar-t.two i:first-child { border-radius: 5px 0 0 5px; }

/* ---------- Regole ---------- */
.g-rules { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.wrow { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.wrow:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.wrow-d { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.fam-sel { width: auto; max-width: 320px; height: 34px; font-weight: 550; }
.prev-h { justify-content: space-between; }
.delta-r { font-size: 11.5px; font-weight: 600; color: var(--ink-4); text-align: center; font-variant-numeric: tabular-nums; }
.delta-r.up { color: var(--green); }
.delta-r.down { color: var(--brand); }
.prev-f { padding-top: 10px; font-size: 12px; }
.card-f > .muted:first-child { display: inline-flex; align-items: center; gap: 6px; }
