/* Studio Salatino — Gestionale. Design system derivato dal sito (blu #023F82, Inter + Open Sans) */
:root {
  --blue: #023F82;
  --blue-dark: #012a56;
  --blue-light: #e8eff7;
  --blue-lighter: #f3f7fb;
  --amber: #F5A524;
  --amber-light: #fff8ec;
  --amber-dark: #8a5c10;
  --green: #1f7a45;
  --green-light: #e7f5ec;
  --red: #c03434;
  --red-light: #fdeeee;
  --text: #212836;
  --gray: #5a6272;
  --muted: #8a93a3;
  --border: #E9EBEF;
  --border-strong: #CAD0DB;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --shadow-sm: 0 1px 3px rgba(2, 63, 130, .06), 0 1px 2px rgba(2, 63, 130, .08);
  --shadow-md: 0 8px 24px rgba(2, 63, 130, .08);
  --shadow-lg: 0 20px 50px rgba(2, 63, 130, .18);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar: 248px;
  --font-head: 'Inter', system-ui, sans-serif;
  --font-body: 'Open Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: 26px; font-weight: 800; line-height: 1.2; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.eyebrow { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 2px; font-size: 11px; font-weight: 700; color: var(--blue); margin-bottom: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.mono { font-variant-numeric: tabular-nums; font-family: var(--font-head); font-weight: 600; }
.text-danger { color: var(--red) !important; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  font-family: var(--font-head); font-weight: 700; font-size: 14px; line-height: 1.2;
  cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 3px 10px rgba(2, 63, 130, .22); }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-outline { background: var(--surface); color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue-light); }
.btn-ghost { background: transparent; color: var(--gray); }
.btn-ghost:hover { background: var(--blue-lighter); color: var(--blue); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a02828; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 0; background: transparent; color: var(--gray); cursor: pointer; flex: none; list-style: none;
}
.icon-btn:hover:not(:disabled) { background: var(--blue-light); color: var(--blue); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn::-webkit-details-marker { display: none; }
.link { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; font-size: 13px; }
.link .icon { width: 14px; height: 14px; }

/* ---------- Forms ---------- */
.input {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(2, 63, 130, .12); }
.input::placeholder { color: #a8b0bd; }
textarea.input { resize: vertical; min-height: 44px; line-height: 1.6; }
select.input { padding-right: 32px; }
.input-sm { width: auto; padding: 7px 10px; font-size: 13px; }
.input.num { text-align: right; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--gray); }
.field-hint { font-size: 12px; color: var(--muted); }
.field-full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.form-error { color: var(--red); font-size: 13px; font-weight: 600; }
.form-stack .btn { align-self: flex-start; }
.form-stack h2 { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); column-gap: 16px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand {
  background: linear-gradient(150deg, var(--blue) 0%, var(--blue-dark) 100%); color: #fff;
  padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.login-brand .eyebrow { color: var(--amber); }
.login-brand h1 { color: #fff; font-size: 36px; max-width: 520px; }
.login-sub { margin-top: 16px; opacity: .8; max-width: 460px; font-size: 16px; }
.login-logo { width: 220px; }
.login-form { align-self: center; justify-self: center; width: min(400px, 100% - 48px); padding: 40px 0; }
.login-form h2 { font-size: 24px; margin-bottom: 24px; }
.login-form .check { margin: 4px 0 18px; }
.login-form .form-error { margin-bottom: 12px; }
.login-logo-mobile { display: none; width: 200px; margin-bottom: 28px; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--blue-dark); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 14px;
}
.brand { padding: 4px 10px 22px; }
.brand img { width: 170px; }
.sidebar-client { margin: -8px 10px 16px; padding: 8px 10px; background: rgba(255, 255, 255, .08); border-radius: var(--radius-sm); font-family: var(--font-head); font-weight: 600; font-size: 13px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .78); font-family: var(--font-head); font-weight: 600; font-size: 14px; text-decoration: none;
}
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.active { background: var(--blue); color: #fff; box-shadow: inset 3px 0 0 var(--amber); }
.sidebar-user { display: flex; align-items: center; gap: 6px; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: #fff; padding: 6px; border-radius: var(--radius-sm); text-decoration: none !important; }
.user-chip:hover { background: rgba(255, 255, 255, .08); }
.user-chip strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { display: block; font-size: 11px; opacity: .65; }
.user-chip > span:last-child { min-width: 0; }
.sidebar .icon-btn { color: rgba(255, 255, 255, .7); }
.sidebar .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--amber); color: var(--blue-dark); font-family: var(--font-head); font-weight: 800; font-size: 13px;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; background: var(--blue-light); color: var(--blue); margin-left: auto; }
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.view { padding: 28px 36px 60px; max-width: 1320px; width: 100%; }
.sidebar-scrim { display: none; }

/* ---------- Page ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--gray); margin-bottom: 10px; }
.back .icon { width: 15px; height: 15px; }
.meta-line { margin-top: 6px; font-size: 14px; }
.sticky-head { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 12px 0; margin-top: -12px; border-bottom: 1px solid transparent; }
.head-title { flex: 1 1 380px; min-width: 0; }
.head-title .input-h1 { width: 100%; }
.input-h1 { font-family: var(--font-head); font-size: 24px; font-weight: 800; border-color: transparent; background: transparent; padding: 4px 8px; margin-left: -9px; }
.input-h1:hover { border-color: var(--border-strong); }
.input-h1:focus { background: var(--surface); }
.save-state { min-width: 0; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .input { width: auto; min-width: 180px; }
.toolbar input[type=search] { flex: 1; min-width: 220px; max-width: 380px; }
.segmented { display: inline-flex; background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); padding: 2px; }
.segmented button { border: 0; background: transparent; padding: 6px 12px; border-radius: 4px; font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--gray); cursor: pointer; }
.segmented button[aria-pressed=true] { background: var(--blue); color: #fff; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols > .card { margin-bottom: 0; }
.cols + .card, .cols + section { margin-top: 18px; }
.section { margin-bottom: 28px; }
.group-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--gray); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--blue-light); color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.prose p + p, .prose ul { margin-top: 10px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none !important;
}
a.stat:hover { border-color: var(--blue); }
.stat-value { font-family: var(--font-head); font-weight: 800; font-size: 26px; color: var(--blue); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--gray); }
.stat-alert .stat-value { color: var(--red); }
.stats-sm .stat-value { font-size: 20px; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-family: var(--font-head); font-size: 11.5px; font-weight: 700; white-space: nowrap; letter-spacing: .1px; }
h1 .badge { font-size: 12px; }
.badge-neutral { background: #eef0f3; color: var(--gray); }
.badge-info { background: var(--blue-light); color: var(--blue); }
.badge-brand { background: var(--blue); color: #fff; }
.badge-success { background: var(--green-light); color: var(--green); }
.badge-warn { background: var(--amber-light); color: var(--amber-dark); }
.badge-danger { background: var(--red-light); color: var(--red); }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list.card { padding: 4px 0; }
.list > li + li { border-top: 1px solid var(--border); }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; color: var(--text); text-decoration: none !important; }
.list.card .list-row { padding: 12px 18px; }
a.list-row:hover, .clickable:hover strong { color: var(--blue); }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.list-main small { color: var(--muted); font-size: 13px; }
.list-meta { display: flex; align-items: center; gap: 8px; flex: none; font-size: 13px; }
.clickable { cursor: pointer; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }

/* Tables */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-family: var(--font-head); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--blue-lighter); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { text-align: right; white-space: nowrap; }

.progress { height: 6px; background: var(--blue-light); border-radius: 3px; overflow: hidden; min-width: 80px; }
.progress span { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.progress-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.progress-row .progress { flex: 1; max-width: 360px; }

.empty { text-align: center; padding: 36px 20px; color: var(--gray); }
.empty-title { font-family: var(--font-head); font-weight: 700; color: var(--text); margin-bottom: 4px; }
.empty p { font-size: 14px; margin-bottom: 12px; }
.empty .btn { margin-top: 10px; }

.callout { display: flex; gap: 14px; background: var(--amber-light); border: 1px solid #f3dcae; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; }
.callout > .icon { color: var(--amber-dark); width: 22px; height: 22px; margin-top: 2px; }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
.callout p { margin: 4px 0 10px; }

.loading { display: grid; place-items: center; min-height: 40vh; }
.loading span { width: 30px; height: 30px; border: 3px solid var(--blue-light); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; padding: 9px 0; font-size: 14px; align-items: baseline; }
.timeline li + li { border-top: 1px dashed var(--border); }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); align-self: center; }
.timeline time { font-size: 12px; white-space: nowrap; }

/* Client detail */
.detail-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.info { margin: 0; }
.info-row { padding: 8px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 90px 1fr; gap: 8px; font-size: 14px; }
.info-row:last-child { border-bottom: 0; }
.info dt { color: var(--muted); font-size: 13px; }
.info dd { margin: 0; overflow-wrap: anywhere; }
.notes { margin-top: 16px; background: var(--amber-light); padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.notes h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--amber-dark); margin-bottom: 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--gray); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--blue); border-bottom-color: var(--blue); }

/* Menu (details) */
.menu { position: relative; }
.menu summary { font-size: 20px; line-height: 1; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 6px; min-width: 220px; z-index: 30; }
.menu-list button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.menu-list button:hover { background: var(--blue-lighter); }

/* Projects */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; gap: 10px; margin: 0; color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.project-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); }
.project-card-head, .project-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.project-card-foot .icon { width: 14px; height: 14px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }

