/* Beacon FinTalent brand: navy #102649 with the terracotta #D75735 of the FinTalent logo as the secondary colour. */
:root {
  --navy: #102649;
  --navy-dark: #0A192F;
  --navy-light: #1E3A6D;
  --navy-subtle: #F0F4F8;
  --sec: #D75735;
  --sec-hover: #B84028;
  --sec-subtle: #FDF1EC;
  --sec-border: #F6CBBC;
  --sec-text: #A63D22;
  --accent: #8B2E16;

  --bg: #F8FAFC;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --border-hover: #CBD5E1;
  --text: #0F172A;
  --muted: #475569;
  --light: #64748B;

  --green: #047857;
  --green-subtle: #ECFDF5;
  --red: #B42318;
  --red-subtle: #FEF0EC;

  --shadow-sm: 0 1px 3px rgba(16, 38, 73, .05);
  --shadow-md: 0 4px 12px rgba(16, 38, 73, .06);
  --shadow-lg: 0 10px 25px rgba(16, 38, 73, .10);
  --shadow-sec: 0 4px 15px rgba(215, 87, 53, .28);
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-full: 9999px;

  --font: 'Plus Jakarta Sans', 'Cairo', system-ui, -apple-system, sans-serif;
  --display: 'Barlow Condensed', 'Plus Jakarta Sans', sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font: 14px/1.55 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
main { flex: 1; min-width: 0; width: 100%; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-light); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; color: var(--navy); }
[dir=auto] { unicode-bidi: plaintext; }
:lang(ar), [dir=rtl] { font-family: 'Cairo', var(--font); }
.muted { color: var(--muted); }
.light { color: var(--light); }
.err { color: var(--red); }
.loading { padding: 64px 24px; text-align: center; color: var(--light); }

