/*! Copyright (c) 2023 Nikolas Konstantinou, NCon IT Solutions. All rights reserved. */
/* ==========================================================================
   Recruiting CRM styles
   Palette: spruce (structure), paper (surfaces), saffron (high-match signal)
   ========================================================================== */
:root {
  --spruce: #1E3B36;
  --spruce-2: #2A4D46;
  --spruce-soft: #E6EEEB;
  --paper: #F7F8F6;
  --surface: #FFFFFF;
  --ink: #18201E;
  --muted: #5F6A65;
  --line: #DDE2DE;
  --saffron: #D4930C;
  --saffron-soft: #FBF1DA;
  --red: #A93A2B;
  --red-soft: #F8E7E3;
  --green: #2D7650;
  --green-soft: #E3F1E8;
  --blue: #2B5C85;
  --blue-soft: #E4EDF5;
  --radius-sm: 4px;
  --radius: 8px;
  --font: "Instrument Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --focus: 0 0 0 3px rgba(212, 147, 12, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--paper); font-variant-numeric: tabular-nums; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--spruce); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .9em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.block { display: block; }
.center { text-align: center; }
.prewrap { white-space: pre-wrap; }
.narrow { max-width: 640px; }
[hidden] { display: none !important; }

/* ---------- Forms ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: .9rem; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--surface);
  border: 1px solid #C9D0CB; border-radius: var(--radius-sm); padding: 9px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--saffron); box-shadow: var(--focus); }
input:disabled { background: var(--paper); color: var(--muted); }
textarea { resize: vertical; }
.check, .switch { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.check input, .switch input { width: auto; accent-color: var(--spruce); }
.switch span { font-weight: 600; }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
.opt { font-weight: 400; color: var(--muted); font-size: .8rem; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-2, .row-3 { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0; }
legend { font-weight: 600; padding: 0 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: .9rem; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid #C2CAC5; background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--spruce); color: var(--spruce); }
.btn-primary { background: var(--spruce); border-color: var(--spruce); color: #fff; }
.btn-primary:hover { background: var(--spruce-2); color: #fff; }
.btn-danger { color: var(--red); border-color: #E2B8B0; }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn.danger { color: var(--red); }
.link-btn.on-dark, a.on-dark { color: #CFDCD8; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); width: 36px; flex: none; cursor: pointer; font-size: 1.1rem; color: var(--muted); }
.icon-btn:hover { color: var(--red); border-color: var(--red); }

/* ---------- Flash ---------- */
.flashes { display: flex; flex-direction: column; gap: 8px; margin: 16px 28px 0; }
.flash { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); border-left: 4px solid var(--blue); background: var(--blue-soft); }
.flash-success { border-color: var(--green); background: var(--green-soft); }
.flash-error { border-color: var(--red); background: var(--red-soft); }
.flash-close { background: none; border: 0; font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--muted); }

