:root {
  --navy: #1F3864;
  --navy-dark: #16294a;
  --blue: #2E75B6;
  --ink: #1F2A37;
  --muted: #5C6B7A;
  --border: #C9D3DF;
  --bg: #F4F6FA;
  --card: #ffffff;
  --zebra: #F7F9FC;
  --green: #1E7B45;
  --green-bg: #E6F4EA;
  --amber: #9A6A00;
  --amber-bg: #FFF4D6;
  --red: #A61B1B;
  --red-bg: #FBE9E9;
  --radius: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 18px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-family, "Segoe UI"), Tahoma, Arial, sans-serif;
  font-size: var(--font-size, 15px);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: 28px; /* space reserved for the pinned footer ticker */
}

html { scrollbar-gutter: stable; }

main { flex: 1 0 auto; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.wrap { width: min(1240px, calc(100% - 32px)); margin: 0 auto; }

/* ---------- Header ---------- */
.masthead { background: var(--navy); color: #fff; }
.masthead .wrap { display: flex; align-items: center; gap: 16px; min-height: 44px; padding: 3px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--blue);
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
}
.brand small { display: block; font-size: 11px; font-weight: 400; opacity: .75; letter-spacing: .3px; }
.brand-logo { flex-direction: column; align-items: flex-start; gap: 0; }
.brand-logo img { display: block; }
.brand-logo small { font-size: 10px; line-height: 1.2; opacity: .8; }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.main-nav .nav-item { position: relative; }
.main-nav a.nav-link, .main-nav button.nav-link {
  color: #E8EEF7; padding: 5px 9px; border-radius: 6px; font-size: 13.5px;
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.main-nav a.nav-link:hover, .main-nav button.nav-link:hover { background: rgba(255,255,255,.10); text-decoration: none; color: #fff; }
.dropdown { display: none; position: absolute; left: 0; top: 100%; min-width: 210px; background: #fff; color: var(--ink);
  border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; z-index: 40; }
.nav-item:hover .dropdown, .nav-item:focus-within .dropdown, .nav-item.open .dropdown { display: block; }
.dropdown a { display: block; padding: 4px 9px; border-radius: 5px; color: var(--ink); font-size: 13.5px; }
.dropdown a:hover { background: var(--zebra); text-decoration: none; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.header-actions a.nav-link { color: #E8EEF7; padding: 5px 9px; border-radius: 6px; font-size: 13.5px; }
.header-actions a.nav-link:hover { background: rgba(255,255,255,.10); color: #fff; text-decoration: none; }
.header-actions .who { color: #D7E2F1; font-size: 13px; margin-right: 4px; }
.user-menu { position: relative; }
.user-toggle {
  color: #E8EEF7; background: none; border: 0; cursor: pointer; font-family: inherit;
  font-size: 13px; padding: 5px 9px; border-radius: 6px; white-space: nowrap;
}
.user-toggle:hover, .user-menu:focus-within .user-toggle { background: rgba(255,255,255,.10); color: #fff; }
.dropdown-right { left: auto; right: 0; min-width: 170px; }
.user-menu:hover .dropdown, .user-menu:focus-within .dropdown, .user-menu.open .dropdown { display: block; }
.dropdown button.dropdown-link {
  display: block; width: 100%; text-align: left; padding: 4px 9px; border-radius: 5px;
  background: none; border: 0; color: var(--ink); font-size: 13.5px; font-family: inherit; cursor: pointer;
}
.dropdown button.dropdown-link:hover { background: var(--zebra); }
.dropdown form { margin: 0; }
.badge-count { background: #E0A526; color: #23180a; border-radius: 20px; padding: 1px 7px; font-size: 11px; font-weight: 700; margin-left: 4px; }

/* ---------- Advertising ---------- */
.top-chrome { position: sticky; top: 0; z-index: 90; }
.marquee-bar { background: #0f2138; }
.marquee-bar .wrap { display: flex; align-items: center; gap: 12px; padding: 3px 0; }
.marquee-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #93A8C4; white-space: nowrap; }
.marquee { overflow: hidden; flex: 1; position: relative; display: flex; align-items: center; }
.marquee-track { display: inline-flex; gap: 24px; white-space: nowrap; animation: marquee 32s linear infinite; will-change: transform; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 13.5px; }
.marquee-item:hover { color: #fff; text-decoration: none; }
.marquee-item .dot { width: 6px; height: 6px; border-radius: 50%; background: #E0A526; }
.marquee-frame { border: 1px solid rgba(255,255,255,.45); padding: 2px 10px; border-radius: 4px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.promo-rail { display: grid; gap: 14px; }
.promo-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.promo-card .promo-inner { background: linear-gradient(160deg, #1F3864, #3b6ea5); color: #fff; border: 3px double rgba(255,255,255,.28);
  border-radius: 4px; padding: 12px; }
.promo-card .promo-inner h4 { margin: 0 0 6px; font-size: 14.5px; }
.promo-card .promo-inner p { margin: 0 0 8px; font-size: 12.5px; color: #DCE7F5; }
.promo-card .promo-inner a { color: #FFE4A8; font-size: 12px; font-weight: 600; }
.promo-rail-scroll { max-height: 560px; overflow-y: auto; padding-right: 4px; }

/* Public pages that keep the right advertising rail */
.page-rail { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.page-rail > * { min-width: 0; }
.page-rail > .promo-rail { position: sticky; top: calc(var(--chrome-h, 80px) + 10px); }
@media (max-width: 1000px) {
  .page-rail { grid-template-columns: 1fr; }
  .page-rail > .promo-rail { position: static; }
}

/* Conversation screen: chat takes the remaining width, rail matches the 280px public rail */
.thread-split { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.thread-split > * { min-width: 0; }
.thread-split > .promo-rail { position: sticky; top: calc(var(--chrome-h, 80px) + 10px); }
@media (max-width: 1000px) {
  .thread-split { grid-template-columns: 1fr; }
  .thread-split > .promo-rail { position: static; }
}

/* ---------- Home layout ---------- */
.home-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr) 280px; gap: 16px; align-items: start; padding: 10px 0 32px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 15.5px; color: var(--navy); }
.panel-body { padding: 14px 16px; }

.side-links { list-style: none; margin: 0; padding: 6px; }
.side-links a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 6px; color: var(--ink); font-size: 14px; }
.side-links a:hover { background: var(--zebra); text-decoration: none; }
.side-links .count { color: var(--muted); font-size: 12px; }
.home-grid .panel-head { padding: 9px 12px; }
.home-grid .side-links { padding: 4px; }
.home-grid .side-links a { padding: 5px 8px; font-size: 13.5px; }
.home-grid .side-links .count { font-size: 11.5px; }

.hero { background: linear-gradient(120deg, #1F3864, #2E75B6); color: #fff; padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
.hero h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: .2px; }
.hero p { margin: 0 0 10px; color: #DCE7F5; font-size: 13.5px; }
.search-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-row input, .search-row select { padding: 8px 10px; border-radius: 6px; font-family: inherit; font-size: 14px; }
/* Translucent border belongs to the blue hero only; inside a white card the controls keep the normal border. */
.hero .search-row input, .hero .search-row select { border: 1px solid rgba(255,255,255,.35); }
.search-row input[name="q"] { flex: 1 1 240px; min-width: 0; }
.search-row select { flex: 0 0 170px; width: auto; }
.search-row .btn { flex: 0 0 auto; }
/* Search strip inside a white card: 30 px controls and a slim frame. */
.card.search-card { padding: 8px 10px; }
.search-card .search-row input, .search-card .search-row select { height: 30px; padding: 3px 8px; }
.search-card .search-row .btn { height: 30px; padding: 0 14px; }
.card.wanted-card { padding-top: 8px; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stat-chip { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); border-radius: 6px; padding: 7px 10px; }
.stat-chip strong { font-size: 17px; display: block; }
.stat-chip span { font-size: 11.5px; color: #C9D9ED; }

/* ---------- Job cards ---------- */
.job-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 8px 16px 14px; border: 1px solid var(--border); border-radius: 6px; background: #fff; margin-bottom: 14px; position: relative; }
.home-latest .job-card { gap: 10px; padding: 12px; margin-bottom: 8px; }
.home-latest-head h2 { line-height: 1.2; }
.home-latest .job-card .meta { margin-top: 3px; }
.home-latest .job-card .excerpt { margin-top: 6px; }
.home-latest .job-card .pill-row { margin-top: 4px; }
.home-latest .job-card .side { gap: 6px; }
.job-card.frame { border: 3px double #B9C7D8; }
.job-card:hover { border-color: var(--blue); }
.job-card h3 { margin: 0 0 4px; font-size: 16px; }
.job-card h3 a { color: var(--navy); }
.job-card .meta { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.job-card .company { font-size: 13px; color: var(--ink); font-weight: 600; }
.job-card .excerpt { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.job-card .side { text-align: right; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-width: 110px; }
.salary { color: var(--green); font-weight: 700; font-size: 14px; }
.employer-intro { margin-top: 14px; padding: 9px 12px; background: #F7F9FC; border: 1px solid var(--border); border-left: 3px solid var(--navy); border-radius: 6px; }
.employer-intro h2 { font-size: 14.5px; margin: 0 0 4px; color: var(--navy); }
.employer-intro .body { white-space: pre-wrap; font-size: 13.5px; color: var(--ink); }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 2px 8px; border-radius: 20px; background: var(--zebra); color: var(--muted); border: 1px solid var(--border); }
.tag.blue { background: #EAF2FB; color: #1c4f86; border-color: #CFE0F2; }
.tag.green { background: var(--green-bg); color: var(--green); border-color: #C9E5D2; }
.tag.amber { background: var(--amber-bg); color: var(--amber); border-color: #F0DFAE; }
.tag.red { background: var(--red-bg); color: var(--red); border-color: #EFC9C9; }

/* ---------- Layout / typography ---------- */
.page { padding: 10px 0 32px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 23px; color: var(--navy); }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { padding: 7px 14px; }
.card h2 { font-size: 17px; color: var(--navy); margin: 0 0 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.card h3 { font-size: 15px; margin: 14px 0 6px; color: var(--navy); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.right { text-align: right; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.center { text-align: center; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb0 { margin-bottom: 0; } .mb4 { margin-bottom: 4px; } .mb8 { margin-bottom: 8px; } .mb10 { margin-bottom: 10px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 6px;
  background: var(--navy); color: #fff; border: 1px solid var(--navy); font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit; line-height: 1.5; }
.btn:hover { background: var(--navy-dark); color: #fff; text-decoration: none; }
.btn.blue { background: var(--blue); border-color: var(--blue); }
.btn.blue:hover { background: #256399; }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--border); }
.btn.ghost:hover { background: var(--zebra); color: var(--navy); }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn.danger:hover { background: #821414; }
.btn.gold { background: #C8891E; border-color: #C8891E; color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; margin: 10px 0 1px; color: var(--ink); }
.field, input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="datetime-local"], input[type="date"], input[type="time"], input[type="url"],
input[type="search"], input[type="tel"], select {
  width: 100%; height: 30px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 14px; background: #fff; color: var(--ink); box-sizing: border-box;
}
textarea, textarea.field {
  width: 100%; height: auto; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 14px; background: #fff; color: var(--ink); resize: vertical;
  box-sizing: border-box;
}
input[type="file"] {
  width: 100%; height: 30px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 13px; background: #fff; color: var(--ink); box-sizing: border-box;
}
input[type="file"]::file-selector-button { height: 24px; margin-right: 8px; }
input[type="date"] { width: 180px; max-width: 100%; }
input[type="time"] { width: 150px; max-width: 100%; }
input[type="datetime-local"] { width: 300px; max-width: 100%; }
/* Segoe UI sits ~2 px low inside a 30 px select; lift the text box. */
select, select.field { padding: 1px 8px 5px; }
/* The hero search keeps its own height on the blue panel. */
.hero .search-row input, .hero .search-row select { height: auto; padding: 8px 10px; }
.field:focus, select:focus, textarea:focus, input:focus { outline: 2px solid #BFD6F0; border-color: var(--blue); }

/* Custom select: closed control, open panel shows five rows then scrolls. */
.pick-select { position: relative; }
.pick-select.w-20 { width: calc(20ch + 44px); max-width: 100%; }
.pick-select select.native-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pick-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 30px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; box-sizing: border-box; }
.pick-toggle.placeholder { color: var(--muted); }
/* Buttons that sit in the same row as 30 px fields follow that height. */
.filter-bar .btn, .form-inline .btn { height: 30px; padding: 0 14px; }
/* Filter and Reset share one compact row: both fixed to the same width. */
.filter-actions { display: flex; gap: 8px; align-items: center; }
.filter-bar .filter-actions .btn { width: 84px; padding: 0 10px; flex: 0 0 auto; }
.pick-toggle:focus { outline: 2px solid #BFD6F0; border-color: var(--blue); }
.pick-toggle::after { content: "\25BE"; color: var(--muted); font-size: 12px; }
.pick-menu { position: absolute; z-index: 95; left: 0; right: 0; top: calc(100% + 4px); max-height: 158px; overflow-y: auto; padding: 4px; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); display: none; }
.pick-menu.open { display: block; }
.pick-menu .pick-item { display: block; width: 100%; min-height: 30px; padding: 5px 8px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.pick-menu .pick-item:hover, .pick-menu .pick-item:focus { background: #EAF1FA; outline: none; }
.pick-menu .pick-item.selected { background: #DCE9F8; font-weight: 600; }
.field-w-15 { width: calc(15ch + 44px); max-width: 100%; }
input.field-w-10 { width: calc(10ch + 44px); max-width: 100%; }
.pick-select.w-24 { width: calc(24ch + 44px); max-width: 100%; }
.form-inline { display: flex; flex-wrap: wrap; gap: 0 16px; }
.form-inline > div { flex: 0 0 auto; min-width: 0; }
.form-inline .pick-select { flex: 0 0 auto; }
.form-span { grid-column: 1 / -1; container-type: inline-size; }
@container (min-width: 920px) {
  .form-inline { justify-content: space-between; }
}
.help { font-size: 12px; color: var(--muted); margin-top: 3px; }
.errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--red); font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
/* Change password: old on top, new + confirmation stacked, rules on the right. */
.pw-form { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 0 26px; align-items: start; }
.pw-new { margin-top: 20px; }
.pw-new label { margin-top: 0; }
.pw-confirm { margin-top: 8px; }
.pw-help { margin-top: 20px; padding: 10px 12px; background: #F7F9FC; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.pw-help ul { margin: 0; padding-left: 16px; }
.pw-help li { margin-bottom: 4px; }
.pw-help li:last-child { margin-bottom: 0; }
/* First-N promotion: promotion box and the three number boxes share one line
   in 55:32:32:32 character proportions, capped at their real character width. */
.promo-row { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; }
.promo-row > div { flex: 32 1 0; min-width: 0; }
.promo-row > div.promo-kind { flex: 55 1 0; }
.promo-row select { width: 100%; max-width: calc(55ch + 44px); }
.promo-row input { width: 100%; max-width: calc(32ch + 44px); }
.voucher-form { display: flex; flex-wrap: wrap; gap: 0 10px; align-items: flex-end; }
.voucher-line > div { min-width: 0; }
.voucher-input { width: calc(16ch + 44px); max-width: 100%; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.voucher-input[readonly] { background: #F3F6FA; cursor: default; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-row.only-one .form-field { grid-column: 1 / -1; }
.form-row > div { min-width: 0; }
.auth-form label { margin: 0 0 1px; font-size: 12.5px; }
.auth-form .field { padding: 3px 9px; font-size: 13.5px; }
.auth-form select, .auth-form select.field { padding: 1px 9px 5px; font-size: 13.5px; }
/* 30 px box - 2 px borders - 4 px padding = 24 px button, the same fit as the slip upload. */
.auth-form input[type="file"] { padding: 2px 8px; font-size: 13px; }
.auth-form .help { margin-top: 2px; font-size: 11.5px; line-height: 1.3; }
.auth-form .errorlist { margin-top: 2px; }
.auth-form .form-row { margin-bottom: 7px; }
.auth-form .form-actions { margin-top: 12px; }
#row-employer_docs label { min-height: 3em; }
.filter-bar { display: grid; grid-template-columns: 2fr repeat(3, 1fr) 1fr auto; gap: 8px; align-items: center; }
.filter-bar input, .filter-bar select { width: 100%; }
.page-main { container-type: inline-size; }
@container (max-width: 760px) {
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar input[name="q"] { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar input[name="q"] { grid-column: 1 / -1; }
}
.form-actions { margin-top: 14px; display: flex; gap: 10px; align-items: center; }
/* Contact Us: name and role share one row; email sits full width above Subject. */
.contact-inline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.contact-inline label { margin-top: 0; }
@media (max-width: 720px) {
  .contact-inline { grid-template-columns: 1fr; }
}
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: auto; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table-wrap { overflow-x: auto; }
.table-wrap > .table { min-width: 720px; }
.table th { text-align: left; background: var(--navy); color: #fff; font-weight: 600; padding: 5px 10px; font-size: 12.5px; line-height: 1.2; }
.table td { border-bottom: 1px solid var(--border); padding: 8px 10px; vertical-align: top; }
.card.flush .table th:first-child, .card.flush .table td:first-child { padding-left: 16px; }
.card.flush .table th:last-child, .card.flush .table td:last-child { padding-right: 16px; }
.table tr:nth-child(even) td { background: var(--zebra); }
.table .num { text-align: right; }
.table-empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- User manual ---------- */
.manual-toc .toc-list { columns: 2; column-gap: 32px; margin: 0; padding-left: 18px; font-size: 14px; }
.manual-toc .toc-list li { margin-bottom: 4px; break-inside: avoid; }
.manual-body h2 { margin-top: 0; }
.manual-body h3 { margin: 18px 0 6px; font-size: 15px; }
.manual-body p, .manual-body li { font-size: 14px; line-height: 1.55; }
.manual-body table.table { margin: 10px 0 4px; }
.manual-figure { margin: 14px 0 10px; text-align: center; }
.manual-figure img { border: 1px solid var(--border); border-radius: 8px; width: 100%; }
.manual-figure figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
@media print { .manual-toc { display: none; } }

/* ---------- Alerts ---------- */
.alerts { margin: 10px 0 0; }
.alert { border-radius: 6px; padding: 10px 14px; margin-bottom: 8px; font-size: 13.5px; border: 1px solid; }
.alert.success { background: var(--green-bg); border-color: #C9E5D2; color: #145c32; }
.alert.error { background: var(--red-bg); border-color: #EFC9C9; color: #8a1717; }
.alert.warning { background: var(--amber-bg); border-color: #F0DFAE; color: #7a5400; }
.alert.info, .alert.debug { background: #EAF2FB; border-color: #CFE0F2; color: #1c4f86; }

/* ---------- Workspace ---------- */
.workspace { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; padding: 0; }
.side-nav { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; position: sticky; top: 10px; }
.side-nav .who { padding: 6px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.side-nav .who strong { display: block; font-size: 14px; }
.side-nav .who span { font-size: 11.5px; color: var(--muted); }
.side-nav a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink); font-size: 13.5px; margin-bottom: 1px; }
.side-nav hr { margin: 6px 0; }
.side-nav a:hover { background: var(--zebra); text-decoration: none; }
.side-nav a.active { background: #EAF2FB; color: var(--navy); font-weight: 600; }
.side-nav.nav-dense { padding: 5px; }
.side-nav.nav-dense .who { padding: 4px 9px 5px; }
.side-nav.nav-dense a { padding: 3px 9px; margin-bottom: 0; }
.side-nav.nav-dense hr { margin: 4px 0; }
.side-nav .nav-drop { position: relative; }
.side-nav .nav-drop > a { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-nav .nav-caret { color: var(--muted); font-size: 15px; line-height: 1; transition: transform .12s ease; }
.side-nav .nav-drop:hover > a .nav-caret,
.side-nav .nav-drop:focus-within > a .nav-caret { transform: rotate(90deg); }
.side-nav .side-drop {
  position: absolute; left: 0; top: 100%; z-index: 40;
  min-width: 100%; width: max-content; max-width: 250px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 24px rgba(16, 42, 76, .14); padding: 4px;
  opacity: 0; pointer-events: none; transition: opacity .12s ease;
}
.side-nav .nav-drop:hover > .side-drop,
.side-nav .nav-drop:focus-within > .side-drop { opacity: 1; pointer-events: auto; }
.side-nav .side-drop a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 9px; margin: 0; border-radius: 6px; font-size: 13px; }
.side-nav .side-drop a:hover { background: var(--zebra); }
.side-nav .side-drop .count { color: var(--muted); font-size: 11.5px; }
.inline-form { display: inline; margin: 0; }
.nowrap { white-space: nowrap; }
.card-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--border); }
.card-form .field { height: 30px; }
.card-form input[type="file"] { max-width: 320px; }
.pad10 { padding: 10px 12px; margin: 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 10px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; box-shadow: var(--shadow); }
.kpi span { display: block; font-size: 11.5px; line-height: 1.3; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi strong { font-size: 24px; line-height: 1.15; color: var(--navy); display: block; margin-top: 2px; }
.kpi small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }

/* ---------- Dashboard density ---------- */
.dash-head { margin-bottom: 10px; }
.dash-head h1 { font-size: 21px; }
.dash-head p { margin-top: 2px; }
.kpi-grid.dash-kpi .kpi { padding: 6px 14px; }
.kpi-grid.dash-kpi .kpi strong { font-size: 22px; margin-top: 1px; }
.dash-card { padding-top: 10px; margin-bottom: 10px; }
.dash-card h2 { margin-bottom: 4px; }
.dash-profile p { margin: 0 0 2px; }
.dash-profile .profile-title { font-size: 14px; }
.dash-profile .profile-meta { margin-bottom: 8px; }
.notice-box.dash-notice { padding: 1px 12px; line-height: 1.25; }
.dash-cv h2 { margin-bottom: 2px; }
.dash-cv .cv-meta { margin: 0 0 6px; }
.dash-cv form { clear: both; }
.dash-cv .rte-area { height: clamp(240px, calc(100vh - 538px), 760px); min-height: 240px; overflow-y: scroll; resize: vertical; }
.dash-cv .rte-area::-webkit-scrollbar { width: 12px; }
.dash-cv .rte-area::-webkit-scrollbar-track { background: #EEF2F7; border-radius: 6px; }
.dash-cv .rte-area::-webkit-scrollbar-thumb { background: #B8C4D6; border-radius: 6px; border: 2px solid #EEF2F7; }
.dash-cv .rte-area::-webkit-scrollbar-thumb:hover { background: #93A3BA; }
.cv-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cv-edit-card .rte { background: #E9EEF5; padding: 10px; border-radius: 8px; }
.cv-edit-card .rte-area { height: clamp(240px, calc(100vh - 388px), 900px); min-height: 240px; max-height: 90vh; overflow-y: scroll; resize: vertical;
  padding: 8.57% 7.62%; font-family: Calibri, "Segoe UI", Arial, sans-serif; font-size: 13px; line-height: 1.16; }
.cv-preview-stage { height: clamp(240px, calc(100vh - 388px), 900px); min-height: 240px; max-height: 90vh; overflow-y: auto; resize: vertical;
  background: #E9EEF5; border: 1px solid var(--border); border-radius: 6px; padding: 14px 14px 4px; }
.cv-preview-stage::-webkit-scrollbar { width: 12px; }
.cv-preview-stage::-webkit-scrollbar-track { background: #E1E7F0; border-radius: 6px; }
.cv-preview-stage::-webkit-scrollbar-thumb { background: #B8C4D6; border-radius: 6px; border: 2px solid #E1E7F0; }
.cv-preview-stage::-webkit-scrollbar-thumb:hover { background: #93A3BA; }
.cv-edit-card { padding-top: 6px; }
.cv-edit-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 4px; }
.cv-edit-top .cv-edit-title { flex: 1; min-width: 0; }
.cv-edit-top label { margin-top: 0; }
.cv-edit-top h2 { margin: 0; }
.cv-edit-card .rte-area::-webkit-scrollbar, .cv-preview-card .cv-sheet::-webkit-scrollbar { width: 12px; }
.cv-edit-card .rte-area::-webkit-scrollbar-track, .cv-preview-card .cv-sheet::-webkit-scrollbar-track { background: #EEF2F7; border-radius: 6px; }
.cv-edit-card .rte-area::-webkit-scrollbar-thumb, .cv-preview-card .cv-sheet::-webkit-scrollbar-thumb { background: #B8C4D6; border-radius: 6px; border: 2px solid #EEF2F7; }
.cv-edit-card .rte-area::-webkit-scrollbar-thumb:hover, .cv-preview-card .cv-sheet::-webkit-scrollbar-thumb:hover { background: #93A3BA; }
.cv-preview-card .cv-sheet { aspect-ratio: 210 / 297; height: auto; overflow-y: scroll; padding: 24px 26px;
  font-family: Calibri, "Segoe UI", Arial, sans-serif; font-size: 13px; line-height: 1.16; }

/* ---------- CV ---------- */
.cv-sheet { background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); padding: 34px 38px; border-radius: 4px; line-height: 1.55; }
.cv-sheet h1, .cv-sheet h2 { color: var(--navy); }
.cv-sheet .cv-sheet-title { margin: 0 0 10px; }
.cv-sheet.classic { font-family: Georgia, "Times New Roman", serif; }
.cv-sheet.classic .cv-sheet-title { text-align: center; font-size: 17px; letter-spacing: .04em;
  padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.cv-sheet.modern { border-top: 5px solid var(--blue); }
.cv-sheet.modern .cv-sheet-title { font-size: 18px; padding-bottom: 6px; border-bottom: 2px solid var(--blue); }
.cv-sheet.compact { font-size: 12px; line-height: 1.25; }
.cv-sheet.compact .cv-sheet-title { font-size: 15px; margin-bottom: 6px; }

/* Imported Word layouts: keep the sidebar/main split while editing and previewing. */
.rte-area .cv-cols, .cv-text .cv-cols { display: flex; align-items: flex-start; width: 100%; }
.rte-area .cv-col, .cv-text .cv-col { flex: 1 1 0; min-width: 0; box-sizing: border-box; padding-right: 10px; }
.rte-area .cv-col[style], .cv-text .cv-col[style] { flex: 0 0 auto; }
.rte-area .cv-col:last-child, .cv-text .cv-col:last-child { padding-right: 0; }

/* The editing surface follows the chosen template: what is typed reads like
   the printed page (heading colour, face, size and the template's accent). */
.cv-edit-card .rte-area, .dash-cv .rte-area { transition: box-shadow .15s; }
.cv-edit-card.tpl-classic .rte-area, .dash-cv.tpl-classic .rte-area {
  font-family: Georgia, "Times New Roman", serif; font-size: 13.5px; line-height: 1.3; color: #1C2A3D; }
.cv-edit-card.tpl-classic .rte-area h1, .cv-edit-card.tpl-classic .rte-area h2,
.cv-edit-card.tpl-classic .rte-area h3 { color: #1C2A3D; border-bottom: 1px solid #B9C2CE; }
.cv-edit-card.tpl-modern .rte-area {
  font-family: Calibri, "Segoe UI", Arial, sans-serif; box-shadow: inset 0 4px 0 var(--blue); }
.cv-edit-card.tpl-modern .rte-area h1, .cv-edit-card.tpl-modern .rte-area h2,
.cv-edit-card.tpl-modern .rte-area h3 { color: #12385F; border-left: 4px solid #1F6FB2; padding-left: 8px; }
.cv-edit-card.tpl-compact .rte-area, .dash-cv.tpl-compact .rte-area { font-size: 12px; line-height: 1.18; }
.cv-edit-card.tpl-bold .rte-area {
  font-family: "Segoe UI", Calibri, Arial, sans-serif; box-shadow: inset 8px 0 0 #ECEDEF; }
.cv-edit-card.tpl-bold .rte-area h1, .cv-edit-card.tpl-bold .rte-area h2,
.cv-edit-card.tpl-bold .rte-area h3 { text-transform: uppercase; letter-spacing: .05em; color: #111;
  border-bottom: 1.5px solid #A9C6DC; }
.cv-edit-card.tpl-pro1 .rte-area {
  font-family: "Segoe UI", Calibri, Arial, sans-serif; box-shadow: inset 8px 0 0 #1C3448; }
.cv-edit-card.tpl-pro1 .rte-area h1, .cv-edit-card.tpl-pro1 .rte-area h2,
.cv-edit-card.tpl-pro1 .rte-area h3 { background: #EBEEF1; color: #1C3448; padding: 2px 6px; }
.cv-edit-card.tpl-pro2 .rte-area {
  font-family: "Segoe UI", Calibri, Arial, sans-serif; box-shadow: inset 0 6px 0 #233E56; }
.cv-edit-card.tpl-pro2 .rte-area h1, .cv-edit-card.tpl-pro2 .rte-area h2,
.cv-edit-card.tpl-pro2 .rte-area h3 { color: #233E56; border-bottom: 1.5px solid #C6D0D9; }
.cv-edit-card.tpl-pro3 .rte-area {
  font-family: "Segoe UI", Calibri, Arial, sans-serif; box-shadow: inset 8px 0 0 #1D3A52; }
.cv-edit-card.tpl-pro3 .rte-area h1, .cv-edit-card.tpl-pro3 .rte-area h2,
.cv-edit-card.tpl-pro3 .rte-area h3 { color: #1B2F42; border-bottom: 1px solid #DDE3E8; }
.cv-text { white-space: pre-wrap; font-family: inherit; }
.cv-frame { border: 1px solid var(--border); border-radius: 6px; padding: 16px; background: var(--zebra); }
.cv-photo { float: right; width: 3.5cm; height: 4.5cm; object-fit: cover; border: 1px solid var(--border); border-radius: 3px; margin: 0 0 12px 16px; background: var(--zebra); }
.cv-thumb { float: right; width: 72px; height: 92px; object-fit: cover; border: 1px solid var(--border); border-radius: 4px; margin: 0 0 8px 12px; background: var(--zebra); }
.photo-hint { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }

/* ---------- Chat ---------- */
.chat-head { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.chat-box { height: 420px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 14px; }
.msg { max-width: 72%; margin-bottom: 10px; padding: 8px 12px; border-radius: 10px; background: var(--zebra); border: 1px solid var(--border); font-size: 13.5px; }
.msg.mine { margin-left: auto; background: #EAF2FB; border-color: #CFE0F2; }
.msg .meta { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form input { flex: 1; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #C9D6E8; margin-top: 10px; padding-bottom: 0; }
.site-footer .footer-main { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 5px 0; font-size: 12px; flex-wrap: wrap; }
.site-footer a { color: #fff; }
.footer-ticker {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  background: #0f2138; border-top: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 -6px 18px rgba(16, 24, 40, .18);
}
.footer-ticker .wrap { display: flex; align-items: center; gap: 12px; padding: 3px 0; min-height: 27px; }

/* ---------- Misc ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 14px 0; }
.pagination a, .pagination span { padding: 6px 11px; border: 1px solid var(--border); border-radius: 5px; background: #fff; font-size: 13px; color: var(--ink); }
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }
.progress { height: 8px; background: var(--zebra); border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.progress span { display: block; height: 100%; background: var(--blue); }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding: 8px 0; }
.bar-chart .bar { flex: 1; background: var(--blue); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bar-chart .bar span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 9.5px; color: var(--muted); }
.notice-box { background: #EAF2FB; border: 1px solid #CFE0F2; border-radius: 6px; padding: 7px 12px; font-size: 13px; color: #1c4f86; }
.danger-zone { border: 1px solid #EFC9C9; background: #FFF7F7; border-radius: 6px; padding: 14px; }
.auth-shell { max-width: 520px; margin: 0 auto; }
.auth-shell.wide { max-width: 760px; }
.steps { margin: 6px 0 0; padding-left: 22px; }
.steps li { margin-bottom: 6px; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.hidden { display: none !important; }

@media (max-width: 1000px) {
  .home-grid { grid-template-columns: 1fr; }
  .grid-4, .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .workspace { grid-template-columns: 1fr; gap: 12px; }
  .side-nav {
    position: static; display: flex; align-items: center; gap: 4px;
    overflow-x: auto; padding: 6px;
  }
  .side-nav .who, .side-nav hr { display: none; }
  .side-nav .nav-drop { display: contents; }
  .side-nav .nav-caret, .side-nav .side-drop { display: none; }
  .side-nav a {
    flex: 0 0 auto; white-space: nowrap; margin: 0; padding: 7px 10px;
    font-size: 13px; border: 1px solid transparent;
  }
  .side-nav a.active { border-color: #CFE0F2; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .form-grid, .pw-form { grid-template-columns: 1fr; }
  .pw-help { margin-top: 14px; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .search-row input[name="q"], .search-row select, .search-row .btn { flex: 1 1 100%; width: 100%; }
  .job-card { grid-template-columns: 1fr; }
  .job-card .side { flex-direction: row; text-align: left; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .grid-4, .kpi-grid, .stats-row { grid-template-columns: 1fr 1fr; }
  .masthead .wrap { flex-wrap: wrap; padding: 8px 0; row-gap: 6px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; margin-left: 0; }
  .main-nav .nav-item, .main-nav a.nav-link, .main-nav button.nav-link {
    flex: 0 0 auto; white-space: nowrap;
  }
  .header-actions { gap: 6px; }
}
@media print {
  .masthead, .site-footer, .marquee-bar, .side-nav, .no-print { display: none !important; }
  body { background: #fff; padding-bottom: 0; }
  .card { box-shadow: none; border: 0; }
}

/* ---------- Rich text (employer About, job description) ---------- */
.rte-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 5px 6px; background: #F7F9FC; border: 1px solid var(--border); border-bottom: 0; border-radius: 6px 6px 0 0; }
.rte-pick { width: auto; height: 26px; padding: 0 6px; font-size: 12.5px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--ink); }
.rte-buttons { display: flex; gap: 4px; margin-left: 2px; }
.rte-buttons button { min-width: 28px; height: 26px; padding: 0 7px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--ink); font-size: 12.5px; cursor: pointer; }
.rte-buttons button:hover { background: #EAF1FA; }
.rte-area { padding: 6px 9px; border: 1px solid var(--border); border-radius: 0 0 6px 6px; background: #fff; font-size: 13.5px; overflow-y: auto; }
.rte-area:focus { outline: 2px solid #BFD6F0; border-color: var(--blue); }
.rich-text { white-space: normal; line-height: 1.16; }
.rich-text p, .rich-text div { margin: 0 0 6px; }
.rich-text p:last-child, .rich-text div:last-child { margin-bottom: 0; }
.rich-text ul, .rich-text ol { margin: 0 0 6px 18px; padding: 0; }
.employer-intro .body { white-space: normal; }
