/* ═══════════════════════════════════════════════════════════════════════
   crm.css — CRM Dashboard and My Leads (index.html, with crm.js).
   Uses the tokens and fx- components from fbc-ui.css. Every chart value is
   also given in text; colour is never the only signal.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Shared ── */
.crm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.crm-muted { color: var(--muted); }
.crm-num { font-variant-numeric: tabular-nums; }
.crm-hint { display: block; margin-top: 4px; font-size: var(--t-xs); color: var(--muted); }
.crm-hint.is-error { color: var(--bad); font-weight: 600; }
.crm-linkbtn { display: inline; padding: 0; border: 0; background: none; font: inherit; color: var(--primary); font-weight: 700; cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.crm-linkbtn:hover { color: var(--primary-hover); }
.crm-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.crm-seg button { min-height: 36px; padding: 0 14px; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: var(--t-sm); font-weight: 700; cursor: pointer; }
.crm-seg button + button { border-left: 1px solid var(--border-strong); }
.crm-seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.crm-seg button:focus-visible { outline-offset: -3px; }
@media (max-width: 860px), (pointer: coarse) { .crm-seg button { min-height: var(--tap); } }
.crm-alert { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r); font-size: var(--t-sm); line-height: 1.45; margin: 0 0 var(--s3); }
.crm-alert--bad { background: var(--bad-bg); color: var(--bad); }
.crm-alert--warn { background: var(--warn-bg); color: var(--warn); }
.crm-alert--ok { background: var(--ok-bg); color: var(--ok); }
.crm-alert--info { background: var(--info-bg); color: var(--info); }
.crm-alert b { font-weight: 800; }
.crm-alert .fx-btn { margin-left: auto; flex: none; }
.crm-empty-sm { padding: var(--s5) var(--s3); text-align: center; font-size: var(--t-sm); color: var(--muted); }