/* ---------- Header ---------- */
.app-header { position: sticky; top: 0; z-index: 20; color: #fff; border-bottom: 3px solid var(--sec);
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #15325B 100%); box-shadow: 0 4px 20px rgba(0, 0, 0, .15); }
.header-inner { max-width: 1440px; margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff; flex-shrink: 0; }
.brand:hover { color: #fff; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-divider { width: 1px; height: 26px; background: rgba(255, 255, 255, .22); }
.brand-product { display: flex; flex-direction: column; line-height: 1.05; }
.brand-product b { font: 800 22px/1 var(--display); letter-spacing: .08em; color: var(--sec); }
.brand-product small { font-size: 11px; color: #A8B7CC; letter-spacing: .04em; margin-top: 2px; }
.nav { display: flex; gap: 4px; min-width: 0; }
.nav a { white-space: nowrap; padding: 8px 14px; border-radius: var(--r-md); color: rgba(255, 255, 255, .78); font-weight: 600; font-size: 13.5px; transition: .15s; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a.on { color: #fff; background: var(--sec); box-shadow: var(--shadow-sec); }
.user { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #CBD5E1; white-space: nowrap; }
.user .avatar { width: 32px; height: 32px; font-size: 12px; background: var(--sec); color: #fff; }
.user a { color: #fff; font-weight: 600; opacity: .8; }
.user a:hover { opacity: 1; color: var(--sec); }
.app-footer { padding: 20px 24px; text-align: center; font-size: 12px; color: var(--light); border-top: 1px solid var(--border); background: #fff; }

/* ---------- Page scaffolding ---------- */
.page { max-width: 1440px; margin: 0 auto; padding: 28px 24px 48px; }
.page.narrow { max-width: 1040px; }
.page-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--sec-text); display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--sec)); }
.page-head h1 { font: 800 34px/1.1 var(--display); letter-spacing: .01em; margin-top: 6px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.back:hover { color: var(--navy); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.pad { padding: 22px; }
.section-title { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--light); margin: 22px 0 10px; }
.section-title:first-child { margin-top: 0; }

/* ---------- KPIs ---------- */
.kpis { display: flex; gap: 12px; flex-wrap: wrap; }
.kpi { min-width: 120px; padding: 12px 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.kpi b { display: block; font: 800 26px/1 var(--display); color: var(--navy); }
.kpi span { font-size: 12px; color: var(--light); font-weight: 500; }
.kpi.sec { background: var(--sec-subtle); border-color: var(--sec-border); }

/* ---------- Controls ---------- */
.input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: #fff; transition: .15s; }
.input:hover { border-color: var(--border-hover); }
.input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(16, 38, 73, .08); }
textarea.input { min-height: 240px; resize: vertical; line-height: 1.6; }
.search { position: relative; }
.search .input { padding: 13px 16px 13px 44px; font-size: 15px; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--light); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: #fff; color: var(--navy); font-weight: 700; font-size: 13.5px; cursor: pointer; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--navy); color: var(--navy); }
.btn.sec { background: var(--sec); border-color: var(--sec); color: #fff; box-shadow: var(--shadow-sec); }
.btn.sec:hover { background: var(--sec-hover); border-color: var(--sec-hover); }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.navy:hover { background: var(--navy-light); }
.btn.ghost-light { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); color: #fff; }
.btn.ghost-light:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .6; cursor: progress; }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 700; background: var(--navy-subtle); color: var(--navy); white-space: nowrap; }
.badge.navy { background: var(--navy); color: #fff; }
.badge.sec { background: var(--sec-subtle); color: var(--sec-text); border: 1px solid var(--sec-border); }
.badge.Strong { background: var(--green-subtle); color: var(--green); }
.badge.Good { background: var(--navy-subtle); color: var(--navy); }
.badge.Possible { background: var(--sec-subtle); color: var(--sec-text); }
.badge.Weak { background: var(--red-subtle); color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 10px; border-radius: var(--r-full); background: var(--bg); border: 1px solid var(--border); font-size: 12px; color: var(--muted); font-weight: 500; }
.chip.cert { background: var(--sec-subtle); border-color: var(--sec-border); color: var(--sec-text); font-weight: 700; }
.chip.must { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: #fff;
  font: 700 15px/1 var(--font); letter-spacing: .02em; }

/* ---------- Candidates list ---------- */
.list-layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 24px; align-items: start; }
.filters { position: sticky; top: 88px; max-height: calc(100vh - 108px); overflow: auto; padding: 18px; }
.filters summary { list-style: none; display: none; }
.filters h4 { margin: 18px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--light); }
.filters h4:first-of-type { margin-top: 0; }
.facet { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 10px; margin: 1px 0; border: 0; border-radius: var(--r-sm);
  background: none; cursor: pointer; text-align: left; color: var(--text); font-weight: 500; transition: .12s; }
.facet:hover { background: var(--navy-subtle); }
.facet small { font-size: 11px; font-weight: 700; color: var(--light); background: var(--bg); border-radius: var(--r-full); padding: 1px 8px; }
.facet.on { background: var(--navy); color: #fff; }
.facet.on small { background: var(--sec); color: #fff; }
.filters .btn { width: 100%; margin-top: 18px; }

.toolbar { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; }
.toolbar .count { font-weight: 700; color: var(--navy); }
.toolbar select { margin-left: auto; width: auto; padding: 8px 12px; }

.rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.row-card { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; color: inherit; transition: transform .2s, border-color .2s, box-shadow .2s; }
.row-card:hover { color: inherit; transform: translateY(-2px); border-color: var(--sec); box-shadow: var(--shadow-md); }
.row-main { flex: 1; min-width: 0; }
.row-name { font-weight: 700; font-size: 15.5px; color: var(--navy); }
.row-title { color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--light); font-size: 12.5px; align-items: center; }
.row-meta .dot::before { content: "•"; margin-right: 14px; color: var(--border-hover); }
.row-card .chips { margin-top: 10px; }
.row-side { text-align: right; flex: none; }
.row-side b { display: block; font: 800 28px/1 var(--display); color: var(--navy); }
.row-side span { font-size: 11px; color: var(--light); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.empty { padding: 48px 24px; text-align: center; color: var(--light); }

/* ---------- Candidate detail ---------- */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 24px; align-items: start; }
.hero { position: relative; overflow: hidden; padding: 26px; border-radius: var(--r-lg); color: #fff; border: 0;
  background: linear-gradient(155deg, var(--navy-dark) 0%, var(--navy) 55%, var(--navy-light) 100%); box-shadow: var(--shadow-lg); }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--accent), var(--sec)); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(215, 87, 53, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(215, 87, 53, .05) 1px, transparent 1px); background-size: 48px 48px; }
.hero > * { position: relative; }
.hero-top { display: flex; gap: 16px; align-items: center; }
.hero .avatar { width: 58px; height: 58px; font-size: 19px; background: var(--sec); color: #fff; }
.hero h1 { color: #fff; font: 800 30px/1.1 var(--display); letter-spacing: .01em; }
.hero .sub { color: #CBD5E1; margin-top: 3px; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero .badge { background: rgba(255, 255, 255, .1); color: #fff; }
.hero .badge.sec { background: var(--sec); color: #fff; border: 0; }
.hero .summary { margin: 16px 0 0; color: #E2E8F0; line-height: 1.65; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.notice { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--sec-subtle); border: 1px solid var(--sec-border); color: var(--sec-text); font-size: 13px; }
.notice a { color: var(--navy); font-weight: 700; }
.stack { display: grid; gap: 16px; margin-top: 16px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 20px; }
.facts dt { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--light); }
.facts dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plus, .minus { margin: 0; padding: 0; list-style: none; }
.plus li, .minus li { position: relative; padding-left: 20px; margin: 6px 0; }
.plus li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.minus li::before { content: "!"; position: absolute; left: 4px; color: var(--accent); font-weight: 800; }
ul.tight { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
ul.tight li { margin: 3px 0; }
.timeline { position: relative; margin-left: 6px; padding-left: 20px; border-left: 2px solid var(--border); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -27px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--sec); }
.tl-item b { color: var(--navy); }
.tl-item .when { font-size: 12.5px; color: var(--light); }
.pdf { position: sticky; top: 88px; height: calc(100vh - 108px); overflow: hidden; padding: 0; }
.pdf-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.pdf-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf iframe { width: 100%; height: calc(100% - 45px); border: 0; display: block; background: #525659; }
.meta-foot { font-size: 12px; color: var(--light); margin-top: 4px; }

/* ---------- Matching ---------- */
.match-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.tips { padding: 20px; background: var(--navy-subtle); border: 1px solid #DCE4EE; border-radius: var(--r-lg); }
.tips h4 { margin: 0 0 10px; color: var(--navy); font-size: 13px; }
.tips ol { margin: 0; padding-left: 18px; color: var(--muted); }
.tips li { margin: 6px 0; }
.job-head { padding: 22px; margin-bottom: 16px; }
.job-head h2 { font: 800 26px/1.15 var(--display); }
.job-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; color: var(--light); font-size: 13px; }
.req { margin-top: 14px; }
.req .label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--light); margin: 10px 0 6px; }
.ai-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.result { display: flex; gap: 18px; padding: 18px; }
.score { flex: none; position: relative; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  background: conic-gradient(var(--ring, var(--sec)) calc(var(--s) * 1%), var(--border) 0); }
.score::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.score span { position: relative; font: 800 20px/1 var(--display); color: var(--navy); }
.score.ai { --ring: var(--navy); }
.result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.result-head .name { font-weight: 700; font-size: 15.5px; }
.result-sub { color: var(--muted); margin-top: 2px; }
.result .two { margin-top: 12px; }
.result h5 { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--light); }
.rank { font: 800 13px/1 var(--display); color: var(--light); letter-spacing: .05em; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { white-space: nowrap; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--light); background: #FBFCFE; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FBFCFE; }
.table-wrap { overflow-x: auto; }
.status { display: inline-block; padding: 2px 9px; border-radius: var(--r-full); font-size: 11.5px; font-weight: 700; background: var(--navy-subtle); color: var(--navy); }
.status.error { background: var(--red-subtle); color: var(--red); }
.status.pending, .status.processing { background: var(--sec-subtle); color: var(--sec-text); }

/* ---------- Sign-in ---------- */
.auth { min-height: calc(100vh - 67px - 58px); display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 56px; color: #fff;
  background: linear-gradient(155deg, var(--navy-dark) 0%, var(--navy) 55%, var(--navy-light) 100%); }
.auth-brand::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(215, 87, 53, .04) 1px, transparent 1px),
  linear-gradient(90deg, rgba(215, 87, 53, .04) 1px, transparent 1px); background-size: 72px 72px; }
.auth-brand::after { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; top: -160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(215, 87, 53, .18), transparent 65%); }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand img { width: 190px; height: auto; }
.auth-brand h1 { color: #fff; font: 800 52px/1.02 var(--display); margin-top: 36px; letter-spacing: .01em; }
.auth-brand h1 em { font-style: normal; color: var(--sec); }
.auth-brand p { color: #CBD5E1; font-size: 16px; max-width: 440px; margin-top: 14px; }
.auth-brand .bar { width: 64px; height: 4px; border-radius: 2px; margin-top: 28px; background: linear-gradient(90deg, var(--accent), var(--sec)); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; padding: 32px; }
.auth-card h2 { font: 800 28px/1.1 var(--display); }
.auth-card .input { margin-top: 18px; padding: 12px 14px; font-size: 15px; }
.auth-card .btn { width: 100%; margin-top: 12px; padding: 12px; font-size: 14.5px; }
.code-input { letter-spacing: .5em; text-align: center; font-weight: 700; font-size: 22px !important; }
body.signed-out .nav, body.signed-out .user { visibility: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .detail-layout, .match-grid { grid-template-columns: minmax(0, 1fr); }
  .pdf { position: static; height: 75vh; }
}
@media (max-width: 900px) {
  .header-inner { gap: 14px; padding: 0 16px; }
  .brand-divider, .brand-product small, .user .email { display: none; }
  .nav { overflow-x: auto; scrollbar-width: none; }
  .nav a { padding: 7px 10px; font-size: 13px; }
  .page { padding: 20px 16px 40px; }
  .list-layout { grid-template-columns: minmax(0, 1fr); }
  .kpi { flex: 1 1 100px; min-width: 0; }
  .filters { position: static; max-height: none; }
  .filters summary { display: flex; justify-content: space-between; cursor: pointer; font-weight: 700; color: var(--navy); }
  .filters:not([open]) > :not(summary) { display: none; }
  .filters[open] summary { margin-bottom: 12px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { padding: 36px 24px; }
  .auth-brand h1 { font-size: 38px; margin-top: 22px; }
}
@media (max-width: 640px) {
  .brand-logo { height: 24px; }
  .brand-product b { font-size: 18px; }
  .two { grid-template-columns: 1fr; }
  .row-side { display: none; }
  .page-head h1 { font-size: 28px; }
  .user a { display: none; }
}

/* ---------- Sync pipeline ---------- */
.nav-count { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin-left: 4px; border-radius: var(--r-full);
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; }
.stepper { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.step { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--light); white-space: nowrap; }
.step span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); font-weight: 800; font-size: 13px; }
.step.on { color: var(--navy); }
.step.on span { background: var(--sec); border-color: var(--sec); color: #fff; box-shadow: var(--shadow-sec); }
.step.done { color: var(--green); }
.step.done span { background: var(--green-subtle); border-color: var(--green); color: var(--green); }
.step-line { flex: 1; height: 2px; min-width: 16px; background: var(--border); }
.pipe { margin-top: 14px; transition: border-color .2s, box-shadow .2s; }
.pipe.active { border-color: var(--sec); box-shadow: var(--shadow-md); }
.pipe-head { display: flex; align-items: flex-start; gap: 16px; }
.pipe-head h3 { font-size: 16px; }
.pipe-head p { margin: 4px 0 0; }
.pipe-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-md); background: var(--navy); color: #fff; font: 800 18px/1 var(--display); }
.pipe:not(.active) .pipe-n { background: var(--navy-subtle); color: var(--navy); }
.review { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--r-md); max-height: 460px; overflow: auto; }
.review td, .review th { padding: 10px 14px; vertical-align: middle; }
.review th { position: sticky; top: 0; z-index: 1; }
.review tr.odd td { background: #FEF6F2; }
.review input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--navy); cursor: pointer; }
.file-name { font-weight: 600; word-break: break-word; }
.file-name a { color: var(--navy); }
.pipe-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.bar-track { height: 8px; border-radius: var(--r-full); background: var(--navy-subtle); overflow: hidden; margin-top: 16px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--sec)); transition: width .4s; }
.proc { list-style: none; margin: 12px 0 0; padding: 0; }
.proc li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.proc li:last-child { border-bottom: 0; }
.proc .ico { width: 18px; text-align: center; font-weight: 800; color: var(--light); }
.proc .res { margin-left: auto; font-size: 12.5px; text-align: right; }
.proc li.run .ico { color: var(--sec-text); animation: spin 1s linear infinite; }
.proc li.ok .ico { color: var(--green); }
.proc li.bad .ico, .proc li.bad .res { color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .stepper { gap: 6px; padding: 12px; }
  .step { font-size: 0; gap: 0; }
  .step.on { font-size: 13px; gap: 8px; }
  .pipe-head { flex-wrap: wrap; }
}

