/* Gestionale Nutrimotion — stile */

@font-face { font-family: 'Manrope'; font-weight: 400; font-display: swap; src: url('../fonts/manrope-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 500; font-display: swap; src: url('../fonts/manrope-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 600; font-display: swap; src: url('../fonts/manrope-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 700; font-display: swap; src: url('../fonts/manrope-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-display: swap; src: url('../fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-display: swap; src: url('../fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-style: italic; font-display: swap; src: url('../fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2'); }

:root {
  --ink: #1D1D1E;
  --ink-2: #2A2928;
  --gold: #A48536;
  --cacao: #5B4336;
  --cacao-2: #7C5F4D;
  --sand: #C9B49B;
  --sand-2: #E3D6C4;
  --ivory: #F6F1E9;
  --cream: #EFE7DA;
  --card: #FFFDF9;
  --line: #E7DDCF;
  --line-2: #D9CCBA;
  --text: #2B2622;
  --muted: #84786D;
  --good: #4C7657;
  --good-bg: #E6EFE6;
  --bad: #B0563D;
  --bad-bg: #F6E4DD;
  --warn: #A9781F;
  --warn-bg: #F6ECD6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(60, 40, 25, .04), 0 6px 24px -12px rgba(60, 40, 25, .14);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--ivory); -webkit-font-smoothing: antialiased; }
a { color: var(--cacao); text-decoration: none; }
a:hover { color: var(--ink); }
h1, h2, h3 { margin: 0; font-weight: 600; color: var(--ink); }
h1 { font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1.05; letter-spacing: -.01em; }
h2 { font-size: 15px; letter-spacing: .01em; }
code { background: var(--cream); padding: 1px 6px; border-radius: 5px; font-size: .92em; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hint { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
.warn-text { color: var(--warn); font-weight: 600; }
.danger-text { color: var(--bad) !important; }
.row-gap { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Struttura ---------- */

.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--ink); color: var(--sand-2); display: flex; flex-direction: column; padding: 28px 16px 20px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; flex-direction: column; align-items: center; padding: 4px 12px 30px; color: var(--cream); }
.brand-logo { width: 150px; height: auto; display: block; }
.brand .brand-sub { margin-top: 12px; color: var(--gold); opacity: 1; }
.auth-logo { width: 230px; height: auto; display: block; }
.report-logo { height: 62px; width: auto; display: block; }
.brand:hover { color: #fff; }
.brand-name { font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: .01em; line-height: 1; }
.brand-name.dark { color: var(--cacao); }
.brand-sub { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--sand); margin-top: 8px; opacity: .8; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #CDBFAE; font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: var(--cream); }
.nav a.active { background: var(--cream); color: var(--ink); }
.nav a.active .ic { color: var(--gold); }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding: 16px 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me-name { color: var(--cream); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-btn { background: none; border: 0; color: #B9AA98; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; padding: 6px; border-radius: 8px; }
.link-btn:hover { color: var(--cream); background: rgba(255, 255, 255, .06); }

.main { padding: 38px 44px 60px; max-width: 1320px; width: 100%; min-width: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 6px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.count { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--muted); background: var(--cream); padding: 2px 9px; border-radius: 20px; vertical-align: middle; margin-left: 6px; letter-spacing: 0; }
h1 .count { font-size: 14px; position: relative; top: -6px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 10px; }
.back .ic { width: 16px; height: 16px; }

/* ---------- Pulsanti ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font: 600 13.5px var(--sans); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: var(--sand); background: #fff; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 17px; height: 17px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.btn.primary:hover { background: var(--ink-2); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--cream); color: var(--ink); }
.btn.danger { background: var(--card); border-color: #E2B9AB; color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.block { width: 100%; height: 46px; }
.btn.icon-only { padding: 0; width: 40px; }
.icon-link { background: none; border: 0; padding: 6px; border-radius: 8px; color: var(--muted); display: inline-flex; cursor: pointer; }
.icon-link:hover { background: var(--cream); color: var(--ink); }
.icon-link .ic { width: 16px; height: 16px; }
.link { color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Card ---------- */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; }
.empty { color: var(--muted); margin: 6px 0; }
.empty-card { text-align: center; padding: 48px 24px; }
.empty-card h2 { font-family: var(--serif); font-size: 26px; font-weight: 500; margin-bottom: 6px; }
.empty-card .row-gap { justify-content: center; margin-top: 18px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cols > .card { margin-bottom: 0; }
.cols + .card, .cols + section { margin-top: 20px; }

/* ---------- Statistiche ---------- */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); color: inherit; }
a.stat:hover { border-color: var(--sand); color: inherit; }
.stat.accent { background: var(--cacao); border-color: var(--cacao); color: var(--cream); }
.stat.accent .stat-label, .stat.accent .stat-foot { color: var(--sand-2); }
.stat.accent .stat-value { color: #fff; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.stat-value { font-family: var(--serif); font-size: 44px; line-height: 1.05; font-weight: 500; color: var(--ink); }
.stat-value small { font-family: var(--sans); font-size: 15px; font-weight: 600; }
.stat-foot { font-size: 12px; color: var(--muted); }

/* ---------- Elenchi ---------- */

.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--line); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; color: inherit; border-radius: 8px; }
.list-row:hover { background: var(--ivory); color: inherit; }
.list-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.list-main strong { font-weight: 600; color: var(--ink); }
.list-main .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--cream); color: var(--cacao); display: inline-flex; align-items: center; justify-content: center; font: 600 13px var(--sans); letter-spacing: .03em; border: 1px solid var(--line); }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; background: var(--cacao); color: var(--cream); border: 0; }
.avatar.lg { width: 64px; height: 64px; font-family: var(--serif); font-size: 26px; font-weight: 500; background: var(--cacao); color: var(--cream); border: 0; }
.badge-ic { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.badge-ic.bia { background: var(--cream); color: var(--cacao); }
.badge-ic.mis { background: #ECEAE4; color: #5D5A52; }

.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-soft { background: var(--cream); color: var(--cacao); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-attiva { background: var(--good-bg); color: var(--good); }
.pill-in_pausa { background: var(--warn-bg); color: var(--warn); }
.pill-conclusa { background: #ECEAE6; color: #77716A; }

.delta { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
.delta.good { color: var(--good); background: var(--good-bg); }
.delta.bad { color: var(--bad); background: var(--bad-bg); }
.delta.neutral { color: #6F665D; background: #EFEBE5; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 32px; align-items: center; gap: 14px; color: inherit; }
.bar-row:hover { color: inherit; }
.bar-row:hover .bar-fill { background: var(--cacao); }
.bar-label { font-weight: 500; }
.bar-track { height: 10px; background: var(--cream); border-radius: 10px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--cacao-2); border-radius: 10px; transition: background .15s; }
.bar-num { text-align: right; font-weight: 700; }

/* ---------- Filtri e tabelle ---------- */

.filters { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.search { flex: 1; min-width: 240px; position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 13px; color: var(--muted); }
.search input { padding-left: 40px !important; }

input, select, textarea { width: 100%; font: 500 14.5px var(--sans); color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 13px; height: 42px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { padding: 11px 13px; height: auto; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2384786D' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 16px; }
.filters select { width: auto; min-width: 160px; }
input:focus, select:focus, textarea:focus { border-color: var(--cacao-2); box-shadow: 0 0 0 3px rgba(124, 95, 77, .14); }
input::placeholder, textarea::placeholder { color: #B5AA9D; }

.table-card { padding: 6px 0 0; overflow: hidden; }
.table-card .card-head { padding: 16px 24px 0; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table .num { text-align: right; }
.table .unit { text-transform: none; letter-spacing: 0; font-weight: 500; opacity: .8; }
.table .actions { text-align: right; width: 1%; white-space: nowrap; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: #FBF8F3; }
.clients .num { white-space: nowrap; }
.clients .num .v { margin-right: 8px; font-weight: 600; }
.clients .num small { color: var(--muted); font-weight: 500; }
.client-cell { display: flex; align-items: center; gap: 12px; color: inherit; }
.client-cell > span:last-child { display: flex; flex-direction: column; }
.client-cell strong { color: var(--ink); font-weight: 600; }
.legend { margin-top: -8px; }
.legend .delta { font-size: 11px; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.history td.num { font-variant-numeric: tabular-nums; }
.note-dot { color: var(--cacao-2); margin-left: 6px; cursor: help; font-size: 18px; line-height: 0; position: relative; top: 2px; }

/* ---------- Moduli ---------- */

.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 14px; }
.form-card { padding: 28px 30px; }
.form-section .hint { font-family: var(--sans); font-size: 12px; }
.form-section { font-family: var(--serif); font-size: 22px; font-weight: 500; margin: 26px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.form-section:first-of-type, .form > .form-section:first-child { margin-top: 0; }
.form-card > input[type=hidden] + .form-section { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 18px; }
.span-2 { grid-column: span 2; }
.align-end { align-items: end; }
.form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; height: 42px; margin-bottom: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--cacao); flex: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.metric-input input { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; height: 48px; }
.metric-input input::placeholder { font-weight: 500; color: #C4B9AC; }
.mi-label { display: flex; align-items: baseline; }
.inline-form { margin-top: 22px; }
.inline-form .form-actions { border-top: 0; padding-top: 0; margin-top: 0; }

.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-color: #EBD3CA; background: #FFFBF9; }
.danger-zone p { margin: 2px 0 0; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 500; border: 1px solid; }
.flash a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; color: inherit; }
.flash-ok { background: var(--good-bg); border-color: #CADBCB; color: #355640; }
.flash-err { background: var(--bad-bg); border-color: #EBC5B8; color: #8E3F2A; }
.flash-warn { background: var(--warn-bg); border-color: #EAD6AD; color: #7D5810; }
.flash-info { background: var(--cream); border-color: var(--line-2); color: var(--cacao); }

/* ---------- Scheda cliente ---------- */

.client-head { align-items: flex-end; }
.client-title { display: flex; align-items: center; gap: 18px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 8px 0 0; color: var(--muted); font-weight: 500; }
.meta > span:not(.pill) + span:not(.pill)::before, .meta .pill + span::before { content: none; }
.client-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.client-side .card { padding: 20px 22px; }
.facts { margin: 0; display: flex; flex-direction: column; }
.facts > div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.prose { margin: 0; white-space: normal; line-height: 1.6; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; box-shadow: var(--shadow); }
.kpi.soft { background: transparent; box-shadow: none; border-style: dashed; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi-value { font-family: var(--serif); font-size: 36px; font-weight: 500; line-height: 1.1; color: var(--ink); }
.kpi-value small { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi .delta { margin-top: 4px; font-size: 12.5px; }
.kpi-foot { font-size: 11.5px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 600 12.5px var(--sans); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--sand); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.chart-box { position: relative; height: 290px; }

/* ---------- Accesso / installazione ---------- */

body.bare { min-height: 100vh; background: var(--ink); background-image: radial-gradient(ellipse at 30% 0%, #3A2D25 0%, var(--ink) 60%); display: flex; }
.auth-wrap { margin: auto; padding: 40px 20px; width: 100%; display: flex; flex-direction: column; align-items: center; }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 18px; padding: 36px 34px 30px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .6); }
.auth-card.wide { max-width: 620px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 26px; text-align: center; }
.auth-brand .brand-name { color: var(--ink); font-size: 40px; }
.auth-brand .brand-sub { color: var(--gold); opacity: 1; margin-top: 14px; }
.auth-card .form-section { font-size: 20px; margin-top: 18px; }
.auth-foot { color: #8C7F72; font-size: 12px; margin-top: 18px; letter-spacing: .04em; }

/* ---------- Report ---------- */

body.report-body { background: #E9E2D7; }
.report-toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; background: rgba(246, 241, 233, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.report { width: 210mm; min-height: 297mm; margin: 28px auto 60px; background: #fff; padding: 18mm 18mm 14mm; box-shadow: 0 20px 60px -30px rgba(60, 40, 25, .35); display: flex; flex-direction: column; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.report-head > div:first-child { display: flex; flex-direction: column; gap: 6px; }
.report-pro { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.report-date { font-size: 12px; color: var(--muted); }
.report-hero { padding: 26px 0 8px; }
.report-hero h1 { font-size: 46px; }
.report-period { color: var(--muted); margin: 8px 0 0; font-weight: 500; }
.report-highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 6px; }
.hl { background: var(--ivory); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; }
.hl-v { font-family: var(--serif); font-size: 32px; font-weight: 600; color: var(--good); line-height: 1.1; }
.hl-l { font-size: 12px; color: var(--muted); font-weight: 600; }
.report-section { margin-top: 22px; break-inside: avoid; }
.report-section h2 { font-family: var(--serif); font-size: 21px; font-weight: 500; margin-bottom: 10px; }
.report-chart { height: 230px; }
.report-table th, .report-table td { padding: 8px 10px !important; font-size: 13px; }
.report-table td { font-variant-numeric: tabular-nums; }
.date-sub { display: block; font-size: 10.5px; color: var(--muted); font-weight: 500; }
.report-comment { min-height: 70px; border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px 14px; line-height: 1.6; outline: none; }
.report-comment:empty::before { content: attr(data-placeholder); color: #B5AA9D; }
.report-comment:focus { border-color: var(--cacao-2); }
.report-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; font-size: 10.5px; color: var(--muted); }

@media print {
  @page { size: A4; margin: 0; }
  body.report-body { background: #fff; }
  .no-print { display: none !important; }
  .report { margin: 0; box-shadow: none; width: auto; min-height: 297mm; }
  .report-comment { border-color: transparent; padding: 0; }
  .report-comment:empty { display: none; }
  .report-section:has(.report-comment:empty) { display: none; }
  .delta, .hl, .pill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .client-layout { grid-template-columns: minmax(0, 1fr); }
  .client-side { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 20px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  body { font-size: 15px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; z-index: 20; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, .06); }
  .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 7px 6px; flex: 1; border-radius: 10px; }
  .nav a.active { background: rgba(239, 231, 218, .12); color: var(--cream); }
  .nav a.active .ic { color: var(--gold); }
  .nav .ic { width: 21px; height: 21px; }
  .main { padding: 22px 16px 100px; }
  h1 { font-size: 32px; }
  .page-head { margin-bottom: 20px; align-items: flex-start; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .head-actions .btn.icon-only { flex: none; }
  .cols, .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .client-side { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 30px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .chip { flex: none; }
  .table-card .card-head { padding: 14px 18px 0; }
  .history th:first-child, .history td:first-child { padding-left: 18px; position: sticky; left: 0; background: var(--card); z-index: 1; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: auto; }
  .card { padding: 18px; }
  .form-card { padding: 20px 18px; }
  .stat-value { font-size: 36px; }
  .bar-row { grid-template-columns: 110px 1fr 28px; }
  .filters .search { flex-basis: 100%; }
  .filters select { flex: 1; min-width: 0; }
  .filters .btn { display: none; }
  .avatar.lg { width: 52px; height: 52px; font-size: 22px; }
  .chart-box { height: 240px; }
  .danger-zone { flex-direction: column; align-items: stretch; }

  /* elenco clienti come schede */
  .clients thead { display: none; }
  .clients, .clients tbody, .clients tr, .clients td { display: block; width: 100%; }
  .clients tr { padding: 14px 18px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 10px; }
  .clients tbody tr:last-child { border-bottom: 0; }
  .clients td { padding: 0 !important; border: 0; text-align: left !important; }
  .clients td:first-child { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
  .clients td:nth-child(2), .clients td:nth-child(3), .clients td:nth-child(4) { display: none; }
  .clients td.num::before { content: attr(data-label); display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
  .clients td.num .v { display: block; }
  .clients tbody tr:hover td { background: transparent; }
  .report-toolbar .muted { display: none; }
}

.mobile-only { display: none; }
@media (max-width: 900px) { .mobile-only { display: block; } }

/* Cifre allineate (non "da vecchio stile") nei numeri grandi */
.stat-value, .kpi-value, .hl-v, h1, .avatar.lg { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
