/* ==========================================================================
   Supahuman client portal — prototype stylesheet
   Brand tokens from platform/app/assets/css/tailwind.css.
   Spatial system: quiet. Whitespace and hairlines instead of boxes,
   one accent (Lime), big light headlines, one thing per screen.
   ========================================================================== */

@import url("https://api.fontshare.com/v2/css?f[]=general-sans@300,400,500,600&display=swap");
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  /* Brand palette (exact) */
  --pine: #183a33;
  --pine-soft: #22483f;
  --pine-deep: #0e2a25;
  --ink: #10201c;
  --lime: #c6e79e;
  --lime-deep: #aeda7e;
  --lime-soft: #e6f3d4;
  --lime-wash: #f1f7e8;
  --sage: #c9d2ce;
  --mist: #e7eae8;
  --paper: #f9f9f9;
  --paper-warm: #fdfcfb;
  --amber: #b45309;
  --success: #3f7a5a;
  --destructive: #a8392e;

  /* Text ramp — three levels, no more */
  --text: #10201c;          /* primary */
  --text-2: #5c6a64;        /* secondary */
  --text-3: #8d9793;        /* tertiary / captions */

  /* Surfaces */
  --bg: #ffffff;
  --surface: #fbfbfa;       /* recessed wash */
  --hairline: #ecefed;
  --hairline-strong: #e0e5e2;

  --font: "General Sans", "Inter", -apple-system, BlinkMacSystemFont, ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  --shadow-soft: 0 1px 3px rgba(16, 32, 28, .04), 0 8px 24px -12px rgba(16, 32, 28, .10);
  --shadow-lift: 0 2px 6px rgba(16, 32, 28, .05), 0 20px 48px -20px rgba(16, 32, 28, .18);
  --shadow-modal: 0 40px 120px -30px rgba(16, 32, 28, .40);

  --nav-w: 236px;
  --page-max: 1060px;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.03em; line-height: 1.12; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
svg { display: block; }
svg:not([width]) { width: 17px; height: 17px; flex-shrink: 0; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--lime); color: var(--pine); }

/* ── Shell ─────────────────────────────────────────────────────────────── */
#app { display: flex; height: 100vh; overflow: hidden; background: var(--bg); }

.nav {
  width: var(--nav-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 14px;
  background: var(--surface);
  border-right: 1px solid var(--hairline);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 30px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.035em;
  color: var(--pine);
}

.nav__items { display: flex; flex-direction: column; gap: 2px; }

.navlink {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  font-weight: 450;
  letter-spacing: -0.015em;
  color: var(--text-2);
  transition: background .16s ease, color .16s ease;
}
.navlink svg { width: 17px; height: 17px; color: var(--text-3); transition: color .16s ease; }
.navlink:hover { background: rgba(16, 32, 28, .04); color: var(--text); }
.navlink:hover svg { color: var(--text-2); }
.navlink.is-active { background: var(--bg); color: var(--pine); font-weight: 500; box-shadow: var(--shadow-soft); }
.navlink.is-active svg { color: var(--pine); }
.navlink__label { flex: 1; min-width: 0; }
.navlink__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); flex-shrink: 0; }

.nav__foot { margin-top: auto; padding-top: 14px; }
.nav__me {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-sm);
  transition: background .16s ease;
}
.nav__me:hover { background: rgba(16, 32, 28, .04); }
.nav__me-name { font-size: 13.5px; font-weight: 500; letter-spacing: -0.015em; }
.nav__me-org { font-size: 12px; color: var(--text-3); margin-top: -1px; }

/* ── Main ──────────────────────────────────────────────────────────────── */
.main { flex: 1; min-width: 0; overflow-y: auto; }
.main::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb { background: rgba(16,32,28,.13); border-radius: 999px; border: 3px solid var(--bg); }

.page { max-width: var(--page-max); margin: 0 auto; padding: 56px 48px 120px; }
.page--wide { max-width: 1180px; }
.page--narrow { max-width: 760px; }

@media (max-width: 900px) {
  .nav { display: none; }
  .page { padding: 40px 24px 96px; }
}

