/* 08-matches.css — The matches board: score rings, client groups, match rows, reasons.
   Part of the CRM stylesheet: the files load in number order (components/app_styles.html) and later
   rules win, exactly as when this was one file. */

/* ---------- Matches board ---------- */
.score-ring { --tone: var(--amber); display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: conic-gradient(var(--tone) calc(var(--score) * 1%), var(--surface-3) 0); }
.score-ring b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); color: var(--tone); font-size: 12.5px; font-weight: 800; letter-spacing: -.02em; }
.score-ring.high { --tone: var(--green); }
.score-ring.mid { --tone: var(--blue); }
.match-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 14px; margin-bottom: 16px; }
.match-groups:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.match-group { display: flex; flex-direction: column; overflow: hidden; }
.match-group-head { display: flex; align-items: center; gap: 12px; padding: 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.match-group-head > .stack { flex: 1; gap: 3px; }
.match-group-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin: 0; }
.match-rows { display: flex; flex-direction: column; }
.match-rows.is-expanded { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.match-rows.is-expanded .match-row { align-items: flex-start; border-right: 1px solid var(--border); height: 100%; }
.match-rows.is-expanded .match-row:nth-child(2n) { border-right: 0; }
.match-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.match-row:last-child { border-bottom: 0; }
.match-row:hover { background: var(--surface-2); }
.match-row.selected { background: var(--accent-soft); }
.match-row-body { flex: 1; min-width: 0; gap: 3px; }
.match-group .phone-link { white-space: nowrap; }
.match-check { width: 16px; height: 16px; flex: none; accent-color: var(--accent); cursor: pointer; }
.match-title { font-weight: 700; color: var(--text); display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.match-title:hover { color: var(--accent-strong); }
.match-group .thumb { display: grid; place-items: center; width: 64px; height: 48px; flex: none; border-radius: 8px; overflow: hidden; color: var(--faint); background: var(--surface-3); }
.match-group .thumb.lg { width: 84px; height: 62px; }
.match-group .thumb img { width: 100%; height: 100%; object-fit: cover; }
.match-more, .match-empty { padding: 10px 14px; margin: 0; }
.reasons { display: flex; flex-wrap: wrap; gap: 4px; }
.reason { display: inline-flex; align-items: center; gap: 3px; height: 19px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.reason .i { width: 11px; height: 11px; }
.reason.good { background: var(--green-bg); color: var(--green); }
.reason.bad { background: var(--surface-3); color: var(--muted); }
.reason.fresh, .fresh-badge { background: var(--amber-bg); color: var(--amber); }
@media (max-width: 640px) {
  .match-group-head { flex-wrap: wrap; }
  .match-group-actions { width: 100%; justify-content: stretch; }
  .match-group-actions .btn { flex: 1; }
  .match-row .thumb { display: none; }
  .match-rows.is-expanded { grid-template-columns: minmax(0, 1fr); }
  .match-rows.is-expanded .match-row { border-right: 0; }
}

