/* ═══════════════════════════════════════════════════════════════════════════
   RECRUITER ACTIVITY TRACKER — DESIGN SYSTEM
   Phase 1 foundation. Locked before any screen is built.

   Everything here is token-driven. Screens compose these classes; they do
   not invent colours, spacing or type sizes. If a screen needs something
   this file does not have, it goes in this file first.

   No web fonts — an internal LAN app should not depend on an external font
   host being reachable. System stacks render Segoe UI on Windows.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Light palette: the complete token set ────────────────────────────────── */
:root {
  --bg:            #F4F6F5;
  --surface:       #FFFFFF;
  --surface-2:     #EDF1EF;
  --surface-3:     #E4EAE8;

  --text:          #16201E;
  --text-2:        #4A5754;
  --text-3:        #75827E;

  --border:        #DBE2E0;
  --border-2:      #E9EDEB;

  --accent:        #0E6459;
  --accent-hover:  #0B5049;
  --accent-soft:   #E2EFEC;
  --accent-ink:    #0B4E45;
  --on-accent:     #FFFFFF;

  --ok:            #2E7D3C;
  --ok-soft:       #E4F1E5;
  --warn:          #8A5E08;
  --warn-soft:     #F9EFD9;
  --danger:        #A93B2D;
  --danger-soft:   #F9E6E3;

  --focus:         #0E6459;

  --shadow-1: 0 1px 2px rgba(22,32,30,.06);
  --shadow-2: 0 1px 3px rgba(22,32,30,.08), 0 8px 24px -12px rgba(22,32,30,.18);
  --shadow-3: 0 2px 8px rgba(22,32,30,.10), 0 20px 48px -16px rgba(22,32,30,.28);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  --sidebar-w: 236px;
  --topbar-h: 56px;
}

/* ── Dark: system preference, unless an explicit light choice overrides ───── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0D1312;
    --surface:       #141D1B;
    --surface-2:     #1A2422;
    --surface-3:     #212C2A;

    --text:          #E8EDEB;
    --text-2:        #AEBAB6;
    --text-3:        #869491;

    --border:        #24302E;
    --border-2:      #1C2725;

    --accent:        #4FC0AD;
    --accent-hover:  #6BCFBE;
    --accent-soft:   #133029;
    --accent-ink:    #7FD6C7;
    --on-accent:     #06201C;

    --ok:            #5DBB6C;
    --ok-soft:       #16291A;
    --warn:          #D6A23A;
    --warn-soft:     #2B2413;
    --danger:        #E0705F;
    --danger-soft:   #2E1A17;

    --focus:         #4FC0AD;

    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 1px 3px rgba(0,0,0,.5), 0 8px 24px -12px rgba(0,0,0,.7);
    --shadow-3: 0 2px 8px rgba(0,0,0,.5), 0 20px 48px -16px rgba(0,0,0,.8);
  }
}

/* ── Dark: explicit toggle wins in both directions ───────────────────────── */
:root[data-theme="dark"] {
  --bg:            #0D1312;
  --surface:       #141D1B;
  --surface-2:     #1A2422;
  --surface-3:     #212C2A;

  --text:          #E8EDEB;
  --text-2:        #AEBAB6;
  --text-3:        #869491;

  --border:        #24302E;
  --border-2:      #1C2725;

  --accent:        #4FC0AD;
  --accent-hover:  #6BCFBE;
  --accent-soft:   #133029;
  --accent-ink:    #7FD6C7;
  --on-accent:     #06201C;

  --ok:            #5DBB6C;
  --ok-soft:       #16291A;
  --warn:          #D6A23A;
  --warn-soft:     #2B2413;
  --danger:        #E0705F;
  --danger-soft:   #2E1A17;

  --focus:         #4FC0AD;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 1px 3px rgba(0,0,0,.5), 0 8px 24px -12px rgba(0,0,0,.7);
  --shadow-3: 0 2px 8px rgba(0,0,0,.5), 0 20px 48px -16px rgba(0,0,0,.8);
}


/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* The browser hides [hidden] elements with a user-agent rule, and ANY author
   rule that sets `display` outranks it. `.alert` sets `display: flex`, so
   every alert marked hidden was still painting — an empty coloured bar above
   the login form and inside every modal.

   !important is deliberate: the whole job of this rule is to beat whatever
   display a component sets for itself. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}


