:root {
  --bg: #f6f7f9; --card: #ffffff; --ink: #1c2733; --muted: #64748b;
  --brand: #0f6b5c; --brand-2: #0d5a4e; --accent: #e8f3f0;
  --line: #e2e8f0; --danger: #b3372f; --ok: #1a7f4b; --warn: #a16207;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.topnav { display: flex; align-items: center; gap: 18px; padding: 10px 22px;
  background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topnav .brand { font-weight: 700; font-size: 17px; color: var(--ink); }
.topnav .brand span { color: var(--brand); }
.topnav a { color: var(--ink); }
.topnav .spacer { flex: 1; }
.whoami { color: var(--muted); font-size: 13px; }
.inline { display: inline; }
.linklike { background: none; border: none; color: var(--brand); cursor: pointer; font-size: 14px; padding: 0; }

.container { max-width: 1200px; margin: 24px auto; padding: 0 20px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 26px 0 40px; }

h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 26px 0 10px; }
.sub { color: var(--muted); margin: 0 0 18px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }

table.list { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
table.list th { background: #f1f5f9; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.list tr:last-child td { border-bottom: none; }

.btn { display: inline-block; background: var(--brand); color: #fff; border: none;
  border-radius: 7px; padding: 8px 16px; font-size: 14px; cursor: pointer; }
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn.secondary { background: #eef2f6; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 13px; }

label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number],
select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 7px; font-size: 14px; font-family: inherit; background: #fff; }
textarea { min-height: 90px; resize: vertical; }
.hint { color: var(--muted); font-size: 12px; margin-top: 3px; }
.error-box { background: #fdecea; border: 1px solid #f5c6c2; color: var(--danger);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.info-box { background: var(--accent); border: 1px solid #c6e3dc; color: var(--brand-2);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; word-break: break-word; }

.badge { display: inline-block; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.badge.open, .badge.active { background: #dcf1e6; color: var(--ok); }
.badge.closed, .badge.rejected { background: #fdeceb; color: var(--danger); }
.badge.withdrawn { background: #f1f5f9; color: var(--muted); }
.badge.hired { background: #fef3c7; color: var(--warn); }
.badge.stage { background: var(--accent); color: var(--brand-2); }
.badge.pass { background: #dcf1e6; color: var(--ok); }
.badge.fail { background: #fdeceb; color: var(--danger); }

/* Pipeline board */
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; }
/* Columns flex to share the row so every stage fits on one screen without scrolling.
   min-width keeps them usable; on very narrow screens the board can still scroll. */
.col { flex: 1 1 0; min-width: 140px; background: #eef1f5; border-radius: 10px; padding: 10px; }
.col h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); margin: 2px 4px 10px; display: flex; justify-content: space-between; }
.cardlet { background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 8px; display: block; color: var(--ink); }
.cardlet:hover { border-color: var(--brand); text-decoration: none; }
.cardlet .nm { font-weight: 600; font-size: 14px; }
.cardlet .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.score-chip { float: right; font-size: 12px; font-weight: 700; color: var(--brand-2); }
/* Board card notifications */
.cardlet.flag-attention { border-color: #f59e0b; background: #fff7ed; }
.cardlet.flag-attention:hover { border-color: #d97706; }
.cardlet.flag-ready { border-color: #16a34a; background: #f0fdf4; }
.cardlet.flag-ready:hover { border-color: #15803d; }
.flag-note { font-size: 11.5px; font-weight: 600; margin-top: 5px; }
.flag-note.flag-attention { color: #b45309; }
.flag-note.flag-ready { color: #15803d; }

/* Scorecard */
.crit { border-bottom: 1px solid var(--line); padding: 10px 0; }
.crit:last-child { border-bottom: none; }
.crit .lbl { font-weight: 600; font-size: 14px; }
.crit .wt { color: var(--muted); font-size: 12px; margin-left: 6px; }
.scale { display: flex; gap: 6px; margin: 8px 0 6px; }
.scale label { display: flex; align-items: center; gap: 4px; font-weight: 400;
  font-size: 13px; margin: 0; background: #f1f5f9; border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 10px; cursor: pointer; }
.scale input { margin: 0; }
.note-item { border-left: 3px solid var(--brand); background: #fafcfb; padding: 8px 12px;
  border-radius: 0 8px 8px 0; margin-bottom: 10px; }
.note-item .who { font-size: 12px; color: var(--muted); }
.timeline li { margin-bottom: 6px; font-size: 13px; }
.timeline .who { color: var(--muted); }

.actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* Public application page */
.apply-wrap { max-width: 680px; margin: 30px auto; }
.apply-head { text-align: center; margin-bottom: 18px; }
.apply-head .org { color: var(--muted); }
.auth-wrap { max-width: 400px; margin: 9vh auto 0; }
.auth-wrap .brand-big { text-align: center; font-size: 26px; font-weight: 700; margin-bottom: 18px; }
.auth-wrap .brand-big span { color: var(--brand); }
.desc { white-space: pre-wrap; }

/* Side-by-side grading layout: responses left, scorecard right (sticky) */
.grade-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }
.grade-grid .sticky-col { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
@media (max-width: 1000px) {
  .grade-grid { grid-template-columns: 1fr; }
  .grade-grid .sticky-col { position: static; max-height: none; }
}
/* Review status */
.badge.rev-new { background: #f1f5f9; color: #64748b; }
.badge.rev-0 { background: #fdeceb; color: #b3372f; }
.badge.rev-1 { background: #fef3c7; color: #a16207; }
.badge.rev-done { background: #dcf1e6; color: #1a7f4b; }

/* Role description formatting: "A | B" lines render as a table, "- " lines as bullets */
.desc-table { border-collapse: collapse; margin: 10px 0; width: 100%; }
.desc-table th, .desc-table td { border: 1px solid #c9c9c9; padding: 8px 12px; text-align: left; vertical-align: top; font-size: 13.5px; line-height: 1.5; white-space: normal; }
.desc-table th { color: #1f3a5f; font-weight: 700; }
.desc-table td:first-child { width: 28%; }
.desc-list { margin: 6px 0 6px 20px; padding: 0; white-space: normal; }
.desc-list li { margin: 3px 0; }

/* Inline description formatting: **bold**, ==highlight==, # big text, ## medium text */
.desc mark, .desc-table mark, .desc-list mark { background: #ffe89e; padding: 0 3px; border-radius: 3px; }
.desc-h1 { display: inline-block; font-size: 19px; font-weight: 700; margin: 8px 0 2px; }
.desc-h2 { display: inline-block; font-size: 16px; font-weight: 700; margin: 6px 0 2px; }

/* Reviewer reading aid: highlights criteria words and figures in answers */
mark.hl-term { background: #fff3a3; padding: 0 2px; border-radius: 2px; }
mark.hl-num  { background: #cfe8ff; padding: 0 2px; border-radius: 2px; }

/* Candidate's own words shown beside each scoring criterion */
.ev { margin: 4px 0 6px; }
.ev-quote { margin: 0 0 5px; padding: 5px 8px; border-left: 3px solid #cbd5e1;
  background: #f8fafc; font-size: 13px; line-height: 1.45; color: #1f2933; }
.ev-from { display: block; margin-top: 3px; font-size: 11px; color: #64748b; }
.ev-none { margin: 4px 0 6px; font-size: 12px; color: #92400e; background: #fffbeb;
  border-left: 3px solid #f0b429; padding: 5px 8px; }

/* ---- Public roles landing page ---------------------------------------- */
.roles-wrap { max-width: 980px; margin: 0 auto; padding: 8px 0 40px; }
.roles-head h1 { margin: 0 0 2px; font-size: 30px; }
.roles-sub { margin: 0 0 14px; color: #64748b; font-size: 14px; }
.roles-intro { font-size: 15px; line-height: 1.6; color: #24313f; margin-bottom: 18px; }
.roles-intro .desc-list { margin: 8px 0; }

.roles-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.rf-btn { border: 1px solid #cbd5e1; background: #fff; color: #24313f; border-radius: 999px;
  padding: 5px 13px; font-size: 13px; cursor: pointer; }
.rf-btn:hover { border-color: #0f6b5c; }
.rf-btn.active { background: #0f6b5c; border-color: #0f6b5c; color: #fff; font-weight: 600; }

.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.role-card { border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; background: #fff;
  display: flex; flex-direction: column; }
.role-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.role-card h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.role-org { margin: 3px 0 8px; color: #0f6b5c; font-weight: 600; font-size: 14px; }
.role-summary { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: #24313f; }
.role-facts { margin: 0 0 14px; font-size: 13px; }
.role-facts dt { color: #64748b; font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; margin-top: 8px; }
.role-facts dd { margin: 2px 0 0; color: #1f2933; }
.role-facts .role-elig { background: #fffbeb; border-left: 3px solid #f0b429; padding: 5px 8px; }
.role-btn { margin-top: auto; text-align: center; text-decoration: none; }
.role-closed-note { margin-top: auto; font-size: 13px; color: #64748b; font-style: italic; }
.closed-badge { background: #e2e8f0; color: #475569; }
.role-card.is-closed { opacity: .62; background: #f8fafc; }
.roles-foot { margin-top: 22px; }

/* Multiple-choice questions on the application form */
.choice-list { flex-direction: column; align-items: flex-start; gap: 4px; }
.choice-list label { font-weight: 400; }

/* Inline card editing for admins and managers on the public roles page */
.card-edit { margin-top: 10px; border-top: 1px dashed #cbd5e1; padding-top: 8px; }
.card-edit > summary { cursor: pointer; font-size: 12px; color: #64748b; }
.card-edit label { font-size: 12px; margin-top: 6px; }
.card-edit textarea, .card-edit input[type=text], .card-edit select { font-size: 13px; }

/* Role status badges */
.badge.pending { background: #eef2ff; color: #4338ca; }
.badge.paused { background: #fff7ed; color: #b45309; }
.role-paused-note { margin-top: auto; font-size: 13px; color: #b45309; font-style: italic; }
.paused-badge { background: #fff7ed; color: #b45309; }
.role-card.is-paused { background: #fffdf8; }

/* Admin preview of another role */
.preview-bar { background: #7c3aed; color: #fff; padding: 7px 16px; font-size: 13px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.preview-bar form { margin: 0; }
.topnav .view-as { display: flex; align-items: center; gap: 5px; margin-right: 10px; }
.topnav .view-as label { color: #64748b; }
