/* ============================================================
   Compare Consultants — drop-in stylesheet
   Scoped under .cmp-page so it doesn't leak into the rest
   of the dashboard.
   ============================================================ */

.cmp-page {
    --cmp-bg:        #f6f7fb;
    --cmp-surface:   #ffffff;
    --cmp-surface-2: #f8fafc;
    --cmp-border:    #e6e8ef;
    --cmp-border-2:  #eef0f5;
    --cmp-text:      #0f172a;
    --cmp-text-2:    #475569;
    --cmp-muted:     #94a3b8;
    --cmp-primary:   #ef6c35;
    --cmp-primary-2: #f58c5f;
    --cmp-primary-d: #d95820;
    --cmp-tint:      #fff1ea;
    --cmp-tint-2:    #ffe2d2;
    --cmp-win-amber: #b45309;
    --cmp-win-green: #047857;
    --cmp-radius:    14px;
    --cmp-radius-sm: 10px;
    --cmp-shadow:    0 1px 2px rgba(15,23,42,.04), 0 4px 14px rgba(15,23,42,.05);
    --cmp-shadow-h:  0 6px 18px rgba(15,23,42,.07), 0 12px 32px rgba(239,108,53,.10);

    padding: 28px 0 96px;
    color: var(--cmp-text);
    font-feature-settings: "ss01","cv11";
}

.cmp-page *,
.cmp-page *::before,
.cmp-page *::after { box-sizing: border-box; }

/* ── Page header ─────────────────────────────────────────── */
.cmp-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    flex-wrap: wrap; gap: 16px;
    padding-bottom: 22px; margin-bottom: 26px;
    border-bottom: 1px solid var(--cmp-border);
}
.cmp-head-eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 11px; font-weight: 600; letter-spacing: .12em;
    text-transform: uppercase; color: var(--cmp-primary);
    margin-bottom: 8px;
}
.cmp-head-eyebrow::before {
    content: ""; width: 18px; height: 1.5px; background: currentColor; border-radius: 2px;
}
.cmp-head h1 {
    font-size: 26px; font-weight: 700; letter-spacing: -.02em;
    color: var(--cmp-text); margin: 0 0 6px;
    line-height: 1.15;
}
.cmp-head-sub { font-size: 14px; color: var(--cmp-text-2); margin: 0; }
.cmp-head-sub strong { color: var(--cmp-text); font-weight: 600; }
.cmp-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Buttons */
.cmp-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: var(--cmp-radius-sm);
    font-size: 13px; font-weight: 600; line-height: 1;
    text-decoration: none; border: 1px solid transparent;
    cursor: pointer; transition: all .18s ease;
    white-space: nowrap;
}
.cmp-btn i, .cmp-btn svg { font-size: 14px; width: 14px; height: 14px; }
.cmp-btn-ghost {
    background: var(--cmp-surface); color: var(--cmp-text-2);
    border-color: var(--cmp-border);
}
.cmp-btn-ghost:hover {
    color: var(--cmp-primary); border-color: var(--cmp-primary-2);
    background: var(--cmp-tint);
}
.cmp-btn-primary {
    background: var(--cmp-primary); color: #fff;
    box-shadow: 0 4px 12px rgba(239,108,53,.28);
}
.cmp-btn-primary:hover {
    background: var(--cmp-primary-d); color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(239,108,53,.4);
}
.cmp-btn-icon {
    width: 38px; height: 38px; padding: 0; justify-content: center;
}

/* ── Toolbar (sits above table) ─────────────────────────── */
.cmp-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    margin: 22px 0 14px;
}
.cmp-toolbar-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cmp-toolbar h3 {
    font-size: 15px; font-weight: 700; color: var(--cmp-text);
    margin: 0; letter-spacing: -.005em;
}
.cmp-toolbar-right { display: flex; align-items: center; gap: 10px; }

/* Switch */
.cmp-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.cmp-switch-track {
    width: 34px; height: 20px; border-radius: 999px;
    background: #d1d5db; position: relative; transition: background .18s;
    flex-shrink: 0;
}
.cmp-switch-track::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .18s;
}
.cmp-switch input { display: none; }
.cmp-switch input:checked + .cmp-switch-track { background: var(--cmp-primary); }
.cmp-switch input:checked + .cmp-switch-track::after { transform: translateX(14px); }
.cmp-switch-label { font-size: 13px; font-weight: 500; color: var(--cmp-text-2); }

