/* leads module styles — the pipeline board, lead cards and the lead page.
   Tokens from app.css only (var(--surface), var(--red-ink)…), never raw colours. */

/* ───────── pipeline page ───────── */
.lead-stats { margin-bottom: 16px; }
.lead-stat-wait { color: var(--faint); }
.leads-page .toolbar { row-gap: 10px; }
.lead-filter { width: auto; flex: 0 1 170px; min-width: 130px; }
.lead-chip-btn {
  border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); background: var(--red-soft); color: var(--red-ink);
  cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; height: 28px;
}
.lead-chip-btn:hover { background: color-mix(in srgb, var(--red-soft) 70%, var(--surface-2)); }
.lead-hint { margin: -4px 0 10px; }
.table tfoot .lead-total td { font-weight: 700; color: var(--text-2); }

/* ───────── kanban cards ───────── */
.lead-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lead-card-top { display: flex; align-items: flex-start; gap: 8px; }
.lead-card-company { flex: 1; min-width: 0; font-weight: 700; font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.lead-card-sub { color: var(--muted); font-size: 12px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lead-card-value { display: flex; align-items: baseline; gap: 8px; font-weight: 700; font-size: 14px; }
.lead-card-prob { font: 500 11px/1 var(--mono); color: var(--muted); padding: 3px 5px; border-radius: 4px; background: var(--surface-2); }
.lead-card-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; min-width: 0; }
.lead-card-meta .chip { height: 22px; font-size: 11.5px; }
.lead-card-foot { display: flex; align-items: center; gap: 8px; padding-top: 7px; margin-top: 1px; border-top: 1px dashed var(--border); }
.lead-days { display: inline-flex; align-items: center; gap: 4px; font: 500 11px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.lead-days.is-stale { color: var(--amber-ink); }
.lead-stage-select { margin-left: auto; width: auto; max-width: 140px; height: 28px; padding: 0 26px 0 8px; font-size: 12px; background-position: right 8px center; cursor: pointer; }

.lead-fu { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.lead-fu .icon { color: var(--muted); }
.lead-fu.is-none { color: var(--faint); font-style: italic; }

/* ───────── lead page ───────── */
.lead-meta-money { display: inline-flex; align-items: baseline; gap: 4px; flex-wrap: wrap; font-weight: 700; }
.lead-meta-money .muted { font-weight: 500; font-size: 12.5px; }

.lead-banners { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.lead-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13.5px;
}
.lead-banner > .icon { flex: none; }
.lead-banner .grow { min-width: 200px; }
.lead-banner.is-won { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.lead-banner.is-won > .icon { color: var(--green-ink); }
.lead-banner.is-lost { background: var(--gray-soft); }
.lead-banner.is-lost > .icon { color: var(--muted); }
.lead-banner.is-match { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.lead-banner.is-match > .icon { color: var(--amber-ink); }
.lead-banner .badge { vertical-align: middle; }

.lead-stagebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.lead-stagebar-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding-bottom: 2px; }
.lead-stagebar-scroll .segmented { flex-wrap: nowrap; }

.lead-followup.is-overdue, .lead-followup.is-today { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.lead-followup-when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.lead-followup-when .icon { color: var(--muted); }
.lead-followup.is-overdue .lead-followup-when, .lead-followup.is-today .lead-followup-when,
.lead-followup.is-overdue .lead-followup-when .icon, .lead-followup.is-today .lead-followup-when .icon { color: var(--red-ink); }
.lead-followup.is-none .lead-followup-when { color: var(--text-2); }
.lead-followup-when .small { font-weight: 500; letter-spacing: 0; }
.lead-followup-step { margin: 10px 0 12px; color: var(--text-2); overflow-wrap: anywhere; }
.lead-followup-step .label-mono { margin-right: 6px; }
.lead-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lead-date { width: auto; height: 28px; font-size: 12.5px; padding: 0 8px; }

.lead-task-link { display: block; text-decoration: none; }
.lead-task-link:hover { text-decoration: underline; text-decoration-color: var(--red); }

@media (max-width: 640px) {
  .lead-filter { flex: 1 1 calc(50% - 4px); }
  .leads-page .toolbar .segmented { width: 100%; }
  .leads-page .toolbar .segmented button { flex: 1; justify-content: center; }
  .lead-followup-when { font-size: 17px; }
  .lead-stage-select { max-width: 120px; }
  .lead-banner .btn { width: 100%; }
}