/* ── Typography ──────────────────────────────────────────────────────────── */
.h1 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.h2 { font-size: 17px; font-weight: 600; letter-spacing: -.005em; line-height: 1.3; }
.h3 { font-size: 14px; font-weight: 600; }

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.muted    { color: var(--text-2); }
.subtle   { color: var(--text-3); }
.small    { font-size: 12.5px; }
.num      { font-variant-numeric: tabular-nums; }
.mono     { font-family: var(--mono); }
.nowrap   { white-space: nowrap; }


/* ── Layout primitives ───────────────────────────────────────────────────── */
.stack   { display: flex; flex-direction: column; gap: 16px; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }
.stack-l { display: flex; flex-direction: column; gap: 28px; }
.row     { display: flex; align-items: center; gap: 12px; }
.row-s   { display: flex; align-items: center; gap: 6px; }
.spacer  { flex: 1 1 auto; }
.wrap    { flex-wrap: wrap; }

.grid    { display: grid; gap: 16px; }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }


/* ── App shell ───────────────────────────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border-2);
  flex: none;
}
/* The mark is an SVG file now, not a lettered tile — one asset serves the
   favicon, the sidebar, the login card and the boot splash. */
.brand-mark { width: 26px; height: 26px; flex: none; display: block; }

.brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--text);
}
/* The second half of the wordmark is lighter, so "Recruit" and "Metrics"
   read as one name rather than two words competing for weight. */
.brand-name-soft { font-weight: 400; color: var(--text-2); }

a.brand { text-decoration: none; }
a.brand:hover { text-decoration: none; background: var(--surface-2); }

.nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}
.nav-icon { width: 16px; text-align: center; flex: none; opacity: .85; }

.who { padding: 8px 10px; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }

/* ── The account corner ──────────────────────────────────────────────────
   Top right of the bar. One control, and a menu behind it — the sidebar foot
   it replaces had three buttons side by side in a 220px column, which wrapped
   and read as another row of navigation. */
.usermenu { position: relative; flex: none; }

.usermenu-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 260px;
  padding: 4px 10px 4px 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--text);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.usermenu-btn:hover,
.usermenu-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border); }

.avatar {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11.5px;
  font-weight: 700;
}

.usermenu-who { display: grid; min-width: 0; text-align: left; line-height: 1.3; }
.usermenu-name { font-size: 13px; font-weight: 600; }
.usermenu-meta { font-size: 11px; color: var(--text-3); }
.usermenu-name,
.usermenu-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu-caret { font-size: 9px; color: var(--text-3); flex: none; }

.usermenu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 236px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  z-index: 70;
}
.usermenu-list[hidden] { display: none; }

.usermenu-head {
  padding: 6px 10px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-2);
}

.usermenu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--r-md);
  background: none;
  color: var(--text-2);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.usermenu-item:hover { background: var(--surface-2); color: var(--text); }
.usermenu-icon { width: 16px; flex: none; text-align: center; font-size: 14px; opacity: .85; }
.usermenu-item-danger { color: var(--danger); }
.usermenu-item-danger:hover { background: var(--danger-soft); color: var(--danger); }

.usermenu-sep { height: 1px; margin: 6px 4px; background: var(--border-2); }

/* Narrow: the avatar alone. The name is still in the menu it opens. */
@media (max-width: 620px) {
  .usermenu-who, .usermenu-caret { display: none; }
  .usermenu-btn { padding: 4px; }
}

/* ── The bell ────────────────────────────────────────────────────────────
   Reuses the account menu's shell — same button, same dropdown, same
   dismissal — so the two controls sitting side by side behave identically. */
.bell-btn {
  position: relative;
  padding: 7px;
  border-radius: 50%;
}
.bell-icon { font-size: 15px; line-height: 1; color: var(--text-2); }

.bell-count {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.bell-count[hidden] { display: none; }

.bell-list { width: 340px; max-width: calc(100vw - 32px); padding: 6px; }
.bell-items { max-height: 380px; overflow-y: auto; }

.bell-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: var(--r-md);
  background: none;
  text-align: left;
  cursor: pointer;
}
.bell-item:hover { background: var(--surface-2); }

/* The dot is the only thing marking unread. A tinted row would fight the
   hover state, and bold text would fight the title's own weight. */
