/* =====================================================================
   Stile del portale – sobrio, affidabile, pensato per il telefono
   Per cambiare i colori del marchio modifica le variabili qui sotto.
   ===================================================================== */
:root {
  /* Palette ispirata al brand guide Ltd24 (nessun logo né nome dello studio) */
  --ink: #122452;          /* blu notte */
  --ink-soft: #3b4768;
  --muted: #646f89;
  --line: #dfe5ee;
  --line-strong: #c6cfdd;
  --bg: #eef2f7;
  --bg-deep: #d8e2ed;      /* azzurro chiaro del brand */
  --surface: #ffffff;
  --surface-alt: #f6f8fb;
  --amber: #efac35;        /* arancio del brand: accenti e pulsanti principali */
  --amber-hover: #e49b1c;
  --amber-title: #c06f00;  /* arancio scuro per titoli leggibili */
  --amber-soft: #fdf2dc;
  --blue: #4355cc;         /* blu del brand */
  --teal: #05d5c8;         /* turchese del brand */
  --sky: #0fa9e9;
  --accent: #3344b8;       /* link e focus (blu leggibile) */
  --accent-bright: #05d5c8;
  --accent-soft: #e7eafb;
  --info: #3344b8;   --info-soft: #e7eafb;
  --warn: #8a5300;   --warn-soft: #fdf1dc;
  --bad: #b3261e;    --bad-soft: #fbe7e5;
  --ok: #04756e;     --ok-soft: #d8f5f2;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(18, 36, 82, .05), 0 10px 30px rgba(18, 36, 82, .07);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Rethink Sans", "Poppins", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -0.01em; font-family: var(--font-head); }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 750; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.demo-banner {
  background: var(--ink); color: #fff; font-size: .82rem; text-align: center;
  padding: 6px 16px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.demo-banner .link-btn { color: var(--accent-bright); }
.app-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-name { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; }
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.header-user { font-size: .85rem; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-link { font-size: .9rem; font-weight: 600; text-decoration: none; }
.lang-select {
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  padding: 4px 8px; font: inherit; font-size: .8rem; font-weight: 700; color: var(--ink);
  width: auto !important;
}
@media (max-width: 600px) { .header-user { display: none; } }

/* ---------- Layout ---------- */
.container { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }
.container-narrow { max-width: 760px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card + .card { margin-top: 16px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .span-2 { grid-column: span 2; }
  .span-3 { grid-column: 1 / -1; }
}

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 24px 16px; }
.auth-grid { display: grid; gap: 28px; width: 100%; max-width: 980px; align-items: center; }
@media (min-width: 880px) { .auth-grid { grid-template-columns: 1.05fr 1fr; } }
.auth-intro h1 { font-size: 2rem; }
.auth-intro ol { padding-left: 0; list-style: none; margin: 20px 0 0; counter-reset: s; }
.auth-intro li { counter-increment: s; display: flex; gap: 12px; margin-bottom: 14px; color: var(--ink-soft); }
.auth-intro li::before {
  content: counter(s); flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); font-weight: 800; display: grid; place-items: center; font-size: .85rem;
}
.auth-card { max-width: 460px; width: 100%; justify-self: center; }
.tabs { display: flex; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 20px; }
.tab {
  flex: 1; border: 0; background: transparent; padding: 9px 12px; border-radius: 999px; font: inherit;
  font-weight: 700; color: var(--muted); cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.field .hint { font-size: .8rem; color: var(--muted); }
.req::after { content: " *"; color: var(--bad); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel],
input[type=search], input[type=url], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 11px 12px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
.field-error { font-size: .8rem; color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--ink-soft); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 44px; }
.input-suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none;
  color: var(--muted); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; padding: 6px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700;
  border-radius: 999px; padding: 11px 20px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .05s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #0b1838; }
.btn-accent { background: var(--amber); color: var(--ink); }
.btn-accent:hover { background: var(--amber-hover); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-danger { background: transparent; border-color: #e7b8b4; color: var(--bad); }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn-accent.is-busy::after { border-color: rgba(18,36,82,.3); border-top-color: var(--ink); }
.btn-ghost.is-busy::after { border-color: var(--line-strong); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; }

/* ---------- Badges & alerts ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-neutral { background: #eeece6; color: var(--ink-soft); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.alert { border-radius: var(--radius-sm); padding: 12px 14px; font-size: .92rem; border: 1px solid; }
.alert-info { background: var(--info-soft); border-color: #c8dbef; color: #17466f; }
.alert-warn { background: var(--warn-soft); border-color: #efd7a9; color: #6e4100; }
.alert-ok { background: var(--ok-soft); border-color: #bfe3d7; color: #08513f; }
.alert-bad { background: var(--bad-soft); border-color: #f0c4c0; color: #87190f; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Dashboard ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.app-card { display: grid; gap: 14px; }
.app-card .company { font-size: 1.15rem; font-weight: 800; }
.app-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.progress { height: 8px; background: #ebe8e0; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--teal)); border-radius: 999px; }
.next-action { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-alt); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .92rem; }
.next-action strong { white-space: nowrap; }
.empty { text-align: center; padding: 40px 20px; }
.empty .icon { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); display: grid; place-items: center; margin: 0 auto 14px; color: var(--accent); }

/* ---------- Wizard ---------- */
.stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 20px; list-style: none; padding: 0; }
.stepper li { display: flex; flex-direction: column; gap: 8px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.stepper li::before { content: ""; height: 5px; border-radius: 999px; background: #e3e0d7; }
.stepper li.done::before { background: var(--accent); }
.stepper li.current { color: var(--ink); }
.stepper li.current::before { background: var(--ink); }
.stepper .num { font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .stepper .label-text { display: none; } .stepper li.current .label-text { display: inline; } }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.wizard-actions .right { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.person-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-alt); }
.person-card + .person-card { margin-top: 14px; }
.person-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; }
.person-head .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex: 0 0 auto; }
.person-body { padding: 0 16px 16px; }
.person-card.collapsed .person-body { display: none; }
.section-label { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 10px; }
.share-total { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 700; margin-top: 16px; }
.share-total.ok { background: var(--ok-soft); color: var(--ok); }
.share-total.bad { background: var(--warn-soft); color: var(--warn); }
.toggle-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-toggle { border: 1px solid var(--line-strong); background: var(--surface); padding: 8px 14px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink-soft); }
.chip-toggle[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.summary dl { display: grid; grid-template-columns: 1fr; gap: 2px 16px; margin: 0; }
@media (min-width: 560px) { .summary dl { grid-template-columns: 200px 1fr; } }
.summary dt { color: var(--muted); font-size: .85rem; font-weight: 600; }
.summary dd { margin: 0 0 8px; font-weight: 600; }
.capital-box { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; justify-content: space-between; font-weight: 700; }

/* ---------- People list (view) ---------- */
.people-list { display: grid; gap: 12px; }
@media (min-width: 640px) { .people-list { grid-template-columns: 1fr 1fr; } }
.person-tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface-alt); display: grid; gap: 8px; }
.roles { display: flex; gap: 6px; flex-wrap: wrap; }
.role-pill { font-size: .72rem; font-weight: 800; background: var(--ink); color: #fff; border-radius: 6px; padding: 2px 8px; }
.role-pill.light { background: #e7e4dc; color: var(--ink); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline time { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.staff-tag { font-size: .7rem; font-weight: 800; color: var(--info); margin-left: 6px; text-transform: uppercase; }

/* ---------- Admin ---------- */
.filters { display: grid; gap: 10px; grid-template-columns: 1fr; margin-bottom: 14px; }
@media (min-width: 720px) { .filters { grid-template-columns: 2fr 1fr; } }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.list th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover td { background: var(--surface-alt); }
.admin-cards { display: none; }
@media (max-width: 720px) {
  .table-wrap { display: none; }
  .admin-cards { display: grid; gap: 12px; }
}
.provenance { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 6px; }
.prov-client { background: #eeece6; color: var(--ink-soft); }
.prov-staff { background: var(--info-soft); color: var(--info); }
.admin-layout { display: grid; gap: 16px; }
@media (min-width: 960px) { .admin-layout { grid-template-columns: 1.4fr 1fr; align-items: start; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: .92rem;
  max-width: calc(100% - 32px); transition: opacity .2s, transform .2s; z-index: 50; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-bad { background: var(--bad); }
.toast-ok { background: var(--ink); }

.footer { text-align: center; font-size: .8rem; color: var(--muted); padding: 24px 16px; }
.footer a { color: var(--muted); }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

/* ---------- Pagine legali ---------- */
.legal h2 { margin-top: 1.5rem; }
@media (max-width: 520px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- AML ---------- */
.aml-person { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-alt); padding: 14px 16px; display: grid; gap: 10px; }
.req-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 8px; transition: box-shadow .3s; }
.req-row.flash { box-shadow: 0 0 0 3px var(--accent-bright); }
.req-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.req-title { font-weight: 800; }
.req-msg { font-size: .9rem; color: #6e4100; background: var(--warn-soft); border-radius: 8px; padding: 8px 10px; }
.upload-box { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 12px; background: var(--surface-alt); }
.upload-box input[type=file] { font: inherit; font-size: .85rem; max-width: 100%; }
.flag { display: inline-block; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); margin-right: 6px; }
.flag.warn { background: var(--warn-soft); color: var(--warn); }
.checklist { display: grid; gap: 8px; margin: 10px 0; }
.modal-back { position: fixed; inset: 0; background: rgba(20, 38, 58, .45); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--radius); max-width: 640px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; padding: 20px; box-shadow: var(--shadow); }
.modal textarea { min-height: 260px; font-size: .88rem; }
.kv { display: grid; grid-template-columns: 1fr; gap: 2px 12px; font-size: .88rem; }
@media (min-width: 560px) { .kv { grid-template-columns: 170px 1fr; } }
.kv dt { color: var(--muted); }
.kv dd { margin: 0 0 4px; font-weight: 600; }
.blockers li { margin-bottom: 4px; }
.tabbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.badge.nodot::before { display: none; }
.aml-person, .req-row { grid-template-columns: minmax(0, 1fr); } .upload-box input[type=file] { width: 100%; }
/* ---------- Questionario Due Diligence ---------- */
.dd-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: .85rem; }
.dd-legal { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .92rem; }
.sig-pad { width: 100%; max-width: 600px; aspect-ratio: 3 / 1; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; touch-action: none; cursor: crosshair; }
.step-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-alt); padding: 14px 16px; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.step-card.locked { opacity: .6; }
.step-title { display: flex; align-items: center; gap: 10px; font-weight: 800; }

/* ---------- Ufficio virtuale ---------- */
.office-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .office-layout { grid-template-columns: 250px minmax(0, 1fr); align-items: start; } }
.office-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
@media (min-width: 900px) { .office-nav { flex-direction: column; overflow: visible; position: sticky; top: 76px; } }
.office-tab { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; font: inherit; font-weight: 700; color: var(--ink-soft); cursor: pointer; white-space: nowrap; text-align: left; }
.office-tab[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.office-tab-label { flex: 1; }
.office-count { font-size: .75rem; background: #eeece6; color: var(--ink-soft); border-radius: 999px; padding: 1px 8px; }
.office-tab[aria-current="page"] .office-count { background: rgba(255,255,255,.18); color: #fff; }
.office-count.is-new, .month-count.is-new { background: var(--accent-bright); color: var(--ink); }
.month-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 520px) { .month-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.month-cell { border: 1px solid var(--line); background: var(--surface-alt); border-radius: 10px; padding: 8px 4px; display: grid; gap: 2px; justify-items: center; font: inherit; cursor: pointer; }
.month-cell[aria-pressed="true"] { border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 2px var(--ink) inset; }
.month-cell:disabled { opacity: .35; cursor: default; }
.month-name { font-size: .78rem; font-weight: 800; text-transform: capitalize; }
.month-count { font-size: .75rem; border-radius: 999px; padding: 0 8px; color: var(--muted); }
.drop-zone { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; background: var(--surface-alt); }
.drop-zone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop-inner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.file-list { display: grid; gap: 8px; }
.file-row { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); flex-wrap: wrap; }
.file-icon { width: 40px; height: 40px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: .7rem; font-weight: 800; flex: 0 0 auto; }
.file-main { flex: 1; min-width: 160px; }
.file-name { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left; word-break: break-word; }
.file-name:hover { color: var(--accent); text-decoration: underline; }
.file-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.office-tab-label { min-width: 0; white-space: normal; }
@media (max-width: 899px) {
  .office-nav { align-items: center; }
  .office-nav > p { display: none; }
  .office-tab-label { white-space: nowrap; }
}


/* =====================================================================
   LAYOUT AREA RISERVATA (menu laterale stile app)
   ===================================================================== */
body { font-family: var(--font); }
body.has-shell {
  display: grid; grid-template-columns: 272px minmax(0, 1fr); grid-template-rows: auto auto 1fr auto;
  grid-template-areas: "banner banner" "side top" "side main" "side foot"; min-height: 100vh;
}
body.has-shell #demo-banner { grid-area: banner; }
body.has-shell .sidebar { grid-area: side; }
body.has-shell .topbar { grid-area: top; }
body.has-shell > main { grid-area: main; width: 100%; max-width: 1240px; margin: 0; padding: 8px 40px 64px; }
body.has-shell > footer { grid-area: foot; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 20px; gap: 26px; background: var(--bg); }
.side-brand { padding: 0 10px; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 14px; color: var(--ink);
  text-decoration: none; font-size: 1.05rem; font-weight: 500; border: 0; background: none; font-family: inherit; cursor: pointer; text-align: left; width: 100%; }
.nav-item:hover { background: rgba(255,255,255,.6); }
.nav-item[aria-current="page"] { background: var(--bg-deep); font-weight: 600; }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--amber); }
.nav-icon { position: relative; display: grid; place-items: center; width: 30px; }
.nav-badge { position: absolute; top: -10px; right: -12px; background: #e0352b; color: #fff; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; line-height: 1.4; }
.side-bottom { margin-top: auto; }
.nav-logout { color: var(--muted); font-size: .95rem; }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 22px 40px 6px; background: transparent; border: 0; position: static; }
.topbar-brand, .topbar-logout { display: none; }
.round-btn { width: 58px; height: 58px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--ink); border: 0; cursor: pointer; }
.round-btn:hover { background: var(--surface-alt); }
.topbar .lang-select { background: var(--surface); border-color: var(--line); padding: 8px 10px; }
@media (max-width: 899px) {
  body.has-shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "banner" "top" "main" "foot"; padding-bottom: 76px; }
  body.has-shell > main { padding: 8px 16px 32px; }
  .sidebar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; top: auto; height: auto; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface); box-shadow: 0 -4px 20px rgba(18,36,82,.1); flex-direction: row; gap: 0; }
  .side-brand, .side-bottom { display: none; }
  .side-nav { flex-direction: row; flex: 1; justify-content: space-around; gap: 0; }
  .nav-item { flex-direction: column; gap: 3px; padding: 6px 4px; font-size: .68rem; text-align: center; border-radius: 10px; width: auto; flex: 1; }
  .nav-item[aria-current="page"] { background: var(--bg); }
  .nav-item[aria-current="page"]::before { left: 25%; right: 25%; top: 0; bottom: auto; width: auto; height: 3px; }
  .nav-icon svg { width: 22px; height: 22px; }
  .topbar { justify-content: space-between; padding: 12px 16px; background: var(--bg); position: sticky; top: 0; z-index: 20; }
  .topbar-brand { display: flex; }
  .topbar-brand .brand-name { font-size: 1.05rem; }
  .round-btn { width: 42px; height: 42px; }
  .round-btn svg { width: 20px; height: 20px; }
  .topbar-logout { display: grid; }
}