/* ---------- Job form & details ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > span { font-size: 12px; font-weight: 700; color: var(--navy); letter-spacing: .02em; }
.field i { color: var(--accent); font-style: normal; }
.job-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px 20px; margin: 14px 0 0; padding: 14px 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); }
.job-facts dt { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--light); }
.job-facts dd { margin: 2px 0 0; font-weight: 600; color: var(--navy); }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Jobs list & job page ---------- */
.tabs { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { padding: 10px 14px; border: 0; background: none; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--light);
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--navy); }
.tab.on { color: var(--navy); border-bottom-color: var(--sec); }
.tab span { margin-left: 6px; padding: 1px 7px; border-radius: var(--r-full); background: var(--navy-subtle); font-size: 11.5px; color: var(--navy); }
.status-pill { display: inline-block; padding: 2px 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 700; background: var(--navy-subtle); color: var(--navy); }
.status-pill.open { background: var(--green-subtle); color: var(--green); }
.status-pill.on_hold { background: var(--sec-subtle); color: var(--sec-text); }
.status-pill.filled { background: var(--navy); color: #fff; }
.status-pill.closed { background: #F1F5F9; color: var(--light); }
.status-select { width: auto; font-weight: 700; padding: 9px 12px; }
.status-select.open { color: var(--green); }
.status-select.on_hold { color: var(--sec-text); }
.counts { white-space: nowrap; }
.cnt { display: inline-block; min-width: 34px; margin-right: 4px; padding: 1px 6px; border-radius: var(--r-sm); font-size: 12px; font-weight: 700; color: var(--border-hover); background: var(--bg); }
.cnt.on { color: var(--navy); background: var(--navy-subtle); }
.stage-badge { display: inline-flex; padding: 3px 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--navy-subtle); color: var(--navy); }
.stage-badge.interviewed { background: #E0F2FE; color: #0369A1; }
.stage-badge.sent { background: var(--sec-subtle); color: var(--sec-text); }
.stage-badge.hired { background: var(--green-subtle); color: var(--green); }
.stage-badge.rejected { background: var(--red-subtle); color: var(--red); }
.btn.danger { color: var(--red); border-color: #F5C2B8; }
.btn.danger:hover { background: var(--red-subtle); border-color: var(--red); color: var(--red); }
.score.sm { width: 40px; height: 40px; }
.score.sm::before { inset: 4px; }
.score.sm span { font-size: 14px; }

/* ---------- Pipeline board ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col { background: #EEF2F7; border-radius: var(--r-lg); padding: 10px; min-height: 120px; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; font-weight: 800; font-size: 12px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--navy); }
.col-head span { background: #fff; border-radius: var(--r-full); padding: 1px 9px; font-size: 12px; }
.col-sent .col-head { color: var(--sec-text); }
.col-hired .col-head { color: var(--green); }
.col-hired { background: var(--green-subtle); }
.col-empty { text-align: center; color: var(--border-hover); padding: 18px 0; }
.pipe-card { display: block; width: 100%; text-align: left; padding: 12px; margin-bottom: 8px; cursor: pointer; font: inherit; color: inherit; transition: .15s; }
.pipe-card:hover { border-color: var(--sec); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pc-top { display: flex; gap: 10px; align-items: center; }
.pc-top .avatar { width: 36px; height: 36px; font-size: 13px; }
.pc-name { font-weight: 700; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-title { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--light); }
.pc-reason { margin-top: 8px; font-size: 12px; color: var(--red); }
.rejected-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 12px; }
.rejected-list .pipe-card { margin: 0; opacity: .85; }

/* ---------- Drawer ---------- */
body.no-scroll { overflow: hidden; }
.drawer-wrap { position: fixed; inset: 0; z-index: 50; }
.drawer-bg { position: absolute; inset: 0; background: rgba(10, 25, 47, .45); animation: fade .2s; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: var(--bg); box-shadow: -10px 0 30px rgba(10, 25, 47, .2);
  display: flex; flex-direction: column; animation: slide .25s ease; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-head { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; background: #fff; border-bottom: 3px solid var(--sec); }
.drawer-body { flex: 1; overflow-y: auto; padding: 6px 20px 24px; }
.drawer-body .section-title { margin-top: 22px; }
.drawer-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 7px 12px; border-radius: var(--r-full); border: 1px solid var(--border); background: #fff; font-weight: 700; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.seg button:hover { border-color: var(--navy); }
.seg button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.seg button.rejected.on { background: var(--red); border-color: var(--red); }
.seg button.hired.on, .seg.rec button.Strong.on { background: var(--green); border-color: var(--green); }
.seg.rec button.Good.on { background: var(--navy); }
.seg.rec button.Possible.on { background: var(--sec); border-color: var(--sec); color: #fff; }
.seg.rec button.Weak.on { background: var(--red); border-color: var(--red); }
.iv { padding: 14px; margin-bottom: 10px; }
.iv-top { display: flex; gap: 12px; align-items: center; }
.iv-bars { display: grid; gap: 6px; margin-top: 12px; }
.iv-bars > div { display: grid; grid-template-columns: minmax(0, 1fr) 110px 18px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.iv-bars i { display: block; height: 6px; border-radius: 3px; background: var(--navy-subtle); overflow: hidden; }
.iv-bars i b { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--navy-light)); border-radius: 3px; }
.iv-bars em { font-style: normal; font-weight: 800; color: var(--navy); text-align: right; }
.iv-note { font-size: 12px; color: var(--light); margin: -2px 0 2px; padding-left: 8px; border-left: 2px solid var(--sec-border); }
.iv-extra { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.iv-comments { margin: 10px 0 0; padding: 10px 12px; background: var(--bg); border-radius: var(--r-md); white-space: pre-wrap; }
.notes { display: grid; gap: 8px; margin-top: 10px; }
.note { padding: 10px 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); white-space: pre-wrap; }

/* ---------- Score sheet ---------- */
.sheet { padding: 16px; margin-bottom: 14px; border-color: var(--sec); box-shadow: var(--shadow-md); }
.sheet-title { font: 800 20px/1 var(--display); color: var(--navy); margin-bottom: 12px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.crit-list { display: grid; gap: 10px; margin: 16px 0; }
.crit { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.crit-head { display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.crit-note { margin-top: 8px; padding: 7px 10px; font-size: 12.5px; }
.rate { display: flex; gap: 4px; flex: none; }
.rate button { width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--border); background: #fff; font-weight: 800; cursor: pointer; color: var(--muted); }
.rate button:hover { border-color: var(--navy); color: var(--navy); }
.rate button.on { background: var(--sec); border-color: var(--sec); color: #fff; }
.sheet-total { display: flex; align-items: baseline; gap: 12px; padding: 10px 12px; margin-bottom: 12px; border-radius: var(--r-md); background: var(--navy); color: #CBD5E1; }
.sheet-total b { font: 800 26px/1 var(--display); color: var(--sec); }
.sheet-total .light { margin-left: auto; color: #94A3B8; }

/* ---------- Candidate page: jobs ---------- */
.cand-jobs { display: grid; gap: 6px; margin-bottom: 12px; }
.cand-jobs a { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: var(--r-md); background: var(--bg); color: var(--text); }
.cand-jobs a:hover { background: var(--navy-subtle); }
.cand-jobs .stage-badge { margin-left: auto; }
.add-job { display: flex; gap: 8px; }
.add-job select { flex: 1; min-width: 0; }

/* ---------- Client report ---------- */
.report-builder { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; flex-wrap: wrap; }
.pick-list { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.pick-list label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.report { padding: 40px 44px; }
.rp-logo { width: 150px; height: auto; }
.rp-cover h1 { font: 800 38px/1.1 var(--display); margin-top: 6px; }
.rp-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; color: var(--muted); }
.rp-bar { width: 72px; height: 4px; border-radius: 2px; margin: 22px 0 8px; background: linear-gradient(90deg, var(--accent), var(--sec)); }
.rp-cand { padding: 26px 0; border-top: 1px solid var(--border); break-inside: avoid; page-break-inside: avoid; }
.rp-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.rp-head h3 { font: 800 26px/1.1 var(--display); }
.rp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rp-score { text-align: center; font-size: 11px; color: var(--light); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.rp-score .score { margin: 0 auto 4px; }
.rp-note { margin-top: 14px; padding: 12px 14px; border-left: 4px solid var(--sec); background: var(--sec-subtle); border-radius: 0 var(--r-md) var(--r-md) 0; }
.rp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.rp-cand h4 { margin: 16px 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--light); }
.rp-foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--light); text-align: center; }

@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .board, .rp-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); }
  .crit-head { flex-direction: column; align-items: flex-start; }
  .report { padding: 22px 18px; }
}
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .app-header, .app-footer, .no-print, .back { display: none !important; }
  .page { padding: 0; max-width: none; }
  .report { border: 0; box-shadow: none; padding: 0; }
  .badge, .chip, .stage-badge, .rp-note, .score, .iv-bars i b, .rp-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Pipeline drag and drop ---------- */
.board-hint { margin: 0 0 10px; font-size: 12.5px; }
.pipe-card { cursor: grab; }
.pipe-card:focus-visible { outline: 3px solid var(--sec); outline-offset: 2px; }
.pipe-card.dragging { opacity: .45; cursor: grabbing; transform: none; }
.col { transition: background .15s, box-shadow .15s; }
.board-dragging .col { outline: 2px dashed var(--border-hover); outline-offset: -2px; }
.col.drop-over { background: var(--sec-subtle); outline: 2px dashed var(--sec) !important; }
.col-empty { border: 2px dashed transparent; border-radius: var(--r-md); }
.board-dragging .col-empty { border-color: var(--border-hover); color: var(--light); }
.reject-zone { margin-top: 14px; transition: background .15s, border-color .15s; }
.reject-zone summary { cursor: pointer; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.reject-zone .drop-label { display: none; margin-left: auto; font-size: 12.5px; color: var(--red); }
.reject-zone[data-empty] summary { cursor: default; }
.board-dragging .reject-zone { border: 2px dashed #F5C2B8; }
.board-dragging .reject-zone .drop-label { display: inline; }
.reject-zone.drop-over { background: var(--red-subtle); border-color: var(--red) !important; }
@media (hover: none) { .board-hint { display: none; } .pipe-card { cursor: pointer; } }