/* ── Dashboard header ── */
.crm-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3) var(--s4); margin-bottom: var(--s4); }
.crm-head h1 { margin: 0; font-size: var(--t-xl); font-weight: 800; line-height: 1.25; }
.crm-head p { margin: 4px 0 0; font-size: var(--t-sm); color: var(--muted); }
.crm-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.crm-updated { font-size: var(--t-xs); color: var(--muted); white-space: nowrap; }
.crm-scope { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; margin-right: 6px; border-radius: var(--r-pill); background: var(--navy); color: #fff; font-size: var(--t-xs); font-weight: 700; }
#crmDashBody[aria-busy="true"] .crm-dash-grid, #crmDashBody[aria-busy="true"] .crm-kpis { opacity: .55; transition: opacity .2s; }

/* ── KPI strip ── */
.crm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.crm-kpi { position: relative; display: flex; flex-direction: column; min-width: 0; padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--sh-1); text-align: left; font: inherit; color: var(--ink); }
.crm-kpi-label { font-size: var(--t-xs); font-weight: 700; color: var(--muted); }
.crm-kpi-value { margin-top: 2px; font-size: var(--t-2xl); font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.crm-kpi-hint { margin-top: 2px; font-size: var(--t-xs); color: var(--muted); line-height: 1.35; }
.crm-kpi--action { cursor: pointer; border-left: 4px solid var(--border-strong); transition: border-color .15s, box-shadow .15s; }
.crm-kpi--action:hover { border-color: var(--primary); box-shadow: var(--sh-2); }
.crm-kpi--action .crm-kpi-go { margin-top: auto; padding-top: 6px; font-size: var(--t-xs); font-weight: 700; color: var(--primary); }
.crm-kpi--warn { border-left-color: var(--warn); }
.crm-kpi--bad { border-left-color: var(--bad); }
.crm-kpi--warn .crm-kpi-value { color: var(--warn); }
.crm-kpi--bad .crm-kpi-value { color: var(--bad); }
.crm-kpi--ok .crm-kpi-value { color: var(--ok); }
@media (max-width: 860px) { .crm-kpis { grid-template-columns: 1fr 1fr; } .crm-kpi-value { font-size: var(--t-xl); } }

/* ── Dashboard grid ── */
.crm-dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s4); align-items: start; }
.crm-dash-grid > .crm-span { grid-column: 1 / -1; }
.crm-dash-grid > .fx-card { min-width: 0; }
@media (max-width: 980px) { .crm-dash-grid { grid-template-columns: minmax(0, 1fr); } }
.crm-card-sub { margin: -6px 0 var(--s3); font-size: var(--t-xs); color: var(--muted); line-height: 1.45; }
.crm-sub-title { margin: var(--s4) 0 var(--s2); font-size: var(--t-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ── Funnel ── */
.crm-funnel { list-style: none; margin: 0; padding: 0; }
.crm-fun-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 96px; align-items: center; gap: var(--s3); padding: 5px 0; font-size: var(--t-sm); }
.crm-fun-label { font-weight: 700; }
.crm-fun-track { display: flex; justify-content: center; height: 22px; }
.crm-fun-bar { display: block; height: 100%; min-width: 3px; border-radius: 4px; }
.crm-fun-val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.crm-fun-val b { font-weight: 800; }
.crm-fun-val span { color: var(--muted); font-size: var(--t-xs); margin-left: 4px; }
.crm-fun-sep { margin: var(--s2) 0 2px; padding-top: var(--s2); border-top: 1px dashed var(--border-strong); font-size: var(--t-xs); font-weight: 700; color: var(--muted); }
.st-new { background: var(--series-1); }
.st-contacted { background: var(--series-2); }
.st-qualified { background: var(--series-3); }
.st-interested { background: var(--series-5); }
.st-converted { background: var(--chart-filled); }
.st-rejected { background: var(--series-4); }
.st-lost { background: var(--series-6); }
@media (max-width: 480px) { .crm-fun-row { grid-template-columns: 78px minmax(0, 1fr) 82px; gap: var(--s2); } }

/* ── Trend (grouped bars) ── */
.crm-legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: 0 0 var(--s3); padding: 0; list-style: none; font-size: var(--t-xs); color: var(--ink-2); }
.crm-legend li { display: inline-flex; align-items: center; gap: 6px; }
.crm-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.crm-swatch--new { background: var(--series-1); }
.crm-swatch--conv { background: var(--chart-filled); }
.crm-trend { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--s2); }
.crm-trend-y { display: flex; flex-direction: column; justify-content: space-between; height: 180px; font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.crm-trend-plot { position: relative; height: 180px; border-bottom: 1px solid var(--border-strong); background-image: linear-gradient(var(--border) 1px, transparent 1px); background-size: 100% 50%; background-position: 0 0; }
.crm-trend-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.crm-trend-plot .b-new { fill: var(--series-1); }
.crm-trend-plot .b-conv { fill: var(--chart-filled); }
.crm-trend-plot .hit { fill: transparent; }
.crm-trend-plot .hit:hover { fill: rgba(21,101,192,.08); }
.crm-trend-x { grid-column: 2; display: flex; justify-content: space-between; gap: var(--s2); margin-top: 4px; font-size: 11px; color: var(--muted); }
.crm-trend-x span:nth-child(2) { text-align: center; }
.crm-trend-x span:last-child { text-align: right; }
.crm-trend-total { margin: var(--s3) 0 0; font-size: var(--t-sm); color: var(--ink-2); }
.crm-details { margin-top: var(--s3); }
.crm-details summary { cursor: pointer; font-size: var(--t-sm); font-weight: 700; color: var(--primary); min-height: 32px; display: inline-flex; align-items: center; }
.crm-details[open] summary { margin-bottom: var(--s2); }
.crm-scroll { max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r); }