.bell-dot {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  flex: none;
  border-radius: 50%;
  background: transparent;
}
.bell-item.is-unread .bell-dot { background: var(--accent); }

.bell-body { display: grid; gap: 2px; min-width: 0; }
.bell-title { font-size: 13px; font-weight: 600; color: var(--text); }
.bell-item.is-unread .bell-title { color: var(--text); }
.bell-item:not(.is-unread) .bell-title { color: var(--text-2); font-weight: 500; }
.bell-detail { font-size: 12px; color: var(--text-2); }
.bell-when { font-size: 11px; color: var(--text-3); }

.bell-empty { padding: 18px 12px; text-align: center; }

.view { padding: 24px; flex: 1; min-width: 0; }
.view-narrow { max-width: 780px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--sidebar-w); z-index: 60;
    transform: translateX(-100%);
    transition: transform .18s ease;
    box-shadow: var(--shadow-3);
  }
  .sidebar[data-open="true"] { transform: none; }
  .view { padding: 16px; }
  .topbar { padding: 0 16px; }
}
.scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  z-index: 50; border: none; padding: 0; cursor: pointer;
}


/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-body { padding: 18px; }
.card-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}


/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, opacity .12s ease;
}
.btn:hover:not(:disabled) { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-danger { color: var(--danger); border-color: var(--border); }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }

.btn-ghost { background: none; border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }

.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }

.btn[data-loading="true"] { position: relative; color: transparent !important; }
.btn[data-loading="true"]::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  color: var(--on-accent);
}
.btn-primary[data-loading="true"]::after { color: var(--on-accent); }
.btn:not(.btn-primary)[data-loading="true"]::after { color: var(--text-2); }
@keyframes spin { to { transform: rotate(360deg); } }


/* ── Forms ───────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field-label .req { color: var(--danger); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input:disabled, .textarea:disabled { background: var(--surface-2); color: var(--text-3); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }

.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.input-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Password reveal. The button sits inside the field rather than beside it, so
   the control keeps its full width and nothing shifts when it appears. */
.input-reveal { position: relative; display: block; }
.input-reveal .input { padding-right: 40px; }

.reveal-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color .12s ease, background .12s ease;
}
.reveal-toggle:hover  { color: var(--text); background: var(--surface-2); }
.reveal-toggle:active { color: var(--accent); }
.reveal-toggle:focus-visible {
  outline: none;
  color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.field[data-invalid="true"] .input,
.field[data-invalid="true"] .textarea,
.field[data-invalid="true"] .select { border-color: var(--danger); }

.field-error { font-size: 12px; color: var(--danger); }
.field-help  { font-size: 12px; color: var(--text-3); }


/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.table thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.table thead th[data-sortable] { cursor: pointer; user-select: none; }
.table thead th[data-sortable]:hover { color: var(--text); }
.table thead th .sort-mark { margin-left: 5px; opacity: .55; }
.table thead th[aria-sort]:not([aria-sort="none"]) { color: var(--accent); }
.table thead th[aria-sort]:not([aria-sort="none"]) .sort-mark { opacity: 1; }

.table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--surface-2); }

.table .cell-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .cell-center { text-align: center; }

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-2);
  flex-wrap: wrap;
}
.table-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-2);
  font-size: 12.5px;
  color: var(--text-3);
}


/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-ok     { background: var(--ok-soft);     color: var(--ok);     border-color: transparent; }
.badge-warn   { background: var(--warn-soft);   color: var(--warn);   border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }

/* State carried by shape as well as colour, so the screen still reads in
   greyscale and for colour-blind users. */
.badge-ok::before     { content: "\25CF"; }
.badge-warn::before   { content: "\25B2"; }
.badge-danger::before { content: "\2715"; }


