/* Emonics Consultant Onboarding -- design tokens shared with the portal
   family (navy/orange/bg/border palette, same spacing scale). Brand mark
   is CSS/text-only in this candidate -- the real logo asset is never
   typeset here (pre-candidate checklist). */

:root {
  --navy: #1E2A5E;
  --navy-dark: #141b40;
  --navy-mid: #2c3a72;
  --navy-tint: rgba(30, 42, 94, 0.06);
  --navy-tint-2: rgba(30, 42, 94, 0.11);
  --orange: #E65F3C;
  --orange-dark: #c94d2d;
  --orange-tint: rgba(230, 95, 60, 0.12);
  --icon-bg: #FDF0EC;
  --ink: #1a1f36;
  --ink-soft: #3d4560;
  --muted: #6b7280;
  --muted-light: #98a0b0;
  --bg: #F4F5F9;
  --card: #ffffff;
  --border: #E5E8F0;
  --border-soft: #EEF0F6;
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --green: #15803d;
  --green-bg: #dcfce7;

  /* Phase accents. Colour is an ACCENT per stage tile, never a grouping
     container -- phases interleave in the C2C and Training ladders
     (paperwork -> screening -> paperwork), so grouping them into contiguous
     blocks would misrepresent the order. Accenting each tile conveys the
     same phase information without touching sequence. */
  --phase-close: #1E2A5E;
  --phase-close-bg: rgba(30, 42, 94, 0.08);
  --phase-paperwork: #4338ca;
  --phase-paperwork-bg: rgba(67, 56, 202, 0.09);
  --phase-screening: #E65F3C;
  --phase-screening-bg: rgba(230, 95, 60, 0.11);
  --phase-prep: #0e7490;
  --phase-prep-bg: rgba(14, 116, 144, 0.10);
  --phase-marketing: #15803d;
  --phase-marketing-bg: rgba(21, 128, 61, 0.10);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 14px rgba(16, 24, 40, 0.05);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--navy); }
button { font-family: var(--font); cursor: pointer; }

.brand-logo { display: block; height: 28px; width: auto; }
.login-card .brand-logo { height: 40px; margin: 0 auto var(--space-5); }

/* ==================== login page ==================== */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-6); }

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--orange);
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  padding: var(--space-6) var(--space-6) var(--space-5);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
}

.login-card h1 { font-size: 22px; font-weight: 700; color: var(--navy); text-align: center; margin: 0 0 var(--space-1); }
.login-card .sub { text-align: center; color: var(--muted); margin: 0 0 var(--space-5); font-size: 13px; }

.login-card label { display: block; font-size: 12px; font-weight: 600; color: var(--navy); margin: 0 0 var(--space-2); letter-spacing: 0.02em; }

.login-card input[type="email"],
.login-card input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: var(--space-4);
}

.login-card button {
  width: 100%;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-weight: 600;
  font-size: 14px;
}
.login-card button:hover { background: var(--navy-dark); }

.login-msg { text-align: center; font-size: 13px; color: var(--muted); min-height: 18px; }
.login-footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: var(--space-4); }

/* ==================== app shell ==================== */

