/*
 * app.css · base (303lab) · pannello. Nessun build. Chiaro e scuro automatici.
 * La landing del cliente ha il suo foglio: landing.css.
 */
:root {
  /* palette ispirata a cobrea (wakeup-labs): grigio freddo, card bianche, verde smeraldo come accento */
  --bg: #f6f6f9; --surface: #fff; --surface-2: #fbfbfd; --ink: #111827; --ink-2: #374151; --muted: #6b7280; --faint: #9ca3af; --line: #eeeff3; --line-2: #e2e4ea;
  --accent: #0fa07a; --accent-soft: #e7f6f1; --accent-ink: #fff; --accent-text: #0b7a5d;
  --ok: #16a34a; --ok-bg: #ecfdf5; --err: #dc2626; --err-bg: #fef2f2; --warn: #d97706; --warn-bg: #fff7ed; --hot: #ea580c; --hot-bg: #fff4ec; --info: #2563eb; --info-bg: #eff6ff;
  --c-sent: #c4c8d2; --c-visit: #f59e0b; --c-answer: #0fa07a;
  --radius: 16px; --radius-s: 10px; --pill: 999px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .03);
  --shadow-l: 0 12px 32px rgba(17, 24, 39, .12);
  --font: Roboto, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1014; --surface: #151a20; --surface-2: #12161b; --ink: #f3f4f6; --ink-2: #d1d5db; --muted: #9ca3af; --faint: #6b7280; --line: #232a33; --line-2: #2f3742;
    --accent: #2fc597; --accent-soft: #10302a; --accent-ink: #06261d; --accent-text: #5fdcb3;
    --ok: #4ade80; --ok-bg: #11291b; --err: #f87171; --err-bg: #2f1414; --warn: #fbbf24; --warn-bg: #2b2210; --hot: #fb923c; --hot-bg: #2e1a0e; --info: #93b4ff; --info-bg: #15203a;
    --c-sent: #3f4753; --c-visit: #fbbf24; --c-answer: #2fc597;
    --shadow: none; --shadow-l: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; }
code, .mono { font-family: var(--mono); font-size: .88em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num, .table .num, .kpi__v { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; margin: 0; font-weight: 700; }
.h2 { font-size: 15px; margin: 0 0 14px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.h2 .muted { font-weight: 400; }
.h3 { font-size: 13px; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
p { margin: 0 0 10px; }

/* Struttura */
.app { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.02em; text-decoration: none; font-size: 17px; padding: 6px 8px; margin-right: 6px; white-space: nowrap; }
.brand__dot { width: 22px; height: 22px; border-radius: 7px; background: var(--ink); display: grid; place-items: center; }
.brand__dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bg); box-shadow: 0 0 0 3px var(--ink), 0 0 0 4px var(--bg); }
.nav { display: flex; gap: 2px; }
.nav a, .nav button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s); color: var(--muted); text-decoration: none; font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; background: none; border: 0; cursor: pointer; width: 100%; text-align: left; }
.nav a:hover, .nav button:hover { color: var(--ink); background: var(--bg); }
.nav a.is-on { color: var(--ink); background: var(--bg); font-weight: 600; }
.nav svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .8; }
.nav__count { margin-left: auto; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--pill); background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; }
.side__foot { display: none; }
.main { min-width: 0; padding: 20px clamp(14px, 3vw, 36px) 64px; max-width: 1400px; width: 100%; }
@media (min-width: 960px) {
  .app { grid-template-columns: 228px 1fr; }
  .side { flex-direction: column; align-items: stretch; height: 100vh; border-bottom: 0; border-right: 1px solid var(--line); padding: 18px 12px; overflow: visible; gap: 0; }
  .brand { margin: 0 0 18px; }
  .nav { flex-direction: column; gap: 2px; }
  .side__foot { display: block; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
  .main { padding-top: 28px; }
}
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 10px; border-radius: var(--radius-s); text-decoration: none; color: var(--ink-2); }
.status:hover { background: var(--bg); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0; box-shadow: 0 0 0 3px var(--ok-bg); }
.dot--off { background: var(--err); box-shadow: 0 0 0 3px var(--err-bg); }
.dot--warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }

.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 22px; }
.head__title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.head__acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumb { font-size: 13px; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--ink); }

/* Pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px; border: 1px solid var(--ink); border-radius: var(--radius-s); background: var(--ink); color: var(--bg); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .12s var(--ease), background .15s, border-color .15s; }
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--ink-2); opacity: 1; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn--warn { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.btn--ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn--sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn--icon { width: 38px; padding: 0; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: none; cursor: pointer; font-weight: 500; }
.link:hover { text-decoration: underline; }
.link--muted { color: var(--muted); }
.inline { display: inline; }
form.inline { display: inline-flex; }

/* Superfici */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card__head .h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.split { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr) 380px; } .split--wide { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }
.stack { display: grid; gap: 16px; align-content: start; }

/* KPI */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .kpis { grid-template-columns: repeat(6, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; text-decoration: none; }
a.kpi:hover { border-color: var(--line-2); }
.kpi__l { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi__v { font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.kpi__v small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi__s { font-size: 12px; color: var(--muted); }
.kpi--hot .kpi__v { color: var(--hot); }
.kpi--ok .kpi__v { color: var(--ok); }

/* Segmenti / filtri */
.seg { display: inline-flex; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); gap: 2px; flex-wrap: wrap; }
.seg a { padding: 5px 10px; border-radius: 6px; font-size: 13px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; }
.seg a:hover { color: var(--ink); }
.seg a.is-on { background: var(--ink); color: var(--bg); }
.seg a .c { margin-left: 4px; opacity: .65; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 12px; font-size: 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-on { color: var(--ink); border-color: var(--ink); }
.tabs a .c { display: inline-block; margin-left: 6px; min-width: 20px; padding: 0 6px; border-radius: var(--pill); background: var(--bg); font-size: 12px; text-align: center; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters input, .filters select { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.filters input[type=search] { flex: 1 1 220px; min-width: 0; }

/* Tabelle */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .w-check { width: 36px; padding-right: 0; }
.table input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.lead-cell { display: flex; flex-direction: column; min-width: 180px; }
.lead-cell a { font-weight: 600; text-decoration: none; }
.lead-cell a:hover { text-decoration: underline; }
.lead-cell span { font-size: 12px; color: var(--muted); }
.bulkbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--accent-soft); font-size: 13px; }

/* Etichette */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--pill); font-size: 12px; font-weight: 600; background: var(--bg); color: var(--ink-2); white-space: nowrap; border: 1px solid transparent; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--err { background: var(--err-bg); color: var(--err); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--hot { background: var(--hot-bg); color: var(--hot); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--muted { color: var(--muted); }
.badge--line { background: transparent; border-color: var(--line-2); }
.flag { font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); }

/* Avvisi */
.notice { padding: 11px 14px; border-radius: var(--radius-s); background: var(--warn-bg); color: var(--warn); font-size: 14px; margin: 0 0 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.notice a { font-weight: 600; }
.notice--err { background: var(--err-bg); color: var(--err); }
.notice--ok { background: var(--ok-bg); color: var(--ok); }
.notice--info { background: var(--info-bg); color: var(--info); }
.empty { text-align: center; padding: 44px 16px; color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.empty strong { color: var(--ink); font-size: 15px; }

/* Moduli */
.fields { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .fields { grid-template-columns: 1fr 1fr; } .fields--3 { grid-template-columns: 1fr 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 550; color: var(--ink-2); min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field input, .field select, .field textarea { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; font-weight: 400; }
.field textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.field textarea.tall { min-height: 260px; font-family: var(--mono); font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field small { font-weight: 400; color: var(--muted); font-size: 12px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-s); font-size: 13px; cursor: pointer; }
.checks label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.checks input { accent-color: var(--accent); }
.form-sec { padding: 18px; border-bottom: 1px solid var(--line); }
.form-sec:last-child { border-bottom: 0; }
.form-sec > .h2 { margin-bottom: 4px; }
.form-sec > .muted { margin-bottom: 14px; }
.form-acts { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 18px; background: var(--surface-2); border-top: 1px solid var(--line); }
.secret { font-family: var(--mono); font-size: 12px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--bg); word-break: break-all; display: flex; gap: 8px; align-items: center; justify-content: space-between; }

/* Dati chiave */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.list li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--hot); margin-top: 8px; flex-shrink: 0; }

/* Grafici */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.funnel { display: grid; gap: 10px; }
.funnel__row { display: grid; grid-template-columns: 120px 1fr 64px; gap: 10px; align-items: center; font-size: 13px; }
.funnel__bar { height: 26px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.funnel__bar span { display: block; height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; transition: width .6s var(--ease); }
.funnel__row:last-child .funnel__bar span { background: var(--ok); }
.funnel__n { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.funnel__n small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13px; }
.hbar__t { height: 6px; grid-column: 1 / -1; background: var(--bg); border-radius: 4px; overflow: hidden; }
.hbar__t span { display: block; height: 100%; background: var(--err); opacity: .75; border-radius: 4px; }

/* Cronologia */
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.feed li:last-child { border-bottom: 0; }
.feed__i { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--bg); color: var(--muted); }
.feed__i svg { width: 15px; height: 15px; }
.feed__i--ok { background: var(--ok-bg); color: var(--ok); }
.feed__i--err { background: var(--err-bg); color: var(--err); }
.feed__i--hot { background: var(--hot-bg); color: var(--hot); }
.feed__i--info { background: var(--info-bg); color: var(--info); }
.feed__t { min-width: 0; }
.feed__t a { font-weight: 600; text-decoration: none; }
.feed__t small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.feed__when { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* Mail */
.mail { border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.mail__head { padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 13px; display: grid; gap: 2px; }
.mail__head strong { font-size: 14px; }
.mail__body { padding: 14px; white-space: pre-wrap; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; max-height: 420px; overflow-y: auto; }

/* Flusso (diagramma) */
.flow-top { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.flow-top strong { color: var(--ink); font-weight: 600; }
.flow-top .sep { width: 1px; height: 16px; background: var(--line); }
.canvas { overflow: auto; background-color: var(--surface-2); background-image: radial-gradient(var(--line-2) 1px, transparent 1px); background-size: 20px 20px; padding: 6px; }
.canvas svg { display: block; min-width: 980px; width: 100%; height: auto; }
.fn rect.fn__box { fill: var(--surface); stroke: var(--line-2); stroke-width: 1; transition: stroke .15s; }
.fn:hover rect.fn__box { stroke: var(--ink-2); }
.fn.is-sel rect.fn__box { stroke: var(--accent); stroke-width: 2; }
.fn.is-paused rect.fn__box { fill: var(--warn-bg); stroke: var(--warn); stroke-dasharray: 4 3; }
.fn__title { font: 600 13px var(--font); fill: var(--ink); }
.fn__n { font: 700 24px var(--font); fill: var(--ink); letter-spacing: -.02em; }
.fn__sub { font: 400 11px var(--font); fill: var(--muted); }
.fn__chip { font: 700 10px var(--font); letter-spacing: .05em; }
.fn__bar { fill: var(--line-2); }
.fn--gate .fn__bar { fill: #8b5cf6; }
.fn--mail .fn__bar { fill: var(--accent); }
.fn--wait .fn__bar { fill: var(--c-sent); }
.fn--ok .fn__bar { fill: var(--ok); }
.fn--err .fn__bar { fill: var(--err); }
.fn--info .fn__bar { fill: var(--info); }
.fn--muted .fn__bar { fill: var(--muted); }
.fn.is-paused .fn__bar { fill: var(--warn); }
.edge { fill: none; stroke: var(--line-2); stroke-width: 1.6; }
.edge--live { stroke: var(--accent); stroke-opacity: .55; stroke-dasharray: 6 6; animation: flow 1.2s linear infinite; }
.edge--stop { stroke: var(--warn); stroke-dasharray: 2 5; }
.edge-l { font: 500 11px var(--font); fill: var(--muted); }
.edge-l-bg { fill: var(--surface-2); }
@keyframes flow { to { stroke-dashoffset: -24; } }
.is-stopped .edge--live { animation: none; stroke: var(--line-2); stroke-dasharray: none; }
.node-list { display: grid; gap: 8px; padding: 12px; }
.node-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); text-decoration: none; }
.node-item.is-paused { border-color: var(--warn); background: var(--warn-bg); }
.node-item__n { margin-left: auto; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
@media (min-width: 760px) { .node-list { display: none; } }
.panel { scroll-margin-top: 20px; }
.placeholders { display: flex; flex-wrap: wrap; gap: 4px; }
.placeholders code { padding: 2px 6px; border-radius: 5px; background: var(--bg); font-size: 11.5px; cursor: copy; }
details.disclose { border: 1px solid var(--line); border-radius: var(--radius-s); }
details.disclose > summary { padding: 10px 12px; cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.disclose > summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 18px; }
details.disclose[open] > summary::after { content: "−"; }
details.disclose > div { padding: 0 12px 12px; }
details.disclose + details.disclose { margin-top: 8px; }

/* Lead */
.lead-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.avatar { width: 46px; height: 46px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; font-weight: 750; font-size: 17px; color: var(--ink-2); flex-shrink: 0; border: 1px solid var(--line); }
.linkbox { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--surface); font-family: var(--mono); font-size: 12.5px; max-width: 100%; }
.linkbox span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.price-tag { font-size: 28px; font-weight: 750; letter-spacing: -.03em; }
.price-tag s { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.meter { display: flex; gap: 4px; }
.meter span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.meter span.on { background: var(--accent); }
.progress { display: flex; gap: 0; margin: 4px 0 2px; }
.progress span { flex: 1; font-size: 11px; color: var(--muted); text-align: center; padding-top: 8px; border-top: 3px solid var(--line); }
.progress span.on { border-color: var(--accent); color: var(--ink); font-weight: 600; }
.progress span.ok { border-color: var(--ok); color: var(--ok); font-weight: 600; }
.progress span.err { border-color: var(--err); color: var(--err); font-weight: 600; }

/* Accesso e installazione */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth__box { width: min(100%, 400px); }
.auth__box .brand { justify-content: center; margin-bottom: 20px; font-size: 22px; }

.pager { margin-top: 14px; }



.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 11px 15px; border-radius: var(--radius-s); background: var(--ink); color: var(--bg); font-size: 14px; box-shadow: var(--shadow-l); opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .3s var(--ease); }
.toast.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
/* icone dentro avvisi, titoli ed etichette: sempre piccole */
.notice svg, .h2 svg, .badge svg { width: 16px; height: 16px; flex-shrink: 0; }
.badge svg { width: 12px; height: 12px; }

/* etichette dei lead */
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.tag:hover { background: var(--accent); color: var(--accent-ink); }
/* impaginazione */
.pg { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-size: 14px; }
.pg__btn, .pg__n { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500; font-variant-numeric: tabular-nums; }
.pg__n { padding: 0 8px; }
a.pg__btn:hover, a.pg__n:hover { border-color: var(--ink-2); }
.pg__n.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pg__btn.is-off { opacity: .4; }
.pg__nums { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pg__dots { padding: 0 4px; color: var(--muted); }
.pg__info { width: 100%; text-align: center; color: var(--muted); font-size: 12px; margin-top: 4px; }
/* fasi dei lead: riquadri con il numero grande */
.steps-nav { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.steps-nav::-webkit-scrollbar { display: none; }
.steps-nav a { flex: 1 0 auto; min-width: 112px; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--muted); transition: border-color .15s; }
.steps-nav a:hover { border-color: var(--line-2); color: var(--ink); }
.steps-nav a.is-on { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.steps-nav__n { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.steps-nav__l { font-size: 13px; font-weight: 500; white-space: nowrap; }
.steps-nav__sep { width: 1px; background: var(--line-2); flex-shrink: 0; margin: 6px 2px; }
/* menu a tendina semplice (details) */
.drop { position: relative; }
.drop > summary { list-style: none; cursor: pointer; }
.drop > summary::-webkit-details-marker { display: none; }
.drop__panel { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-l); width: max-content; max-width: min(92vw, 720px); }
.drop__panel--col { flex-direction: column; align-items: flex-start; }
.filters .drop__panel select { min-height: 36px; }
.mini-input { min-height: 32px; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; width: 140px; }
@media (max-width: 640px) { .drop__panel { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; max-width: none; width: auto; } }
/* lead su mobile: fasi in griglia, righe come schede */
@media (max-width: 640px) {
  .steps-nav { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; }
  .steps-nav a { min-width: 0; padding: 10px 12px; }
  .steps-nav__l { white-space: normal; font-size: 12.5px; }
  .steps-nav__sep { display: none; }
  .table--leads thead { display: none; }
  .table--leads, .table--leads tbody { display: block; }
  .table--leads tr { display: grid; grid-template-columns: 36px 1fr auto; gap: 6px 10px; padding: 14px 14px 14px 6px; border-bottom: 1px solid var(--line); align-items: start; }
  .table--leads td { display: block; padding: 0; border: 0; }
  .table--leads td:nth-child(1) { grid-row: 1 / span 2; padding-top: 2px; }
  .table--leads td:nth-child(2) { grid-column: 2 / span 2; }
  .table--leads td:nth-child(3) { grid-column: 2; }
  .table--leads td:nth-child(4) { grid-column: 3; text-align: right; }
  .table--leads .w-check input { width: 22px; height: 22px; }
}
.flag-svg { display: inline-block; margin-right: 3px; vertical-align: -2px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); flex-shrink: 0; }
/* etichette del problema del sito (colori di TaskFlow) e icone dei contatti */
.sev { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; line-height: 1; padding: 4px 8px; border-radius: 99px; white-space: nowrap; color: #fff; background: #8a8a8a; }
.sev-giu { background: #d93025; }
.sev-costruzione { background: #ef6c00; }
.sev-vecchio { background: #1a6fe0; }
.sev-difetti { background: #b7791f; }
.sev-personalizzata { background: #0f8b7d; }
.lead-sum { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.lead-sum > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ci-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; }
.ci { display: inline-grid; place-items: center; width: 28px; height: 24px; border-radius: 7px; border: 1px solid var(--line-2); color: var(--ink); }
.ci-g { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.ci-g small { color: var(--muted); }
/* scheda: pulsanti dei contatti */
.cbtns { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 14px; }
.cbtn { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px; border: 1px solid var(--line-2); border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-size: 12.5px; font-weight: 500; background: var(--surface); transition: border-color .15s, background .15s; }
a.cbtn:hover { border-color: var(--ink); }
.cbtn.is-off { color: var(--muted); opacity: .45; border-style: dashed; }
.grow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-s); color: var(--ink); text-decoration: none; margin-bottom: 14px; }
.grow:hover { border-color: var(--ink); }
.grow__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.grow__t small { color: var(--muted); font-size: 12.5px; }
.kv dd .btn--sm { padding: 3px 6px; vertical-align: middle; margin-left: 4px; }
.reg { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: #efeafc; color: #5b3fc4; font-size: 11px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; text-decoration: none; }
.ci-row .reg { margin-left: auto; }
/* riga del lead */
.lr { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.lr__top { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; }
.lr__name { font-weight: 600; font-size: 14.5px; color: var(--ink); text-decoration: none; min-width: 0; }
.lr__name:hover { text-decoration: underline; }
.lr__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--muted); }
.lr__meta > * + *:not(em)::before { content: "·"; margin-right: 8px; color: var(--line-2); }
.lr__meta .flag-svg { margin-right: 0; }
.lr__meta .flag-svg + *::before { content: none; }
.lr__meta a { color: var(--muted); text-decoration: none; }
.lr__meta a:hover { color: var(--ink); text-decoration: underline; }
.lr__meta em { font-style: normal; font-weight: 500; }
.lr__warn { color: var(--warn); }
.lr__err { color: var(--err); }
.lr__sum { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.lr__sum > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lr .ci-row { margin-top: 1px; }
.lr .reg { flex-shrink: 0; }
.table--leads td { vertical-align: top; padding-top: 16px; padding-bottom: 16px; }
.table--leads .w-check { padding-top: 17px; }
th.lr-st, td.lr-st { width: 230px; }
th.lr-pr, td.lr-pr { width: 160px; }
@media (max-width: 640px) { td.lr-st, td.lr-pr { width: auto; } .lr__sum > span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } }
.lr__name { align-self: flex-start; }
.lr__meta .reg { height: 18px; font-size: 10.5px; padding: 0 6px; }
.lr__meta .reg::before, .lr__meta .reg + *::before { content: none; }
.lr__meta .reg:hover { text-decoration: none; color: #5b3fc4; background: #e4dcfb; }
.lr__meta a.reg { color: #5b3fc4; }
@media (max-width: 640px) { .table--leads td, .table--leads .w-check { padding: 0; } .table--leads tr { gap: 10px 10px; } }

/* ===== tema cobrea: barra laterale a scheda, voce attiva verde, etichette maiuscole ===== */
body { font-size: 14.5px; }
.link, .tag { color: var(--accent-text); }
.tag:hover { color: var(--accent-ink); }
.card, .kpi { box-shadow: none; }
.table th { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.kpi__l, .h3 { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.nav a.is-on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav a.is-on svg { opacity: 1; }
.nav a.is-on .nav__count { background: var(--accent-ink); color: var(--accent-text); }
.nav a:not(.is-on):hover { background: var(--accent-soft); color: var(--accent-text); }
.steps-nav a { border-color: var(--line); }
.steps-nav a.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--surface); }
.steps-nav a.is-on .steps-nav__n { color: var(--accent-text); }
.btn--accent { background: var(--accent); border-color: var(--accent); }
.btn--accent:hover { background: #0b8f6c; border-color: #0b8f6c; opacity: 1; }
.badge--info { background: var(--accent-soft); color: var(--accent-text); }
.bulkbar { background: var(--accent-soft); color: var(--accent-text); }
.field input, .field select, .field textarea, .filters input[type=search], .filters select { border-color: var(--line-2); }
@media (min-width: 960px) {
  .app { grid-template-columns: 252px 1fr; }
  .side { position: sticky; top: 16px; height: calc(100vh - 32px); margin: 16px 0 16px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); box-shadow: var(--shadow); padding: 20px 12px 14px; }
  .brand { padding-bottom: 16px; margin-bottom: 12px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .side__foot { border-top-color: var(--line); }
  .main { padding-left: 32px; }
}
.brand__dot { background: var(--accent); } .brand__dot::after { background: var(--surface-2); box-shadow: 0 0 0 3px var(--accent), 0 0 0 4px var(--surface-2); }
/* lista lead su mobile: scheda ordinata */
@media (max-width: 640px) {
  .table--leads tr:hover td, .table--leads tr:hover { background: transparent; }
  .table--leads tr { grid-template-columns: 30px 1fr auto; padding: 16px 14px 16px 10px; gap: 8px 10px; }
  .table--leads td:nth-child(3), .table--leads td:nth-child(4) { padding-top: 6px; border-top: 1px dashed var(--line); }
  .table--leads td:nth-child(3) { grid-column: 2; }
  .table--leads td:nth-child(4) { grid-column: 3; }
  .lr { gap: 7px; }
  .lr__name { font-size: 15.5px; line-height: 1.3; }
  .lr__meta { gap: 6px; }
  .lr__meta > * + *:not(em)::before { content: none; }
  .lr__meta em { flex-basis: 100%; font-size: 12px; }
  .lr__meta a[target] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .lr__sum { flex-direction: column; align-items: flex-start; gap: 5px; }
  .lr__sum > span { font-size: 13px; line-height: 1.45; }
  .lr-pr .small { font-size: 12px; color: var(--muted); }
}
@media (max-width: 640px) { .lr__meta { gap: 4px 8px; } .lr__meta a[target], .lr__meta > span:last-of-type:not(:first-child) { } .lr__meta a[target] { flex-basis: 100%; } }
/* flusso: partenze, punti di arrivo, lista su mobile */
.fn--entry .fn__bar { fill: var(--faint); }
.fn--end .fn__box { fill: var(--surface-2); }
.node-list__h { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 8px 2px 0; }
.node-list__h:first-child { margin-top: 0; }
.node-item--end { background: var(--surface-2); }
@media (max-width: 759px) { .canvas { display: none; } }
/* mobile: al tocco si evidenzia tutta la scheda, non i singoli blocchi */
@media (max-width: 640px) {
  .table.table--leads tbody tr:hover td { background: transparent; }
  .table.table--leads tbody tr { -webkit-tap-highlight-color: transparent; transition: background .15s; }
  .table.table--leads tbody tr:active { background: var(--surface-2); }
}
@media (hover: none) { .table tbody tr:hover td { background: transparent; } }
/* flusso su mobile: diagramma verticale */
.vf { display: none; padding: 14px 14px 18px; background-color: var(--surface-2); background-image: radial-gradient(var(--line-2) 1px, transparent 1px); background-size: 18px 18px; }
@media (max-width: 759px) { .vf { display: flex; flex-direction: column; align-items: stretch; } .node-list { display: none; } }
.vf__lbl { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0 2px 8px; }
.vf__row { display: grid; gap: 8px; }
.vf__row--3 { grid-template-columns: repeat(3, 1fr); }
.vf__row--2 { grid-template-columns: 1fr 1fr; }
.vf__col { display: flex; flex-direction: column; min-width: 0; }
.vf__n { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 10px 12px 10px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.vf__n::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--c-sent); }
.vf__n--gate::before { background: #8b5cf6; } .vf__n--mail::before { background: var(--accent); } .vf__n--entry::before { background: var(--faint); }
.vf__n--dash { border-style: dashed; }
.vf__n.is-paused { border-color: var(--warn); background: var(--warn-bg); }
.vf__n.is-sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.vf__t { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.vf__t em { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); margin-left: 4px; }
.vf__t em.vf__pause { color: var(--warn); }
.vf__n b { font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.vf__n small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.vf__row--3 .vf__n b { font-size: 18px; }
.vf__arrow { align-self: center; width: 2px; height: 18px; background: var(--line-2); position: relative; margin: 2px 0 6px; }
.vf__arrow::after { content: ""; position: absolute; left: -4px; bottom: -5px; border: 5px solid transparent; border-top-color: var(--line-2); }
.vf__arrow--s { height: 12px; }
.vf__split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0; position: relative; }
.vf__split span { text-align: center; font-size: 11px; color: var(--muted); padding-top: 14px; position: relative; }
.vf__split::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 10px; border: 2px solid var(--line-2); border-bottom: 0; border-radius: 10px 10px 0 0; }
.vf__ends { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vf__end { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); font-size: 12.5px; font-weight: 600; border-left: 3px solid var(--muted); }
.vf__end b { font-size: 17px; font-variant-numeric: tabular-nums; }
.vf__end--ok { border-left-color: var(--ok); } .vf__end--info { border-left-color: var(--info); } .vf__end--err { border-left-color: var(--err); }