/* ── Ranked bars ── */
.crm-bars { list-style: none; margin: 0; padding: 0; }
.crm-bars li { padding: 6px 0; }
.crm-bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); font-size: var(--t-sm); margin-bottom: 4px; }
.crm-bar-name { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.crm-bar-name.is-missing { font-weight: 600; font-style: italic; color: var(--muted); }
.crm-bar-val { flex: none; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: var(--t-xs); }
.crm-bar-val b { font-size: var(--t-sm); color: var(--ink); }
.crm-bar-track { height: 8px; border-radius: var(--r-pill); background: var(--chart-track); overflow: hidden; }
.crm-bar-fill { display: flex; height: 100%; border-radius: inherit; background: var(--series-2); overflow: hidden; }
.crm-bar-fill > span { display: block; height: 100%; background: var(--chart-filled); box-shadow: inset -2px 0 0 var(--surface); }
.crm-bars--lost .crm-bar-fill { background: var(--series-4); }
.crm-bars button.crm-bar-row { display: block; width: 100%; padding: 6px var(--s2); margin: 0 calc(-1 * var(--s2)); width: calc(100% + 2 * var(--s2)); border: 0; border-radius: var(--r-sm); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.crm-bars button.crm-bar-row:hover { background: var(--surface-2); }
.crm-bars button.crm-bar-row .crm-bar-name { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.crm-bars li:has(> button.crm-bar-row) { padding: 0; }
.crm-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s5); }
@media (max-width: 640px) { .crm-two { grid-template-columns: minmax(0, 1fr); } }

/* ── Response ── */
.crm-resp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.crm-resp-tile { padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.crm-resp-tile .v { margin-top: 2px; font-size: var(--t-xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.crm-resp-tile .v.is-none { font-size: var(--t-md); font-weight: 700; color: var(--muted); }
.crm-resp-tile .l { font-size: var(--t-xs); font-weight: 700; color: var(--muted); }
.crm-resp-tile .h { margin-top: 2px; font-size: var(--t-xs); color: var(--muted); line-height: 1.4; }
.crm-resp-tile .fx-bar { margin-top: 8px; }
@media (max-width: 420px) { .crm-resp { grid-template-columns: minmax(0, 1fr); } }

/* ── Area ── */
.crm-area-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); margin-bottom: var(--s3); }
.crm-area-where { font-size: var(--t-sm); font-weight: 700; }
.crm-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: var(--s2); }

/* ── Team table ── */
.crm-team-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); margin-bottom: var(--s3); }
.crm-team-tools label { font-size: var(--t-xs); font-weight: 700; color: var(--muted); margin-right: 6px; }
.crm-select, .crm-input, .crm-textarea { min-height: 36px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-sm); max-width: 100%; }
.crm-textarea { width: 100%; min-height: 64px; resize: vertical; line-height: 1.45; }
.crm-input { width: 100%; }
.crm-select:focus-visible, .crm-input:focus-visible, .crm-textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.crm-input[aria-invalid="true"] { border-color: var(--bad); }
@media (max-width: 860px), (pointer: coarse) { .crm-select, .crm-input { min-height: var(--tap); font-size: 16px; } .crm-textarea { font-size: 16px; } }
.crm-team th button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.crm-team th button:hover { color: var(--ink); }
.crm-team th.num button { flex-direction: row-reverse; }
.crm-team th .arr { display: inline-block; width: 10px; font-size: 10px; }
.crm-team td.seat { font-weight: 700; white-space: nowrap; }
.crm-team .crm-zero { color: var(--muted); }
.crm-team .crm-flag { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.crm-team .crm-flag--bad { color: var(--bad); }
.crm-team .crm-flag--warn { color: var(--warn); }
.crm-team-note { margin: var(--s2) 0 0; font-size: var(--t-xs); color: var(--muted); }
/* Phones: each row is a compact card: seat code across the top, the figures
   in two columns with their labels above them. */
@media (max-width: 640px) {
  .crm-compact tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px var(--s3); padding: var(--s3); }
  .crm-compact td { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0; padding: 0; text-align: left; overflow-wrap: anywhere; }
  .crm-compact td::before { font-size: 11px; }
  .crm-compact td.num { text-align: left; }
  .crm-compact td.crm-wide { grid-column: 1 / -1; }
  .crm-team td.seat { white-space: normal; font-size: var(--t-md); }
}

/* ── My Leads: filter bar ── */
.crm-filters { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s3); align-items: end; padding: var(--s4); margin-bottom: var(--s3); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
.crm-filters label.crm-flabel, .crm-field > label { display: block; margin-bottom: 4px; font-size: var(--t-xs); font-weight: 700; color: var(--muted); }
.crm-filters .crm-select, .crm-filters .crm-input { width: 100%; }
.crm-f-search { grid-row: span 1; }
.crm-f-checks { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; min-height: 36px; grid-column: 1 / -1; }
.crm-check { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-size: var(--t-sm); font-weight: 600; cursor: pointer; }
.crm-check input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.crm-check span { color: var(--muted); font-weight: 400; }
.crm-f-checks .fx-btn { margin-left: auto; }
@media (max-width: 860px) { .crm-filters { grid-template-columns: 1fr 1fr; padding: var(--s3); } .crm-f-search { grid-column: 1 / -1; } .crm-check { min-height: var(--tap); } }
@media (max-width: 420px) { .crm-filters { grid-template-columns: minmax(0, 1fr); } }
.crm-results { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s2); margin: 0 0 var(--s3); font-size: var(--t-sm); color: var(--ink-2); min-height: 20px; }
.crm-results b { font-weight: 800; }