/* ── Type ──────────────────────────────────────────────────────────────── */
.display { font-size: 40px; letter-spacing: -0.035em; line-height: 1.08; }
.h1 { font-size: 32px; letter-spacing: -0.033em; line-height: 1.12; }
.h2 { font-size: 23px; letter-spacing: -0.028em; line-height: 1.2; }
.h3 { font-size: 18px; letter-spacing: -0.024em; line-height: 1.3; font-weight: 500; }
.lede { font-size: 17px; line-height: 1.5; color: var(--text-2); font-weight: 400; letter-spacing: -0.015em; }
.body { font-size: 15px; line-height: 1.6; color: var(--text-2); }
.small { font-size: 13.5px; line-height: 1.5; }
.caption { font-size: 12.5px; line-height: 1.45; color: var(--text-3); }
.eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-3);
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.dim { color: var(--text-2); }
.dimmer { color: var(--text-3); }
.strong { font-weight: 500; color: var(--text); }

/* ── Page header ───────────────────────────────────────────────────────── */
.head { display: flex; align-items: flex-start; gap: 24px; margin-bottom: 44px; }
.head__title { font-size: 34px; letter-spacing: -0.035em; line-height: 1.1; }
.head__sub { margin-top: 10px; font-size: 16.5px; line-height: 1.5; color: var(--text-2); max-width: 56ch; }
.head__actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; padding-top: 4px; }

.sect { margin-top: 68px; }
.sect--tight { margin-top: 44px; }
.sect__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.sect__title { font-size: 19px; font-weight: 500; letter-spacing: -0.026em; }
.sect__note { font-size: 14px; color: var(--text-3); }
.sect__act { margin-left: auto; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 18px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: 14.5px; font-weight: 500; letter-spacing: -0.015em;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: scale(.98); }

.btn--primary { background: var(--pine); color: #fff; }
.btn--primary:hover { background: var(--pine-soft); box-shadow: 0 8px 20px -8px rgba(24,58,51,.5); }

.btn--lime { background: var(--lime); color: var(--pine); }
.btn--lime:hover { background: var(--lime-deep); box-shadow: 0 8px 22px -8px rgba(174,218,126,.85); }

.btn--soft { background: rgba(16,32,28,.05); color: var(--text); }
.btn--soft:hover { background: rgba(16,32,28,.09); }

.btn--line { border-color: var(--hairline-strong); color: var(--text); }
.btn--line:hover { border-color: var(--text-3); background: rgba(16,32,28,.02); }

.btn--quiet { color: var(--text-2); padding: 0 12px; }
.btn--quiet:hover { background: rgba(16,32,28,.05); color: var(--text); }

.btn--lg { height: 46px; padding: 0 26px; font-size: 15.5px; }
.btn--sm { height: 32px; padding: 0 14px; font-size: 13.5px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ── Tabs ──────────────────────────────────────────────────────────────── */
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: rgba(16,32,28,.05); border-radius: var(--r-pill); }
.tab {
  height: 32px; padding: 0 16px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 500; letter-spacing: -0.015em; color: var(--text-2);
  transition: background .16s ease, color .16s ease;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--bg); color: var(--pine); box-shadow: var(--shadow-soft); }

/* ── Pills ─────────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 25px; padding: 0 11px;
  border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 500; letter-spacing: -0.01em;
  white-space: nowrap;
}
.pill svg { width: 13px; height: 13px; stroke-width: 2.6; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.pill--live   { background: var(--lime-wash); color: var(--pine); }
.pill--live .dot { background: var(--lime-deep); }
.pill--done   { background: rgba(63,122,90,.11); color: var(--success); }
.pill--wait   { background: rgba(180,83,9,.11); color: var(--amber); }
.pill--wait .dot { background: var(--amber); }
.pill--quiet  { background: rgba(16,32,28,.055); color: var(--text-2); }
.pill--quiet .dot { background: var(--text-3); }
.pill--proven { background: var(--pine); color: var(--lime); }

/* ── Cards / surfaces ──────────────────────────────────────────────────── */
.panel { background: var(--bg); border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.panel--soft { background: var(--surface); border-color: transparent; }
.panel--lift { box-shadow: var(--shadow-soft); border-color: transparent; }
.panel__in { padding: 26px 28px; }
.panel__in--tight { padding: 18px 22px; }

.rule { height: 1px; background: var(--hairline); border: 0; }

/* Row list — hairline separated, no boxes */
.rows { display: flex; flex-direction: column; }
.row-item {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--hairline);
}
.row-item:first-child { border-top: 1px solid var(--hairline); }
.row-item--link { transition: opacity .16s ease; }
.row-item--link:hover { opacity: .62; }