/* ── Stat tiles ──────────────────────────────────────────────────────────── */
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-1);
}
.tile-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.tile-value {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.tile-delta { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tile-delta[data-dir="up"]   { color: var(--ok); }
.tile-delta[data-dir="down"] { color: var(--danger); }
.tile-delta[data-dir="flat"] { color: var(--text-3); }
.tile-foot { font-size: 12px; color: var(--text-3); }


/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  border: 1px solid transparent;
}
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-warn   { background: var(--warn-soft);   color: var(--warn); }
.alert-ok     { background: var(--ok-soft);     color: var(--ok); }
.alert-info   { background: var(--accent-soft); color: var(--accent-ink); }


/* ── Empty & loading states ──────────────────────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-3);
}
.empty-title { font-size: 14px; font-weight: 600; color: var(--text-2); }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }


/* ── Toasts ──────────────────────────────────────────────────────────────── */
.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 260px;
  max-width: 400px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-3);
  font-size: 13.5px;
  pointer-events: auto;
  animation: toast-in .18s ease;
}
.toast[data-kind="ok"]     { border-left: 3px solid var(--ok); }
.toast[data-kind="error"]  { border-left: 3px solid var(--danger); }
.toast[data-kind="warn"]   { border-left: 3px solid var(--warn); }
.toast[data-kind="info"]   { border-left: 3px solid var(--accent); }
.toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 0 2px; line-height: 1;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }


/* ── Login ───────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 372px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: 28px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.auth-title { font-size: 19px; font-weight: 650; letter-spacing: -.015em; }
.auth-title .brand-name-soft { font-weight: 400; color: var(--text-2); }
.auth-sub { font-size: 13px; color: var(--text-3); margin-top: 2px; }


/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal {
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-3);
}
.modal::backdrop { background: rgba(10, 18, 17, .45); }

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-2);
}
.modal-body { padding: 20px; max-height: 65vh; overflow-y: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-2);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}


/* ── Two-column form grid ────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.form-grid .span-2 { grid-column: 1 / -1; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  cursor: pointer;
  padding: 6px 0;
}
.check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }


/* ── Hierarchy tree ──────────────────────────────────────────────────────── */
.tree-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-2);
}
.tree-row:last-child { border-bottom: none; }
.tree-row:hover { background: var(--surface-2); }
.tree-rail { flex: none; color: var(--text-3); font-family: var(--mono); white-space: pre; }
.tree-name { font-weight: 500; }
.tree-meta { font-size: 12.5px; color: var(--text-3); }


/* ── Import steps ────────────────────────────────────────────────────────── */
.steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.step {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 8px;
  border-radius: 20px;
  font-size: 12.5px;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.step[data-state="active"] { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.step[data-state="done"]   { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.step-num {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  background: var(--surface); color: inherit;
  border: 1px solid currentColor;
}
.step-arrow { color: var(--text-3); font-size: 11px; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 34px 20px;
  text-align: center;
  background: var(--surface);
  transition: border-color .12s ease, background .12s ease;
}
.dropzone[data-over="true"] { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }

.issue-row { display: grid; grid-template-columns: 60px 110px 1fr; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--border-2); font-size: 13px; }
.issue-row:last-child { border-bottom: none; }
.issue-row .issue-loc { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }

.cred-table { font-family: var(--mono); font-size: 12.5px; }


/* ── Daily activity: the count grid ──────────────────────────────────────────
   Large targets and big type. This form is filled every working day, and the
   number should be readable across a desk without leaning in.               */
.count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.count-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  cursor: text;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.count-cell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.count-cell:has(input:disabled) { background: var(--surface-2); cursor: default; }

.count-input {
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--text);
}
.count-input:focus { outline: none; }
.count-input:disabled { color: var(--text-3); }

/* Spinners are useless at this size and steal horizontal room. */
.count-input::-webkit-outer-spin-button,
.count-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.count-input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.count-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-top: 4px;
}
.count-hint { font-size: 11.5px; color: var(--text-3); }


/* ── Team day view ───────────────────────────────────────────────────────── */
.day-picker { display: flex; align-items: center; gap: 6px; }
.day-picker .input { width: auto; }

.flag-list { display: flex; flex-wrap: wrap; gap: 4px; }

.exception-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-2);
  font-size: 13.5px;
}
.exception-line:last-child { border-bottom: none; }
.exception-line .who { font-weight: 600; min-width: 130px; }