/* ── My Leads: cards ── */
.crm-leads { list-style: none; margin: 0; padding: 0; }
.crm-lead { margin-bottom: var(--s3); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
.crm-lead.is-open { border-color: var(--border-strong); box-shadow: var(--sh-2); }
.crm-lead.is-overdue { border-left: 4px solid var(--bad); }
.crm-lead-top { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4) 0; }
.crm-lead-toggle { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s2); min-height: 36px; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.crm-lead-toggle .nm { font-size: var(--t-md); font-weight: 800; overflow-wrap: anywhere; }
.crm-lead-toggle .chev { margin-left: auto; color: var(--muted); font-size: 18px; transition: transform .15s; }
.crm-lead-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.crm-lead-toggle:hover .nm { color: var(--primary); }
.crm-lead-body { padding: var(--s2) var(--s4) var(--s3); }
.crm-lead-line { display: flex; flex-wrap: wrap; gap: 4px var(--s3); font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; }
.crm-lead-line + .crm-lead-line { margin-top: 2px; }
.crm-lead-line .k { color: var(--muted); }
.crm-tel { font-weight: 700; color: var(--primary); text-decoration: none; white-space: nowrap; }
.crm-tel:hover { text-decoration: underline; }
.crm-alt-tag { margin-left: 4px; font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
@media (max-width: 860px), (pointer: coarse) { .crm-tel { display: inline-flex; align-items: center; min-height: 32px; } }
.crm-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.crm-stage { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 800; background: var(--neu-bg); color: var(--neu); }
.crm-stage::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.crm-stage--new { background: var(--info-bg); color: var(--info); }
.crm-stage--contacted { background: #E6F4F8; color: #0E6A80; }
.crm-stage--qualified, .crm-stage--interested { background: #F1E9FD; color: #5B21B6; }
.crm-stage--converted { background: var(--ok-bg); color: var(--ok); }
.crm-stage--rejected, .crm-stage--lost { background: var(--bad-bg); color: var(--bad); }
.crm-stage--rejected::before, .crm-stage--lost::before { border-radius: 1px; transform: rotate(45deg); }
.crm-stage--converted::before { content: '✓'; width: auto; height: auto; background: none; font-size: 11px; }
.crm-lead-closed { margin-top: 6px; font-size: var(--t-sm); color: var(--bad); }

.crm-lead-detail { border-top: 1px solid var(--border); padding: var(--s3) var(--s4) var(--s4); }
.crm-block { margin-top: var(--s4); }
.crm-block:first-child { margin-top: 0; }
.crm-block-title { margin: 0 0 var(--s2); font-size: var(--t-xs); font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.crm-enq { font-size: var(--t-sm); line-height: 1.35; } .crm-enq .k { color: var(--muted); }
.crm-enq .crm-block-title { margin-bottom: var(--s1); }
.crm-enq-text { color: var(--ink); font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.crm-enq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); column-gap: var(--s4); }
.crm-enq-msg + .crm-enq-grid { margin-top: 2px; }

/* ── Opened card: compact rows. Every control 44px high, typed text 16px. ── */
.crm-lead-detail .crm-block { margin-top: 10px; }
.crm-lead-detail .fx-btn { padding: 0 var(--s3); }
.crm-lead-detail .crm-block:first-child, .crm-lead-detail .crm-card-msg + .crm-block { margin-top: 0; }
.crm-lead-detail .fx-btn, .crm-lead-detail .crm-stage-btn, .crm-lead-detail .crm-input, .crm-lead-detail .crm-select { min-height: var(--tap); }
.crm-lead-detail .crm-input, .crm-lead-detail .crm-select, .crm-lead-detail .crm-textarea { font-size: 16px; }
.crm-lead-detail .crm-stage-btn { padding: 0 10px; }
.crm-quick { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5); }
.crm-inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); min-width: 0; max-width: 100%; }
.crm-inline--grow { flex: 1 1 320px; }
.crm-inline-label { font-size: var(--t-xs); font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.crm-fu-input { width: auto; flex: 0 1 230px; min-width: 0; }
.crm-inline--grow .crm-select { flex: 1 1 180px; min-width: 0; max-width: 360px; }
.crm-edit-toggle { min-height: var(--tap); display: inline-flex; align-items: center; font-size: var(--t-sm); }
.crm-alt-input { width: auto; flex: 0 1 200px; min-width: 0; }
.crm-note-row { display: flex; align-items: flex-start; gap: var(--s2); }
.crm-note-field { flex: 1 1 auto; min-width: 0; }
.crm-note-row .crm-textarea { min-height: var(--tap); line-height: 1.35; }
.crm-note-row .fx-btn { flex: none; }
/* Phone: follow-up label on top, then [date-time | Set | Clear] on one line. */
@media (max-width: 520px) {
  .crm-fu { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 2px; width: 100%; }
  .crm-fu .crm-inline-label { grid-column: 1 / -1; }
  .crm-fu .crm-fu-input { width: 100%; }
}
@media (max-width: 359px) { .crm-fu { grid-template-columns: auto auto 1fr; } .crm-fu .crm-fu-input { grid-column: 1 / -1; } }
.crm-stages { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-stage-btn { min-height: 34px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-xs); font-weight: 700; cursor: pointer; }
.crm-stage-btn:hover { border-color: var(--primary); }
.crm-stage-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; cursor: default; }
.crm-stage-btn[aria-pressed="true"]::before { content: '● '; }
@media (max-width: 860px), (pointer: coarse) { .crm-stage-btn { min-height: var(--tap); } }
.crm-subform { margin-top: var(--s3); padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.crm-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s2); }
.crm-row > .crm-field { flex: 1 1 200px; min-width: 0; }
.crm-field + .crm-field { margin-top: 0; }
.crm-stack > * + * { margin-top: var(--s2); }
.crm-counter { font-size: var(--t-xs); color: var(--muted); text-align: right; margin-top: 2px; }
.crm-card-msg:empty { display: none; }
.crm-card-msg { margin-bottom: var(--s3); }
.crm-lead[aria-busy="true"] .crm-lead-detail { opacity: .6; pointer-events: none; }

