/* ─────────────────────────────────────────────────────────────────────────
   Meta Neurons ATS — design system v2 (Dark AI-tech + gradient)
   Không tải tài nguyên ngoài: font hệ thống, hiệu ứng CSS thuần.
   ───────────────────────────────────────────────────────────────────────── */
:root {
  /* Bảng màu đồng bộ metaneurons.com: nền #06060d, primary #00DC82 (green),
     secondary #0066FF/#0099FF (blue), teal #00BBCC, purple #7C6AF7. */
  --bg: #06060d;
  --surface: #0b1310;
  --surface-2: #101c16;
  --surface-3: #17281f;
  --line: rgba(140, 220, 185, 0.13);
  --line-strong: rgba(140, 220, 185, 0.26);
  --text: #eef7f2;
  --muted: #97aaa2;
  --brand-a: #00DC82;   /* neon green  */
  --brand-b: #0066FF;   /* blue        */
  --grad: linear-gradient(135deg, #00DC82, #0066FF);
  --accent: #2fe39b;
  --teal: #00BBCC; --blue: #0099FF; --purple: #7C6AF7;
  --ok: #00DC82; --warn: #fbbf24; --err: #f87171;
  --pub: #00DC82; --cand: #a78bfa; --int: #00B4FF;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --glow: 0 0 0 1px rgba(0, 220, 130, 0.35), 0 8px 40px rgba(0, 180, 160, 0.16);
  /* aliases giữ tương thích v1 */
  --panel: var(--surface); --panel2: var(--surface-2);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }

/* ── Custom scrollbar toàn hệ thống (đồng bộ theme, thay thanh mặc định) ── */
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
/* WebKit/Blink (Chrome, Edge, Safari) */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
  border: 2px solid transparent;   /* tạo khe hở hai bên thumb */
  background-clip: padding-box;
  transition: background-color .15s;
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(var(--brand-a), var(--brand-b));
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:active { background: var(--brand-a); background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }
body {
  margin: 0;
  font: 14.5px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
::selection { background: rgba(0, 220, 130, 0.35); }

/* gradient text */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ── header / nav ─────────────────────────────────────────── */
header.app {
  position: sticky; top: 0; z-index: 40;
  padding: 14px 28px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: rgba(5, 20, 16, 0.7);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
header.app h1 { font-size: 16.5px; font-weight: 700; }
header.app .sub { color: var(--muted); font-size: 12.5px; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--grad);
  box-shadow: 0 0 18px rgba(0, 220, 130, 0.5);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff; font-weight: 800;
}
nav.top-links { display: flex; gap: 20px; margin-left: 22px; }
nav.top-links a { color: var(--muted); font-size: 13.5px; }
nav.top-links a:hover { color: var(--text); text-decoration: none; }

main.page { padding: 28px 24px 60px; max-width: 1200px; margin: 0 auto; }

/* ── cards ────────────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0)) , var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .2s, transform .2s, box-shadow .25s;
}
.card.hover:hover, .card.job:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 220, 130, 0.5);
  box-shadow: var(--glow);
}
.grid { display: grid; gap: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); font-size: 12.5px; }
.right { margin-left: auto; }

/* ── buttons ──────────────────────────────────────────────── */
button, .btn {
  position: relative; overflow: hidden;
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
              linear-gradient(120deg, rgba(140,220,185,.35), rgba(140,220,185,.12)) border-box;
  color: var(--text); border: 1px solid transparent;
  border-radius: 11px; padding: 9px 18px; cursor: pointer; font-size: 13.5px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .15s;
}
button:hover, .btn:hover {
  background: linear-gradient(var(--surface-3), var(--surface-3)) padding-box,
              var(--grad) border-box;
  text-decoration: none; transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
button:active { transform: translateY(0); }
button.primary, .btn.primary {
  background: var(--grad); border: none; color: #fff; font-weight: 650;
  box-shadow: 0 4px 22px rgba(0, 200, 130, 0.35), inset 0 1px 0 rgba(255,255,255,.25);
}
/* vệt sáng quét qua khi hover */
button.primary::after, .btn.primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%);
  transform: translateX(-110%); transition: transform .5s ease;
}
button.primary:hover::after, .btn.primary:hover::after { transform: translateX(110%); }
button.primary:hover, .btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(0, 190, 170, 0.45), inset 0 1px 0 rgba(255,255,255,.25);
}
button.danger { background: rgba(248,113,113,.06) padding-box, linear-gradient(120deg, rgba(248,113,113,.5), rgba(248,113,113,.2)) border-box; color: var(--err); }
button.danger:hover { background: rgba(248, 113, 113, 0.12) padding-box, var(--err) border-box; box-shadow: 0 6px 18px rgba(248,113,113,.15); }
button.ghost { background: transparent; border-color: transparent; box-shadow: none; }
button.ghost:hover { background: var(--surface-2); border-color: transparent; box-shadow: none; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ── forms ────────────────────────────────────────────────── */
input, select, textarea {
  background: rgba(8, 16, 13, 0.75); color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 11px; padding: 10px 13px; font-size: 13.5px; font-family: inherit;
  width: 100%; transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover, select:hover, textarea:hover { border-color: rgba(140, 220, 185, 0.45); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-a); background-color: rgba(10, 22, 17, 0.9);
  box-shadow: 0 0 0 3px rgba(0, 220, 130, 0.15), 0 0 24px rgba(0, 220, 130, 0.09);
}
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2394a1bf' stroke-width='1.8' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center;
}
select:focus {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2300DC82' stroke-width='1.8' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center;
}
::placeholder { color: rgba(151, 170, 162, 0.55); }

/* ── Custom dropdown (thay option native) ── đồng nhất iOS/Windows/mọi trình duyệt */
.dd { position: relative; display: inline-flex; }
.dd-btn {
  width: 100%; box-sizing: border-box; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(8, 16, 13, 0.75); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 11px;
  padding: 10px 13px; font-size: 13.5px; font-weight: 500;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.dd-btn:hover { border-color: rgba(140, 220, 185, 0.45); }
.dd-btn:focus-visible { outline: none; border-color: var(--brand-a); box-shadow: 0 0 0 3px rgba(0, 220, 130, 0.15); }
.dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-arrow { flex: none; color: var(--muted); transition: transform .18s ease; }
.dd.open .dd-btn { border-color: var(--brand-a); background-color: rgba(10, 22, 17, 0.9); box-shadow: 0 0 0 3px rgba(0, 220, 130, 0.15); }
.dd.open .dd-arrow { transform: rotate(180deg); color: var(--brand-a); }
.dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  margin: 0; padding: 6px; list-style: none;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55); max-height: 300px; overflow-y: auto;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
.dd.open .dd-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dd-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 11px; border-radius: 8px; font-size: 13.5px; color: var(--text);
  cursor: pointer; transition: background .12s;
}
.dd-opt:hover { background: var(--surface-3); }
.dd-opt[aria-selected="true"] { color: var(--brand-a); font-weight: 600; }
.dd-opt[aria-selected="true"]::after { content: "✓"; color: var(--brand-a); font-size: 12px; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }
input[type="file"] { padding: 8px; }
input[type="file"]::file-selector-button {
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 5px 12px; margin-right: 10px; cursor: pointer; font-size: 12.5px;
}
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.field { margin-bottom: 13px; }
form .row > .field { flex: 1; margin-bottom: 0; }