.remark-cell {
  max-width: 320px;
  color: var(--text-2);
  font-size: 12.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ── Trend chart ─────────────────────────────────────────────────────────── */
.trend-svg { width: 100%; height: auto; display: block; }

.trend-svg .grid       { stroke: var(--border-2); stroke-width: 1; }
.trend-svg .bar        { fill: var(--accent); opacity: .38; transition: opacity .12s ease; }
.trend-svg .bar:hover  { opacity: .62; }
/* The most recent month is the one being read; everything else is context. */
.trend-svg .bar-current { opacity: .95; }
.trend-svg .bar-value  { fill: var(--text-2); font-size: 10.5px; font-weight: 600;
                         font-family: var(--sans); font-variant-numeric: tabular-nums; }
.trend-svg .axis-label { fill: var(--text-3); font-size: 10px;
                         font-family: var(--mono); letter-spacing: .04em; }


/* ── Period picker ───────────────────────────────────────────────────────── */
.period { display: flex; align-items: center; gap: 6px; }
.period .select { width: auto; min-width: 130px; }

/* A row of controls that narrow a list — selects, a date range, a clear
   button. Without this they inherit width:100% from the shared field rule and
   each claims a line of its own, so three filters become three rows. */
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.filters .select { width: auto; min-width: 150px; }
.filters .input  { width: auto; }


/* ── Rank pill ───────────────────────────────────────────────────────────── */
.rank {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}
.rank b { font-size: 13px; font-weight: 700; color: var(--text-2); }
.rank[data-top="true"] b { color: var(--ok); }

/* ── Delta ───────────────────────────────────────────────────────────────── */
.delta { font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta[data-dir="up"]   { color: var(--ok); }
.delta[data-dir="down"] { color: var(--danger); }
.delta[data-dir="flat"] { color: var(--text-3); }
/* Fewer duplicates is an improvement, so this metric reads inverted. */
.delta[data-invert="true"][data-dir="up"]   { color: var(--danger); }
.delta[data-invert="true"][data-dir="down"] { color: var(--ok); }

.metric-tabs { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Observation-mode banner ─────────────────────────────────────────────── */
.observation {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text-2);
}


/* ── Review document ─────────────────────────────────────────────────────── */
.review-doc { max-width: 860px; }

.review-text {
  white-space: pre-wrap;
  line-height: 1.65;
  color: var(--text);
  font-size: 14.5px;
}

.comment {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-2);
}
.comment:last-of-type { border-bottom: none; }
.comment-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 3px;
  font-size: 13px;
}


/* ── Print ───────────────────────────────────────────────────────────────────
   The review page doubles as the PDF. Printing drops the shell and every
   control, leaving the figures and the assessment — so what comes out of the
   printer is exactly what the manager was reading, with no PDF library and
   no licensing question attached to one.                                    */
@media print {
  @page { margin: 16mm; }

  /* Print in the light palette regardless of the reader's theme — a dark
     surface would otherwise render as a solid black page or as white-on-white. */
  :root, :root[data-theme="dark"] {
    --bg: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #FFFFFF;
    --surface-3: #FFFFFF;
    --text: #000000;
    --text-2: #333333;
    --text-3: #666666;
    --border: #BBBBBB;
    --border-2: #DDDDDD;
    --accent: #0B4E45;
    --accent-soft: #FFFFFF;
    --accent-ink: #0B4E45;
    --ok: #1F5D2A;
    --danger: #8C2F22;
    --shadow-1: none;
    --shadow-2: none;
    --shadow-3: none;
  }

  body { background: #FFFFFF; font-size: 11pt; }

  .sidebar,
  .topbar,
  .toast-host,
  .no-print,
  .scrim          { display: none !important; }

  .shell          { display: block; }
  .view           { padding: 0; }
  .card           { border: none; box-shadow: none; }
  .card-head      { padding: 0 0 10px; border-bottom: 1px solid #000; }
  .card-body      { padding: 14px 0 0; }
  .card-foot      { background: none; padding: 10px 0 0; border-top: 1px solid #DDD; }
  .review-doc     { max-width: none; }

  .tile           { border: 1px solid #DDD; box-shadow: none; break-inside: avoid; }
  .grid-auto      { grid-template-columns: repeat(3, 1fr); }
  .badge          { border: 1px solid #999; }
  .comment        { break-inside: avoid; }

  a[href]::after  { content: ""; }
}


/* ── The written account ─────────────────────────────────────────────────── */
.account {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.account-section { display: flex; flex-direction: column; gap: 3px; }
.account-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* Raw request preview in the dry-run dialog. */
.payload {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  color: var(--text-2);
}

@media print {
  .account { background: none; border-left: 2px solid #000; }
  .payload { display: none; }
}


/* ── Settings ────────────────────────────────────────────────────────────── */
.provider-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  max-width: 560px;
}
.provider-option {
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.provider-option:hover { border-color: var(--accent); }
.provider-option[data-selected="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}
.provider-option[data-selected="true"] .provider-name { color: var(--accent-ink); }
.provider-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }

/* The control column is sized, not `auto`.

   Inputs already carry width:100%, but in an `auto` track that resolves
   against a track sized to the input's own intrinsic width — roughly twenty
   characters — so every value longer than that was clipped with no way to
   read it back. Giving the track a real size is what actually widens them. */
.setting-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(240px, 460px);
  gap: 16px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-2);
}
.setting-row:last-child { border-bottom: none; }
.setting-key { font-size: 12.5px; font-weight: 600; color: var(--text-2); }

/* Numbers keep their own width — a four-digit port in a 460px box reads as a
   mistake rather than a setting. */
.setting-row .input-num { width: 110px; }

/* Shorter than a form textarea: these hold a list, not a paragraph. */
.setting-row .textarea { min-height: 62px; }

@media (max-width: 720px) {
  .setting-row { grid-template-columns: 1fr; gap: 6px; }
}

/* Sticky so the save action stays reachable on a long form. */
.save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  z-index: 30;
}


/* ── Dashboard: what needs attention ─────────────────────────────────────── */
.attention-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-2);
}
.attention-row:last-child { border-bottom: none; }

.attention-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--text-3);
}
.attention-dot[data-severity="danger"] { background: var(--danger); }
.attention-dot[data-severity="warn"]   { background: var(--warn); }
.attention-dot[data-severity="info"]   { background: var(--accent); }

