/* Emonics Bench — design tokens shared with the portal and org-hierarchy
   console (services/eos-portal/static/portal.css, services/org-hierarchy/
   static/app.css): same navy/orange/bg/border palette, same collapsible-
   tree mechanism, so this reads as part of one product family. */

:root {
  --navy: #1E2A5E;
  --navy-dark: #141b40;
  --navy-tint: rgba(30, 42, 94, 0.06);
  --navy-tint-2: rgba(30, 42, 94, 0.11);
  --orange: #E65F3C;
  --orange-tint: rgba(230, 95, 60, 0.12);
  --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;
  --green: #15803d;
  --green-bg: #dcfce7;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --radius: 10px; --radius-xl: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 27, 64, 0.06);
  --shadow: 0 4px 16px rgba(20, 27, 64, 0.10);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.app-header {
  display: flex; align-items: center; gap: var(--space-5);
  background: var(--navy); padding: var(--space-3) var(--space-5);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; }
.brand img { height: 26px; display: block; }
/* EOS-0357 — the header named no service; its only clue was a nav link
   labelled "Goals", which reads as a tab rather than as where you are. */
.brand-word { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.all-tools { color: rgba(255,255,255,0.75); text-decoration: none; font-size: 13px;
  font-weight: 500; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.all-tools:hover { background: rgba(255,255,255,0.12); color: #fff; }
.app-nav { margin-left: var(--space-4); display: flex; gap: var(--space-4); }
.app-nav a, .app-account .email { color: rgba(255,255,255,0.85); font-size: 13px; text-decoration: none; }
.app-account { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
.btn-ghost {
  background: transparent; border: 1px solid rgba(255,255,255,0.35); color: #fff;
  border-radius: 999px; padding: 6px 14px; font-size: 12.5px; cursor: pointer;
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); }

.app-main { padding: var(--space-5); max-width: 1100px; margin: 0 auto; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--space-4); }
.page-title { font-size: 22px; font-weight: 700; color: var(--navy); margin: 0 0 4px; }
.page-sub { color: var(--muted); font-size: 13px; margin: 0; }
.toolbar { display: flex; gap: var(--space-2); }
.toolbar button {
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; font-size: 12.5px; cursor: pointer; color: var(--ink-soft);
}
.toolbar button:hover { border-color: var(--navy); color: var(--navy); }

.empty-panel { padding: var(--space-5); color: var(--muted); text-align: center; }

.footer-note {
  margin-top: var(--space-4); padding: var(--space-3) var(--space-4);
  background: var(--amber-bg); color: var(--amber); border-radius: var(--radius);
  font-size: 12.5px;
}

/* ==================== division / location / manager panels ==================== */

.division {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  margin-bottom: var(--space-4); box-shadow: var(--shadow-sm); overflow: hidden;
}
.division.open { box-shadow: var(--shadow); }

.division-head, .location-head, .manager-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5); cursor: pointer; user-select: none;
  border-left: 4px solid var(--navy);
}
.location-head, .manager-head { border-left-width: 3px; padding: var(--space-3) 0; border-left-color: var(--muted-light); }

.chev { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted-light); transition: transform .18s ease; display: inline-flex; }
.open > .division-head .chev, .open > .location-head .chev, .open > .manager-head .chev { transform: rotate(90deg); color: var(--navy); }

.division-title { font-size: 16.5px; font-weight: 700; color: var(--navy); }
.location-name, .manager-name { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.recruiter-name { font-size: 13px; font-weight: 600; color: var(--ink); }

.stats { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.stat {
  font-size: 11.5px; color: var(--muted); background: #f4f6fa; border-radius: 999px;
  padding: 3px 10px; white-space: nowrap;
}
.stat b { font-weight: 700; color: var(--ink); }
.stat.broken { background: var(--error-bg); color: var(--error); }
.stat.broken b { color: var(--error); }

.collapsible { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s ease; }
.open > .collapsible { grid-template-rows: 1fr; }
.collapsible > .collapsible-inner { overflow: hidden; }

.division-body { padding: 0 var(--space-5) var(--space-4); border-top: 1px solid var(--border-soft); }
.location { border-bottom: 1px solid var(--border-soft); padding-left: var(--space-3); }
.location:last-child { border-bottom: none; }
.location-body, .manager-body { padding: 0 0 var(--space-3) var(--space-4); }

.manager-row { border-left: 1.5px solid var(--border); padding-left: var(--space-3); margin-top: var(--space-2); }

.recruiter-leaf { border-left: 1.5px solid var(--border); padding-left: var(--space-3); margin: var(--space-2) 0; }
.consultant-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; }
.consultant-list li {
  padding: 6px 10px; font-size: 12.5px; color: var(--ink-soft);
  border-bottom: 1px solid var(--border-soft);
}
.consultant-list li:last-child { border-bottom: none; }
/* Consultant name -> tracker card. Existing tokens only: --navy is the same
   ink the division tag already uses, --muted-light the same grey as other
   secondary marks. Underline on hover/focus rather than always-on, so a dense
   bench list does not turn into a wall of underlines. */
.consultant-link { color: var(--navy); text-decoration: none; }
.consultant-link:hover, .consultant-link:focus-visible { text-decoration: underline; }
.consultant-link-ext { margin-left: 3px; font-size: 10.5px; color: var(--muted-light); }

.consultant-division-tag {
  display: inline-block; margin-left: 8px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--navy);
  background: var(--navy-tint-2); border-radius: 999px; padding: 1px 8px;
}

