:root {
  --navy: #10233f;
  --navy-light: #16305a;
  --blue: #1868db;
  --blue-dark: #0f4fb0;
  --blue-bg: #eaf1fd;
  --bg: #f2f4f8;
  --card: #ffffff;
  --border: #dde2ea;
  --ink: #1b2430;
  --muted: #626c7a;
  --green: #1a7f4e;
  --green-bg: #e4f5ec;
  --amber: #9a6b0a;
  --amber-bg: #fbf0da;
  --red: #b3311f;
  --red-bg: #fbe7e4;
  --purple: #5b3fae;
  --purple-bg: #ece7fb;
  --radius: 6px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
.display { font-family: 'Fraunces', serif; }
.mono { font-family: 'IBM Plex Mono', monospace; }

#toast {
  position: fixed; top: 20px; right: 20px; z-index: 999;
  background: var(--navy); color: #fff;
  padding: 10px 16px; border-radius: var(--radius); font-size: 13px;
  box-shadow: 0 6px 18px rgba(16,35,63,0.25);
  opacity: 0; transform: translateY(-6px); transition: all .2s ease;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateY(0); }

/* ---------- top bar ---------- */
.topbar { background: var(--navy); border-bottom: 1px solid rgba(255,255,255,0.08); }
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: flex-start; gap: 28px; height: 56px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 30px; height: 30px; border-radius: 6px; background: var(--blue);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.brand-name { font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 15px; color: #fff; letter-spacing: 0.01em; }
.tabs { display: flex; gap: 2px; font-size: 13px; font-weight: 500; margin-left: auto; }
.tab {
  padding: 8px 16px; border-radius: var(--radius); color: rgba(255,255,255,0.65);
}
.tab:hover { color: #fff; background: rgba(255,255,255,0.06); }
.tab.active { background: var(--blue); color: #fff; }

/* ---------- topbar right: search/add + privacy/help/user menu ---------- */
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.topbar-find { position: relative; display: flex; align-items: center; }
.topbar-find .icon { position: absolute; left: 10px; opacity: 0.5; font-size: 12px; pointer-events: none; }
.topbar-find input {
  width: 170px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  color: #fff; padding: 7px 10px 7px 28px; font-size: 12.5px; border-radius: 20px;
}
.topbar-find input::placeholder { color: rgba(255,255,255,0.45); }
.topbar-find input:focus { background: rgba(255,255,255,0.14); box-shadow: none; border-color: rgba(255,255,255,0.3); }
.topbar-add {
  display: flex; align-items: center; gap: 6px; background: var(--blue); color: #fff;
  border: none; border-radius: 20px; padding: 7px 14px 7px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.topbar-add:hover { background: var(--blue-dark); }
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 5px 8px 5px 5px; border-radius: 20px; }
.user-chip:hover { background: rgba(255,255,255,0.08); }
.user-chip .avatar-sm {
  width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.user-chip .uname { font-size: 13px; color: #fff; font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .caret { font-size: 9px; color: rgba(255,255,255,0.5); }
.user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 14px 32px rgba(16,35,63,0.22); min-width: 200px; padding: 6px;
  z-index: 200; display: none;
}
.user-dropdown.open { display: block; }
.user-dropdown-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-dropdown-head .nm { font-size: 13.5px; font-weight: 700; }
.user-dropdown-head .rl { font-size: 11px; color: var(--muted); margin-top: 2px; }
.user-dropdown-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--ink); }
.user-dropdown-item:hover { background: var(--bg); }

/* ---------- generic layout ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 48px 24px; }
.wrap-portal { max-width: 1080px; }
.wrap-wide { max-width: 1180px; margin: 0 auto; padding: 0; display: flex; align-items: flex-start; min-height: calc(100vh - 56px); }
.eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.08em; color: var(--blue); margin-bottom: 8px; font-weight: 600; }
h1.display { font-size: 32px; margin: 0 0 8px; font-weight: 600; }
.muted { color: var(--muted); }

.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.back-link:hover { color: var(--ink); }

/* ---------- public careers list ---------- */
.job-list { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.job-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 14px; border-bottom: 1px solid var(--border); cursor: pointer;
  background: var(--card);
}
.job-row:last-child { border-bottom: none; }
.job-row:hover { background: var(--blue-bg); }
.job-title { font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 16px; }
.pill { font-family: 'IBM Plex Mono', monospace; font-size: 10px; padding: 3px 8px; border-radius: 20px; background: var(--blue-bg); color: var(--blue-dark); font-weight: 600; }
.meta-line { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.empty { border: 1px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--muted); background: var(--card); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
label.field { display: block; margin-bottom: 16px; }
label.field .label-text { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
input, textarea, select {
  width: 100%; background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 11px; font-size: 14px; font-family: 'IBM Plex Sans', sans-serif; outline: none; color: var(--ink);
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(24,104,219,0.12); }
textarea { min-height: 90px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- buttons ---------- */
.btn { font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 13.5px; padding: 10px 20px; border-radius: var(--radius); border: none; cursor: pointer; background: var(--blue); color: #fff; }
.btn:hover { background: var(--blue-dark); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--ink); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { font-size: 12.5px; padding: 7px 14px; }
.btn-icon { background: transparent; border: none; cursor: pointer; padding: 7px; border-radius: var(--radius); color: var(--muted); }
.btn-icon:hover { background: var(--bg); color: var(--ink); }

.req-list { list-style: none; padding: 0; margin: 0; }
.req-list li { display: flex; gap: 8px; margin-bottom: 6px; }
.req-list li::before { content: "\2014"; color: var(--blue); }

.gate { max-width: 380px; margin: 0 auto; padding: 96px 24px; text-align: center; }

/* ---------- resume dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); background: var(--bg);
  padding: 22px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: var(--blue-bg); }
.dropzone-icon { font-size: 20px; margin-bottom: 6px; }
.dropzone-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--blue-bg); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.file-chip-name { display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---------- admin shell: sidebar + content ---------- */
.sidebar {
  width: 220px; flex-shrink: 0; background: var(--navy); min-height: calc(100vh - 56px);
  padding: 0 0 16px; display: flex; flex-direction: column; gap: 2px;
}
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px; margin: 8px 8px 0; border-radius: var(--radius);
  color: rgba(255,255,255,0.7); font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.side-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.side-link.active { background: var(--blue); color: #fff; }
.side-link .count { margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: 11px; opacity: 0.8; }
.side-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 12px 16px; }
.side-foot { margin-top: auto; padding: 10px 18px; font-size: 12px; color: rgba(255,255,255,0.45); }

/* ---------- open-records rail (bowling-alley panel tracker) ---------- */
.rail-head { padding: 4px 18px 6px; font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.06em; color: rgba(255,255,255,0.4); text-transform: uppercase; font-weight: 600; }
.rail-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 18px; margin: 0 8px; border-radius: var(--radius); color: rgba(255,255,255,0.75); font-size: 12.5px; cursor: pointer; }
.rail-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.rail-icon { font-size: 12px; flex-shrink: 0; }
.rail-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-close { flex-shrink: 0; opacity: 0.5; font-size: 11px; padding: 3px 5px; border-radius: 4px; line-height: 1; }
.rail-close:hover { opacity: 1; background: rgba(255,255,255,0.18); }

.admin-main { flex: 1; min-width: 0; padding: 24px 28px 60px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.admin-header h1 { font-size: 20px; margin: 0; font-weight: 600; }
.admin-header .actions { display: flex; gap: 8px; }

/* ---------- stat cards ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-card .num { font-size: 24px; font-weight: 700; font-family: 'IBM Plex Mono', monospace; }
.stat-card .lbl { font-size: 11.5px; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.03em; }

.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.bulk-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--blue-dark, #1a2b4a); color: #fff;
  padding: 10px 14px; border-radius: var(--radius, 8px);
  margin-bottom: 12px; font-size: 13px;
}
.bulk-bar select { font-size: 13px; padding: 4px 8px; border-radius: 6px; border: none; }
.bulk-bar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.filters input, .filters select { width: auto; }
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap input { padding-left: 30px; }
.search-wrap .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); opacity: 0.4; }
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.view-toggle button { border: none; background: var(--card); padding: 8px 12px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.view-toggle button.active { background: var(--blue); color: #fff; }

/* ---------- job admin cards ---------- */
.job-admin-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.status-tag { font-family: 'IBM Plex Mono', monospace; font-size: 10px; padding: 3px 9px; border-radius: 20px; border: 1px solid; font-weight: 600; }
.status-open { background: var(--green-bg); color: var(--green); border-color: rgba(26,127,78,0.25); }
.status-closed { background: var(--red-bg); color: var(--red); border-color: rgba(179,49,31,0.25); }

/* ---------- candidate data grid (Bullhorn-style dense table) ---------- */
.grid-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.grid-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted);
  padding: 10px 14px; background: #f7f8fb; border-bottom: 1px solid var(--border); font-weight: 600; white-space: nowrap;
}
.grid-table th.sortable { cursor: pointer; user-select: none; }
.grid-table th.sortable:hover { color: var(--ink); }
.grid-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.grid-table tbody tr { cursor: pointer; }
.grid-table tbody tr:hover { background: var(--blue-bg); }
.grid-table tbody tr:last-child td { border-bottom: none; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  margin-right: 10px; flex-shrink: 0;
}
.name-cell { display: flex; align-items: center; }
.name-cell .who .em { font-size: 12px; color: var(--muted); }

.stamp { font-family: 'IBM Plex Mono', monospace; font-size: 10px; padding: 4px 10px; border-radius: 20px; border: 1px solid; white-space: nowrap; font-weight: 600; }
.st-New { background: #eef0f4; color: #3b4250; border-color: rgba(59,66,80,0.2); }
.st-Reviewing { background: var(--blue-bg); color: var(--blue-dark); border-color: rgba(24,104,219,0.2); }
.st-Interview { background: var(--amber-bg); color: var(--amber); border-color: rgba(154,107,10,0.25); }
.st-Offer { background: var(--purple-bg); color: var(--purple); border-color: rgba(91,63,174,0.25); }
.st-Hired { background: var(--green); color: #fff; border-color: var(--green); }
.st-Rejected { background: var(--red-bg); color: var(--red); border-color: rgba(179,49,31,0.25); }

/* ---------- candidate detail drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(16,35,63,0.35); z-index: 100; display: flex; justify-content: flex-end; }
.drawer { width: min(480px, 100%); background: var(--card); height: 100%; overflow-y: auto; padding: 24px; box-shadow: -8px 0 24px rgba(0,0,0,0.12); display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.drawer-name { font-size: 20px; font-weight: 700; }
.drawer-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; font-size: 13.5px; margin: 14px 0; }
.detail-block { margin-bottom: 14px; }
.detail-block .label-text { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--muted); margin-bottom: 5px; font-weight: 600; letter-spacing: 0.03em; }
.detail-block p { white-space: pre-line; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; margin: 0; font-size: 13.5px; }
.resume-file-link { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--blue-bg); border: 1px solid rgba(24,104,219,0.2); border-radius: var(--radius); font-size: 13.5px; font-weight: 500; }
.status-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.status-buttons button { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; padding: 6px 11px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); cursor: pointer; font-weight: 600; }
.status-buttons button.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.status-buttons button.active.st-New { background: #3b4250; border-color: #3b4250; color: #fff; }
.status-buttons button.active.st-Reviewing { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.status-buttons button.active.st-Interview { background: var(--amber); border-color: var(--amber); color: #fff; }
.status-buttons button.active.st-Offer { background: var(--purple); border-color: var(--purple); color: #fff; }
.status-buttons button.active.st-Hired { background: var(--green); border-color: var(--green); color: #fff; }
.status-buttons button.active.st-Rejected { background: var(--red); border-color: var(--red); color: #fff; }
.drawer-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; border-top: 1px solid var(--border); padding-top: 16px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(16,35,63,0.35); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.modal { background: var(--card); border-radius: var(--radius); max-width: 520px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 24px; box-shadow: 0 12px 32px rgba(0,0,0,0.18); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { font-size: 18px; margin: 0; font-weight: 600; }

.modal-resume-preview { max-width: 800px; }
.resume-preview-body { min-height: 200px; }
.resume-preview-frame { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: var(--radius); background: #525659; }
.resume-preview-doc { max-height: 70vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; background: #fff; font-size: 14px; line-height: 1.6; }
.resume-preview-doc img { max-width: 100%; }
.resume-preview-doc table { border-collapse: collapse; }
.resume-preview-doc td, .resume-preview-doc th { border: 1px solid var(--border); padding: 4px 8px; }
.resume-preview-text { max-height: 70vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--bg); font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; margin: 0; }

.success-box { text-align: center; padding: 48px 24px; }
.success-icon { font-size: 32px; color: var(--green); margin-bottom: 12px; }

/* ---------- careers portal (Bullhorn OSCP-style) ---------- */
.portal-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff; padding: 56px 24px 72px;
}
.portal-hero-inner { max-width: 1080px; margin: 0 auto; }
.portal-hero .eyebrow { color: #8fb6f2; }
.portal-hero h1.display { color: #fff; }
.portal-hero p.muted { color: rgba(255,255,255,0.72); margin: 8px 0 24px; }
.search-bar {
  position: relative; max-width: 520px; background: #fff; border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}
.search-bar .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: 0.4; }
.search-bar input { border: none; padding: 13px 16px 13px 40px; font-size: 14.5px; border-radius: var(--radius); }
.search-bar input:focus { box-shadow: none; }
.wrap-portal { margin-top: -40px; }
.portal-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: 0 4px 14px rgba(16,35,63,0.06); }
.portal-filters select { width: auto; min-width: 160px; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.portal-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; cursor: pointer; transition: box-shadow .15s, border-color .15s; display: flex; flex-direction: column; }
.portal-card:hover { border-color: var(--blue); box-shadow: 0 8px 22px rgba(16,35,63,0.1); }
.portal-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.portal-company { font-size: 12.5px; color: var(--blue-dark); font-weight: 600; margin-bottom: 6px; }
.portal-card-desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 10px 0 14px; flex: 1; }
.portal-card-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11px; border-top: 1px solid var(--border); padding-top: 10px; margin-top: auto; }

/* ---------- companies ---------- */
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.company-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.company-stats { display: flex; gap: 14px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }

/* ---------- placements ---------- */
.pl-Active { background: var(--green-bg); color: var(--green); border-color: rgba(26,127,78,0.25); }
.pl-Ended { background: #eef0f4; color: #3b4250; border-color: rgba(59,66,80,0.2); }
.pl-FellThrough { background: var(--red-bg); color: var(--red); border-color: rgba(179,49,31,0.25); }

/* ---------- users / roles ---------- */
.role-tag { font-family: 'IBM Plex Mono', monospace; font-size: 10px; padding: 3px 9px; border-radius: 20px; font-weight: 600; letter-spacing: 0.03em; }
.role-admin { background: var(--purple-bg); color: var(--purple); }
.role-member { background: var(--blue-bg); color: var(--blue-dark); }

@media (max-width: 860px) {
  .wrap-wide { flex-direction: column; }
  .sidebar { width: 100%; min-height: auto; flex-direction: row; overflow-x: auto; }
  .side-foot { display: none; }
  .admin-main { padding: 18px; }
}
@media (max-width: 600px) {
  .row2, .detail-grid { grid-template-columns: 1fr; }
  .topbar-inner { padding: 0 14px; }
  .grid-table thead { display: none; }
  .grid-table, .grid-table tbody, .grid-table tr, .grid-table td { display: block; width: 100%; }
  .grid-table tr { border-bottom: 1px solid var(--border); padding: 10px 14px; }
  .grid-table td { border: none; padding: 3px 0; }
}

/* ---------- unified record panel (Bullhorn-style Overview/Edit) ---------- */
/* A "bowling alley": several panels can be open side by side and stay open —
   this is a non-blocking dock, not a modal. The outer layer never dims the
   page or intercepts clicks (pointer-events: none), so the rest of the app
   stays fully usable while panels are open; only the panels themselves
   (record-stack) accept clicks. Panels close only via their own "x", the
   Actions menu, or the open-records rail — never by clicking elsewhere. */
.record-overlay { position: fixed; top: 56px; left: 0; right: 0; bottom: 0; background: transparent; z-index: 100; display: flex; justify-content: flex-end; pointer-events: none; }
.record-stack { display: flex; flex-direction: row; height: 100%; max-width: 100%; overflow-x: auto; pointer-events: auto; }
.record-panel { width: min(420px, 92vw); flex-shrink: 0; background: var(--card); height: 100%; overflow-y: auto; box-shadow: -6px 0 24px rgba(16,35,63,0.22); display: flex; flex-direction: column; border-left: 1px solid rgba(16,35,63,0.1); }
.record-header { padding: 16px 22px; color: #fff; flex-shrink: 0; }
.record-header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.record-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.record-icon { font-size: 18px; flex-shrink: 0; opacity: 0.95; }
.record-eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.07em; opacity: 0.85; margin-bottom: 3px; font-weight: 600; text-transform: uppercase; }
.record-title { font-size: 18.5px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-subtitle { font-size: 12.5px; opacity: 0.92; margin-top: 5px; }
.record-header .btn-icon { color: #fff; }
.record-header .btn-icon:hover { background: rgba(255,255,255,0.2); }
.record-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.record-actions-menu { position: relative; }
.record-actions-btn {
  display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.14); color: #fff;
  border: 1px solid rgba(255,255,255,0.35); border-radius: var(--radius); padding: 6px 12px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em; cursor: pointer;
}
.record-actions-btn:hover { background: rgba(255,255,255,0.24); }
.record-actions-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 14px 32px rgba(16,35,63,0.22); min-width: 160px; padding: 6px;
  z-index: 20; display: none;
}
.record-actions-dropdown.open { display: block; }
.record-actions-dropdown-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px; font-size: 13px;
  cursor: pointer; color: var(--ink);
}
.record-actions-dropdown-item:hover { background: var(--bg); }
.record-actions-dropdown-item.danger { color: var(--red); }
.record-fieldstrip {
  display: flex; flex-wrap: wrap; gap: 22px; padding: 10px 22px; background: #f7f8fb;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.record-fieldstrip .fs-item { min-width: 0; }
.record-fieldstrip .fs-label {
  display: block; font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: 0.05em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 2px; font-weight: 600;
}
.record-fieldstrip .fs-val { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.record-hue-job { background: linear-gradient(135deg, var(--blue-dark), var(--blue)); }
.record-hue-candidate { background: linear-gradient(135deg, #1c5e3d, #2d8a5f); }
.record-hue-company { background: linear-gradient(135deg, #5b3a91, #7c52c4); }
.record-hue-placement { background: linear-gradient(135deg, #8a5a12, #c9861f); }
.record-hue-user { background: linear-gradient(135deg, #39485e, #54697f); }
.record-tabs { display: flex; gap: 4px; padding: 0 20px; background: var(--card); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.record-tab { padding: 12px 12px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; font-family: 'IBM Plex Mono', monospace; text-transform: uppercase; user-select: none; }
.record-tab:hover { color: var(--ink); }
.record-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.record-body { padding: 20px 22px 28px; flex: 1; }
.detail-section { margin-bottom: 22px; }
.note-text { font-size: 13.5px; white-space: pre-line; word-break: break-word; margin: 0; }
.note-text.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.note-expand-toggle { background: none; border: none; padding: 4px 0 0; margin: 0; color: var(--blue); font-size: 12px; font-weight: 600; cursor: pointer; }
.detail-section-title { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.07em; color: var(--muted); text-transform: uppercase; font-weight: 600; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.detail-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.detail-item .label-text { display: block; margin-bottom: 3px; }
.detail-item .val { font-size: 14px; word-break: break-word; }
.detail-item .val.muted-val { color: var(--muted); }
.related-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.related-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; font-size: 13px; border-bottom: 1px solid var(--border); cursor: pointer; }
.related-row:last-child { border-bottom: none; }
.related-row:hover { background: var(--bg); }
.record-edit-form .btn-block { margin-top: 6px; }