.attention-title { font-size: 14px; font-weight: 600; }


/* ── One-time credential display ─────────────────────────────────────────── */
.cred-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  background: var(--accent-soft);
}
.cred-value {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--accent-ink);
  user-select: all;
  word-break: break-all;
}

/* ── Daily entry: criteria and their employer split ──────────────────────────
   The entry screen is generated from the criteria master, so these have to
   work for any number of rows in any order — no per-metric styling.        */

.metric-row {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 12px 14px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.metric-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.metric-row:has(input:disabled) { background: var(--surface-2); }
.metric-row[data-over="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.metric-head { display: flex; align-items: center; gap: 14px; }

/* Fixed width so every number lines up down the column regardless of how
   long the criterion's name is. */
.metric-total { width: 92px; flex: none; }

.metric-name { font-size: 14.5px; font-weight: 600; color: var(--text); }
.metric-desc { font-size: 12px; color: var(--text-3); margin-top: 1px; }

.split-box {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.split-row { display: flex; align-items: center; gap: 8px; }
.split-name { flex: 1; font-size: 13px; color: var(--text-2); }
.split-row .input-num { width: 78px; }

.split-status { font-size: 12px; color: var(--text-3); }
.split-status[data-state="over"]      { color: var(--danger); font-weight: 600; }
.split-status[data-state="remainder"] { color: var(--warn); }
.split-status[data-state="done"]      { color: var(--ok); }

/* ── Client notes (minutes of meeting) ────────────────────────────────────── */

.mom-row {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mom-head { display: flex; align-items: center; gap: 8px; }
.mom-name { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.mom-row .textarea { min-height: 62px; }

/* ── Daily targets ───────────────────────────────────────────────────────────
   Deliberately quiet. A target is context while someone fills the form in,
   not a verdict on their day — the red-for-missing treatment belongs on the
   supervisor's team view, not on the screen the recruiter types into.     */

.target-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
}
.target-badge[data-met="true"] {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}

/* Assignment chips — what management has put this recruiter on, per client.
   Deliberately quieter than the target badge when unmet: an assignment is an
   instruction to work toward, not a failure notice while the day is running. */
.assignment-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.assignment-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid transparent;
  cursor: default;
}
.assignment-chip[data-met="true"] {
  background: var(--ok-soft);
  color: var(--ok);
}

/* On the team view the same information IS a verdict, so it carries weight. */
.target-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--ok-soft);
  color: var(--ok);
}
.target-chip[data-met="false"] { background: var(--warn-soft); color: var(--warn); }