/* ---------- Pills, tags, scores ---------- */
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.status-submitted { background: var(--blue-soft); border-color: #C7D8E7; color: var(--blue); }
.status-reviewing { background: #EEF0F2; border-color: #D5DAE0; color: #4A5560; }
.status-shortlisted { background: var(--saffron-soft); border-color: #EBD49E; color: #8A5E05; }
.status-interview { background: #ECE7F6; border-color: #D6CCEB; color: #5B3F95; }
.status-offered, .status-hired { background: var(--green-soft); border-color: #BFDCCB; color: var(--green); }
.status-rejected { background: var(--red-soft); border-color: #EBC9C2; color: var(--red); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 12px; }
.tags li { font-size: .82rem; padding: 3px 9px; border-radius: var(--radius-sm); background: var(--spruce-soft); color: var(--spruce); }
.tags-quiet li { background: var(--paper); border: 1px solid var(--line); color: var(--muted); }
.tags-ok li { background: var(--green-soft); color: var(--green); }
.tags-miss li { background: var(--red-soft); color: var(--red); text-decoration: line-through; text-decoration-color: rgba(169,58,43,.4); }

.score { display: inline-flex; align-items: center; gap: 8px; }
.score-bar { width: 64px; height: 6px; background: #E7EBE8; border-radius: 3px; overflow: hidden; }
.score-bar span { display: block; height: 100%; background: #9AA6A0; }
.score-mid .score-bar span { background: var(--blue); }
.score-high .score-bar span, .score.is-high .score-bar span { background: var(--saffron); }
.score-num { font-weight: 600; font-size: .9rem; min-width: 2ch; }

/* The memorable element: the saffron high-match marker */
.flag-high { display: inline-block; font-size: .76rem; font-weight: 700; color: #7A5204; background: var(--saffron-soft); border: 1px solid #EBCB85; border-radius: 3px; padding: 1px 7px; text-decoration: none; white-space: nowrap; }
.row-high td:first-child { box-shadow: inset 4px 0 0 var(--saffron); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--saffron); color: #fff; font-size: .75rem; font-weight: 700; }

.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--spruce-soft); color: var(--spruce); font-weight: 700; font-size: .8rem; }
.avatar.lg { width: 60px; height: 60px; font-size: 1.15rem; }

/* ---------- Notification bell ---------- */
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.bell { position: relative; }
.bell-btn { position: relative; display: inline-flex; padding: 7px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.bell-count { position: absolute; top: -4px; right: -4px; background: var(--saffron); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 9px; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(360px, 90vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(24, 32, 30, .14); z-index: 50; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.bell-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.bell-list li { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.bell-list li.unread { background: var(--saffron-soft); }
.bell-list a { color: var(--ink); text-decoration: none; display: block; }
.bell-list time { display: block; color: var(--muted); font-size: .78rem; }
.bell-all { display: block; padding: 10px 14px; font-size: .85rem; text-align: center; }

/* ---------- Employer shell ---------- */
.emp-shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.emp-nav { align-self: start; background: var(--spruce); color: #E8EFEC; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.emp-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 0 8px 22px; line-height: 1.2; }
.emp-brand small { display: block; font-weight: 400; color: #A9BDB7; font-size: .78rem; }
.brand-mark { width: 22px; height: 22px; border-radius: 4px; background: linear-gradient(135deg, var(--saffron) 0 50%, #E8EFEC 50% 100%); flex: none; }
.emp-nav nav { display: flex; flex-direction: column; gap: 2px; }
.emp-nav nav a { color: #CFDCD8; text-decoration: none; padding: 8px 10px; border-radius: var(--radius-sm); font-weight: 500; }
.emp-nav nav a:hover { background: var(--spruce-2); color: #fff; }
.emp-nav nav a.active { background: #fff; color: var(--spruce); }
.emp-nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 10px; font-size: .85rem; }
.emp-main { min-width: 0; }
.emp-top { display: flex; align-items: center; gap: 14px; padding: 16px 28px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.page-title { font-size: 1.3rem; margin: 0; }
.crumb { font-weight: 500; color: var(--muted); text-decoration: none; margin-right: 6px; font-size: .95rem; }
.crumb::after { content: " /"; }
.emp-content { padding: 24px 28px 48px; max-width: 1360px; }
.nav-toggle { display: none; font-size: 1.2rem; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 10px; cursor: pointer; }

/* Panels & dashboard */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; }
.sub { font-size: .85rem; color: var(--muted); font-weight: 600; margin: 14px 0 6px; }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 20px; overflow: hidden; }
.kpi { display: flex; flex-direction: column; padding: 16px 18px; text-decoration: none; color: var(--ink); border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi:hover { background: var(--paper); }
.kpi-num { font-size: 1.9rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.kpi-label { font-size: .85rem; font-weight: 500; margin-top: 4px; }
.kpi-sub { font-size: .78rem; color: var(--muted); }
.kpi-high { background: var(--saffron-soft); }
.kpi-high .kpi-num { color: #8A5E05; }
.kpi-high:hover { background: #F7E7C1; }

.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dash-grid .panel + .panel { margin-top: 0; }
.span-2 { grid-column: span 2; }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 280px; }
.panel-high { border-top: 3px solid var(--saffron); }
.match-list, .simple-list { list-style: none; margin: 0; padding: 0; }
.match-list li a { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.match-list li:last-child a { border-bottom: 0; }
.ml-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ml-text strong, .ml-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.simple-list li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.simple-list li:last-child { border-bottom: 0; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 600; font-size: .8rem; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FBFCFB; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: #FAFBFA; }
.table .num { text-align: right; }
.table a { color: var(--ink); }
.is-closed td { color: var(--muted); }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.who { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.tabs a { padding: 6px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--muted); font-weight: 500; }
.tabs a.active { background: var(--spruce-soft); color: var(--spruce); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters label { flex-direction: row; }
.filters .grow { flex: 1 1 260px; }
.filters select { width: auto; }

/* Detail pages */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.detail-side .panel + .panel { margin-top: 16px; }
.candidate-head { display: flex; gap: 16px; align-items: flex-start; }
.candidate-head.is-high { border-left: 4px solid var(--saffron); }
.ch-text { flex: 1; min-width: 0; }
.ch-text h2 { font-size: 1.3rem; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ch-text p { margin-bottom: 4px; }
.contact { display: flex; flex-wrap: wrap; gap: 14px; }
.ch-score { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 2px; }
.big-score { font-size: 2.4rem; font-weight: 700; line-height: 1; color: var(--muted); }
.big-score.score-mid { color: var(--blue); }
.big-score.score-high { color: var(--saffron); }
.breakdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.breakdown > div { background: var(--paper); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; }
.bd-num { font-weight: 700; font-size: 1.2rem; }
.bd-num small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 10px; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.cv-summary { background: var(--paper); border-left: 3px solid var(--spruce); padding: 10px 14px; }
.timeline { list-style: none; padding: 0; margin: 0 0 10px; font-size: .9rem; }
.timeline li { padding: 4px 0 4px 14px; border-left: 2px solid var(--line); }
.note { background: var(--saffron-soft); padding: 8px 12px; border-radius: var(--radius-sm); font-size: .88rem; }
.note-error { background: var(--red-soft); }

.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.agenda-date { width: 52px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 0; flex: none; }
.agenda-date span { display: block; font-size: 1.3rem; font-weight: 700; line-height: 1.1; }
.agenda-date small { color: var(--muted); }

.form-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.form-grid .panel { display: flex; flex-direction: column; gap: 14px; }
.form-grid .panel + .panel { margin-top: 0; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; }
.danger-zone { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.settings { max-width: 760px; }
.settings .panel + .panel { margin-top: 20px; }
.narrow-form { max-width: 380px; }
.inline-form { margin-top: 12px; }
.test-result { padding: 8px 12px; border-radius: var(--radius-sm); font-size: .88rem; }
.test-result.ok { background: var(--green-soft); }
.test-result.fail { background: var(--red-soft); }

/* Threads & chat */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad, .pad { padding: 20px; }
.thread-list, .note-list { list-style: none; padding: 0; margin: 0 0 14px; }
.thread-list li a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.thread-list li:last-child a { border-bottom: 0; }
.thread-list li.unread a { background: var(--saffron-soft); }
.tl-text { flex: 1; min-width: 0; }
.tl-preview { display: block; color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.note-list li { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 14px; }
.note-list li.unread { background: var(--saffron-soft); }

.chat { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.chat-log { height: 360px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 78%; padding: 9px 13px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; white-space: pre-wrap; word-wrap: break-word; }
.msg.mine { align-self: flex-end; background: var(--spruce); color: #fff; border-color: var(--spruce); }
.msg-meta { display: block; font-size: .74rem; opacity: .7; margin-top: 3px; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.chat-form textarea { flex: 1; min-height: 44px; }
.chat-empty { margin: auto; text-align: center; }

.empty { text-align: center; padding: 48px 20px; border: 1px dashed #C9D0CB; border-radius: var(--radius); background: var(--surface); }
.empty p { color: var(--muted); }
.small-empty { padding: 28px 16px; }

/* ---------- Candidate portal ---------- */
.cand-top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.cand-top-inner { max-width: 1080px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 24px; }
.cand-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; color: var(--ink); }
.cand-brand.on-dark { color: #fff; }
.cand-nav { display: flex; gap: 4px; align-items: center; }
.cand-nav a { padding: 7px 11px; border-radius: var(--radius-sm); text-decoration: none; color: var(--muted); font-weight: 500; }
.cand-nav a:hover { color: var(--spruce); }
.cand-nav a.active { color: var(--spruce); background: var(--spruce-soft); }
.cand-nav a.btn-primary { color: #fff; }
.cand-top .top-actions { margin-left: auto; }
.cand-nav + .nav-toggle { margin-left: auto; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; background: var(--spruce); color: #fff; font-weight: 700; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(24,32,30,.14); padding: 12px 14px; min-width: 220px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.menu-panel p { margin: 0; }
.cand-content { max-width: 1080px; margin: 0 auto; padding: 28px 20px 56px; }
.app-candidate .flashes { max-width: 1040px; margin: 16px auto 0; padding: 0 20px; }
.cand-foot { max-width: 1080px; margin: 0 auto; padding: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.copyright { font-size: .78rem; color: #8FA8A1; }
.auth-foot { display: flex; flex-direction: column; gap: 8px; }
.cand-h1 { font-size: 1.75rem; letter-spacing: -.02em; }
.cand-h2 { font-size: 1.05rem; margin-top: 4px; }
.cand-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.side-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.side-block + .side-block { margin-top: 14px; }
.meeting-block { border-top: 3px solid var(--spruce); }
.meeting { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line); }
.meeting:last-child { border-bottom: 0; }

.progress-card { display: grid; grid-template-columns: 1fr 160px auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 24px; }
.pc-text { display: flex; flex-direction: column; }
.pc-bar { height: 8px; background: #E7EBE8; border-radius: 4px; overflow: hidden; }
.pc-bar span { display: block; height: 100%; background: var(--spruce); }

.app-cards { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.app-cards a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.app-cards a > span:first-child { flex: 1; }
.app-cards a:hover { border-color: var(--spruce); }

.jobs-hero { padding: 12px 0 24px; }
.jobs-hero h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -.03em; margin-bottom: 6px; max-width: 18ch; }
.jobs-hero p { color: var(--muted); }
.job-search { display: flex; flex-wrap: wrap; gap: 10px; background: var(--surface); padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.job-search .grow { flex: 1 1 260px; }
.job-search select { width: auto; }
.job-list { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--spruce); }
.job-list li a { display: flex; justify-content: space-between; gap: 20px; padding: 20px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.job-list li a:hover h2 { color: var(--spruce); text-decoration: underline; text-underline-offset: 3px; }
.job-list h2 { font-size: 1.2rem; margin-bottom: 4px; }
.jl-meta { color: var(--muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 0; }
.jl-meta span::before { content: "/"; margin: 0 8px; color: #B5BDB8; }
.jl-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; flex: none; }
.job-detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; margin-top: 10px; }
.jd-body { max-width: 68ch; }
.jd-body .cand-h2 { margin-top: 24px; }
.jd-apply { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--saffron); border-radius: var(--radius); padding: 18px 20px; position: sticky; top: 80px; }
.fit-note { background: var(--paper); padding: 10px 12px; border-radius: var(--radius-sm); }
.cv-chip { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; background: var(--paper); border: 1px solid var(--line); padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 10px; }

.status-track { margin: 20px 0 28px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); padding: 0; margin: 0; counter-reset: none; }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.steps li::before { content: ""; position: absolute; top: 8px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.steps li:first-child::before { display: none; }
.step-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid #C2CAC5; z-index: 1; }
.steps li.done { color: var(--ink); }
.steps li.done .step-dot { background: var(--spruce); border-color: var(--spruce); }
.steps li.done::before, .steps li.current::before { background: var(--spruce); }
.steps li.current { color: var(--ink); font-weight: 700; }
.steps li.current .step-dot { border-color: var(--saffron); background: var(--saffron); box-shadow: 0 0 0 4px var(--saffron-soft); }
.status-closed { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--muted); padding: 14px 16px; border-radius: var(--radius-sm); }

.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.field-row { display: flex; gap: 8px; margin-bottom: 8px; }
.custom-fields .hint { margin-top: 0; }
.drop { border: 1.5px dashed #B8C2BC; border-radius: var(--radius); padding: 18px; text-align: center; align-items: center; cursor: pointer; background: var(--paper); margin-top: 14px; }
.drop:hover { border-color: var(--spruce); }
.drop input { border: 0; background: transparent; padding: 0; width: auto; max-width: 100%; }

/* ---------- Auth ---------- */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; }
.auth-side { background: var(--spruce); color: #fff; padding: 36px 44px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.auth-pitch h1 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); letter-spacing: -.03em; max-width: 14ch; }
.auth-pitch p { color: #CFDCD8; max-width: 38ch; font-size: 1.05rem; }
.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 32px 20px; }
.auth-main .flashes { width: 100%; max-width: 420px; margin: 0 0 12px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 1.5rem; margin-bottom: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(3) { border-right: 0; }
  .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: span 2; }
  .detail-grid, .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .emp-shell { grid-template-columns: 1fr; }
  .emp-nav { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  .emp-nav.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .nav-toggle { display: inline-block; }
  .emp-top, .emp-content { padding-left: 16px; padding-right: 16px; }
  .flashes { margin: 12px 16px 0; }
  .dash-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .cand-grid, .job-detail, .profile-grid { grid-template-columns: 1fr; }
  .jd-apply { position: static; }
  .cand-top-inner { flex-wrap: wrap; gap: 12px; }
  .cand-nav { display: none; order: 3; width: 100%; flex-direction: column; align-items: stretch; }
  .cand-nav.open { display: flex; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 24px; }
  .progress-card { grid-template-columns: 1fr; }
  .breakdown { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { border-right: 0; border-bottom: 1px solid var(--line); }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); row-gap: 18px; }
  .steps li::before { display: none; }
  .job-list li a { flex-direction: column; }
  .jl-side { align-items: flex-start; text-align: left; }
  .candidate-head { flex-wrap: wrap; }
  .ch-score { align-items: flex-start; text-align: left; }
  .msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* API settings and guide */
.new-key { margin-bottom: 14px; }
.key-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.key-row code, .code { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: .85rem; }
.key-row code { background: var(--surface); border: 1px solid var(--line); padding: 6px 10px; border-radius: var(--radius-sm); word-break: break-all; flex: 1; }
pre.code { background: #16211F; color: #E3ECE9; padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; line-height: 1.5; margin: 0 0 12px; }
.field-table td:first-child code { white-space: nowrap; }
.req { color: var(--red); font-weight: 700; font-size: .78rem; }
.endpoint { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin: 4px 0; }
.method { font-family: Consolas, monospace; font-weight: 700; font-size: .78rem; padding: 2px 7px; border-radius: 3px; background: var(--spruce-soft); color: var(--spruce); }
.method.post { background: var(--saffron-soft); color: #7A5204; }