/* ── Hero consultant cards ─────────────────────────────── */
.cmp-cards { margin-bottom: 8px; }

.cmp-card {
    background: var(--cmp-surface);
    border: 1px solid var(--cmp-border);
    border-radius: var(--cmp-radius);
    box-shadow: var(--cmp-shadow);
    padding: 22px 20px 20px;
    height: 100%;
    position: relative;
    transition: box-shadow .22s ease, transform .22s ease, border-color .22s;
    display: flex; flex-direction: column;
}
.cmp-card:hover {
    box-shadow: var(--cmp-shadow-h);
    border-color: #d2d6e2;
    transform: translateY(-2px);
}
.cmp-card[data-best="1"]::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit;
    border: 1.5px solid var(--cmp-primary); pointer-events: none;
    box-shadow: 0 0 0 4px rgba(239,108,53,.10);
}

.cmp-card-top {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 10px; margin-bottom: 14px;
}
.cmp-rank {
    font-size: 10px; font-weight: 700; letter-spacing: .14em;
    color: var(--cmp-muted); text-transform: uppercase;
}
.cmp-card-remove {
    width: 28px; height: 28px; border-radius: 8px;
    background: transparent; color: var(--cmp-muted);
    border: 1px solid var(--cmp-border);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .18s;
    flex-shrink: 0;
}
.cmp-card-remove:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.cmp-card-remove svg { width: 13px; height: 13px; }

.cmp-card-avatar {
    width: 64px; height: 64px; border-radius: 16px;
    position: relative;
    background: linear-gradient(135deg, var(--cmp-primary), var(--cmp-primary-2));
    padding: 2px;
    margin-bottom: 14px;
}
.cmp-card-avatar img {
    display: block; width: 100%; height: 100%;
    border-radius: 14px;
    object-fit: cover;
    background: #fff;
}
.cmp-card-avatar .cmp-online {
    position: absolute; bottom: -2px; right: -2px;
    width: 14px; height: 14px; border-radius: 50%;
    background: #22c55e; border: 2.5px solid #fff;
}

