/* Inter (SIL Open Font License, assets/fonts/LICENSE-Inter.txt): carattere unico del pannello, anche senza internet */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/inter-400i.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700 900; font-display: swap; src: url("../fonts/inter-700.woff") format("woff"); }

/* =========================================================
   Pannello di Controllo — foglio di stile
   Toni: verde cipresso (struttura), rosa salume (anno corrente), grigio salvia (anno precedente)
   ========================================================= */
:root {
  /* identità VIANI: blu notte e oro (v16) */
  --cypress: #13233A;
  --cypress-2: #1E3553;
  --cypress-3: #2D4C72;
  --sage: #C9A961;
  --sage-soft: #F3ECDC;
  --paper: #F5F5F2;
  --gold: #C9A961;
  --gold-2: #E6CF98;
  --surface: #FFFFFF;
  --ink: #1C2623;
  --ink-2: #3A4642;
  --muted: #66736E;
  --line: #DCE2DF;
  --line-2: #EDF1EF;
  --rose: #B8476B;
  --rose-soft: #F6E3EA;
  --py: #A3B1AB;
  --pos: #1E7A52;
  --neg: #B42318;
  --neg-soft: #FBEAE8;
  --warn: #8A5A00;
  --warn-soft: #FFF4DC;
  --info-soft: #E8F0F6;
  --radius-s: 6px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28, 38, 35, .06), 0 2px 8px rgba(28, 38, 35, .04);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--font);
  --sans: var(--font);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sidebar-w: 272px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--paper); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
