/* Recruiter candidate matching (dashboard → Candidate Matches).
   Namespaced .cmatch-* so it never collides with the shared table/card rules.
   Reuses the existing rank-chip / status-pill vocabulary from ai-screening.css. */

/* ── Filter toolbar ──────────────────────────────────────────────── */
.cmatch-toolbar{
    display:grid;
    grid-template-columns:minmax(0,2fr) minmax(0,1.4fr) minmax(0,.9fr) minmax(0,.9fr);
    gap:12px;
    align-items:end;
    margin-bottom:18px;
    padding:14px;
    border:1px solid var(--kdx-border);
    border-radius:20px;
    background:var(--kdx-soft);
}
.cmatch-toolbar .label{margin:0;font-size:12px;font-weight:900;color:var(--kdx-muted)}
.cmatch-toolbar .select,.cmatch-toolbar .input{margin-top:5px}
.cmatch-check{
    display:flex;align-items:center;gap:8px;
    grid-column:1/-1;
    color:var(--kdx-muted);font-size:12.5px;font-weight:850;cursor:pointer;
}
.cmatch-check input{width:16px;height:16px;accent-color:var(--kdx-blue);cursor:pointer}
.cmatch-toolbar-actions{display:flex;flex-wrap:wrap;gap:10px;grid-column:1/-1}

/* ── Result header ───────────────────────────────────────────────── */
.cmatch-resultbar{
    display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;
    margin:0 2px 12px;
    color:var(--kdx-ink);font-size:14px;font-weight:850;
}