/* ---------- Home cliente ---------- */
.hero-grid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
@media (min-width: 1100px) { .hero-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr) minmax(240px, .9fr); } }
@media (min-width: 700px) and (max-width: 1099px) { .hero-grid { grid-template-columns: 1fr 1fr; } .hero-welcome { grid-column: 1 / -1; } }
.hero-welcome { overflow-wrap: anywhere; font-family: var(--font-head); font-weight: 800; font-size: clamp(2rem, 3.4vw, 3.1rem); line-height: 1.08; color: var(--ink); margin: 0; align-self: center; letter-spacing: -0.02em; }
.cut { clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 0 100%); }
.company-card { background: var(--surface); border-radius: var(--radius); padding: 28px 30px; display: grid; gap: 10px; align-content: start; box-shadow: var(--shadow); }
.company-name { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.5rem, 2.6vw, 2.05rem); line-height: 1.12; color: var(--amber-title); margin: 0; text-transform: uppercase; }
.company-sub { color: var(--ink); font-size: 1.02rem; }
.company-link { display: inline-flex; align-items: center; gap: 10px; color: var(--amber-title); font-weight: 600; text-decoration: none; }
.company-link:hover { text-decoration: underline; }
.pill-status { justify-self: end; }
.dossier-card { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 28px; display: grid; gap: 12px; justify-items: center; text-align: center; align-content: center; text-decoration: none; min-height: 220px; }
.dossier-card:hover { background: #0e1d44; }
.dossier-title { font-family: var(--font-head); font-weight: 700; font-size: 1.45rem; }
.dossier-sub { font-size: 1rem; color: #dbe3f2; }
.ring { width: 92px; height: 92px; }
.ring text { font-family: var(--font-head); font-weight: 800; fill: #fff; font-size: 15px; }
.company-switch { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.switch-chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; color: var(--ink); text-decoration: none; }
.switch-chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.home-row { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); margin-top: 22px; }
@media (min-width: 900px) { .home-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.panel { background: var(--surface); border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow); display: grid; gap: 14px; align-content: start; }
.panel h2 { font-size: 1.35rem; margin: 0; }
.kicker { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { border-radius: 14px; background: var(--surface-alt); border: 1px solid var(--line); padding: 16px; display: grid; gap: 8px; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--amber); background: #fff; }
.tile-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-deep); color: var(--ink); }
.tile-name { font-weight: 600; font-size: .95rem; }
.tile-meta { font-size: .8rem; color: var(--muted); }
.tile-new { color: var(--ok); font-weight: 700; }
.next-box { display: flex; gap: 14px; align-items: flex-start; background: var(--amber-soft); border-radius: 14px; padding: 16px; }
.next-box .tile-icon { background: var(--amber); }
.apps-list { display: grid; gap: 10px; }
.app-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.app-line:first-child { border-top: 0; }
body.has-shell > main.container-narrow { max-width: 900px; }

.next-box .next-action { border: 0; background: none; padding: 0; font-size: 1rem; }
@media (max-width: 899px) {
  .topbar .header-right { flex-wrap: nowrap; gap: 8px; }
  .topbar .round-btn[href="dashboard.html#account"] { display: none; }
  .app-line { grid-template-columns: minmax(0, 1fr); }
  .app-line > .row { justify-content: flex-start !important; }
}

/* =====================================================================
   MENU RICHIUDIBILE, PASSI PRATICA, PROCEDURA GUIDATA (v6)
   ===================================================================== */
body.has-shell { transition: grid-template-columns .22s ease; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-toggle { width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; transition: transform .22s ease; }
.side-toggle:hover { background: rgba(255,255,255,.7); color: var(--ink); }
@media (min-width: 900px) {
  body.has-shell.side-collapsed { grid-template-columns: 92px minmax(0, 1fr); }
  body.side-collapsed .sidebar { padding: 28px 12px; align-items: center; }
  body.side-collapsed .side-top { flex-direction: column; gap: 14px; }
  body.side-collapsed .side-brand { padding: 0; }
  body.side-collapsed .side-brand .brand-name,
  body.side-collapsed .nav-label { display: none; }
  body.side-collapsed .side-toggle { transform: rotate(180deg); }
  body.side-collapsed .side-nav { width: 100%; align-items: center; }
  body.side-collapsed .nav-item { justify-content: center; padding: 14px 0; width: 58px; }
  body.side-collapsed .nav-item[aria-current="page"]::before { left: -6px; }
  body.side-collapsed > main { max-width: 1400px; }
}
@media (max-width: 899px) { .side-top { display: none; } }
.round-btn.is-active { outline: 3px solid var(--amber); outline-offset: 2px; }

@media (min-width: 1100px) { .hero-grid.hero-2 { grid-template-columns: minmax(0, .8fr) minmax(0, 2fr); } }
@media (min-width: 700px) and (max-width: 1099px) { .hero-grid.hero-2 { grid-template-columns: minmax(0, 1fr); } }

.credas-note { display: flex; gap: 10px; align-items: flex-start; }
.credas-note svg { flex: 0 0 auto; margin-top: 2px; }

/* nome società + tendina LTD / LIMITED / LLP */
.name-suffix { display: flex; gap: 8px; }
.name-suffix input { flex: 1; min-width: 0; }
.name-suffix .suffix-select { width: auto !important; flex: 0 0 auto; font-weight: 700; min-width: 116px; }
.hint-note { color: var(--amber-title); }

/* documenti dentro la scheda persona */
.person-docs { display: grid; gap: 10px; margin-top: 6px; }
.person-docs .req-row { background: var(--surface-alt); }

/* questionario dentro la procedura guidata */
.dd-q-embedded { display: grid; gap: 10px; padding: 18px 0; border-top: 1px solid var(--line); }
.dd-q-embedded:first-of-type { border-top: 0; }
.otp-box { border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface-alt); }

/* i 5 passi della pratica */
.stage-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; counter-reset: st; }
.stage-track li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 0 2px; }
.stage-track li::before { content: ""; position: absolute; top: 16px; left: calc(-50% + 20px); right: calc(50% + 20px); height: 3px; border-radius: 3px; background: var(--line); }
.stage-track li:first-child::before { display: none; }
.stage-track li.st-done::before, .stage-track li.st-current::before { background: var(--teal); }
.st-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .9rem; background: var(--bg-deep); color: var(--muted); position: relative; z-index: 1; }
.st-done .st-dot { background: var(--teal); color: var(--ink); }
.st-current .st-dot { background: var(--amber); color: var(--ink); box-shadow: 0 0 0 5px rgba(239,172,53,.22); }
.stage-track.staff .attention .st-dot { background: #e0352b; color: #fff; box-shadow: 0 0 0 5px rgba(224,53,43,.18); }
.st-text { display: grid; gap: 1px; line-height: 1.25; }
.st-text strong { font-size: .82rem; color: var(--ink); }
.st-text small { font-size: .74rem; color: var(--muted); }
@media (max-width: 640px) {
  .stage-track { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stage-track li { flex-direction: row; text-align: left; gap: 12px; padding: 6px 0; }
  .stage-track li::before { left: 16px; right: auto; width: 3px; height: 14px; top: -7px; }
}
dd, .alert, .req-msg, .next-action { overflow-wrap: anywhere; }

/* ---------- v7: pagina più larga col menu chiuso ---------- */
@media (min-width: 900px) {
  body.side-collapsed > main.container-narrow { max-width: 1180px; }
  body.has-shell > main.container-wide { max-width: 1560px; }
  body.side-collapsed > main.container-wide { max-width: none; }
}

/* ---------- CRM clienti ---------- */
.crm-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.crm-toolbar input[type=search] { max-width: 360px; flex: 1 1 220px; }
.crm-toolbar .btn svg { vertical-align: -3px; }
.crm-cols-panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.crm-cols-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
.crm-card { padding: 0; overflow: hidden; }
.crm-scroll { overflow-x: auto; }
.crm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.crm-table th, .crm-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
.crm-table td.wide, .crm-table th.wide { white-space: normal; min-width: 240px; }
.crm-table thead th { background: var(--surface-alt); font-size: .78rem; color: var(--muted); font-weight: 700; position: sticky; top: 0; }
.crm-table .filter-row th { padding: 6px 8px; background: var(--surface); }
.crm-table .filter-row input, .crm-table .filter-row select { padding: 6px 8px; font-size: .82rem; min-width: 110px; width: 100%; }
.th-sort { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; padding: 0; text-transform: inherit; }
.th-sort:hover, th.sorted .th-sort { color: var(--ink); }
.sort-ind { font-size: .7rem; opacity: .6; }
.crm-table tbody tr.clickable { cursor: pointer; }
.crm-table tbody tr.clickable:hover { background: var(--surface-alt); }
.crm-table .mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.crm-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.crm-name:hover { text-decoration: underline; }
.type-pill { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #e8ebfb; color: var(--blue); }
.type-pill.type-llp { background: #fff1d6; color: var(--amber-title); }
.crm-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.crm-tab { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.crm-tab[aria-selected="true"] { color: var(--ink); border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--amber); }
.crm-section { padding: 0; }
.crm-section > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; cursor: pointer; }
.crm-section > summary::-webkit-details-marker { display: none; }
.crm-section > summary h2 { margin: 0; }
.crm-section .chev { transition: transform .2s; color: var(--muted); }
.crm-section:not([open]) .chev { transform: rotate(-90deg); }
.crm-section-body { padding: 0 24px 22px; display: grid; gap: 14px; }
.field-warn { color: var(--amber-title); font-size: .8rem; }
.field-warn:empty { display: none; }
.crm-savebar { position: sticky; bottom: 12px; z-index: 5; margin-top: 18px; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.crm-savebar > div:first-child { flex: 1; min-width: 0; }
@media (max-width: 899px) { .crm-savebar { bottom: 84px; } .crm-section > summary { padding: 16px; } .crm-section-body { padding: 0 16px 18px; } }

/* ---------- v8: scheda cliente su due colonne, finestrelle filtri ---------- */
.crm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.crm-head-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crm-tabs-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 12px; }
.crm-tabs-row .crm-tabs { margin: 0; }
.crm-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .crm-columns { grid-template-columns: minmax(0, 1fr); } }
.crm-col { display: grid; gap: 12px; align-content: start; }
details.crm-section { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; padding: 0; }
details.crm-section > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; cursor: pointer;
  background: var(--ink); color: #fff; padding: 13px 18px; font-family: var(--font-head); font-weight: 700; font-size: 1rem; }
details.crm-section > summary::-webkit-details-marker { display: none; }
details.crm-section > summary:hover { background: #1b3270; }
details.crm-section .chev { color: #fff; transition: transform .2s; transform: rotate(-90deg); }
details.crm-section[open] .chev { transform: none; }
details.crm-section .crm-section-body { padding: 18px; display: grid; gap: 14px; }
.sub-label { font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 6px; border-top: 1px solid var(--line); padding-top: 14px; }
.stack-tight { display: grid; gap: 10px; }
.repeat-row { display: grid; gap: 4px; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-alt); }
.repeat-row > .link-btn { justify-self: end; }
.contact-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 12px; background: var(--surface-alt); }
.danger-link { color: #c0362c !important; }
.add-btn { border-style: dashed; }
.switch-row { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
input.switch { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 999px; background: #cfd6e2; position: relative; cursor: pointer; flex: 0 0 auto; transition: background .15s; margin: 0; padding: 0; border: 0; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
input.switch:checked { background: #1f9d55; }
input.switch:checked::after { left: 21px; }
input.switch:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.readouts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); background: var(--surface-alt); border-radius: 10px; padding: 12px; }
.readout { font-size: .92rem; }
.due-ok-txt { color: #17803d; } .due-warn-txt { color: var(--warn); } .due-bad-txt { color: #c0362c; }
.svc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); font-size: .92rem; }
.pkg-pill { display: inline-block; font-size: .74rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: #e7f6ee; color: #17803d; text-transform: uppercase; letter-spacing: .04em; }
.pkg-pill.pkg-premium { background: #fff1d6; color: var(--amber-title); }
.pkg-pill.pkg-basic { background: #e8ebfb; color: var(--blue); }
.pw-box { display: grid; gap: 6px; }
.pw-value { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: .95rem; min-width: 120px; }
.due-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.due-chip { display: grid; gap: 1px; background: var(--surface); border-radius: 10px; padding: 8px 12px; box-shadow: var(--shadow); border-left: 4px solid #1f9d55; min-width: 150px; }
.due-chip.due-warn { border-left-color: var(--amber); } .due-chip.due-bad { border-left-color: #c0362c; }
.due-chip .due-label { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.due-chip small { font-size: .74rem; color: var(--muted); }
.crm-table td.due-warn { color: var(--amber-title); font-weight: 700; } .crm-table td.due-bad { color: #c0362c; font-weight: 700; }
/* intestazioni elenco con icona filtro */
.th-in { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.th-filter { border: 0; background: transparent; color: #a0aabb; cursor: pointer; padding: 2px; border-radius: 6px; display: grid; place-items: center; }
.th-filter:hover { color: var(--ink); background: var(--bg); }
.th-filter.on { color: #fff; background: var(--blue); }
.crm-table thead th { white-space: normal; min-width: 110px; vertical-align: bottom; }
.pop { position: absolute; z-index: 60; width: 300px; max-width: calc(100vw - 16px); background: var(--surface); border-radius: 12px; box-shadow: 0 12px 40px rgba(18,36,82,.22); border: 1px solid var(--line); padding: 14px; display: grid; gap: 10px; }
.pop .pop-list { max-height: 300px; overflow: auto; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.pop .pop-list .check { padding: 4px 2px; font-size: .9rem; }
.pop .pop-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pop .pop-search { padding: 8px 10px; }

/* ---------- v9: schede CRM (timeline, task, scadenze), bilancio, area cliente ---------- */
.crm-tab:disabled { opacity: .45; cursor: not-allowed; }
.crm-tab svg { vertical-align: -3px; }
/* timeline a due lati come BrightManager */
.tl-note-box { display: grid; gap: 8px; }
.tl-filters { flex-wrap: wrap; }
.tl-month, .tl-search { width: auto !important; max-width: 220px; }
.tl { list-style: none; margin: 8px 0 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--line); transform: translateX(-1px); }
.tl-item { position: relative; width: 50%; padding: 0 28px 18px 0; box-sizing: border-box; }
.tl-item:nth-child(even) { margin-left: 50%; padding: 0 0 18px 28px; }
.tl-dot { position: absolute; top: 8px; right: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px var(--surface); }
.tl-item:nth-child(even) .tl-dot { right: auto; left: -6px; }
.tl-client .tl-dot { background: var(--teal); }
.tl-note .tl-dot { background: var(--amber); }
.tl-card { display: grid; gap: 4px; }
.tl-title { font-weight: 700; font-family: var(--font-head); color: var(--ink); line-height: 1.3; }
.tl-client .tl-title { color: #128a7f; }
.tl-change { font-size: .9rem; }
.tl-change em { font-style: italic; font-weight: 700; }
.tl-noteText { white-space: pre-wrap; background: #fff7e6; border-radius: 8px; padding: 8px 10px; font-size: .92rem; }
.tl-empty { width: 100%; text-align: center; padding: 18px; background: var(--surface); position: relative; }
.tl-pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-pager select { width: auto !important; }
@media (max-width: 700px) {
  .tl::before { left: 6px; }
  .tl-item, .tl-item:nth-child(even) { width: 100%; margin-left: 0; padding: 0 0 16px 26px; }
  .tl-dot, .tl-item:nth-child(even) .tl-dot { left: 0; right: auto; }
}
/* task */
.tk-form { border: 1px solid var(--line); background: var(--surface-alt); border-radius: 12px; padding: 14px; display: grid; gap: 10px; }
.tk-list { display: grid; gap: 8px; }
.tk-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 150px auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.tk-row.is-done { opacity: .65; }
.tk-row.is-done .tk-title { text-decoration: line-through; }
.tk-title { font-weight: 700; text-align: left; }
.tk-due { display: grid; font-weight: 700; }
.tk-due small { font-weight: 400; color: var(--muted); }
.tk-status { width: auto !important; }
@media (max-width: 700px) { .tk-row { grid-template-columns: minmax(0, 1fr) auto; } .tk-due { grid-column: 1; } }
.pay-total { background: #fff1d6; color: var(--ink); border-radius: 10px; padding: 6px 12px; font-weight: 700; }
.pay-total.big { display: grid; text-align: right; padding: 8px 14px; }
.pay-total.big small { font-weight: 600; color: var(--muted); }
.pay-total.big strong { font-size: 1.3rem; }
.office-frame { width: 100%; min-height: 600px; border: 0; border-radius: var(--radius); background: transparent; display: block; }
body.embed { background: var(--bg); }
body.embed > main { max-width: none; padding: 0; margin: 0; }
body.embed .footer, body.embed #demo-banner { display: none; }
/* bilancio da approvare */
.approval-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; background: var(--surface); }
.approval-box { border: 1px dashed var(--amber); background: #fffaf0; border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
.tile.tile-alert { box-shadow: inset 0 0 0 2px var(--amber); }
.tile.tile-alert .tile-meta { color: var(--warn); font-weight: 700; }
/* home della società costituita */
.todo-list { display: grid; gap: 8px; }
.todo-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; text-decoration: none; color: var(--ink);
  border-radius: 12px; padding: 10px 12px; background: var(--surface-alt); border-left: 4px solid var(--blue); }
.todo-item:hover { background: var(--bg); }
.todo-item.todo-warn { border-left-color: var(--amber); } .todo-item.todo-bad { border-left-color: #c0362c; }
.todo-btn { font-weight: 700; font-size: .85rem; white-space: nowrap; color: var(--blue); }
@media (max-width: 600px) { .todo-item { grid-template-columns: auto minmax(0, 1fr); } .todo-btn { grid-column: 2; } }
.todo-text { display: grid; gap: 1px; min-width: 0; }
.todo-verb { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.todo-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--amber-soft); color: var(--warn); font-size: .75rem; display: inline-grid; place-items: center; letter-spacing: 0; }
.todo-item.todo-done { background: transparent; border-left-color: var(--line); color: var(--muted); }
.todo-item.todo-done .tile-icon { opacity: .55; }
.todo-item.todo-done .todo-verb { color: var(--muted); }
.todo-ok { font-size: .82rem; font-weight: 700; color: var(--ok); white-space: nowrap; }
.todo-allgood { margin: 4px 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.todo-count { white-space: nowrap; }
#home-todo .todo-list { margin-top: 10px; }
@media (max-width: 600px) { .todo-ok { grid-column: 2; } }
.mini-dues { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mini-dues li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-alt); border-left: 4px solid #1f9d55; }
.mini-dues li.due-warn { border-left-color: var(--amber); } .mini-dues li.due-bad { border-left-color: #c0362c; }
.mini-dues small { grid-column: 1 / -1; color: var(--muted); }
.pay-strip { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); background: #fff1d6; border-radius: 10px; padding: 10px 12px; }
.pay-card { display: grid; grid-template-columns: minmax(0, 1.4fr) auto minmax(120px, auto); gap: 6px 16px; align-items: center; border-radius: 12px; padding: 12px 14px;
  background: var(--surface-alt); border-left: 4px solid #1f9d55; }
.pay-card.due-warn { border-left-color: var(--amber); } .pay-card.due-bad { border-left-color: #c0362c; }
.pay-amount { font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; }
.pay-when { display: grid; text-align: right; }
.pay-when small { color: var(--muted); }
.pay-ref { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 600px) { .pay-card { grid-template-columns: minmax(0, 1fr) auto; } .pay-when { grid-column: 1 / -1; text-align: left; } }
.cd-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.cd-date { display: grid; }
.cd-date small { color: var(--muted); }
.cd-row.due-warn .cd-date strong { color: var(--amber-title); } .cd-row.due-bad .cd-date strong { color: #c0362c; } .cd-row.due-ok .cd-date strong { color: #17803d; }

/* ---------- v10: documenti obbligatori, documenti firmati, tributi nelle sezioni, come pagare ---------- */
.req-docs { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface-alt); }
.req-doc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.req-doc-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.req-doc.ok .req-doc-icon { background: #e7f6ee; color: #17803d; }
.req-doc.missing .req-doc-icon { background: #fff1d6; color: var(--amber-title); }
.sg-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 640px) { .sg-row { grid-template-columns: minmax(0, 1fr); } }
.pay-block { display: grid; gap: 8px; }
.pay-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.pay-line.is-paid { color: var(--ink-soft); }
.pay-line code, .pay-ref code, dl.bank code { font-size: .88rem; background: var(--surface-alt); padding: 1px 6px; border-radius: 6px; }
.how-pay { grid-column: 1 / -1; }
.how-pay summary { cursor: pointer; font-weight: 700; color: var(--blue); font-size: .9rem; }
.how-pay-body { display: grid; gap: 8px; margin-top: 8px; }
dl.bank { margin: 0; }
.tl-diff { margin: 0; padding-left: 18px; font-size: .9rem; } .tl-diff em { font-weight: 700; }
.hero-welcome.hero-top { margin: 4px 0 14px; font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
.hero-grid.hero-1 { grid-template-columns: minmax(0, 1fr) !important; }
.hero-grid.hero-1 .company-name { white-space: normal; overflow-wrap: anywhere; }

/* ---------- v11: email automatiche, inviti, spagnolo ---------- */
.modal.modal-wide { max-width: 1100px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.linklike:hover strong { text-decoration: underline; }
.nowrap { white-space: nowrap; }
td.right { text-align: right; }
.em-langs { display: inline-flex; gap: 4px; }
.em-lang { font-size: .7rem; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: #eeece6; color: #a8a49a; }
.em-lang.on { background: var(--info-soft); color: var(--info); }
.em-edit-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .em-edit-grid { grid-template-columns: minmax(0, 1fr); } }
.em-palette { display: grid; gap: 10px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.em-vlist { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.em-var { border: 1px solid var(--line-strong); background: var(--surface-alt); border-radius: 6px; padding: 3px 7px; font: inherit; font-size: .74rem; font-family: ui-monospace, Menlo, Consolas, monospace; cursor: pointer; color: var(--ink); overflow-wrap: anywhere; }
.em-var:hover { border-color: var(--ink); }
.em-preview { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--surface-alt); display: grid; gap: 8px; }
.em-prev-subj { font-weight: 700; overflow-wrap: anywhere; }
.em-prev-body { white-space: pre-wrap; font-size: .9rem; line-height: 1.55; overflow-wrap: anywhere; }
.em-table td { vertical-align: middle; }
.member-box { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tl-email-btn { margin-top: 6px; }
.em-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.em-scroll table.list { min-width: 640px; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; flex: 0 0 auto; }
.hidden-pill { justify-self: start; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #eeece6; color: var(--ink-soft); }
.vis-select { width: auto; min-width: 150px; padding: 6px 30px 6px 10px; font-size: .85rem; }
.rec-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; background: var(--surface); }
.rec-card.rec-client_done { border-color: #bfe3cf; background: #f3fbf6; }
.rec-card.rec-part_received { border-color: #f1c2c2; }
.rec-state { color: var(--ok); font-weight: 600; }
.rec-staff-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.rec-staff-row select { width: auto; min-width: 220px; }
.rec-verify a { font-weight: 700; }
.crm-pane .card { min-width: 0; max-width: 100%; } .crm-pane .table-wrap { overflow-x: auto; max-width: 100%; }
.rec-staff-row, .rec-card { grid-template-columns: minmax(0, 1fr); min-width: 0; } .rec-staff-row select { max-width: 100%; min-width: 0; flex: 1 1 200px; }
.flag-svg { display: inline-block; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); vertical-align: middle; flex: 0 0 auto; }
.lang-pick { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.lang-caret { font-size: .75rem; color: var(--muted); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 70; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px; min-width: 160px; }
.lang-menu[hidden] { display: none; }
.lang-opt { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font: inherit; cursor: pointer; color: var(--ink); text-align: left; }
.lang-opt:hover, .lang-opt[aria-selected="true"] { background: var(--surface-alt); }
.queue-btn { position: relative; }
.round-badge { position: absolute; top: -2px; right: -2px; }
.req-with-pic { display: flex; align-items: center; gap: 12px; min-width: 0; }
.doc-pic { flex: 0 0 auto; }
.cpick { position: relative; }
.cpick-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; padding: 8px; background: var(--surface); cursor: text; }
.cpick-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(239,172,53,.35); }
.cpick-chips { display: contents; }
.cpick-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--ink); color: #fff; border-radius: 999px; padding: 5px 6px 5px 12px; font-weight: 600; font-size: .9rem; }
.cpick-chip button { border: 0; background: rgba(255,255,255,.2); color: #fff; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1; }
.cpick-input { flex: 1 1 160px; border: 0 !important; box-shadow: none !important; padding: 6px 4px !important; min-width: 120px; outline: none; }
.cpick-sug { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px; max-height: 280px; overflow: auto; }
.cpick-sug[hidden] { display: none; }
.cpick-opt { text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font: inherit; cursor: pointer; color: var(--ink); }
.cpick-opt:hover, .cpick-opt.is-first { background: var(--surface-alt); }

/* ---- v13: modelli email come BrightManager ---- */
.em-group { margin-bottom: 12px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.em-group-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border: 0; cursor: pointer;
  background: var(--ink); color: #fff; font: inherit; font-weight: 700; text-align: left; }
.em-group-head:hover { background: #1b3270; }
.em-group-head .chev, .em-acc-head .chev, .em-card-toggle .chev { transition: transform .15s; font-size: 1.1rem; line-height: 1; }
.em-group-head[aria-expanded="false"] .chev, .em-acc-head[aria-expanded="false"] .chev, .em-card-toggle[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.em-group-body { padding: 14px 16px; }
.em-table td { vertical-align: top; }
.em-name { min-width: 180px; max-width: 280px; }
.em-prev-cell { width: 55%; }
.em-prev-text { white-space: pre-line; font-size: .82rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.em-new-menu { right: 0; left: auto; min-width: 230px; z-index: 30; }
.em-edit-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.em-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.em-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface-alt);
  border-bottom: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.em-card-toggle { width: 100%; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; font-weight: 700; text-align: left; }
.em-card-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.em-card-foot { padding: 0 14px 12px; }
.em-body { min-height: 260px; font-family: inherit; line-height: 1.5; }
.em-canned-select { max-width: 220px; }
.em-acc-head { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; margin-top: 6px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); cursor: pointer; font: inherit; font-weight: 700; font-size: .88rem; color: var(--ink); text-align: left; }
.em-acc-body { padding: 8px 4px 4px; display: flex; flex-direction: column; gap: 8px; }
.em-var-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.em-var-label { font-size: .84rem; color: var(--ink-soft); }
.em-var-box { border: 1px solid var(--line-strong); background: var(--surface-alt); border-radius: 6px; padding: 5px 8px; font-size: .74rem; text-align: left;
  font-family: ui-monospace, Menlo, Consolas, monospace; cursor: copy; color: var(--ink); overflow-wrap: anywhere; }
.em-var-box:hover, .em-var-box:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.em-tr-state { display: inline-flex; gap: 4px; }
.em-tr-flag.off { opacity: .3; filter: grayscale(1); }
.em-tr-lang { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.em-flag { display: inline-flex; vertical-align: middle; }
.em-flag-btn { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 900px) {
  .em-edit-layout { grid-template-columns: minmax(0, 1fr); }
  .em-prev-cell { display: none; }
  .em-var-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ---- v14: righe dei modelli che si leggono come una frase ---- */
.em-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.em-list .em-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; align-items: center; padding: 14px 16px; }
.em-list .em-row + .em-row { border-top: 1px solid var(--line); }
.em-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.em-row-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: var(--ink); font-size: .98rem; }
.em-row-client { font-size: .82rem; color: var(--ink-soft); }
.em-row-rule { font-size: .88rem; color: var(--ink-soft); }
.em-row-if { color: var(--ink-soft); }
.em-row-next { font-size: .84rem; color: var(--ink-soft); }
.em-row-next.has-next strong { color: var(--ok); font-weight: 600; }
.em-row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.em-row-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--ink); }
.em-row-actions .btn { min-height: 44px; }
.em-list .em-row.is-off .em-row-title, .em-list .em-row.is-off .em-row-rule { color: var(--muted); }
.em-list .em-row.is-off .em-row-switch span { color: var(--muted); }
@media (max-width: 640px) {
  .em-list .em-row { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .em-row-actions { justify-content: space-between; }
  .em-row-actions .em-edit-btn { margin-left: auto; }
}

/* ---- v14b: intestazioni dei gruppi leggere (il contenuto pesa più del contenitore) ---- */
.em-group { border: 0; background: transparent; border-radius: 0; overflow: visible; margin-bottom: 22px; }
.em-group-head { background: transparent; color: var(--ink); padding: 6px 2px 10px; border-bottom: 2px solid var(--line); border-radius: 0;
  font-family: var(--font-head); font-size: 1.08rem; }
.em-group-head:hover { background: transparent; color: var(--accent); }
.em-group-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.em-group-body { padding: 12px 0 0; }

/* ---- v14c: stato dell'invio ---- */
.em-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; margin: 4px 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.em-status-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.em-status-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; min-width: 0; font-size: .9rem; color: var(--ink-soft); }
.em-status-text strong { color: var(--ink); font-size: 1rem; }
.em-status-demo { font-size: .82rem; color: var(--ink-soft); }
.em-status .btn { min-height: 44px; }
.em-status.is-on { background: var(--ok-soft); border-color: #a9e6df; }
.em-status.is-on .em-status-dot { background: var(--ok); }
.em-status.is-off { background: var(--warn-soft); border-color: #f2d49c; }
.em-status.is-off .em-status-dot { background: var(--warn); }
.em-status.is-paused { background: var(--bad-soft); border-color: #f1c3be; }
.em-status.is-paused .em-status-dot { background: var(--bad); }

/* ---- v14d: riassunto dell'email e barra Salva ---- */
.em-summary { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; margin: 0 0 16px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid #cdd3f3; color: var(--ink-soft); font-size: .9rem; }
.em-summary strong { color: var(--ink); font-size: 1rem; font-weight: 600; line-height: 1.45; }
.em-summary.is-off { background: var(--surface-alt); border-color: var(--line); }
.em-savebar .btn { min-height: 44px; }
#et-dirty { color: var(--warn); font-weight: 600; }
.em-canned-select { max-width: 280px; width: auto; }
@media (max-width: 640px) { .em-canned-select { max-width: 100%; width: 100%; } }

/* ---- v15: Lavori ---- */
.wk-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 4px 0 12px; }
.wk-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.wk-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px 250px; gap: 8px 18px; align-items: center; padding: 12px 16px; }
.wk-row + .wk-row { border-top: 1px solid var(--line); }
.wk-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wk-client { font-weight: 600; color: var(--ink); text-decoration: none; }
.wk-client:hover { text-decoration: underline; }
.wk-what { font-size: .9rem; color: var(--ink-soft); }
.wk-note { font-size: .84rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.wk-due { display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; border-radius: 8px; font-size: .84rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.wk-due strong { color: var(--ink); font-weight: 600; font-size: .9rem; }
.wk-due.is-yellow { background: #fdf6d8; }
.wk-due.is-orange { background: #fde5cc; }
.wk-due.is-orange span { color: #8a4300; }
.wk-due.is-red { background: var(--bad-soft); }
.wk-due.is-red span, .wk-due.is-red strong { color: var(--bad); }
.wk-state select { width: 100%; min-height: 44px; }
.wk-row[data-status="client_done"] .wk-state select, .wk-row[data-status="part_received"] .wk-state select { border-color: var(--amber); }
.wk-empty { padding: 18px 16px; color: var(--ink-soft); }
@media (max-width: 760px) {
  .wk-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .wk-filters input { grid-column: 1 / -1; }
  .wk-row { grid-template-columns: minmax(0, 1fr) auto; padding: 14px; }
  .wk-state { grid-column: 1 / -1; }
}

/* ---- v15b: barra in basso del telefono: «Account» è già nel cerchietto in alto, così le voci entrano tutte ---- */
@media (max-width: 899px) {
  .side-nav .nav-item[data-nav="account"] { display: none; }
  .nav-item { font-size: .7rem; min-width: 0; }
}

/* ---- v16: lettura automatica dei documenti ---- */
.ai-read { color: var(--ink-soft); }
.ai-warn { color: var(--warn); font-weight: 600; }

/* ---- v17: lettera d'incarico ---- */
body.loe-open { overflow: hidden; }
.loe-gate { position: fixed; inset: 0; z-index: 200; background: rgba(18, 36, 82, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.loe-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); width: min(860px, 100%); max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; overflow: hidden; }
.loe-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px 12px; border-bottom: 1px solid var(--line); }
.loe-head h1 { font-size: 1.35rem; margin: 0; }
.loe-letter { flex: 1; overflow: auto; padding: 18px 22px; font-size: .9rem; line-height: 1.6; color: var(--ink); background: var(--surface-alt); }
.loe-letter h3 { font-size: .95rem; margin: 18px 0 6px; color: var(--ink); }
.loe-letter p { margin: 0 0 10px; max-width: 75ch; }
.loe-letter ul { margin: 0 0 10px; padding-left: 20px; max-width: 75ch; }
.loe-letter:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.loe-letter-modal { max-height: 65vh; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.loe-foot { padding: 14px 22px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.loe-foot .btn-primary { min-height: 44px; }
.loe-staff { display: flex; flex-direction: column; gap: 8px; }
.loe-state { margin: 0; font-weight: 600; color: var(--ink); }
.loe-state.is-signed { color: var(--ok); }
@media (max-width: 640px) { .loe-gate { padding: 0; } .loe-box { max-height: 100vh; height: 100%; border-radius: 0; } .loe-head { flex-direction: column; } }

/* ---- v17b: spunte dei servizi ---- */
.svc-ticks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 14px; margin-bottom: 8px; }
.svc-tick { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: .92rem; color: var(--ink); cursor: pointer; }
.svc-tick input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.loe-added { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: .88rem; }
.loe-ta { min-height: 160px; font-size: .86rem; line-height: 1.5; }

/* modifiche alla società (home del cliente) */
.chg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.chg-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; }
.chg-text { white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#chg-text { width: 100%; }
.chg-item.is-waiting { border-color: var(--warn); }
.chg-miss { margin: 4px 0 0; padding-left: 18px; }
.chg-miss li { margin: 2px 0; }
#home-changes .row { flex-wrap: wrap; align-items: center; }
@media (max-width: 600px) { #home-changes .btn-sm { min-height: 44px; } }
/* griglia dell'ufficio virtuale: l'ultimo riquadro dispari occupa tutta la riga */
.tiles > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* editor lettere d'incarico */
.lt-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.lt-jump { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lt-jump a { padding: 6px 0; }
.lt-fallback { color: var(--warn); font-weight: 600; }
.lt-empty-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.lt-empty-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 12px; border-top: 1px solid var(--line); }
.lt-empty-row:first-child { border-top: 0; }
.lt-empty-open { list-style: none; padding: 8px; }
.em-var-box { min-height: 34px; font-size: .8rem; }
@media (min-width: 1000px) { .lt-side { position: sticky; top: 16px; max-height: calc(100vh - 110px); overflow: auto; } }
@media (max-width: 600px) { .em-var-box, #lt-preview, #lt-reset, .lt-empty-row .btn { min-height: 44px; } #lt-back { padding: 10px 0; } }
.loe-letter p, .loe-letter ul { max-width: 68ch; }
.pay-rule-diff { color: var(--warn); font-weight: 600; }
@media (max-width: 600px) { #loe-staff .btn-sm { min-height: 44px; } }
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.em-status.is-failed { background: var(--bad-soft); border-color: #f1c3be; }
.em-status.is-failed .em-status-dot { background: var(--bad); }
.el-error { overflow-wrap: anywhere; max-width: 260px; }

/* ---------- Barra laterale in stile TaxScan (solo schermi grandi) ----------
   pannello bianco con bordo sottile, voci compatte, voce attiva su sfondo blu tenue */
@media (min-width: 900px) {
  body.has-shell { grid-template-columns: 232px minmax(0, 1fr); }
  .sidebar { background: var(--surface); border-right: 1px solid rgba(18,36,82,.08); padding: 22px 14px; gap: 30px; }
  .side-brand { padding: 0 8px; }
  .brand-name { font-size: 1.15rem; }
  .side-nav { gap: 3px; }
  .nav-item { gap: 11px; padding: 9px 12px; border-radius: 9px; font-size: .9rem; font-weight: 600; color: #5d6787; }
  .nav-item:hover { background: #f1f4f9; color: var(--ink); }
  .nav-item[aria-current="page"] { background: #e8ebfa; color: var(--ink); font-weight: 600; }
  .nav-item[aria-current="page"]::before { display: none; }
  .nav-icon { width: 20px; color: rgba(18,36,82,.38); }
  .nav-icon svg { width: 18px; height: 18px; }
  .nav-item:hover .nav-icon { color: var(--ink-soft); }
  .nav-item[aria-current="page"] .nav-icon { color: var(--blue); }
  .nav-item:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
  .nav-badge { top: -7px; right: -9px; font-size: .66rem; padding: 0 6px; }
  .nav-logout { font-size: .85rem; }
  .side-toggle:hover { background: #f1f4f9; }
  body.has-shell.side-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  body.side-collapsed .sidebar { padding: 22px 10px; }
  body.side-collapsed .nav-item { width: 46px; padding: 11px 0; }
}

/* Menu chiuso come in TaxScan: la barra sparisce e resta solo il pulsante ☰ in alto a sinistra */
.side-open { display: none; }
@media (min-width: 900px) {
  body.has-shell.side-collapsed { grid-template-columns: minmax(0, 1fr); grid-template-areas: "banner" "top" "main" "foot"; }
  body.side-collapsed .sidebar { display: none; }
  body.side-collapsed .side-open { display: grid; place-items: center; width: 42px; height: 42px; margin-right: auto; border: 1px solid rgba(18,36,82,.1);
    border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; }
  body.side-collapsed .side-open:hover { background: #f1f4f9; }
  body.side-collapsed .side-open:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
  body.side-collapsed > main { max-width: 1400px; margin: 0 auto; }
}

/* Colonne dell'elenco clienti ridimensionabili trascinando il bordo dell'intestazione */
.crm-table thead th { position: sticky; }
.col-resize { position: absolute; top: 0; right: 0; width: 9px; height: 100%; cursor: col-resize; z-index: 3; touch-action: none; }
.col-resize::after { content: ""; position: absolute; top: 20%; bottom: 20%; left: 4px; width: 2px; border-radius: 2px; background: transparent; }
.crm-table thead th:hover .col-resize::after, .col-resize:focus-visible::after, body.col-resizing .col-resize::after { background: var(--line-strong); }
.col-resize:hover::after, .col-resize:focus-visible::after { background: var(--blue) !important; }
.col-resize:focus-visible { outline: none; }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none; }
.crm-table.sized { table-layout: fixed; }
.crm-table.sized th, .crm-table.sized td { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crm-table.sized td.wide { white-space: nowrap; }

/* Colonne spostabili trascinando l'intestazione */
.crm-table thead th[draggable="true"] { cursor: grab; }
.crm-table thead th.dragging { opacity: .45; }
.crm-table thead th.drop-before { box-shadow: inset 3px 0 0 var(--blue); }
.crm-table thead th.drop-after { box-shadow: inset -3px 0 0 var(--blue); }
/* Prima colonna sempre visibile mentre si scorre a destra */
.crm-table.sized th:first-child, .crm-table.sized td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.crm-table.sized thead th:first-child { z-index: 4; background: var(--surface-alt); }
.crm-table tbody tr.clickable:hover td:first-child { background: var(--surface-alt); }
.crm-scroll.more-left .crm-table td:first-child, .crm-scroll.more-left .crm-table th:first-child { box-shadow: 8px 0 10px -8px rgba(18,36,82,.28); }
/* Frecce per spostarsi tra le colonne, fisse in basso a destra */
.hnav { position: fixed; right: 28px; bottom: 26px; z-index: 25; display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); border: 1px solid rgba(18,36,82,.08); }
.hnav[hidden] { display: none; }
.hnav-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding-bottom: 3px; }
.hnav-btn:hover:not(:disabled) { background: var(--blue); }
.hnav-btn:disabled { background: #e3e7ef; color: #a3abbd; cursor: default; }
.hnav-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 899px) { .hnav { bottom: calc(84px + env(safe-area-inset-bottom)); right: 14px; } }

/* ---------- Spazi ottimizzati: niente barra in alto su schermi grandi ----------
   lingua nel profilo, account/uscita/email in coda nel menu laterale */
.nav-group { display: flex; flex-direction: column; }
.nav-row { position: relative; display: flex; align-items: center; }
.nav-caret { display: none; }
.nav-sub[hidden] { display: none; }
.title-count { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.title-count h1 { margin: 0; }
@media (min-width: 900px) {
  body.has-shell { grid-template-rows: auto auto 1fr auto; }
  .topbar { padding: 0; min-height: 0; }
  .topbar .header-right, .topbar .topbar-brand { display: none; }
  /* menu chiuso: il pulsante ☰ sta a sinistra all'altezza del titolo, senza una riga in più */
  body.side-collapsed .topbar { position: relative; padding: 0; height: 0; z-index: 5; }
  body.side-collapsed .topbar .side-open { position: absolute; top: 22px; left: 18px; }
  /* menu chiuso: la pagina usa tutta la larghezza, il titolo si sposta appena per lasciare posto a ☰ */
  body.has-shell.side-collapsed > main, body.has-shell.side-collapsed > main.container-narrow, body.has-shell.side-collapsed > main.container-wide { max-width: none; margin: 0; padding-left: 18px; padding-right: 18px; }
  body.side-collapsed > main h1 { padding-left: 58px; }
  body.has-shell > main { padding-top: 26px; }
  .nav-row .nav-item { padding-right: 34px; }
  .nav-caret { display: grid; place-items: center; position: absolute; right: 6px; top: 50%; width: 26px; height: 26px; margin-top: -13px;
    border: 0; border-radius: 7px; background: transparent; color: #8a93ad; cursor: pointer; transform: rotate(-90deg); transition: transform .18s ease; }
  .nav-caret:hover { background: rgba(18,36,82,.07); color: var(--ink); }
  .nav-caret[aria-expanded="true"] { transform: none; }
  .nav-caret:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
  .nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px 22px; padding-left: 10px; border-left: 1px solid rgba(18,36,82,.1); }
  .nav-subitem { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; font-size: .84rem; font-weight: 600; color: #5d6787; text-decoration: none; }
  .nav-subitem svg { width: 15px; height: 15px; color: rgba(18,36,82,.38); flex: none; }
  .nav-subitem:hover { background: #f1f4f9; color: var(--ink); }
  .nav-subitem[aria-current="page"] { background: #e8ebfa; color: var(--ink); }
  .nav-subitem[aria-current="page"] svg { color: var(--blue); }
  .head-actions-mobile { display: none; }
  .page-head { margin-bottom: 14px; }
  body.side-collapsed .nav-sub, body.side-collapsed .nav-caret { display: none; }
}
@media (max-width: 899px) {
  .nav-group, .nav-row { display: contents; }
  .nav-sub { display: none !important; }
  .side-nav .nav-item[data-nav="queue"], .side-nav .nav-item[data-nav="help"] { display: none; }
}
.crm-table.sized { min-width: 100%; }
/* trascinare le righe per scorrere la tabella */
.crm-scroll.panning, .crm-scroll.panning * { cursor: grabbing !important; user-select: none; }
.crm-table tbody tr.crm-row:hover { background: var(--surface-alt); }
.crm-table tbody tr.crm-row:hover td:first-child { background: var(--surface-alt); }
.crm-scroll:not(.panning) .crm-table tbody td { cursor: default; }
.crm-table .crm-name { cursor: pointer; }
.crm-table .crm-name:hover { text-decoration: underline; }

/* Fatture lette dal documento (Ufficio virtuale) */
.inv-block { display: grid; gap: 10px; margin: -4px 0 14px 46px; }
.inv-card { border: 1px solid rgba(18,36,82,.12); border-left: 4px solid var(--amber, #f0ad2b); border-radius: 12px; padding: 12px 14px; background: var(--surface); display: grid; gap: 10px; }
.inv-card.is-ok { border-left-color: #1f9d6b; }
.inv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inv-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px 12px; }
.inv-grid > .inv-f { grid-column: span 2; }
.inv-grid > .inv-currency, .inv-grid > .inv-vat { grid-column: span 1; }
.inv-f { display: grid; gap: 4px; min-width: 0; }
.inv-f label { font-size: .76rem; font-weight: 700; color: var(--ink-soft); }
.inv-f input, .inv-f select { width: 100%; min-width: 0; padding: 8px 10px; font-size: .9rem; }
.inv-grid > .inv-counterparty { grid-column: span 4; }
@media (max-width: 760px) { .inv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .inv-grid > .inv-f, .inv-grid > .inv-counterparty { grid-column: span 1; } .inv-grid > .inv-counterparty { grid-column: span 2; } .inv-block { margin-left: 0; } }
.inv-currency select { padding: 8px 4px 8px 8px; font-size: .85rem; }

/* ---------- Soci all'estero: stile essenziale (bianco, bordi leggeri, una cosa per riga) ---------- */
.fx-intro { max-width: 760px; margin: -4px 0 18px; }
.fx-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.fx-form, .fx-out { padding: 24px; border: 1px solid rgba(18,36,82,.08); box-shadow: none; }
.fx-form h2, .fx-out h2 { font-size: 1.15rem; margin: 0 0 16px; }
.fx-form .field { margin-bottom: 16px; }
.fx-label { font-size: .85rem; font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.fx-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-seg-btn { border: 1px solid rgba(18,36,82,.16); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.fx-seg-btn:hover { border-color: var(--blue); }
.fx-seg-btn[aria-checked="true"] { background: #e8ebfa; border-color: var(--blue); color: var(--ink); }
.fx-seg-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.fx-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fx-row2[hidden] { display: none; }
.fx-cap { grid-template-columns: 1.4fr 1fr; gap: 10px; }
.fx-more { margin: 4px 0 16px; border-top: 1px solid rgba(18,36,82,.08); padding-top: 12px; }
.fx-more summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 10px; }
.fx-actions { justify-content: flex-end; gap: 10px; align-items: center; border-top: 1px solid rgba(18,36,82,.08); padding-top: 16px; margin-top: 4px; }
.fx-actions #fx-saved { margin-right: auto; }
.fx-lead { color: var(--ink-soft); margin: -6px 0 14px; }
.fx-table { border: 1px solid rgba(18,36,82,.08); border-radius: 12px; overflow: hidden; }
.fx-kv { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; padding: 11px 14px; border-top: 1px solid rgba(18,36,82,.07); align-items: baseline; }
.fx-kv:first-child { border-top: 0; }
.fx-kv:nth-child(even) { background: #fafbfd; }
.fx-k { font-size: .86rem; color: var(--ink-soft); font-weight: 600; }
.fx-v { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.fx-note { font-weight: 400; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.fx-callout { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #f4f6fb; }
.fx-callout p { margin: 4px 0 0; font-size: .9rem; }
.fx-when { background: #eef8f3; }
.fx-empty { text-align: center; padding: 40px 10px; }
.fx-empty-ico { font-size: 2rem; }
@media (max-width: 980px) { .fx-layout { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .fx-row2, .fx-cap { grid-template-columns: 1fr; } .fx-kv { grid-template-columns: 1fr; gap: 2px; } }
@media print {
  .sidebar, .topbar, .footer, .fx-form, #fx-print, .fx-intro, .side-open { display: none !important; }
  body.has-shell { display: block; }
  .fx-layout { display: block; }
  .fx-out { border: 0; padding: 0; }
}
.fx-form .check-row { display: flex; gap: 10px; align-items: center; margin: 4px 0 14px; font-size: .92rem; }

/* Barra della prossima scadenza (area cliente) */
.next-due { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 0 0 18px; border-radius: 12px; background: var(--surface); border: 1px solid rgba(18,36,82,.1); font-size: .92rem; }
.next-due-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #1f9d6b; }
.next-due.tone-warn { background: #fff8e8; border-color: #f2d48a; } .next-due.tone-warn .next-due-dot { background: #e0a21b; }
.next-due.tone-bad { background: #fdeeee; border-color: #efb4b4; } .next-due.tone-bad .next-due-dot { background: #c73a3a; }
.next-due-txt { flex: 1; min-width: 0; }
.next-due-date { color: var(--ink-soft); }
.next-due-help { margin-top: 4px; color: var(--ink); font-size: .86rem; }
.next-due-link { font-weight: 700; white-space: nowrap; text-decoration: none; color: var(--blue); }
.next-due-link:hover { text-decoration: underline; }
.next-due-x { border: 0; background: transparent; font-size: 1.3rem; line-height: 1; color: var(--ink-soft); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.next-due-x:hover { background: rgba(18,36,82,.07); }
.next-due-x:focus-visible, .next-due-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 640px) { .next-due { flex-wrap: wrap; } .next-due-link { order: 3; margin-left: 22px; } }

/* Corporation Tax: quanto mettere da parte */
.ct-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.ct-box { border: 1px solid rgba(18,36,82,.08); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; background: var(--surface); }
.ct-box small { color: var(--ink-soft); font-weight: 600; font-size: .78rem; }
.ct-box strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.ct-tax { background: #f4f6fb; }
.ct-big { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: #eef8f3; font-weight: 700; font-size: 1.05rem; }
.ct-reserve { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; margin-top: 14px; }
.ct-reserve input { max-width: 180px; }
.ct-gap { font-weight: 700; padding-bottom: 8px; }
.ct-gap.is-miss { color: #b4541a; } .ct-gap.is-ok { color: #1f7a54; }
.ct-bar { height: 8px; border-radius: 99px; background: #e7ebf3; margin-top: 10px; overflow: hidden; }
.ct-bar span { display: block; height: 100%; background: #1f9d6b; border-radius: 99px; }
.ct-empty { display: grid; gap: 12px; margin-top: 12px; }
@media (max-width: 760px) { .ct-grid { grid-template-columns: 1fr 1fr; } }

/* Dividendi: quanto puoi distribuire */
.dv-table { border: 1px solid rgba(18,36,82,.08); border-radius: 12px; overflow: hidden; margin-top: 12px; }
.dv-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-top: 1px solid rgba(18,36,82,.07); font-size: .93rem; }
.dv-row:first-child { border-top: 0; }
.dv-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dv-total { background: #eef8f3; font-weight: 700; font-size: 1.02rem; }
.dv-more { margin-top: 14px; }
.dv-more summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink-soft); }
.dv-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 10px; }
.dv-form .field { margin: 0; }
.dv-form input { max-width: 170px; }
.dv-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.dv-list li { display: flex; gap: 14px; align-items: center; font-size: .9rem; }
.dv-cta { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: #f4f6fb; display: grid; gap: 10px; }

/* ricevute via email */
.inbox-box { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-alt); }
.inbox-box[hidden] { display: none; }
.inbox-ico { font-size: 1.2rem; line-height: 1.6; }
.inbox-main { display: grid; gap: 6px; min-width: 0; }
.inbox-addr { font-size: .95rem; padding: 4px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); word-break: break-all; }
.in-dom { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.in-mx { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-alt); font-size: .8rem; overflow-x: auto; white-space: pre; }
.in-log-row { padding: 4px 0; border-bottom: 1px solid var(--line); }

/* controllo affiancato delle fatture */
body.rv-lock { overflow: hidden; }
.rv-overlay { position: fixed; inset: 0; z-index: 900; background: rgba(18, 36, 82, .45); display: grid; place-items: center; padding: 16px; }
.rv-panel { background: var(--surface); border-radius: 18px; width: min(1240px, 100%); height: min(860px, 100%); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; box-shadow: 0 20px 60px rgba(18, 36, 82, .25); }
.rv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.rv-top strong { word-break: break-all; }
.rv-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); min-height: 0; }
.rv-left { background: var(--bg); min-height: 0; overflow: auto; display: grid; }
.rv-doc { min-height: 0; display: grid; }
.rv-doc iframe { width: 100%; height: 100%; min-height: 520px; border: 0; background: #fff; }
.rv-doc img { max-width: 100%; margin: 16px auto; box-shadow: 0 4px 18px rgba(18, 36, 82, .12); background: #fff; align-self: start; }
.rv-text { margin: 16px; padding: 16px; background: #fff; border-radius: 10px; white-space: pre-wrap; font-size: .85rem; align-self: start; }
.rv-nodoc { margin: 24px; }
.rv-side { overflow: auto; padding: 16px; display: grid; gap: 12px; align-content: start; }
.rv-status { padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: .9rem; }
.rv-status.is-warn { background: var(--amber-soft); color: var(--warn); }
.rv-status.is-ok { background: var(--ok-soft); color: var(--ok); }
.rv-try { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--line-strong); }
@media (max-width: 820px) {
  .rv-overlay { padding: 0; }
  .rv-panel { border-radius: 0; height: 100%; }
  .rv-body { grid-template-columns: 1fr; grid-template-rows: 42vh minmax(0, 1fr); }
  .rv-doc iframe { min-height: 0; }
}
.rv-side .inv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rv-side .inv-grid > .inv-f, .rv-side .inv-grid > .inv-currency, .rv-side .inv-grid > .inv-vat { grid-column: span 1; }
.rv-side .inv-grid > .inv-counterparty { grid-column: span 2; }

/* Scadenze: fascia tasse e scadenze per trimestre */
.tax-band { display: grid; gap: 10px; margin-bottom: 18px; padding: 18px 20px; border-radius: 18px; background: linear-gradient(135deg, var(--accent-soft), var(--bg-deep)); }
.tax-band-main { display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; }
.tax-band-main h2 { margin: 0 12px 0 0; font-size: 2rem; letter-spacing: -.02em; }
.tax-band-kpi { display: grid; gap: 2px; }
.tax-band-kpi small { color: var(--ink-soft); font-weight: 600; }
.tax-band-kpi strong { font-size: 1.5rem; }
.tax-band-status { padding: 9px 12px; border-radius: 12px; font-weight: 700; }
.tax-band-status.is-ok { background: var(--ok-soft); color: var(--ok); }
.tax-band-status.is-warn { background: var(--amber-soft); color: var(--warn); }
.tax-band-status.is-bad { background: var(--bad-soft); color: var(--bad); }
.cd-q { margin: 16px 0 8px; font-size: 1rem; }
.cd-q.is-late { color: var(--bad); }
.cd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cd-card { display: grid; gap: 6px; align-content: start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.cd-chip { justify-self: start; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-alt); color: var(--ink-soft); }
.cd-chip.due-warn { background: var(--amber-soft); color: var(--warn); }
.cd-chip.due-bad { background: var(--bad-soft); color: var(--bad); }
.cd-chip.due-ok { background: var(--ok-soft); color: var(--ok); }
.cd-card-title { font-size: 1rem; }
.cd-amount { font-size: 1.35rem; font-weight: 800; }
.cd-card-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 4px; }
.cd-ours { color: var(--ok); font-weight: 700; } .cd-yours { color: var(--accent); font-weight: 700; }
@media (max-width: 600px) { .tax-band-main h2 { font-size: 1.6rem; width: 100%; } }
@media (max-width: 600px) {
  .next-due { flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; }
  .next-due-dot { margin-top: 6px; }
  .next-due-txt { flex: 1 1 calc(100% - 60px); }
  .next-due-link { order: 5; flex-basis: 100%; padding-left: 20px; }
}

/* soglia IVA */
#cd-vat { display: grid; gap: 10px; }
.vt-nums strong { font-size: 1.6rem; }
.vt-bar { position: relative; height: 14px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--line); overflow: hidden; }
.vt-bar span { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.vt-bar.vt-warn span { background: var(--amber); } .vt-bar.vt-bad span { background: var(--bad); }
.vt-bar i { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(18, 36, 82, .25); }
.vt-msg { padding: 9px 12px; border-radius: 12px; font-weight: 700; }
.vt-msg-ok { background: var(--ok-soft); color: var(--ok); } .vt-msg-warn { background: var(--amber-soft); color: var(--warn); } .vt-msg-bad { background: var(--bad-soft); color: var(--bad); }

/* Il tuo Paese: profilo fiscale UK */
.fx-uk { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--surface-alt); border: 1px solid var(--line); }
.fx-uk h3 { margin: 0; font-size: 1rem; }
.fx-uk-item { display: grid; gap: 6px; }
.fx-uk-sub { padding-left: 26px; }
.fx-uk-sub[hidden] { display: none; }
.fx-uk-docs { margin: 6px 0 0; padding-left: 18px; }

/* logo a parola intera (Ltd24): il nome è già nel logo */
.brand-logo.brand-logo-wide { width: auto; height: 34px; max-width: 150px; }
html[data-logo="wide"] .brand .brand-name { display: none; }
@media (max-width: 900px) { .brand-logo.brand-logo-wide { height: 28px; } }

/* Home cliente: benvenuto più discreto, riquadri con angoli arrotondati */
.hero-welcome.hero-top.hero-small { font-size: clamp(1.1rem, 1.5vw, 1.35rem); font-weight: 700; margin: 0 0 12px; letter-spacing: -0.01em; }
.company-card { border-radius: var(--radius); clip-path: none; }
.company-card .company-name { margin: 0; }
.home-row.home-row-1 { grid-template-columns: minmax(0, 1fr) !important; }

/* finestra di conferma */
.ask-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(18, 36, 82, .5); display: grid; place-items: center; padding: 16px; animation: ask-in .12s ease-out; }
.ask-box { width: min(460px, 100%); background: var(--surface); border-radius: 18px; padding: 22px 22px 18px; box-shadow: 0 24px 60px rgba(18, 36, 82, .3); display: grid; gap: 10px; text-align: center; }
.ask-box h2 { margin: 0; font-size: 1.2rem; }
.ask-box p { margin: 0; color: var(--ink-soft); }
.ask-icon { justify-self: center; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; background: var(--accent-soft); color: var(--accent); }
.ask-box.is-danger .ask-icon { background: var(--bad-soft); color: var(--bad); }
.ask-warn { font-size: .88rem; font-weight: 700; color: var(--bad) !important; }
.ask-box .field { text-align: left; }
.ask-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.ask-actions .btn { min-width: 130px; }
.ask-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }
@keyframes ask-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ask-overlay { animation: none; } }
.ask-actions .btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }

/* Calcolatori */
.calc-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.calc-tab { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.calc-tab:hover { border-color: var(--blue); }
.calc-tab.is-on { background: var(--navy, #122452); border-color: var(--navy, #122452); color: #fff; }
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-money { display: flex; align-items: center; border: 1px solid var(--line-strong, var(--line)); border-radius: 10px; background: var(--surface); }
.calc-money span { padding: 0 4px 0 12px; color: var(--muted); font-weight: 700; }
.calc-money input { border: 0 !important; box-shadow: none !important; flex: 1; min-width: 0; }
.calc-out { display: grid; gap: 8px; }
.calc-big { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--ok-soft); }
.calc-big small { color: var(--ink-soft); font-weight: 600; }
.calc-big strong { font-size: 2rem; letter-spacing: -.02em; color: var(--ok); }
.calc-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.calc-line.is-tax strong { color: var(--bad); }
.calc-line.is-total { border-bottom: 0; font-size: 1.02rem; }
.calc-details summary { cursor: pointer; font-weight: 700; margin-top: 6px; }
.calc-details ul { margin: 6px 0 0; padding-left: 18px; }
.calc-gain { margin: 0; font-weight: 700; color: var(--ok); }
.calc-table-wrap { overflow-x: auto; }
.calc-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.calc-table th, .calc-table td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.calc-table th:first-child, .calc-table td:first-child { text-align: left; }
.calc-table tr.is-best td { background: var(--ok-soft); }
.calc-best { color: var(--ok); font-weight: 700; }
.calc-disclaimer { margin-top: 18px; max-width: 900px; }

.calc-grid-mix { grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); }
.calc-table td strong { white-space: nowrap; }
@media (max-width: 1100px) { .calc-grid-mix { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .calc-table thead { display: none; }
  .calc-table, .calc-table tbody, .calc-table tr, .calc-table td { display: block; width: 100%; }
  .calc-table tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
  .calc-table td { display: flex; justify-content: space-between; gap: 10px; text-align: right; border: 0; padding: 4px 0; }
  .calc-table td::before { content: attr(data-label); color: var(--muted); font-weight: 600; text-align: left; }
  .calc-table td:first-child { display: block; text-align: left; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 4px; }
  .calc-table td:first-child::before { content: none; }
}

/* ===== Ufficio virtuale in stile Dropbox ===== */
.fold-ico { width: 22px; height: 22px; flex: none; color: #4a7dff; }
.fold-ico.is-navy { color: #2f4aa8; } .fold-ico.is-grey { color: #8a94a8; } .fold-ico.is-light { color: #b9c8f5; }
.office-tab { border: 0; background: transparent; border-radius: 10px; padding: 9px 10px; font-weight: 600; }
.office-tab:hover { background: var(--surface-alt); }
.office-tab[aria-current="page"] { background: #e7edff; color: var(--ink); border-color: transparent; }
.office-tab[aria-current="page"] .office-count { background: #fff; color: var(--ink-soft); }
.office-nav { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px; }
.office-main { border-radius: 16px; position: relative; }
.office-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.office-top-left { min-width: 0; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 1.05rem; }
.crumb { border: 0; background: none; padding: 2px 4px; border-radius: 6px; font: inherit; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.crumb:hover { background: var(--surface-alt); color: var(--ink); }
.crumb.is-here { color: var(--ink); font-weight: 800; cursor: default; }
.crumb-sep { color: var(--muted); }
.crumb-year { width: auto; padding: 2px 26px 2px 8px; font-weight: 700; border-radius: 8px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tb-search { width: 220px; max-width: 100%; border-radius: 999px; padding-left: 14px; }
.tb-views { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tb-view { border: 0; background: var(--surface); padding: 7px 11px; cursor: pointer; font-size: 1rem; color: var(--ink-soft); }
.tb-view.is-on { background: #e7edff; color: var(--ink); }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.folder-tile { position: relative; display: grid; justify-items: start; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; text-align: left; font: inherit; }
.folder-tile:hover { border-color: #b9c8f5; background: #f6f8ff; }
.folder-tile .fold-ico { width: 44px; height: 44px; }
.folder-tile.is-empty { opacity: .8; }
.folder-name { font-weight: 700; color: var(--ink); }
.folder-new { position: absolute; top: 10px; right: 10px; font-size: .75rem; font-weight: 700; color: var(--warn); }
.drop-zone.is-slim { padding: 8px 12px; border-width: 1px; }
.drop-inner { gap: 8px; }
.drop-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #e7edff; color: #2f4aa8; font-size: .85rem; }
.office-main.is-dropping { outline: 3px dashed #4a7dff; outline-offset: -6px; }
.drop-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(231, 237, 255, .88); border-radius: 16px; font-weight: 800; font-size: 1.1rem; color: #2f4aa8; pointer-events: none; padding: 20px; text-align: center; }
.file-list { gap: 0; }
.file-head, .file-list:not(.is-grid) > .file-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 150px 90px auto; gap: 12px; align-items: center; }
.file-head { padding: 6px 10px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
.file-list:not(.is-grid) > .file-row { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px; background: transparent; }
.file-list:not(.is-grid) > .file-row:hover { background: #f6f8ff; }
.file-icon { width: 36px; height: 36px; border-radius: 8px; font-size: .62rem; font-weight: 800; letter-spacing: .02em; }
.file-icon.ext-pdf, .file-thumb.ext-pdf { background: #fde8e7; color: #c4362b; }
.file-icon.ext-img, .file-thumb.ext-img { background: #e6f4ea; color: #1e7b3c; }
.file-icon.ext-xls, .file-thumb.ext-xls { background: #e4f3ec; color: #127346; }
.file-icon.ext-doc, .file-thumb.ext-doc { background: #e7edff; color: #2f4aa8; }
.file-col { white-space: nowrap; }
.file-meta-m { display: none; }
.file-list .inv-block { margin: 0 0 6px 52px; }
.file-list.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.file-card { display: grid; gap: 4px; align-content: start; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); min-width: 0; }
.file-card:hover { border-color: #b9c8f5; }
.file-thumb { height: 96px; border: 0; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 1rem; cursor: pointer; background: var(--surface-alt); color: var(--ink-soft); }
.file-card .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.file-card-foot { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.empty-folder { display: grid; justify-items: center; gap: 6px; padding: 28px 10px; }
.empty-folder .fold-ico { width: 56px; height: 56px; }
@media (max-width: 760px) {
  .file-head { display: none; }
  .file-list:not(.is-grid) > .file-row { grid-template-columns: 36px minmax(0, 1fr); }
  .file-list:not(.is-grid) > .file-row .file-col { display: none; }
  .file-list:not(.is-grid) > .file-row .file-actions { grid-column: 2; }
  .file-meta-m { display: inline; }
  .tb-search { width: 100%; flex: 1; }
  .toolbar { width: 100%; }
  .file-list .inv-block { margin-left: 0; }
}

.office-top-left { flex: 1 1 340px; }
.toolbar .tb-search { width: 230px; flex: none; }
.office-tab { font-size: .93rem; }
.btn-icon { min-width: 36px; padding-left: 10px; padding-right: 10px; }
.file-list:not(.is-grid) > .file-row .file-actions { flex-wrap: nowrap; }
@media (max-width: 760px) { .toolbar .tb-search { flex: 1; width: auto; } .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .folder-tile { padding: 12px; } .folder-tile .fold-ico { width: 34px; height: 34px; } }

/* ---------- Documenti societari (studio) ---------- */
.docs-step { margin-bottom: 16px; }
.docs-step h2 { margin: 0; }
.docs-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.docs-tpl { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface, #fff); cursor: pointer; font: inherit; color: inherit; }
.docs-tpl > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.docs-tpl:hover { border-color: var(--accent); }
.docs-tpl.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.docs-tpl.soon { cursor: default; opacity: .6; border-style: dashed; }
.docs-tpl-ic { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; background: var(--accent-soft, #eef4f8); color: var(--accent); }
.docs-holders { display: grid; gap: 6px; }
.docs-hrow { display: grid; grid-template-columns: 1.1fr 1.6fr 90px 40px; gap: 6px; align-items: center; }
.docs-hhead { font-weight: 700; }
.docs-holders > .btn { justify-self: start; }
.docs-total { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft, #eef4f8); }
.docs-res { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; }
.docs-res.on { border-color: var(--accent); }
.docs-save { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; padding: 14px; border-radius: 12px; border: 1px dashed var(--line); }
.docs-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.docs-prev-item { display: grid; gap: 6px; }
.docs-frame { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
@media (max-width: 640px) {
  .docs-hrow { grid-template-columns: 1fr 70px 40px; }
  .docs-hrow > :nth-child(2) { grid-column: 1 / -1; order: 3; }
  .docs-hhead { display: none; }
}

/* ---------- Presenta un amico / recensione ---------- */
@media (min-width: 900px) { .home-row.home-extras { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.ref-box, .review-box { display: grid; gap: 10px; align-content: start; }
.ref-title { margin: 0; font-size: 1.15rem; }
.ref-share { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ref-share .ref-link { flex: 1 1 220px; min-width: 0; font-size: .85rem; background: var(--accent-soft); }
.ref-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ref-stat { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); }
.ref-stat strong { font-size: 1.3rem; }
.review-box { background: linear-gradient(160deg, var(--surface) 60%, #fff7e6); }
.ref-staff { display: grid; gap: 8px; margin-top: 14px; }
.ref-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.ref-row .file-main { display: grid; gap: 2px; }
@media (max-width: 640px) { .ref-row { grid-template-columns: 1fr auto; } .ref-row > .btn { grid-column: 1 / -1; justify-self: start; } }
.rfp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.rfp-stat { background: var(--surface); }
.rfp-warn { border-color: #efd7a9; background: var(--warn-soft); }
.rfp-row { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto auto; }
@media (max-width: 760px) { .rfp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rfp-row { grid-template-columns: 1fr auto; } .rfp-row > :nth-child(2) { grid-column: 1 / -1; } }
.tree-note { display: flex; gap: 12px; align-items: flex-start; margin: 22px 0 0; padding: 14px 16px; border-radius: 14px; background: #e9f7ef; color: #14532d; font-size: .92rem; line-height: 1.5; }
.tree-ic { font-size: 1.3rem; line-height: 1; }

/* ---------- Scelta del Paese (nuova pratica) ---------- */
.jflag { display: inline-flex; width: 30px; height: 20px; flex: 0 0 auto; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.jflag svg { width: 100%; height: 100%; display: block; }
.jur-box { position: relative; background: var(--surface, #fff); border-radius: 20px; padding: 28px; width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: grid; gap: 12px; box-shadow: 0 24px 60px rgba(18,36,82,.25); }
.jur-box h2 { margin: 0; font-size: 1.45rem; }
.jur-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: none; cursor: pointer; font-size: 1rem; color: inherit; }
.jur-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.jur-card { display: grid; gap: 12px; align-content: start; text-align: left; padding: 16px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface, #fff); font: inherit; color: inherit; }
button.jur-card { cursor: pointer; }
button.jur-card:hover, button.jur-card:focus-visible, .jur-multi:hover { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.jur-head { display: flex; gap: 12px; align-items: center; }
.jur-head .jflag { width: 42px; height: 28px; }
.jur-head > span:last-child { display: grid; gap: 1px; }
.jur-type { justify-self: start; font-weight: 800; font-size: .85rem; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft, #eef4f8); color: var(--accent); }
.jur-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.jur-types .btn { display: grid; gap: 2px; justify-items: start; align-content: start; text-align: left; height: auto; padding: 10px 12px; white-space: normal; border-radius: 12px; }
.jur-line { display: flex; align-items: center; gap: 8px; }
.jur-line .jflag { width: 22px; height: 15px; }
@media (max-width: 600px) { .jur-grid { grid-template-columns: 1fr; } .jur-box { padding: 22px 18px; } }
.jur-kind { grid-template-columns: auto 1fr; align-items: center; }
.jur-kind > span:last-child { display: grid; gap: 3px; }
.jur-kind-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; background: var(--accent-soft, #eef4f8); color: var(--accent); }

/* ---------- Illustrazioni (stile Open Peeps, senza marchi) ----------
   Copie leggere con sfondo trasparente in img/illustrazioni/web; dimensioni contenute. */
.ill { display: block; height: auto; user-select: none; pointer-events: none; }
.welcome-row { display: flex; align-items: flex-end; gap: 14px; margin: 0 0 12px; }
.welcome-row .hero-welcome.hero-top.hero-small { margin: 0 0 6px; }
.ill-welcome { width: auto; height: 76px; flex: 0 0 auto; }
@media (max-width: 640px) { .ill-welcome { height: 52px; } .welcome-row { gap: 10px; } }
.company-card.empty-ill { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px 28px; }
.empty-ill-text { display: grid; gap: 10px; align-content: start; }
.ill-empty { width: auto; height: 190px; max-width: 100%; }
@media (max-width: 640px) {
  .company-card.empty-ill { grid-template-columns: 1fr; }
  .ill-empty { height: 130px; justify-self: center; order: 2; }
}

/* pagina di accesso: albero piantato con Play it Green */
.tree-note { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; }
.tree-note .ill-tree { grid-column: 1 / -1; width: 100%; max-width: 300px; margin: 0 auto 6px; }
.tree-title { grid-column: 1 / -1; margin: 0; display: flex; gap: 8px; align-items: center; font-size: 1rem; }
.tree-text { grid-column: 1 / -1; margin: 0; }
@media (max-width: 879px) { .tree-note .ill-tree { display: none; } }
.tree-note[hidden] { display: none; }

/* illustrazioni negli stati vuoti e nelle conferme */
.ill-ok { display: flex; align-items: center; gap: 14px; }
.ill-small { width: auto; height: 92px; flex: 0 0 auto; }
.ill-small.ill-wide { height: 64px; }
.ill-folder { width: auto; height: 120px; }
.jur-kind { grid-template-columns: 1fr; justify-items: start; }
.ill-kind { width: 100%; height: 130px; object-fit: contain; }
@media (max-width: 640px) { .ill-small { height: 64px; } .ill-small.ill-wide { height: 48px; } .ill-folder { height: 90px; } .ill-kind { height: 80px; } }

/* accesso con Google / LinkedIn */
.oauth-box { margin-bottom: 6px; gap: 10px; }
.oauth-btn[hidden] { display: none; }
.oauth-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #fff; }
.oauth-note { margin: 0; text-align: center; }
.oauth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin-top: 4px; }
.oauth-or::before, .oauth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* v29: accesso — testo breve, impegno green in evidenza */
.auth-kicker { margin: 0 0 6px; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.auth-intro h1 { font-size: clamp(1.6rem, 3.2vw, 2.15rem); line-height: 1.15; margin: 0; }
.auth-sub { margin: 10px 0 0; font-size: 1rem; }
.tree-note { display: block !important; margin: 22px 0 0; padding: 0; border-radius: 18px; background: #eaf7e4; color: #1f3d14; overflow: hidden; border: 1px solid #cfe9c3; }
.tree-note[hidden] { display: none !important; }
.tree-note .ill-tree { display: block !important; width: 100%; max-width: none; height: 210px; object-fit: contain; background: #fff; padding: 14px 18px 0; margin: 0; }
.tree-body { padding: 16px 20px 18px; }
.pig-logo { display: block; height: 46px; width: auto; margin: 0 0 10px; }
.tree-title { margin: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.3; color: #1f3d14; }
.tree-text { margin: 6px 0 0; font-size: .95rem; line-height: 1.5; }
.tree-link { display: inline-block; margin-top: 10px; font-weight: 600; color: #3f8f1f; text-decoration: none; }
.tree-link:hover { text-decoration: underline; }
@media (min-width: 880px) { .auth-grid { align-items: start; } .auth-intro { padding-top: 8px; } }
@media (max-width: 879px) {
  .auth-grid { gap: 14px; }
  .auth-intro { display: contents; }
  .auth-intro > * { order: 1; }
  .auth-card { order: 2; }
  .auth-intro > .tree-note { order: 3; margin-top: 8px; }
  .auth-sub { margin-top: 4px; font-size: .92rem; }
  .tree-note .ill-tree { height: 150px; }
  .auth-wrap { place-items: start center; }
}

/* v32: illustrazioni nelle finestre e negli stati */
.ill-ask { display: block; justify-self: center; width: auto; height: 120px; max-width: 70%; object-fit: contain; margin: 0 auto 2px; }
.help-actions { display: grid; gap: 8px; margin-top: 4px; }
.help-actions .btn { width: 100%; }
.ill-check { display: block; width: auto; height: 130px; max-width: 80%; margin: 4px auto 0; object-fit: contain; }
.error-state { max-width: 460px; margin: 40px auto; text-align: center; display: grid; gap: 10px; justify-items: center; }
.error-state h2 { margin: 0; }
.error-state p { margin: 0; }
.ill-error { width: auto; height: 170px; max-width: 90%; object-fit: contain; }
.ill-done { display: block; width: auto; height: 150px; max-width: 80%; object-fit: contain; margin: 0 auto; }
.loe-box.loe-done { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 34px 24px; max-width: 520px; height: auto; }
.loe-box.loe-done h1 { margin: 0; }
.loe-box.loe-done p { margin: 0; }
.sent-ill { display: flex; align-items: center; gap: 14px; }
.ill-sent { width: auto; height: 84px; flex: none; object-fit: contain; }
@media (max-width: 560px) { .ill-ask { height: 96px; } .ill-sent { height: 64px; } .ill-check { height: 104px; } }
.help-box, .ask-box > * { min-width: 0; }
.help-actions .btn { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