/* ── table ────────────────────────────────────────────────── */
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
tr:hover td { background: rgba(0, 220, 130, 0.045); }

/* ── badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2.5px 11px; border-radius: 999px; font-size: 11.5px;
  border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap;
  background: rgba(255, 255, 255, 0.02);
}
.badge.ok, .badge.published, .badge.hired, .badge.confirmed, .badge.accepted, .badge.synced, .badge.delivered { color: var(--ok); border-color: rgba(0,220,130,.5); background: rgba(0,220,130,.08); }
.badge.warn, .badge.draft, .badge.pending, .badge.offer, .badge.offer_accepted, .badge.sent, .badge.unassigned { color: var(--warn); border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.06); }
.badge.err, .badge.closed, .badge.rejected, .badge.failed, .badge.declined, .badge.expired, .badge.cancelled, .badge.dead { color: var(--err); border-color: rgba(248,113,113,.45); background: rgba(248,113,113,.06); }
.badge.info, .badge.applied, .badge.screening, .badge.interview, .badge.scheduled { color: var(--int); border-color: rgba(0,180,255,.45); background: rgba(0,180,255,.08); }
.badge.skill { color: #5ff0b6; border-color: rgba(0,220,130,.35); background: rgba(0,220,130,.07); }

/* ── toast ────────────────────────────────────────────────── */
.toast-wrap {
  position: fixed; z-index: 100;
  bottom: max(20px, env(safe-area-inset-bottom)); right: max(20px, env(safe-area-inset-right));
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--surface-2); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 11px 15px; max-width: 380px; font-size: 13px;
  box-shadow: var(--shadow); animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast.warn { border-left-color: var(--warn); }

/* ── modal ────────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(3, 5, 10, 0.78);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px; z-index: 50; overflow: auto; animation: fade-in .18s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0)), var(--surface);
  border: 1px solid var(--line-strong); border-radius: 18px;
  padding: 24px; width: 100%; max-width: 560px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow); animation: modal-in .22s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.modal.wide { max-width: 880px; }
.modal h2 { font-size: 17px; }

/* ── internal shell ───────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex: none; padding: 18px 12px 18px 2px;
  display: flex; flex-direction: column; gap: 1px;
  position: sticky; top: 0; height: 100vh;
  background: #06130f;
  border-right: 1px solid var(--line);
}
.sidebar .brand { font-size: 15px; font-weight: 700; padding: 4px 10px 16px; display: flex; align-items: center; gap: 9px; }
.sidebar a.nav {
  min-height: 36px; display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 12px;
  color: #91a39e; font-size: 13.5px; line-height: 20px; font-weight: 560; border: 1px solid transparent;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.sidebar a.nav .nav-icon { width: 17px; height: 17px; flex: 0 0 17px; opacity: .88; }
.sidebar a.nav .nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar a.nav:hover { background: rgba(0, 220, 130, .055); color: #c0d1cc; text-decoration: none; }
.sidebar a.nav.active {
  background: rgba(0, 190, 135, .09);
  border-color: rgba(0, 202, 145, .4);
  color: #00c990; font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(0, 145, 105, .08);
}
.sidebar a.nav.active .nav-icon { opacity: 1; }
.sidebar a.nav:focus-visible { outline: 2px solid rgba(0, 220, 130, .72); outline-offset: 2px; }
.content { flex: 1; padding: 24px 28px; min-width: 0; }
.content > h2 { font-size: 18px; margin-bottom: 16px; }

/* ── pipeline board ───────────────────────────────────────── */
/* Board cao ~viewport, chỉ cuộn NGANG; mỗi cột cuộn dọc nội bộ (kiểu Kanban).
   → tiêu đề cột luôn cố định trên đầu (nằm ngoài vùng cuộn thẻ), và vùng thả .col
   phủ hết chiều cao cột ⇒ kéo-thả được cả khi cột dài (cuộn trong từng cột, không
   cuộn cả trang nên cột đích luôn hiển thị đầy đủ). */