.cmp-card-name {
    font-size: 16px; font-weight: 700; color: var(--cmp-text);
    margin: 0 0 4px; letter-spacing: -.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmp-card-role {
    font-size: 13px; color: var(--cmp-text-2);
    margin: 0 0 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmp-card-loc {
    font-size: 12px; color: var(--cmp-muted);
    display: inline-flex; align-items: center; gap: 4px;
    margin-bottom: 14px;
}
.cmp-card-loc svg { width: 12px; height: 12px; }

.cmp-card-keystats {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 0; margin-bottom: 14px;
    border-top: 1px solid var(--cmp-border-2);
    border-bottom: 1px solid var(--cmp-border-2);
}
.cmp-keystat-label {
    font-size: 10px; font-weight: 600; letter-spacing: .08em;
    color: var(--cmp-muted); text-transform: uppercase;
    margin: 0 0 3px;
}
.cmp-keystat-value {
    font-size: 16px; font-weight: 700; color: var(--cmp-text);
    line-height: 1; letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
}
.cmp-keystat-value small {
    font-size: 11px; font-weight: 500; color: var(--cmp-muted);
    margin-left: 1px;
}
.cmp-keystat-value .cmp-star {
    display: inline-block; width: 12px; height: 12px;
    color: #f59e0b; vertical-align: -1px; margin-right: 2px;
}

.cmp-card-cta {
    display: flex; gap: 8px; margin-top: auto;
}
.cmp-card-cta .cmp-btn { flex: 1; justify-content: center; padding: 10px 12px; }

/* ── Sticky comparison strip (appears on scroll) ────────── */
.cmp-stuck {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--cmp-border);
    padding: 10px 16px;
    border-radius: 12px 12px 0 0;
    display: none;
    align-items: center; gap: 14px;
    margin: 0 -1px;
}
.cmp-stuck.is-visible { display: flex; }
.cmp-stuck-label {
    font-size: 12px; font-weight: 700; color: var(--cmp-text-2);
    text-transform: uppercase; letter-spacing: .08em;
    margin-right: 4px;
}
.cmp-stuck-avs { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 0; overflow: hidden; }
.cmp-stuck-av {
    display: flex; align-items: center; gap: 8px; min-width: 0;
}
.cmp-stuck-av img {
    width: 28px; height: 28px; border-radius: 8px; object-fit: cover;
    border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--cmp-border);
}
.cmp-stuck-av span {
    font-size: 12px; font-weight: 600; color: var(--cmp-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Feature comparison table ──────────────────────────── */
.cmp-tbl-card {
    background: var(--cmp-surface);
    border: 1px solid var(--cmp-border);
    border-radius: var(--cmp-radius);
    box-shadow: var(--cmp-shadow);
    overflow: hidden;
}
.cmp-tbl-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.cmp-tbl {
    width: 100%;
    border-collapse: separate; border-spacing: 0;
    font-size: 13px;
}
.cmp-tbl th, .cmp-tbl td {
    padding: 0;
    vertical-align: middle;
    text-align: center;
}

/* Header row inside the table */
.cmp-tbl thead th {
    background: var(--cmp-surface-2);
    padding: 14px 18px;
    font-size: 11px; font-weight: 700; color: var(--cmp-muted);
    text-transform: uppercase; letter-spacing: .1em;
    border-bottom: 1px solid var(--cmp-border);
    white-space: nowrap;
}
.cmp-tbl thead th:first-child {
    text-align: left;
    background: var(--cmp-surface-2);
    border-right: 1px solid var(--cmp-border);
    position: sticky; left: 0; z-index: 4;
    min-width: 200px;
}

/* Feature label cells (left column) */
.cmp-tbl tbody td.cmp-feat-cell {
    position: sticky; left: 0; z-index: 3;
    background: var(--cmp-surface);
    border-right: 1px solid var(--cmp-border);
    text-align: left;
    min-width: 200px;
}
.cmp-tbl tbody tr:nth-child(even) td.cmp-feat-cell { background: var(--cmp-surface-2); }

.cmp-feat {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 20px;
    font-size: 13px; font-weight: 600; color: var(--cmp-text);
}
.cmp-feat-ico {
    width: 32px; height: 32px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.cmp-feat-ico svg { width: 15px; height: 15px; }
.cmp-feat-sub {
    display: block; font-size: 11px; font-weight: 500;
    color: var(--cmp-muted); margin-top: 2px;
}

/* Data cells */
.cmp-tbl tbody td.cmp-val {
    padding: 18px 18px;
    border-bottom: 1px solid var(--cmp-border-2);
    color: var(--cmp-text);
    transition: background .15s;
}
.cmp-tbl tbody tr:nth-child(even) td.cmp-val { background: var(--cmp-surface-2); }
.cmp-tbl tbody tr:last-child td { border-bottom: none; }

/* Column spotlight (hover) */
.cmp-tbl[data-spotlight="1"] tbody td.cmp-val,
.cmp-tbl[data-spotlight="2"] tbody td.cmp-val,
.cmp-tbl[data-spotlight="3"] tbody td.cmp-val,
.cmp-tbl[data-spotlight="4"] tbody td.cmp-val { opacity: .42; }
.cmp-tbl[data-spotlight="1"] tbody td.cmp-val.col-1,
.cmp-tbl[data-spotlight="2"] tbody td.cmp-val.col-2,
.cmp-tbl[data-spotlight="3"] tbody td.cmp-val.col-3,
.cmp-tbl[data-spotlight="4"] tbody td.cmp-val.col-4 {
    opacity: 1;
    background: var(--cmp-tint) !important;
}

/* Value tokens */
.cmp-price {
    font-size: 18px; font-weight: 700; color: var(--cmp-text);
    letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}
.cmp-price small { font-size: 12px; font-weight: 500; color: var(--cmp-muted); }
.cmp-price-sub {
    font-size: 11px; color: var(--cmp-muted); margin-top: 2px;
}
.cmp-rating-stars {
    display: inline-flex; gap: 1px; color: #f59e0b; margin-bottom: 4px;
}
.cmp-rating-stars svg { width: 13px; height: 13px; }
.cmp-rating-stars svg.is-off { color: #e5e7eb; }
.cmp-rating-num {
    font-size: 13px; font-weight: 700; color: var(--cmp-text);
    font-variant-numeric: tabular-nums;
}
.cmp-rating-num + .cmp-muted { font-size: 11px; }

.cmp-muted { color: var(--cmp-muted); }
.cmp-dim   { color: var(--cmp-muted); font-size: 13px; }

/* Generic tag/pill chip used in skills/langs/timezone */
.cmp-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600; line-height: 1.4;
    background: #f1f5f9; color: var(--cmp-text-2);
    border: 1px solid #e5e7eb;
}
.cmp-chip-indigo { background: var(--cmp-tint); color: var(--cmp-primary-d); border-color: var(--cmp-tint-2); }
.cmp-chip-emerald { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.cmp-chip-amber { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.cmp-chip-slate { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.cmp-chip-rose  { background: #fff1f2; color: #be123c; border-color: #fecdd3; }

.cmp-chip-group { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cmp-stack { display: flex; flex-direction: column; gap: 6px; align-items: center; }

/* Experience tier */
.cmp-tier {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 700; letter-spacing: .01em;
    border: 1px solid;
}
.cmp-tier::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cmp-tier-junior { background:#f1f5f9; color:#475569; border-color:#cbd5e1; }
.cmp-tier-mid    { background:#eff6ff; color:#1d4ed8; border-color:#bfdbfe; }
.cmp-tier-senior { background:#ecfdf5; color:#047857; border-color:#a7f3d0; }
.cmp-tier-expert { background: var(--cmp-tint); color: var(--cmp-primary-d); border-color: var(--cmp-tint-2); }

/* Availability */
.cmp-avail {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 600;
    border: 1px solid;
}
.cmp-avail-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cmp-avail-on    { background:#ecfdf5; color:#047857; border-color:#a7f3d0; }
.cmp-avail-soon  { background:#fffbeb; color:#b45309; border-color:#fde68a; }
.cmp-avail-busy  { background:#fef2f2; color:#b91c1c; border-color:#fecaca; }

/* Winner badge */
.cmp-win {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 6px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 10px; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase;
}
.cmp-win svg { width: 10px; height: 10px; }
.cmp-win-best  { background: #ecfdf5; color: var(--cmp-win-green); }
.cmp-win-top   { background: #fffbeb; color: var(--cmp-win-amber); }

.cmp-hi-green { color: var(--cmp-win-green) !important; }
.cmp-hi-amber { color: var(--cmp-win-amber) !important; }

/* Hide-ties mode: greys out non-winners */
.cmp-tbl.is-diff-only tbody tr:not(.has-diff) td.cmp-val { opacity: .25; }
.cmp-tbl.is-diff-only tbody tr:not(.has-diff) td.cmp-feat-cell { opacity: .55; }

/* Footer row */
.cmp-tbl tfoot td {
    background: #fffaf6;
    padding: 18px;
    border-top: 1px solid var(--cmp-border);
}
.cmp-tbl tfoot td.cmp-feat-cell { background: #fffaf6; }
.cmp-tbl tfoot .cmp-feat { padding: 0 20px; }

/* ── Empty state ────────────────────────────────────────── */
.cmp-empty {
    background: var(--cmp-surface);
    border: 1.5px dashed #d4d8e3;
    border-radius: var(--cmp-radius);
    padding: 72px 24px;
    text-align: center;
}
.cmp-empty-ico {
    width: 64px; height: 64px; margin: 0 auto 18px;
    border-radius: 16px;
    background: var(--cmp-tint);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--cmp-primary);
}
.cmp-empty h3 { font-size: 18px; font-weight: 700; margin: 0 0 6px; color: var(--cmp-text); }
.cmp-empty p  { font-size: 14px; color: var(--cmp-text-2); margin: 0 auto 22px; max-width: 440px; line-height: 1.55; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .cmp-head h1 { font-size: 22px; }
    .cmp-feat { padding: 14px; gap: 10px; }
    .cmp-feat-ico { width: 28px; height: 28px; }
    .cmp-tbl tbody td.cmp-val { padding: 14px; }
}
@media (max-width: 576px) {
    .cmp-tbl thead th:first-child,
    .cmp-tbl tbody td.cmp-feat-cell { min-width: 150px; }
    .cmp-card { padding: 18px 16px; }
}

/* Print niceties */
@media print {
    .cmp-page { padding: 0; }
    .cmp-head-actions, .cmp-toolbar-right, .cmp-card-remove, .cmp-stuck { display: none !important; }
    .cmp-card, .cmp-tbl-card { box-shadow: none; border-color: #ccc; }
    .cmp-tbl tbody td.cmp-val { opacity: 1 !important; }
}