.broken-bucket {
  margin-top: var(--space-2); border: 1px dashed var(--error); border-radius: var(--radius);
  padding: var(--space-2) var(--space-3); background: var(--error-bg);
}
.broken-bucket .broken-reason { font-size: 12px; font-weight: 700; color: var(--error); }

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

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy-dark);
}
.login-card { background: var(--card); border-radius: var(--radius-xl); padding: 40px; width: 340px; text-align: center; }
.login-card img { height: 30px; margin-bottom: 24px; }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; margin-bottom: 12px;
}
.login-card button {
  width: 100%; padding: 10px; border: none; border-radius: var(--radius); background: var(--orange);
  color: #fff; font-weight: 700; font-size: 14px; cursor: pointer;
}
.login-msg { font-size: 12.5px; color: var(--muted); margin-top: 12px; min-height: 16px; }

/* ==================== goals console ====================
   Additions only. Every value below is an EXISTING token from the block
   above (--navy, --orange, --border, --space-*, --radius*) -- no new
   design vocabulary, so this reads as the same product as bench-console,
   org-hierarchy and the portal. */

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: var(--space-4); flex-wrap: wrap; }
.crumbs a { color: var(--navy); text-decoration: none; cursor: pointer; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--muted-light); }

/* ---- big choice buttons (home / locations) ---- */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.choice {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: var(--space-5); cursor: pointer; text-align: left;
  box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease;
  border-left: 4px solid var(--navy); font: inherit; width: 100%;
}
.choice:hover, .choice:focus-visible { border-color: var(--navy); box-shadow: var(--shadow); outline: none; }
.choice-title { font-size: 18px; font-weight: 700; color: var(--navy); }
.choice-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.choice[disabled] { cursor: default; opacity: .7; border-left-color: var(--muted-light); }
.choice[disabled]:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }

/* ---- two-column: form beside the propagation panel ---- */
.split { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: var(--space-5); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm); padding: var(--space-5); margin-bottom: var(--space-4);
}
.card-title { font-size: 15px; font-weight: 700; color: var(--navy); margin: 0 0 var(--space-4); }
.card-sub { font-size: 12.5px; color: var(--muted); margin: -8px 0 var(--space-4); }

/* ---- labeled boxes ---- */
.field { margin-bottom: var(--space-4); }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field .unit { font-weight: 400; color: var(--muted); }
.field-input { position: relative; display: flex; align-items: center; }
.field-input .prefix { position: absolute; left: 12px; color: var(--muted); font-size: 14px; }
.field input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 15px; color: var(--ink); font-family: inherit;
}
.field input.has-prefix { padding-left: 26px; }
.field input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-tint); }
.field .help { font-size: 11.5px; color: var(--muted-light); margin-top: 5px; }

.btn-primary {
  width: 100%; padding: 11px; border: none; border-radius: var(--radius); background: var(--orange);
  color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit;
}
.btn-primary:hover { filter: brightness(.96); }
.btn-primary[disabled] { background: var(--muted-light); cursor: default; }
.btn-secondary {
  width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--ink-soft); font-size: 13px; cursor: pointer;
  font-family: inherit; margin-top: var(--space-2);
}

/* ---- propagation panel: names first, numbers beside them ---- */
.owes {
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: var(--space-4) var(--space-5); font-size: 15px; font-weight: 600;
  margin-bottom: var(--space-4); line-height: 1.5;
}
.owes .owes-label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: rgba(255,255,255,.65); margin-bottom: 4px; }