/* ── Avatar ────────────────────────────────────────────────────────────── */
.av {
  border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-weight: 500; letter-spacing: -0.01em; color: #fff;
  background: var(--pine);
}
.av--xs { width: 26px; height: 26px; font-size: 10.5px; }
.av--sm { width: 34px; height: 34px; font-size: 12.5px; }
.av--md { width: 44px; height: 44px; font-size: 15px; }
.av--lg { width: 58px; height: 58px; font-size: 19px; }
.av--xl { width: 76px; height: 76px; font-size: 25px; }
.av--ghost { background: var(--mist); color: var(--text-3); }

/* ══════════════════════════════════════════════════════════════════════
   THE 90™ — the pulsing rail
   ══════════════════════════════════════════════════════════════════════ */

/* Gate positions as % of the 90-day window: 14 → 15.6, 30 → 33.3, 60 → 66.7, 90 → 100 */
.rail { position: relative; padding: 16px 0; }
.rail__track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--mist);
}
.rail__fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: calc(var(--pct) * 1%);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pine) 0%, var(--success) 55%, var(--lime-deep) 100%);
}
/* The head — a live dot that breathes at today's position */
.rail__head {
  position: absolute; top: 50%; left: calc(var(--pct) * 1%);
  transform: translate(-50%, -50%);
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--lime-deep);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px rgba(16,32,28,.10);
  z-index: 3;
}
.rail__head::after {
  content: ""; position: absolute; inset: -3px;
  border-radius: 50%; background: var(--lime-deep);
  animation: rail-pulse 2.4s cubic-bezier(.4,0,.2,1) infinite;
  z-index: -1;
}
@keyframes rail-pulse {
  0%   { transform: scale(.85); opacity: .55; }
  70%  { transform: scale(2.6);  opacity: 0; }
  100% { transform: scale(2.6);  opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .rail__head::after { animation: none; } }

.rail__gate {
  position: absolute; top: 50%; left: calc(var(--at) * 1%);
  transform: translate(-50%, -50%);
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--sage);
  z-index: 2;
}
.rail__gate.is-done { background: var(--pine); border-color: var(--pine); }

/* Labelled variant for the scorecard hero */
.rail--labelled { padding-bottom: 0; }
.rail__labels { position: relative; height: 40px; margin-top: 14px; }
.rail__label {
  position: absolute; left: calc(var(--at) * 1%);
  transform: translateX(-50%);
  text-align: center; white-space: nowrap;
}
.rail__label:first-child { transform: translateX(0); text-align: left; }
.rail__label:last-child  { transform: translateX(-100%); text-align: right; }
.rail__label-d { font-family: var(--mono); font-size: 11px; color: var(--text-3); letter-spacing: 0; }
.rail__label-n { font-size: 12.5px; font-weight: 500; letter-spacing: -0.015em; color: var(--text-2); margin-top: 2px; }
.rail__label.is-done .rail__label-n { color: var(--pine); }
.rail__label.is-next .rail__label-n { color: var(--amber); }

/* Compact inline rail for list rows */
.rail--mini { padding: 0; }
.rail--mini .rail__track { height: 4px; }
.rail--mini .rail__head { width: 11px; height: 11px; border-width: 2.5px; }
.rail--mini .rail__gate { width: 7px; height: 7px; border-width: 1.5px; }

/* ── Gate blocks (the scorecard body) ──────────────────────────────────── */
.gate {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 32px;
  padding: 30px 0;
  border-top: 1px solid var(--hairline);
}
.gate:last-child { border-bottom: 1px solid var(--hairline); }
.gate--locked { opacity: .5; }

.gate__aside { display: flex; flex-direction: column; gap: 5px; }
.gate__when { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); letter-spacing: 0; }
.gate__name { font-size: 19px; font-weight: 500; letter-spacing: -0.028em; }
.gate__signal { font-size: 13px; color: var(--text-3); }
.gate__status { margin-top: 8px; }

.gate__desc { font-size: 14.5px; line-height: 1.6; color: var(--text-2); margin-bottom: 18px; max-width: 62ch; }

.reads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
@media (max-width: 900px) { .reads { grid-template-columns: minmax(0,1fr); } .gate { grid-template-columns: minmax(0,1fr); gap: 18px; } }
.read__k { font-size: 12px; color: var(--text-3); letter-spacing: -0.005em; }
.read__v { font-size: 14.5px; font-weight: 450; letter-spacing: -0.015em; margin-top: 3px; }
.read__v--quote { font-weight: 400; color: var(--text-2); font-style: italic; }
.read__v--empty { color: var(--text-3); }