/* ── Candidate card ──────────────────────────────────────────────── */
.cmatch-list{display:grid;gap:12px}
.cmatch-card{
    display:grid;
    grid-template-columns:38px auto minmax(0,1fr) auto;
    gap:16px;align-items:start;
    padding:16px;
    border:1px solid var(--kdx-border);
    border-left:4px solid #cbd5e1;
    border-radius:18px;
    background:#fff;
    box-shadow:var(--kdx-card-shadow);
    transition:box-shadow .18s ease,transform .18s ease;
}
.cmatch-card:hover{box-shadow:var(--kdx-card-shadow-hover);transform:translateY(-1px)}
.cmatch-card.cmatch-high{border-left-color:#16a34a}
.cmatch-card.cmatch-mid{border-left-color:#d97706}
.cmatch-card.cmatch-low{border-left-color:#94a3b8}
.cmatch-rank{padding-top:16px;color:var(--kdx-muted);font-size:13px;font-weight:950;text-align:center}

/* Score donut — pure CSS, no chart library. */
.cmatch-score{display:grid;justify-items:center;gap:6px;width:88px}
.cmatch-ring{
    display:grid;place-items:center;
    width:74px;height:74px;border-radius:999px;
    background:conic-gradient(var(--cmatch-ring-color,#2c4699) calc(var(--cmatch-pct,0) * 1%),var(--cmatch-ring-track,#e6eefb) 0);
}
.cmatch-ring::after{
    content:'';grid-area:1/1;
    width:58px;height:58px;border-radius:999px;background:#fff;
}
.cmatch-ring b{
    grid-area:1/1;z-index:1;
    color:var(--cmatch-ring-color,#2c4699);
    font-size:20px;font-weight:950;line-height:1;letter-spacing:-.02em;
}
.cmatch-ring b i{font-size:11px;font-style:normal;font-weight:900}
.cmatch-high .cmatch-ring{--cmatch-ring-color:#16a34a;--cmatch-ring-track:#dcfce7}
.cmatch-mid .cmatch-ring{--cmatch-ring-color:#d97706;--cmatch-ring-track:#fef3c7}
.cmatch-low .cmatch-ring{--cmatch-ring-color:#64748b;--cmatch-ring-track:#e2e8f0}
.cmatch-band{
    border-radius:999px;padding:3px 9px;
    font-size:10px;font-weight:950;text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;
}
.cmatch-high .cmatch-band{background:#dcfce7;color:#166534}
.cmatch-mid .cmatch-band{background:#fef3c7;color:#92400e}
.cmatch-low .cmatch-band{background:#e2e8f0;color:#475569}

/* ── Candidate body ──────────────────────────────────────────────── */
.cmatch-main{display:grid;gap:8px;min-width:0}
.cmatch-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.cmatch-name{color:var(--kdx-ink);font-size:16px;font-weight:950;line-height:1.2}
.cmatch-meta{display:flex;flex-wrap:wrap;gap:6px 14px;color:var(--kdx-muted);font-size:12px;font-weight:850}
.cmatch-meta span{display:inline-flex;align-items:center;gap:5px;min-width:0}
.cmatch-meta span+span::before{content:'';width:3px;height:3px;border-radius:999px;background:currentColor;opacity:.5;margin-right:9px}
.cmatch-chips{margin-top:2px}
.cmatch-evidence{margin-top:2px}
.cmatch-evidence summary{width:max-content;cursor:pointer;color:var(--kdx-blue);font-size:12px;font-weight:950}
.cmatch-evidence p{margin:8px 0 0;color:#475569;font-size:12px;line-height:1.55;font-weight:800}
.cmatch-gaps strong{color:#991b1b}

/* ── Actions ─────────────────────────────────────────────────────── */
.cmatch-actions{display:grid;gap:8px;justify-items:stretch;align-content:start;min-width:150px}
.cmatch-actions .btn{width:100%;justify-content:center;white-space:nowrap}
.cmatch-actions .file-link{
    display:inline-flex;justify-content:center;
    padding:8px 12px;border:1px solid var(--kdx-border);border-radius:12px;
    background:var(--kdx-soft);color:var(--kdx-blue);
    font-size:12.5px;font-weight:900;text-decoration:none;
}
.cmatch-actions .file-link:hover{border-color:var(--kdx-border-hover)}
.cmatch-invite-form{margin:0}
.cmatch-invited-note{text-align:center;padding-top:4px}

/* ── Empty state ─────────────────────────────────────────────────── */
.cmatch-empty{display:grid;gap:10px;justify-items:start}
.cmatch-empty strong{color:var(--kdx-ink);font-size:16px;font-weight:950}
.cmatch-empty p{margin:0;max-width:62ch;line-height:1.55}

/* ── Dark theme ──────────────────────────────────────────────────── */
body.theme-dark .cmatch-card{background:#101a3d;box-shadow:none}
body.theme-dark .cmatch-ring::after{background:#101a3d}
body.theme-dark .cmatch-low .cmatch-ring{--cmatch-ring-color:#94a3b8;--cmatch-ring-track:#182550}
body.theme-dark .cmatch-high .cmatch-ring{--cmatch-ring-track:#052e16}
body.theme-dark .cmatch-mid .cmatch-ring{--cmatch-ring-track:#431407}
body.theme-dark .cmatch-high .cmatch-band{background:#052e16;color:#86efac}
body.theme-dark .cmatch-mid .cmatch-band{background:#431407;color:#fbbf24}
body.theme-dark .cmatch-low .cmatch-band{background:#182550;color:#cbd5e1}
body.theme-dark .cmatch-name,body.theme-dark .cmatch-resultbar,body.theme-dark .cmatch-empty strong{color:#f8fafc}
body.theme-dark .cmatch-meta,body.theme-dark .cmatch-rank{color:#94a3b8}
body.theme-dark .cmatch-evidence p{color:#cbd5e1}
body.theme-dark .cmatch-gaps strong{color:#fca5a5}
body.theme-dark .cmatch-actions .file-link{background:#0d1330;color:#bcd2f2}

/* ── Responsive ──────────────────────────────────────────────────── */
@media(max-width:1080px){
    .cmatch-toolbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
    .cmatch-card{grid-template-columns:auto minmax(0,1fr);gap:12px}
    .cmatch-rank{display:none}
    .cmatch-actions{grid-column:1/-1;grid-auto-flow:column;justify-content:start;min-width:0}
    .cmatch-actions .btn,.cmatch-actions .file-link{width:auto}
}
@media(max-width:640px){
    .cmatch-toolbar{grid-template-columns:1fr}
    .cmatch-card{grid-template-columns:1fr;justify-items:start}
    .cmatch-score{display:flex;align-items:center;gap:12px;width:100%}
    .cmatch-ring{width:60px;height:60px}
    .cmatch-ring::after{width:46px;height:46px}
    .cmatch-ring b{font-size:17px}
    .cmatch-actions{grid-auto-flow:row;width:100%}
    .cmatch-actions .btn,.cmatch-actions .file-link{width:100%}
    .cmatch-meta span+span::before{display:none}
}