.person-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px var(--space-3); border-bottom: 1px solid var(--border-soft);
}
.person-row:last-child { border-bottom: none; }
.person-name { font-size: 13.5px; font-weight: 600; color: var(--ink); min-width: 180px; }
.person-role { font-size: 11.5px; color: var(--muted-light); }
.person-nums { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.num {
  font-size: 12px; background: var(--navy-tint); color: var(--navy); border-radius: 999px;
  padding: 3px 10px; white-space: nowrap;
}
.num b { font-weight: 700; }
.num.mtd { background: #f4f6fa; color: var(--ink-soft); }

/* Absence is NOT zero and NOT an error. Muted grey, never red. */
.no-target { font-size: 12px; color: var(--muted-light); font-style: italic; }

.pace-ok { color: var(--green); background: var(--green-bg); }
.pace-behind { color: var(--amber); background: var(--amber-bg); }

.saved-banner {
  background: var(--green-bg); color: var(--green); border-radius: var(--radius);
  padding: var(--space-4); font-size: 13.5px; margin-bottom: var(--space-4); line-height: 1.6;
}
.error-banner {
  background: var(--error-bg); color: var(--error); border-radius: var(--radius);
  padding: var(--space-3) var(--space-4); font-size: 13px; margin-bottom: var(--space-4);
}
.readonly-banner {
  background: var(--amber-bg); color: var(--amber); border-radius: var(--radius);
  padding: var(--space-3) var(--space-4); font-size: 12.5px; margin-bottom: var(--space-4);
}
.marketed-pill {
  font-size: 11.5px; color: var(--ink-soft); background: #f4f6fa;
  border-radius: 999px; padding: 2px 9px; margin-left: 8px;
}
.spinner { font-size: 13px; color: var(--muted); padding: var(--space-5); text-align: center; }

/* Team-aggregate roster: names as chips, not 52 rows of "No target set".
   Existing tokens only. */
.share-lines { margin-bottom: var(--space-4); }
.share-line {
  font-size: 13px; color: var(--ink-soft); padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
}
.share-line:last-child { border-bottom: none; }
.roster-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: var(--space-4) 0 var(--space-2);
}
.roster-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.roster-chips .chip {
  font-size: 12px; color: var(--ink-soft); background: #f4f6fa;
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}

/* Name + marketed pill must stay on one line: at 12 rows the pill wrapping
   under the name made every row two-high and the list unreadable at a
   glance. Numbers stay right-aligned regardless of name length. */
.person-row { flex-wrap: nowrap; }
.person-name {
  display: flex; align-items: center; gap: 8px;
  min-width: 220px; flex: 0 0 auto; white-space: nowrap;
}
.marketed-pill { margin-left: 0; white-space: nowrap; }
.panel-note {
  font-size: 12px; color: var(--muted); background: #f4f6fa;
  border-radius: var(--radius); padding: 8px var(--space-3);
  margin-bottom: var(--space-3);
}

/* Inline per-person input (Pre-Sales collections). */
.inline-field { position: relative; display: inline-flex; align-items: center; margin-left: 10px; }
.inline-field .prefix { position: absolute; left: 10px; color: var(--muted); font-size: 13px; }
.inline-field input {
  width: 120px; padding: 6px 10px 6px 22px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13.5px; font-family: inherit; color: var(--ink);
}
.inline-field input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-tint); }

/* C2C lanes: two visually separate sections. A person belongs to exactly
   one lane, so the boundary has to be visible, not implied by spacing. */
.lane { margin-bottom: var(--space-5); }
.lane-head {
  display: flex; align-items: center; gap: var(--space-3);
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--navy);
}
.lane-title {
  font-size: 13px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--navy);
}

/* Individual override: the person picker is required, so the section is
   visibly inert until one is chosen. */
.field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; font-family: inherit;
  color: var(--ink); background: var(--card);
}
.field select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-tint); }
#overrides input[disabled] { background: #f4f6fa; color: var(--muted-light); cursor: not-allowed; }
.override-list { margin-bottom: var(--space-4); }
.override-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 8px var(--space-3); background: var(--navy-tint);
  border-radius: var(--radius); margin-bottom: 6px; font-size: 12.5px;
}
.override-text { color: var(--ink-soft); }
.btn-clear {
  margin-left: auto; background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 12px; font-size: 11.5px; cursor: pointer;
  color: var(--muted); font-family: inherit;
}
.btn-clear:hover { border-color: var(--error); color: var(--error); }