.board { display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; padding-bottom: 12px; align-items: stretch; height: calc(100vh - 140px); }
.col {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  width: 248px; flex: none; padding: 11px; display: flex; flex-direction: column; gap: 8px;
  min-height: 130px; overflow: hidden;
}
.col h3 { flex: none; font-size: 12.5px; display: flex; justify-content: space-between; padding: 2px 4px 6px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.col h3 .count { color: var(--text); background: var(--surface-3); border-radius: 999px; padding: 0 8px; font-size: 11px; }
.col.dragover { border-color: var(--brand-a); box-shadow: var(--glow); }
.col-cards { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.col-more { width: 100%; justify-content: center; font-size: 12.5px; padding: 7px 10px; margin-top: 2px; }
.card-app {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px;
  padding: 11px; cursor: grab; font-size: 13px; display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s, transform .15s;
}
.card-app:hover { border-color: rgba(0, 220, 130, 0.5); transform: translateY(-1px); }
.card-app:active { cursor: grabbing; }
.card-app .name { font-weight: 600; }
/* Row 20 — chọn nhiều thẻ bằng Ctrl/Cmd+Click (Shift+Click chọn dải) để từ chối hàng loạt. */
.card-app.selected { border-color: var(--brand-a); background: rgba(0, 220, 130, 0.10); box-shadow: 0 0 0 1px var(--brand-a) inset; }
.card-app.selected::after {
  content: "✓"; position: absolute; top: 6px; right: 8px; font-size: 11px; font-weight: 700;
  color: var(--brand-a); line-height: 1;
}
.card-app { position: relative; }

/* ── tabs / stats / misc ──────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: none; background: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 9px 14px; color: var(--muted); }
.tabs button.active { color: var(--text); border-bottom-color: var(--brand-a); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.stat .k { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.pager .pager-ctrl { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager button { padding: 5px 10px; font-size: 12.5px; min-width: 34px; justify-content: center; }
.pager button.active { color: var(--text); background: var(--surface-2); border-color: var(--brand-a); font-weight: 600; }
.pager button.pager-gap { color: var(--muted); min-width: 28px; padding: 5px 6px; }

/* Candidate profile list */
.candidate-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.candidate-toolbar-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.candidate-toolbar svg, .candidate-table svg {
  width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.candidate-toolbar-btn, .candidate-columns > summary, .candidate-sort > summary {
  min-height: 38px; padding: 7px 13px; border: 1px solid var(--line-strong);
  border-radius: 11px; color: var(--text); background: rgba(8, 16, 13, .72);
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; line-height: 1.2; list-style: none;
  transition: border-color .15s, background .15s, color .15s;
}
.candidate-toolbar-btn:hover, .candidate-columns > summary:hover, .candidate-sort > summary:hover,
.candidate-columns[open] > summary, .candidate-sort[open] > summary {
  border-color: rgba(0, 220, 130, .5); background: var(--surface-2);
}
.candidate-columns, .candidate-sort { position: relative; }
.candidate-columns > summary::-webkit-details-marker,
.candidate-sort > summary::-webkit-details-marker { display: none; }
.candidate-sort[data-order="asc"] > summary svg { transform: rotate(180deg); }
.candidate-sort-menu {
  position: absolute; z-index: 36; top: calc(100% + 8px); left: 0; width: 220px;
  padding: 6px; border: 1px solid var(--line-strong); border-radius: 11px;
  background: #0c1712; box-shadow: var(--shadow);
}
.candidate-sort-menu button {
  width: 100%; justify-content: flex-start; padding: 8px 10px; border: 0; border-radius: 7px;
  color: var(--muted); background: transparent; box-shadow: none; transform: none; font-size: 12.5px;
}
.candidate-sort-menu button:hover { color: var(--text); background: var(--surface-2); box-shadow: none; transform: none; }
.candidate-sort-menu button.active { color: var(--brand-a); background: rgba(0, 220, 130, .08); }
.candidate-sort-menu button.active::after { content: '✓'; margin-left: auto; }
.candidate-columns-menu {
  position: absolute; z-index: 35; top: calc(100% + 8px); left: 0; width: 230px;
  padding: 10px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: #0c1712; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px;
}
.candidate-columns-title {
  grid-column: 1 / -1; padding: 2px 7px 7px; color: var(--muted);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.candidate-columns-menu label {
  display: flex; align-items: center; gap: 7px; min-width: 0; margin: 0;
  padding: 6px 7px; border-radius: 7px; color: var(--text); font-size: 12px;
  cursor: pointer;
}
.candidate-columns-menu label:hover { background: var(--surface-2); }
.candidate-columns-menu input,
.candidate-table input[type="checkbox"] {
  width: 16px; height: 16px; flex: none; margin: 0; padding: 0;
  accent-color: var(--brand-a); cursor: pointer;
}
.candidate-table input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; border: 1.5px solid rgba(0, 220, 130, .72);
  border-radius: 50%; background: rgba(0, 220, 130, .025);
  box-shadow: inset 0 0 0 1px rgba(0, 220, 130, .08), 0 0 8px rgba(0, 220, 130, .12);
  transition: border-color .16s ease, background .16s ease, box-shadow .2s ease, transform .16s ease;
}
.candidate-table input[type="checkbox"]:hover {
  border-color: #32f6a5; background: rgba(0, 220, 130, .09);
  box-shadow: 0 0 0 3px rgba(0, 220, 130, .09), 0 0 13px rgba(0, 220, 130, .38);
  transform: scale(1.06);
}
.candidate-table input[type="checkbox"]:checked {
  border-color: #32f6a5;
  background-color: var(--brand-a);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 8 2.5 2.5L12 5.5' fill='none' stroke='%23060d09' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(135deg, #32f6a5, #00bbcc);
  background-position: center, center; background-repeat: no-repeat; background-size: 13px 13px, 100% 100%;
  box-shadow: 0 0 0 3px rgba(0, 220, 130, .12), 0 0 15px rgba(0, 220, 130, .62);
}
.candidate-table input[type="checkbox"]:indeterminate {
  border-color: #32f6a5;
  background: linear-gradient(#06100b, #06100b) center / 8px 2px no-repeat,
              linear-gradient(135deg, #32f6a5, #00bbcc);
  box-shadow: 0 0 0 3px rgba(0, 220, 130, .12), 0 0 15px rgba(0, 220, 130, .62);
}
.candidate-table input[type="checkbox"]:focus-visible {
  outline: none; box-shadow: 0 0 0 4px rgba(0, 220, 130, .2), 0 0 18px rgba(0, 220, 130, .7);
}
.candidate-download-selected { min-height: 38px; padding: 8px 15px; font-size: 13px; }
.candidate-list-card {
  min-width: 0; overflow: visible; border: 1px solid var(--line);
  border-radius: 15px; background: var(--surface);
}
.candidate-list-count {
  min-height: 42px; padding: 12px 18px; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px;
}
.candidate-loading { padding: 42px 18px; color: var(--muted); text-align: center; }
.candidate-table-scroll {
  max-height: min(62vh, 650px); overflow: auto; scrollbar-color: var(--line-strong) transparent;
}
.candidate-table { min-width: 1420px; border-collapse: separate; border-spacing: 0; }
.candidate-table th, .candidate-table td {
  padding: 12px 11px; border-bottom: 1px solid var(--line);
  vertical-align: middle; text-align: center; white-space: nowrap;
}
.candidate-table th {
  position: sticky; z-index: 12; top: 0; height: 42px;
  text-align: center;
  background: #0a1510; box-shadow: 0 1px 0 var(--line);
}
.candidate-table tbody tr:last-child td { border-bottom: 0; }
.candidate-table tbody tr:hover td { background: rgba(0, 220, 130, .035); }
.candidate-table [data-candidate-col="name"] { min-width: 160px; }
.candidate-table [data-candidate-col="received"] { min-width: 108px; }
.candidate-table [data-candidate-col="source"] { min-width: 100px; }
.candidate-table [data-candidate-col="cv"] { min-width: 120px; }
.candidate-table [data-candidate-col="position"] { min-width: 230px; }
.candidate-table [data-candidate-col="applied"],
.candidate-table [data-candidate-col="screening"],
.candidate-table [data-candidate-col="interview"],
.candidate-table [data-candidate-col="offer"],
.candidate-table [data-candidate-col="rejected"] { min-width: 112px; text-align: center; }
.candidate-table [data-candidate-col="stored"] { min-width: 150px; text-align: center; }
.candidate-table [data-candidate-col="actions"] { min-width: 76px; text-align: center; }
.candidate-select-cell { width: 46px; min-width: 46px; text-align: center !important; }
.candidate-row-check:disabled { cursor: not-allowed !important; }
.candidate-sort-mark { margin-left: 2px; color: var(--muted); }
.candidate-date { color: var(--muted); }
.candidate-dash { color: rgba(151, 170, 162, .55); }
.candidate-name {
  display: inline; margin-right: 5px; color: var(--text);
  font-size: 13px; font-weight: 700; text-align: center;
}
.candidate-position-item { padding: 2px 0; text-align: center; }
.candidate-position {
  display: block; max-width: 230px; margin: 0 auto; color: var(--text);
  font-size: 12.5px; font-weight: 600; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.candidate-stage-value { display: block; width: 100%; padding: 2px 0; }
.candidate-stage-value .badge { font-weight: 600; }
.candidate-table .badge.applied { color: #16d9d0; border-color: rgba(22,217,208,.45); background: rgba(22,217,208,.08); }
.candidate-table .badge.screening { color: #58b9ff; border-color: rgba(88,185,255,.45); background: rgba(88,185,255,.08); }
.candidate-table .badge.interview { color: #26d997; border-color: rgba(38,217,151,.45); background: rgba(38,217,151,.08); }
.candidate-table .badge.stored { color: #a990ff; border-color: rgba(169,144,255,.48); background: rgba(169,144,255,.09); }
.candidate-table .badge.offer, .candidate-table .badge.offer_accepted { color: #f7cc3d; border-color: rgba(247,204,61,.48); background: rgba(247,204,61,.08); }
.candidate-table .badge.rejected { color: #ff7777; border-color: rgba(255,119,119,.48); background: rgba(255,119,119,.08); }
.candidate-cv-actions { display: flex; align-items: center; justify-content: center; gap: 5px; }
.candidate-cv-actions button {
  overflow: visible; padding: 4px 3px; border: 0; border-radius: 6px;
  color: var(--text); background: transparent; box-shadow: none; transform: none;
  font-size: 12px; font-weight: 600; gap: 5px;
}
.candidate-cv-actions button:hover { color: var(--accent); background: rgba(0,220,130,.08); box-shadow: none; transform: none; }
.candidate-cv-actions svg { width: 15px; height: 15px; color: var(--muted); }
.candidate-actions-cell { position: relative; }
.candidate-row-actions { position: relative; display: inline-block; }
.candidate-row-actions > summary {
  width: 34px; height: 28px; padding: 0; border-radius: 8px; list-style: none;
  color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 800;
  letter-spacing: 1px; display: inline-flex; align-items: center; justify-content: center;
}
.candidate-row-actions > summary::-webkit-details-marker { display: none; }
.candidate-row-actions > summary:hover, .candidate-row-actions[open] > summary {
  color: var(--text); background: var(--surface-2);
}
.candidate-action-menu {
  position: absolute; z-index: 28; top: calc(100% + 5px); right: 0;
  width: 178px; padding: 6px; border: 1px solid var(--line-strong);
  border-radius: 11px; background: #0d1813; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
}
.candidate-table tbody tr:nth-last-child(-n + 2) .candidate-action-menu {
  top: auto; bottom: calc(100% + 5px);
}
.candidate-action-menu button {
  width: 100%; justify-content: flex-start; padding: 8px 9px; border: 0;
  border-radius: 7px; color: var(--text); background: transparent;
  box-shadow: none; transform: none; font-size: 12.5px;
}
.candidate-action-menu button:hover { background: var(--surface-2); box-shadow: none; transform: none; }
.candidate-action-menu button.danger { color: var(--err); background: transparent; }
.candidate-action-menu button.danger:hover { background: rgba(248,113,113,.1); }
.candidate-action-menu svg { width: 16px; height: 16px; }
.candidate-list-footer {
  min-height: 52px; padding: 9px 16px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.candidate-list-footer label {
  display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 12px;
}
.candidate-list-footer select {
  width: 66px; height: 32px; padding: 5px 28px 5px 11px; border-radius: 9px; font-size: 12px;
  background-position: right 9px center;
}
.candidate-page-controls { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.candidate-page-controls button { width: 32px; height: 32px; min-width: 32px; padding: 0; font-size: 19px; }

/* Unified candidate/application profile, inspired by the Talent Scout reference. */
.modal.candidate-profile-modal {
  max-width: 980px; padding: 0; gap: 12px; border: 0;
  background: transparent; box-shadow: none;
}
.candidate-profile { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.candidate-profile-hero,
.candidate-profile-section,
.candidate-profile-footer {
  border: 1px solid var(--line-strong); border-radius: 15px;
  background: linear-gradient(180deg, rgba(255,255,255,.018), transparent), #0c1512;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.candidate-profile-hero { padding: 20px; display: flex; flex-direction: column; gap: 13px; }
.candidate-profile-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.candidate-profile-title h2 { font-size: 20px; line-height: 1.3; }
.candidate-profile-meta { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.candidate-profile-switch { display: flex; align-items: center; gap: 10px; margin: 0; }
.candidate-profile-switch select { width: min(430px, 100%); }
.candidate-profile-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.candidate-profile-actions select { width: 220px; }
.candidate-profile-actions button { min-height: 38px; padding: 8px 14px; font-size: 12.5px; }
.candidate-profile-section { overflow: hidden; }
.candidate-profile-section > summary {
  min-height: 46px; padding: 12px 17px; list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 9px; border-bottom: 1px solid transparent;
  color: var(--text); font-size: 12.5px; font-weight: 750; letter-spacing: .015em;
}
.candidate-profile-section > summary::-webkit-details-marker { display: none; }
.candidate-profile-section > summary::before {
  content: '›'; color: var(--muted); font-size: 19px; line-height: 1;
  transform: rotate(0); transition: transform .16s ease;
}
.candidate-profile-section[open] > summary { border-bottom-color: var(--line); }
.candidate-profile-section[open] > summary::before { transform: rotate(90deg); }
.candidate-profile-section-icon { color: var(--brand-a); font-size: 16px; line-height: 1; }
.candidate-profile-section-body { padding: 17px; min-width: 0; }
.candidate-profile-info-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 34px;
}
.candidate-profile-info-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.candidate-profile-info-grid span,
.candidate-profile-subtitle { color: var(--muted); font-size: 11.5px; }
.candidate-profile-info-grid strong { overflow-wrap: anywhere; font-size: 13px; }
.candidate-profile-multiline,
.candidate-profile-experience { white-space: pre-wrap; }
.candidate-profile-text-rows,
.candidate-profile-text-rows-list { display: flex; flex-direction: column; gap: 7px; }
.candidate-profile-text-row { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 6px; }
.candidate-profile-text-row-remove { min-height: 38px; padding: 6px; color: var(--muted); font-size: 18px; }
.candidate-profile-text-row-remove:hover { color: var(--err); }
.candidate-profile-text-row-add { align-self: flex-start; min-height: 32px; padding: 5px 9px; color: var(--brand-a); font-size: 12px; }
.candidate-profile-subtitle { margin: 18px 0 7px; }
.candidate-profile-skills { display: flex; flex-wrap: wrap; gap: 7px; }
.candidate-profile-skills > span:not(.muted) {
  padding: 3px 10px; border: 1px solid rgba(0,180,255,.42); border-radius: 999px;
  color: #64c7ff; background: rgba(0,180,255,.07); font-size: 11.5px;
}
.candidate-profile-experience,
.candidate-profile-feedback,
.candidate-profile-notes > div {
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(5, 12, 9, .38); font-size: 12.5px;
}
.candidate-profile-links { display: flex; align-items: center; gap: 9px 14px; flex-wrap: wrap; }
button.candidate-profile-edit-button {
  min-height: 40px; padding: 9px 15px; color: var(--brand-a); font-weight: 700;
  border: 1px solid transparent;
  background: linear-gradient(rgba(0, 220, 130, .09), rgba(0, 220, 130, .09)) padding-box,
              linear-gradient(120deg, rgba(0, 220, 130, .75), rgba(24, 216, 194, .35)) border-box;
  box-shadow: 0 4px 16px rgba(0, 220, 130, .12), inset 0 1px 0 rgba(255, 255, 255, .06);
}
button.candidate-profile-edit-button:hover {
  color: #8dffd0;
  background: linear-gradient(rgba(0, 220, 130, .16), rgba(0, 220, 130, .16)) padding-box,
              linear-gradient(120deg, var(--brand-a), #18d8c2) border-box;
  box-shadow: 0 6px 22px rgba(0, 220, 130, .2);
}
button.candidate-profile-edit-button:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(0, 220, 130, .2), 0 6px 22px rgba(0, 220, 130, .2);
}
button.candidate-profile-link {
  overflow: visible; padding: 2px 0; border: 0; border-radius: 0; color: var(--brand-a);
  background: transparent; box-shadow: none; transform: none; font-size: 12px;
}
button.candidate-profile-link:hover { color: #66ffc3; background: transparent; box-shadow: none; transform: none; text-decoration: underline; }
.candidate-profile-edit { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.candidate-profile-edit > summary { color: var(--accent); cursor: pointer; font-size: 12.5px; font-weight: 650; }
.candidate-profile-edit form { margin-top: 13px; }
.candidate-profile-ai { display: flex; flex-direction: column; gap: 14px; }
.candidate-profile-score {
  display: grid; grid-template-columns: auto minmax(120px, 1fr) auto; align-items: center; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(5,12,9,.38);
}
.candidate-profile-score > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.candidate-profile-score > div { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.candidate-profile-score i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #00dc82, #18d8c2); box-shadow: 0 0 14px rgba(0,220,130,.5); }
.candidate-profile-score b { color: var(--brand-a); font-size: 12px; }
.candidate-profile-points > b { display: block; margin-bottom: 6px; font-size: 12.5px; }
.candidate-profile-points.positive > b { color: var(--ok); }
.candidate-profile-points.negative > b { color: var(--warn); }
.candidate-profile-points ul { display: flex; flex-direction: column; gap: 5px; margin: 0; padding-left: 18px; }
.candidate-profile-points li { color: var(--muted); font-size: 12.5px; }
.candidate-profile-points li b { color: var(--text); }
.candidate-profile-table-scroll { overflow-x: auto; }
.candidate-profile-table-scroll table { min-width: 680px; }
.iv-scorecards-cell { min-width: 200px; vertical-align: top; }
.iv-scorecard-item { padding: 5px 0; border-bottom: 1px solid var(--line); }
.iv-scorecard-item:last-of-type { border-bottom: none; }
.iv-scorecard-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.iv-sc-edit-btn { padding: 1px 8px !important; font-size: 12px !important; line-height: 1.4; }
.iv-sc-add-btn { margin-top: 6px; font-size: 12px; }
.iv-scorecard-scores { display: flex; flex-wrap: wrap; gap: 3px; }
.iv-scorecard-comment { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
/* Offer / rejection email preview popup */
.offer-email-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 4px; }
.offer-email-fields { display: flex; flex-direction: column; gap: 4px; }
.offer-email-section-label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 4px; }
.offer-email-preview-pane { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; max-height: 520px; overflow-y: auto; }
.offer-email-preview-subject { font-weight: 700; font-size: 13px; margin-bottom: 10px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.offer-email-preview-body { font-size: 13px; line-height: 1.65; color: var(--text); }
.offer-email-preview-body p { margin: 8px 0; }
.offer-email-preview-body ul { padding-left: 20px; margin: 6px 0; }
.offer-email-preview-body li { margin: 3px 0; }
@media (max-width: 700px) { .offer-email-grid { grid-template-columns: 1fr; } }
.candidate-profile-notes { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.candidate-profile-notes > div > span { color: var(--muted); font-size: 11px; }
.candidate-profile-notes p,
.candidate-profile-feedback p { margin: 4px 0 0; }
.candidate-profile-note-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.candidate-profile-note-form input[name="content"] { flex: 1 0 100%; }
/* ── inline @mention picker ─────────────── */
.mention-content-wrap { position: relative; flex: 1 0 100%; }
.mention-content-wrap input { width: 100%; }
.mention-actions-row { display: flex; gap: 8px; align-items: flex-start; flex: 1 0 100%; }
.mention-chips-wrap { display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; flex: 1; min-width: 0; }
.mention-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(0,184,212,.13); color: var(--text);
  border: 1px solid rgba(0,184,212,.32); border-radius: 20px;
  padding: 2px 9px; font-size: 11.5px; line-height: 1.5;
}
.mention-chip-x { background: none; border: none; color: inherit; opacity: .6; cursor: pointer; padding: 0 2px; font-size: 14px; line-height: 1; }
.mention-chip-x:hover { opacity: 1; }
.mention-dropdown {
  position: fixed; z-index: 9999;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  list-style: none; padding: 4px 0; margin: 0;
  max-height: 220px; overflow-y: auto;
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
}
.mention-dropdown li { padding: 8px 12px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.mention-dropdown li:hover, .mention-dropdown li.active { background: var(--panel2); }
.candidate-profile-feedback + .candidate-profile-feedback { margin-top: 8px; }
.candidate-profile-footer { padding: 11px 15px; display: flex; justify-content: flex-end; gap: 8px; }
.candidate-profile-footer button { padding: 8px 16px; }

.candidate-email-section { display: flex; flex-direction: column; gap: 16px; }
.candidate-email-compose {
  padding: 15px; border: 1px solid rgba(0,220,130,.2); border-radius: 12px;
  background: linear-gradient(150deg, rgba(0,220,130,.055), rgba(0,102,255,.025));
}
.candidate-email-compose form { margin-top: 14px; }
.candidate-email-compose .field { min-width: 0; }
.candidate-email-auto-cc,
.candidate-email-schedule {
  display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 12.5px;
}
.candidate-email-auto-cc { margin: 2px 0 12px; }
.candidate-email-auto-cc input,
.candidate-email-schedule input { width: 16px; height: 16px; accent-color: var(--brand-a); }
.candidate-email-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding: 7px;
  border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 9px 9px 0 0;
  background: rgba(2,10,7,.58);
}
.candidate-email-toolbar button,
.candidate-email-toolbar select,
.candidate-email-attach {
  min-height: 30px; width: auto; padding: 5px 9px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel2); color: var(--text); font-size: 11.5px;
}
.candidate-email-toolbar button:hover,
.candidate-email-attach:hover { border-color: var(--brand-a); color: var(--brand-a); }
.candidate-email-attach { display: inline-flex; align-items: center; cursor: pointer; }
.candidate-email-color {
  display: inline-flex; width: 30px; height: 30px; padding: 4px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel2); cursor: pointer;
}
.candidate-email-color input { width: 20px; height: 20px; padding: 0; border: 0; background: transparent; }
.candidate-email-editor {
  min-height: 190px; max-height: 420px; overflow: auto; padding: 13px;
  border: 1px solid var(--line-strong); border-radius: 0 0 9px 9px; outline: none;
  background: rgba(4,13,9,.7); color: var(--text); line-height: 1.55;
}
.candidate-email-editor:focus { border-color: rgba(0,220,130,.7); box-shadow: inset 0 0 0 1px rgba(0,220,130,.2); }
.candidate-email-editor:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.candidate-email-files,
.candidate-email-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.candidate-email-files span,
.candidate-email-attachments span {
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.025); color: var(--muted); font-size: 11.5px;
}
.candidate-email-send-row { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 12px; }
.candidate-email-send-row input[type="datetime-local"] { width: auto; min-width: 210px; }
.candidate-email-history-title { display: flex; align-items: center; justify-content: space-between; }
.candidate-email-thread { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.candidate-email-thread + .candidate-email-thread { margin-top: 8px; }
.candidate-email-thread > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 13px; cursor: pointer; background: rgba(255,255,255,.018);
}
.candidate-email-thread-messages { display: flex; flex-direction: column; gap: 9px; padding: 10px; border-top: 1px solid var(--line); }
.candidate-email-message {
  padding: 12px; border-left: 3px solid #10b981; border-radius: 8px;
  background: rgba(4,13,9,.62); overflow: hidden;
}
.candidate-email-message.inbound { border-left-color: #3b82f6; }
.candidate-email-message-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.candidate-email-message-head time { color: var(--muted); font-size: 11.5px; }
.candidate-email-address { color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.candidate-email-address span { color: var(--text); }
.candidate-email-message-subject { margin: 9px 0 6px; font-weight: 700; }
.candidate-email-message-body { line-height: 1.55; overflow-wrap: anywhere; }
.candidate-email-message-body p { margin: 5px 0; }
.candidate-email-message-body a { color: var(--brand-a); }
.candidate-email-error { margin-top: 8px; padding: 7px 9px; border-radius: 6px; background: rgba(239,68,68,.1); color: #ff8b8b; font-size: 11.5px; }
.candidate-email-empty { padding: 20px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; }

@media (max-width: 720px) {
  .candidate-profile-hero { padding: 16px; }
  .candidate-profile-title { flex-direction: column; }
  .candidate-profile-info-grid { grid-template-columns: 1fr; gap: 12px; }
  .candidate-profile-actions, .candidate-profile-switch { align-items: stretch; flex-direction: column; }
  .candidate-profile-actions select, .candidate-profile-actions button, .candidate-profile-switch select { width: 100%; }
  .candidate-profile-score { grid-template-columns: 1fr auto; }
  .candidate-email-compose .row,
  .candidate-email-send-row,
  .candidate-email-thread > summary,
  .candidate-email-message-head { align-items: stretch; flex-direction: column; }
  .candidate-email-send-row input[type="datetime-local"],
  .candidate-email-send-row button { width: 100%; }
  .candidate-profile-score > div { grid-column: 1 / -1; grid-row: 2; }
  .mention-actions-row { flex-direction: column; }
}

/* ── email chips input ────────────────────────────────────── */
.chips-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 42px; padding: 6px 8px; cursor: text;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.chips-input:focus-within { border-color: var(--brand-a); box-shadow: 0 0 0 3px rgba(0,220,130,.12); }
.chips-input .chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 6px 3px 10px; font-size: 12.5px; line-height: 1.5;
  color: var(--text); background: rgba(0,220,130,.08);
  border: 1px solid rgba(0,220,130,.5); border-radius: 999px; max-width: 100%;
}
.chips-input .chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips-input .chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; min-width: 0; font-size: 14px; line-height: 1;
  color: var(--muted); background: transparent; border: none; border-radius: 50%; box-shadow: none;
}
.chips-input .chip-x:hover { color: var(--err); background: rgba(248,113,113,.12); transform: none; }
.chips-input .chips-entry {
  flex: 1; min-width: 140px; margin: 0; padding: 4px 2px;
  background: transparent; border: none; box-shadow: none; border-radius: 0;
}
.chips-input .chips-entry:focus { border: none; box-shadow: none; outline: none; }
.chips-input .chips-entry.invalid { color: var(--err); }
/* Ô "+ thêm…" là <select>: ép nền tối + chữ sáng cho cả control lẫn dropdown,
   nếu không option bị chữ trắng trên nền trắng (mặc định trình duyệt). */
.chips-input select.chips-add { color: var(--text); background: var(--surface-2); cursor: pointer; }
.chips-input select.chips-add option { color: var(--text); background: var(--surface-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.pub { background: var(--pub); } .dot.cand { background: var(--cand); } .dot.int { background: var(--int); }
pre.json {
  background: #070b14; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: 12px/1.5 ui-monospace, Menlo, monospace;
  overflow: auto; max-height: 300px; white-space: pre-wrap; margin: 0;
}
code { background: var(--surface-3); border-radius: 6px; padding: 1px 6px; font-size: 12px; }

/* ── hero decorations (careers / login) ───────────────────── */
.fx-wrap { position: relative; overflow: hidden; }
.fx-grid::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(110, 220, 175, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 220, 175, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 45%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 45%, transparent 100%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; }
.orb.a { width: 420px; height: 420px; background: rgba(0, 220, 130, 0.26); top: -140px; left: 6%; animation: drift 16s ease-in-out infinite alternate; }
.orb.b { width: 360px; height: 360px; background: rgba(0, 130, 255, 0.24); top: -60px; right: 4%; animation: drift 20s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(50px, 36px); } }
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } }

.notif-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--err); }

/* ── motion utilities ─────────────────────────────────────── */
/* chữ gradient lấp lánh chậm */
.shimmer {
  background: linear-gradient(100deg, #00DC82, #00BBCC, #00B4FF, #00DC82);
  background-size: 260% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer { to { background-position: -260% 0; } }

/* hiện dần khi cuộn tới (kèm IntersectionObserver) */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.16,1,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }

/* card viền gradient khi hover (đẹp hơn đổi màu viền đơn) */
.card.job, .card.hover {
  border: 1px solid transparent;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0)) padding-box,
              linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(120deg, rgba(140,220,185,.22), rgba(140,220,185,.08)) border-box;
}
.card.job:hover, .card.hover:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0)) padding-box,
              linear-gradient(var(--surface), var(--surface)) padding-box,
              var(--grad) border-box;
  transform: translateY(-4px);
  box-shadow: 0 18px 44px rgba(0,0,0,.5), 0 0 30px rgba(0, 200, 140, 0.13);
}
@media (prefers-reduced-motion: reduce) {
  .shimmer { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── responsive / mobile (iOS + Android) ──────────────────────
   Chưa có breakpoint nào cho màn nhỏ: dưới đây gom hết các sửa đổi
   cho điện thoại. Áp cho MỌI trang dùng ui.css (nội bộ, careers, ứng viên). */

/* iOS: không "phình" chữ khi xoay ngang. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

@media (max-width: 820px) {
  /* iOS zoom-on-focus khi input < 16px → ép 16px lúc focus trên mobile. */
  input, select, textarea { font-size: 16px; }

  /* Shell nội bộ: sidebar dọc → thanh điều hướng ngang cuộn được trên đầu.
     Thanh dính đỉnh phải né Dynamic Island của iPhone 16 (safe-area-inset-top). */
  .shell { flex-direction: column; min-height: 100vh; min-height: 100dvh; }
  .sidebar {
    width: 100%; height: auto;
    position: sticky; top: 0; z-index: 45;
    flex-direction: row; align-items: center; gap: 4px;
    padding: 8px 10px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-right: none; border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar .brand { padding: 0 6px; margin: 0; font-size: 14px; white-space: nowrap; flex: none; }
  .sidebar a.nav { padding: 7px 11px; font-size: 13px; white-space: nowrap; flex: none; }
  /* Khối tên + đăng xuất: gọn lại, đẩy về cuối; ẩn badge vai trò cho đỡ chật. */
  .sidebar > .muted {
    display: flex; align-items: center; gap: 8px;
    /* !important để thắng inline style margin-top:auto của khối này. */
    margin: 0 0 0 auto !important; padding: 0 4px; flex: none; white-space: nowrap;
  }
  .sidebar > .muted br, .sidebar > .muted .badge { display: none; }
  .sidebar > .muted > div { margin-top: 0 !important; }

  /* Giảm padding khung nội dung để tận dụng bề ngang; chừa safe-area 2 bên +
     đáy (home indicator) để nội dung cuối không bị che. */
  .content {
    padding: 16px max(14px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-right));
  }
  main.page {
    padding: 20px max(14px, env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
  /* header đăng nhập cũng dính đỉnh → né Dynamic Island. */
  header.app {
    padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  }

  /* Bảng: cho cuộn ngang trong khung thay vì bóp cột chật cứng. */
  .content table, .card table {
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .content .candidate-table { display: table; overflow: visible; }
  .candidate-table-scroll { max-height: 62vh; -webkit-overflow-scrolling: touch; }

  /* Modal: vừa khít màn hình nhỏ. */
  .modal, .modal.wide { max-width: 100%; }
  .modal-bg { padding: 4vh 10px; }

  /* Toast không rộng quá viewport; chừa safe-area (home indicator + viền bo). */
  .toast-wrap {
    left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .toast { max-width: none; }

  /* Grid auto-fit inline (báo cáo) → 1 cột trên mobile. */
  .grid[style*="minmax"] { grid-template-columns: 1fr !important; }
}

/* ── mobile UX: nút bấm, tìm kiếm, trường nhập (≤640px, tối ưu iPhone 16 Pro 402px) ── */
@media (max-width: 640px) {
  /* Nút bấm to hơn cho dễ chạm (≈44px HIG). Chỉ tăng padding ở nút thường —
     chip-x/pager/tabs có rule riêng đặc thù hơn nên không bị ảnh hưởng. */
  button, .btn { padding: 12px 18px; }

  /* Tiêu đề + hành động: xếp dọc để tên không chen với nút. */
  .row.spread { flex-direction: column; align-items: stretch; gap: 10px; }
  .row.spread > h2 { margin-bottom: 0; }
  /* Cụm nút ở đầu trang trải đều, dễ chạm. */
  .row.spread > .row, .row.spread > span.row { width: 100%; }
  .row.spread > .row > button, .row.spread > span.row > button { flex: 1; }
  .candidate-toolbar { align-items: stretch; flex-direction: column; }
  .candidate-toolbar-group { display: grid; grid-template-columns: 1fr; }
  .candidate-toolbar-btn, .candidate-columns > summary, .candidate-sort > summary, .candidate-download-selected {
    width: 100%; justify-content: center;
  }
  .candidate-columns-menu { width: min(290px, calc(100vw - 32px)); }
  .candidate-list-footer { align-items: stretch; flex-direction: column; }
  .candidate-page-controls { justify-content: space-between; }

  /* Thanh tìm kiếm/lọc: lưới 2 cột gọn, mỗi ô full-width, nút + ghi chú trải hết. */
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
  .filters > input, .filters > select, .filters > label,
  .filters > button, .filters > .muted, .filters > span {
    max-width: none !important; width: 100%; margin: 0;
  }
  .filters > label { display: flex; align-items: center; gap: 6px; }
  .filters > label input { width: 100%; }
  .filters > label br { display: none; }
  .filters > button, .filters > .muted { grid-column: 1 / -1; }

  /* Trường nhập trong form modal: 2 ô cạnh nhau → xuống dòng full-width. */
  form .row > .field { flex: 1 1 100%; }

  /* Modal footer: nút hành động dễ chạm, trải rộng. */
  .modal .row[style*="flex-end"] { flex-direction: column-reverse; align-items: stretch; }
  .modal .row[style*="flex-end"] > button { width: 100%; }
}

@media (max-width: 480px) {
  body { font-size: 14px; }
  .content { padding: 14px 11px; }
  main.page { padding: 16px 12px 40px; }
  header.app { padding: 10px 13px; }
  header.app h1 { font-size: 15px; }
  .stat .v { font-size: 24px; }
  /* Cột pipeline hẹp lại để lộ rõ có thể vuốt ngang. */
  .board .col { width: 82vw; max-width: 300px; }
  .modal { padding: 18px; border-radius: 14px; }
}

/* Màn siêu hẹp: thanh lọc về 1 cột (iPhone 16 Pro 402px vẫn giữ 2 cột). */
@media (max-width: 380px) {
  .filters { grid-template-columns: 1fr; }
}

/* ── filter chip rows ────────────────────────────────────────────────── */
.frow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.frow-label { font-size: 12px; color: var(--muted); white-space: nowrap; width: 84px; flex-shrink: 0; }
.frow-scroll { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; }
.fchips { display: flex; gap: 4px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; flex: 1; padding-bottom: 2px; }
.fchips::-webkit-scrollbar { display: none; }
.fchip {
  font-size: 12px; padding: 3px 11px; border-radius: 999px;
  background: transparent; cursor: pointer; white-space: nowrap;
  color: var(--muted); transition: all .15s; flex-shrink: 0;
  border: 1px solid rgba(140,220,185,.25);
}
.fchip:hover { border-color: var(--int); color: var(--int); transform: none; box-shadow: none; }
.fchip.active { background: rgba(0,180,255,.15); border-color: var(--int); color: var(--int); font-weight: 600; }
.fscroll-btn {
  background: transparent; border: 1px solid rgba(140,220,185,.2);
  border-radius: 50%; width: 22px; height: 22px; min-width: 22px;
  padding: 0; cursor: pointer; flex-shrink: 0; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: all .15s;
}
.fscroll-btn:hover { border-color: var(--int); color: var(--int); transform: none; box-shadow: none; }

/* ── bot template — sidebar + panel layout ──────────────── */
.bt-layout { display:flex; flex-direction:row; min-height:540px; overflow:hidden; padding:0; border-radius:var(--radius); gap:0; }
.bt-sidebar { width:212px; flex:none; border-right:1px solid var(--line); padding:8px 6px; display:flex; flex-direction:column; gap:2px; overflow-y:auto; }
.bt-nav-btn { width:100%; display:flex; flex-direction:column; align-items:flex-start; gap:5px; padding:10px 12px; border-radius:8px; background:transparent; border:1px solid transparent; color:var(--muted); cursor:pointer; text-align:left; transform:none !important; box-shadow:none !important; transition:background .14s,color .14s; }
.bt-nav-btn:hover { background:var(--surface-2); color:var(--text); border-color:transparent; }
.bt-nav-btn.active { background:rgba(0,220,130,.1); color:var(--text); border-color:rgba(0,220,130,.2); }
.bt-nav-name { font-size:12.5px; font-weight:500; line-height:1.35; }
.bt-panel { flex:1; display:none; flex-direction:column; overflow:hidden; min-width:0; }
.bt-panel.visible { display:flex; }
.bt-panel-hd { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:16px 22px; border-bottom:1px solid var(--line); flex-shrink:0; flex-wrap:wrap; }
.bt-panel-title { font-size:13.5px; font-weight:600; margin-bottom:2px; }
.bt-panel-sub { font-size:11.5px; color:var(--muted); }
.bt-panel-hd-r { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.bt-panel-bd { padding:18px 22px; overflow-y:auto; flex:1; display:flex; flex-direction:column; gap:0; }
.bt-panel-foot { padding:12px 22px; border-top:1px solid var(--line); display:flex; align-items:center; gap:10px; flex-shrink:0; }
/* toolbar connected to editor */
.bt-toolbar { display:flex; gap:2px; padding:5px 6px; background:var(--surface-3); border:1px solid var(--line-strong); border-bottom:none; border-radius:8px 8px 0 0; }
.bt-toolbar button { background:transparent; border:1px solid transparent; border-radius:5px; padding:3px 10px; font-size:12px; color:var(--muted); cursor:pointer; min-width:28px; line-height:1.5; transform:none !important; box-shadow:none !important; transition:background .12s,color .12s; }
.bt-toolbar button:hover { background:rgba(0,220,130,.1); color:var(--brand-a); border-color:transparent; }
.bt-toolbar .bt-sep { width:1px; background:var(--line-strong); margin:4px 3px; align-self:stretch; }
/* editor */
.bt-editor { min-height:130px; max-height:260px; background:rgba(8,16,13,.75); color:var(--text); border:1px solid var(--line-strong); border-radius:0 0 8px 8px; padding:10px 12px; font:13px/1.65 ui-monospace,Menlo,Consolas,monospace; white-space:pre-wrap; word-break:break-word; overflow-y:auto; outline:none; cursor:text; transition:border-color .15s,box-shadow .15s; }
.bt-editor:hover { border-color:rgba(140,220,185,.45); }
.bt-editor:focus { border-color:var(--brand-a); box-shadow:0 0 0 3px rgba(0,220,130,.15),0 0 24px rgba(0,220,130,.09); }
.bt-editor:empty::before { content:attr(data-placeholder); color:rgba(151,170,162,.4); pointer-events:none; }
/* var chip inside editor */
.bt-var { background:rgba(0,220,130,.12); color:var(--brand-a); border:1px solid rgba(0,220,130,.28); border-radius:4px; padding:0 4px; font-size:11.5px; }
/* insert-variable chips below editor */
.bt-chips-wrap { margin-top:10px; display:flex; flex-direction:column; gap:5px; }
.bt-chips-row { display:flex; flex-wrap:wrap; gap:4px; align-items:center; }
.bt-chips-lbl { font-size:10.5px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); white-space:nowrap; }
.bt-chip { cursor:pointer; font-size:10.5px; background:rgba(0,220,130,.07); border:1px solid rgba(0,220,130,.2); border-radius:5px; padding:2px 8px; color:rgba(0,220,130,.75); font-family:ui-monospace,Menlo,monospace; user-select:none; transition:all .12s; }
.bt-chip:hover { background:rgba(0,220,130,.14); border-color:var(--brand-a); color:var(--brand-a); }
.bt-chip.req { background:rgba(251,191,36,.07); border-color:rgba(251,191,36,.28); color:rgba(251,191,36,.8); }
.bt-chip.req:hover { background:rgba(251,191,36,.12); border-color:var(--warn); color:var(--warn); }