.app-header {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: 0 var(--space-5);
  height: 56px;
}
.app-nav { display: flex; gap: var(--space-4); flex: 1; }
.app-nav a { color: rgba(255,255,255,0.75); text-decoration: none; font-size: 14px; font-weight: 600; padding: 8px 0; }
.app-nav a.active, .app-nav a:hover { color: #fff; border-bottom: 2px solid var(--orange); }
.app-account { display: flex; align-items: center; gap: var(--space-3); font-size: 13px; }
.btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: #fff; border-radius: 6px; padding: 6px 10px; font-size: 12px; }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

/* The pipeline is a wide instrument -- the shell takes the viewport minus
   sane margins rather than a centred reading column, so stage cards can be
   large enough to hold consultants instead of shrinking to chips. */
.app-main { padding: var(--space-5) var(--space-6) var(--space-7); max-width: 1800px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }
.page-title { font-size: 25px; font-weight: 700; color: var(--navy); letter-spacing: -0.015em; margin: 0 0 var(--space-1); }
.page-sub { color: var(--muted); font-size: 13.5px; margin: 0; max-width: 70ch; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; margin-bottom: var(--space-5); }

/* ==================== board ==================== */

/* Division switch as a proper segmented control (same component language as
   org-hierarchy's), with each division's live headcount in its label. */
.division-tabs {
  display: inline-flex; background: #e9ecf3; border-radius: 9px; padding: 3px; gap: 2px;
  margin-bottom: var(--space-5);
}
.division-tab {
  background: none; border: none; color: var(--muted);
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 15px; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}
.division-tab:hover:not(.active) { color: var(--ink); }
.division-tab.active { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }
.division-tab .tab-count {
  min-width: 19px; height: 19px; padding: 0 6px; border-radius: 999px;
  background: var(--navy-tint-2); color: var(--navy);
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.division-tab.active .tab-count { background: var(--navy); color: #fff; }
.division-tab.is-zero .tab-count { background: transparent; color: var(--muted-light); border: 1px solid var(--border); }

/* Phase legend -- explains the accent colours without grouping stages. */
.phase-legend { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.phase-key { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.phase-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }

/* Stage cards WRAP into a responsive grid instead of one horizontal strip --
   a 10-to-14-stage ladder forced sideways scrolling. Cards are deliberately
   LARGE (min 260px, min-height 196px): the board is the instrument an exec
   opens, and each card must hold 2-3 consultants without expanding. At
   1440px this lays out 5 per row, so the 14-stage FT ladder is 3 full rows
   filling the width and most of the height.

   Cards stretch to a uniform height per row. Letting populated cards grow
   past their row-mates instead left ragged gaps under every short card,
   which read as patchy rather than composed -- and stretching costs
   populated stages nothing, since the row grows to fit its tallest card.
   Because the ladder wraps, each card carries its step number --
   left-to-right alone no longer conveys sequence. */
.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-items: stretch;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
}

.board-col {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  min-height: 196px;
  display: flex;
  flex-direction: column;
  /* The phase accent rides the top edge of every card -- the journey reads
     as a coloured progression across the ladder, not 14 identical boxes.
     --phase-* are set per card by the renderer. */
  border-top: 3px solid var(--phase, var(--navy));
  transition: box-shadow .16s ease, border-color .12s ease;
}
.board-col:hover { box-shadow: var(--shadow); }

.board-col-header {
  padding: var(--space-4) var(--space-4) var(--space-3);
  display: flex; align-items: flex-start; gap: var(--space-3);
}
/* Step marker styled as a waypoint on the path, tinted to its phase. */
.stage-num {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  background: var(--phase-bg, var(--navy-tint));
  color: var(--phase, var(--navy));
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.stage-heading { flex: 1; min-width: 0; }
.stage-name {
  display: block;
  font-size: 12.5px; font-weight: 700; color: var(--navy);
  text-transform: uppercase; letter-spacing: 0.05em;
  line-height: 1.35; overflow-wrap: break-word;
}
.stage-phase { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted-light); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 3px; }
/* Count as a big numeral, not a chip -- it is the number an exec scans for. */
.stage-count {
  flex: none; font-size: 26px; font-weight: 700; line-height: 1;
  color: var(--navy); font-variant-numeric: tabular-nums;
}
.board-col.is-empty .stage-count { color: var(--muted-light); font-weight: 600; }

.board-col-body {
  padding: 0 var(--space-3) var(--space-3);
  display: flex; flex-direction: column; gap: 7px;
  flex: 1;
}

/* ---- empty stage, designed rather than blank ----
   In the all-zero board an empty stage stays FULL SIZE: at zero the board
   must still look like a substantial instrument, not a collapsed accordion.
   A faint dashed well carries the stage's phase tint so the ladder reads as
   the map of the process even with nobody in it. */
.stage-well {
  flex: 1; border: 1px dashed var(--border); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--phase-bg, var(--navy-tint)) 0%, rgba(255,255,255,0) 70%);
  display: flex; align-items: center; justify-content: center;
  min-height: 92px;
}
.stage-well span { font-size: 11.5px; font-weight: 600; color: var(--muted-light); letter-spacing: 0.04em; }

/* ...but once OTHER stages are populated, an empty stage recedes: it keeps
   its row's height so rows stay uniform, and drops the "Empty" well so five
   placeholders don't shout over the consultants who are actually there. */
.board.has-population .board-col.is-empty { box-shadow: none; background: #fbfcfe; }
.board.has-population .board-col.is-empty .stage-well { display: none; }

/* ---- full-board empty state ---- */
.board-empty-banner {
  display: flex; align-items: center; gap: var(--space-4);
  background: var(--card); border: 1px solid var(--border);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.board-empty-banner .beb-icon {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  background: var(--icon-bg); color: var(--orange);
  display: flex; align-items: center; justify-content: center;
}
.board-empty-banner .beb-title { font-size: 14.5px; font-weight: 700; color: var(--navy); margin: 0 0 2px; }
.board-empty-banner .beb-sub { font-size: 12.5px; color: var(--muted); margin: 0; }

/* Consultant entry: a person with presence -- initials, name, dwell chip,
   and a dwell warning that escalates amber -> red rather than one flat
   "over SLA" flag. */
.card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 9px 10px;
  cursor: pointer;
  display: flex; align-items: center; gap: 9px;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.card:hover { border-color: var(--navy); box-shadow: var(--shadow-sm); }
.card .avatar {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy-tint-2); color: var(--navy);
  border: 1px solid rgba(30, 42, 94, 0.09);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
}
.card .card-identity { min-width: 0; flex: 1; }
.card .name {
  font-weight: 600; font-size: 13px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.dwell {
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: #f4f6fa; border-radius: 999px; padding: 2px 7px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.card.dwell-warn { border-color: #f3ddb0; background: #fffdf6; }
.card.dwell-warn .dwell { background: var(--amber-bg); color: var(--amber); }
.card.dwell-over { border-color: #f3c6c6; background: var(--error-bg); }
.card.dwell-over .dwell { background: #fde2e2; color: var(--error); }
.card .lane-tag, .card .hold-tag {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 6px; border-radius: 4px; white-space: nowrap;
}
.card .lane-tag { background: var(--orange-tint); color: var(--orange-dark); }
.card .hold-tag { background: var(--amber-bg); color: var(--amber); }

/* "+N more" when a stage holds more than the card shows at rest. */
.card-more {
  text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding: 5px; border-radius: var(--radius-sm); background: #f7f9fc; cursor: pointer;
}
.card-more:hover { background: #eef2f8; color: var(--navy); }
.badge { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600; background: var(--bg); color: var(--muted); }
.badge.division-FT { background: var(--orange-tint); color: var(--orange-dark); }
.badge.division-C2C { background: #EEF2FF; color: #3730A3; }
.badge.division-Hybrid { background: #ECFDF5; color: #065F46; }
.badge.division-Training { background: #FEF3C7; color: #92400E; }
.badge.over-sla { background: var(--error-bg); color: var(--error); }

/* ==================== detail ==================== */

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.detail-panel { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: var(--space-4); }
.detail-panel h2 { font-size: 14px; color: var(--navy); margin: 0 0 var(--space-3); }
.kv-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.kv-row .k { color: var(--muted); }
.event-row, .mail-row { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.event-row .dir-forward { color: var(--success); }
.event-row .dir-backward { color: var(--error); }
.event-row .dir-mint { color: var(--navy); }

.stage-advance { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-4); }
.stage-advance select, .stage-advance input, .stage-advance button { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.stage-advance button { background: var(--navy); color: #fff; border: none; font-weight: 600; }
.stage-advance button:hover { background: var(--navy-dark); }

/* ==================== payments ==================== */

.payment-form { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-4); align-items: center; }
.payment-form select, .payment-form input, .payment-form button { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.payment-form input[type="number"] { width: 120px; }
.payment-form input[type="file"] { border: none; padding: 0; }
.payment-form button { background: var(--orange); color: #fff; border: none; font-weight: 600; }
.payment-form button:hover { background: var(--orange-dark); }

/* ==================== pending assignments list ==================== */

.pending-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-3);
  margin-bottom: var(--space-2);
}
.pending-row.over-sla { border-left: 3px solid var(--error); background: var(--error-bg); }
.pending-row .main { flex: 1; cursor: pointer; }
.pending-row .name { font-weight: 600; }
.pending-row .meta { color: var(--muted); font-size: 12px; }
.pending-row button { padding: 8px 14px; border: none; border-radius: 6px; font-weight: 600; font-size: 13px; background: var(--navy); color: #fff; }
.pending-row button:hover { background: var(--navy-dark); }
.pending-row .state-label { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ==================== modal ==================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: var(--card);
  border-radius: 12px;
  padding: var(--space-5);
  min-width: 360px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(16, 24, 40, 0.2);
}
.modal-box h2 { margin: 0 0 var(--space-4); color: var(--navy); font-size: 16px; }
.modal-box .row { margin-bottom: var(--space-3); position: relative; }
.modal-box label { display: block; font-size: 12px; font-weight: 600; color: var(--navy); margin-bottom: var(--space-2); }
.modal-box input, .modal-box select { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.modal-box .actions { display: flex; gap: var(--space-2); justify-content: flex-end; margin-top: var(--space-4); }
.modal-box .actions button { padding: 9px 16px; border-radius: 6px; font-weight: 600; font-size: 13px; border: none; }
.modal-box .btn-primary { background: var(--orange); color: #fff; }
.modal-box .btn-primary:hover { background: var(--orange-dark); }
.modal-box .btn-cancel { background: var(--bg); color: var(--ink); }

/* ==================== employee picker ==================== */

.picker-row { position: relative; }
.picker-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.1);
}
.picker-option { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.picker-option:hover { background: var(--bg); }
.picker-option.muted { color: var(--muted); cursor: default; }

/* ==================== new enrollment form ==================== */

.form-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: var(--space-5); max-width: 560px; }
.form-card .row { margin-bottom: var(--space-4); }
.form-card label { display: block; font-size: 12px; font-weight: 600; color: var(--navy); margin-bottom: var(--space-2); }
.form-card input, .form-card select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.form-card button { background: var(--orange); color: #fff; border: none; border-radius: 8px; padding: 11px 18px; font-weight: 600; }
.form-card button:hover { background: var(--orange-dark); }

.msg { font-size: 13px; padding: 8px 10px; border-radius: 6px; margin-top: var(--space-3); }
.msg.error { background: var(--error-bg); color: var(--error); }
.msg.success { background: var(--success-bg); color: var(--success); }

/* ---- candidate profile (exec daily-review substance) ---- */
.profile-panel {
  border: 1px solid var(--border); border-left: 3px solid var(--orange);
  border-radius: var(--radius); background: #fcfdff;
  padding: var(--space-3) var(--space-4); margin: var(--space-3) 0;
}
.profile-panel-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--orange-dark); margin-bottom: var(--space-2);
}
.profile-panel .kv-row { padding: 5px 0; }
.profile-notes { margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border-soft); }
.profile-notes .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.profile-notes p { margin: 3px 0 0; font-size: 13px; color: var(--ink); }

/* compact profile line on a board card */
.card-profile {
  display: block; margin-top: 3px; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Dropped: visible on the board by ruling, but visually retired -- a
   neutral grey accent so it never competes with live pipeline stages. */
:root { --phase-dropped: #6b7280; --phase-dropped-bg: rgba(107, 114, 128, 0.10); }
.board-col.is-dropped { background: #fbfbfc; }