.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 10px; }
.column { background: #eef2f7; border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; min-height: 220px; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.column-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--gray); }
.column-head .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.column-body { display: flex; flex-direction: column; gap: 8px; flex: 1; border-radius: var(--radius-sm); transition: background .15s; min-height: 60px; }
.column-body.drop-over { background: var(--blue-light); }
.task { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; box-shadow: var(--shadow-sm); cursor: pointer; }
.task:hover { border-color: var(--blue); }
.task.dragging { opacity: .45; }
.task-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-meta .icon { width: 13px; height: 13px; }
.task-done .task-title, .task-done .list-main strong { text-decoration: line-through; color: var(--muted); }
.task-row { padding-left: 18px !important; }
.task-check { width: 18px; height: 18px; accent-color: var(--green); flex: none; cursor: pointer; }
.task-group { margin-bottom: 22px; }

/* ---------- Documents ---------- */
.doc-editor { max-width: 900px; }
.sec-edit { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.sec-edit-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.input-title { font-family: var(--font-head); font-weight: 700; font-size: 16px; border-color: transparent; padding: 6px 8px; }
.input-title:hover { border-color: var(--border-strong); }
.doc-num { font-family: var(--font-head); font-weight: 800; color: var(--amber); font-size: 14px; margin-right: 6px; }
.kpi-edit { display: grid; grid-template-columns: 2fr 1fr 1fr 2fr auto; gap: 8px; margin-bottom: 8px; }

.doc-read { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 48px 56px; max-width: 900px; margin: 0 auto; font-size: 15.5px; line-height: 1.7; }
.doc-cover { border-bottom: 3px solid var(--blue); padding-bottom: 24px; margin-bottom: 28px; }
.doc-logo { width: 190px; margin-bottom: 28px; }
.doc-cover h1 { font-size: 30px; margin: 4px 0 8px; }
.doc-read h2 { font-size: 19px; color: var(--blue); margin-bottom: 10px; display: flex; align-items: baseline; }
.doc-read section { margin-bottom: 28px; break-inside: auto; }
.doc-read p + p, .doc-read ul { margin-top: 10px; }
.doc-read ul { padding-left: 22px; }
.doc-summary { background: var(--blue-lighter); border-left: 4px solid var(--amber); padding: 18px 22px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.kpi { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 2px; break-inside: avoid; }
.kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-family: var(--font-head); font-weight: 700; }
.kpi-value { font-family: var(--font-head); font-size: 24px; font-weight: 800; color: var(--blue); }
.kpi-target { font-size: 13px; color: var(--green); font-weight: 600; }
.kpi-note { font-size: 13px; color: var(--gray); }
.doc-foot { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- Quotes ---------- */
.quote-editor { max-width: 960px; }
.items-head, .item-row { display: grid; grid-template-columns: 1fr 90px 140px 120px 34px; gap: 8px; align-items: center; }
.items-head { font-family: var(--font-head); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 0 0 6px; }
.item-row { margin-bottom: 8px; }
.item-amount { font-weight: 600; }
.totals { margin: 16px 0 0 auto; min-width: 300px; border-collapse: collapse; font-size: 14px; }
.totals td { padding: 6px 0; }
.totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; padding-left: 24px; }
.totals-grand td { border-top: 2px solid var(--blue); font-family: var(--font-head); font-weight: 800; font-size: 18px; color: var(--blue); padding-top: 10px; }
.quote-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 3px solid var(--blue); padding-bottom: 20px; margin-bottom: 24px; }
.quote-head .doc-logo { margin: 0; }
.quote-id { text-align: right; }
.quote-id h1 { font-size: 24px; justify-content: flex-end; }
.quote-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.quote-parties p { font-size: 14px; }
.quote-items { margin-top: 20px; border: 1px solid var(--border); }
.quote-items th { background: var(--blue-lighter); }
.terms { margin-top: 28px; font-size: 13.5px; color: var(--gray); }
.terms h2 { font-size: 14px !important; }
.stamp { display: inline-block; margin-top: 18px; padding: 8px 16px; border: 2px solid; border-radius: var(--radius-sm); font-family: var(--font-head); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.stamp-ok { color: var(--green); }
.stamp-ko { color: var(--red); }

/* ---------- Modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(1, 26, 54, .45); display: grid; place-items: center; padding: 16px; z-index: 100; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: min(480px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-wide { width: min(680px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 8px; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 10px 22px; overflow-y: auto; }
.modal-body > p { margin-bottom: 14px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-foot .form-error { flex: 1; }
.foot-left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--blue-dark); color: #fff; padding: 12px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); font-size: 14px; font-weight: 600; border-left: 4px solid var(--amber); transition: opacity .3s, transform .3s; max-width: 360px; }
.toast-danger { background: var(--red); border-left-color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

.print-area[hidden] { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cols { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 90; transform: translateX(-100%); transition: transform .2s ease; }
  .nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(1, 26, 54, .4); z-index: 80; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
  .topbar-logo { height: 28px; width: auto; }
  .view { padding: 20px 16px 48px; }
  .sticky-head { top: 55px; }
  h1 { font-size: 22px; }
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-logo-mobile { display: block; }
  .board { grid-template-columns: repeat(4, 260px); }
  .doc-read { padding: 28px 20px; }
  .kpi-edit { grid-template-columns: 1fr 1fr; }
  .kpi-edit .icon-btn { justify-self: end; }
  .items-head { display: none; }
  .item-row { grid-template-columns: 1fr 1fr; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
  .item-row > input:first-child { grid-column: 1 / -1; }
  .quote-parties { grid-template-columns: 1fr; }
  .toolbar .input, .toolbar input[type=search] { flex: 1 1 100%; max-width: none; }
  .list-row { flex-wrap: wrap; }
  .table { font-size: 13px; }
}
@media (max-width: 520px) {
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .totals { min-width: 0; width: 100%; }
  .quote-head { flex-direction: column; }
  .quote-id { text-align: left; }
  .quote-id h1 { justify-content: flex-start; }
}

/* ---------- Stampa / PDF ---------- */
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { background: #fff; font-size: 11pt; }
  .sidebar, .topbar, .no-print, #toasts, .sidebar-scrim, .back { display: none !important; }
  .view { padding: 0; max-width: none; }
  .print-area, .print-area[hidden] { display: block !important; }
  .doc-read { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .doc-read h2 { break-after: avoid; }
  .kpi, .quote-items tr, .totals { break-inside: avoid; }
  a { color: inherit; }
}

/* =====================================================================
   MODULO MARKETING
   ===================================================================== */
:root {
  --series: #1d5fb0;
  --series-cmp: #9aa3b2;
  --ok: #1f7a45; --ok-bg: #e7f5ec;
  --warn: #9a6512; --warn-bg: #fff4dd;
  --bad: #c03434; --bad-bg: #fdeeee;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-warn { color: var(--warn); }
.h1-like { font-size: 24px; font-weight: 800; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.plain { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.link-btn { border: 0; background: none; color: var(--blue); font-weight: 600; cursor: pointer; padding: 0; }
.table-compact th, .table-compact td { padding: 8px 10px; }
.table-wrap.flat { box-shadow: none; }
.small-loading { min-height: 60px; }
.small-loading span { width: 22px; height: 22px; }
.disabled { opacity: .55; }

/* Panoramica */
.steps-mini { display: inline-flex; gap: 5px; }
.step-dot { width: 12px; height: 12px; border-radius: 50%; background: #e3e7ee; display: inline-block; }
.step-dot.done { background: var(--blue); }
.ai-pill { font-family: var(--font-head); font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 20px; background: var(--blue-light); color: var(--blue); }
.ai-pill.ai-off { background: #eef0f3; color: var(--gray); }

/* Stepper */
.stepper { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 22px; }
.step { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none !important; min-width: 0; }
.step:hover { border-color: var(--blue); }
.step-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #eef0f3; color: var(--gray); font-family: var(--font-head); font-weight: 800; font-size: 12px; }
.step.done .step-num { background: var(--ok-bg); color: var(--ok); }
.step.active { border-color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); }
.step.active .step-num { background: var(--blue); color: #fff; }
.step-text { display: flex; flex-direction: column; min-width: 0; }
.step-text strong { font-family: var(--font-head); font-size: 14px; }
.step-text small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Fonti */
.source-card { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.source-card.inactive { opacity: .6; }
.source-head { display: flex; justify-content: space-between; align-items: center; }
.platform-tag { display: inline-block; font-family: var(--font-head); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--gray); background: #eef0f3; padding: 2px 8px; border-radius: 4px; vertical-align: middle; }
.source-actions { display: flex; gap: 2px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.platform-group { display: grid; grid-template-columns: 110px 1fr; gap: 12px; margin-bottom: 12px; align-items: start; }
.platform-group-label { font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--gray); padding-top: 10px; }
.platform-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.platform-tile { text-align: left; border: 1.5px dashed var(--border-strong); background: var(--surface); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.platform-tile:hover { border-color: var(--blue); border-style: solid; background: var(--blue-lighter); }
.platform-tile small { color: var(--muted); font-size: 12px; }
.cm-row { display: grid; grid-template-columns: 2fr 1fr 1.2fr 1.2fr auto; gap: 6px; margin-bottom: 6px; }

/* Dati */
.cov-table { font-size: 13px; }
.cov-table th.cov-month { text-align: center; padding: 8px 2px; font-size: 11px; }
.cov-table th.cov-month small { display: block; font-weight: 400; color: var(--muted); }
.cov-table td { padding: 6px 10px; }
.cov-table td.cov { padding: 0; border: 2px solid var(--surface); height: 26px; min-width: 30px; }
.cov-0 { background: #f1f3f6; }
.cov-1 { background: #c9daf0; }
.cov-2 { background: #7fa6dc; }
.cov-3 { background: var(--series); }
.cov-legend { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cov-legend .cov { width: 14px; height: 14px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.cov-source { cursor: pointer; }
.cov-source:hover td:first-child { color: var(--blue); }
.cov-metric td:first-child { padding-left: 26px; color: var(--gray); }
.data-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 18px; }
.mono-input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.imp-summary { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 14px; background: var(--blue-lighter); border-radius: var(--radius-sm); margin: 16px 0; font-size: 14px; }
.imp-grid h3 { margin: 4px 0 8px; font-size: 14px; }
.imp-grid .table-wrap { max-height: 280px; overflow: auto; }
.manual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 14px; }

/* Filtri */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 6px; }
.filters .field { margin-bottom: 0; min-width: 170px; }

/* Analisi */
.analysis-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; margin-top: 14px; }
.snap-live.refreshing { opacity: .5; transition: opacity .2s; }
.mk-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; margin-bottom: 16px; }
.mk-block-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.mk-block-title { font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mk-block-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.kpi-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi-tile { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px 6px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-tile-label { font-size: 12.5px; color: var(--gray); }
.kpi-tile-value { font-family: var(--font-head); font-weight: 700; font-size: 22px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-tile-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 20px; }
.spark { width: 100%; height: 28px; display: block; margin-top: 2px; }
.warn-dot { font-size: 11px; color: var(--warn); background: var(--warn-bg); border-radius: 10px; padding: 1px 7px; }
.delta { font-family: var(--font-head); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.delta-positivo { color: var(--ok); }
.delta-negativo { color: var(--bad); }
.delta-neutro, .delta-stabile, .delta-na { color: var(--gray); }
.all-metrics { margin-top: 10px; }
.all-metrics summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--blue); padding: 4px 0; }
.all-metrics table { margin-top: 8px; }

/* Grafici */
.chart { margin: 0; }
.chart-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; }
.chart-title { font-weight: 600; color: var(--gray); }
.chart-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--gray); }
.chart-head .link-btn { margin-left: auto; font-size: 12.5px; }
.key { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--series); vertical-align: middle; margin-left: 6px; }
.key-cmp { border-top: 2px dashed var(--series-cmp); }
.chart-plot { position: relative; padding-left: 52px; height: 220px; outline: none; }
.doc-chart .chart-plot { height: 180px; }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: calc(100% - 0px); overflow: visible; }
.chart-plot svg .grid { stroke: #edf0f4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-plot svg .crosshair { stroke: #b8c0cc; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-plot:focus-visible { box-shadow: 0 0 0 2px var(--blue); border-radius: 4px; }
.chart-yaxis span { position: absolute; left: 0; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-xaxis span { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart-dot, .chart-hover-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--series); box-shadow: 0 0 0 2px var(--surface); transform: translate(-50%, -50%); pointer-events: none; }
.chart-dot.hollow { background: var(--surface); box-shadow: inset 0 0 0 2px var(--series), 0 0 0 2px var(--surface); }
.chart-endlabel { position: absolute; transform: translate(-100%, -150%); font-size: 12px; font-weight: 700; color: var(--text); background: rgba(255,255,255,.85); padding: 0 3px; border-radius: 3px; pointer-events: none; white-space: nowrap; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12.5px; pointer-events: none; z-index: 5; min-width: 150px; }
.tip-head { color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row .key { margin-left: 0; }
.tip-row span:last-child { color: var(--gray); }
.chart-table { margin-top: 10px; max-height: 260px; overflow: auto; }
.chart-empty { padding: 30px 0; text-align: center; }

/* Insight */
.insights-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.insights-panel h3 { font-size: 15px; }
.insights { list-style: none; margin: 8px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.insight { display: flex; gap: 6px; align-items: flex-start; border-left: 3px solid #d5dbe4; padding: 6px 0 6px 10px; }
.insight-negativo, .insight-criticita { border-left-color: var(--bad); }
.insight-positivo, .insight-opportunita { border-left-color: var(--ok); }
.insight-avviso { border-left-color: var(--amber); }
.insight-check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; flex: 1; }
.insight-check input { margin-top: 3px; accent-color: var(--blue); flex: none; }
.insight-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.45; }
.insight-text strong { font-size: 13.5px; }
.insight-text span:not(.origin) { color: var(--gray); }
.origin { font-family: var(--font-head); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.origin-ai { color: #6b4fbb; }
.effect-negativo { color: var(--bad); }
.effect-positivo { color: var(--ok); }
.effect-avviso { color: var(--warn); }
.ai-box { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }
.ai-summary { background: #f5f2fc; border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 8px; }
.ai-questions { font-size: 13px; background: var(--blue-lighter); padding: 8px 10px; border-radius: var(--radius-sm); }
.ai-questions ul { margin: 4px 0 0; padding-left: 18px; }
.ai-card { border-color: #d9d0f3; background: #fcfbff; }
.ai-card .eyebrow { color: #6b4fbb; }
.ai-text { margin: 4px 0 12px 26px; font-size: 14px; color: var(--gray); }
.save-box { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }

/* Stati e avanzamento */
.status { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-head); font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.status-raggiunto, .status-in_linea { background: var(--ok-bg); color: var(--ok); }
.status-attenzione { background: var(--warn-bg); color: var(--warn); }
.status-critico { background: var(--bad-bg); color: var(--bad); }
.status-senza_dati { background: #eef0f3; color: var(--gray); }
.meter { position: relative; display: inline-block; width: 110px; height: 8px; border-radius: 4px; background: #e8edf4; vertical-align: middle; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--series); }
.meter-raggiunto .meter-fill, .meter-in_linea .meter-fill { background: var(--ok); }
.meter-attenzione .meter-fill { background: var(--amber); }
.meter-critico .meter-fill { background: var(--bad); }
.meter-target { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); border-radius: 1px; }
.stat-status .stat-value { font-size: 22px; }
.status-bg-raggiunto .stat-value, .status-bg-in_linea .stat-value { color: var(--ok); }
.status-bg-attenzione .stat-value { color: var(--warn); }
.status-bg-critico .stat-value { color: var(--bad); }
.budget-row { margin-top: 12px; }
.budget-row h3 { font-size: 14px; margin-bottom: 4px; }

/* Piano */
.plan-card { display: flex; flex-direction: column; gap: 6px; margin: 0; color: var(--text); text-decoration: none !important; }
.plan-card:hover { border-color: var(--blue); }
.period-edit { max-width: 420px; }
.input-unit { display: inline-flex; align-items: center; gap: 4px; }
.input-unit .input { width: 110px; }
.targets-table select { min-width: 220px; }
.actions-table .input { min-width: 90px; }
.actions-table td:nth-child(2) .input { min-width: 200px; }
.choice { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.commentary textarea { resize: vertical; }

/* Blocchi nei documenti */
.doc-block { margin-bottom: 28px; break-inside: auto; }
.doc-table { font-size: 13.5px; }
.doc-table-wrap { border-radius: var(--radius-sm); }
.doc-table .group-row td { background: var(--blue-lighter); font-family: var(--font-head); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--blue); }
.doc-table .total-row td { border-top: 2px solid var(--blue); }
.doc-insights { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.doc-insights li { display: flex; flex-direction: column; gap: 2px; border-left: 3px solid #d5dbe4; padding-left: 12px; font-size: 14.5px; }
.doc-insights li.insight-negativo, .doc-insights li.insight-criticita { border-left-color: var(--bad); }
.doc-insights li.insight-positivo, .doc-insights li.insight-opportunita { border-left-color: var(--ok); }
.doc-insights li span:last-child { color: var(--gray); }
.doc-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; }
.doc-chart { break-inside: avoid; }
.blocks-card { border-left: 4px solid var(--series); }

@media (max-width: 1100px) {
  .analysis-layout { grid-template-columns: 1fr; }
  .insights-panel { position: static; max-height: none; }
  .stepper { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 860px) {
  .stepper { grid-template-columns: repeat(8, auto); overflow-x: auto; }
  .step-text small { display: none; }
  .platform-group { grid-template-columns: 1fr; gap: 4px; }
  .cm-row { grid-template-columns: 1fr 1fr; }
  .doc-charts { grid-template-columns: 1fr; }
  .chart-plot { height: 180px; }
}
@media print {
  .chart-head .link-btn, .chart-tip, .chart-hover-dot, .all-metrics summary { display: none !important; }
  .doc-charts { grid-template-columns: 1fr 1fr; }
  .doc-table, .kpi-tile { break-inside: avoid; }
  .table-wrap { overflow: visible !important; box-shadow: none; }
}

/* =====================================================================
   GANTT, TIMELINE, FATTURE, DASHBOARD CLIENTE
   ===================================================================== */
.view-switch { margin-left: auto; }
.card-title-sm { font-size: 15px; margin-bottom: 12px; }
.gantt-card { padding: 14px 14px 10px; }
.gantt-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.g-legend { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.g-key { display: inline-block; width: 14px; height: 8px; border-radius: 3px; margin-left: 6px; }
.g-key-ms { display: inline-block; width: 9px; height: 9px; transform: rotate(45deg); background: var(--text); margin-left: 8px; margin-right: 2px; }
.gantt { position: relative; overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.g-row { display: flex; min-width: max-content; }
.g-label { position: sticky; left: 0; z-index: 3; width: var(--label-w); flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 13px; min-height: 40px; }
.g-label-text { min-width: 0; display: flex; flex-direction: column; }
.g-label-text a { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-label-text a:hover { color: var(--blue); }
.g-label-text small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-row-group .g-label { background: var(--blue-lighter); }
.g-row-group .g-label-text a { font-family: var(--font-head); font-weight: 700; }
.g-toggle { border: 0; background: none; cursor: pointer; color: var(--gray); padding: 0 2px; font-size: 12px; width: 16px; }
.g-head { position: sticky; top: 0; z-index: 5; }
.g-head .g-label { z-index: 6; background: var(--surface); font-family: var(--font-head); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); border-bottom: 1px solid var(--border); min-height: 48px; }
.g-head .g-track { background: var(--surface); border-bottom: 1px solid var(--border); height: 48px; }
.g-months, .g-ticks { position: relative; height: 24px; }
.g-months span, .g-ticks span { position: absolute; top: 0; height: 24px; line-height: 24px; font-size: 11px; color: var(--gray); padding-left: 4px; border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.g-months span { font-family: var(--font-head); font-weight: 700; color: var(--text); text-transform: capitalize; overflow: visible; }
.g-months span b { position: sticky; left: calc(var(--label-w) + 6px); font-weight: 700; }
.g-ticks span.we { background: #f4f6f9; }
.g-rows { position: relative; }
.g-bg { position: absolute; top: 0; bottom: 0; left: var(--label-w); pointer-events: none; z-index: 0; }
.g-weekend { position: absolute; top: 0; bottom: 0; background: #f6f8fb; }
.g-vline { position: absolute; top: 0; bottom: 0; border-left: 1px solid #eef1f5; }
.g-today { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--amber); z-index: 2; }
.g-today span { position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 700; color: var(--amber-dark); background: var(--amber-light); padding: 0 4px; border-radius: 3px; }
.g-track { position: relative; flex: none; z-index: 1; }
.g-rows .g-row { border-bottom: 1px solid #f0f2f5; }
.g-rows .g-row:hover .g-label { background: var(--blue-lighter); }
.g-bar { position: absolute; top: 9px; height: 22px; border-radius: 5px; background: #9aa3b2; color: #fff; font-size: 11.5px; font-weight: 600; display: flex; align-items: center; overflow: hidden; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.08); user-select: none; touch-action: none; }
.g-bar:focus-visible, .g-milestone:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.g-bar.g-dragging { cursor: grabbing; opacity: .85; box-shadow: var(--shadow-md); z-index: 4; }
.g-bar-label { position: relative; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
.g-outside-label, .g-milestone-label { position: absolute; top: 12px; font-size: 11.5px; color: var(--gray); white-space: nowrap; pointer-events: none; }
.g-status-da_fare { background: #8e98a8; }
.g-status-in_corso { background: var(--series); }
.g-status-revisione { background: #c98a12; }
.g-status-fatto { background: var(--ok); }
.g-group.g-bar { background: #c8d6ea; color: var(--blue-dark); height: 16px; top: 12px; border-radius: 4px; }
.g-group .g-progress { position: absolute; left: 0; top: 0; bottom: 0; background: var(--blue); border-radius: 4px 0 0 4px; }
.g-group .g-bar-label { color: #fff; mix-blend-mode: normal; text-shadow: 0 0 2px rgba(1,42,86,.6); }
.g-dueonly { opacity: .75; background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(255,255,255,.25) 5px 10px); }
.g-overdue { box-shadow: 0 0 0 2px var(--bad); }
.g-handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 2; }
.g-handle-l { left: 0; }
.g-handle-r { right: 0; }
.g-bar:hover .g-handle { background: rgba(255,255,255,.35); }
.g-milestone { position: absolute; top: 13px; width: 14px; height: 14px; transform: translateX(-50%) rotate(45deg); border-radius: 2px; cursor: grab; box-shadow: 0 0 0 2px var(--surface); touch-action: none; }
.g-hint { position: absolute; left: 8px; top: 12px; font-size: 11.5px; color: var(--muted); font-style: italic; white-space: nowrap; }
.g-drag-tip { position: fixed; z-index: 300; background: var(--blue-dark); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 4px; pointer-events: none; }
.g-row-task[data-row] .g-track { cursor: default; }

.stat-attention .stat-value { color: var(--amber-dark); }
.doc-group-title { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--gray); margin: 12px 0 4px; display: flex; gap: 6px; align-items: center; }
.doc-group-title:first-of-type { margin-top: 0; }
.file-btn { cursor: pointer; }
.totals-net td { font-family: var(--font-head); font-weight: 800; color: var(--text); border-top: 1px solid var(--border); padding-top: 8px; }
.list-row a.list-main { color: var(--text); text-decoration: none; }
.list-row a.list-main:hover strong { color: var(--blue); }

@media (max-width: 860px) {
  .gantt { --label-w: 170px !important; }
  .g-label { width: 170px; }
  .g-legend { margin-left: 0; }
}
@media print {
  .gantt-toolbar { display: none; }
  .gantt { max-height: none; overflow: visible; }
}

/* Registrazione fatture */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; cursor: pointer; text-align: center; background: var(--blue-lighter); }
.dropzone:hover, .dropzone.over { border-color: var(--blue); background: var(--blue-light); }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }
.dropzone-text { display: inline-flex; align-items: center; gap: 8px; color: var(--blue); }
.invoice-card { max-width: 640px; }
.invoice-amount { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.invoice-amount strong { font-family: var(--font-head); font-size: 30px; font-weight: 800; color: var(--text); }
.invoice-card .actions { margin-top: 14px; }
.notes-plain { margin-top: 12px; font-size: 14px; color: var(--gray); }
.menu-file { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.menu-file:hover { background: var(--blue-lighter); }

/* Pagamento con bonifico */
.pay-box { border-left: 4px solid var(--ok); }
.pay-amount { font-family: var(--font-head); font-size: 22px; font-weight: 800; }
.pay-list { margin: 0; }
.pay-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.pay-row:last-child { border-bottom: 0; }
.pay-row dt { color: var(--muted); font-size: 13px; }
.pay-row dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.pay-value { font-weight: 600; overflow-wrap: anywhere; }
.pay-row:nth-child(2) .pay-value { font-family: ui-monospace, Menlo, monospace; font-size: 14.5px; letter-spacing: .3px; }
.pay-copy { padding: 3px 8px; font-size: 12px; }
.pay-notes { margin-top: 10px; }
.invoice-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.invoice-layout .invoice-card { max-width: none; }
.text-ok { color: var(--ok); }
.settings-cols { align-items: start; }
@media (max-width: 1100px) { .invoice-layout { grid-template-columns: 1fr; } }
@media print { .pay-copy { display: none; } }

/* Barra superiore sempre visibile con campanella */
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 36px; background: var(--bg); position: sticky; top: 0; z-index: 40; justify-content: flex-end; }
.topbar #menu-toggle, .topbar .topbar-logo { display: none; }
.topbar-right { position: relative; margin-left: auto; }
.bell { position: relative; width: 40px; height: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: 50%; }
.bell .icon { width: 20px; height: 20px; }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--bad); color: #fff; font-family: var(--font-head); font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 60; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.notif-list { list-style: none; margin: 0; padding: 4px; }
.notif { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: var(--radius-sm); cursor: pointer; }
.notif:hover { background: var(--blue-lighter); }
.notif.unread { background: #f3f7fd; }
.notif-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-light); color: var(--blue); display: grid; place-items: center; flex: none; }
.notif.urgent .notif-icon { background: var(--bad-bg); color: var(--bad); }
.notif-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.notif-text strong { font-size: 13.5px; }
.notif.unread .notif-text strong::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); margin-right: 6px; vertical-align: 1px; }
.notif-text span { color: var(--gray); }
.notif-text time { color: var(--muted); font-size: 11.5px; }
.notif-empty { padding: 20px 14px; text-align: center; }
@media (max-width: 860px) {
  .topbar { padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); justify-content: flex-start; }
  .topbar #menu-toggle, .topbar .topbar-logo { display: inline-grid; }
  .topbar .topbar-logo { display: block; }
}
.sticky-head { top: 60px; }
@media (max-width: 860px) { .sticky-head { top: 61px; } }

/* Stato di pagamento delle fatture */
.pay-state { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-head); font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.pay-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pay-state-overdue { background: var(--bad-bg); color: var(--bad); }
.pay-state-due { background: var(--warn-bg); color: var(--warn); }
.pay-state-open { background: var(--blue-light); color: var(--blue); }
.pay-state-paid { background: var(--ok-bg); color: var(--ok); }
.pay-state-void { background: #eef0f3; color: var(--gray); }
tr.inv-overdue td { background: #fff6f6; }
tr.inv-overdue td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
tr.inv-due td { background: #fffaf0; }
tr.inv-due td:first-child { box-shadow: inset 4px 0 0 var(--amber); }
tr.inv-paid td { color: var(--gray); }
.uncovered { border-left: 4px solid var(--bad); }
.uncovered.only-due { border-left-color: var(--amber); }
.uncovered-list li .list-meta { gap: 10px; }
.callout-danger { background: var(--bad-bg); border-color: #f2c9c9; }
.callout-danger > .icon { color: var(--bad); }
.list li.li-overdue { box-shadow: inset 4px 0 0 var(--bad); background: #fff6f6; }
.list li.li-due { box-shadow: inset 4px 0 0 var(--amber); background: #fffaf0; }

/* Firma elettronica */
.sig-tabs { margin-bottom: 10px; }
.sig-canvas { width: 100%; height: 150px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); background: #fff; touch-action: none; cursor: crosshair; display: block; }
.sig-foot { display: flex; justify-content: space-between; margin-top: 4px; }
.sig-typed-preview { display: block; font-family: 'Brush Script MT', 'Segoe Script', 'Snell Roundhand', cursive; font-size: 34px; color: #0b2a57; min-height: 50px; padding: 8px 4px; border-bottom: 1px solid var(--border-strong); margin-top: 8px; }
.sign-steps { display: flex; flex-direction: column; gap: 14px; }
.sign-legal { font-size: 13px; background: var(--blue-lighter); padding: 10px 12px; border-radius: var(--radius-sm); }
.otp-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.otp-row .input { width: 160px; letter-spacing: 4px; font-family: ui-monospace, Menlo, monospace; font-size: 18px; text-align: center; }
.certificate { border-left: 4px solid var(--ok); }
.certificate h2 { display: flex; align-items: center; gap: 8px; }
.cert-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cert-signature { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; text-align: center; background: #fff; }
.cert-signature img { max-width: 100%; margin: 0 auto; }
.hash { font-size: 12px; overflow-wrap: anywhere; }
.sign-link-box { display: flex; gap: 8px; align-items: center; }
.sign-link-box .input { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.public-sign { max-width: 900px; margin: 0 auto; padding: 24px 16px 60px; }
.public-sign-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.public-sign-head img { width: 180px; }
@media (max-width: 760px) { .cert-grid { grid-template-columns: 1fr; } }
@media print { body.print-cert .view > *:not(#certificate) { display: none !important; } body.print-cert #certificate { border: 0; box-shadow: none; } }

/* Richieste e videochiamate */
.req-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.req-type input { position: absolute; opacity: 0; }
.req-type span { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1.5px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; height: 100%; }
.req-type span .icon { color: var(--blue); }
.req-type small { color: var(--muted); font-size: 12px; }
.req-type input:checked + span { border-color: var(--blue); background: var(--blue-lighter); box-shadow: inset 0 0 0 1px var(--blue); }
.req-type input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.slot-days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.slot-days button { flex: none; display: flex; flex-direction: column; align-items: center; width: 58px; padding: 6px 0; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-size: 11px; color: var(--gray); text-transform: capitalize; }
.slot-days button strong { font-family: var(--font-head); font-size: 18px; color: var(--text); }
.slot-days button[aria-selected=true] { border-color: var(--blue); background: var(--blue); color: #fff; }
.slot-days button[aria-selected=true] strong { color: #fff; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; margin-bottom: 8px; }
.slot { padding: 8px 0; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-family: var(--font-head); font-weight: 600; font-size: 13px; }
.slot:hover { border-color: var(--blue); }
.slot.chosen { background: var(--ok); border-color: var(--ok); color: #fff; }
.req-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-light); color: var(--blue); display: grid; place-items: center; flex: none; }
li.req-unread .list-main strong { color: var(--blue-dark); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-right: 6px; vertical-align: 1px; }
.meet-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--ok); }
.meet-card.past { border-left-color: var(--border-strong); opacity: .8; }
.meet-when { display: flex; gap: 12px; align-items: center; }
.meet-when > .icon { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); box-sizing: content-box; }
.meet-when div { display: flex; flex-direction: column; }
.meet-when strong { font-family: var(--font-head); font-size: 18px; text-transform: capitalize; }
.proposed { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.proposed-slot { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); text-transform: capitalize; }
.messages { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 12px; background: #f1f4f8; }
.msg.staff { background: var(--blue-lighter); border: 1px solid var(--blue-light); }
.msg.mine { align-self: flex-end; }
.msg-meta { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg-body p { margin: 0; font-size: 14.5px; }
.msg-body p + p { margin-top: 6px; }
.msg-system { align-self: center; font-size: 12px; color: var(--gray); background: #f6f8fb; padding: 4px 12px; border-radius: 20px; text-align: center; }
.reply { display: flex; gap: 10px; align-items: flex-end; }
.reply .input { flex: 1; }
.agenda-row { align-items: flex-start; }
.agenda-time { width: 110px; flex: none; font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--blue); padding-top: 2px; }
.agenda-day { margin-bottom: 18px; }
.agenda-day .group-title { text-transform: capitalize; }
.google-card { margin-top: 18px; }
.google-card h2 { display: flex; align-items: center; gap: 8px; }
.google-card h3 { margin: 18px 0 10px; font-size: 15px; }
.day-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pick input { position: absolute; opacity: 0; }
.day-pick span { display: inline-block; padding: 6px 12px; border: 1.5px solid var(--border-strong); border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 600; }
.day-pick input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.day-pick input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.window-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; max-width: 320px; }
@media (max-width: 640px) { .req-types { grid-template-columns: 1fr; } .msg { max-width: 95%; } .agenda-time { width: 80px; } }
.req-type, .day-pick { position: relative; }
.contact-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--blue); }
.contact-card h2 { margin-bottom: 4px; }
.open-req { width: 100%; margin: 0; border-top: 1px solid var(--border); padding-top: 10px; }
/* La modale non si allarga oltre lo schermo per contenuti lunghi (es. fila dei giorni) */
.modal { min-width: 0; max-width: 100%; }
.modal-body { min-width: 0; overflow-x: hidden; }
.modal-body .field, .modal-body [data-slots] { min-width: 0; }

/* Area contenuti: live, articoli, formazione */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 26px; }
.content-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; margin: 0; color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.content-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.content-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--blue-light); }
.content-cover.placeholder { display: grid; place-items: center; color: var(--blue); }
.content-cover.placeholder .icon { width: 40px; height: 40px; opacity: .5; }
.content-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.content-card h3 { font-size: 16.5px; line-height: 1.3; }
.content-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.content-foot { margin-top: auto; color: var(--gray); }
.content-foot .icon { width: 14px; height: 14px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { border: 1.5px solid var(--border-strong); background: var(--surface); border-radius: 20px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip[aria-pressed=true] { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip[aria-pressed=true] .muted { color: rgba(255,255,255,.75); }
.content-article { max-width: 780px; margin: 0 auto; }
.content-article header { margin-bottom: 18px; }
.content-article h1 { font-size: 32px; margin: 4px 0 6px; }
.content-article .cover { width: 100%; border-radius: var(--radius); margin: 8px 0 20px; }
.lead { font-size: 18px; color: var(--gray); margin-bottom: 18px; line-height: 1.6; }
.rich { font-size: 16.5px; line-height: 1.75; }
.rich p, .rich ul, .rich ol, .rich blockquote { margin: 0 0 16px; }
.rich h2 { font-size: 22px; margin: 28px 0 10px; }
.rich h3 { font-size: 18px; margin: 22px 0 8px; }
.rich blockquote { border-left: 4px solid var(--amber); padding: 6px 16px; background: var(--amber-light); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text); }
.rich ul, .rich ol { padding-left: 24px; }
.video-embed { position: relative; aspect-ratio: 16 / 9; margin: 8px 0 22px; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.live-box { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--blue); }
.live-box.live-in_corso { border-left-color: var(--bad); }
.live-box.live-conclusa { border-left-color: var(--border-strong); }
.content-done { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; gap: 12px; align-items: center; }
.content-editor { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.content-side { position: sticky; top: 76px; }
.content-body { font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; line-height: 1.6; }
.cover-edit { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cover-preview { width: 200px; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: var(--blue-lighter); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.preview-box { max-height: 70vh; overflow-y: auto; font-size: 14.5px; }
.preview-box .cover { width: 100%; border-radius: var(--radius-sm); margin-bottom: 12px; }
@media (max-width: 1100px) { .content-editor { grid-template-columns: 1fr; } .content-side { position: static; } }
@media (max-width: 640px) { .content-article h1 { font-size: 25px; } .rich { font-size: 16px; } }

/* ================= Navigazione e barra superiore (revisione UX) ================= */
.sidebar { padding: 18px 12px 14px; }
.brand { padding: 2px 10px 18px; display: block; }
.brand img { width: 158px; height: auto; display: block; }
.sidebar-client { margin: 0 6px 12px; }
.nav { gap: 14px; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.nav-section { display: flex; flex-direction: column; gap: 1px; }
.nav-label { margin: 0 0 4px; padding: 0 12px; font-family: var(--font-head); font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255, 255, 255, .45); }
.nav a { padding: 8px 12px; gap: 11px; font-size: 13.5px; }
.nav a .icon { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav a > span:not(.nav-badge) { flex: 1; min-width: 0; }
.nav-badge { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: rgba(255, 255, 255, .16); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.nav-badge-danger { background: var(--red); }
.nav-badge[hidden] { display: none; }
.sidebar-user { margin-top: 10px; padding-top: 10px; }

.topbar { gap: 10px; padding: 12px 36px; }
.search-trigger {
  display: inline-flex; align-items: center; gap: 10px; width: min(420px, 100%); margin-right: auto; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.search-trigger:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.search-trigger .icon { width: 18px; height: 18px; color: var(--gray); }
.search-trigger span { flex: 1; }
.search-trigger kbd, .palette kbd { font-family: var(--font-head); font-size: 11px; font-weight: 700; color: var(--gray); background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: 0; }
.topbar .btn-sm { height: 40px; padding: 0 14px; border-radius: 999px; }
.topbar .btn-sm .icon { width: 17px; height: 17px; }
.menu-wrap { position: relative; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: var(--radius-sm); font: inherit; font-size: 14px; color: var(--text); cursor: pointer; text-align: left; }
.dropdown button .icon { width: 17px; height: 17px; color: var(--blue); }
.dropdown button:hover, .dropdown button:focus-visible { background: var(--blue-lighter); outline: none; }
.notif-panel { top: calc(100% + 8px); }

/* Ricerca globale */
.palette-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(1, 26, 54, .35); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette { width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.palette-input .icon { width: 20px; height: 20px; color: var(--gray); }
.palette-input input { flex: 1; border: 0; outline: none; font: inherit; font-size: 16px; color: var(--text); background: none; min-width: 0; }
.palette-input input::-webkit-search-cancel-button { display: none; }
.palette-results { overflow-y: auto; padding: 6px; }
.palette-group + .palette-group { margin-top: 6px; }
.palette-group-title { margin: 6px 10px 4px; font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none !important; }
.palette-item.active { background: var(--blue-light); }
.palette-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--blue-lighter); color: var(--blue); display: grid; place-items: center; flex: none; }
.palette-icon .icon { width: 16px; height: 16px; }
.palette-item.active .palette-icon { background: var(--surface); }
.palette-text { display: flex; flex-direction: column; min-width: 0; }
.palette-text strong { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-text small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-empty { padding: 22px; text-align: center; color: var(--muted); margin: 0; }

@media (max-width: 860px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .search-trigger { width: 40px; height: 40px; padding: 0; justify-content: center; margin-right: 0; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .hide-sm { display: none; }
  .topbar .btn-sm { width: 40px; padding: 0; justify-content: center; }
  .topbar-logo { margin-right: auto; }
}

/* ================= Dashboard (revisione UX) ================= */
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-alert .stat-hint { color: var(--red); font-weight: 600; }
.stat-warn .stat-hint { color: var(--amber-dark); font-weight: 600; }
.inbox-card { padding-bottom: 8px; }
.inbox { margin: 0 -20px; }
.inbox .list-row { padding: 11px 20px; }
.inbox-row:hover { background: var(--blue-lighter); }
.inbox-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: #eef0f3; color: var(--gray); }
.inbox-icon .icon { width: 17px; height: 17px; }
.inbox-icon.tone-danger { background: var(--red-light); color: var(--red); }
.inbox-icon.tone-warn { background: var(--amber-light); color: var(--amber-dark); }
.inbox-icon.tone-brand { background: var(--blue-light); color: var(--blue); }
.inbox-meta { font-size: 12.5px; font-weight: 600; color: var(--gray); }
.inbox-more { margin: 6px 0 4px; }
.all-clear { display: flex; gap: 14px; align-items: center; padding: 6px 0 10px; }
.all-clear > .icon { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--green-light); color: var(--green); flex: none; }
.date-chip { width: 44px; flex: none; text-align: center; border-radius: 8px; background: var(--blue-lighter); color: var(--blue); font-family: var(--font-head); font-size: 11px; font-weight: 700; text-transform: uppercase; line-height: 1.2; padding: 5px 0; }
.date-chip b { display: block; font-size: 17px; font-weight: 800; }
.activity-card summary { list-style: none; cursor: pointer; margin-bottom: 0; }
.activity-card summary::-webkit-details-marker { display: none; }
.activity-card summary h2::after { content: '▾'; margin-left: 8px; font-size: 13px; color: var(--muted); display: inline-block; transition: transform .15s; }
.activity-card:not([open]) summary h2::after { transform: rotate(-90deg); }
.activity-card[open] summary { margin-bottom: 12px; }
@media (max-width: 860px) { .inbox-row { flex-wrap: wrap; row-gap: 2px; } .inbox-meta { width: 100%; padding-left: 48px; } }
.summary-line { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; font-size: 14px; color: var(--gray); }
.summary-line > span[aria-hidden] { color: var(--border-strong); }
.source-actions { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; margin: auto -8px -6px; padding-top: 8px; border-top: 1px solid var(--border); }
.source-actions .btn-sm { padding: 6px 8px; }
.source-actions [data-delete] { margin-left: auto; }
.info dd a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= Framework: funnel ================= */
.funnel-card .card-head { align-items: flex-start; }
.funnel { display: flex; flex-direction: column; gap: 0; }
.funnel-row { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr) 90px; gap: 14px; align-items: center; }
.funnel-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.funnel-label strong { font-family: var(--font-head); font-size: 14px; }
.funnel-label small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.funnel-bar-wrap { display: flex; justify-content: center; }
.funnel-bar { height: 40px; border-radius: 6px; display: grid; place-items: center; min-width: 90px; font-family: var(--font-head); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
/* Scala sequenziale di un solo blu: le fasi sono ordinate, dalla più ampia alla più profonda */
.phase-bg-see { background: #86b6ef; color: #0d366b; }
.phase-bg-think { background: #5598e7; color: #0d2a52; }
.phase-bg-do { background: #256abf; color: #fff; }
.phase-bg-care { background: #104281; color: #fff; }
.phase { align-self: flex-start; font-family: var(--font-head); font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--blue); }
.funnel-delta { text-align: right; }
.funnel-row, .funnel-step { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr) 90px; gap: 14px; align-items: center; }
.funnel-step-mid { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 5px 0; font-size: 12.5px; color: var(--gray); flex-wrap: wrap; }
.funnel-step-rate { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.funnel-step-rate .icon { width: 13px; height: 13px; }
.funnel-step-cmp { color: var(--muted); }
.funnel-step-cmp.neg { color: var(--red); }
.funnel-step-cmp.pos { color: var(--green); }
.funnel-bottleneck .funnel-step-rate { color: var(--red); }
.funnel-flag { background: var(--red-light); color: var(--red); font-family: var(--font-head); font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.funnel-overall { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--gray); }
.fn-stage { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 10px; }
.fn-stage-head { display: flex; gap: 6px; align-items: center; }
.fn-stage-head .input:first-of-type { flex: 1; }
.fn-stage-head select { width: 170px; flex: none; }
.fn-terms { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 0 30px; }
.fn-term { display: flex; gap: 6px; align-items: center; }
@media (max-width: 700px) {
  .funnel-row { grid-template-columns: 1fr; gap: 6px; }
  .funnel-bar-wrap { justify-content: flex-start; }
  .funnel-delta { text-align: left; }
  .funnel-step { grid-template-columns: 1fr; gap: 0; }
  .funnel-step > span { display: none; }
  .funnel-step-mid { justify-content: flex-start; margin: 6px 0 8px 10px; padding: 2px 0 2px 10px; border-left: 2px dashed var(--border-strong); }
  .fn-stage-head { flex-wrap: wrap; }
  .fn-terms { margin-left: 0; }
}

/* ================= Framework nei documenti ================= */
.fw-wrap { margin-top: 6px; }
.fw-axis-top { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-left: 0; font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); text-align: center; margin-bottom: 6px; }
.fw-body { display: flex; gap: 8px; }
.fw-axis-side { display: grid; grid-auto-rows: 1fr; gap: 10px; width: 22px; flex: none; }
.fw-axis-side span { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.fw-wrap:has(.fw-axis-side) .fw-axis-top { margin-left: 30px; }
.fw-grid { flex: 1; display: grid; grid-template-columns: repeat(var(--fw-cols, 2), minmax(0, 1fr)); gap: 10px; }
.fw-cell { background: var(--blue-lighter); border: 1px solid var(--border); border-top: 3px solid var(--blue); border-radius: 8px; padding: 12px 14px; break-inside: avoid; }
.fw-cell h4 { margin: 0 0 6px; font-family: var(--font-head); font-size: 13px; color: var(--blue-dark); }
.fw-cell ul { margin: 0; padding-left: 18px; font-size: 14px; }
.fw-cell li + li { margin-top: 3px; }
.fw-cell p { margin: 0; font-size: 14px; }
.fw-ok { border-top-color: var(--green); background: #f3faf6; }
.fw-bad { border-top-color: var(--red); background: #fdf6f6; }
.fw-info { border-top-color: #1d5fb0; }
.fw-warn { border-top-color: var(--amber); background: #fffbf3; }
.fw-bmc { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); grid-template-areas:
  "partners partners activities activities value value relationships relationships segments segments"
  "partners partners resources resources value value channels channels segments segments"
  "costs costs costs costs costs revenues revenues revenues revenues revenues"; }
.fw-bmc [data-area=partners] { grid-area: partners; } .fw-bmc [data-area=activities] { grid-area: activities; }
.fw-bmc [data-area=resources] { grid-area: resources; } .fw-bmc [data-area=value] { grid-area: value; border-top-color: var(--amber); }
.fw-bmc [data-area=relationships] { grid-area: relationships; } .fw-bmc [data-area=channels] { grid-area: channels; }
.fw-bmc [data-area=segments] { grid-area: segments; } .fw-bmc [data-area=costs] { grid-area: costs; } .fw-bmc [data-area=revenues] { grid-area: revenues; }
.fw-table-wrap { overflow-x: auto; }
.fw-table { width: 100%; border-collapse: separate; border-spacing: 6px; table-layout: fixed; font-size: 13.5px; }
.fw-table th { font-family: var(--font-head); font-size: 12px; color: var(--blue-dark); text-align: left; padding: 8px 10px; background: var(--blue-light); border-radius: 6px; }
.fw-table tbody th { width: 150px; background: transparent; color: var(--gray); vertical-align: top; }
.fw-table td { background: var(--blue-lighter); border-radius: 6px; padding: 8px 10px; vertical-align: top; }
.fw-table td p { margin: 0; }
.fw-purpose { display: flex; gap: 8px; align-items: baseline; margin: 4px 0 10px; }
.fw-tag { flex: none; font-family: var(--font-head); font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; background: var(--blue-light); color: var(--blue); padding: 2px 7px; border-radius: 4px; }
.fw-edit { display: grid; grid-template-columns: repeat(var(--fw-cols, 2), minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.fw-edit-cell { display: flex; flex-direction: column; gap: 4px; }
.fw-edit-table { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fw-edit-table fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.fw-edit-table legend { font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--blue); padding: 0 4px; }
.add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fw-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fw-pick-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.fw-pick-item:has(input:checked) { border-color: var(--blue); background: var(--blue-lighter); }
.fw-pick-item input { margin-top: 3px; accent-color: var(--blue); }
.fw-pick-item small { display: block; color: var(--gray); font-size: 12.5px; margin-top: 2px; }
@media (max-width: 760px) {
  .fw-grid, .fw-edit, .fw-edit-table, .fw-pick, .add-row { grid-template-columns: 1fr; }
  .fw-axis-top, .fw-axis-side { display: none; }
  .fw-bmc { grid-template-columns: 1fr; grid-template-areas: none; }
  .fw-bmc [data-area] { grid-area: auto !important; }
}
@media print { .fw-cell, .fw-table td { background: #fff !important; } }

/* ================= Matrice di Eisenhower ================= */
.matrix-help { margin: -6px 0 12px; }
.eisenhower { display: grid; grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 6px 8px; }
.eh-axis { font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.eh-top { grid-column: 2; display: grid; grid-template-columns: 1fr 1fr; text-align: center; }
.eh-side { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: 1fr 1fr; }
.eh-side span { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; }
.eh-grid { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; }
.eh-q { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--border-strong); border-radius: var(--radius); padding: 14px; min-height: 220px; display: flex; flex-direction: column; transition: box-shadow .15s, background .15s; }
.eh-q header h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.eh-q header p { margin: 2px 0 10px; font-size: 12.5px; color: var(--gray); }
.q-do { border-top-color: var(--red); }
.q-plan { border-top-color: var(--blue); }
.q-delegate { border-top-color: var(--amber); }
.q-drop { border-top-color: #9aa3b2; background: #fafbfc; }
.eh-q.drop-over { box-shadow: 0 0 0 2px var(--blue) inset; background: var(--blue-lighter); }
.eh-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.eh-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; cursor: grab; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); }
.eh-card:hover { border-color: var(--blue); }
.eh-card.dragging { opacity: .5; }
.eh-card strong { font-size: 14px; font-weight: 600; }
.eh-card small { color: var(--muted); font-size: 12px; }
.eh-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-top: 4px; }
.eh-empty { color: var(--muted); font-size: 13px; padding: 10px 0; text-align: center; border: 1.5px dashed var(--border); border-radius: 8px; }
@media (max-width: 760px) {
  .eisenhower { grid-template-columns: 1fr; }
  .eh-axis { display: none; }
  .eh-grid { grid-column: 1; grid-template-columns: 1fr; grid-template-rows: none; }
}

/* ================= SMART, ICE e matrice impatto / sforzo ================= */
.smart { display: inline-flex; gap: 3px; }
.smart-chip { width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; font-family: var(--font-head); font-size: 11px; font-weight: 800; cursor: help; }
.smart-chip.ok { background: var(--green-light); color: var(--green); }
.smart-chip.ko { background: var(--amber-light); color: var(--amber-dark); box-shadow: inset 0 0 0 1px #f0cf92; }
.ice-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.ice-select { width: 62px; text-align: right; }
.ice-score { font-family: var(--font-head); font-size: 15px; color: var(--blue); }
.ie-matrix { margin: 0; }
.ie-matrix svg { width: 100%; height: auto; display: block; }
.ie-q { stroke: var(--surface); stroke-width: 2; }
.ie-win { fill: var(--green-light); }
.ie-major { fill: var(--blue-light); }
.ie-fill { fill: #f1f3f6; }
.ie-avoid { fill: var(--red-light); }
.ie-label { font-family: var(--font-head); font-size: 10.5px; font-weight: 700; fill: var(--gray); text-transform: uppercase; letter-spacing: .5px; }
.ie-axis { font-size: 11px; fill: var(--muted); }
.ie-pt circle { fill: var(--blue); stroke: var(--surface); stroke-width: 2; }
.ie-pt text { fill: #fff; font-family: var(--font-head); font-size: 11px; font-weight: 800; pointer-events: none; }
.ie-matrix figcaption { margin-top: 4px; }
@media (max-width: 1100px) { .ice-layout { grid-template-columns: 1fr; } .ie-matrix { max-width: 360px; } }

/* ================= Pagina Framework ================= */
.fw-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.fw-lib-card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fw-lib-card h3 { font-size: 16px; }
.fw-lib-card p { margin: 0; font-size: 14px; color: var(--gray); }
.fw-where { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-weight: 700; font-size: 13px; }
.fw-where .icon { width: 15px; height: 15px; }
.fw-example summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--blue); }
.fw-example[open] { grid-column: 1 / -1; }
.fw-example .fw-wrap { margin-top: 10px; }

/* ================= Solleciti, promemoria e approvazioni ================= */
.rem-card .card-head h2, .approval-card h2 { display: flex; align-items: center; gap: 8px; }
.rem-card .card-head h2 .icon { width: 18px; height: 18px; color: var(--blue); }
.rem-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rem-history li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.rem-text { display: flex; flex-direction: column; min-width: 0; }
.rem-text small { color: var(--muted); font-size: 12px; }
.rem-mode { flex: none; font-family: var(--font-head); font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 10px; margin-top: 1px; }
.rem-auto { background: var(--blue-light); color: var(--blue); }
.rem-manuale { background: #eef0f3; color: var(--gray); }
.rem-details { margin-top: 12px; }
.rem-details summary { cursor: pointer; color: var(--blue); font-weight: 600; margin-bottom: 8px; }
.callout-inline { display: block; padding: 10px 12px; }
.approval-card summary { list-style: none; cursor: pointer; margin-bottom: 0; }
.approval-card summary::-webkit-details-marker { display: none; }
.approval-card[open] summary { margin-bottom: 12px; }
.approval-staff { display: flex; flex-direction: column; gap: 10px; }
.approval-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.approval-note { margin: 0; padding: 8px 12px; border-left: 3px solid var(--amber); background: var(--amber-light); border-radius: 0 6px 6px 0; font-size: 14px; }
.approval-client { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-left: 4px solid var(--amber); }
.approval-client strong { display: flex; align-items: center; gap: 8px; }
.approval-done { display: flex; align-items: center; gap: 8px; color: var(--green); font-weight: 600; font-size: 14px; margin: 0 0 14px; }
.approval-done.warn { color: var(--amber-dark); }
.approval-done .icon { width: 18px; height: 18px; }
.rules { display: flex; flex-direction: column; gap: 14px; }
.rule { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.rule-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; color: var(--gray); padding-left: 26px; }
.rule-fields .input { width: 160px; }
.rule-fields .input.num { width: 70px; }
.client-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 200px; overflow-y: auto; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; }
.radio-row { display: flex; gap: 18px; margin-bottom: 10px; }

/* Grafico a barre */
.bar-chart { margin: 0; }
.bar-chart .chart-legend { display: flex; gap: 16px; font-size: 12.5px; margin-bottom: 6px; }
.bar-chart .chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.bar-chart svg { width: 100%; height: auto; display: block; }
.bar-chart .grid { stroke: #edf0f4; }
.bar-chart .baseline { stroke: #cad0db; }
.bar-chart .axis { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.bar-chart .bar:hover { opacity: .8; }

/* ================= Trattative ================= */
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.pipe-col { background: #eef2f7; border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; min-height: 260px; transition: box-shadow .15s; }
.pipe-col header { margin-bottom: 8px; }
.pipe-col header h2 { font-size: 14px; display: flex; align-items: center; gap: 6px; }
.pipe-body { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pipe-empty { color: var(--muted); font-size: 12.5px; text-align: center; border: 1.5px dashed var(--border-strong); border-radius: 8px; padding: 14px 0; margin: 0; }
.drop-over { box-shadow: 0 0 0 2px var(--blue) inset; }
.deal-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow-sm); cursor: grab; display: flex; flex-direction: column; gap: 3px; }
.deal-card:hover { border-color: var(--blue); }
.deal-card.dragging { opacity: .5; }
.deal-title { font-weight: 600; font-size: 14px; color: var(--text); padding-right: 26px; }
.deal-card > small { color: var(--muted); font-size: 12px; }
.deal-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; }
.deal-value { font-family: var(--font-head); font-weight: 700; color: var(--blue-dark); }
.chip-src { font-size: 11px; background: var(--blue-lighter); color: var(--gray); border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.deal-next { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--gray); margin-top: 4px; }
.deal-next .icon { width: 13px; height: 13px; }
.deal-next.late { color: var(--red); font-weight: 600; }
.avatar-xs { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; font-size: 9.5px; background: var(--blue-light); color: var(--blue); }
.pipe-outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 18px; }
.pipe-drop { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 14px; border-radius: var(--radius); border: 1.5px dashed var(--border-strong); font-family: var(--font-head); font-weight: 700; }
.pipe-drop .icon { width: 18px; height: 18px; }
.pipe-drop.won { color: var(--green); background: #f3faf6; }
.pipe-drop.lost { color: var(--red); background: #fdf6f6; }
.stage { display: inline-flex; font-family: var(--font-head); font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 20px; background: var(--blue-light); color: var(--blue); white-space: nowrap; vertical-align: middle; }
.stage-vinto { background: var(--green-light); color: var(--green); }
.stage-perso { background: var(--red-light); color: var(--red); }
.stage-nuovo { background: #eef0f3; color: var(--gray); }
.stage-bar { display: flex; margin: 0 0 18px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.stage-bar button { flex: 1; border: 0; background: none; padding: 9px 6px; font-family: var(--font-head); font-size: 12.5px; font-weight: 600; color: var(--gray); cursor: pointer; border-right: 1px solid var(--border); }
.stage-bar button:last-child { border-right: 0; }
.stage-bar button:hover { background: var(--blue-lighter); }
.stage-bar button.current { background: var(--blue); color: #fff; }
.stage-bar button.current.won { background: var(--green); }
.stage-bar button.current.lost { background: var(--red); }
.activity-form { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; align-items: start; margin-bottom: 14px; }
.deal-activities { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.deal-activities li { display: flex; gap: 10px; }
.deal-activities p { margin: 2px 0 0; font-size: 14px; white-space: pre-wrap; }
.act-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-lighter); color: var(--blue); display: grid; place-items: center; flex: none; }
.act-icon .icon { width: 14px; height: 14px; }
@media (max-width: 760px) { .activity-form { grid-template-columns: 1fr; } .stage-bar { flex-wrap: wrap; } .stage-bar button { flex: 1 1 33%; } }

/* ================= B.I. ================= */
.info-dot { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #eef0f3; color: var(--gray); font-size: 10px; font-weight: 700; cursor: help; vertical-align: 1px; }
.bi-table td { vertical-align: middle; }
.bar-cell { width: 45%; }
.bar-cell .small { margin-left: 6px; }
.hbar { display: inline-block; width: calc(100% - 90px); min-width: 60px; height: 10px; background: #eef2f7; border-radius: 5px; vertical-align: middle; overflow: hidden; }
.hbar span { display: block; height: 100%; background: #2a78d6; border-radius: 5px; }
.bi-table tr.best td { background: #f5fbf7; }
.stats-4 + .card { margin-top: 0; }

/* ================= Piano editoriale ================= */
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-nav strong { min-width: 150px; text-align: center; font-family: var(--font-head); text-transform: capitalize; }
.editorial-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: start; }
.editorial-layout.no-side { grid-template-columns: 1fr; }
.ed-ideas { display: flex; flex-direction: column; gap: 6px; }
.ed-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ed-wd { background: var(--surface); padding: 6px 8px; font-family: var(--font-head); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.ed-day { background: var(--surface); min-height: 108px; padding: 4px 5px 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ed-day.other { background: #fafbfc; }
.ed-day.other .ed-day-head span { color: var(--border-strong); }
.ed-day.today .ed-day-head span { background: var(--blue); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.ed-day-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; color: var(--gray); padding: 0 2px; }
.ed-add { border: 0; background: none; color: var(--muted); cursor: pointer; opacity: 0; padding: 0; width: 20px; height: 20px; border-radius: 4px; display: grid; place-items: center; }
.ed-add .icon { width: 14px; height: 14px; }
.ed-day:hover .ed-add, .ed-add:focus-visible { opacity: 1; }
.ed-add:hover { background: var(--blue-light); color: var(--blue); }
.ed-chip { display: flex; align-items: center; gap: 5px; background: var(--blue-lighter); border-radius: 5px; padding: 3px 6px; font-size: 12px; cursor: pointer; min-width: 0; color: var(--text); text-decoration: none !important; border-left: 3px solid var(--c, #868e96); }
.ed-chip:hover { background: var(--blue-light); }
.ed-chip.dragging { opacity: .5; }
.ed-chip.st-idea, .ed-chip.st-bozza { background: #f4f5f7; }
.ed-chip.st-pubblicato .ed-title { color: var(--gray); }
.ed-chip.st-pubblicato::after { content: '✓'; color: var(--green); font-weight: 700; margin-left: auto; }
.ed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #868e96); flex: none; }
.ed-time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.ed-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-client { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px; }
.ed-content { background: #fff8ec; border-left-color: var(--amber); }
.ed-content .ed-dot { background: var(--amber); }
.ed-legend-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--gray); }
.ed-legend { display: inline-flex; align-items: center; gap: 5px; }
/* Colori dei canali: palette categoriale validata, in ordine fisso; il nome del canale è sempre indicato */
.ch-instagram { --c: #2a78d6; } .ch-facebook { --c: #eb6834; } .ch-linkedin { --c: #1baf7a; } .ch-blog { --c: #eda100; }
.ch-newsletter { --c: #e87ba4; } .ch-live { --c: #008300; } .ch-youtube { --c: #4a3aa7; } .ch-tiktok { --c: #e34948; }
.ch-gbp, .ch-altro { --c: #868e96; }
.copy-box { background: var(--blue-lighter); border-radius: 8px; padding: 12px 14px; font-size: 14px; }
.drop-over.ed-day { background: var(--blue-lighter); }
@media (max-width: 1000px) { .editorial-layout { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .ed-cal { grid-template-columns: 1fr; } .ed-wd, .ed-day.other { display: none; } .ed-day { min-height: 0; } .ed-day:not(:has(.ed-chip)) { display: none; } }
.ed-cal .ed-chip { flex-wrap: wrap; row-gap: 1px; align-items: center; }
.ed-cal .ed-title { flex-basis: 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.ed-cal .ed-time { font-size: 11px; }
.ed-cal .ed-client { flex-basis: 100%; max-width: none; }
.ed-cal .ed-chip.st-pubblicato::after { order: 2; }
@media (max-width: 1350px) { .editorial-layout { grid-template-columns: 1fr; } .ed-ideas { flex-direction: row; flex-wrap: wrap; align-items: center; } .ed-ideas .ed-chip { max-width: 280px; } .ed-ideas h2 { flex-basis: 100%; } }

/* ================= Menu a gruppi (sottomenu) ================= */
.nav { gap: 4px; }
.nav-section { margin-bottom: 4px; }
.nav-group-head { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 12px; border: 0; background: none; border-radius: var(--radius-sm); color: rgba(255, 255, 255, .78); font-family: var(--font-head); font-weight: 600; font-size: 13.5px; cursor: pointer; text-align: left; }
.nav-group-head:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-group-head .icon { width: 18px; height: 18px; flex: none; }
.nav-group-head > span:nth-of-type(1) { flex: 1; }
.nav-caret { font-size: 11px; opacity: .6; transition: transform .15s; }
.nav-group:not(.open) .nav-caret { transform: rotate(-90deg); }
.nav-group.has-active > .nav-group-head { color: #fff; }
.nav-sub { display: none; flex-direction: column; gap: 1px; margin: 1px 0 6px 20px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .14); }
.nav-group.open .nav-sub { display: flex; }
.nav-sub a { padding: 7px 10px; font-size: 13px; }
.nav-sub a .icon { display: none; }
.nav-group.open .nav-badge-sum { display: none; }
.gear .icon { width: 20px; height: 20px; }
.dropdown-settings { min-width: 260px; }
.dropdown-label { margin: 8px 10px 4px; font-family: var(--font-head); font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.dropdown-label:first-child { margin-top: 4px; }
.dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text); text-decoration: none !important; }
.dropdown a .icon { width: 17px; height: 17px; color: var(--blue); }
.dropdown a:hover, .dropdown a:focus-visible { background: var(--blue-lighter); outline: none; }
.nav-section + .nav-section { margin-top: 10px; }

/* ================= Avatar e profili ================= */
.avatar-img { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; background: var(--blue-light); }
.person { display: flex; align-items: center; gap: 10px; }
.profile-fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px 4px; margin: 12px 0 0; }
.profile-fieldset legend { font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--blue); padding: 0 4px; }
.photo-pick { display: flex; align-items: center; gap: 14px; margin: 6px 0 12px; }
.photo-pick .avatar { background: var(--blue-light); color: var(--blue); }

/* ================= Widget del consulente (clienti) ================= */
.cw { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.cw-launcher { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 10px 30px rgba(2, 63, 130, .35); }
.cw-launcher:hover { background: var(--blue-dark); }
.cw-face { width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .16); display: grid; place-items: center; overflow: hidden; }
.cw-face .avatar { background: var(--amber); color: var(--blue-dark); }
.cw-dot { position: absolute; top: 4px; left: 36px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--blue); }
.cw.open .cw-label { display: none; }
.cw.open .cw-launcher { padding-right: 6px; }
.cw-panel { width: min(380px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--border); }
.cw-head { display: flex; align-items: center; gap: 12px; padding: 16px; background: linear-gradient(150deg, var(--blue), var(--blue-dark)); color: #fff; }
.cw-head .avatar { background: var(--amber); color: var(--blue-dark); }
.cw-who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cw-who strong { font-family: var(--font-head); font-size: 16px; }
.cw-who span { font-size: 12.5px; opacity: .8; }
.cw-close { color: rgba(255, 255, 255, .8); }
.cw-close:hover { background: rgba(255, 255, 255, .12) !important; color: #fff !important; }
.cw-bio { margin: 0; padding: 10px 16px; font-size: 13px; color: var(--gray); border-bottom: 1px solid var(--border); }
.cw-actions { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.cw-act { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 10px; background: var(--blue-lighter); color: var(--blue); font-size: 11.5px; font-weight: 600; text-decoration: none !important; }
.cw-act:hover { background: var(--blue-light); }
.cw-act .icon { width: 18px; height: 18px; }
.cw-messages { flex: 1; min-height: 140px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #fafbfd; }
.cw-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.cw-msg p { margin: 0; padding: 8px 11px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.cw-msg time { display: block; font-size: 10.5px; color: var(--muted); margin: 2px 6px 0; }
.cw-msg.them p { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.cw-msg.me { align-self: flex-end; }
.cw-msg.me p { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.cw-msg.me time { text-align: right; }
.cw-sys, .cw-empty { text-align: center; font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.cw-quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 0; scrollbar-width: none; }
.cw-quick button { flex: none; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12.5px; color: var(--gray); cursor: pointer; }
.cw-quick button:hover { border-color: var(--blue); color: var(--blue); }
.cw-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; }
.cw-compose textarea { flex: 1; resize: none; border: 1.5px solid var(--border-strong); border-radius: 12px; padding: 8px 10px; font: inherit; font-size: 14px; max-height: 120px; }
.cw-compose textarea:focus { outline: none; border-color: var(--blue); }
.cw-compose .btn { height: 38px; width: 38px; padding: 0; justify-content: center; border-radius: 50%; }
.cw-foot { display: flex; justify-content: space-between; padding: 8px 14px 12px; border-top: 1px solid var(--border); }
@media (max-width: 600px) { .cw { right: 12px; bottom: 12px; } .cw-label { display: none; } .cw-launcher { padding: 6px; } }
@media print { .cw { display: none !important; } }

/* ================= Guida introduttiva ================= */
.tour-layer { position: fixed; inset: 0; z-index: 300; }
.tour-layer.centered { background: rgba(1, 26, 54, .55); display: grid; place-items: center; }
.tour-spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(1, 26, 54, .55); transition: all .25s ease; pointer-events: none; outline: 2px solid var(--amber); }
.tour-card { position: fixed; background: var(--surface); border-radius: 14px; padding: 18px 18px 14px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 24px); transition: top .25s ease, left .25s ease; }
.tour-layer.centered .tour-card { position: relative; width: min(440px, calc(100vw - 32px)); }
.tour-card h2 { font-size: 18px; margin-bottom: 6px; }
.tour-card p { margin: 0 0 12px; font-size: 14px; color: var(--gray); }
.tour-count { font-family: var(--font-head); font-size: 11px !important; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--blue) !important; margin-bottom: 4px !important; }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-actions [data-tour=skip] { margin-right: auto; }
.tour-dots { display: flex; gap: 4px; margin-right: 6px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.tour-dots i.on { background: var(--blue); }

/* ================= Come usare la piattaforma ================= */
.help-search { margin-bottom: 14px; }
.help-search .input { max-width: 520px; }
.help-topics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.help-topics a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--gray); }
.help-topics a:hover { border-color: var(--blue); color: var(--blue); }
.help-topics .icon { width: 15px; height: 15px; }
.help-section h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; margin-bottom: 8px; }
.help-section h2 .icon { width: 19px; height: 19px; color: var(--blue); }
.help-item { border-top: 1px solid var(--border); }
.help-item summary { cursor: pointer; padding: 11px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.help-item summary::after { content: '+'; color: var(--blue); font-weight: 700; }
.help-item[open] summary::after { content: '–'; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item p { margin: 0 0 12px; color: var(--gray); font-size: 14.5px; }
.help-contact { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tour-actions { flex-wrap: wrap; row-gap: 8px; }
.tour-card { box-sizing: border-box; }
.cw { flex-direction: column-reverse; }

/* ================= Dashboard (riprogettata) ================= */
.dash-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 18px; border-radius: 14px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%); color: #fff; box-shadow: var(--shadow-md); }
.dash-hero .eyebrow { color: var(--amber); }
.dash-hero h1 { color: #fff; font-size: 26px; }
.dash-hero-text p { margin: 6px 0 0; color: rgba(255, 255, 255, .85); font-size: 15px; }
.dash-hero-text strong { color: #fff; }
.focus-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.focus-chip { display: flex; flex-direction: column; align-items: flex-start; min-width: 104px; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); color: #fff; text-decoration: none !important; font: inherit; cursor: pointer; text-align: left; }
.focus-chip:hover { background: rgba(255, 255, 255, .18); }
.focus-chip strong { font-family: var(--font-head); font-size: 24px; line-height: 1.1; }
.focus-chip span { font-size: 12px; opacity: .85; }
.focus-chip.danger { background: rgba(192, 52, 52, .9); border-color: transparent; }
.focus-chip.ok strong::after { content: ' ✓'; font-size: 16px; color: #9be3b4; }
.kpi-strip .stat { padding: 14px 16px; }
.kpi-strip .stat-value { font-size: 22px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.dash-main > .card, .dash-side > .card, .dash-side > details { margin-bottom: 18px; }
.inbox-row .list-main { text-decoration: none !important; color: inherit; }
.inbox-act { flex: none; }
.task-quick .task-check { width: 18px; height: 18px; accent-color: var(--green); flex: none; }
.task-quick .task-done strong { text-decoration: line-through; color: var(--muted); }
.text-warn { color: var(--amber-dark); font-weight: 600; }
.date-chip.today { background: var(--blue); color: #fff; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.mini-kpis div { background: var(--blue-lighter); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; }
.mini-kpis strong { font-family: var(--font-head); font-size: 15px; color: var(--blue-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-kpis span { font-size: 11.5px; color: var(--gray); }
.hero-card { display: flex; align-items: center; gap: 12px; background: var(--surface); color: var(--text); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-md); min-width: 300px; }
.hero-card > div:not(.hero-card-actions) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.hero-card strong { font-family: var(--font-head); font-size: 15px; }
.hero-card .avatar { background: var(--amber); color: var(--blue-dark); }
.hero-card-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--blue-light); color: var(--blue); display: grid; place-items: center; flex: none; }
.hero-card-actions { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 1180px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .dash-hero { padding: 18px; }
  .focus-chip { min-width: 0; flex: 1 1 40%; }
  .hero-card { min-width: 0; width: 100%; flex-wrap: wrap; }
  .inbox-act { display: none; }
}

/* ================= Assistente AI (team) ================= */
.aw { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.aw[hidden] { display: none; }
.aw-launcher { display: flex; align-items: center; gap: 8px; padding: 11px 18px; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--blue), #1d5fb0); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 10px 30px rgba(2, 63, 130, .35); }
.aw-launcher .icon { width: 18px; height: 18px; color: var(--amber); }
.aw-launcher:hover { filter: brightness(1.08); }
.aw.open .aw-launcher span { display: none; }
.aw-panel { width: min(420px, calc(100vw - 24px)); height: min(620px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden; }
.aw-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; }
.aw-head .icon { width: 18px; height: 18px; color: var(--amber); }
.aw-head strong { flex: 1; font-family: var(--font-head); }
.aw-expand, .aw-close { color: rgba(255, 255, 255, .8) !important; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; }
.aw-expand .icon, .aw-close .icon { color: inherit !important; width: 16px; height: 16px; }
.aw-expand { transform: rotate(-45deg); }
.aw-expand:hover, .aw-close:hover { background: rgba(255, 255, 255, .12) !important; color: #fff !important; }
.aw-body { flex: 1; min-height: 0; display: flex; }
.as { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.as-page { padding: 0; height: calc(100vh - 250px); min-height: 460px; display: flex; overflow: hidden; }
.as-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: #fafbfd; }
.as-welcome { text-align: center; margin: auto; max-width: 360px; color: var(--gray); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.as-welcome .icon { width: 32px; height: 32px; color: var(--amber); }
.as-welcome p { margin: 0; font-size: 13.5px; }
.as-msg { display: flex; gap: 8px; align-items: flex-start; }
.as-msg.user { justify-content: flex-end; }
.as-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: var(--amber); display: grid; place-items: center; flex: none; }
.as-avatar .icon { width: 15px; height: 15px; }
.as-bubble { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; background: var(--surface); border: 1px solid var(--border); border-top-left-radius: 4px; }
.as-msg.user .as-bubble { background: var(--blue); color: #fff; border-color: var(--blue); border-top-left-radius: 14px; border-top-right-radius: 4px; }
.as-bubble p { margin: 0 0 8px; } .as-bubble p:last-child { margin-bottom: 0; }
.as-bubble ul, .as-bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.as-bubble a { font-weight: 600; }
.as-typing { display: flex; gap: 4px; padding: 12px 14px; }
.as-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: as-blink 1.2s infinite ease-in-out; }
.as-typing i:nth-child(2) { animation-delay: .2s; } .as-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes as-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.as-prop { margin-top: 10px; border: 1.5px solid var(--amber); background: #fffbf3; border-radius: 10px; padding: 10px 12px; }
.as-prop.done { border-color: var(--green); background: #f3faf6; }
.as-prop.cancelled { opacity: .6; border-color: var(--border); background: #f7f8fa; }
.as-prop-head { display: flex; align-items: center; gap: 6px; }
.as-prop-head .icon { width: 16px; height: 16px; color: var(--amber-dark); }
.as-prop.done .as-prop-head .icon { color: var(--green); }
.as-prop ul { margin: 6px 0; padding-left: 18px; font-size: 13px; color: var(--gray); }
.as-prop-preview { font-size: 12.5px; white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px; margin: 6px 0; max-height: 160px; overflow-y: auto; }
.as-prop-actions { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.as-suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 0; }
.as-suggest:empty { display: none; }
.as-suggest button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12.5px; color: var(--gray); cursor: pointer; text-align: left; }
.as-suggest button:hover { border-color: var(--blue); color: var(--blue); }
.as-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 6px; border-top: 1px solid var(--border); }
.as-compose textarea { flex: 1; resize: none; border: 1.5px solid var(--border-strong); border-radius: 12px; padding: 8px 10px; font: inherit; font-size: 14px; max-height: 140px; }
.as-compose textarea:focus { outline: none; border-color: var(--blue); }
.as-compose .btn { height: 38px; width: 38px; padding: 0; justify-content: center; border-radius: 50%; }
.as-note { margin: 0; padding: 0 12px 10px; font-size: 11.5px; color: var(--muted); }
@media (max-width: 600px) { .aw { right: 12px; bottom: 12px; } .aw-launcher span { display: none; } .aw-launcher { padding: 12px; } }
@media print { .aw { display: none !important; } }

/* Barra AI in alto (team) */
.search-trigger.compact { width: auto; margin-right: 0; flex: none; }
.search-trigger.compact span { display: none; }
.ai-bar { flex: 1; max-width: 640px; margin-right: auto; display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 14px; border-radius: 999px; background: var(--surface);
  border: 1.5px solid transparent; background-image: linear-gradient(var(--surface), var(--surface)), linear-gradient(135deg, var(--amber), #1d5fb0); background-origin: border-box; background-clip: padding-box, border-box; box-shadow: var(--shadow-sm); }
.ai-bar > .icon { width: 18px; height: 18px; color: var(--amber-dark); flex: none; }
.ai-bar input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 14px; background: none; color: var(--text); padding: 6px 0; }
.ai-bar input::placeholder { color: var(--muted); }
.ai-bar:focus-within { box-shadow: 0 0 0 3px rgba(245, 165, 36, .25); }
.ai-bar-go { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.ai-bar-go .icon { width: 16px; height: 16px; }
.update-banner { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 400; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; background: var(--blue-dark); color: #fff; border-radius: 999px; box-shadow: var(--shadow-lg); font-size: 14px; }
.update-banner .icon { width: 18px; height: 18px; color: var(--amber); }
@media (max-width: 860px) {
  .ai-bar { order: 5; flex-basis: 100%; max-width: none; margin: 4px 0 0; }
  .topbar { flex-wrap: wrap; }
  .search-trigger.compact { margin-left: auto; }
}

/* ================= Time management e prezzi ================= */
.tm-btn { display: flex; align-items: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--gray); cursor: pointer; font-family: var(--font-head); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.tm-btn .icon { width: 19px; height: 19px; }
.tm-btn:hover { border-color: var(--blue); color: var(--blue); }
.tm-btn.on { background: var(--green); border-color: var(--green); color: #fff; }
.tm-btn.on .icon { animation: tm-pulse 2s infinite; }
@keyframes tm-pulse { 50% { opacity: .5; } }
.tm-time:empty { display: none; }
.tm-panel { width: 320px; padding: 8px 12px 12px; }
.tm-form .field { margin-bottom: 8px; }
.tm-big { display: block; font-family: var(--font-head); font-size: 30px; color: var(--green); font-variant-numeric: tabular-nums; margin: 2px 0 4px; }
.tm-run p { margin: 0 0 4px; }
.tm-run .actions { margin-top: 10px; }
.week-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.day-card { margin: 0; }
.day-card.today { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.day-card h2 { font-size: 15px; text-transform: capitalize; }
.day-card .card-head { gap: 8px; }
.day-card .card-head h2 { flex: 1; }
.time-list { margin: 0 -8px; }
.time-row { width: 100%; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; border-radius: 6px; padding: 8px !important; }
.time-row:hover { background: var(--blue-lighter); }
.time-dur { font-family: var(--font-head); font-weight: 800; font-size: 13px; color: var(--blue); min-width: 58px; font-variant-numeric: tabular-nums; }
.pricing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.rates-card { position: sticky; top: 76px; }
.rate-big { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 10px; background: var(--blue-lighter); margin-bottom: 10px; }
.rate-big span { font-size: 12.5px; color: var(--gray); }
.rate-big strong { font-family: var(--font-head); font-size: 26px; color: var(--blue-dark); }
.rate-big small { font-size: 12px; color: var(--muted); }
.rate-big.floor { background: #fdf6f6; }
.rate-big.floor strong { color: var(--red); font-size: 20px; }
.people-table .input { width: 90px; margin-left: auto; }
.budget-card { border-left: 4px solid var(--amber); }
.budget-card .card-head h2 { display: flex; align-items: center; gap: 8px; }
.budget-card .card-head h2 .icon { color: var(--amber-dark); width: 18px; height: 18px; }
.budget-inputs { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.budget-inputs .field { margin: 0; }
.budget-inputs select { min-width: 260px; }
.budget-inputs .segmented button { text-transform: capitalize; }
.budget-main { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; }
.budget-price { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; }
.budget-price span { font-size: 12.5px; opacity: .85; }
.budget-price strong { font-family: var(--font-head); font-size: 28px; }
.budget-price small { font-size: 12px; opacity: .8; }
.budget-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.budget-facts div, .time-facts > div { background: var(--blue-lighter); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 1px; }
.budget-facts span, .time-facts span { font-size: 12px; color: var(--gray); }
.budget-facts strong, .time-facts strong { font-family: var(--font-head); font-size: 17px; color: var(--blue-dark); }
.budget-facts small, .time-facts small { font-size: 11.5px; color: var(--muted); }
.budget-conf { font-size: 13px; color: var(--gray); margin: 10px 0 6px; }
.budget-cmp { display: flex; gap: 6px; align-items: center; font-size: 13.5px; font-weight: 600; padding: 8px 10px; border-radius: 8px; margin: 6px 0; }
.budget-cmp .icon { width: 16px; height: 16px; flex: none; }
.budget-cmp.ok { background: var(--green-light); color: var(--green); }
.budget-cmp.warn { background: var(--amber-light); color: var(--amber-dark); }
.budget-cmp.bad { background: var(--red-light); color: var(--red); }
.budget-detail { margin: 8px 0; }
.budget-detail summary { cursor: pointer; font-weight: 600; color: var(--blue); font-size: 13px; }
.time-card .card-head h2 { display: flex; align-items: center; gap: 8px; }
.time-card .card-head h2 .icon { width: 18px; height: 18px; color: var(--blue); }
.time-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.time-bar { height: 8px; background: #e3e8f0; border-radius: 4px; overflow: hidden; margin: 6px 0 2px; }
.time-bar span { display: block; height: 100%; background: var(--green); }
.time-bar.warn span { background: var(--amber); }
.time-bar.bad span { background: var(--red); }
@media (max-width: 1000px) { .pricing-layout, .budget-main { grid-template-columns: 1fr; } .rates-card { position: static; } }
@media (max-width: 700px) { .budget-facts, .time-facts { grid-template-columns: 1fr; } .budget-inputs select { min-width: 0; width: 100%; } }
.sticky-head { top: var(--topbar-h, 60px); }
@media (max-width: 860px) { .sticky-head { top: var(--topbar-h, 61px); } }
/* Timer sulle card della board */
.task-meta .task-timer { margin-left: auto; width: 26px; height: 26px; opacity: .55; }
.task:hover .task-meta .task-timer, .task-meta .task-timer:focus-visible { opacity: 1; }

/* ---------- Processo di consulenza: fasi della pipeline, brief, prossimo passo, percorso del cliente ---------- */
.stage-brief, .stage-qualifica { background: var(--amber-light); color: var(--amber-dark); }
.stage-meet { background: var(--blue-light); color: var(--blue); }
.stage-proposta { background: #e9e6f6; color: #4a3aa7; }
.stage-bar.process button { font-size: 12px; }
.verdict { display: inline-flex; align-items: center; font-family: var(--font-head); font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 20px; background: #eef0f3; color: var(--gray); }
.verdict-sm { font-size: 10.5px; padding: 1px 8px; align-self: flex-start; }
.verdict-good { background: var(--ok-bg); color: var(--ok); }
.verdict-warn { background: var(--warn-bg); color: var(--warn); }
.verdict-bad { background: var(--bad-bg); color: var(--bad); }

.next-step { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--blue); margin-bottom: 18px; }
.next-step p { margin: 2px 0 0; }
.next-step .eyebrow { margin: 0; }

.brief-wait p { margin: 0 0 10px; }
.brief-wait .actions { margin-top: 10px; }
.brief-result { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.brief-result p { margin: 4px 0 0; }
.brief-score { display: flex; align-items: baseline; justify-content: center; min-width: 74px; padding: 12px 10px; border-radius: var(--radius); font-family: var(--font-head); }
.brief-score strong { font-size: 28px; line-height: 1; }
.brief-score span { font-size: 12px; margin-left: 2px; }
.score-good { background: var(--ok-bg); color: var(--ok); }
.score-warn { background: var(--warn-bg); color: var(--warn); }
.score-bad { background: var(--bad-bg); color: var(--bad); }
.brief-signals { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.brief-signals li { display: flex; gap: 8px; align-items: flex-start; }
.brief-signals .icon { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }
.brief-signals .sig-good .icon { color: var(--ok); }
.brief-signals .sig-warn .icon { color: var(--warn); }
.brief-signals .sig-bad .icon { color: var(--bad); }
.brief-answers summary { cursor: pointer; font-family: var(--font-head); font-weight: 700; padding: 6px 0; }
.brief-answers section { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.brief-answers h3 { margin: 0; font-size: 14px; }
.brief-purpose { margin: 2px 0 8px; font-size: 12px; color: var(--muted); font-style: italic; }
.brief-answers dl { margin: 0; display: grid; gap: 4px; }
.brief-answers dt { font-size: 12.5px; color: var(--gray); font-weight: 600; margin-top: 6px; }
.brief-answers dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }

/* Questionario pubblico */
.public-brief { max-width: 720px; margin: 0 auto; padding: 24px 16px 60px; }
.brief-card { padding: 28px; }
.brief-card h1 { font-size: 24px; margin: 4px 0 12px; }
.brief-facts { list-style: none; padding: 0; margin: 18px 0; display: flex; gap: 10px 20px; flex-wrap: wrap; color: var(--gray); font-size: 14px; }
.brief-facts li { display: flex; align-items: center; gap: 6px; }
.brief-facts .icon { width: 16px; height: 16px; color: var(--blue); }
.brief-progress { height: 6px; border-radius: 6px; background: var(--blue-light); overflow: hidden; margin-bottom: 16px; }
.brief-progress span { display: block; height: 100%; background: var(--blue); border-radius: 6px; transition: width .3s; }
.brief-form { display: grid; gap: 22px; margin-top: 8px; }
.brief-q-label { margin: 0 0 4px; font-weight: 700; font-family: var(--font-head); font-size: 15px; }
.brief-q-label .req { color: var(--red); }
.brief-q-hint { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.brief-q .input { width: 100%; }
.brief-options { display: grid; gap: 8px; }
.brief-option { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); font-size: 14.5px; }
.brief-option:hover { border-color: var(--blue); }
.brief-option.on { border-color: var(--blue); background: var(--blue-lighter); }
.brief-option input { accent-color: var(--blue); width: 17px; height: 17px; flex-shrink: 0; }
.brief-other { margin-top: 8px; }
.brief-q.has-error .brief-options, .brief-q.has-error > .input { outline: 2px solid var(--red-light); outline-offset: 2px; border-radius: var(--radius-sm); }
.brief-q-error { color: var(--red); font-size: 13px; margin: 6px 0 0; font-weight: 600; }
.brief-nav { justify-content: space-between; border-top: 1px solid var(--border); padding-top: 16px; }
.brief-done { text-align: center; }
.brief-done > .icon { width: 44px; height: 44px; color: var(--ok); background: var(--ok-bg); border-radius: 50%; padding: 10px; }

/* Percorso di consulenza (scheda cliente e portale) */
.journey { margin-bottom: 18px; }
.journey-steps { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; counter-reset: j; }
.jstep { position: relative; min-width: 0; }
.jstep > a, .jstep > .jlink { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 10px 0 0; color: inherit; text-decoration: none; }
.jstep > a[aria-disabled="true"] { pointer-events: none; }
.jstep::before { content: ''; position: absolute; top: 15px; left: 32px; right: 0; height: 2px; background: var(--border-strong); }
.jstep:last-child::before { display: none; }
.jstep-fatto::before { background: var(--ok); }
.jdot { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; font-family: var(--font-head); font-weight: 700; font-size: 13px; background: var(--surface); border: 2px solid var(--border-strong); color: var(--muted); }
.jdot .icon { width: 15px; height: 15px; }
.jstep-fatto .jdot { background: var(--ok); border-color: var(--ok); color: #fff; }
.jstep-in_corso .jdot { border-color: var(--blue); color: var(--blue); }
.jstep-saltato .jdot { border-style: dashed; }
.jstep.current .jdot { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 5px var(--blue-light); }
.jtext { display: flex; flex-direction: column; min-width: 0; }
.jtext strong { font-family: var(--font-head); font-size: 13.5px; }
.jtext small { color: var(--muted); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.jstep.current .jtext strong { color: var(--blue); }
.phase-chip { display: inline-flex; font-family: var(--font-head); font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 20px; background: var(--blue-light); color: var(--blue); }
.phase-chip.phase-brief, .phase-chip.phase-meet { background: var(--amber-light); color: var(--amber-dark); }
.phase-chip.phase-monitoraggio { background: var(--ok-bg); color: var(--ok); }

/* Portale: timeline in evidenza con il passo richiesto */
.journey-hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 22px 24px; margin-bottom: 18px; }
.journey-hero.needs-action { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light), var(--shadow-md); }
.journey-hero > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.journey-hero > header .eyebrow { margin: 0; }
.journey-count { font-family: var(--font-head); font-size: 12.5px; font-weight: 700; color: var(--blue); background: var(--blue-light); padding: 3px 10px; border-radius: 20px; }
.journey-steps.big .jdot { width: 40px; height: 40px; font-size: 15px; }
.journey-steps.big .jstep::before { top: 19px; left: 40px; }
.journey-steps.big .jtext strong { font-size: 15px; }
.journey-action { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding: 16px 18px; border-radius: var(--radius); background: var(--blue-lighter); }
.journey-action.action-required { background: var(--blue); color: #fff; }
.journey-action.action-required p { color: #dce7f4; }
.journey-action.action-required .btn-primary { background: #fff; color: var(--blue); border-color: #fff; }
.journey-action.action-required .journey-badge { background: rgba(255,255,255,.18); color: #fff; }
.journey-action-text { flex: 1 1 260px; min-width: 0; }
.journey-action h2 { margin: 0; font-size: 18px; color: inherit; }
.journey-action p { margin: 4px 0 0; font-size: 14px; }
.journey-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; background: var(--surface); color: var(--blue); }
.journey-badge .icon { width: 14px; height: 14px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
@media (max-width: 760px) {
  .journey-steps { grid-template-columns: 1fr; gap: 12px; }
  .jstep > a, .jstep > .jlink { flex-direction: row; align-items: center; }
  .jstep::before { top: 32px; bottom: -12px; left: 15px; right: auto; width: 2px; height: auto; }
  .journey-steps.big .jstep::before { top: 40px; left: 19px; }
  .journey-hero { padding: 18px 16px; }
  .brief-card { padding: 20px 16px; }
}

.info dd { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Analisi avanzate: journey, segmenti, trend, previsioni ---------- */
.key-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.key-fc { border-top: 2px dashed #2a78d6; }
.key-band { height: 9px; border: 0; background: rgba(42, 120, 214, .22); border-radius: 2px; }
.key-trend { border-top: 1.5px dashed #52514e; }
.key-cp { width: 0; height: 12px; border: 0; border-left: 2px solid #eb6834; }
.key-anom { width: 9px; height: 9px; border: 2px solid #e34948; border-radius: 50%; }
.chart-legend .key[style] { height: 9px; width: 9px; border: 0; border-radius: 2px; }
.chart-plot svg .divider { stroke: #c3c2b7; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart-plot svg .cp-line { stroke: #eb6834; stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-note { position: absolute; top: -2px; transform: translateX(-50%); font-size: 11px; color: var(--muted); background: var(--surface); padding: 0 3px; }
.chart-anom { position: absolute; width: 12px; height: 12px; border: 2px solid #e34948; border-radius: 50%; transform: translate(-50%, -50%); background: var(--surface); pointer-events: none; }
.fc-row td { background: #f5f9fe; }
.badge-mini { font-size: 10.5px; font-weight: 700; color: var(--red); text-transform: uppercase; }

.ci-rows { display: grid; gap: 6px; margin: 6px 0 12px; }
.ci-row { display: grid; grid-template-columns: minmax(120px, 1.1fr) 2.4fr minmax(90px, auto); align-items: center; gap: 12px; font-size: 13px; }
.ci-label { overflow-wrap: anywhere; }
.ci-track { position: relative; height: 22px; background: linear-gradient(#edf0f4, #edf0f4) center / 100% 1px no-repeat; }
.ci-whisk { position: absolute; top: 50%; height: 6px; transform: translateY(-50%); background: rgba(42, 120, 214, .28); border-radius: 3px; }
.ci-dot { position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: #2a78d6; box-shadow: 0 0 0 2px var(--surface); transform: translate(-50%, -50%); }
.ci-dot.muted { background: #9aa3b2; }
.ci-ref { position: absolute; top: 0; bottom: 0; border-left: 1.5px dashed #52514e; }
.ci-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ci-value small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.ci-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.ci-ref-key { display: inline-block; height: 12px; border-left: 1.5px dashed #52514e; }
.sig-flag { color: var(--blue); font-weight: 700; font-size: 12px; }

.sig { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.sig .icon { width: 12px; height: 12px; }
.sig-yes { background: var(--blue-light); color: var(--blue); }
.sig-no { background: #eef0f3; color: var(--gray); font-weight: 600; }

.method { margin-top: 10px; font-size: 12.5px; color: var(--gray); }
.method summary { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font-weight: 600; }
.method summary .icon { width: 14px; height: 14px; }
.method p { margin: 6px 0; line-height: 1.5; }
.method table { margin-top: 6px; }

.flow-chart .flow-plot { height: auto; padding-left: 0; }
.flow-chart .flow-plot svg { position: static; width: 100%; height: auto; overflow: visible; }
.flow-chart .axis { font-size: 11px; fill: var(--muted); }
.flow-label { font-size: 11.5px; fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.flow-link { cursor: pointer; transition: stroke-opacity .15s; }
.path-cell { max-width: 380px; overflow-wrap: anywhere; }

.cohort-table th, .cohort-table td { padding: 5px 7px; font-size: 12px; }
.cohort-cell { font-variant-numeric: tabular-nums; border: 2px solid var(--surface); }
.cohort-na { background: #fafafa; }

.season-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; height: 180px; margin: 8px 0; }
.season-col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; background: linear-gradient(#c3c2b7, #c3c2b7) center 50% / 100% 1px no-repeat; }
.season-bar { position: absolute; left: 22%; right: 22%; border-radius: 3px; }
.season-val { position: absolute; top: 0; font-size: 10.5px; color: var(--gray); font-variant-numeric: tabular-nums; }
.season-m { position: absolute; bottom: -2px; font-size: 11px; color: var(--muted); }

.tp-matrix th[scope=row] { font-weight: 600; white-space: nowrap; }
.tp-cell { min-width: 130px; vertical-align: top; }
.tp-cell strong { display: block; font-variant-numeric: tabular-nums; }
.tp-cell small { display: block; font-size: 11px; opacity: .85; }
.tp-empty { color: var(--muted); text-align: center; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 14px 0; }
.stat-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.stat-card h3 { margin: 0 0 4px; font-size: 12.5px; color: var(--gray); text-transform: uppercase; letter-spacing: .03em; }
.stat-card .big { margin: 0 0 4px; font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.stat-card p { margin: 0 0 4px; }
.seg-card h3 { margin: 0; font-size: 16px; }
.seg-card .card-head p { margin: 4px 0 0; }
h3.sub { font-size: 14px; margin: 6px 0; }
.trend-table tr[data-open] { cursor: pointer; }
.trend-table tr[data-open]:hover td { background: var(--blue-lighter); }
.trend-table .spark { width: 110px; height: 26px; }
.picker { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.anom-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.stage-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.stage-steps li { position: relative; display: grid; grid-template-columns: 220px 1fr; gap: 2px 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: #f6f8fb; overflow: hidden; }
.stage-steps li > * { position: relative; }
.stage-steps small { grid-column: 2; color: var(--muted); }
.stage-bar-fill { position: absolute !important; left: 0; top: 0; bottom: 0; background: rgba(42, 120, 214, .14); }
.rec-summary { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; font-size: 13.5px; }
.rec-summary li { display: flex; gap: 10px; flex-wrap: wrap; }
.rec-attrs { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.rec-imports { margin-top: 12px; font-size: 13px; }
.rec-imports summary { cursor: pointer; color: var(--blue); font-weight: 600; }
@media (max-width: 760px) {
  .ci-row { grid-template-columns: 1fr auto; }
  .ci-track { grid-column: 1 / -1; order: 3; }
  .stage-steps li { grid-template-columns: 1fr; }
  .stage-steps small { grid-column: 1; }
  .season-bars { gap: 2px; }
  .season-val { display: none; }
}

/* ---------- Miglioramenti della piattaforma ---------- */
.opt-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.opt-gauge { position: relative; width: 116px; height: 116px; flex-shrink: 0; }
.opt-gauge svg { width: 100%; height: 100%; }
.opt-gauge .g-track { fill: none; stroke: #edf0f4; stroke-width: 10; }
.opt-gauge .g-fill { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .4s; }
.gauge-good .g-fill { stroke: #0ca30c; } .gauge-mid .g-fill { stroke: #2a78d6; } .gauge-low .g-fill { stroke: #eb6834; }
.opt-gauge strong { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 24px; }
.opt-text { flex: 1 1 260px; min-width: 0; }
.opt-text h2 { margin: 0 0 4px; }
.opt-text p { margin: 0 0 4px; }
.opt-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.impr-filters { gap: 12px; flex-wrap: wrap; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-row .chip[aria-pressed=true] { background: var(--blue); color: #fff; border-color: var(--blue); }
.impr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 22px; }
.impr-grid > .empty { grid-column: 1 / -1; }
.impr-card { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.impr-card:hover, .impr-card:focus-visible { border-color: var(--blue); box-shadow: var(--shadow-md); outline: none; }
.impr-card header { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.impr-card h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.impr-card p { margin: 0; color: var(--gray); font-size: 13.5px; line-height: 1.45; flex: 1; }
.impr-card footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.impr-actions { margin-left: auto; display: flex; gap: 4px; }
.impr-kind, .impr-aud, .impr-ai { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-head); font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.impr-kind .icon { width: 13px; height: 13px; }
.kind-funzionalita { background: var(--blue-light); color: var(--blue); }
.kind-uso { background: #eef0f3; color: var(--gray); }
.kind-correzione { background: var(--amber-light); color: var(--amber-dark); }
.impr-aud { background: none; color: var(--muted); border: 1px solid var(--border); font-weight: 600; }
.impr-ai { background: #4a3aa7; color: #fff; }
.impr-uplift { font-family: var(--font-head); font-weight: 800; font-size: 15px; color: var(--blue); background: var(--blue-lighter); border-radius: 6px; padding: 2px 8px; }
.impr-state { font-size: 12.5px; font-weight: 600; color: var(--gray); display: inline-flex; align-items: center; gap: 4px; }
.impr-state .icon { width: 14px; height: 14px; }
.state-applicato { color: var(--green); }
.impr-impact { font-size: 12px; color: var(--gray); display: inline-flex; align-items: center; gap: 6px; }
.impact-meter { display: inline-flex; gap: 2px; align-items: flex-end; }
.impact-meter i { display: block; width: 5px; background: #d6dbe3; border-radius: 1px; }
.impact-meter i:nth-child(1) { height: 7px; } .impact-meter i:nth-child(2) { height: 10px; } .impact-meter i:nth-child(3) { height: 13px; }
.impact-meter i.on { background: var(--blue); }
.impr-detail section { margin-bottom: 16px; }
.impr-detail h3 { font-size: 14px; margin: 0 0 6px; }
.impr-detail h3:focus { outline: none; }
.impr-detail p { margin: 0 0 6px; line-height: 1.55; }
.impr-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.impr-evidence { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.impr-evidence div { background: #f6f8fb; border-radius: var(--radius-sm); padding: 8px 10px; }
.impr-evidence dt { font-size: 11.5px; color: var(--muted); }
.impr-evidence dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.impr-impact-box { background: var(--blue-lighter); border-radius: var(--radius); padding: 12px 14px; }
.impr-impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.impr-impact-grid > div > span { display: block; font-size: 11.5px; color: var(--muted); }
.impr-impact-grid strong { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.impr-prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.impr-prompt { width: 100%; font-size: 12.5px; line-height: 1.45; background: #f6f8fb; }
.usage-details { margin-top: 10px; }
.usage-details > summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; list-style: none; margin-bottom: 12px; }
.usage-details > summary h2 { margin: 0; font-size: 18px; }
.usage-details > summary::before { content: '▸'; color: var(--blue); }
.usage-details[open] > summary::before { content: '▾'; }
.adopt-bar { display: inline-block; width: 70px; height: 6px; background: #edf0f4; border-radius: 3px; vertical-align: middle; overflow: hidden; }
.adopt-bar i { display: block; height: 100%; background: #2a78d6; }
@media (max-width: 760px) {
  .impr-grid { grid-template-columns: 1fr; }
  .opt-head { gap: 14px; }
  .opt-gauge { width: 88px; height: 88px; }
}

/* ---------- Finestre del percorso (benvenuto, questionario, meet) e porta d'ingresso ---------- */
body.sheet-open { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(1, 25, 52, .52); display: flex; align-items: center; justify-content: center; padding: 24px; animation: sheet-fade .16s ease-out; }
.sheet-backdrop.out { opacity: 0; transition: opacity .15s; }
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet { position: relative; width: 100%; max-height: calc(100vh - 48px); overflow-y: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); animation: sheet-up .2s ease-out; }
.sheet-md { max-width: 560px; } .sheet-lg { max-width: 760px; }
.sheet-close { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--surface); }
.sheet-body { padding: 34px 38px 30px; }
.sheet-body h2 { font-size: 24px; margin: 4px 0 12px; line-height: 1.25; outline: none; }
.sheet-body > div > p { line-height: 1.6; }
.sheet-center { text-align: center; display: flex; flex-direction: column; align-items: center; }
.sheet-center .sheet-steps { text-align: left; width: 100%; max-width: 480px; }
.sheet-big-icon { width: 54px; height: 54px; color: #1f7a45; background: var(--green-light); border-radius: 50%; padding: 12px; margin-bottom: 6px; }
.sheet-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.brief-intro .sheet-actions, .meet-pick .sheet-actions { justify-content: flex-start; }
.sheet-steps { list-style: none; padding: 0; margin: 14px 0 4px; display: grid; gap: 0; }
.sheet-steps li { position: relative; display: flex; gap: 12px; padding: 0 0 16px; }
.sheet-steps li:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 2px; background: var(--border-strong); }
.sheet-steps li.ss-done:not(:last-child)::before { background: #1f7a45; }
.ss-dot { position: relative; z-index: 1; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; font-size: 13px; background: #eef0f3; color: var(--muted); }
.ss-dot .icon { width: 15px; height: 15px; }
.ss-done .ss-dot { background: #1f7a45; color: #fff; }
.ss-current .ss-dot { background: var(--blue); color: #fff; box-shadow: 0 0 0 4px var(--blue-light); }
.sheet-steps strong { display: block; font-family: var(--font-head); font-size: 15px; }
.ss-current strong { color: var(--blue); }
.sheet-steps small { display: block; color: var(--gray); font-size: 13px; margin-top: 2px; line-height: 1.45; }
.sheet-consultant { display: flex; align-items: center; gap: 12px; background: #f6f8fb; border-radius: 12px; padding: 12px 14px; margin: 14px 0; text-align: left; }
.sheet-consultant strong { display: block; font-family: var(--font-head); }
.sheet-consultant small { color: var(--gray); }
.brief-step-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sheet .brief-nav { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); padding-top: 16px; position: sticky; bottom: -30px; background: var(--surface); padding-bottom: 6px; }

.welcome-hero { text-align: center; }
.welcome-logo { width: 190px; margin: 0 auto 10px; display: block; }
.welcome-consultant { display: flex; gap: 16px; align-items: center; background: var(--blue-lighter); border-radius: 14px; padding: 16px 18px; margin: 18px 0; }
.welcome-consultant strong { display: block; font-family: var(--font-head); font-size: 17px; }
.welcome-consultant small { color: var(--gray); }
.welcome-consultant p { margin: 6px 0 0; font-size: 13.5px; color: var(--gray); line-height: 1.5; }
.welcome-consultant .eyebrow { margin: 0; }
.welcome h3 { font-size: 15px; margin: 8px 0 0; }
.welcome-note { text-align: center; margin-top: 8px; }

.meet-days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 8px 0; scroll-snap-type: x mandatory; }
.meet-days button { flex: 0 0 auto; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 78px; padding: 10px 8px; border: 1.5px solid var(--border-strong); background: var(--surface); border-radius: 12px; cursor: pointer; font-family: var(--font-head); }
.meet-days button span { font-size: 12px; text-transform: uppercase; color: var(--muted); }
.meet-days button strong { font-size: 15px; }
.meet-days button small { font-size: 11px; color: var(--muted); }
.meet-days button[aria-selected=true] { border-color: var(--blue); background: var(--blue); color: #fff; }
.meet-days button[aria-selected=true] span, .meet-days button[aria-selected=true] small { color: #dce7f4; }
.meet-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.meet-slots button { padding: 11px 6px; border: 1.5px solid var(--border-strong); background: var(--surface); border-radius: 10px; font-family: var(--font-head); font-weight: 700; font-size: 15px; cursor: pointer; }
.meet-slots button:hover { border-color: var(--blue); color: var(--blue); }
.meet-slots button[aria-pressed=true] { background: var(--blue); border-color: var(--blue); color: #fff; }
.meet-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; width: 100%; margin: 14px 0 4px; text-align: left; }
.meet-summary div { background: var(--blue-lighter); border-radius: 10px; padding: 12px 14px; }
.meet-summary span { display: block; font-size: 12px; color: var(--muted); }
.meet-summary strong { font-family: var(--font-head); }
.meet-prep { width: 100%; text-align: left; margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; }
.meet-prep h3 { font-size: 14px; margin: 0 0 6px; }
.meet-prep ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--gray); line-height: 1.6; }

.brief-track { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; font-size: 13.5px; color: var(--gray); }
.brief-track li { display: flex; align-items: center; gap: 6px; }
.brief-track .icon { width: 15px; height: 15px; }
.brief-track li.ok { color: #1f7a45; }

/* Porta d'ingresso (link dell'email) */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 440px) 1fr; background: var(--bg); }
.gate-single { display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate-side { background: linear-gradient(160deg, #023F82 0%, #012a56 100%); color: #fff; padding: 44px 40px; display: flex; flex-direction: column; gap: 16px; }
.gate-logo-light { width: 190px; }
.gate-side h2 { color: #fff; font-size: 26px; line-height: 1.25; margin: 18px 0 0; }
.gate-side p { color: #d4e1f1; line-height: 1.6; margin: 0; }
.gate-steps { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 14px; }
.gate-steps li { display: flex; gap: 12px; align-items: flex-start; opacity: .8; }
.gate-steps li.current { opacity: 1; }
.gate-steps li > span { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.gate-steps li.current > span { background: #fff; color: var(--blue); border-color: #fff; }
.gate-steps strong { display: block; font-family: var(--font-head); }
.gate-steps small { color: #c4d5ea; }
.gate-consultant { margin-top: auto; display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.1); border-radius: 12px; padding: 12px 14px; }
.gate-consultant small { display: block; color: #c4d5ea; font-size: 12px; }
.gate-consultant strong { display: block; font-family: var(--font-head); }
.gate-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.gate-card { width: 100%; max-width: 460px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-md); padding: 34px 32px; }
.gate-card h1 { font-size: 26px; margin: 4px 0 8px; }
.gate-logo { width: 180px; margin-bottom: 18px; }
.gate-form { display: grid; gap: 12px; }
.gate-form .btn-lg { width: 100%; justify-content: center; }
.gate-form .field-hint.ok { color: #1f7a45; font-weight: 600; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { width: 100%; padding-right: 72px; }
.pw-wrap .link-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.gate-privacy { align-items: flex-start; font-size: 13.5px; line-height: 1.45; }
.gate-privacy input { margin-top: 3px; }

@media (max-width: 860px) {
  .gate { grid-template-columns: 1fr; }
  .gate-side { padding: 26px 20px; gap: 10px; }
  .gate-side h2 { font-size: 21px; margin-top: 8px; }
  .gate-steps, .gate-consultant { display: none; }
  .gate-main { padding: 20px 16px 40px; align-items: flex-start; }
  .gate-card { padding: 24px 18px; }
}
@media (max-width: 640px) {
  .sheet-backdrop { padding: 0; align-items: stretch; }
  .sheet { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .sheet-body { padding: 56px 18px 24px; }
  .sheet-body h2 { font-size: 21px; }
  .welcome-consultant { flex-direction: column; text-align: center; }
  .sheet .brief-nav { bottom: -24px; }
}

.update-banner { top: auto; bottom: 20px; }

/* ================= Piano dei pagamenti ================= */
.plan-card .card-head h2 { display: flex; align-items: center; gap: 8px; }
.plan-card .card-head h2 .icon { width: 18px; height: 18px; color: var(--blue); }
.plan-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.plan-presets .chip { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; color: var(--gray); }
.plan-presets .chip:hover { border-color: var(--blue); color: var(--blue); }
.plan-rows { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.plan-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 90px 110px minmax(140px, 1fr) 130px 34px; gap: 8px; align-items: center; }
.plan-row.saldo { padding-top: 6px; border-top: 1px dashed var(--border-strong); }
.plan-pct { display: flex; align-items: center; gap: 4px; }
.plan-pct input { width: 64px; }
.plan-pct strong { font-family: var(--font-head); padding-left: 6px; }
.plan-amt { font-family: var(--font-head); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.pay-plan { margin: 18px 0; }
.pay-plan h2 { font-size: 16px; margin-bottom: 6px; }
.plan-pick { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.fw-pick-item.disabled { opacity: .55; }
@media (max-width: 760px) { .plan-row { grid-template-columns: 1fr 90px; } .plan-row .plan-amt { text-align: left; } }

/* ================= Timing ================= */
.timing-list { display: flex; flex-direction: column; gap: 10px; }
.timing-card { padding: 0; margin: 0; overflow: hidden; }
.timing-head { display: grid; grid-template-columns: 18px minmax(0, 2fr) repeat(3, minmax(90px, .8fr)) minmax(170px, 1fr); gap: 12px; align-items: center; width: 100%; padding: 14px 16px; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; color: var(--text); }
.timing-head:hover { background: var(--blue-lighter); }
.timing-caret { color: var(--muted); transition: transform .15s; }
.timing-card.open .timing-caret { transform: rotate(90deg); }
.timing-name { display: flex; flex-direction: column; min-width: 0; }
.timing-name strong { font-family: var(--font-head); font-size: 15px; }
.timing-name small, .timing-num small { color: var(--muted); font-size: 11.5px; }
.timing-num { display: flex; flex-direction: column; font-family: var(--font-head); font-weight: 700; font-variant-numeric: tabular-nums; }
.timing-num small { font-family: var(--font-body); font-weight: 400; }
.timing-use { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.var.over { color: var(--red); }
.var.under { color: var(--green); }
.var small { font-weight: 400; }
.use-bar { display: inline-block; width: 110px; height: 7px; border-radius: 4px; background: #e3e8f0; overflow: hidden; vertical-align: middle; }
.use-bar span { display: block; height: 100%; background: var(--green); }
.use-bar.warn span { background: var(--amber); }
.use-bar.over span { background: var(--red); }
.timing-tasks .use-bar { width: 60px; margin-left: 6px; }
.timing-body { border-top: 1px solid var(--border); padding: 12px 16px 16px; background: #fbfcfd; }
.timing-project-est { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 13.5px; }
.timing-project-est label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.est-in, .timing-project-est input { width: 80px; }
.timing-tasks tr.task-done td:first-child { color: var(--muted); }
@media (max-width: 1000px) { .timing-head { grid-template-columns: 18px 1fr 1fr; } .timing-use { grid-column: 2 / -1; } }
.budget-mods { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 8px 0; padding: 8px 10px; background: var(--blue-lighter); border-radius: 8px; }
.budget-mods .field-label { flex-basis: 100%; }
.budget-client { flex-basis: 100%; margin: 4px 0 0; display: flex; gap: 6px; align-items: center; }
.budget-client .icon { width: 15px; height: 15px; flex: none; }
.budget-client.warn { color: var(--amber-dark); }
.budget-client.ok { color: var(--green); }

/* Ritaglio della foto del profilo (photo-crop.js) */
.sheet-backdrop.sheet-over-modal { z-index: 110; }
.crop { max-width: 420px; margin: 0 auto; }
.crop-stage { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #0b1f38; cursor: grab; touch-action: none; user-select: none; outline-offset: 3px; }
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(1, 25, 52, .55); border: 2px solid rgba(255, 255, 255, .85); pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.crop-zoom input { flex: 1; accent-color: var(--blue); }
.crop .form-error { margin-top: 10px; text-align: center; }
