:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --ink: #1c2733;
  --muted: #6b7785;
  --line: #e3e8ee;
  --brand: #3d6293;
  --brand-dark: #2c4a72;
  --accent: #2f8f6b;
  --warn: #b4541a;
  --danger: #b32424;
  --ok: #1c7a3d;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 35, 50, .08), 0 1px 2px rgba(20, 35, 50, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 1.5rem;
  background: var(--brand); color: #fff;
  padding: 0 1.5rem; height: 58px;
  box-shadow: var(--shadow);
}
.brand a { color: #fff; font-weight: 700; font-size: 1.15rem; }
.brand span { font-weight: 400; opacity: .85; }
.mainnav { display: flex; gap: .25rem; margin-right: auto; }
.mainnav a {
  color: #eafff7; padding: .45rem .8rem; border-radius: 6px; font-size: .95rem;
}
.mainnav a:hover { background: rgba(255,255,255,.14); text-decoration: none; }
.useractions { display: flex; align-items: center; gap: 1rem; }
.who { font-size: .85rem; color: #eafff7; }
.who em { font-style: normal; opacity: .85; }
.btn-link { color: #fff; font-size: .85rem; }
.rolepill {
  display: inline-block; margin-left: .4rem; padding: .05rem .5rem;
  border-radius: 999px; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .03em; background: rgba(255,255,255,.2);
}

/* ---------- Layout ---------- */
.container { max-width: 1080px; margin: 1.6rem auto; padding: 0 1.25rem; }
.sitefooter {
  max-width: 1080px; margin: 2rem auto; padding: 1rem 1.25rem;
  display: flex; justify-content: space-between;
  font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line);
}
.muted { color: var(--muted); }

/* ---------- Page header ---------- */
.pagehead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap;
}
.pagehead h1 { font-size: 1.5rem; margin: 0; }
.pagehead .sub { color: var(--muted); font-size: .9rem; margin-top: .2rem; }

/* ---------- Cards & panels ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem; margin-bottom: 1.25rem;
}
.panel h2 { margin-top: 0; font-size: 1.1rem; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; box-shadow: var(--shadow);
}
.stat .num { font-size: 2rem; font-weight: 700; color: var(--brand-dark); }
.stat .label { color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) { .cards { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #fafcfe; }
td.actions { white-space: nowrap; text-align: right; }

/* ---------- Buttons ---------- */
.btn, button.btn {
  display: inline-block; cursor: pointer; font: inherit; font-size: .9rem;
  padding: .5rem .95rem; border-radius: 7px; border: 1px solid var(--brand);
  background: var(--brand); color: #fff; text-decoration: none;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--brand-dark); }
.btn.secondary:hover { background: #f0f6f4; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: #f0f3f6; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.small { padding: .3rem .6rem; font-size: .82rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.field .hint { color: var(--muted); font-size: .8rem; margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
select, textarea {
  width: 100%; padding: .55rem .65rem; border: 1px solid var(--line);
  border-radius: 7px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(61,98,147,.18);
}
textarea { min-height: 90px; resize: vertical; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.1rem; }
@media (max-width: 680px) { .formgrid { grid-template-columns: 1fr; } }
.formactions { display: flex; gap: .6rem; margin-top: .5rem; }

/* ---------- Flash ---------- */
.flashes { margin-bottom: 1.2rem; }
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: .5rem; font-size: .92rem; border: 1px solid; }
.flash.success { background: #e8f6ee; border-color: #b6e2c6; color: var(--ok); }
.flash.error { background: #fdecec; border-color: #f3c2c2; color: var(--danger); }

/* ---------- Status badges ---------- */
.badge {
  display: inline-block; padding: .15rem .6rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; border: 1px solid transparent;
}
.badge.submitted    { background: #e7f0fb; color: #1463b3; }
.badge.under_review { background: #fff3e0; color: #b4541a; }
.badge.interview    { background: #ede7fb; color: #5b3bb3; }
.badge.offered      { background: #e3f7f1; color: #0b6e5f; }
.badge.placed       { background: #e8f6ee; color: #1c7a3d; }
.badge.rejected     { background: #fdecec; color: #b32424; }
.badge.withdrawn    { background: #eef1f4; color: #6b7785; }
.badge.open         { background: #e8f6ee; color: #1c7a3d; }
.badge.closed       { background: #eef1f4; color: #6b7785; }

/* ---------- Login ---------- */
.login-wrap { max-width: 400px; margin: 4rem auto; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 2rem; }
.login-card h1 { font-size: 1.4rem; margin: 0 0 .3rem; }
.login-card .lead { color: var(--muted); margin-bottom: 1.4rem; font-size: .92rem; }
.login-card .btn { width: 100%; text-align: center; }
.demo-creds { margin-top: 1.4rem; font-size: .8rem; color: var(--muted); background: #f7f9fb; border: 1px dashed var(--line); border-radius: 8px; padding: .8rem; }
.demo-creds code { background: #eef1f4; padding: .05rem .3rem; border-radius: 4px; }

/* ---------- Misc ---------- */
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; }
.position-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin-bottom: .9rem; background: var(--panel); box-shadow: var(--shadow); }
.position-card h3 { margin: 0 0 .25rem; }
.position-card .meta { color: var(--muted); font-size: .88rem; display: flex; gap: 1.1rem; flex-wrap: wrap; }
.position-card .meta b { color: var(--ink); font-weight: 600; }
.deflist { display: grid; grid-template-columns: 160px 1fr; gap: .5rem 1rem; font-size: .93rem; }
.deflist dt { color: var(--muted); }
.deflist dd { margin: 0; }
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.doctype-tag { display: inline-block; min-width: 92px; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 2rem; }
.split { display: grid; grid-template-columns: 1.7fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* role pills for federal/facility */
.rolepill.federal  { background: rgba(255,255,255,.28); }
.rolepill.facility { background: rgba(255,255,255,.28); }
.rolepill.bd       { background: rgba(255,255,255,.28); }
.rolepill.credentialer { background: rgba(255,255,255,.28); }
.rolepill.hr       { background: rgba(255,255,255,.28); }
.rolepill.recruiter { background: rgba(255,255,255,.28); }

/* HR onboarding status badges */
.badge.onboarded   { background: #e8f6ee; color: #1c7a3d; }

/* clickable demo login chips */
.cred-list { display: grid; gap: .35rem; margin-top: .6rem; }
.cred-chip {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  background: #f7f9fb; border: 1px solid var(--line); border-radius: 7px;
  padding: .4rem .6rem; cursor: pointer; font-size: .82rem; text-align: left; width: 100%;
}
.cred-chip:hover { background: #eef4fb; border-color: #cfe0f4; }
.cred-chip .role { font-weight: 600; color: var(--brand-dark); }
.cred-chip .who { color: var(--muted); font-family: monospace; font-size: .76rem; }

/* contract status badges */
.badge.pipeline       { background: #e7f0fb; color: #1463b3; }
.badge.active         { background: #e8f6ee; color: #1c7a3d; }
.badge.option_pending { background: #fff3e0; color: #b4541a; }
.badge.expired        { background: #fdecec; color: #b32424; }
.badge.closed         { background: #eef1f4; color: #6b7785; }
.badge.exercised      { background: #e8f6ee; color: #1c7a3d; }
.badge.pending        { background: #fff3e0; color: #b4541a; }

/* inline editable row forms */
.rowform { display: contents; }
.rowform input, .rowform select { padding: .35rem .45rem; font-size: .85rem; }
td.tight { padding: .35rem .4rem; }

/* credential item status badges */
.badge.in_progress { background: #fff3e0; color: #b4541a; }
.badge.received    { background: #e7f0fb; color: #1463b3; }
.badge.verified    { background: #e8f6ee; color: #1c7a3d; }
.badge.rejected    { background: #fdecec; color: #b32424; }
.badge.waived      { background: #eef1f4; color: #6b7785; }

/* progress bar */
.progress { background: #eef1f4; border-radius: 6px; height: 12px; overflow: hidden; min-width: 90px; }
.progress > span { display: block; height: 100%; background: var(--brand); }
.exp-flag { color: var(--warn); font-weight: 600; }
.exp-bad  { color: var(--danger); font-weight: 600; }

/* onboarding stage badges */
.badge.not_started   { background: #eef1f4; color: #6b7785; }
.badge.credentialing { background: #fff3e0; color: #b4541a; }
.badge.cleared       { background: #e8f6ee; color: #1c7a3d; }
.badge.ready_to_start{ background: #e8f6ee; color: #1c7a3d; }
.badge.active        { background: #e3f7f1; color: #0b6e5f; }
.badge.on_assignment { background: #e3f7f1; color: #0b6e5f; }
.badge.on_extension  { background: #ede7fb; color: #5b3bb3; }

/* charts */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 820px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem;
}
.chart-card h2 { margin: 0 0 .2rem; font-size: 1rem; }
.chart-card .chart-sub { color: var(--muted); font-size: .82rem; margin-bottom: .6rem; }
.chart-wrap { position: relative; height: 240px; }
.kpi-banner {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem;
}
@media (max-width: 760px) { .kpi-banner { grid-template-columns: repeat(2, 1fr); } }
.read-only-note {
  background: #eef4fb; border: 1px solid #cfe0f4; color: #1463b3;
  border-radius: 8px; padding: .6rem .9rem; font-size: .85rem; margin-bottom: 1.25rem;
}

/* Inline help "?" tooltips (used across Insights, Pricing, Risk) */
.help { display:inline-flex; align-items:center; justify-content:center; width:17px; height:17px;
  border-radius:50%; background:var(--brand); color:#fff; font-size:.72rem; font-weight:700;
  cursor:help; position:relative; margin-left:.4rem; vertical-align:middle; }
.help .help-tip { display:none; position:absolute; top:135%; left:0; z-index:60; width:300px;
  background:#1c2733; color:#fff; padding:.65rem .8rem; border-radius:9px; font-size:.78rem;
  font-weight:400; line-height:1.45; box-shadow:0 10px 30px rgba(0,0,0,.3); white-space:normal; }
.help:hover .help-tip, .help:focus .help-tip { display:block; }

/* Portal dropdowns in the main nav */
.navdrop { position: relative; }
.navdrop > a.navtop::after { content: " \25BE"; font-size: .65rem; opacity: .85; }
.navdrop-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 195px;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 14px 34px rgba(15,23,42,.28); padding: .3rem 0; z-index: 200;
}
.navdrop:hover .navdrop-menu, .navdrop:focus-within .navdrop-menu { display: block; }
.navdrop-menu a { display: block; color: var(--ink); padding: .45rem .95rem; font-size: .9rem; white-space: nowrap; }
.navdrop-menu a:hover { background: var(--bg); text-decoration: none; }
.navdrop-menu .navsep { border-top: 1px solid var(--line); margin: .3rem 0; }