/* cifre tutte della stessa larghezza: colonne di numeri allineate */
table, .kpi-value, .ms-value, .n, td, th, svg text, input, .sel-chip { font-variant-numeric: tabular-nums lining-nums; }
button, input, select, textarea, svg text { font-family: var(--font); }
a { color: var(--cypress-2); }
a:hover { color: var(--cypress); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 .5rem; }
code { font-family: var(--mono); font-size: .85em; background: var(--line-2); padding: .1em .35em; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); font-size: .85rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- struttura ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--cypress); color: #D8E5DE;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.1rem 1rem; color: #fff; text-decoration: none; font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.brand:hover { color: #fff; }
.sidebar nav { padding: 0 .6rem 1rem; flex: 1; }
.nav-group { display: flex; align-items: center; gap: .6rem; margin: 1.35rem .6rem .5rem; font-size: .72rem; color: var(--sage); letter-spacing: .16em; text-transform: uppercase; font-weight: 700; }
.nav-group::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(201, 169, 97, .45), rgba(201, 169, 97, 0)); }
.nav-sub { margin-top: .55rem; }
.nav-sub-title { display: block; margin: .55rem .6rem .3rem; padding: .05rem 0 .05rem .6rem; border-left: 2px solid #C9A961;
  font-family: var(--serif); font-size: 1rem; font-weight: 600; letter-spacing: .01em; color: #E6CF98; line-height: 1.25; }
.nav-sub ul li a { padding-left: 1.1rem; white-space: nowrap; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: flex; align-items: center; gap: .6rem; padding: .48rem .65rem; border-radius: var(--radius-s);
  color: #D8E5DE; text-decoration: none; font-size: .93rem;
}
.sidebar li a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar li a.active { background: linear-gradient(90deg, #C9A961, #B8954B); color: #14261F; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28), inset 4px 0 0 #F3E2B3; }
.sidebar li a.active .ico { color: #14261F; opacity: 1; }
.sidebar li a.active:hover { background: linear-gradient(90deg, #D4B46C, #C29F55); color: #14261F; }
.sidebar-foot { padding: 1rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-backdrop { display: none; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: .75rem; padding: .75rem 1.5rem; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 1.35rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: .9rem; }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: var(--radius-s); padding: .35rem; cursor: pointer; color: var(--ink); display: inline-flex; }
.icon-btn.menu-toggle { display: none; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.lang-switch a { padding: .2rem .55rem; font-size: .78rem; text-decoration: none; color: var(--muted); }
.lang-switch a.on { background: var(--cypress); color: #fff; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sage-soft); color: var(--cypress); display: grid; place-items: center; font-weight: 600; }
.uname { font-size: .9rem; }
.user-pop { position: absolute; right: 0; top: calc(100% + .4rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 180px; padding: .35rem; z-index: 30; }
.user-pop a, .user-pop button { display: block; width: 100%; text-align: left; padding: .5rem .7rem; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: none; border-radius: var(--radius-s); cursor: pointer; }
.user-pop a:hover, .user-pop button:hover { background: var(--line-2); }
.content { padding: 1.5rem; max-width: 1500px; width: 100%; }

/* ---------- selezione (foglio INPUT) ---------- */
.selection { margin-bottom: 1.25rem; }
.sel-ribbon {
  display: flex; align-items: center; gap: 1rem; justify-content: space-between; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--cypress-2);
  border-radius: var(--radius); padding: 1rem 1.25rem;
}
.sel-who { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; margin: 0; line-height: 1.2; }
.sel-when { margin: .2rem 0 0; color: var(--ink-2); }
.sel-agents { margin: .35rem 0 0; font-size: .88rem; color: var(--muted); }
.sel-agents strong { color: var(--ink-2); font-weight: 600; }
.sel-params { margin: .35rem 0 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.sel-chip { display: inline-block; padding: .05rem .55rem; border-radius: 99px; background: var(--sage-soft); color: var(--cypress); font-size: .82rem; }
.sel-form { background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 1rem 1.25rem 1.1rem; margin-top: -6px; }
.sel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem 1.5rem; }
.sel-grid fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .8rem; align-content: start; }
.sel-grid fieldset:first-child { grid-column: span 2; }
.sel-grid legend { font-family: var(--serif); font-weight: 600; margin-bottom: .4rem; font-size: 1rem; }
.span-2 { grid-column: span 2; }
.sel-actions { display: flex; gap: .6rem; margin-top: 1rem; }
.combo { display: grid; gap: .3rem; }
.hint { font-size: .8rem; color: var(--muted); display: block; margin-top: .25rem; }

/* ---------- form ---------- */
label { display: grid; gap: .25rem; font-size: .86rem; color: var(--ink-2); }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=file], select, textarea {
  font: inherit; font-size: .93rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: .45rem .6rem; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--cypress-3); outline: 2px solid rgba(62, 117, 101, .2); outline-offset: 0; }
[aria-invalid=true] { border-color: var(--neg); }
.field-error { color: var(--neg); font-size: .8rem; }
.unit-input { display: flex; align-items: stretch; }
.unit-input input { border-radius: var(--radius-s) 0 0 var(--radius-s); }
.unit-input span { display: grid; place-items: center; padding: 0 .55rem; background: var(--line-2); border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--radius-s) var(--radius-s) 0; font-size: .82rem; color: var(--muted); }
.form-panel { padding: 1.25rem; display: grid; gap: .85rem; align-content: start; }
.form-panel h2 { margin-bottom: .1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .85rem 1rem; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .25rem; }
.checks { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: .45rem; font-size: .9rem; }
.radios { border: 0; padding: 0; margin: 0; display: grid; gap: .3rem; }
.radios legend { font-size: .86rem; color: var(--ink-2); margin-bottom: .2rem; }
.radios label { display: flex; gap: .45rem; align-items: center; }
.inline { display: inline; }
.inline-edit { display: flex; gap: .4rem; }
.search-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.search-form input[type=search] { width: 240px; }
.search-form select { width: auto; max-width: 220px; }
.settings { display: grid; gap: 1.25rem; max-width: 900px; }
.pw-wrap { display: flex; }
.pw-wrap input { border-radius: var(--radius-s) 0 0 var(--radius-s); }
.pw-toggle { border: 1px solid var(--line); border-left: 0; background: var(--line-2); border-radius: 0 var(--radius-s) var(--radius-s) 0; padding: 0 .7rem; cursor: pointer; font: inherit; font-size: .82rem; }

/* ---------- pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-size: .9rem; font-weight: 500;
  padding: .5rem .95rem; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--cypress-3); color: var(--cypress); }
.btn-primary { background: var(--cypress-2); border-color: var(--cypress-2); color: #fff; }
.btn-primary:hover { background: var(--cypress); border-color: var(--cypress); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--cypress-2); }
.btn-ghost:hover { background: var(--sage-soft); border-color: transparent; }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--neg); }
.btn-danger-ghost:hover { background: var(--neg-soft); border-color: transparent; color: var(--neg); }
.btn-sm { padding: .3rem .65rem; font-size: .83rem; }
.btn-block { width: 100%; }

/* ---------- avvisi ---------- */
.alert { display: flex; gap: .75rem; justify-content: space-between; align-items: flex-start; padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid transparent; font-size: .92rem; }
.alert ul { margin: .35rem 0 .35rem 1.1rem; padding: 0; }
.alert-success { background: var(--sage-soft); border-color: #CADBD1; color: var(--cypress); }
.alert-error { background: var(--neg-soft); border-color: #F2C7C2; color: #7A1A12; }
.alert-warning { background: var(--warn-soft); border-color: #F0DCAA; color: var(--warn); }
.alert-info { background: var(--info-soft); border-color: #CDDDEA; color: #24435C; }
.alert-close { background: none; border: 0; font-size: 1.2rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }
.selection .alert { margin: .75rem 0 0; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.25rem; }
.kpi { padding: 1rem 1.25rem; border-right: 1px solid var(--line-2); }
.kpi:last-child { border-right: 0; }
.kpi-label { font-size: .85rem; color: var(--muted); margin: 0; }
.kpi-value { font-family: var(--serif); font-size: 1.75rem; font-weight: 600; margin: .1rem 0; font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.01em; }
.kpi-compare { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; font-size: .85rem; margin: 0; }
.kpi-count .kpi-value { color: var(--cypress-2); }
.delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* ---------- pannelli e tabelle ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.25rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line-2); }
.panel-head p { margin: 0; }
.panel-tools { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.table-filter { width: 200px !important; padding: .3rem .55rem !important; font-size: .85rem !important; }
.table-wrap { overflow: auto; }
.table-wrap.tall { max-height: 70vh; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: .5rem .8rem; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
table.data.dense th, table.data.dense td { padding: .38rem .65rem; font-size: .86rem; }
table.data thead th { position: sticky; top: 0; background: #F8FAF9; font-weight: 600; font-size: .8rem; color: var(--ink-2); border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
table.data thead th a { color: inherit; text-decoration: none; }
table.data thead th a:hover { color: var(--cypress-2); }
table.data[data-sortable] thead th { cursor: pointer; user-select: none; }
table.data[data-sortable] thead th[aria-sort=ascending]::after { content: " ↑"; }
table.data[data-sortable] thead th[aria-sort=descending]::after { content: " ↓"; }
table.data tbody th { font-weight: 500; }
table.data tbody tr:hover { background: #F7FAF8; }
table.data tfoot th, table.data tfoot td { font-weight: 700; background: #F8FAF9; border-top: 2px solid var(--line); border-bottom: 0; position: sticky; bottom: 0; }
table.data .n { text-align: right; white-space: nowrap; }
table.data .w-num { width: 3rem; }
table.data .w-bar { min-width: 150px; }
table.data tr.out td, table.data tr.out th { color: #A8B2AE; }
table.data tr.subtle th, table.data tr.subtle td { color: var(--muted); font-style: italic; }
table.data tr.nd td { color: var(--muted); }
table.data tr.row-neg td { background: #FDF5F4; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data td.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

.bar { display: block; position: relative; height: 1.35rem; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.bar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--rose); opacity: .85; border-radius: 4px; }
.bar.bar-muted::before { background: var(--py); }
.bar span { position: relative; padding: 0 .45rem; font-size: .8rem; line-height: 1.35rem; font-weight: 600; color: var(--ink); }
.mbar { display: inline-flex; justify-content: flex-end; position: relative; min-width: 130px; padding: .1rem .35rem; border-radius: 4px; }
.mbar::before { content: ""; position: absolute; inset: 0 0 0 auto; width: var(--w); background: rgba(30, 122, 82, .16); border-radius: 4px; }
.mbar.neg::before { background: rgba(180, 35, 24, .16); }
.mbar span { position: relative; }

.tag { display: inline-block; padding: .05rem .5rem; border-radius: 99px; background: var(--line-2); font-size: .76rem; color: var(--ink-2); margin-right: .25rem; }
.tag-ok { background: var(--sage-soft); color: var(--cypress); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.role-badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .76rem; font-weight: 600; }
.role-admin { background: var(--rose-soft); color: #7D2442; }
.role-editor { background: #E4EEF6; color: #24435C; }
.role-viewer { background: var(--line-2); color: var(--ink-2); }
.sidebar .role-badge { background: rgba(255, 255, 255, .1); color: #D8E5DE; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1.1rem; flex-wrap: wrap; }
.pager-count { padding: .7rem 1.1rem; margin: 0; }
.pager-links { display: flex; gap: .25rem; }
.pager-links a, .pager-links span { min-width: 2rem; text-align: center; padding: .25rem .5rem; border-radius: var(--radius-s); text-decoration: none; font-size: .88rem; }
.pager-links a:hover { background: var(--sage-soft); }
.pager-links .cur { background: var(--cypress-2); color: #fff; }

.footnote { font-size: .8rem; color: var(--muted); max-width: 90ch; }
.page-intro { margin-bottom: 1rem; max-width: 90ch; }
.formula { font-family: var(--serif); font-size: 1.05rem; }
.formula a { font-family: var(--font); font-size: .85rem; margin-left: .5rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; flex-wrap: wrap; }
.tabs a { padding: .55rem 1rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--cypress); border-bottom-color: var(--rose); font-weight: 600; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1.25rem; align-items: start; }
.import-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.import-grid .panel { margin-bottom: 0; }
.import-grid + .panel { margin-top: 1.25rem; }
.result-panel { padding: 1rem 1.25rem; border-left: 4px solid var(--sage); }
ul.plain { margin: .5rem 0 0; padding-left: 1.1rem; }
.roles-legend { margin: 0; padding: .5rem 1.1rem 1rem; display: grid; gap: .5rem; }
.roles-legend div { display: grid; grid-template-columns: 140px 1fr; gap: 1rem; align-items: center; }
.roles-legend dd { margin: 0; font-size: .9rem; }

/* ---------- margini ---------- */
.margin-summary {
  display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 1.5rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem;
}
.ms-value { font-family: var(--serif); font-size: 2.4rem; font-weight: 600; margin: 0; color: var(--pos); font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.015em; line-height: 1.1; }
.margin-summary.is-neg .ms-value { color: var(--neg); }
.ms-ratio { margin: .35rem 0 0; color: var(--ink-2); }
.ms-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem 1.25rem; margin: 0; }
.ms-breakdown div { border-left: 2px solid var(--line); padding-left: .75rem; }
.ms-breakdown dt { font-size: .8rem; color: var(--muted); }
.ms-breakdown dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- grafici ---------- */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.chart-grid .panel { margin-bottom: 0; }
.chart-grid > * { min-width: 0; }
.chart { min-width: 0; }
.chart-legend { flex-wrap: wrap; }
.chart-grid + .footnote { margin-top: 1rem; }
.span-all { grid-column: 1 / -1; }
.chart { padding: .75rem 1rem 1rem; position: relative; min-height: 260px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font: 11px var(--font); fill: var(--muted); }
.chart .lbl { fill: var(--ink-2); font-size: 11.5px; }
.chart svg.hb text { font-size: 12.5px; }
.chart svg.hb .lbl { font-size: 12.5px; }
.chart .grid line { stroke: var(--line-2); }
.chart .axis line { stroke: var(--line); }
.chart rect.s0 { fill: var(--rose); }
.chart rect.s1 { fill: var(--py); }
.chart rect:hover { opacity: .8; }
.chart-legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--ink-2); margin-bottom: .4rem; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: .8rem; padding: .35rem .55rem; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -110%); z-index: 5; }
.chart-empty { color: var(--muted); text-align: center; padding: 4rem 1rem; }

/* ---------- pagine senza layout ---------- */
body.bare { background: var(--cypress); min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.bare-wrap { width: 100%; max-width: 400px; }
.bare-brand { display: flex; align-items: center; gap: .7rem; color: #fff; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; margin-bottom: 1.25rem; justify-content: center; }
.auth-card { background: var(--surface); border-radius: 14px; padding: 1.75rem; display: grid; gap: 1rem; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.auth-card h1 { font-size: 1.5rem; }
.auth-card .alert { margin: 0; }
.bare-lang { text-align: center; margin-top: 1rem; }
.bare-lang a { color: var(--sage); margin: 0 .4rem; font-size: .85rem; text-decoration: none; }
.bare-lang a.on { color: #fff; text-decoration: underline; }
.bare .alert { margin-bottom: 1rem; }
.error-page { background: var(--surface); border-radius: var(--radius); padding: 2rem; text-align: center; border: 1px solid var(--line); }
.error-code { font-family: var(--serif); font-size: 3.5rem; font-weight: 600; color: var(--rose); margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .margin-summary { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; }
  .icon-btn.menu-toggle { display: inline-flex; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(odd) { border-right: 1px solid var(--line-2); }
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
  .uname { display: none; }
  .sel-grid fieldset:first-child { grid-column: auto; }
  .kpi { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .ms-breakdown { grid-template-columns: 1fr 1fr; }
  .search-form input[type=search] { width: 100%; }
}
@media (max-width: 520px) {
  .sel-grid fieldset { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .sel-who { font-size: 1.2rem; }
  .kpi-value { font-size: 1.45rem; }
  .ms-value { font-size: 1.9rem; }
  .page-title { font-size: 1.1rem; }
  .table-filter { width: 100% !important; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- stampa ---------- */
@media print {
  .sidebar, .topbar, .sel-form, .sel-ribbon .btn, .panel-tools, .pager, .alert-close, .skip { display: none !important; }
  body { background: #fff; font-size: 11px; }
  .content { padding: 0; max-width: none; }
  .panel, .kpis, .sel-ribbon, .margin-summary { border-color: #ccc; break-inside: avoid; box-shadow: none; }
  .table-wrap, .table-wrap.tall { max-height: none; overflow: visible; }
  table.data thead th, table.data tfoot td, table.data tfoot th { position: static; }
  .chart-grid { grid-template-columns: 1fr; }
}

/* ---------- canali di vendita ---------- */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); margin-right: .45rem; vertical-align: -1px; }
table.data th.grp { text-align: center; border-bottom: 1px solid var(--line); }
.chart text.val { fill: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.chart text.in { font-size: 12px; font-weight: 700; }
.chart svg.st text { font-size: 12px; }
.chart svg.st .lbl { font-size: 12.5px; }
.chart svg.hb text.val { font-size: 12.5px; }
.chart text.pv { fill: var(--ink); font-size: 17px; font-weight: 700; }
.chart svg.pie { max-width: 460px; margin: 0 auto; }
.chart-pie3d { display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 220px); align-items: center; gap: .5rem; }
.chart-pie3d .chart-tip { white-space: nowrap; }
.pie-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: .88rem; }
.pie-legend li { display: grid; grid-template-columns: 12px 1fr auto; gap: .5rem; align-items: center; }
.pie-legend i { width: 12px; height: 12px; border-radius: 3px; display: block; }
.pie-legend b { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .chart-pie3d { grid-template-columns: 1fr; } }
.cv-table th[scope=row], .cv-table thead th { white-space: nowrap; }
.chart-grid > *, .chart-pie3d > * { min-width: 0; }
.chart svg { max-width: 100%; }
.chart-panel .panel-head h2 { min-width: 0; overflow-wrap: anywhere; }
.chart-legend { flex-wrap: wrap; row-gap: .3rem; }
.chart:has(svg) { min-height: 0; }
@media (max-width: 640px) {
  /* su telefono i grafici larghi scorrono in orizzontale invece di rimpicciolire il testo */
  .chart-stack100, .chart-lines2, .chart-hbars { overflow-x: auto; }
  .chart-stack100 svg, .chart-lines2 svg, .chart-hbars svg { min-width: 680px; max-width: none; }
}

/* ---------- Paese export / Agente (v3) ---------- */
.an-selection .sel-ribbon { border-radius: var(--radius) var(--radius) 0 0; }
.an-form { margin-top: 0; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .7rem 1rem; align-items: end; }
.an-grid .an-wide { grid-column: span 2; }
.an-grid label { min-width: 0; }
.an-grid select { width: 100%; }
.an-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.an-foot { display: flex; gap: .5rem 1.25rem; align-items: center; flex-wrap: wrap; margin-top: .9rem; }
.an-form .hint { margin: 0; flex: 1 1 320px; }
td.nowrap { white-space: nowrap; }
.table-note { margin: .6rem 1.25rem .9rem; font-size: .84rem; color: var(--muted); }
.ch-letter { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; margin-right: .55rem; border-radius: 50%;
  background: var(--cypress, #23443B); color: #fff; font-family: var(--sans, inherit); font-size: .8rem; font-weight: 700; vertical-align: .1em; }
@media (max-width: 640px) {
  .an-grid { grid-template-columns: 1fr 1fr; }
  .an-grid .an-wide { grid-column: 1 / -1; }
}
@media print { .an-form { display: none; } }
.an-ribbon-tools { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Import mensile da Excel (v4) ---------- */
.monthly-panel { border-left: 4px solid var(--cypress, #23443B); }
.monthly-intro { margin: 0 1.25rem .9rem; color: var(--ink-2); }
.monthly-grid { padding: 0 1.25rem; margin-bottom: .5rem; }
.form-panel-inner { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; background: var(--surface); display: grid; gap: .6rem; align-content: start; }
.form-panel-inner h3 { margin: 0; font-family: var(--serif); font-size: 1.1rem; display: flex; align-items: center; }
.form-panel-inner p { margin: 0; }
.monthly-foot { margin: .4rem 1.25rem 1rem; }
.csv-details { padding: 0; }
.csv-details > summary { cursor: pointer; padding: 1rem 1.25rem; font-family: var(--serif); font-weight: 600; }
.csv-details[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.csv-details > .import-grid { padding: 0 1.25rem 1.25rem; }
.busy-note { display: flex; align-items: center; gap: .5rem; color: var(--cypress-2, #2F5D50); font-weight: 600; }
.busy-note::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 1100px) { .dest-grid { grid-template-columns: 1fr; } }
.inline-edit.dest-row { display: grid; grid-template-columns: 70px 70px 1fr 92px; gap: .4rem; align-items: center; flex: 1; }
.inline-edit.dest-row.dest-c { grid-template-columns: 90px 70px 1fr 92px; }
.dest-head { display: grid; grid-template-columns: 70px 70px 1fr 170px; gap: .4rem; font-size: .8rem; color: var(--muted); padding: 0 0 .3rem; }
.dest-head.dest-c { grid-template-columns: 90px 70px 1fr 170px; }
.panel-body { padding: 0 1.25rem 1.25rem; }
.panel-body > .hint { margin: 0 0 .8rem; }
.dest-line { padding: .25rem 0; border-bottom: 1px solid var(--line-2); display: flex; gap: .4rem; align-items: center; }
.dest-line > form.inline { flex: none; width: 74px; }
.dest-new { margin-right: 78px; }
.dest-new { padding: .6rem 0; margin-bottom: .6rem; border-bottom: 1px solid var(--line); }
.dest-table { width: 100%; border-collapse: collapse; }
.dest-table td { padding: .2rem 0; }
.dest-row input { min-width: 0; width: 100%; }
.dest-row form { margin: 0; }
label.check { display: flex; gap: .45rem; align-items: center; font-size: .88rem; }
label.check input { width: auto; }

/* ---------- Salva PDF / stampa (v4.1) ---------- */
.btn-pdf { display: inline-flex; align-items: center; gap: .35rem; }
.btn-pdf .ico { width: 16px; height: 16px; }
.print-head { display: none; }
@page { size: A4 landscape; margin: 9mm 9mm 11mm; }
@media (max-width: 520px) { .btn-pdf span { display: none; } }
@media print {
  html, body { background: #fff !important; }
  body { font-size: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .shell { display: block; }
  .main-col { display: block; }
  .content { padding: 0 !important; }
  .print-head { display: flex; align-items: baseline; gap: 1rem; border-bottom: 2px solid #23443B; padding: 0 0 4px; margin: 0 0 8px; }
  .print-head .ph-app { color: #5F6B66; font-size: 9px; }
  .print-head .ph-title { font-family: var(--serif); font-size: 15px; color: #23443B; flex: 1; }
  .print-head .ph-meta { color: #5F6B66; font-size: 9px; }
  .btn, button, .an-form, .an-ribbon-tools, .table-filter, .csv-details, .monthly-panel, form.inline, .hint { display: none !important; }
  .alert { display: none !important; }
  .selection .alert-warning { display: block !important; }
  .sel-ribbon { padding: 6px 10px; border-radius: 4px; }
  .sel-who { font-size: 14px; }
  .kpis { margin-bottom: 8px; }
  .kpi { padding: 6px 10px; }
  .kpi-value { font-size: 16px; }
  .panel { margin-bottom: 8px; border-radius: 4px; }
  .panel, .kpis, .sel-ribbon { break-inside: auto; }
  .chart-panel, .kpis, .sel-ribbon, .margin-summary, .result-panel { break-inside: avoid; }
  .panel-head { padding: 6px 10px; break-after: avoid; }
  .panel-head h2 { font-size: 12px; }
  .table-wrap, .table-wrap.tall { max-height: none !important; overflow: visible !important; }
  table.data { font-size: 8.5px; width: 100%; }
  table.data th, table.data td { padding: 2px 4px !important; font-size: 9.5px !important; line-height: 1.3 !important; }
  table.data .bar span, table.data .mbar { font-size: 9.5px !important; }
  table.data thead { display: table-header-group; }
  table.data tfoot { display: table-row-group; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .kpi { border-bottom: 0 !important; border-right: 1px solid #ddd !important; }
  .kpi:last-child { border-right: 0 !important; }
  table.data tr { break-inside: avoid; }
  table.data thead th, table.data tfoot td, table.data tfoot th { position: static !important; }
  table.data .w-bar { min-width: 0; }
  .chart-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .chart-grid .span-all { grid-column: 1 / -1; }
  .chart { padding: 4px 8px; min-height: 0; }
  .chart-stack100, .chart-lines2, .chart-hbars { overflow: visible !important; }
  .chart-stack100 svg, .chart-lines2 svg, .chart-hbars svg { min-width: 0 !important; max-width: 100% !important; }
  .chart-tip { display: none !important; }
  .footnote, .table-note { font-size: 8px; }
  a { color: inherit; text-decoration: none; }
}
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .35rem 1rem; }

/* ---------- Listini clienti (v5) ---------- */
.lst-folder-form { display: grid; grid-template-columns: 1fr auto; gap: .6rem 1rem; align-items: end; }
.lst-folder-form input { font-family: var(--mono, monospace); font-size: .88rem; }
@media (max-width: 760px) { .lst-folder-form { grid-template-columns: 1fr; } }
.lst-table .lst-cat th { background: var(--cypress, #23443B); color: #fff; font-family: var(--serif); font-size: .95rem; letter-spacing: .02em; padding: .45rem .7rem; text-align: left; }
.lst-table .lst-sec th { background: var(--sage-soft, #E6EFE9); color: var(--cypress, #23443B); font-weight: 600; font-size: .82rem; padding: .3rem .7rem; text-align: left; }
.lst-table .lst-name { font-weight: 600; min-width: 240px; }
.lst-table .lst-name span { display: block; font-weight: 400; color: var(--muted); font-size: .8em; }
.lst-table .lst-net { font-weight: 700; color: var(--cypress, #23443B); }
.lst-table .lst-extra { color: #B8476B; font-weight: 600; }
.lst-table.only-bought tr.lst-notbought { display: none; }
.lst-print-head { display: none; }
.lst-link { display: flex; flex-wrap: wrap; gap: .8rem 2rem; align-items: end; justify-content: space-between; }
.lst-link-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.lst-link-form label { min-width: 280px; }
.lst-link-form .hint { flex-basis: 100%; margin: 0; }
.lst-mode { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; font-size: .88rem; }
.doc-badge { display: inline-block; min-width: 3.2em; text-align: center; font-size: .7rem; font-weight: 700; padding: .1rem .35rem; border-radius: 4px; background: #E6E0D4; color: #3A3A3A; margin-right: .4rem; }
.doc-pdf { background: #F4D9DF; color: #9C2F4B; } .doc-pptx, .doc-ppt { background: #F7E2D0; color: #A4521C; }
.doc-xlsx, .doc-xlsm, .doc-xls { background: #DCEBDF; color: #23603A; } .doc-png, .doc-jpg, .doc-jpeg { background: #DDE6F2; color: #2F5480; }
@media print {
  body.print-clean .print-head, body.print-clean .lst-head, body.print-clean .tabs, body.print-clean .footnote,
  body.print-clean .lst-sheet > .panel-head { display: none !important; }
  body.print-clean .lst-print-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #23443B; padding-bottom: 4px; margin-bottom: 6px; }
  body.print-clean .lst-print-head strong { display: block; font-family: var(--serif); font-size: 17px; color: #23443B; }
  body.print-clean .lst-print-head span { font-size: 11px; }
  body.print-clean .lst-print-head div span { font-size: 13px; font-weight: 600; }
  body.print-clean .lst-sheet { border: 0; }
  .lst-table .lst-cat th { background: #23443B !important; color: #fff !important; }
  .lst-table .lst-cat { break-after: avoid; }
  .lst-table .lst-name { min-width: 0; }
}

/* listino: prodotti senza prezzo nel file */
.lst-noprice td, .lst-noprice th { opacity: .55; }
@media print { body.print-clean .lst-noprice { display: none; } }

/* ---------- offerte (v6) ---------- */
.badge { display: inline-block; padding: .05rem .45rem; border-radius: 99px; font-size: .72rem; font-weight: 700; background: #E6E0D4; color: #3A3A3A; vertical-align: middle; }
.badge-new { background: #F6DCE5; color: #8E2E52; }
.off-head-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.off-head-grid .panel { margin: 0; }
.off-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.off-pair[hidden], label[hidden] { display: none; }
.radios-inline { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; align-items: center; }
.radios-inline legend { width: 100%; }
.off-add-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem 1.5rem; align-items: start; }
.off-add-grid fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; align-content: start; }
.off-add-grid legend { font-weight: 600; margin-bottom: .3rem; }
.off-fam-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .3rem 1rem; }
.off-fam-item summary { cursor: pointer; padding: .15rem 0; }
.off-fam-item summary .check { display: inline-flex; }
.off-fam-item .check-grid { grid-template-columns: 1fr; padding: .2rem 0 .4rem 1.6rem; gap: .15rem; }
.off-codes textarea { font-family: var(--mono, monospace); }
.off-kpis { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.off-kpis strong { color: var(--ink); font-size: 1rem; margin-left: .2rem; }
.off-table th.c { text-align: center; border-bottom: 1px solid var(--line); }
.off-table td, .off-table th { white-space: nowrap; }
.off-table .lst-name { white-space: normal; min-width: 200px; }
.off-table .num-in { width: 5.2rem; padding: .2rem .35rem; text-align: right; font-size: .85rem; }
.off-table .pct-in { width: 4rem; }
.off-table .num-in[hidden] { display: none; }
.off-table .calc-out { font-variant-numeric: tabular-nums; }
.off-table td.pos { color: var(--cypress-2, #2E5B4F); }
.off-actions { position: sticky; bottom: 0; background: var(--bg, #F5F3EE); padding: .7rem 0; z-index: 2; }
.off-danger { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .5rem; }
.off-head-links { display: flex; gap: .4rem; align-items: center; }
.off-cond { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 0; padding: .75rem 1rem; border-bottom: 1px solid var(--line-2); }
.off-cond div { min-width: 140px; }
.off-cond dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.off-cond dd { margin: 0; font-weight: 600; }
.off-cond .off-note { flex-basis: 100%; }
.off-cond .off-note dd { font-weight: 400; }
@media (max-width: 900px) { .off-add-grid { grid-template-columns: 1fr; } }
@media print {
  body.print-clean .off-cond { padding: 4px 0 6px; gap: 2px 18px; }
  body.print-clean .off-cond dt { font-size: 8px; }
  body.print-clean .off-cond dd { font-size: 10px; }
  body.print-clean .off-client-note { display: block !important; font-size: 8px; }
  .off-table { font-size: 7.5px !important; }
  .off-table td, .off-table th { padding: 2px 3px !important; }
}
.off-add-grid fieldset > .btn { justify-self: start; }
.off-kpi-in { margin: 0; border-width: 0 0 1px; border-radius: 0; }
@media (max-width: 480px) { .off-head-grid { grid-template-columns: 1fr; } }
.off-hint { padding: .6rem 1.1rem 0; margin: 0; }

/* ---------- prezzi: barra cliente e switch (v7) ---------- */
.lst-bar { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; align-items: end; justify-content: space-between; margin: 0 0 1.1rem; }
.lst-bar label { min-width: 280px; }
.lst-bar-links { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--line); }
.lst-bar-links a { padding: .45rem .8rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: .9rem; }
.lst-bar-links a.on { color: var(--cypress); border-bottom-color: var(--rose); font-weight: 600; }
.sw-load { display: grid; grid-template-columns: 1fr 1.4fr; gap: .8rem 1.2rem; align-items: start; }
.sw-load-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.sw-params-grid { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: end; }
.sw-params-grid .radios label { flex-wrap: wrap; }
.sw-fx { display: inline-flex; width: 7rem; margin-left: .4rem; }
.sw-unit { width: auto; padding: .15rem .3rem; font-size: .8rem; margin-left: .2rem; }
@media (max-width: 760px) { .sw-load { grid-template-columns: 1fr; } }
@media print {
  .lst-bar, .sw-load, .sw-params, .off-actions, .off-danger, .result-panel { display: none !important; }
  .num-in { border: 0 !important; background: transparent !important; padding: 0 !important; width: auto !important; }
  .sw-unit { border: 0; appearance: none; -webkit-appearance: none; background: transparent; }
}
.sw-opts { max-width: 820px; }
.sw-opts caption { text-align: left; padding: 0 0 .3rem; }
.sw-opt-on th, .sw-opt-on td { background: var(--sage-soft, #E6EFE9); }
.sw-opts td.small { min-width: 190px; }

/* ---------- listino per cliente: scelta completo / acquistati ---------- */
.lst-open-form { display: grid; grid-template-columns: minmax(260px, 420px) 1fr auto; gap: .8rem 1.5rem; align-items: end; }
.lst-open-form .form-actions { margin: 0; }
@media (max-width: 900px) { .lst-open-form { grid-template-columns: 1fr; } }
.lst-choice { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; padding: .75rem 1.1rem; }
.lst-choice p { flex-basis: 100%; margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.seg a { padding: .4rem .9rem; text-decoration: none; color: var(--ink-2, #444); font-size: .9rem; }
.seg a + a { border-left: 1px solid var(--line); }
.seg a.on { background: var(--cypress-2, #2E5B4F); color: #fff; }
.seg a.on .muted { color: rgba(255,255,255,.75); }
@media print { .lst-choice { display: none !important; } }
.lst-suggest { display: grid; gap: .4rem; padding: .7rem .9rem; border: 1px dashed var(--cypress-3, #3E7565); border-radius: var(--radius-s); background: var(--sage-soft, #E6EFE9); }
.lst-suggest p { margin: 0; }
.lst-suggest-row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.lst-suggest-row code { font-size: .86rem; word-break: break-all; }
.lst-open-form [hidden], fieldset[hidden] { display: none !important; }

/* ---------- switch: colonna gialla del prezzo netto attuale ---------- */
.off-table .att-col { background: #FFF3B0 !important; }
.off-table th.att-col { color: #5A4A00; }
.off-table .att-col .num-in { background: #FFFBE0; border-color: #E8D36A; font-weight: 600; }
.off-table .pct-in::placeholder { color: #8A8A8A; font-style: italic; }
@media print { .off-table .att-col { background: #FFF3B0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------- logo nei PDF e tabella switch per il cliente ---------- */
.logo-preview { padding: .6rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; width: max-content; }
.logo-preview .pdf-logo { max-height: 70px; max-width: 260px; display: block; }
.lst-print-head .pdf-logo { max-height: 62px; max-width: 220px; margin-right: 16px; }
.lst-print-head .pdf-title { flex: 1; }
.sw-client td.sw-new, .sw-client th.sw-new { background: #1F3A5F !important; color: #fff !important; font-weight: 700; }
.sw-client td.sw-cur, .sw-client th.sw-cur { background: #FFF3B0 !important; font-weight: 600; }
.sw-client th.sw-new, .sw-client th.sw-cur { text-align: right; }
@media print {
  body.print-clean .lst-print-head { align-items: center !important; }
  .sw-client td.sw-new, .sw-client th.sw-new, .sw-client td.sw-cur, .sw-client th.sw-cur { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* traduzioni di consegna, pagamento e MOQ */
.tr-box summary { cursor: pointer; font-size: .88rem; color: var(--cypress-2, #2E5B4F); font-weight: 600; }
.tr-grid { display: grid; grid-template-columns: 2.4rem repeat(3, 1fr); gap: .35rem .5rem; align-items: center; }
.tr-grid input { font-size: .85rem; padding: .3rem .45rem; }

/* ---------- listino completo impaginato per il PDF (pagine, legenda, numeri di pagina) ---------- */
.pp-wrap { display: none; }
@media print {
  body.has-pp #main > *:not(.pp-wrap) { display: none !important; }
  body.has-pp .pp-wrap { display: block; }
  .pp-page { height: 186mm; position: relative; overflow: hidden; break-after: page; page-break-after: always; box-sizing: border-box; }
  .pp-page:last-child { break-after: auto; page-break-after: auto; }
  .pp-head { display: flex; align-items: center; gap: 6mm; border-bottom: 0.6mm solid #23443B; padding-bottom: 3mm; margin-bottom: 4mm; }
  .pp-head .pp-logo { max-height: 24mm; max-width: 60mm; }
  .pp-title { flex: 1; }
  .pp-title strong { display: block; font-family: var(--serif); font-size: 22pt; color: #23443B; line-height: 1.1; }
  .pp-title span { font-size: 13pt; font-weight: 600; }
  .pp-date { font-size: 10pt; }
  .pp-cond { display: flex; gap: 3mm 12mm; margin: 0 0 6mm; flex-wrap: wrap; }
  .pp-cond dt { font-size: 7pt; text-transform: uppercase; letter-spacing: .04em; color: #666; }
  .pp-cond dd { margin: 0; font-size: 10pt; font-weight: 600; }
  .pp-legend-title { font-family: var(--serif); color: #23443B; font-size: 13pt; margin: 0 0 2mm; }
  .pp-legend { border-collapse: collapse; width: 120mm; font-size: 10pt; }
  .pp-legend th { text-align: left; font-size: 8pt; color: #555; border-bottom: 0.3mm solid #9DB5AA; padding: 1mm 2mm; }
  .pp-legend td { padding: 1.3mm 2mm; border-bottom: 0.2mm solid #E3E8E5; }
  .pp-legend td.pp-legend-cat { font-weight: 700; color: #fff; background: #23443B !important; }
  .pp-legend .n { text-align: right; }
  .pp-note { position: absolute; bottom: 9mm; left: 0; font-size: 7.5pt; color: #555; margin: 0; }
  .pp-run { height: 9mm; display: flex; justify-content: space-between; align-items: flex-start; font-size: 8pt; color: #333; border-bottom: 0.3mm solid #23443B; box-sizing: border-box; }
  .pp-run strong { color: #23443B; }
  .pp-table { width: 279mm; table-layout: fixed; border-collapse: collapse; font-size: 7pt; margin-top: 0; }
  .pp-table thead th { height: 7mm; font-size: 6.8pt; text-align: left; padding: 0 1mm; border-bottom: 0.3mm solid #9DB5AA; color: #333; vertical-align: bottom; white-space: nowrap; overflow: hidden; }
  .pp-table .n { text-align: right; }
  .pp-band th { height: 8mm; background: #23443B !important; color: #fff !important; font-family: var(--serif); font-size: 10pt; text-align: left; padding: 0 2mm; letter-spacing: .03em; }
  .pp-band span { font-family: inherit; font-size: 8pt; font-weight: 400; opacity: .85; }
  .pp-sec th { height: 5.5mm; background: #E6EFE9 !important; color: #23443B; font-size: 7pt; text-align: left; padding: 0 2mm; }
  .pp-row td { height: 7.2mm; padding: 0 1mm; border-bottom: 0.2mm solid #E3E8E5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
  .pp-name b, .pp-name i { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pp-name b { font-size: 7.4pt; line-height: 3.4mm; }
  .pp-name i { font-style: normal; font-size: 6pt; color: #666; line-height: 2.8mm; }
  .pp-table td.pp-net, .pp-table th.pp-net { background: #1F3A5F !important; color: #fff !important; font-weight: 700; }
  .pp-table td.mono { font-size: 7pt; }
  .pp-foot { position: absolute; left: 0; right: 0; bottom: 0; height: 6mm; font-size: 8pt; color: #333; display: flex; justify-content: space-between; align-items: flex-end; }
  .pp-foot span:first-child { font-weight: 600; color: #23443B; }
  .pp-wrap * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* switch: per chi è (gruppo/cliente/agente) e suggerimento sconti */
.sw3-grid { display: flex; flex-wrap: wrap; gap: .8rem 2rem; align-items: end; }
.sw3-grid label[data-target-box] { min-width: 300px; }
.sw3-grid [hidden] { display: none !important; }
.sw3-sugg { border-top: 1px solid var(--line-2); padding-top: .8rem; }
.sw3-sugg h3 { margin: 0 0 .4rem; font-size: 1rem; }
/* articoli acquistati evidenziati nel listino completo */
.sw-client tr.hl td:not(.sw-new), .sw-client tr.hl th { background: #FFF6CC; }
.sw-client tr.hl td:first-child::before { content: '★ '; color: #B8860B; }
@media print {
  .pp-row.hl td:not(.pp-net) { background: #FFF6CC !important; }
  .pp-row.hl td:first-child::before { content: '★ '; color: #B8860B; }
}
@media print { .pp-hl-note { margin: 4mm 0 0; font-size: 9pt; background: #FFF6CC !important; display: inline-block; padding: 1.5mm 3mm; } }

/* tabelle offerta/switch compatte: dettaglio costi richiudibile, caratteri più piccoli */
.costs-collapsed .cd { display: none; }
.cd-toggle { font: inherit; font-weight: 600; background: none; border: 0; color: var(--cypress-2, #2E5B4F); cursor: pointer; padding: 0 .2rem; white-space: nowrap; }
.cd-toggle:hover { text-decoration: underline; }
.cd-arrow { font-size: .9em; }
.off-table { font-size: .8rem; }
.off-table th, .off-table td { padding-left: .35rem; padding-right: .35rem; }
.off-table thead th { font-size: .74rem; white-space: normal; line-height: 1.15; }
.off-table .lst-name { min-width: 150px; max-width: 220px; font-size: .78rem; }
.off-table .lst-name span { font-size: .72rem; }
.off-table .num-in { width: 4.3rem; font-size: .8rem; padding: .15rem .3rem; }
.off-table .pct-in { width: 3.2rem; }
@media print { .cd-toggle .cd-arrow { display: none; } }
.off-table.data thead th { white-space: normal !important; vertical-align: bottom; }
.off-table.data thead th.c { white-space: nowrap !important; }
.off-table td.att-col { white-space: nowrap; }
.off-table .sw-unit { font-size: .72rem; padding: .1rem; }
.off-table td.mono { font-size: .74rem; }
.off-table .lst-name { min-width: 135px; max-width: 200px; }
.off-table .num-in { width: 3.9rem; }
.off-table .att-col .num-in { width: 3.9rem; }
.off-table td:last-child .btn-sm { padding: .1rem .35rem; }
.off-table.data.dense td, .off-table.data.dense th { padding: .32rem .3rem; }
.off-table.data.dense td.mono { font-size: .74rem; }
.off-table.data.dense td, .off-table.data.dense th { font-size: .78rem; }
.off-table.data.dense thead th { font-size: .72rem; }
.buy-filter { display: block; margin-top: .2rem; font-size: .7rem; padding: .05rem .15rem; width: auto; font-weight: 400; }
.off-table tr[hidden] { display: none; }

/* ---------- order form ---------- */
.of-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem 1rem; }
.of-head .of-wide { grid-column: span 3; }
@media (max-width: 900px) { .of-head { grid-template-columns: 1fr; } .of-head .of-wide { grid-column: auto; } }
.of-table th.of-qty, .of-table td.of-qty { background: #FFF3B0 !important; }
.of-table td.of-qty .num-in { background: #FFFBE0; border-color: #E8D36A; font-weight: 700; width: 4.2rem; }
.of-table tr.of-on td, .of-table tr.of-on th { font-weight: 600; }
.of-add { display: flex; gap: .6rem; align-items: end; padding: .6rem 1rem; }
.of-add textarea { min-width: 260px; }
.of-doc { display: none; }
@media screen { body.has-of .of-doc { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0; overflow: hidden; box-shadow: 0 8px 30px rgba(14,28,47,.12); } body.has-of .of-doc .ofx-body { padding: 0 1.4rem 1.2rem; } }
.of-client-box { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .6rem; padding: .7rem 1rem; border: 1px solid #E2C97F; border-left: 4px solid #C6A55C; background: #FFFBEF; border-radius: var(--radius); }
.of-client-box p { margin: .15rem 0 0; }
.of-client-act { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.of-client-act select { margin-left: .3rem; }
.of-banner { width: 100%; max-height: 120px; object-fit: contain; display: block; }
.of-titlebar { display: flex; justify-content: space-between; align-items: center; background: #1F3A5F; color: #fff; padding: .4rem .7rem; margin: .4rem 0; }
.of-titlebar strong { font-family: var(--serif); font-size: 1.25rem; letter-spacing: .06em; }
.of-titlebar span { font-size: .8rem; }
.of-box { display: grid; grid-template-columns: 1.2fr 1fr; gap: .4rem 1rem; background: #DCE6F2; padding: .5rem .7rem; margin-bottom: .5rem; }
.of-box span { display: block; font-size: .68rem; text-transform: uppercase; color: #1F3A5F; font-weight: 700; }
.of-company strong { font-size: 1.05rem; color: #1F3A5F; }
.of-meta { grid-column: span 2; display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: end; }
.of-brand { font-size: .82rem; }
.of-cb { font-size: 1rem; display: inline !important; }
.of-print { width: 100%; border-collapse: collapse; font-size: .72rem; }
.of-print th { background: #DCE6F2; color: #1F3A5F; font-size: .66rem; text-transform: uppercase; padding: .25rem .3rem; text-align: left; border: 1px solid #B9C9DD; }
.of-print td { padding: .18rem .3rem; border: 1px solid #DCE3EC; vertical-align: middle; }
.of-print .n { text-align: right; }
.of-print .of-cat th { background: #23443B; color: #fff; font-family: var(--serif); font-size: .78rem; text-transform: none; }
.of-print .of-name b { display: block; font-weight: 600; }
.of-print .of-name i { display: block; font-style: normal; font-size: .62rem; color: #666; }
.of-print td.of-pr { background: #1F3A5F; color: #fff; font-weight: 700; }
.of-print td.of-qty, .of-print th.of-qty { background: #FFF3B0; font-weight: 700; min-width: 3.2rem; }
.of-print tfoot th { background: #DCE6F2; font-size: .75rem; }
.of-notes { margin-top: .5rem; border: 1px solid #B9C9DD; min-height: 2.5rem; padding: .3rem .5rem; font-size: .75rem; }
.of-notes span { font-weight: 700; color: #1F3A5F; text-transform: uppercase; font-size: .66rem; }
.of-foot { font-size: .62rem; color: #666; margin-top: .3rem; }
@media print {
  body.has-of #main > *:not(.of-doc) { display: none !important; }
  body.has-of .of-doc { display: block; }
  .of-doc * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .of-print thead { display: table-header-group; }
  .of-print tfoot { display: table-row-group; }
  .of-print tr { break-inside: avoid; }
}

/* ---- Confronto Prezzi Applicati ---- */
.cp-grid { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr 1fr; gap: .7rem 1rem; }
.cp-search { display: flex; gap: .7rem; align-items: end; margin-top: .8rem; }
.cp-search label { flex: 1; }
.cp-search input { width: 100%; font-size: 1.05rem; }
@media (max-width: 900px) { .cp-grid { grid-template-columns: 1fr 1fr; } }
.cp-real { display: inline-block; background: #1F3A5F; color: #fff; font-weight: 700; padding: .12rem .45rem; border-radius: 3px; white-space: nowrap; }
.cp-avg { display: inline-block; color: #3d3d3d; font-style: italic; padding: .12rem .45rem; border: 1px dashed #b9b2a3; border-radius: 3px; white-space: nowrap; }
.cp-tag { display: inline-block; margin-left: .45rem; font-size: .62rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #1F3A5F; background: #DCE6F2; border-radius: 3px; padding: .05rem .35rem; vertical-align: 1px; }
.cp-table tr.cp-has-list td { background: #F4F8FC; }
.cp-legend { font-size: .78rem; color: var(--muted, #666); margin-left: .8rem; }
.cp-legend .cp-real, .cp-legend .cp-avg { font-size: .7rem; padding: 0 .3rem; }
.d-block { display: block; }
.cp-found tr.muted td { color: #999; }
@media print { .cp-table tr.cp-has-list td { background: #F4F8FC !important; } .cp-real { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.cp-table { font-size: .8rem; }
.cp-table th { white-space: normal; font-size: .72rem; line-height: 1.2; }
.cp-table td, .cp-table th { padding: .3rem .4rem !important; }
.cp-table td.small { font-size: .72rem; }
.cp-table td.cp-nw { white-space: nowrap; }
@media print { .no-print { display: none !important; } }

/* ---- logo VIANI nel menu e nella pagina di accesso ---- */
.brand.brand-viani { flex-direction: column; justify-content: center; gap: .55rem; padding: 1.4rem 1rem 1.1rem; margin: 0 .6rem;
  border-bottom: 1px solid rgba(201, 169, 97, .35); text-align: center; }
.brand.brand-viani img { width: 78px; height: auto; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); }
.brand.brand-viani span { font-family: var(--serif); font-size: .92rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #E6CF98; line-height: 1.3; }
.bare-brand img[src*="logo-viani-oro"] { width: 96px; height: auto; }
.bare-brand { flex-direction: column; gap: .6rem; }
.bare-brand span { font-size: 1.05rem; letter-spacing: .16em; text-transform: uppercase; color: #E6CF98; }

/* firma "Created by Andrea Mazzoni" */
.credit { margin: .9rem 0 0; text-align: center; font-family: var(--serif); font-style: italic; font-size: .8rem; letter-spacing: .04em; color: rgba(230, 207, 152, .7); }
.credit span { font-style: normal; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: .74rem; color: #E6CF98; }
.sidebar-foot .credit { margin-top: .7rem; text-align: left; }
@media print { .credit { display: none; } }

/* listini clienti allineati al FONTE */
.lst-badge { display: inline-block; margin-left: .35rem; font: 700 .58rem/1.4 var(--sans, sans-serif); letter-spacing: .05em; text-transform: uppercase; padding: 0 .3rem; border-radius: 3px; vertical-align: 1px; }
.lst-b-nuovo { background: #E3F1E8; color: #23443B; }
.lst-b-agg { background: #FBF1D6; color: #8E6E2B; }
.lst-sync { display: block; }
.lst-sync > strong { margin-right: .35rem; }
.lst-sync > .small { display: block; margin-top: .35rem; }

/* ---- stampe ordinate: tabelle e grafici interi, intestazioni ripetute ---- */
@media print {
  table.data { width: 100%; }
  table.data thead { display: table-header-group; }
  table.data tfoot { display: table-row-group; }
  table.data tr, .kpi, .chart svg, .chart-pie3d, .pie-legend li { break-inside: avoid; page-break-inside: avoid; }
  .panel-head, .panel > h2, .lst-cat, .lst-sec, tr.lst-cat, tr.lst-sec { break-after: avoid; page-break-after: avoid; }
  .chart, .chart-card, .chart-grid > * { break-inside: avoid; page-break-inside: avoid; }
  .panel { overflow: visible !important; }
  .table-wrap { overflow: visible !important; max-height: none !important; }
}
body.pp-measure .table-wrap, body.pp-measure .table-wrap.tall { max-height: none !important; overflow: visible !important; }
@media print {
  .panel.print-keep, .chart-panel.print-keep, .result-panel.print-keep { break-inside: avoid !important; page-break-inside: avoid !important; }
  table.data tbody tr:last-child { break-after: avoid; page-break-after: avoid; }
  table.data tfoot tr { break-before: avoid; page-break-before: avoid; }
}
@media print { #t-margini { font-size: 8px; } #t-margini th, #t-margini td { padding: 2px 3px !important; } }
@media print { .pp-run-l { display: flex; align-items: center; gap: 3mm; } .pp-run-logo { height: 7.5mm; width: auto; margin-top: -1mm; } .pp-run { align-items: center; } }

/* nome sotto il logo su tre righe: SALES INSIGHT / by / ANDREA MAZZONI */
.brand-lines { display: flex; flex-direction: column; align-items: center; gap: .1rem; line-height: 1.2; }
.brand-lines .bl-main, .brand-lines .bl-name { font-family: var(--serif); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #E6CF98; }
.brand-lines .bl-by { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: .8em; letter-spacing: .04em; color: rgba(230, 207, 152, .75); text-transform: none !important; }
.brand.brand-viani .brand-lines { font-size: .9rem; }
.bare-brand .brand-lines { font-size: 1.05rem; }
.brand.brand-viani span.brand-lines span, .bare-brand .brand-lines span { text-transform: none; }
.brand.brand-viani .bl-main, .brand.brand-viani .bl-name, .bare-brand .bl-main, .bare-brand .bl-name { text-transform: uppercase; }
.brand.brand-viani .brand-lines span, .bare-brand .brand-lines span { font-size: .92rem; line-height: 1.25; }
.bare-brand .brand-lines span { font-size: 1.05rem; }
.brand.brand-viani .brand-lines .bl-by, .bare-brand .brand-lines .bl-by { font-size: .78rem; letter-spacing: .06em; font-style: italic; font-weight: 400; text-transform: none; color: rgba(230, 207, 152, .8); }

/* ---- gruppo: aderenti ---- */
.grp-seg button { border: 0; background: none; padding: .4rem .8rem; font: inherit; font-size: .85rem; cursor: pointer; color: var(--ink-2, #444); }
.grp-seg button + button { border-left: 1px solid var(--line); }
.grp-seg button.on { background: var(--cypress, #23443B); color: #fff; }
.grp-hint { margin: 0 1rem .5rem; }
.grp-heat th.grp-fam { vertical-align: bottom; min-width: 84px; max-width: 110px; white-space: normal; line-height: 1.15; font-size: .72rem; }
.grp-heat td.grp-cell { min-width: 84px; font-variant-numeric: tabular-nums; transition: background .2s; }
.grp-heat td.grp-cell.zero { color: #bbb; }
.grp-heat tbody th { white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.grp-charts-title { font-family: var(--serif); margin: 1.6rem 0 .6rem; color: var(--cypress, #23443B); }
@media print { .grp-heat td.grp-cell { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .grp-seg { display: none; } }
.grp-hint[hidden] { display: none !important; }
.grp-panel #t-grp { font-size: .8rem; }
.grp-panel #t-grp th, .grp-panel #t-grp td { padding: .35rem .45rem; }
.grp-panel #t-grp tbody th { min-width: 170px; }
.grp-panel #t-grp td.small { white-space: nowrap; font-size: .72rem; }
.grp-panel #t-grp .w-bar { width: 105px; min-width: 105px; }

/* ---- v16: versione, schede Tabelle | Grafici ---- */
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.app-version { font: 600 .7rem/1 var(--font); letter-spacing: .08em; color: rgba(230, 207, 152, .75); border: 1px solid rgba(201, 169, 97, .35); border-radius: 99px; padding: .2rem .5rem; }
.view-tabs { display: flex; gap: .3rem; margin: 0 0 1rem; border-bottom: 1px solid var(--line); }
.view-tabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.view-tabs a:hover { color: var(--ink); }
.view-tabs a.on { color: var(--cypress); border-bottom-color: var(--gold); }
.view-tabs .ico { width: 16px; height: 16px; }
/* ---- qualità dati ---- */
.q-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; margin: 0 0 1.2rem; }
.q-card { display: grid; gap: .25rem; padding: .9rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.q-card .q-n { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; }
.q-card .q-t { font-size: .85rem; line-height: 1.3; }
.q-card .q-e { font-size: .78rem; color: var(--muted); }
.q-card.q-high { border-left-color: var(--neg); } .q-card.q-high .q-n { color: var(--neg); }
.q-card.q-med { border-left-color: #D98C1F; } .q-card.q-med .q-n { color: #B26B00; }
.q-card.q-info { border-left-color: var(--cypress-3); } .q-card.q-info .q-n { color: var(--cypress-3); }
.q-card.q-ok { border-left-color: var(--pos); opacity: .8; } .q-card.q-ok .q-n { color: var(--pos); }
.q-panel > summary { cursor: pointer; list-style: none; }
.q-panel > summary::-webkit-details-marker { display: none; }
.q-panel > summary h2::before { content: "▸ "; color: var(--gold); }
.q-panel[open] > summary h2::before { content: "▾ "; }
.q-why { margin: 0 1rem .6rem; }

.sys-grid { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.2rem; margin: 0; }
.sys-grid dt { color: var(--muted); }
.sys-grid dd { margin: 0; }
.sys-pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .5rem; border-radius: 99px; margin: 0 .2rem .2rem 0; }
.sys-pill.ok { background: #E3F1E8; color: var(--pos); }
.sys-pill.ko { background: var(--neg-soft); color: var(--neg); }
/* ---- Home direzionale ---- */
.home-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; padding: 1.4rem 1.6rem; margin-bottom: 1rem; border-radius: var(--radius);
  background: radial-gradient(900px 300px at 100% 0%, rgba(201,169,97,.22), transparent 60%), linear-gradient(135deg, #13233A, #1E3553); color: #fff; box-shadow: var(--shadow); }
.home-hero h1 { margin: .2rem 0; font-family: var(--serif); font-size: 2.1rem; color: #fff; }
.home-kick { margin: 0; color: var(--gold-2); letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; font-weight: 600; }
.home-sub { margin: 0; color: #C9D3E0; }
.home-find { display: flex; gap: .5rem; }
.home-find input { min-width: 280px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; padding: .55rem .8rem; }
.home-find input::placeholder { color: #B9C3D2; }
.kpis.kpis-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .kpis.kpis-5 { grid-template-columns: repeat(2, 1fr); } }
.home-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 1000px) { .home-grid { grid-template-columns: 1fr; } }
.home-area { padding: .7rem 1rem; border-top: 1px solid var(--line-2); }
.home-area .ha-l { margin: 0; font-weight: 600; }
.home-area .ha-v { margin: .2rem 0; font-family: var(--serif); font-size: 1.4rem; }
.home-h2 { font-family: var(--serif); margin: 1.4rem 0 .7rem; color: var(--cypress); }
.home-alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1rem; }
.ha-card { border-top: 4px solid var(--line); }
.ha-card .hint { margin: 0 1rem .5rem; }
.ha-card.ha-red { border-top-color: var(--neg); } .ha-card.ha-amber { border-top-color: #D98C1F; } .ha-card.ha-green { border-top-color: var(--pos); } .ha-card.ha-blue { border-top-color: var(--gold); }
.ha-card table a { color: var(--cypress-2); font-weight: 600; text-decoration: none; }
.ha-card table a:hover { text-decoration: underline; }
.ha-sys { margin: .5rem 1rem; padding-left: 1.1rem; line-height: 1.7; }
.ha-card > p { margin: .5rem 1rem 1rem; }
/* ---- scheda cliente ---- */
.sc-tag { display: inline-block; margin-right: 1rem; }
tr.sc-sotto td { background: #FFF4F2; }
.sc-flag { color: var(--neg); font-size: .7rem; }
.sc-docs { list-style: none; padding: .3rem 1rem 1rem; margin: 0; line-height: 2; }
.sc-docs a { text-decoration: none; color: var(--cypress-2); font-weight: 600; }
/* ---- analisi clienti ---- */
.ac-bridge { display: grid; grid-template-columns: repeat(7, 1fr); gap: .6rem; padding: .5rem 1.2rem 1.2rem; align-items: end; }
.acb-col { display: grid; gap: .3rem; text-align: center; }
.acb-track { position: relative; height: 200px; background: linear-gradient(0deg, var(--line-2) 1px, transparent 1px) 0 0 / 100% 25%; border-bottom: 1px solid var(--line); }
.acb-bar { position: absolute; left: 18%; right: 18%; border-radius: 4px 4px 0 0; }
.acb-base { background: var(--cypress); } .acb-up { background: #2E8B62; } .acb-down { background: var(--neg); }
.acb-v { font-size: .86rem; font-variant-numeric: tabular-nums; }
.acb-l { font-size: .78rem; color: var(--ink-2); }
.abc { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-weight: 700; font-size: .78rem; color: #fff; }
.abc-A { background: var(--cypress); } .abc-B { background: var(--gold); color: #13233A; } .abc-C { background: #A3B1AB; }
.segtag { font-size: .72rem; font-weight: 600; padding: .1rem .45rem; border-radius: 99px; }
.seg-nuovi { background: #E3F1E8; color: var(--pos); } .seg-persi { background: var(--neg-soft); color: var(--neg); }
.seg-crescita { background: #E8F3EE; color: #2E8B62; } .seg-calo { background: #FFF1E0; color: #B26B00; } .seg-stabili { background: var(--line-2); color: var(--muted); }
.ac-bridge .acb-track::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; border-bottom: 2px dashed var(--line); }
.pvm-say { margin: .2rem 1rem .4rem; font-size: 1.05rem; font-family: var(--serif); color: var(--cypress); }
.pvm-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem 1.5rem; padding: 0 1.2rem 1.2rem; font-size: .84rem; color: var(--ink-2); }
@media (max-width: 900px) { .pvm-legend { grid-template-columns: 1fr; } }
/* ---- budget ---- */
.bu-year { margin-left: auto; align-self: center; }
.bu-table td.bu-in input { width: 110px; text-align: right; padding: .25rem .4rem; border: 1px solid #E2C97F; background: #FFFBEF; border-radius: 4px; font: inherit; }
.bu-table th.bu-in { background: #FBF1D6; }
.bu-bar { position: relative; display: block; height: 20px; background: var(--line-2); border-radius: 4px; overflow: hidden; min-width: 110px; }
.bu-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.bu-bar.bu-ok i { background: #8CC9A6; } .bu-bar.bu-mid i { background: #F1C76B; } .bu-bar.bu-ko i { background: #E9A39B; }
.bu-bar b { position: relative; padding-left: .4rem; font-size: .76rem; line-height: 20px; }
.bu-bar em { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--cypress); }
.bu-fill input { width: 52px; text-align: right; }

/* Offerte come trattative */
.st-badge { display: inline-block; border: 1px solid transparent; border-radius: 999px; padding: .1rem .6rem; font-size: .78rem; font-weight: 600; line-height: 1.5; cursor: default; font-family: inherit; }
button.st-badge { cursor: pointer; }
button.st-badge:hover { filter: brightness(.95); box-shadow: 0 0 0 2px rgba(201,169,97,.35); }
.st-inviata { background: #E8EEF6; color: #2B4A73; border-color: #C9D6E8; }
.st-trattativa { background: #FBF3E0; color: #8A6514; border-color: #EAD9A8; }
.st-accettata { background: #E4F3EA; color: #1E6B3D; border-color: #BFE0CB; }
.st-persa { background: #F8E6E4; color: #9B2C20; border-color: #EBC3BE; }
.st-why { display: block; max-width: 14rem; white-space: normal; margin-top: .15rem; }
.st-dialog { border: 1px solid var(--line, #ddd); border-radius: 12px; padding: 1.25rem 1.5rem; width: min(30rem, 92vw); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.st-dialog::backdrop { background: rgba(19,35,58,.45); }
.st-dialog h3 { margin: 0 0 1rem; font-size: 1.05rem; }
.st-opts { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.st-opt { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; }
.st-opt input:checked + .st-badge { box-shadow: 0 0 0 2px #13233A; }
.st-field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; font-size: .9rem; }
.st-field input { padding: .45rem .6rem; border: 1px solid var(--line, #ccc); border-radius: 8px; font: inherit; }
.st-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
.kpis.kpis-4 { grid-template-columns: repeat(4, 1fr); margin: 0 1rem 1rem; }
.pipe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 0 1rem 1rem; }
@media (max-width: 1000px) { .pipe-grid { grid-template-columns: 1fr; } .kpis.kpis-4 { grid-template-columns: 1fr 1fr; } }
.winbar { display: inline-block; width: 3rem; height: .45rem; border-radius: 4px; margin-right: .4rem; vertical-align: middle;
  background: linear-gradient(90deg, #C9A961 var(--w), #E9E4D8 var(--w)); }
.pipe-why { padding: 0 1rem 1rem; }
.badge-warn { background: #FBE9D0; color: #8A4B08; }

/* Ritorno dell'order form */
.of-import { border-top: 1px dashed var(--line, #ddd); }
.of-import input[type=file] { font-size: .85rem; max-width: 18rem; }
.of-cnote-t { margin: .35rem 0 0; white-space: normal; background: #FBF7EC; border-left: 3px solid #C9A961; padding: .5rem .75rem; border-radius: 4px; }
.imp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 1000px) { .imp-grid { grid-template-columns: 1fr; } }
.imp-grid .panel { padding-bottom: 1rem; }
.imp-grid .panel > p, .imp-grid .panel > h3 { padding: 0 1rem; }
.imp-h3 { font-size: .95rem; margin: 1rem 0 0; }
.imp-chk { padding: .5rem 1rem 0; }
.imp-warn ul { margin: 0; padding: .25rem 1rem 1rem 2rem; }
.imp-table tr.imp-ch td { background: #FBF3E0; }
.imp-actions { display: flex; justify-content: flex-end; gap: .6rem; margin: 1rem 0 2rem; }

/* Storico listino FONTE */
.ls-filter { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ls-filter input[type=search], .ls-filter select { padding: .4rem .6rem; border: 1px solid var(--line, #ccc); border-radius: 8px; font: inherit; }
.ls-tag { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600; }
.ls-nuovo { background: #E4F3EA; color: #1E6B3D; }
.ls-tolto { background: #F8E6E4; color: #9B2C20; }
.ls-prezzo { background: #FBF3E0; color: #8A6514; }
.ls-empty { padding: 1.5rem; }

/* Viste salvate */
.sel-tools { display: flex; gap: .5rem; align-items: flex-start; flex-wrap: wrap; }
.vw-menu { position: relative; }
.vw-menu > summary { list-style: none; cursor: pointer; }
.vw-menu > summary::-webkit-details-marker { display: none; }
.vw-n { display: inline-block; min-width: 1.2rem; padding: 0 .3rem; border-radius: 999px; background: #C9A961; color: #13233A; font-size: .72rem; font-weight: 700; text-align: center; margin-left: .2rem; }
.vw-pop { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 40; width: 18rem; background: #fff; border: 1px solid var(--line, #ddd); border-radius: 10px; box-shadow: 0 14px 36px rgba(19,35,58,.18); padding: .6rem; }
.vw-list { list-style: none; margin: 0 0 .5rem; padding: 0; max-height: 15rem; overflow: auto; }
.vw-list li { display: flex; align-items: center; justify-content: space-between; gap: .4rem; border-radius: 6px; }
.vw-list li:hover { background: #F6F2E8; }
.vw-list a { flex: 1; padding: .35rem .5rem; text-decoration: none; color: inherit; font-weight: 500; }
.vw-list form { margin: 0; }
.vw-del { border: 0; background: none; color: #9B2C20; font-size: 1.1rem; cursor: pointer; padding: 0 .45rem; line-height: 1; }
.vw-empty { margin: .2rem .3rem .6rem; }
.vw-save { display: flex; gap: .35rem; border-top: 1px solid var(--line, #eee); padding-top: .55rem; }
.vw-save input { flex: 1; min-width: 0; padding: .35rem .5rem; border: 1px solid var(--line, #ccc); border-radius: 7px; font: inherit; font-size: .88rem; }
@media print { .vw-menu { display: none !important; } }
.st-opt { position: relative; }
.st-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.st-opt input:focus-visible + .st-badge { outline: 2px solid #C9A961; outline-offset: 2px; }
.st-opt .st-badge { cursor: pointer; padding: .3rem .8rem; font-size: .85rem; }
.imp-chk label, .panel-tools label.small { display: inline-flex; flex-direction: row; align-items: center; gap: .45rem; margin: 0; font-weight: 500; }
.imp-chk input[type=checkbox], .panel-tools label.small input[type=checkbox] { width: auto; margin: 0; }
.ls-filter { flex-wrap: nowrap; }
.ls-filter input[type=search] { width: 15rem; }
.ls-filter select { width: auto; }

/* Stampa: impaginazione a blocchi interi (v20) */
@media print {
  .pp-flow { display: block !important; }
  .pp-flow > .print-keep { display: inline-block !important; vertical-align: top; width: var(--ppw, 100%) !important; margin: 0 4px 8px 0 !important;
    break-inside: avoid !important; page-break-inside: avoid !important; }
  .pp-flow > :not(.print-keep) { display: block !important; width: 100% !important; }
  .print-keep { break-inside: avoid !important; page-break-inside: avoid !important; }
  h1, h2, h3, .home-h2, .panel-head { break-after: avoid !important; page-break-after: avoid !important; }
  .home-alerts { gap: 0 !important; }
}

/* Tabelle larghe che devono stare nella pagina senza scorrere (Marginalità) */
table.fit-table { width: 100%; }
table.fit-table thead th { white-space: normal; line-height: 1.2; vertical-align: bottom; font-size: .78rem; }
table.fit-table td, table.fit-table th { padding-left: .45rem; padding-right: .45rem; }
table.fit-table td { font-size: .84rem; }
table.fit-table .fit-desc { min-width: 12rem; white-space: normal; }
table.fit-table .w-bar-s { min-width: 0; }
table.fit-table .mbar { min-width: 92px; }
@media (max-width: 1350px) { table.fit-table td { font-size: .8rem; } table.fit-table .mbar { min-width: 80px; } }
table.fit-table thead th, table.fit-table thead th.n { white-space: normal !important; }
table.fit-table td.fit-desc { white-space: normal !important; min-width: 11rem; max-width: 17rem; }
@media (max-width: 1400px) {
  table.fit-table td, table.fit-table th { padding-left: .3rem !important; padding-right: .3rem !important; }
  table.fit-table td { font-size: .76rem; }
  table.fit-table thead th { font-size: .72rem; }
  table.fit-table td.fit-desc { min-width: 9rem; max-width: 12rem; }
  table.fit-table .mbar { min-width: 70px; padding: .1rem .25rem; }
}
#t-margini thead th:first-child, #t-margini tbody td:first-child { width: 1.6rem; font-size: .7rem; }

/* Offerte: come funziona */
.off-how { border-left: 4px solid #C9A961; }
.off-how-sum { display: flex; gap: .8rem; align-items: center; padding: .9rem 1.1rem; cursor: pointer; list-style: none; }
.off-how-sum::-webkit-details-marker { display: none; }
.off-how-q { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #13233A; color: #C9A961; font-weight: 700; flex: none; }
.off-how-steps { counter-reset: oh; list-style: none; margin: 0; padding: 0 1.1rem 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .8rem; }
.off-how-steps li { counter-increment: oh; background: #FBF8F1; border: 1px solid #EFE6D2; border-radius: 10px; padding: .75rem .85rem; font-size: .86rem; display: flex; flex-direction: column; gap: .3rem; }
.off-how-steps li::before { content: counter(oh); font: 700 1.1rem var(--serif, Georgia); color: #C9A961; }
.off-how-ex { margin: .9rem 1.1rem 1.1rem; font-size: .88rem; background: #EEF2F7; border-radius: 8px; padding: .6rem .8rem; }
@media (max-width: 1100px) { .off-how-steps { grid-template-columns: 1fr 1fr; } }
@media print { .off-how { display: none !important; } }

/* ANALISI > Codici attivi */
.cod-form { display: flex; flex-wrap: wrap; gap: .6rem .9rem; align-items: flex-end; justify-content: flex-end; max-width: 46rem; }
.cod-form label { display: flex; flex-direction: column; gap: .2rem; font-size: .76rem; color: var(--muted); }
.cod-form select, .cod-form input { padding: .35rem .5rem; border: 1px solid var(--line, #ccc); border-radius: 7px; font: inherit; font-size: .88rem; color: var(--ink); width: auto; }
.cod-form input[type=number] { width: 4.2rem; }
.cod-both, .cod-bal { --c: #13233A; } .cod-pi { --c: #3E6FA3; } .cod-pe { --c: #8A6E3B; } .cod-ita { --c: #2E8B57; } .cod-exp { --c: #C9A961; }
.cod-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; background: var(--c); margin-right: .45rem; vertical-align: -1px; }
.cod-seg { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 14%, white); color: color-mix(in srgb, var(--c) 85%, black); border: 1px solid color-mix(in srgb, var(--c) 30%, white); }
.kpi-alert { background: #FDF6F4; }
.cod-insights ul { margin: 0; padding: .3rem 1.25rem 1rem 2.4rem; display: grid; gap: .45rem; line-height: 1.45; }
.cod-insights li::marker { color: #C9A961; }
.cod-insights .neg-li { color: var(--neg); }
.cod-bars { padding: .4rem 1.25rem .6rem; }
.cod-bar-row { display: grid; grid-template-columns: 7rem 1fr; gap: .8rem; align-items: center; margin: .35rem 0; }
.cod-bar-l { font-size: .82rem; color: var(--muted); text-align: right; }
.cod-bar { display: flex; height: 1.6rem; border-radius: 6px; overflow: hidden; background: #eee; }
.cod-bar span { background: var(--c); color: #fff; font-size: .72rem; font-weight: 600; display: grid; place-items: center; overflow: hidden; white-space: nowrap; }
.cod-bar span.cod-exp { color: #13233A; }
.cod-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin: .5rem 0 0 7.8rem; font-size: .78rem; color: var(--muted); }
.cod-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; background: var(--c); margin-right: .35rem; vertical-align: -1px; }
.cod-mk .cod-mk-main th, .cod-mk .cod-mk-main td { font-weight: 600; }
.cod-mk .cod-mk-sub th { padding-left: 1.7rem !important; font-weight: 400; color: var(--ink-2); }
.cod-mk .cod-mk-sub td { color: var(--ink-2); }
.cod-pareto { padding: .3rem 1.25rem 1.1rem; display: grid; gap: .45rem; }
.cod-par { display: grid; grid-template-columns: 9rem 1fr 3.5rem; gap: .8rem; align-items: center; font-size: .86rem; }
.cod-par strong { text-align: right; font-variant-numeric: tabular-nums; }
.cod-par-bar { height: .9rem; background: #EEE9DD; border-radius: 4px; overflow: hidden; }
.cod-par-bar i { display: block; height: 100%; background: linear-gradient(90deg, #13233A, #3E6FA3); }
.cod-mixh { min-width: 8rem; }
.cod-mini { display: flex; height: .7rem; width: 8rem; border-radius: 3px; overflow: hidden; background: #eee; }
.cod-mini i { display: block; background: var(--c); }
.cod-why { display: inline-block; margin: 0 .25rem .15rem 0; padding: 0 .45rem; border-radius: 4px; font-size: .7rem; background: #F1EEE6; color: #5F5A4E; white-space: nowrap; }
.cod-why-perdita, .cod-why-calo { background: #F8E6E4; color: #9B2C20; }
.cod-abc { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; font-size: .72rem; font-weight: 700; }
.cod-abc-A { background: #13233A; color: #C9A961; } .cod-abc-B { background: #DCE4EE; color: #13233A; } .cod-abc-C { background: #F1EEE6; color: #8A8270; }
tr.cod-row-cand td { background: #FDF6F4; }
.cod-opp { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 1100px) { .cod-opp { grid-template-columns: 1fr; } }
.panel-tools select { padding: .3rem .45rem; border: 1px solid var(--line, #ccc); border-radius: 7px; font: inherit; font-size: .85rem; }
@media print { .cod-form { display: none !important; } .cod-bar span, .cod-mini i, .cod-par-bar i, .cod-dot, .cod-abc { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.cod-sel .sel-ribbon { flex-wrap: wrap; }
.cod-sel .sel-text { flex: 1 1 100%; }
.cod-form { max-width: none; width: 100%; justify-content: flex-start; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line, #eee); }
.cod-whyh { min-width: 15rem; }
.cod-seg { font-size: .68rem; padding: .05rem .4rem; }
#t-cod td .cod-seg { white-space: normal; }
#t-cod thead th:first-child, #t-cod tbody td:first-child { width: 1.8rem; font-size: .72rem; }
#t-cod td.fit-desc { max-width: 15rem; }
.cod-mk th[scope=row] { min-width: 10.5rem; white-space: normal !important; }
#t-cod td.fit-desc { max-width: 13.5rem; }
.cod-fam .cod-mini { width: 6rem; }
@media (max-width: 1400px) {
  .cod-whyh { min-width: 9rem; }
  #t-cod td.fit-desc, .cod-candt td.fit-desc { max-width: 10rem; }
  #t-cod thead th:first-child, #t-cod tbody td:first-child { display: none; }
}
.panel-tools select { width: auto !important; }
#t-cod td .cod-seg { white-space: nowrap; }
#t-cod td.fit-desc { max-width: 12.5rem; } @media (max-width: 1400px) { #t-cod td.fit-desc { max-width: 10rem; } }

/* Consegna / pagamento: menu a tendina + testo */
.terms-field { display: flex; gap: .45rem; flex-wrap: wrap; width: 100%; }
.terms-field select { flex: 0 1 auto; min-width: 9rem; max-width: 100%; }
.terms-field input { flex: 1 1 10rem; min-width: 8rem; }
.terms-field input[hidden] { display: none !important; }

/* Scheda anagrafica cliente */
.span-2 { grid-column: span 2; }
@media (max-width: 700px) { .span-2 { grid-column: auto; } }
.ana-new { display: flex; gap: .5rem; align-items: center; }
.ana-new input { min-width: 18rem; padding: .4rem .6rem; border: 1px solid var(--line, #ccc); border-radius: 8px; font: inherit; }
.ana-cp { display: inline-block; width: 4rem; height: .45rem; background: #EEE9DD; border-radius: 4px; overflow: hidden; vertical-align: middle; }
.ana-cp i { display: block; height: 100%; background: #C9A961; }
.ana-doc { background: #F4F6F9; border-radius: 14px; overflow: hidden; border: 1px solid var(--line, #e3e6ea); margin-bottom: 1.5rem; }
.ana-hero { background: #13233A; color: #fff; padding: 1.6rem 2rem 1.3rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 4px solid #C9A961; }
.ana-hero-l { display: flex; gap: 1rem; align-items: center; }
.ana-hero-ico { width: 2.6rem; height: 2.6rem; color: #C9A961; flex: none; }
.ana-hero h1 { margin: 0; font-family: var(--serif); font-size: 1.9rem; letter-spacing: .02em; color: #fff; }
.ana-hero p { margin: .2rem 0 0; color: #C8D0DC; font-size: .95rem; }
.ana-hero-r { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }
.ana-hero-r img { height: 2.6rem; width: auto; filter: brightness(1.15); }
.ana-hero-name { background: rgba(201,169,97,.18); color: #E8D5A6; border: 1px solid rgba(201,169,97,.5); border-radius: 999px; padding: .15rem .8rem; font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.ana-sec { background: #fff; margin: 1rem 1.25rem; border: 1px solid #E3E7EC; border-radius: 12px; padding: .4rem 0 .6rem; }
.ana-sec-h { display: flex; align-items: center; gap: .7rem; padding: .7rem 1.1rem .6rem; border-bottom: 1px solid #E3E7EC; margin: 0 .2rem .2rem; }
.ana-sec-h h2 { margin: 0; font-family: var(--sans, inherit); font-size: 1.12rem; font-weight: 700; color: #13233A; }
.ana-num { display: inline-grid; place-items: center; min-width: 2.1rem; height: 2.1rem; border-radius: 8px; background: #F6EFDD; color: #9A7B33; font-weight: 700; font-size: .95rem; margin-right: .1rem; }
.ana-kv { margin: 0; }
.ana-kv > div { display: grid; grid-template-columns: minmax(10rem, 26%) 1fr; }
.ana-kv > div:nth-child(even) { background: #F7F8FA; }
.ana-kv dt { padding: .55rem 1.2rem; color: #6B7684; border-right: 1px solid #E3E7EC; }
.ana-kv dd { margin: 0; padding: .55rem 1.2rem; color: #1E2530; }
.ana-kv a, .ana-ct a { color: #1F4E79; text-decoration: none; }
.ana-empty { color: #A0A8B3; font-style: italic; }
.ana-ct { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ana-ct thead th { background: #EEF2F6; color: #13233A; text-align: left; padding: .55rem .9rem; font-size: .82rem; font-weight: 700; }
.ana-ct td, .ana-ct tbody th { padding: .65rem .9rem; border-bottom: 1px solid #EEF0F3; border-right: 1px solid #EEF0F3; text-align: left; }
.ana-ct tbody th { font-weight: 600; color: #1E2530; }
.ana-ct tbody tr:nth-child(even) { background: #F9FAFB; }
.ana-agent { display: grid; grid-template-columns: 1.6fr 1fr; gap: .8rem; padding: .7rem 1rem .3rem; }
.ana-agent > div { background: #F6EFDD; border-radius: 8px; padding: .6rem .9rem; display: flex; flex-direction: column; gap: .2rem; }
.ana-agent span { color: #9A7B33; font-size: .74rem; font-weight: 700; letter-spacing: .05em; }
.ana-agent strong { font-weight: 500; color: #1E2530; font-size: 1.02rem; }
.ana-notes { margin: .5rem 1.2rem .3rem; line-height: 1.55; }
.ana-foot { display: flex; justify-content: space-between; padding: .6rem 1.4rem 1rem; color: #6B7684; font-size: .82rem; border-top: 1px solid #E3E7EC; margin: 0 1.25rem; }
.ana-fsec h2 { display: flex; align-items: center; gap: .6rem; }
.ana-ct-edit input { width: 100%; min-width: 7rem; }
.ana-delf { margin: 0 0 2rem; }
@media print {
  .ana-doc { border: 0; border-radius: 0; background: #fff; margin: 0; }
  .ana-hero { padding: 5mm 6mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ana-hero h1 { font-size: 18pt; }
  .ana-sec { margin: 3mm 0; break-inside: avoid; page-break-inside: avoid; }
  .ana-kv dt, .ana-kv dd { padding: 1.4mm 4mm; font-size: 9pt; }
  .ana-ct td, .ana-ct th { padding: 1.4mm 3mm !important; font-size: 8.5pt; }
  .ana-num, .ana-agent > div, .ana-kv > div:nth-child(even), .ana-ct thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ana-foot { margin: 0; }
}

/* Switch prezzi attuali / nuovi */
.swp-new-f { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-end; padding: 0 1.25rem 1.1rem; }
.swp-new-f label { flex: 1 1 22rem; }
.swp-new-f .hint { flex: 1 1 100%; margin: 0; }
.swp-cond td, .swp-cond th { vertical-align: middle; }
.swp-cond td:nth-child(2) { color: var(--muted); width: 32%; }
.swp-cond td:nth-child(3) { width: 45%; }
.swp-cond select, .swp-cond input[type=text], .swp-cond input[type=date] { width: 100%; }
.swp-short { max-width: 9rem; }
.swp-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.swp-chips .sel-chip { border: 1px solid #EAD9A8; cursor: pointer; font: inherit; font-size: .82rem; }
.swp-chips .sel-chip:hover { background: #F6EFDD; }
.swp-src { font-weight: 600; margin: 0; }
.swp-load { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 1000px) { .swp-load { grid-template-columns: 1fr; } }
.swp-load select, .swp-load textarea { width: 100%; }
.swp-rules { display: grid; gap: .8rem; }
.swp-rule { border: 1px solid var(--line, #e3e3e3); border-left: 4px solid #C9A961; border-radius: 10px; padding: .7rem 1rem; background: #FFFDF8; display: grid; gap: .6rem; }
.swp-rule-h { display: flex; justify-content: space-between; align-items: center; }
.swp-fams { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.swp-fams label.is-off { opacity: .45; }
.swp-all { background: #13233A; color: #fff; border-radius: 6px; padding: .15rem .6rem; }
.swp-all strong { color: #C9A961; }
.swp-rule-v { display: flex; gap: 1rem; flex-wrap: wrap; }
.swp-rule-v label { max-width: 14rem; }
.swp-kpis { margin: 0 1rem 1rem; }
.swp-table tr.swp-fam th, .swp-doc-t2 tr.swp-fam th { background: #13233A; color: #E8D5A6; text-align: left; font-size: .78rem; letter-spacing: .05em; padding: .35rem .7rem; }
.swp-table .swp-newcol, .swp-doc-t2 .swp-newcol { background: #FBF6E8; }
.swp-table tr.swp-nd td { color: var(--muted); }
.swp-rn { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #C9A961; color: #13233A; font-size: .66rem; font-weight: 700; margin-left: .25rem; }
.swp-doc { background: #fff; border: 1px solid var(--line, #e3e6ea); border-radius: 12px; padding: 0 0 1rem; overflow: hidden; margin-bottom: 1.5rem; }
.swp-doc-h { display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem; align-items: center; background: #13233A; color: #fff; padding: 1.2rem 1.6rem; border-bottom: 4px solid #C9A961; }
.swp-doc-h img { height: 3.2rem; width: auto; }
.swp-doc-k { margin: 0; color: #C9A961; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; }
.swp-doc-h h1 { margin: .15rem 0; font-family: var(--serif); font-size: 1.8rem; letter-spacing: .06em; color: #fff; }
.swp-doc-c { margin: 0; font-size: 1.05rem; color: #E8D5A6; font-weight: 600; }
.swp-doc-d { display: grid; grid-template-columns: auto auto; gap: .2rem .8rem; border: 1px solid rgba(201,169,97,.6); border-radius: 8px; padding: .6rem .9rem; font-size: .8rem; }
.swp-doc-d span { color: #C8D0DC; text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; align-self: center; }
.swp-doc-why { margin: 1rem 1.6rem 0; background: #FBF7EC; border-left: 4px solid #C9A961; border-radius: 6px; padding: .7rem 1rem; }
.swp-doc-why h2 { margin: 0 0 .3rem; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: #9A7B33; }
.swp-doc-why p { margin: 0; line-height: 1.5; }
.swp-doc-cond { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 1.6rem 0; }
.swp-doc-cond > div { border: 1px solid #E3E7EC; border-radius: 8px; padding: .45rem .8rem; display: flex; flex-direction: column; min-width: 9rem; }
.swp-doc-cond span, .swp-doc-sum span { font-size: .68rem; color: #6B7684; text-transform: uppercase; letter-spacing: .06em; }
.swp-doc-sum { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 1.6rem 0; }
.swp-doc-sum > div { background: #F4F6F9; border-radius: 8px; padding: .5rem .9rem; display: flex; flex-direction: column; min-width: 10rem; }
.swp-doc-sum strong { font-family: var(--serif); font-size: 1.3rem; }
.swp-doc-sum em { font-style: normal; font-size: .78rem; color: #6B7684; }
.swp-doc-chg { flex: 1 1 100%; }
.swp-doc-chg em { display: block; color: #1E2530; }
.swp-doc-t2 { width: calc(100% - 3.2rem); margin: 1rem 1.6rem 0; border-collapse: collapse; font-size: .86rem; }
.swp-doc-t2 thead th { background: #EEF2F6; color: #13233A; font-size: .74rem; padding: .45rem .55rem; text-align: left; }
.swp-doc-t2 thead th.n, .swp-doc-t2 td.n { text-align: right; }
.swp-doc-t2 td { padding: .35rem .55rem; border-bottom: 1px solid #EEF0F3; }
.swp-doc-note { margin: .8rem 1.6rem 0; font-size: .78rem; color: #6B7684; }
@media print {
  .swp-doc { border: 0; border-radius: 0; margin: 0; }
  .swp-doc-h, .swp-doc-t2 tr.swp-fam th, .swp-doc-t2 .swp-newcol, .swp-doc-t2 thead th, .swp-doc-why, .swp-doc-sum > div { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .swp-doc-h { padding: 4mm 5mm; }
  .swp-doc-t2 { width: 100%; margin: 3mm 0 0; font-size: 8.5pt; }
  .swp-doc-t2 thead { display: table-header-group; }
  .swp-doc-t2 tr { break-inside: avoid; }
  .swp-doc-t2 td, .swp-doc-t2 th { padding: 1mm 2mm !important; }
  .swp-doc-why, .swp-doc-cond, .swp-doc-sum, .swp-doc-note { margin-left: 0; margin-right: 0; }
  .swp-doc-t2 tr.swp-fam { break-after: avoid; }
}
.swp-cond input[type=date], .ana-form input[type=date] { padding: .45rem .6rem; border: 1px solid var(--line, #ccc); border-radius: 8px; font: inherit; max-width: 14rem; }
.ana-filled { background: #FBF3E0 !important; transition: background .3s; }
.ana-src-msg { display: block; margin-top: .15rem; }
.ana-agent { grid-template-columns: 1.6fr 1fr; }
.ana-reload { margin-top: .35rem; justify-self: start; width: auto; }
.swp-flag { display: block; margin-top: .2rem; font-size: .74rem; color: #9B2C20; background: #FCEDEA; border-radius: 4px; padding: .05rem .4rem; width: fit-content; }
.swp-warn { margin: 0 1rem .8rem; background: #FCEDEA; color: #9B2C20; border-radius: 8px; padding: .55rem .9rem; font-size: .9rem; }

/* Switch: documento impaginato (copertina con legenda, una famiglia per pagina) */
.swp-book { display: grid; gap: 1.2rem; margin-bottom: 2rem; }
.swp-page { position: relative; background: #fff; border: 1px solid var(--line, #e3e6ea); border-radius: 10px; box-shadow: 0 6px 20px rgba(19,35,58,.07); padding: 1.1rem 1.4rem 1.2rem; overflow: hidden; }
.swp-cover { padding: 0 0 1.2rem; }
.swp-cover .swp-doc-h { border-radius: 10px 10px 0 0; }
.swp-pnum { position: absolute; right: .9rem; bottom: .5rem; font-size: .72rem; color: #9AA3AE; }
.swp-page-h { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 3px solid #C9A961; padding-bottom: .35rem; margin-bottom: .55rem; }
.swp-page-h h2 { margin: 0; font-family: var(--serif); font-size: 1.15rem; color: #13233A; letter-spacing: .03em; }
.swp-page-h h2 span { font-family: var(--sans, inherit); font-size: .8rem; color: #6B7684; font-weight: 400; }
.swp-page-c { font-size: .75rem; color: #6B7684; }
.swp-page .swp-doc-t2 { width: 100%; margin: 0; }
.swp-doc-t2 thead th { vertical-align: bottom; line-height: 1.15; }
.swp-row-flag td { background: #FCEDEA; }
.swp-page-note { margin: .5rem 0 0; font-size: .74rem; color: #9B2C20; }
.swp-index { margin: 1rem 1.6rem 0; }
.swp-index h2 { margin: 0 0 .5rem; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #9A7B33; }
.swp-index ol { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2.2rem; }
.swp-index li { display: flex; align-items: baseline; gap: .4rem; padding: .22rem 0; break-inside: avoid; font-size: .9rem; }
.swp-ix-n em { color: #9AA3AE; font-style: normal; font-size: .8rem; }
.swp-ix-dots { flex: 1; border-bottom: 1px dotted #C9CED6; transform: translateY(-.25rem); }
.swp-ix-p { font-weight: 700; color: #13233A; white-space: nowrap; }
.swp-sum-warn { background: #FCEDEA !important; }
@media print {
  .swp-book { display: block; gap: 0; margin: 0; }
  .swp-page { border: 0; border-radius: 0; box-shadow: none; padding: 0; margin: 0; overflow: visible; break-after: page; page-break-after: always; }
  .swp-page:last-child { break-after: auto; page-break-after: auto; }
  .swp-cover .swp-doc-h { border-radius: 0; }
  .swp-cover .swp-doc-why, .swp-cover .swp-doc-cond, .swp-cover .swp-doc-sum, .swp-cover .swp-index, .swp-cover .swp-doc-note { margin-left: 0; margin-right: 0; }
  .swp-doc-why { padding: 2.5mm 4mm; } .swp-doc-why p { font-size: 9pt; }
  .swp-doc-cond > div, .swp-doc-sum > div { padding: 1.5mm 3mm; }
  .swp-doc-sum strong { font-size: 12pt; }
  .swp-index li { font-size: 9pt; padding: .8mm 0; }
  .swp-page-h { margin-bottom: 2mm; padding-bottom: 1.2mm; }
  .swp-page-h h2 { font-size: 12pt; }
  .swp-page .swp-doc-t2 { font-size: 7.8pt; table-layout: fixed; }
  .swp-page .swp-doc-t2 thead th { font-size: 6.8pt; padding: 1mm 1.2mm !important; }
  .swp-page .swp-doc-t2 td { padding: .8mm 1.2mm !important; line-height: 3.4mm; }
  .swp-doc-t2.is-compare col, .swp-doc-t2.is-compare th:nth-child(1) { width: 13mm; }
  .swp-doc-t2.is-compare th:nth-child(2) { width: auto; }
  .swp-doc-t2.is-compare th:nth-child(3) { width: 17mm; } .swp-doc-t2.is-compare th:nth-child(4) { width: 15mm; }
  .swp-doc-t2.is-compare th:nth-child(5) { width: 15mm; } .swp-doc-t2.is-compare th:nth-child(6), .swp-doc-t2.is-compare th:nth-child(7) { width: 12mm; }
  .swp-doc-t2.is-compare th:nth-child(8), .swp-doc-t2.is-compare th:nth-child(9), .swp-doc-t2.is-compare th:nth-child(10), .swp-doc-t2.is-compare th:nth-child(11) { width: 18mm; }
  .swp-doc-t2.is-compare th:nth-child(12) { width: 14mm; }
  .swp-doc-t2.is-client th:nth-child(1) { width: 14mm; } .swp-doc-t2.is-client th:nth-child(3) { width: 18mm; } .swp-doc-t2.is-client th:nth-child(4) { width: 16mm; }
  .swp-doc-t2.is-client th:nth-child(5) { width: 17mm; } .swp-doc-t2.is-client th:nth-child(6), .swp-doc-t2.is-client th:nth-child(7) { width: 13mm; }
  .swp-doc-t2.is-client th:nth-child(8), .swp-doc-t2.is-client th:nth-child(9) { width: 22mm; }
  .swp-row-flag td, .swp-page-h { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.swp-adopt { border-left: 4px solid #2E8B57; }
.swp-adopted { background: #E4F3EA; color: #1E6B3D; border-radius: 8px; padding: .6rem .9rem; margin: 0; }
.swp-adopt-f { display: grid; gap: .6rem; }
.swp-adopt-b { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
@media print { .swp-page .swp-doc-t2 td.mono { font-size: 7.4pt; } .swp-page .swp-doc-t2 .small { font-size: 6.4pt; } }

/* PREZZI > Listino Base */
.lb-hero { background: linear-gradient(135deg, #13233A 0%, #1C3352 100%); color: #fff; border-radius: 16px; padding: 2rem 2.2rem; display: grid; gap: 1.4rem; border-bottom: 4px solid #C9A961; }
.lb-kicker { margin: 0; color: #C9A961; letter-spacing: .18em; font-size: .74rem; text-transform: uppercase; }
.lb-hero h2 { margin: .3rem 0 .4rem; font-family: var(--serif); font-size: 1.9rem; color: #fff; }
.lb-hero-t p { margin: 0; color: #C8D0DC; max-width: 60rem; line-height: 1.55; }
.lb-steps { counter-reset: lb; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; }
.lb-steps li { counter-increment: lb; background: rgba(255,255,255,.06); border: 1px solid rgba(201,169,97,.35); border-radius: 12px; padding: .9rem 1rem; display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; color: #DCE2EA; }
.lb-steps li::before { content: counter(lb); font: 700 1.3rem var(--serif, Georgia); color: #C9A961; }
.lb-steps strong { color: #fff; }
@media (max-width: 1100px) { .lb-steps { grid-template-columns: 1fr 1fr; } }
.lb-hero-a { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.lb-hero-a .btn-lg { padding: .75rem 1.4rem; font-size: 1rem; background: #C9A961; color: #13233A; border-color: #C9A961; }
.lb-hero-a .hint, .lb-imp .hint { color: #C8D0DC; }
.lb-imp summary { cursor: pointer; color: #E8D5A6; }
.lb-imp form { margin-top: .6rem; }
.lb-tools { display: flex; flex-direction: column; gap: 0; padding: 0; }
.lb-tool { border-bottom: 1px solid var(--line, #eee); }
.lb-tool:last-child { border-bottom: 0; }
.lb-tool > summary { cursor: pointer; padding: .8rem 1.2rem; font-weight: 600; display: flex; align-items: center; gap: .6rem; list-style: none; }
.lb-tool > summary::-webkit-details-marker { display: none; }
.lb-ti { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 6px; background: #F6EFDD; color: #9A7B33; font-weight: 700; }
.lb-tool form { padding: 0 1.2rem 1rem; display: grid; gap: .7rem; }
.lb-varia-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.lb-varia-row label { max-width: 16rem; }
.lb-panel .panel-tools select, .lb-panel .panel-tools input[type=search] { padding: .35rem .5rem; border: 1px solid var(--line, #ccc); border-radius: 7px; font: inherit; font-size: .86rem; }
.lb-wrap { max-height: 70vh; overflow: auto; }
.lb-table { font-size: .82rem; }
.lb-table thead th { position: sticky; top: 0; z-index: 2; background: #EEF2F6; white-space: nowrap; }
.lb-table td { padding: .12rem .2rem !important; }
.lb-table input, .lb-table select { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 5px; padding: .28rem .35rem; font: inherit; font-size: .82rem; color: var(--ink); min-width: 0; }
.lb-table input:hover, .lb-table select:hover { border-color: #DCE2EA; }
.lb-table input:focus, .lb-table select:focus { border-color: #C9A961; background: #FFFCF4; outline: none; }
.lb-table .lb-code { width: 5.2rem; }
.lb-table .lb-desc { min-width: 22rem; }
.lb-table .lb-sm { width: 6rem; }
.lb-table .lb-num { width: 5.4rem; text-align: right; }
.lb-table select { width: 4.4rem; }
.lb-table .lb-price { background: #FBF6E8; }
.lb-table .lb-kg { font-weight: 700; }
.lb-table input:disabled { color: #B5BCC6; }
.lb-table tr.lb-gcat th { position: sticky; top: 2.15rem; z-index: 1; background: #13233A; color: #E8D5A6; text-align: left; letter-spacing: .06em; font-size: .78rem; padding: .4rem .7rem; }
.lb-table tr.lb-gcat th span { color: #8FA0B5; font-weight: 400; margin-left: .4rem; }
.lb-table tr.lb-gsez td { background: #F6F2E8; color: #6E5A2C; font-weight: 600; font-size: .76rem; padding: .3rem .7rem !important; }
.lb-table tr.is-dirty td { background: #FFF6DE; }
.lb-table tr.is-dirty td.lb-price { background: #FBEBC0; }
.lb-table tr.is-del td { background: #FCEDEA; }
.lb-table tr.is-del input, .lb-table tr.is-del select { text-decoration: line-through; color: #9B2C20; }
.lb-table tr[data-new="1"] td { background: #E4F3EA; }
.lb-table .lb-c-en, .lb-table .lb-c-cat, .lb-table .lb-c-sez, .lb-table .lb-c-more { width: 0; max-width: 0; padding: 0 !important; border: 0; overflow: hidden; font-size: 0; }
.lb-table .lb-c-en > *, .lb-table .lb-c-cat > *, .lb-table .lb-c-sez > *, .lb-table .lb-c-more > * { display: none; }
.lb-show-en .lb-c-en, .lb-show-cat .lb-c-cat, .lb-show-sez .lb-c-sez, .lb-show-more .lb-c-more { width: auto !important; max-width: none !important; padding: .12rem .2rem !important; font-size: .82rem !important; }
.lb-show-en .lb-c-en > *, .lb-show-cat .lb-c-cat > *, .lb-show-sez .lb-c-sez > *, .lb-show-more .lb-c-more > * { display: block; }
.lb-show-en th.lb-c-en, .lb-show-cat th.lb-c-cat, .lb-show-sez th.lb-c-sez, .lb-show-more th.lb-c-more { padding: .45rem .5rem !important; font-size: .78rem !important; }
.lb-show-cat .lb-c-cat input { width: 7.5rem; }
.lb-show-sez .lb-c-sez input { width: 14rem; }
.lb-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 1rem; align-items: center; background: #13233A; color: #fff; padding: .7rem 1.2rem; border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -8px 24px rgba(19,35,58,.18); }
.lb-savebar strong { color: #C9A961; font-size: 1.1rem; }
.lb-savebar-h { flex: 1; color: #C8D0DC; font-size: .82rem; }
.lb-savebar .btn-ghost { color: #fff; }
.lb-savebar .btn-primary { background: #C9A961; border-color: #C9A961; color: #13233A; }
.lb-savebar[hidden] { display: none !important; }
@media print {
  .lb-wrap { max-height: none; overflow: visible; }
  .lb-table input, .lb-table select { border: 0 !important; background: none !important; -webkit-appearance: none; appearance: none; padding: 0 !important; font-size: 7.5pt; }
  .lb-table thead th, .lb-table tr.lb-gcat th { position: static; }
  .lb-table tr.lb-gcat th, .lb-table tr.lb-gsez td, .lb-table .lb-price { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.lg-bulk { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; padding: .9rem 1.2rem; }
.lg-bulk label { max-width: 9rem; }
.lg-bulk select { padding: .4rem .5rem; border: 1px solid var(--line, #ccc); border-radius: 7px; font: inherit; }
.lg-bulk .hint { flex: 1 1 100%; margin: 0; }
.lg-table .lb-num { border-color: #DCE2EA; background: #fff; }
.lg-table tr.lg-row.is-dirty td { background: #FFF6DE; }
.warn-txt { color: #B7791F; }
.lg-h3 { margin: .6rem 0 0; font-size: 1rem; }
.inline-form { display: inline; margin: 0; }
.lg-badge { display: inline-block; background: #E4F3EA; color: #1E6B3D; border-radius: 999px; padding: 0 .55rem; font-size: .76rem; font-weight: 600; }
.lg-new-cta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-left: 4px solid #C9A961; }
.lg-new-cta h2 { margin: 0; }

.lg-bulk select { width: auto !important; min-width: 14rem; }
.lb-table tr.lb-gcat th, .lb-table tr.lb-gsez td { text-align: left !important; }
.lb-panel > .panel-head .panel-tools { flex-wrap: nowrap; }
.lb-panel > .panel-head .panel-tools input[type=search] { width: 15rem; }
.fc-panel { border-left: 4px solid #B42318; }
.fc-hint { margin: 0 1.25rem .6rem; }
.fc-h3 { margin: .8rem 1.25rem .4rem; font-size: .98rem; }
.fc-table { margin: 0 0 .6rem; }
.fc-table tr.fc-skip td { background: #FCEDEA; }
.fc-list { margin: 0 1.25rem 1rem; display: flex; flex-direction: column; gap: .2rem; font-size: .88rem; }
.fc-manage { border-left: 4px solid #2E8B57; }
.fc-ok { margin-bottom: 1rem; }
.fc-panel.fc-soft { border-left-color: #C9A961; }
.fc-rep { margin: .4rem 1.25rem 1rem; }
.fc-rep summary { cursor: pointer; color: var(--muted); font-size: .9rem; }

.lst-mkfonte { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .4rem; font-weight: 400; }
.lst-mkfonte label { display: flex; gap: .35rem; align-items: center; font-size: .8rem; }
.lst-mkfonte .unit-input input { width: 3.5rem; }

.lst-b-switch { background: var(--info-soft); color: #24435C; }

/* ================================================================ costruzione budget */
.bp-areas { display: flex; gap: .5rem; align-items: stretch; margin: 0 0 1rem; flex-wrap: wrap; }
.bp-areas > a { display: flex; flex-direction: column; gap: .3rem; min-width: 180px; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.bp-areas > a:hover { border-color: var(--sage); }
.bp-areas > a.on { border-color: var(--cypress); box-shadow: inset 0 -3px 0 var(--rose), var(--shadow); }
.bp-area-l { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; }
.bp-year { margin-left: auto; align-self: center; }
.bp-year select { margin-left: .35rem; }
.bp-st { display: inline-block; align-self: flex-start; padding: .05rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; border: 1px solid transparent; }
.bp-st-bozza { background: var(--paper); color: var(--muted); border-color: var(--line); }
.bp-st-proposto { background: var(--warn-soft); color: var(--warn); border-color: #F0DCAA; }
.bp-st-approvato { background: #E3F1E8; color: var(--pos); border-color: #BFDCCB; }
.bp-status { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem 1.5rem; align-items: center; padding: .85rem 1.25rem; margin: 0 0 1rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius); }
.bp-status-proposto { border-left-color: #E2B94F; }
.bp-status-approvato { border-left-color: var(--pos); }
.bp-steps { display: flex; align-items: center; gap: .4rem; }
.bp-step { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.bp-step b { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; border: 2px solid var(--line); font-size: .75rem; background: var(--surface); }
.bp-step.done b { background: var(--cypress); border-color: var(--cypress); color: #fff; }
.bp-step.cur { color: var(--ink); }
.bp-step.cur b { box-shadow: 0 0 0 3px var(--sage-soft); }
.bp-step-line { width: 26px; height: 2px; background: var(--line); }
.bp-step-line.done { background: var(--cypress); }
.bp-status-txt { margin: 0; font-size: .88rem; color: var(--muted); }
.bp-actions, .bp-ac-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.bp-actions form, .bp-ac-actions form { margin: 0; }
.bp-kpis .kpi-value { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.bp-kpis .delta { font-size: .8rem; font-weight: 700; }
.bp-kpi-main { background: linear-gradient(180deg, #FBF6EC, #fff); }
.bp-charts { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.25rem; }
.bp-ch-note { margin: 0 1.25rem 1rem; }
.bp-method-grid { display: grid; grid-template-columns: 1fr 260px; gap: 1.5rem; padding: 0 1.25rem 1.1rem; }
.bp-method-grid p { margin: .2rem 0 .5rem; }
.bp-method-list { margin: .3rem 0 .6rem; padding-left: 1.1rem; font-size: .9rem; }
.bp-method-list li { margin: .2rem 0; }
.bp-aff { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; background: var(--paper); align-self: start; }
.bp-aff-t { margin: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.bp-aff-v { margin: .2rem 0; font-size: 1.7rem; font-family: var(--serif); font-weight: 700; }
.bp-aff-v.warn { color: var(--warn); }
.bp-dimtabs { display: flex; gap: .3rem; padding: 0 1.25rem .6rem; flex-wrap: wrap; }
.bp-dimtabs a { padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--muted); font-size: .85rem; font-weight: 600; }
.bp-dimtabs a.on { background: var(--cypress); border-color: var(--cypress); color: #fff; }
.bp-table th.bp-col-bu, .bp-table td.bp-col-bu, .bp-grid .bp-col-bu { background: #FBF3F6; }
.bp-table th.bp-col-ch, .bp-table td.bp-col-ch, .bp-grid .bp-col-ch { background: #F6F8F7; }
.bp-tag { display: inline-block; margin-left: .35rem; padding: 0 .4rem; border-radius: 999px; font-size: .68rem; font-weight: 700; background: var(--sage-soft); color: #7A6127; vertical-align: middle; }
.bp-tag-neg { background: var(--neg-soft); color: var(--neg); }
.bp-tag-warn { background: var(--warn-soft); color: var(--warn); }
.bp-sig-intro { margin: 0 1.25rem .6rem; }
.bp-sig-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 0 1.25rem 1.25rem; }
.bp-sig { border: 1px solid var(--line); border-top: 3px solid var(--line); border-radius: var(--radius-s); padding: .7rem .9rem; background: var(--surface); }
.bp-sig-neg { border-top-color: var(--neg); }
.bp-sig-warn { border-top-color: #E2B94F; }
.bp-sig-pos { border-top-color: var(--pos); }
.bp-sig h3 { margin: 0 0 .5rem; font-size: .92rem; display: flex; justify-content: space-between; gap: .5rem; }
.bp-sig h3 span { color: var(--muted); font-weight: 600; font-size: .8rem; white-space: nowrap; }
.bp-sig-list { margin: 0; padding-left: 1.2rem; font-size: .84rem; }
.bp-sig-list li { margin: .18rem 0; }
.bp-sig-list li span { float: right; margin-left: .5rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.bp-sig-list a { text-decoration: none; color: var(--ink); }
.bp-sig-list a:hover { text-decoration: underline; }
.bp-conc { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0 0 .5rem; }
.bp-conc div { background: var(--paper); border-radius: var(--radius-s); padding: .45rem .6rem; }
.bp-conc dt { font-size: .74rem; color: var(--muted); }
.bp-conc dd { margin: 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 700; }
/* costruzione */
.bp-params-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem 1.25rem; padding: 0 1.25rem 1.1rem; }
.bp-params-grid label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .88rem; }
.bp-params-grid small { font-weight: 400; color: var(--muted); font-size: .76rem; line-height: 1.35; }
.bp-params-grid .unit-input input { width: 6rem; font-size: 1.05rem; font-weight: 700; }
.bp-sticky { position: sticky; top: 0; z-index: 5; margin: 0 0 1rem; }
.bp-totals { display: flex; gap: 0; align-items: stretch; background: var(--cypress); color: #fff; border-radius: var(--radius); box-shadow: 0 4px 14px rgba(19, 35, 58, .18); overflow: hidden; }
.bp-totals > div { padding: .55rem 1rem; display: flex; flex-direction: column; gap: .05rem; border-right: 1px solid rgba(255, 255, 255, .12); min-width: 120px; }
.bp-totals span { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; opacity: .75; }
.bp-totals b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.bp-totals i { font-style: normal; font-size: .78rem; font-weight: 700; }
.bp-totals i.pos { color: #9BE0BC; }
.bp-totals i.neg { color: #FFB4AB; }
.bp-totals .bp-t-main { background: rgba(255, 255, 255, .07); }
.bp-totals .bp-t-main b { font-size: 1.35rem; color: var(--gold); }
.bp-totals .bp-t-sel { margin-left: auto; }
.bp-t-save { justify-content: center; align-items: flex-end; border-right: 0 !important; }
.bp-t-save .btn-primary { background: var(--gold); border-color: var(--gold); color: var(--cypress); font-weight: 700; }
.bp-dirty { font-size: .72rem !important; text-transform: none !important; color: #FFE3A3; opacity: 1 !important; }
.bp-filters, .bp-bulk { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; padding: .9rem 1.25rem; }
.bp-filters label, .bp-bulk label { display: flex; flex-direction: column; gap: .2rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
.bp-filters select { max-width: 200px; }
.bp-f-q input { width: 210px; }
.bp-bulk { border-top: 1px dashed var(--line); background: #FBFAF6; border-radius: 0 0 var(--radius) var(--radius); }
.bp-bulk strong { align-self: center; font-size: .88rem; }
.bp-bulk .unit-input input { width: 5rem; }
.bp-bulk .hint { flex-basis: 100%; margin: 0; }
.bp-gridwrap { max-height: none; overflow: visible; }
table.data.bp-grid thead th { position: sticky; top: var(--bp-top, 0px); z-index: 4; background: #F1F5F3; box-shadow: 0 1px 0 var(--line), 0 3px 6px rgba(0,0,0,.06); }
.bp-grid tr.bp-c > * { border-top: 1px solid var(--line); }
.bp-grid tr.bp-c.open > * { background: #FBF8F1; }
.bp-grid tr.bp-c.open > .bp-col-bu { background: #F8EEF2; }
.bp-grid tr.bp-f td { font-size: .84rem; border-top: 0; }
.bp-grid tr.bp-f .bp-col-in input { background: #fff; }
.bp-tg { width: 30px; }
.bp-tgb { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; width: 24px; height: 24px; line-height: 1; cursor: pointer; color: var(--cypress); }
.bp-tgb:hover { border-color: var(--sage); }
.bp-cn { color: var(--ink); text-decoration: none; font-weight: 600; }
.bp-cn:hover { text-decoration: underline; }
.bp-sub { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }
.bp-fn { padding-left: 1.4rem !important; }
.bp-met { display: inline-block; margin-left: .45rem; padding: 0 .35rem; border-radius: 4px; font-size: .66rem; font-weight: 700; background: var(--paper); color: var(--muted); border: 1px solid var(--line); vertical-align: middle; }
.bp-met-fermo { background: var(--warn-soft); color: var(--warn); border-color: #F0DCAA; }
.bp-met-ritmo { background: var(--info-soft); color: #24435C; border-color: #CDDDEA; }
.bp-note { display: block; width: 100%; max-width: 280px; margin-top: .2rem; font-size: .76rem; padding: .15rem .35rem; border: 1px solid transparent; background: transparent; border-radius: 4px; }
.bp-note:hover, .bp-note:focus { border-color: var(--line); background: #fff; }
.bp-in { width: 4.6rem; text-align: right; padding: .2rem .35rem; border: 1px solid var(--line); border-radius: 5px; font-variant-numeric: tabular-nums; font-weight: 600; }
.bp-in:focus { outline: 2px solid var(--sage); border-color: var(--sage); }
.bp-in::placeholder { color: #A7B0AC; font-weight: 400; }
.bp-grid .bp-col-in { background: #FFFCF3; }
.bp-more { padding: .6rem 1.25rem 1rem; display: flex; gap: .75rem; align-items: center; }
.bp-new-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem 1rem; padding: 0 1.25rem 1rem; align-items: end; }
.bp-new-form label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; font-size: .86rem; }
.bp-new-form .span-2 { grid-column: span 2; }
/* riepilogo direzione */
.bp-intro { padding: 1rem 1.25rem; }
.bp-intro h2 { margin: 0 0 .4rem; }
.bp-intro p { margin: .25rem 0; }
.bp-areacards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.bp-areacard { border-top: 4px solid var(--line); }
.bp-areacard-proposto { border-top-color: #E2B94F; }
.bp-areacard-approvato { border-top-color: var(--pos); }
.bp-areacard .panel-head { display: flex; justify-content: space-between; align-items: center; }
.bp-ac-body { padding: 0 1.25rem .5rem; }
.bp-ac-v { margin: 0 0 .6rem; font-family: var(--serif); font-size: 1.7rem; font-weight: 700; display: flex; gap: .6rem; align-items: baseline; }
.bp-ac-v .delta { font-size: .9rem; }
.bp-ac-dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0 0 .5rem; }
.bp-ac-dl div { background: var(--paper); border-radius: var(--radius-s); padding: .4rem .6rem; }
.bp-ac-dl dt { font-size: .72rem; color: var(--muted); }
.bp-ac-dl dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.bp-ac-actions { padding: 0 1.25rem 1rem; justify-content: flex-start; }
.bp-phase .bp-phase-tot > * { background: #FBF3F6; }
.bp-phase .bp-est { font-style: italic; color: #8A6E2B; }
@media (max-width: 1100px) {
  .bp-charts, .bp-areacards, .bp-method-grid { grid-template-columns: 1fr; }
  .bp-sig-grid { grid-template-columns: 1fr 1fr; }
  .bp-params-grid { grid-template-columns: 1fr 1fr; }
  .bp-status { grid-template-columns: 1fr; }
  .bp-totals { flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .bp-sig-grid, .bp-params-grid, .bp-new-form { grid-template-columns: 1fr; }
  .bp-new-form .span-2 { grid-column: auto; }
}
@media print {
  .bp-sticky { position: static; }
  .bp-gridwrap { max-height: none; }
}
/* costruzione budget: rifiniture */
.bp-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bp-kpis .kpi { padding: .85rem 1rem; }
.bp-kpis .kpi-value { font-size: 1.4rem; }
.bp-kpis .kpi-compare { font-size: .78rem; }
@media (max-width: 1350px) { .bp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bp-sticky { top: 3.6rem; }
.bp-table { font-size: .82rem; }
.bp-table th, .bp-table td { padding-left: .45rem; padding-right: .45rem; }
.bp-table thead th { white-space: normal; vertical-align: bottom; line-height: 1.2; }
.bp-table tbody th { font-weight: 600; }
.bp-grid { font-size: .82rem; }
.bp-grid th, .bp-grid td { padding: .35rem .4rem; }
.bp-grid thead th { white-space: normal; vertical-align: bottom; line-height: 1.2; font-size: .78rem; }
.bp-grid td.small { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; }
.bp-grid tbody th { max-width: 230px; }
.bp-grid input.bp-in { width: 3.9rem; padding: .18rem .3rem; font-size: .8rem; }
.bp-grid input.bp-note { width: 100%; max-width: 230px; padding: .1rem .3rem; font-size: .74rem; }
.bp-bulk input[type=text] { width: 5.2rem; }
.bp-sig-list { list-style: none; padding: 0; counter-reset: n; }
.bp-sig-list li { display: flex; gap: .45rem; align-items: baseline; counter-increment: n; }
.bp-sig-list li::before { content: counter(n) '.'; color: var(--muted); min-width: 1.2rem; font-size: .78rem; }
.bp-sig-list li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-sig-list li span { float: none; margin: 0; white-space: nowrap; }
.bp-charts .chart { min-height: 0; }
.bp-grid .bp-sub, .bp-grid thead .bp-sub { font-size: .7rem; font-weight: 400; color: var(--muted); white-space: nowrap; }
.bp-grid tbody th { max-width: 210px; }
.bp-grid td.small { max-width: 115px; }
.bp-phase { font-size: .76rem; }
.bp-phase th, .bp-phase td { padding-left: .35rem; padding-right: .35rem; }
.bp-phase tbody th { white-space: nowrap; }
.bp-grid .bp-sub b { font-weight: 700; }
.bp-grid .bp-sub b.pos { color: var(--pos); }
.bp-grid .bp-sub b.neg { color: var(--neg); }
.bp-grid td.bp-ca { max-width: 150px; }
.bp-grid td.bp-ca .bp-sub { overflow: hidden; text-overflow: ellipsis; }
.bp-table .bp-sub { display: block; font-size: .7rem; font-weight: 400; color: var(--muted); white-space: nowrap; }
.bp-table .bp-sub.pos, .bp-table .bp-sub b.pos { color: var(--pos); }
.bp-table .bp-sub.neg, .bp-table .bp-sub b.neg { color: var(--neg); }
.bp-table thead .bp-sub { color: var(--muted); }

/* ================================================================ controllo vendite vs minimi */
.mc-filters { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: flex-end; padding: 1rem 1.25rem; }
.mc-filters label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.mc-filters select { min-width: 120px; }
.mc-area { border: 0; padding: 0; margin: 0; display: flex; gap: .2rem; align-items: center; flex-wrap: wrap; }
.mc-area legend { font-size: .8rem; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: .25rem; }
.mc-area label.check { flex-direction: row; align-items: center; gap: .35rem; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: .86rem; cursor: pointer; }
.mc-area label.check:has(input:checked) { background: var(--cypress); border-color: var(--cypress); color: #fff; }
.mc-area input { accent-color: var(--gold); }
.mc-q input { width: 230px; }
.mc-actions { display: flex; gap: .4rem; margin-left: auto; }
.mc-last { flex-basis: 100%; margin: 0; }
.mc-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; margin: 0 0 1.25rem; }
.mc-card { display: flex; flex-direction: column; gap: .15rem; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--cypress); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.mc-card:hover { border-color: var(--sage); }
.mc-card.on { box-shadow: 0 0 0 2px var(--cypress), var(--shadow); }
.mc-card b { font-family: var(--serif); font-size: 1.6rem; line-height: 1.1; }
.mc-c-l { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mc-c-s { font-size: .78rem; color: var(--muted); }
.mc-card-ok { border-top-color: var(--pos); }
.mc-card-nd { border-top-color: #7A4FB5; background: #FAF7FD; }
.mc-card-min { border-top-color: #E2B94F; }
.mc-card-fc { border-top-color: var(--neg); }
.mc-legend { margin: 0 1.25rem .6rem; display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; }
.mc-dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-left: .4rem; }
.mc-dot.mc-ok { background: #DDF0E5; border: 1px solid #9FD0B4; }
.mc-dot.mc-min { background: #FFF1CF; border: 1px solid #EBCB7A; }
.mc-dot.mc-fc { background: #FBDCD8; border: 1px solid #EBA39A; }
.mc-dot.mc-nd { background: #EFE7FA; border: 1px solid #C9B4E8; }
.mc-table { font-size: .8rem; }
.mc-table th, .mc-table td { padding-left: .4rem; padding-right: .4rem; }
.mc-table thead th { white-space: normal; vertical-align: bottom; line-height: 1.2; }
.mc-groups th { text-align: center; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--line); }
.mc-g-tot { background: #F2F4F3; } .mc-g-it { background: #EEF4F0; } .mc-g-ex { background: #EEF2F7; }
.mc-g-min { background: #F7F2E6; } .mc-g-cmp { background: #FBF3F6; }
.mc-col-min { background: #FCFAF4; }
.mc-sub { display: block; font-size: .7rem; color: var(--muted); font-weight: 400; }
.mc-table td.mc-ok { background: #EEF8F2; color: #17603F; }
.mc-table td.mc-min { background: #FFF6DD; color: #7A5300; }
.mc-table td.mc-fc { background: #FCE6E3; color: #8F1D12; font-weight: 700; }
.mc-table tr.mc-st-manca > td, .mc-table tr.mc-st-vuoto > td { background: #F7F2FD; }
.mc-table tr.mc-st-manca > td:first-child, .mc-table tr.mc-st-vuoto > td:first-child { box-shadow: inset 4px 0 0 #7A4FB5; }
.mc-badge { display: inline-block; padding: 0 .4rem; border-radius: 999px; background: #7A4FB5; color: #fff; font-size: .66rem; font-weight: 700; letter-spacing: .02em; }
.mc-nd-txt { color: #7A4FB5; font-weight: 700; }
.mc-wrap { max-height: none; }
.mc-print-head { display: none; }
@media (max-width: 1200px) { .mc-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media print {
  .mc-print-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #23443B; padding-bottom: 4px; margin-bottom: 8px; gap: 12px; }
  .mc-print-head strong { display: block; font-family: var(--serif); font-size: 16px; color: #23443B; }
  .mc-print-head span { font-size: 11px; }
  .mc-cards { grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 8px; }
  .mc-card { padding: 5px 8px; box-shadow: none; }
  .mc-card b { font-size: 15px; }
  .mc-table { font-size: 8.5px; }
  .mc-table thead { display: table-header-group; }
  .mc-table tr { break-inside: avoid; }
  .mc-table td.mc-ok, .mc-table td.mc-min, .mc-table td.mc-fc, .mc-table tr.mc-st-manca > td, .mc-table tr.mc-st-vuoto > td, .mc-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.mc-table th.mc-cmp-col { box-shadow: inset 0 -3px 0 var(--rose); color: var(--ink); }
.mc-legend .mc-dot:first-child { margin-left: 0; }
@media print {
  .mc-panel { break-inside: auto !important; page-break-inside: auto !important; }
  .mc-print-head { display: block; border: 0; padding: 0; margin: 0 0 6px; }
  .mc-print-head strong { display: none; }
  .mc-print-head span { font-size: 12px; font-weight: 600; }
  .mc-print-head .pdf-date { display: none; }
  .mc-cards a { break-inside: avoid; }
  .mc-legend { font-size: 8.5px; margin: 0 0 4px; }
}

/* switch: mantieni i netti attuali */
.swp-keep { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius-s); padding: .75rem 1rem; margin: 0 0 1rem; background: var(--paper); }
.swp-keep.on, .swp-keep:has(.swp-keep-t input:checked) { border-left-color: var(--gold); background: #FBF6EC; }
.swp-keep-t { font-size: 1rem; }
.swp-keep-f { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: flex-end; margin: .4rem 0; }
.swp-keep-f > label { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; font-weight: 600; }
.swp-keep-f .unit-input input { width: 5rem; }
.swp-keep-f fieldset { border: 0; padding: 0; margin: 0; }
.swp-keep-f legend { font-size: .82rem; font-weight: 600; margin-bottom: .2rem; }
.swp-keep:not(.on):not(:has(.swp-keep-t input:checked)) .swp-keep-f { opacity: .55; }
.swp-mt-sum { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; font-size: .85rem; margin: .4rem 0 .6rem; }
.swp-mf { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 700; margin-left: .35rem; border: 1px solid transparent; }
.swp-mt-sum .swp-mf { margin-left: 0; }
.swp-mf-max { background: var(--warn-soft); color: var(--warn); border-color: #F0DCAA; }
.swp-mf-basso { background: var(--info-soft); color: #24435C; border-color: #CDDDEA; }
.swp-mf-magg { background: #F3EAFB; color: #5B3591; border-color: #D9C6F0; }
.swp-mf-min { background: #FFF1CF; color: #7A5300; border-color: #EBCB7A; }
.swp-mf-fc { background: var(--neg-soft); color: var(--neg); border-color: #F2C7C2; }
.swp-vsmin { font-weight: 600; }
.swp-vm-ok { color: var(--pos); }
.swp-vm-min { background: #FFF6DD; color: #7A5300; }
.swp-vm-fc { background: #FCE6E3; color: #8F1D12; }

/* ================================================================ margine netto cliente */
.mg-head .sel-ribbon { align-items: center; }
.mg-pick { margin-left: auto; min-width: 320px; max-width: 460px; }
.mg-pick label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.mg-nolist { display: inline-block; padding: 0 .5rem; border-radius: 999px; background: var(--info-soft); color: #24435C; font-size: .78rem; font-weight: 700; }
.mg-chip-mod { background: var(--warn-soft) !important; color: var(--warn) !important; border-color: #F0DCAA !important; }
.mg-ctrl { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.mg-box { padding: 1rem 1.25rem; margin: 0; }
.mg-box h2 { font-size: 1.05rem; margin: 0 0 .7rem; display: flex; align-items: center; gap: .5rem; }
.mg-seg { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .8rem; }
.mg-seg label { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; position: relative; padding-left: 2.1rem; }
.mg-seg label input { position: absolute; left: .75rem; top: .8rem; accent-color: var(--cypress); }
.mg-seg label b { font-size: .92rem; }
.mg-seg label small { color: var(--muted); font-size: .76rem; line-height: 1.3; }
.mg-seg label.on { border-color: var(--cypress); box-shadow: inset 0 0 0 1px var(--cypress); background: #F7F9FB; }
.mg-seg label.off { opacity: .55; cursor: not-allowed; }
.mg-period { display: flex; flex-wrap: wrap; gap: .6rem .9rem; align-items: flex-end; }
.mg-period label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.mg-period select { min-width: 110px; }
.mg-box .hint { margin: .6rem 0 0; }
.mg-costs.changed { border-color: #E2B94F; box-shadow: 0 0 0 1px #E2B94F inset; }
.mg-cost-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.mg-cost-grid label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; font-weight: 600; }
.mg-cost-grid .unit-input input { font-size: 1.05rem; font-weight: 700; }
.mg-cost-grid small { font-weight: 400; color: var(--muted); font-size: .72rem; }
.mg-cost-grid label.mod .unit-input input { background: var(--warn-soft); border-color: #E2B94F; }
.mg-cost-grid label.mod small { color: var(--warn); font-weight: 700; }
.mg-cost-act { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .8rem; }
.mg-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mg-kpi-main { background: linear-gradient(180deg, #FBF6EC, #fff); }
.mg-kpi-warn .kpi-value { color: #7A4FB5; }
.mg-build-row { display: flex; gap: .4rem; padding: 0 1.25rem; flex-wrap: wrap; align-items: stretch; }
.mg-step { flex: 1 1 110px; display: flex; flex-direction: column; gap: .1rem; padding: .55rem .7rem; border-radius: var(--radius-s); background: var(--paper); border: 1px solid var(--line); }
.mg-step span { font-size: .74rem; color: var(--muted); font-weight: 600; }
.mg-step b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.mg-step small { font-size: .72rem; color: var(--muted); }
.mg-step-p { background: #F2F4F7; border-color: #C9D3DE; }
.mg-step-c b { color: var(--neg); }
.mg-step-m { background: #E9F5EE; border-color: #A9D3BA; }
.mg-step-m b { color: var(--pos); font-size: 1.2rem; }
.mg-build-h { margin: .5rem 1.25rem 1rem; }
.mg-table { font-size: .8rem; }
.mg-table th, .mg-table td { padding-left: .4rem; padding-right: .4rem; }
.mg-table thead th { white-space: normal; vertical-align: bottom; line-height: 1.2; }
.mg-groups th { text-align: center; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--line); }
.mg-g1 { background: #F2F4F3; } .mg-g2 { background: #FBF3F3; } .mg-g3 { background: #EEF6F1; } .mg-g4 { background: #F4F2EE; }
.mg-table td.mg-pm { background: #F7F9FB; }
.mg-table tr.mg-row-nd > td { background: #F7F2FD; }
.mg-table tr.mg-row-nd > td:first-child { box-shadow: inset 4px 0 0 #7A4FB5; }
.mg-table tr.mg-row-py > td { color: var(--muted); }
.mg-table td.mg-nd { color: #7A4FB5; font-weight: 700; }
.mg-print-costs { display: none; }
@media (max-width: 1200px) { .mg-ctrl { grid-template-columns: 1fr; } .mg-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mg-cost-grid { grid-template-columns: 1fr 1fr; } }
@media print {
  .mg-print-costs { display: block; margin: 0 0 4px; font-size: 10px; font-weight: 600; }
  .mg-table { font-size: 8.5px; }
  .mg-build-row { gap: 4px; }
  .mg-step { padding: 3px 5px; }
}
.mg-cc { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; padding: .6rem .9rem; margin: 0 0 1rem; border: 1px solid #F0DCAA; border-left: 4px solid #E2B94F; background: var(--warn-soft); border-radius: var(--radius-s); font-size: .88rem; }
.mg-cc.ok { border-color: #BFDCCB; border-left-color: var(--pos); background: #EEF8F2; }
.mg-cc > span:first-child { font-weight: 600; margin-right: .25rem; }
.mg-table td.mg-desc { min-width: 230px; }
.mg-table td .mc-sub { white-space: nowrap; }
.mg-table .mc-sub b.pos { color: var(--pos); } .mg-table .mc-sub b.neg { color: var(--neg); }
.btn-danger { background: var(--neg); border-color: var(--neg); color: #fff; }
.btn-danger:hover { background: #8F1D12; border-color: #8F1D12; color: #fff; }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.btn-del { color: var(--neg); border-color: #F2C7C2; font-weight: 700; min-width: 2rem; }
.btn-del:hover { background: var(--neg-soft); color: var(--neg); }
.sel-col { width: 2rem; text-align: center; }
.sel-col input { width: 1rem; height: 1rem; accent-color: var(--cypress); }
.bulk-del { display: flex; justify-content: flex-end; padding: .6rem 1rem; border-top: 1px solid var(--line-2); }
.lg-tipo{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:10px;margin:0 0 14px}
.lg-tipo-opt{display:flex;gap:10px;align-items:flex-start;border:1px solid var(--line,#dfe3ea);border-radius:10px;padding:10px 12px;cursor:pointer}
.lg-tipo-opt:has(input:checked){border-color:var(--accent,#1f5fbf);background:rgba(31,95,191,.05)}
.lg-tipo-opt span{display:flex;flex-direction:column;gap:2px}.lg-tipo-opt small{color:var(--muted,#6b7280);font-weight:400}
.tag-pot{display:inline-block;font-size:11px;padding:1px 7px;border-radius:9px;background:#fff4d6;color:#8a5a00;margin-left:6px;vertical-align:middle}
.orph-panel{border-left:4px solid #d97706}.orph-list{list-style:none;padding:0;margin:8px 0 12px;columns:2;column-gap:24px}.orph-list li{padding:3px 0;break-inside:avoid}
.mg-pick{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end}.mg-q{display:flex;gap:6px}.mg-q input{min-width:280px}
.mg-match-list{list-style:none;padding:0;margin:6px 0 0;columns:2;column-gap:28px}.mg-match-list li{padding:4px 0;break-inside:avoid}
.bp-start{display:inline-block;padding:1px 8px;border-radius:9px;background:#E8F1EC;color:#23443B;font-weight:600;font-size:.8rem;white-space:nowrap}
.bp-ncy td .bp-sub,.bp-ncy th .bp-sub{display:block}
/* menu: voce selezionata ben evidente */
.sidebar li a.active { position: relative; padding-top: .58rem; padding-bottom: .58rem;
  background: linear-gradient(90deg, #E2C47A, #C9A961); color: #10201A; box-shadow: 0 4px 14px rgba(0,0,0,.35), inset 5px 0 0 #FFF3CF; }
.nav-sub:has(a.active) > .nav-sub-title { color: #FFE3A3; border-left-width: 4px; background: rgba(201,169,97,.12); border-radius: 0 6px 6px 0; }
.q-link-form{display:flex;gap:6px;align-items:center}.q-link-form input[type=text]{min-width:280px}
.q-link th .bp-sub{display:block;font-weight:400;font-size:.78rem}
.usb-form h2{margin-top:1.4rem}.usb-form h2:first-of-type{margin-top:0}
.usb-size{font-size:1.05rem;font-weight:600;margin:.8rem 0 0;padding:.7rem 1rem;background:#F4EEDD;border-radius:8px;color:#23443B}
.usb-dest{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:10px;margin-bottom:.6rem}
.usb-other{max-width:420px}.usb-done{border-left:4px solid #2E7D5B}

/* ---------- Focus Italia / Export ---------- */
.fc-bar { display: inline-block; width: 46px; height: 6px; margin-right: 6px; vertical-align: middle; border-radius: 3px; background: linear-gradient(90deg, #23443B var(--w), #E8E3D6 var(--w)); }
.fc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 1200px) { .fc-two { grid-template-columns: 1fr; } }
.btn-gold { background: #C9A961; border-color: #B8964F; color: #10201A; font-weight: 600; }
.btn-gold:hover { background: #D7B871; color: #10201A; }

/* ---------- Business Review: scelta ---------- */
.br-form h2 { margin: 0 0 .2rem; }
.br-tipi { display: flex; flex-wrap: wrap; gap: .5rem; border: 0; padding: 0; margin: .9rem 0; }
.br-tipi legend { font-size: .8rem; font-weight: 600; color: var(--muted, #5F6B66); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .06em; }
.br-tipo { cursor: pointer; }
.br-tipo input { position: absolute; opacity: 0; pointer-events: none; }
.br-tipo span { display: inline-block; padding: .5rem 1.05rem; border: 1px solid #D8D2C3; border-radius: 999px; background: #fff; font-weight: 600; color: #23443B; }
.br-tipo input:checked + span { background: #23443B; border-color: #23443B; color: #fff; box-shadow: inset 0 -3px 0 #C9A961; }
.br-tipo input:focus-visible + span { outline: 2px solid #C9A961; outline-offset: 2px; }
.br-row { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: end; }
.br-row label { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; font-weight: 600; }
.br-pick { min-width: 320px; }
.br-pick select, .br-pick input { min-width: 320px; }
.br-err { margin: .6rem 0 0; }
.br-empty { display: flex; gap: 1.4rem; align-items: flex-start; }
.br-empty-ico { font-size: 2.4rem; }
.br-steps { margin: .4rem 0 0 1.1rem; padding: 0; line-height: 1.7; }
.br-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .8rem 1.1rem; margin-bottom: 1rem; border-radius: 10px; background: #F4EEDD; border: 1px solid #E6DCC0; }
.br-bar p { margin: 0; }
.br-bar > div { display: flex; gap: .5rem; }
.br-bar .hint { flex-basis: 100%; }

/* ---------- Business Review: pagine 16:9 ---------- */
.br-deck { display: flex; flex-direction: column; gap: 1.4rem; align-items: center; }
.brs { --g: #23443B; --gold: #C9A961; --ink: #1F2A2E; --mut: #6B7570; position: relative; width: 100%; max-width: 1180px; aspect-ratio: 16 / 9; container-type: inline-size; background: #fff;
  box-shadow: 0 6px 26px rgba(16, 32, 26, .14); border-radius: 6px; overflow: hidden; padding: 4.6cqw 4.5cqw 4.4cqw; color: var(--ink); font-size: 14.3px; display: flex; flex-direction: column; }
.brs::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: .9cqw; background: var(--g); }
.brs-head { margin-bottom: 1.6cqw; }
.brs-kick { margin: 0; font-size: .82em; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); position: relative; padding-top: .9cqw; }
.brs-kick::before { content: ""; position: absolute; left: 0; top: 0; width: 3.8cqw; height: .38cqw; background: var(--gold); }
.brs-head h2 { margin: .3cqw 0 0; font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: 2.3em; color: var(--g); line-height: 1.12; }
.brs-lead { margin: .6cqw 0 0; font-size: 1.12em; color: var(--mut); max-width: 90%; }
.brs-foot { position: absolute; left: 4.5cqw; right: 4.5cqw; bottom: 1.4cqw; display: flex; justify-content: space-between; border-top: 1px solid #E3DED2; padding-top: .55cqw; font-size: .72em; color: var(--mut); }
.brs .pos { color: #1E7A52; } .brs .neg { color: #B42318; }
.brs-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.3cqw; }
.brs-kpi { background: #F7F5EF; border-radius: .7cqw; padding: 1.1cqw 1.3cqw 1.1cqw 1.6cqw; position: relative; }
.brs-kpi::before { content: ""; position: absolute; left: 0; top: 1.4cqw; bottom: 1.4cqw; width: .45cqw; background: var(--gold); }
.brs-kpi .l { margin: 0; font-size: .74em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); }
.brs-kpi .v { margin: .35cqw 0; font-family: Georgia, serif; font-weight: 700; font-size: 1.85em; color: var(--g); white-space: nowrap; }
.brs-kpi .s { margin: 0; font-size: .82em; color: var(--mut); }
.brs-h3 { font-family: Georgia, serif; color: var(--g); font-size: 1.2em; margin: 2cqw 0 .6cqw; font-weight: 700; }
.brs-msgs { margin: 0; padding: 0; list-style: none; display: grid; gap: .55cqw; }
.brs-msgs li { position: relative; padding-left: 1.6cqw; line-height: 1.36; font-size: 1.02em; }
.brs-msgs li::before { content: ""; position: absolute; left: 0; top: .5em; width: .62cqw; height: .62cqw; border-radius: 50%; background: var(--gold); }
.brs-msgs li.pos::before { background: #1E7A52; } .brs-msgs li.neg::before { background: #B42318; }
.brs-2 { display: grid; gap: 2cqw; flex: 1; min-height: 0; align-items: start; }
.brs-2.w62 { grid-template-columns: 1.62fr 1fr; } .brs-2.w66 { grid-template-columns: 2fr 1fr; } .brs-2.w46 { grid-template-columns: 1fr 1.15fr; }
.brs .chart { min-height: 0; }
.brs .chart svg { width: 100%; height: auto; max-height: 30cqw; }
.brs-t { width: 100%; border-collapse: collapse; font-size: .86em; font-variant-numeric: tabular-nums; }
.brs-t th, .brs-t td { padding: .34cqw .5cqw; border-bottom: 1px solid #E9E4D8; text-align: right; white-space: nowrap; }
.brs-t thead th { background: var(--g); color: #fff; font-weight: 700; font-size: .92em; }
.brs-t tbody th, .brs-t tfoot th, .brs-t .l { text-align: left; font-weight: 600; }
.brs-t tbody th { white-space: normal; }
.brs-t tbody tr:nth-child(odd) td, .brs-t tbody tr:nth-child(odd) th { background: #FAF8F3; }
.brs-t tfoot th, .brs-t tfoot td { background: #F4F1EA; font-weight: 700; border-top: 2px solid var(--g); }
.brs-t-full { font-size: .92em; }
.brs-t-full tbody th { white-space: nowrap; }
.brs-t-full th, .brs-t-full td { padding: .55cqw .5cqw; }
.brs-box { background: #F7F5EF; border-radius: .7cqw; padding: 1.4cqw 1.6cqw; font-size: .98em; }
.brs-box p { margin: 0 0 .9cqw; line-height: 1.3; } .brs-box .big { font-size: 1.25em; font-weight: 700; }
.brs-box .muted { font-size: .88em; }
.brs-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6cqw 2cqw; }
.brs-list h4 { margin: 0 0 .4cqw; padding: .55cqw 1cqw; color: #fff; background: var(--g); font-size: 1em; }
.brs-list.pos h4 { background: #1E7A52; } .brs-list.neg h4 { background: #B42318; } .brs-list.lost h4 { background: #8A6D3B; }
.brs-list table { width: 100%; border-collapse: collapse; font-size: .9em; }
.brs-list th, .brs-list td { padding: .28cqw .5cqw; border-bottom: 1px solid #E9E4D8; text-align: left; font-weight: 500; }
.brs-list td { text-align: right; white-space: nowrap; }
.brs-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6cqw; }
.brs-act { display: flex; gap: 1.4cqw; align-items: center; background: #F7F5EF; border-radius: .8cqw; padding: 1.3cqw 1.6cqw; min-height: 10cqw; }
.brs-act span { flex: none; width: 4.6cqw; height: 4.6cqw; border-radius: 50%; background: var(--g); color: #fff; display: grid; place-items: center; font-family: Georgia, serif; font-size: 1.6em; font-weight: 700; }
.brs-act p { margin: 0; line-height: 1.35; font-size: 1.04em; }
/* copertina */
.brs-cover { background: #23443B; color: #fff; padding: 0; flex-direction: row; }
.brs-cover::before { width: 2.4cqw; height: auto; bottom: 0; right: auto; background: #C9A961; }
.brs-cover .cv-l { flex: 1; padding: 8.5cqw 4cqw 4cqw 7.5cqw; display: flex; flex-direction: column; }
.brs-cover .cv-r { width: 33%; background: #2F5D50; padding: 8cqw 3.6cqw; display: flex; flex-direction: column; justify-content: space-between; }
.cv-kick { margin: 0; color: #C9A961; font-weight: 700; letter-spacing: .3em; font-size: 1.05em; text-transform: uppercase; }
.brs-cover h1 { margin: 1.2cqw 0 0; font-family: Georgia, serif; font-weight: 400; font-size: 4.6em; line-height: 1; color: #fff; }
.cv-rule { display: block; width: 9cqw; height: .45cqw; background: #C9A961; margin: 2.2cqw 0 1.8cqw; }
.cv-name { margin: 0; font-family: Georgia, serif; font-weight: 700; font-size: 2.5em; line-height: 1.1; }
.cv-scope { margin: 1.2cqw 0 0; color: #E6DCC0; font-size: 1.3em; }
.cv-per { margin: .6cqw 0 0; font-size: 1.3em; }
.cv-by { margin: auto 0 0; color: #BFCBC6; font-size: .95em; }
.cv-num .l { margin: 0; color: #C9A961; font-size: .9em; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.cv-num .v { margin: .4cqw 0; font-family: Georgia, serif; font-size: 2.7em; white-space: nowrap; }
.cv-num .d { margin: 0; font-weight: 700; font-size: 1.05em; } .cv-num .d.pos { color: #8FD3AE; } .cv-num .d.neg { color: #F4A59C; }
@page br { size: 13.333in 7.5in; margin: 0; }
@media print {
  .br-deck { display: block; }
  .brs { page: br; width: 13.333in; max-width: none; height: 7.5in; aspect-ratio: auto; box-shadow: none; border-radius: 0; break-after: page; break-inside: avoid; margin: 0; font-size: 14.3px; }
  .brs:last-child { break-after: auto; }
  .br-deck ~ *, .print-head { display: none !important; }
}
.error-detail { margin: .8rem auto; max-width: 560px; text-align: left; font-size: .8rem; }
.error-detail summary { cursor: pointer; color: #5F6B66; }
.error-detail code { display: block; margin-top: .4rem; padding: .6rem; background: #F4F1EA; border-radius: 6px; white-space: pre-wrap; word-break: break-word; color: #1F2A2E; }
/* Business Review a schermo: pagina fissa 1280×720 ridotta in scala (stessa resa di PDF e PowerPoint) */
.br-deck .brs-fit { position: relative; width: 100%; max-width: 1280px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; box-shadow: 0 6px 26px rgba(16, 32, 26, .14); background: #fff; }
.br-deck .brs-fit > .brs { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; max-width: none; aspect-ratio: auto; transform: scale(var(--s, 1)); transform-origin: 0 0; box-shadow: none; border-radius: 0; }
@media print {
  .br-deck .brs-fit { position: static; width: auto; max-width: none; aspect-ratio: auto; overflow: visible; border-radius: 0; box-shadow: none; break-after: page; }
  .br-deck .brs-fit:last-child { break-after: auto; }
  .br-deck .brs-fit > .brs { position: relative; transform: none; width: 13.333in; height: 7.5in; break-after: auto; }
}
.lst-xpl { padding: 1rem 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; border-left: 4px solid #C9A961; }
.lst-xpl > div { flex: 1 1 380px; } .lst-xpl .hint { margin: .2rem 0 0; }
.aimp-res { border-left: 4px solid #2E7D5B; padding: 1rem 1.25rem; }
.aimp-res h2 { margin: 0 0 .6rem; }
.aimp-kpi { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; list-style: none; margin: 0 0 .6rem; padding: 0; }
.aimp-kpi li { display: flex; align-items: baseline; gap: .35rem; color: #5F6B66; }
.aimp-kpi b { font-family: Georgia, serif; font-size: 1.5rem; color: #23443B; }
.ana-sedi { margin-top: 1rem; }
.sc-ana { padding: .8rem 1.2rem; }
.sc-ana dl { display: flex; flex-wrap: wrap; gap: .5rem 1.8rem; margin: 0; }
.sc-ana dt { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6B7570; }
.sc-ana dd { margin: .1rem 0 0; font-weight: 600; color: #1F2A2E; }

/* colonna del margine % evidenziata */
table.data th.col-hl, table.data td.col-hl, table th.col-hl, table td.col-hl { background: #FFF3CF !important; font-weight: 700; }
table.data thead th.col-hl { color: #6B4E00; }
table.data td.col-hl strong { font-weight: 800; }
/* anno corrente nelle tabelle di confronto: kg ed € in neretto */
table td.cy-col, table th.cy-col { font-weight: 700; }
table td.cy-col { background-image: linear-gradient(rgba(29, 53, 87, .045), rgba(29, 53, 87, .045)); }
table thead th.cy-col { color: var(--ink, #1D3557); }
@media print { table td.cy-col { background-image: none; } }
/* Margine Netto: la tabella degli articoli entra nella pagina */
.mg-table { font-size: .76rem; }
.mg-table th, .mg-table td { padding-left: .3rem; padding-right: .3rem; }
.mg-table td.mg-desc { min-width: 150px; max-width: 260px; }
.mg-table td .mc-sub { white-space: normal; }
.mg-table td.mg-pm .mc-sub { white-space: nowrap; }
/* stampa grafici: un grafico alto (es. famiglie di prodotto) resta intero in una pagina, con titolo e legenda */
@media print {
  .chart svg { max-height: 78vh; width: auto !important; max-width: 100% !important; margin: 0 auto; display: block; }
  .chart-panel.span-all { break-inside: avoid; page-break-inside: avoid; }
  .chart-panel .legend, .chart-panel .chart-legend { break-after: avoid; page-break-after: avoid; }
}
/* Home direzionale in PDF */
@media print {
  .home-find { display: none !important; }
  .home-hero { padding: 8px 12px; margin-bottom: 8px; break-inside: avoid; }
  .home-hero h1 { font-size: 18px; }
  .kpis.kpis-5 { grid-template-columns: repeat(5, 1fr) !important; }
  .home-grid { grid-template-columns: 2fr 1fr !important; gap: 8px; }
  .home-grid > * { break-inside: avoid; }
}
/* Elaborazione Offerta a costo */
.ofc-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 1100px) { .ofc-top { grid-template-columns: 1fr; } }
.ofc-costs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1rem; }
.ofc-costs .span-2, .form-grid .span-2 { grid-column: span 2; }
.ofc-note-int { display: block; margin-top: .8rem; }
.ofc-note-int textarea, .ofc-form textarea { width: 100%; }
.ofc-add { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .8fr); gap: 1rem; }
@media (max-width: 1100px) { .ofc-add { grid-template-columns: 1fr; } }
.ofc-add-box { border: 1px solid var(--line, #e3dfd3); border-radius: 10px; padding: .8rem; }
.ofc-add-box h3 { margin: 0 0 .5rem; font-size: .95rem; }
.ofc-add-box select[multiple] { width: 100%; }
.ofc-new { display: grid; gap: .35rem; }
.ofc-new input { width: 100%; }
.ofc-table .ofc-desc { min-width: 220px; }
.ofc-table .ofc-mn { max-width: 6.5rem; display: inline-flex; }
.ofc-table .ofc-mn input { width: 4.2rem; text-align: right; font-weight: 700; }
.ofc-table td.ofc-net, .ofc-table th.ofc-net { background: #E9F2EC; }
.ofc-table tr.ofc-bad td { background: #FDECEC; }
.ofc-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 2rem; }
.ofc-tools { display: flex; gap: .5rem; justify-content: flex-end; margin-bottom: .6rem; }
.ofc-to { margin: 1rem 0 .4rem; }
.ofc-to-k { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #6b6b6b); margin: 0; }
.ofc-to-v { font-size: 1.25rem; font-weight: 700; margin: .1rem 0 0; }
.ofc-cond { display: flex; flex-wrap: wrap; gap: .4rem 2rem; margin: .4rem 0 1rem; }
.ofc-cond dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #6b6b6b); }
.ofc-cond dd { margin: 0; font-weight: 600; }
.ofc-notes { margin-top: 1rem; padding: .7rem .9rem; border-left: 3px solid #C9A227; background: #FBF8EF; break-inside: avoid; }
.ofc-notes h3 { margin: 0 0 .3rem; font-size: .9rem; }
.ofc-notes p { margin: 0; }
.ofc-sign { margin-top: 2rem; break-inside: avoid; }
.ofc-sign p { margin: .1rem 0; }
.ofc-sign-name { font-weight: 700; font-size: 1.05rem; }
@media print { .ofc-table td.ofc-net, .ofc-table th.ofc-net { background: #E9F2EC !important; } }
.ofc-table { font-size: .8rem; }
table.data.ofc-table thead th, table.data.dense.ofc-table thead th { white-space: normal !important; line-height: 1.15; vertical-align: bottom; min-width: 3.6rem; }
.ofc-table thead th:nth-child(2) { min-width: 0; }
.ofc-table .ofc-desc { min-width: 140px; }
.ofc-table th, .ofc-table td { padding-left: .35rem; padding-right: .35rem; }
.ofc-table .ofc-mn input { width: 3.3rem; }
/* Scheda cliente: sintesi, due colonne, costi per servire il cliente */
.ana-facts { list-style: none; margin: 0; padding: .9rem 1.25rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .6rem; background: #fff; border-bottom: 1px solid #E3E7EC; }
.ana-facts li { background: #F7F8FA; border: 1px solid #E8EBEF; border-radius: 10px; padding: .5rem .75rem; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.ana-facts span { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #6B7684; font-weight: 600; }
.ana-facts b { font-size: 1rem; color: #13233A; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ana-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.ana-two > .ana-sec:first-child { margin-right: .5rem; }
.ana-two > .ana-sec:last-child { margin-left: .5rem; }
.ana-two .ana-kv > div { grid-template-columns: minmax(7.5rem, 36%) 1fr; }
@media (max-width: 1150px) { .ana-two { grid-template-columns: 1fr; } .ana-two > .ana-sec { margin-left: 1.25rem !important; margin-right: 1.25rem !important; } }
.ana-costs { border: 2px solid #C9A961; background: linear-gradient(180deg, #FFFCF4, #fff 60%); }
.ana-costs-lead { margin: .5rem 1.2rem 0; color: #6B7684; font-size: .88rem; }
.ana-cost-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; padding: .8rem 1.2rem .4rem; }
@media (max-width: 1000px) { .ana-cost-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ana-cost { background: #13233A; color: #fff; border-radius: 12px; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.ana-cost-k { font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: #E8D5A6; font-weight: 700; }
.ana-cost-v { font-size: 1.7rem; font-weight: 700; line-height: 1.1; color: #fff; }
.ana-cost-v small { font-size: .85rem; font-weight: 500; color: #C8D0DC; }
.ana-cost-n { font-size: .85rem; color: #C8D0DC; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ana-cost .ana-empty { color: #8C97A6; font-size: .9rem; font-weight: 400; }
.ana-cost-tot { margin: .5rem 1.2rem .3rem; padding: .55rem .8rem; background: #F6EFDD; border-radius: 8px; color: #13233A; font-size: .92rem; }
.ana-fcosts { border-left: 4px solid #C9A961; }
/* Resoconto clienti */
.ana-res-f { display: flex; align-items: end; gap: .5rem; }
.ana-res-f label { display: flex; flex-direction: column; gap: .15rem; }
.ana-res-wrap { margin: 1rem 1.25rem; background: #fff; border: 1px solid #E3E7EC; border-radius: 12px; overflow: auto; }
.ana-res-t { font-size: .84rem; }
.ana-res-t thead th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.ana-res-t td, .ana-res-t tbody th { padding: .45rem .6rem; vertical-align: top; }
.ana-res-t td.n { text-align: right; }
.ana-res-t tr.ana-res-first td, .ana-res-t tr.ana-res-first th { border-top: 2px solid #C9A961; }
.ana-res-c { font-weight: 700; color: #9A7B33; white-space: nowrap; }
@media print {
  .ana-facts { padding: 3mm 0; gap: 2mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ana-facts li { padding: 1.5mm 2.5mm; }
  .ana-facts b { font-size: 10pt; }
  .ana-two { grid-template-columns: 1fr 1fr !important; }
  .ana-two > .ana-sec { margin-left: 0 !important; margin-right: 0 !important; }
  .ana-two > .ana-sec:first-child { margin-right: 2mm !important; }
  .ana-cost, .ana-costs, .ana-cost-tot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ana-cost-v { font-size: 15pt; }
  .ana-res-wrap { margin: 2mm 0; overflow: visible; border: 0; }
  .ana-res-t { font-size: 7.6pt; }
  .ana-res-t td, .ana-res-t tbody th, .ana-res-t thead th { padding: 1mm 1.6mm !important; font-size: 7.6pt; }
  .ana-res-t tr { break-inside: avoid; }
  .ana-res-t thead { display: table-header-group; }
  .ana-res-t tr.ana-res-first td, .ana-res-t tr.ana-res-first th, .ana-res-c { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.ana-kv.ana-kv-2 { display: grid; grid-template-columns: 1fr 1fr; }
.ana-kv.ana-kv-2 > div { grid-template-columns: minmax(8rem, 40%) 1fr; background: transparent !important; border-bottom: 1px solid #EEF0F3; }
.ana-kv.ana-kv-2 > div:nth-child(4n+1), .ana-kv.ana-kv-2 > div:nth-child(4n+2) { background: #F7F8FA !important; }
@media (max-width: 1000px) { .ana-kv.ana-kv-2 { grid-template-columns: 1fr; } }
@media print { .ana-kv.ana-kv-2 > div:nth-child(4n+1), .ana-kv.ana-kv-2 > div:nth-child(4n+2) { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
@media print {
  .ana-doc .ana-sec { break-inside: auto; page-break-inside: auto; }
  .ana-doc .ana-sec-h { break-after: avoid; page-break-after: avoid; }
  .ana-doc .ana-costs, .ana-doc .ana-two .ana-sec, .ana-kv > div, .ana-ct tr { break-inside: avoid; page-break-inside: avoid; }
  .ana-doc:not(.ana-res) .ana-facts { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .ana-doc:not(.ana-res) .ana-facts span { font-size: 6.5pt; }
}
@media print {
  .ana-kv.ana-kv-2 { grid-template-columns: 1fr 1fr !important; }
  .ana-cost-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .ana-foot { break-before: avoid; page-break-before: avoid; }
}
@media print { .ana-res-t td:nth-child(8), .ana-res-t td:nth-child(7) { white-space: nowrap; } }
.ana-res-t .badge { font-size: .7rem; padding: .05rem .4rem; }
@media print { .ana-res .ana-facts li { padding: 1mm 2mm; } .ana-res .ana-facts b { font-size: 9pt; } .ana-res-t .badge { font-size: 6.5pt; } }
.ana-res-t td:nth-child(4) { max-width: 12rem; }
.ana-res-t { width: 100%; }
@media print {
  .ana-res-t td:nth-child(9) { white-space: normal; max-width: 30mm; }
  .ana-res-t tbody th { max-width: 48mm; }
  .ana-res-t thead th { white-space: normal; }
}
.ana-res-t { font-size: .8rem; }
.ana-res-t thead th { white-space: normal !important; vertical-align: bottom; }
.ana-res-t td, .ana-res-t tbody th { padding: .4rem .5rem; }
.ana-res-t td:nth-child(9) { white-space: normal; }
.ana-res-t tbody th { max-width: 15rem; white-space: normal; }
.ana-res-c { white-space: normal !important; max-width: 7rem; }
/* Inter è un po' più largo: gli importi grandi restano su una riga */
.kpi-value { white-space: nowrap; font-size: clamp(1.2rem, 1.75vw, 1.6rem); letter-spacing: -.02em; }
.ms-value { letter-spacing: -.025em; }
/* Inter: tabelle un filo più compatte per restare larghe come prima */
table.data { font-size: .865rem; }
table.data.dense th, table.data.dense td { font-size: .825rem; }
table.data thead th { font-size: .78rem; letter-spacing: .005em; }
