/* KPI */
.kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi-card { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 16px; transition: all 0.15s; }
.kpi-card:hover { border-color: var(--border-strong); }
.kpi-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 6px; }
.kpi-value { font-family: var(--font-mono); font-size: 28px; font-weight: 700; line-height: 1; }

/* FUNNEL */
.funnel { display: flex; align-items: stretch; gap: 3px; margin-bottom: 20px; height: 64px; }
.funnel-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden; }
.funnel-stage::before { content: ''; position: absolute; inset: 0; background: currentColor; opacity: 0.12; }
.funnel-stage:hover { transform: translateY(-2px); }
.funnel-stage:hover::before { opacity: 0.18; }
.funnel-stage.active { outline: 2px solid var(--accent); outline-offset: 1px; }
.funnel-count { font-family: var(--font-mono); font-size: 22px; font-weight: 700; position: relative; z-index: 1; }
.funnel-label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; position: relative; z-index: 1; }
.funnel-connector { width: 12px; display: flex; align-items: center; color: var(--text-muted); font-size: 10px; }

/* BANNERS */
.banners { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--radius-md); font-size: 13px; cursor: pointer; transition: all 0.15s; border: 1px solid transparent; }
.banner:hover { border-color: var(--border-strong); }
.banner-red { background: var(--red-dim); color: var(--red); }
.banner-purple { background: var(--purple-dim); color: var(--purple); }

/* SEARCH & FILTER */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 200px; max-width: 400px; padding: 8px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-default); background: var(--bg-secondary); color: var(--text-primary); font-size: 13px; outline: none; transition: border-color 0.15s; }
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 14px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; border: 1px solid var(--border-default); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; transition: all 0.12s; white-space: nowrap; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); }

/* TABLE */
.table-container { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.table-meta { padding: 10px 16px; font-size: 11px; color: var(--text-muted); border-bottom: 1px solid var(--border-subtle); font-family: var(--font-mono); }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 12px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); text-align: left; white-space: nowrap; background: var(--bg-tertiary); border-bottom: 1px solid var(--border-subtle); position: sticky; top: 0; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--accent); }
.sort-icon { font-size: 9px; margin-left: 3px; opacity: 0.6; }
tr.role-row { border-bottom: 1px solid var(--border-subtle); transition: background 0.1s; cursor: pointer; }
tr.role-row:hover { background: var(--bg-hover); }
.role-title { color: var(--text-primary); transition: color 0.1s; }
.role-title:hover { color: var(--accent); }
table.hide-status-cols .col-status,
table.hide-status-cols .col-applied,
table.hide-status-cols .col-next { display: none; }
tr.role-row.expanded { background: var(--accent-dim); }
td { padding: 10px 12px; font-size: 13px; vertical-align: middle; }
td.mono { font-family: var(--font-mono); font-size: 12px; }
td.muted { color: var(--text-muted); font-size: 12px; }

/* BADGES */
.status-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 10px; font-weight: 600; white-space: nowrap; cursor: pointer; position: relative; transition: all 0.12s; }
.status-badge:hover { filter: brightness(1.15); }
.s-new { background: var(--blue-dim); color: var(--blue); }
.s-cvreq { background: var(--purple-dim); color: var(--purple); }
.s-cvready { background: var(--teal-dim); color: var(--teal); }
.s-applied { background: var(--amber-dim); color: var(--amber); }
.s-interviewing { background: var(--purple-dim); color: var(--purple); }
.s-offer { background: var(--green-dim); color: var(--green); }
.s-rejected { background: var(--red-dim); color: var(--red); }
.s-withdrawn { background: var(--grey-dim); color: var(--grey); }
.fit-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: var(--radius-sm); font-size: 10px; font-weight: 700; }
.f-strong { background: var(--amber-dim); color: var(--amber); }
.f-good { background: var(--green-dim); color: var(--green); }
.f-partial { background: var(--grey-dim); color: var(--grey); }
.f-skip { background: var(--red-dim); color: var(--red); }

/* STATUS DROPDOWN */
.status-dropdown { position: absolute; top: calc(100% + 4px); left: 0; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-popup); z-index: 200; min-width: 160px; overflow: hidden; }
.status-option { padding: 8px 14px; font-size: 12px; cursor: pointer; transition: background 0.1s; display: flex; align-items: center; gap: 8px; }
.status-option:hover { background: var(--bg-hover); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

/* DETAIL ROW */
.detail-row td { padding: 0 !important; }
.detail-panel { padding: 16px 24px 20px; border-top: 1px solid var(--border-subtle); background: var(--bg-tertiary); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; }
.detail-full { grid-column: 1 / -1; }
.detail-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 2px; }
.detail-value { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.5; white-space: pre-wrap; }
.detail-actions { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-subtle); margin-top: 8px; grid-column: 1 / -1; }
.cv-generating { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--purple-dim); border: 1px solid rgba(167,139,250,0.25); border-radius: var(--radius-md); color: var(--purple); font-size: 12px; font-weight: 500; }
.cv-progress-bar { flex: 1; height: 4px; background: rgba(167,139,250,0.15); border-radius: 2px; overflow: hidden; }
.cv-progress-fill { height: 100%; width: 30%; background: var(--purple); border-radius: 2px; animation: cv-progress 2s ease-in-out infinite; }
@keyframes cv-progress { 0% { width: 10%; margin-left: 0; } 50% { width: 40%; margin-left: 30%; } 100% { width: 10%; margin-left: 90%; } }
.btn { border: none; border-radius: var(--radius-sm); padding: 5px 10px; font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.12s; white-space: nowrap; }
.btn-accent { background: var(--accent); color: var(--text-inverse); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border-default); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: none; color: var(--text-muted); border: 1px solid var(--border-default); }
.btn-danger:hover { color: var(--red); border-color: var(--red); }
.btn-cv { background: var(--teal-dim); color: var(--teal); border: 1px solid var(--teal); }
.btn-cv:hover { background: var(--teal); color: var(--bg-primary); }
.btn:disabled { opacity: 0.4; cursor: default; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--border-default); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* TOAST */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-strong); padding: 12px 20px; border-radius: var(--radius-md); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-popup); max-width: 360px; opacity: 0; transform: translateY(12px) scale(0.95); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
