/* Statistics stay scoped to this workspace and the internal call-review dialog. */
.stats-panel { --st-muted:rgba(var(--ink-rgb),.64); --st-teal:#087d6b; }
.tab-panel.stats-panel { padding:0; background:transparent; border:0; box-shadow:none; }
.stats-panel .panel-head { display:grid; grid-template-columns:minmax(0,1fr) 42px; align-items:start; gap:16px; }
:root[data-theme="sombre"] .stats-panel { --st-teal:#65d6b9; }
.stats-panel *, .st-dialog * { letter-spacing:0; }
.st-muted,.st-caption { color:var(--st-muted,rgba(var(--ink-rgb),.64)); }
.st-caption { font-size:12px; line-height:1.6; margin:10px 0 0; }
.st-toolbar { display:flex; flex-wrap:wrap; gap:14px; align-items:end; padding:0 0 20px; border-bottom:1px solid var(--line-strong); }
.st-toolbar label,.st-list-filters label,.st-simulation-fields label { margin:0; font-size:11px; }
.st-toolbar select { min-width:160px; margin-top:5px; }
.st-toolbar #st-range { margin-left:auto; padding:10px 0; font-size:12px; }
.st-custom { display:flex; flex-wrap:wrap; align-items:end; gap:10px; }
.st-custom input { margin-top:5px; }
.stats-panel button.st-refresh { width:42px; height:42px; padding:0; font-size:24px; border-radius:8px; }
.st-status { font-size:13px; color:var(--st-muted); margin:12px 0; min-height:20px; }
.st-status.is-error { color:var(--brand-red); }
.st-notice,.st-quality { padding:12px 16px; border-left:3px solid var(--brand-orange); background:rgba(var(--ink-rgb),.035); font-size:13px; }
.st-quality { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:20px 0 0; }
.st-quality p { margin:0; }
.st-quality button { flex:none; }
.st-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.st-kpi { padding:20px; border:1px solid var(--line); border-radius:8px; background:var(--surface); min-width:0; position:relative; }
.st-kpi::before { content:""; position:absolute; left:20px; top:0; width:30px; height:3px; background:var(--brand-red); }
.st-kpi:nth-child(2)::before { background:#3984c6; }
.st-kpi:nth-child(3)::before { background:var(--st-teal); }
.st-kpi:nth-child(4)::before { background:var(--brand-orange); }
.st-kpi-label { font-size:12px; font-weight:600; color:var(--st-muted); }
.st-kpi-value { font-size:34px; font-weight:800; line-height:1.25; margin:10px 0; font-variant-numeric:tabular-nums; }
.st-kpi-value small { font-size:20px; font-weight:600; }
.st-kpi-detail { font-size:11px; color:var(--st-muted); min-height:17px; }
.st-meta { display:flex; flex-wrap:wrap; gap:8px 24px; padding:15px 0 0; font-size:12px; color:var(--st-muted); }
.st-meta strong { color:var(--ink); }
.st-analysis { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(240px,1fr); gap:32px; }
.st-section { padding:28px 0; border-bottom:1px solid var(--line-strong); min-width:0; }
.st-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:18px; }
.st-heading h3 { margin:0; font-size:17px; font-weight:750; }
.st-heading > .st-muted { font-size:12px; }
.st-heading .st-caption { margin-top:6px; }
.st-legend { display:flex; gap:14px; flex-wrap:wrap; font-size:11px; color:var(--st-muted); }
.st-legend span::before { content:""; display:inline-block; width:8px; height:8px; border-radius:2px; margin-right:6px; background:var(--brand-red); }
.st-legend .st-won-key::before { background:var(--st-teal); }
.st-trend { min-height:200px; overflow-x:auto; }
.st-trend svg { display:block; width:100%; min-width:360px; height:200px; }
.st-chart-grid { stroke:var(--line-strong); stroke-width:1; }
.st-chart-text { fill:var(--st-muted); font:10px var(--font); }
.st-trend svg .st-chart-call { fill:var(--brand-red); }
.st-trend svg .st-chart-won { fill:var(--st-teal); }
.st-stage-row { display:grid; grid-template-columns:1fr auto; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); font-size:13px; }
.st-stage-row:last-child { border-bottom:0; }
.st-stage-row strong { font-variant-numeric:tabular-nums; }
.st-stage-dot { display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:9px; background:var(--st-muted); }
.st-stage-dot.converted { background:var(--st-teal); }
.st-stage-dot.pending { background:var(--brand-orange); }
.st-stage-dot.unknown { background:#3984c6; }
.st-table-wrap { max-width:100%; overflow-x:auto; }
.st-table { width:100%; border-collapse:collapse; font-size:13px; }
.st-table th { text-align:left; padding:12px; background:rgba(var(--ink-rgb),.035); color:var(--st-muted); font-size:11px; font-weight:600; white-space:nowrap; }
.st-table td { padding:14px 12px; border-bottom:1px solid var(--line); vertical-align:middle; }
.st-coaches .st-table td:not(:first-child),.st-coaches .st-table th:not(:first-child) { text-align:right; font-variant-numeric:tabular-nums; }
.st-table strong,.st-table small { display:block; }
.st-table small { color:var(--st-muted); font-size:11px; margin-top:4px; overflow-wrap:anywhere; }
.st-coach-name { display:flex; gap:10px; align-items:center; min-width:140px; }
.st-avatar { display:grid; place-items:center; width:32px; height:32px; flex:none; border-radius:50%; background:rgba(var(--ink-rgb),.06); color:var(--ink); font-size:11px; font-weight:700; }
.st-coaches tr:nth-child(2n) .st-avatar { color:var(--st-teal); background:rgba(15,140,109,.1); }
.st-rate { display:inline-flex; align-items:center; justify-content:end; gap:10px; }
.st-rate-track { width:60px; height:4px; display:block; background:var(--line-strong); border-radius:3px; overflow:hidden; }
.st-rate-track i { display:block; height:100%; background:var(--st-teal); }
.st-tag { display:inline-block; padding:4px 8px; font-size:11px; border-radius:4px; background:rgba(var(--ink-rgb),.055); white-space:nowrap; }
.st-tag.converted { color:var(--st-teal); background:rgba(15,140,109,.1); }
.st-tag.pending { color:var(--ink); border-left:2px solid var(--brand-orange); }
.st-forecast-values { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.st-forecast-values strong { display:block; font-size:28px; font-weight:750; font-variant-numeric:tabular-nums; }
.st-forecast-values span { font-size:12px; color:var(--st-muted); }
.st-forecast-values > div { border-left:2px solid var(--line-strong); padding-left:16px; }
.st-forecast-values > div:last-child { border-left-color:var(--st-teal); }
.st-simulator { margin-top:20px; padding-top:14px; border-top:1px solid var(--line); }
.stats-panel summary { cursor:pointer; font-weight:650; font-size:13px; }
.st-simulation-fields { display:flex; flex-wrap:wrap; gap:16px; align-items:end; padding-top:16px; }
.st-simulation-fields input { margin-top:5px; width:180px; }
.st-simulation-fields output { padding:12px 0; font-weight:700; color:var(--st-teal); }
.st-list-filters { display:flex; align-items:end; gap:14px; margin-bottom:16px; }
.st-list-filters input,.st-list-filters select { margin-top:5px; }
.st-list-filters label:first-child { flex:1; max-width:380px; }
.st-call-table td:first-child { max-width:230px; overflow-wrap:anywhere; }
.st-call-table td:nth-child(2) { white-space:nowrap; }
.st-call-table td:last-child { text-align:right; }
.stats-panel button.ghost { border-radius:8px; }
.st-pagination { display:flex; gap:16px; align-items:center; justify-content:end; margin-top:16px; font-size:12px; color:var(--st-muted); }
.st-pagination button { width:40px; height:40px; padding:0; font-size:18px; }
.stats-panel button:disabled { opacity:.45; cursor:not-allowed; }
.st-profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px 40px; padding-top:14px; }
.st-profile-grid h4 { margin:0 0 16px; font-size:13px; }
.st-profile-bar { margin:12px 0; font-size:12px; }
.st-profile-bar > div { display:flex; justify-content:space-between; gap:12px; margin-bottom:5px; overflow-wrap:anywhere; }
.st-profile-bar > span { display:block; height:5px; background:var(--line); }
.st-profile-bar i { display:block; height:100%; background:#3984c6; }
.st-empty { padding:30px 16px; color:var(--st-muted); font-size:13px; text-align:center; }
.st-definitions dl { font-size:12px; max-width:850px; }
.st-definitions dt { margin-top:14px; font-weight:700; }
.st-definitions dd { margin:5px 0 0; color:var(--st-muted); }
.st-sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.st-dialog { width:min(560px,calc(100vw - 28px)); max-height:calc(100dvh - 32px); overflow:auto; padding:24px; border:1px solid var(--line-strong); border-radius:8px; background:var(--surface); color:var(--ink); box-shadow:0 24px 80px #0004; }
.st-dialog::backdrop { background:rgba(0,0,0,.48); }
.st-dialog .st-dialog-head { display:flex; align-items:start; justify-content:space-between; gap:14px; }
.st-dialog h3 { margin:0; font-size:20px; }
.st-dialog-head button { background:transparent; color:var(--ink); width:40px; height:40px; flex:none; font-size:24px; border-radius:6px; }
.st-dialog .st-dialog-person { margin:8px 0 20px; font-size:13px; overflow-wrap:anywhere; }
.st-dialog label { margin:16px 0 6px; letter-spacing:0; }
.st-dialog select,.st-dialog input { border-radius:6px; }
.st-dialog-actions { display:flex; gap:10px; align-items:center; justify-content:end; margin-top:24px; }
.st-dialog-actions button { min-height:44px; }
.st-dialog-error { color:var(--brand-red); font-size:13px; margin:14px 0 0; }
.st-dialog-history { margin-top:18px; border-top:1px solid var(--line); padding-top:14px; font-size:12px; }
.st-dialog-history summary { cursor:pointer; font-weight:600; }
.st-dialog-history li { margin:10px 0; }
.st-dialog-history ol { padding-left:18px; }
.st-dialog .st-caption { color:rgba(var(--ink-rgb),.64); }
.st-review-booking { margin:8px 0 0 4px; }
.st-call-actions { display:flex; flex-wrap:wrap; justify-content:end; gap:8px; }
.st-insight-filters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; align-items:end; }
.st-insight-filters label { margin:0; font-size:11px; min-width:0; }
.st-insight-filters select { width:100%; margin-top:6px; }
.st-matrix-wrap { margin-top:18px; }
.st-matrix { min-width:550px; }
.st-matrix th:first-child { width:22%; min-width:140px; }
.st-matrix tbody th { background:transparent; border-bottom:1px solid var(--line); white-space:normal; font-size:12px; color:var(--ink); }
.st-matrix td { min-width:175px; font-variant-numeric:tabular-nums; }
.st-matrix td strong { font-size:14px; }
.st-ci { position:relative; width:100%; height:10px; margin-top:10px; background:rgba(var(--ink-rgb),.04); border-radius:2px; }
.st-ci i { display:block; position:absolute; top:3px; height:4px; background:var(--st-teal); opacity:.4; }
.st-ci b { position:absolute; top:0; width:3px; height:10px; background:var(--st-teal); transform:translateX(-50%); }
.st-correlation { display:grid; grid-template-columns:auto minmax(0,1fr); gap:22px; padding-top:20px; align-items:start; font-size:13px; }
.st-correlation-value { font-size:26px; font-weight:750; min-width:65px; font-variant-numeric:tabular-nums; }
.st-acquisition .st-meta { padding:0 0 16px; }
.st-acquisition table { min-width:720px; }
.st-acquisition td { font-variant-numeric:tabular-nums; }
.st-loss-reasons { max-width:600px; }
.st-journey-dialog { width:min(740px,calc(100vw - 28px)); }
.st-contact-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:24px; }
.st-contact-heading h4 { margin:0; font-size:15px; }
.st-contact-row { display:grid; grid-template-columns:minmax(120px,1fr) minmax(100px,1fr) minmax(140px,1.2fr) 36px; align-items:end; gap:8px; padding:10px 0; border-bottom:1px solid var(--line); }
.st-contact-row label { margin:0; min-width:0; font-size:11px; }
.st-contact-row input,.st-contact-row select { width:100%; margin-top:6px; padding:10px 8px; }
.st-contact-row button { height:42px; width:36px; padding:0; font-size:22px; }
.st-dialog .st-check-label { display:flex; align-items:center; gap:10px; font-size:13px; }
.st-dialog .st-check-label input { width:18px; height:18px; flex:none; margin:0; }
.stats-panel :is(button,input,select,summary):focus-visible,.st-dialog :is(button,input,select,summary):focus-visible { outline:2px solid var(--brand-orange); outline-offset:3px; }
@media(max-width:1100px) { .st-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } .st-analysis { grid-template-columns:1fr; gap:0; } }
@media(max-width:600px) {
  .st-contact-heading { align-items:start; flex-direction:column; }
  .st-contact-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr) 36px; }
  .st-contact-row label:nth-child(1) { grid-column:1/3; }
  .st-contact-row label:nth-child(2) { grid-column:1; }
  .st-contact-row button { grid-column:3; grid-row:1/3; align-self:center; }
  .st-insight-filters { grid-template-columns:1fr; gap:12px; }
  .st-call-actions { justify-content:start; }
  .st-correlation { grid-template-columns:1fr; gap:8px; }
  .st-kpis { gap:10px; } .st-kpi { padding:16px 12px; } .st-kpi-value { font-size:28px; } .st-kpi-label { min-height:36px; }
  .st-toolbar { gap:10px; } .st-toolbar > label { flex:1; min-width:120px; } .st-toolbar select { min-width:0; width:100%; }
  .st-toolbar #st-range { margin:0; flex-basis:100%; padding:0; }
  .st-custom { width:100%; order:2; } .st-custom label { flex:1; min-width:110px; } .st-custom input { padding:10px 5px; }
  .st-quality { align-items:start; flex-direction:column; }
  .st-analysis,.st-profile-grid { grid-template-columns:1fr; }
  .st-section { padding:22px 0; } .st-heading { gap:10px; }
  .st-forecast-values { gap:12px; } .st-forecast-values > div { padding-left:10px; } .st-forecast-values strong { font-size:24px; }
  .st-forecast-values span { font-size:11px; }
  .st-simulation-fields { gap:12px; } .st-simulation-fields label { flex:1; min-width:110px; } .st-simulation-fields input { width:100%; }
  .st-list-filters { flex-wrap:wrap; } .st-list-filters label { width:100%; max-width:none!important; }
  .st-call-table thead { display:none; }
  .st-call-table,.st-call-table tbody { display:block; width:100%; }
  .st-call-table tr { display:grid; grid-template-columns:1fr auto; gap:8px; padding:16px 0; border-bottom:1px solid var(--line-strong); }
  .st-call-table td { border:0; padding:0; }
  .st-call-table td:first-child { grid-column:1/-1; max-width:none; }
  .st-call-table td:nth-child(2) { font-size:12px; }
  .st-call-table td:nth-child(3) { grid-column:1/-1; color:var(--st-muted); font-size:12px; }
  .st-call-table td:nth-child(4) { grid-row:2; grid-column:2; }
  .st-call-table td:last-child { grid-column:1/-1; text-align:left; margin-top:5px; }
  .st-call-table td:last-child button { min-height:42px; }
  .st-dialog { padding:20px; }
}