/* ── Notes timeline ── */
.crm-timeline { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.crm-timeline li { position: relative; padding: 0 0 var(--s3) 22px; font-size: var(--t-sm); line-height: 1.45; }
.crm-timeline li::before { content: ''; position: absolute; left: 5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.crm-timeline li::after { content: ''; position: absolute; left: 10px; top: 18px; bottom: 0; width: 1px; background: var(--border); }
.crm-timeline li:last-child::after { display: none; }
.crm-timeline li.k-status_change::before { border-color: var(--primary); }
.crm-timeline li.k-assignment::before { border-color: var(--series-5); }
.crm-timeline li.k-follow_up::before { border-color: var(--warn); }
.crm-timeline li.k-created::before { border-color: var(--accent); background: var(--accent); }
.crm-tl-kind { font-weight: 800; }
.crm-tl-meta { font-size: var(--t-xs); color: var(--muted); }
.crm-tl-text { color: var(--ink-2); overflow-wrap: anywhere; white-space: pre-line; }

/* ── Pager ── */
.crm-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: var(--s4) 0; }
.crm-pager button { min-width: 36px; min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); font: inherit; font-size: var(--t-sm); font-weight: 700; color: var(--ink); cursor: pointer; }
.crm-pager button[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.crm-pager button:disabled { opacity: .45; cursor: default; }
.crm-pager .gap { color: var(--muted); padding: 0 2px; }
@media (max-width: 860px), (pointer: coarse) { .crm-pager button { min-width: var(--tap); min-height: var(--tap); } }

/* ── Skeleton rows ── */
.crm-skel-card { height: 92px; margin-bottom: var(--s3); border-radius: var(--r-lg); }