/* ── Stats — quiet, no boxes ───────────────────────────────────────────── */
.figs { display: flex; gap: 56px; flex-wrap: wrap; }
.fig__v { font-size: 30px; font-weight: 500; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.fig__v small { font-size: 15px; font-weight: 400; color: var(--text-3); letter-spacing: -0.015em; margin-left: 3px; }
.fig__k { font-size: 13px; color: var(--text-3); margin-top: 7px; }

/* ── Notice ────────────────────────────────────────────────────────────── */
.notice {
  display: flex; gap: 13px;
  border-radius: var(--r-md);
  padding: 15px 17px;
  font-size: 14px; line-height: 1.55;
}
.notice svg { width: 17px; height: 17px; margin-top: 1px; }
.notice--lime { background: var(--lime-wash); color: var(--pine); }
.notice--soft { background: var(--surface); color: var(--text-2); }
.notice--warn { background: rgba(180,83,9,.07); color: #8a4207; }

/* ── Fields ────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; }
.field__l { font-size: 13.5px; font-weight: 500; letter-spacing: -0.015em; }
.field__h { font-size: 12.5px; color: var(--text-3); }
.inp, .ta {
  width: 100%;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-sm);
  background: var(--bg);
  padding: 10px 13px;
  font-size: 14.5px;
  letter-spacing: -0.015em;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.inp:focus, .ta:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3.5px rgba(198,231,158,.45); }
.ta { resize: vertical; min-height: 92px; line-height: 1.55; }
.inp::placeholder, .ta::placeholder { color: var(--text-3); }

/* ── Modal (the hire moment) ───────────────────────────────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(14, 42, 37, .40);
  backdrop-filter: blur(10px) saturate(120%);
  display: grid; place-items: center;
  padding: 32px;
  animation: fade .3s ease both;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.modal {
  width: 100%; max-width: 620px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-modal);
  animation: rise .42s cubic-bezier(.16,1,.3,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985) } to { opacity: 1; transform: none } }
.modal__body { padding: 40px 40px 32px; }
.modal__foot {
  padding: 20px 40px 28px;
  display: flex; align-items: center; gap: 10px;
}
@media (prefers-reduced-motion: reduce) { .scrim, .modal { animation: none; } }

/* ── Utilities ─────────────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 12px; }
.row--top { align-items: flex-start; }
.row--base { align-items: baseline; }
.col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.push { margin-left: auto; }
.center { text-align: center; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g4{gap:4px}.g6{gap:6px}.g8{gap:8px}.g10{gap:10px}.g12{gap:12px}.g14{gap:14px}
.g16{gap:16px}.g20{gap:20px}.g24{gap:24px}.g32{gap:32px}.g40{gap:40px}
.mt4{margin-top:4px}.mt6{margin-top:6px}.mt8{margin-top:8px}.mt10{margin-top:10px}
.mt12{margin-top:12px}.mt16{margin-top:16px}.mt20{margin-top:20px}.mt24{margin-top:24px}
.mt32{margin-top:32px}.mt40{margin-top:40px}
.mb4{margin-bottom:4px}.mb6{margin-bottom:6px}.mb8{margin-bottom:8px}.mb10{margin-bottom:10px}
.mb12{margin-bottom:12px}.mb16{margin-bottom:16px}.mb20{margin-bottom:20px}.mb24{margin-bottom:24px}
.mb32{margin-bottom:32px}.mb40{margin-bottom:40px}

.two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.three { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 900px) { .two, .three { grid-template-columns: minmax(0,1fr); } }

/* Dark pine surface, used sparingly (one per screen at most) */
.pine {
  color: var(--lime-wash);
  background: linear-gradient(155deg, #20463e 0%, #0e2a25 100%);
  border-radius: var(--r-xl);
}
.pine .dimmer, .pine .caption { color: rgba(241,247,232,.55); }
.pine .dim { color: rgba(241,247,232,.75); }
.pine .rail__track { background: rgba(255,255,255,.14); }
.pine .rail__head { border-color: #16342d; }
.pine .rail__gate { background: #16342d; border-color: rgba(255,255,255,.35); }
.pine .rail__gate.is-done { background: var(--lime-deep); border-color: var(--lime-deep); }
.pine .rail__label-d { color: rgba(241,247,232,.45); }
.pine .rail__label-n { color: rgba(241,247,232,.7); }
.pine .rail__label.is-done .rail__label-n { color: var(--lime); }
.pine .rail__label.is-next .rail__label-n { color: #f0c98a; }
