@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Variables ── */

:root {
  --bg: #edf1f5;
  --surface: #ffffff;
  --surface-alt: #f7f9fb;
  --border: #d8dfe6;
  --border-strong: #c0c9d4;
  --text-primary: #1a2533;
  --text-secondary: #5a6a7e;
  --text-tertiary: #8b99ab;
  --accent: #1a3a5c;
  --accent-light: #e6edf5;
  --accent-mid: #2a5a8c;
  --highlight: #b8860b;
  --highlight-light: #fdf5e0;
  --red: #a83232;
  --red-light: #fce8e8;
  --blue: #2c5f8a;
  --blue-light: #edf3f8;
  --green: #0d7377;
  --green-light: #e0f2f2;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(26,37,51,0.04);
  --shadow: 0 1px 3px rgba(26,37,51,0.06), 0 1px 2px rgba(26,37,51,0.04);
  --shadow-md: 0 4px 12px rgba(26,37,51,0.06);
  --shadow-lg: 0 8px 24px rgba(26,37,51,0.10);
}

/* ── Reset ── */

* { margin: 0; padding: 0; box-sizing: border-box; }

.hidden { display: none !important; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Top Nav ── */

.topnav {
  background: #1a3a5c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav-brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topnav-brand svg { opacity: 1; }
.topnav-logo { height: 30px; width: auto; }
.topnav-links { display: flex; gap: 24px; }
.topnav-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.topnav-links a:hover { color: #fff; }
.topnav-links a.active { color: #fff; font-weight: 700; }

/* Nav dropdown (Example menu) */
.nav-dropdown { position: relative; }
.nav-dropdown > a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-dropdown > a:hover { color: #fff; }
.nav-dropdown > a.active { color: #fff; font-weight: 700; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding-top: 8px;
  min-width: 180px;
  z-index: 100;
  background: transparent;
}
.nav-dropdown.has-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  background: var(--accent);
  border-left: 1px solid rgba(255,255,255,0.15);
  border-right: 1px solid rgba(255,255,255,0.15);
}
.nav-dropdown-menu a:first-child {
  border-top: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
}
.nav-dropdown-menu a:last-child {
  border-bottom: 1px solid rgba(255,255,255,0.15);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.nav-dropdown-menu a:hover { background: #2a4a5e; color: #fff; }
.nav-dropdown-menu a.active { color: #fff; }
.nav-dropdown-menu a.nav-coming-soon { opacity: 0.45; cursor: default; pointer-events: none; }

/* Admin menu: wider, with a role pill on the right of each item, a divider
   before the HRIS pages, and a hover description beside the item. */
.nav-dropdown-menu-wide { min-width: 270px; }
.nav-dropdown-menu-wide a { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav-dropdown-menu a.nav-menu-divider { border-top: 1px solid rgba(255,255,255,0.22); }
.nav-role-pill {
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 8px;
  line-height: 1.5;
}
.nav-role-admin { background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.85); }
.nav-role-hris { background: #f0d9b8; color: #6b3d0e; }
.ah-card .nav-role-admin { background: var(--accent-light); color: var(--accent); }
.nav-dropdown-menu a[data-desc] { position: relative; }
.nav-dropdown-menu a[data-desc]:hover::after {
  content: attr(data-desc);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  width: 250px;
  white-space: normal;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  pointer-events: none;
  z-index: 101;
}

/* Admin home: a card per admin page with a top-left preview of it (placeholder
   data only, see tools/admin-previews) and what's on it. */
.ah-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ah-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.ah-card:hover { border-color: var(--accent-mid); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.ah-shot { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; object-position: top left; background: var(--surface-alt); border-bottom: 1px solid var(--border); }
.ah-body { padding: 14px 16px 16px; }
.ah-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 5px; }
.ah-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }

.topnav-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topnav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; color: #fff;
  cursor: pointer;
  transition: all 0.15s;
}
.topnav-avatar:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.6);
}
.topnav-user-menu {
  position: relative;
}
.role-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 12px 14px;
  z-index: 200;
}
.role-popover-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.role-popover-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.role-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 8px;
}
.role-tag-check {
  flex-shrink: 0;
}

/* ── Main Layout ── */

.main-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 32px 60px;
}

/* ── Page Header ── */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header-left { display: flex; align-items: center; gap: 16px; }
.page-header-left .section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar-lg {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-mid));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px; color: #fff;
  flex-shrink: 0;
}
.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.page-header-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.page-header-meta .sep { color: var(--border-strong); }
.page-header-right {
  display: flex; gap: 8px; align-items: center; padding-top: 8px;
}

/* ── Badges ── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-green { background: var(--accent-light); color: var(--accent); }
.badge-gold { background: var(--highlight-light); color: #8b6d14; }

/* ── Buttons ── */

.btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
  font-family: inherit;
}
.btn:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-mid); border-color: var(--accent-mid); }
.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-danger:hover { background: #8a2828; border-color: #8a2828; }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--surface-alt); color: var(--text-primary); }
/* Icon pinned to the left with equal padding, label centered across the button.
   Keeps a column of buttons visually aligned regardless of label length. */
.btn-icon-left { position: relative; justify-content: center; text-align: center; padding-left: 40px; padding-right: 40px; }
.btn-icon-left > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); flex: none; }

/* ── KPI Strip ── */

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.kpi-card {
  background: var(--surface);
  padding: 18px 20px;
}
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.kpi-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}
.kpi-value .currency { font-size: 16px; color: var(--text-secondary); }
.kpi-change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-left: 4px;
}

/* ── Grid Layouts ── */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.grid-3-2 {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
  margin-bottom: 16px;
}
.grid-2-3 {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* ── Card ── */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-header[data-toggle-target] {
  transition: background 0.15s, border-left 0.15s;
  border-left: 3px solid transparent;
}
.card-header[data-toggle-target]:hover {
  background: rgba(26, 58, 92, 0.06);
  border-left: 3px solid var(--accent);
}
.card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.1px;
}
.card-action {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
.card-body { padding: 16px 18px; }
.card-body-flush { padding: 0; }

/* ── Comp Breakdown ── */

.comp-breakdown-visual {
  display: flex;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}
.comp-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  transition: flex 0.3s;
  position: relative;
}
.comp-seg-salary { background: var(--accent); flex: 82.5; }
.comp-seg-bonus { background: var(--highlight); flex: 8.25; color: #5a4410; }
.comp-seg-benefits { background: #0d7377; flex: 8.14; color: #fff; }

.comp-detail-rows { display: flex; flex-direction: column; gap: 8px; }
.comp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--surface-alt);
}
.comp-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.comp-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.comp-dot-salary { background: var(--accent); }
.comp-dot-bonus { background: var(--highlight); }
.comp-dot-benefits { background: #0d7377; }
.comp-dot-equity { background: var(--blue); }
.comp-row-label { font-size: 13.5px; font-weight: 500; }
.comp-row-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 500;
}
.comp-row-pct {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: 8px;
  min-width: 36px;
  text-align: right;
}

.comp-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-top: 2px solid var(--text-primary);
  margin-top: 8px;
  font-weight: 700;
}
.comp-total-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
}

/* ── Benefits ── */

.benefit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.benefit-item:last-child, .benefit-item:nth-last-child(2) { border-bottom: none; }
.benefit-name { color: var(--text-secondary); }
.benefit-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
}
.benefit-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 2px solid var(--text-primary);
  font-weight: 700;
  font-size: 14px;
}
.benefit-total .benefit-value { font-size: 14px; font-weight: 700; }

/* ── Equity ── */

.equity-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  text-align: center;
}
.equity-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--blue-light);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.equity-placeholder p {
  font-size: 13px;
  color: var(--text-tertiary);
  max-width: 260px;
  line-height: 1.5;
}
.equity-placeholder .equity-title {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-size: 13.5px;
}

/* ── Market Range ── */

.market-range {
  margin-bottom: 16px;
}
.range-track {
  position: relative;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin: 16px 0 8px;
}
.range-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-light), var(--accent));
  border-radius: 4px;
  width: 70%;
}
.range-marker {
  position: absolute;
  top: -5px;
  width: 18px; height: 18px;
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transform: translateX(-50%);
}
/* Percentile bubble on the position dot. Pure CSS off a data-tip attribute so
   it survives every market-card re-render (haircut edits, eyeball toggles). */
.range-marker[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary, #1a2233);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  padding: 6px 9px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 30;
}
.range-marker[data-tip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-primary, #1a2233);
  border-bottom: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 30;
}
.range-marker[data-tip]:hover::after,
.range-marker[data-tip]:hover::before { opacity: 1; }
/* Cards clip overflow, so a centered bubble would be cut off near the track
   ends. Render sites tag edge-hugging dots and the bubble edge-aligns instead;
   the arrow stays centered on the dot. */
.range-marker[data-tip][data-tip-align="left"]::after { left: -6px; transform: none; }
.range-marker[data-tip][data-tip-align="right"]::after { left: auto; right: -6px; transform: none; }
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}
.range-labels span { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.range-labels .label-pct { font-family: 'DM Sans', sans-serif; font-size: 10px; font-weight: 600; color: var(--text-secondary); }
.market-current {
  text-align: center;
  margin-top: 10px;
  padding: 8px;
  background: var(--accent-light);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
}
.market-current strong {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

/* ── Adjustment Table ── */

.adj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.adj-table th {
  padding: 8px 12px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-primary);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.adj-table th:first-child { text-align: left; }
.adj-table td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.adj-table td:first-child {
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 12.5px;
}
.adj-table tr:last-child td { border-bottom: none; }
.adj-table .highlight-row td {
  background: var(--accent-light);
  font-weight: 600;
}
.adj-table .highlight-row td:first-child { color: var(--accent); }

/* ── Increase Recommendation ── */

.rec-card {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.rec-header {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rec-body { padding: 16px 18px; }
.rec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.rec-item-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.65;
  margin-bottom: 3px;
}
.rec-item-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 500;
}
.rec-item-value.large {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -1px;
}
.rec-divider {
  height: 1px;
  background: rgba(255,255,255,0.15);
  margin: 14px 0;
}
.rec-new {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rec-new-label { font-size: 13px; font-weight: 500; opacity: 0.8; }
.rec-new-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Rec card reveal: body wrapper holds both layers at constant size */
.rec-body-wrap {
  position: relative;
}

/* Reveal overlay: centered over the body area */
.rec-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: opacity 0.35s ease;
}
.rec-reveal-out {
  opacity: 0;
  pointer-events: none;
}
.rec-reveal-btn {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.6);
  border-radius: 6px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.rec-reveal-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: #fff;
  transform: scale(1.03);
}

/* Body hidden (takes up space but invisible) */
.rec-body-hidden {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s ease 0.1s, visibility 0s linear 0.5s;
}
.rec-body-visible {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.4s ease 0.15s;
}

/* ── Info Bar ── */

.info-bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.info-bar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--text-secondary);
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.info-bar-item:last-child {
  border-right: none;
}
.info-bar-item strong {
  color: var(--text-primary);
  font-weight: 600;
}
.info-bar-accent {
  color: var(--accent);
  font-weight: 600;
}

.info-bar-group {
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.info-bar-group .info-bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.info-bar-group .info-bar-row + .info-bar-row {
  border-top: 1px solid var(--border);
}
.info-bar-group .info-bar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--text-secondary);
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.info-bar-group .info-bar-item:last-child {
  border-right: none;
}

/* ── Data Table ── */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  padding: 9px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.data-table thead th:last-child { text-align: right; }
.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
/* Change History: fourteen columns at a 1440px page; tighter cells. */
.ch-table thead th, .ch-table tbody td { padding-left: 8px; padding-right: 8px; }
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
}
.data-table .align-right { text-align: right; }

/* Audit popover */
.audit-vt-cell {
  position: relative;
  cursor: default;
}
.audit-vt-summary {
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}
.audit-popover {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 8px 0;
  min-width: 200px;
  max-width: 300px;
  max-height: 240px;
  overflow-y: auto;
}
.audit-popover.visible { display: block; }
.audit-popover-name {
  padding: 4px 14px;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audit-popover-name:hover {
  background: var(--surface-alt);
}

/* Level pay-range popover (dept-levels page) */
.tip-trigger { position: relative; }
.level-popover {
  display: none;
  position: fixed;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 8px 0;
  min-width: 180px;
  max-width: 260px;
  white-space: nowrap;
  pointer-events: none;
}
.level-popover.visible { display: block; }
.level-popover-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 14px;
  font-size: 13px;
  color: var(--text-primary);
}
.level-popover-row span:first-child {
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 16px;
}
.level-popover-footer {
  padding: 6px 14px 2px;
  font-size: 11px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* TBD placeholder animation */
.tbd-placeholder {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-tertiary);
  font-style: italic;
  font-size: 12px;
  transition: background 0.3s, color 0.3s, transform 0.2s;
  cursor: default;
}
.tbd-placeholder:hover {
  background: var(--surface-alt);
  color: var(--text-secondary);
  transform: scale(1.05);
}

/* Editable Chatbooks title input on dept-levels */
.cb-title-editable {
  font-size: 12px;
  padding: 3px 6px;
  width: 100%;
  min-width: 120px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.cb-title-editable.cb-title-empty {
  color: var(--text-tertiary);
  font-style: italic;
}
.cb-title-editable:hover {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: 0 0 0 2px rgba(106, 159, 192, 0.08);
}
.cb-title-editable:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(106, 159, 192, 0.18);
  font-style: normal;
  color: var(--text-primary);
  outline: none;
}

/* Stacked per-person Chatbooks titles, shown when people on one level differ. */
.cb-title-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cb-title-stack-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cb-title-stack-row .cb-title-editable {
  flex: 1 1 auto;
  min-width: 100px;
}
.cb-title-emp-name {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* Drag and drop */
.emp-chip-movable[draggable="true"] { cursor: grab; }
.emp-chip-movable[draggable="true"]:active { cursor: grabbing; }
tr.drag-over > td { background: rgba(106, 159, 192, 0.12) !important; }
tr.drag-over { outline: 2px dashed var(--primary); outline-offset: -2px; border-radius: 4px; }

.trigger-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.trigger-promo { background: #e0f2f2; color: #0d7377; }
.trigger-anni { background: var(--surface-alt); color: var(--text-secondary); }
.trigger-role { background: var(--accent-light); color: var(--accent); }
.trigger-hire { background: var(--highlight-light); color: #8b6d14; }
.change-positive { color: #0d7377; font-weight: 600; }

/* ── Section Headers ── */

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  margin-top: 32px;
}
.section-header:first-of-type { margin-top: 0; }
.section-header h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}
.section-header .section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.section-header .section-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.section-icon-summary { background: var(--accent-light); color: var(--accent); }
.section-icon-comp { background: #e0f2f2; color: #0d7377; }
.section-icon-roadmap { background: var(--highlight-light); color: #8b6d14; }

/* ── Coach Banner ── */

.coach-banner {
  background: var(--highlight-light);
  border: 1px solid #e8d9a8;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 12.5px;
  color: #8b6d14;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.coach-banner strong { font-weight: 600; }

/* ── Animations ── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in {
  animation: fadeUp 0.35s ease-out both;
}
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }

/* ── Login Screen ── */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
}
.login-logo-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.login-logo-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.login-logo-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.login-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}
.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 20px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-google:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  background: var(--surface-alt);
}
.btn-google svg,
.btn-google img {
  width: 18px; height: 18px;
  flex-shrink: 0;
}

/* ── Privacy Modal ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.15s ease-out;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  animation: fadeUp 0.25s ease-out;
}
.modal-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--highlight-light);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: var(--highlight);
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}
.modal-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.modal-actions .btn { min-width: 120px; justify-content: center; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Dashboard ── */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  display: block;
}
.dash-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.dash-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.dash-card-icon-accent { background: var(--accent-light); color: var(--accent); }
.dash-card-icon-green { background: var(--green-light); color: var(--green); }
.dash-card-icon-gold { background: var(--highlight-light); color: var(--highlight); }
.dash-card-icon-blue { background: var(--blue-light); color: var(--blue); }
.dash-card-icon-red { background: var(--red-light); color: var(--red); }
.dash-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.1px;
}
.dash-card p {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.dash-card .dash-card-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
}

/* ── Team List ── */

.team-list {
  display: flex;
  flex-direction: column;
}
.team-member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
  color: inherit;
}
.team-member:last-child { border-bottom: none; }
.team-member:hover { background: var(--surface-alt); }
.team-member-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-mid));
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; color: #fff;
  flex-shrink: 0;
}
.team-member-info { flex: 1; min-width: 0; }
.team-member-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-member-title {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-member-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ── Team Overview Table ── */

.team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.team-table thead th {
  padding: 9px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.team-table thead th:last-child { text-align: right; }
.team-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.team-table tbody tr:last-child td { border-bottom: none; }
.team-table tbody tr:hover { background: var(--surface-alt); }
.team-table tbody tr { cursor: pointer; }
.team-table .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
}
.team-table .align-right { text-align: right; }
.team-member-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.team-member-cell .team-member-avatar {
  width: 30px; height: 30px;
  font-size: 11px;
}

/* ── Admin / Org Tree ── */

.org-tree {
  padding: 16px 0;
  transition: max-height 0.4s ease;
  overflow: hidden;
}
.org-tree-collapsed {
  max-height: 280px;
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}
.org-expand-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 0 14px;
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  z-index: 5;
  transition: opacity 0.2s;
}
.org-expand-overlay:hover {
  opacity: 0.8;
}
.org-expand-overlay.hidden {
  display: none;
}

/* Sub-team table truncation (team page) */
.sub-team-table-wrap {
  transition: max-height 0.4s ease;
  overflow: hidden;
}
.sub-team-collapsed {
  max-height: 230px;
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}
.sub-team-expand-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 0 14px;
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  z-index: 5;
  transition: opacity 0.2s;
}
.sub-team-expand-overlay:hover {
  opacity: 0.8;
}
.sub-team-expand-overlay.hidden {
  display: none;
}
.sub-team-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 0;
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  border-top: 1px solid var(--border);
  transition: opacity 0.2s;
}
.sub-team-collapse-btn:hover {
  opacity: 0.8;
}
.sub-team-collapse-btn.hidden {
  display: none;
}
.org-node {
  position: relative;
}
.org-node-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  transition: background 0.12s;
}
.org-node-content:hover { background: var(--surface-alt); }
.org-node-content .team-member-avatar {
  width: 32px; height: 32px;
  font-size: 12px;
  color: #fff;
}
.org-node[data-level="0"] { padding-left: 0; }
.org-node[data-level="1"] { padding-left: 28px; }
.org-node[data-level="2"] { padding-left: 56px; }
.org-node[data-level="3"] { padding-left: 84px; }
.org-node[data-level="4"] { padding-left: 112px; }

.org-connector {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
}
.org-connector-v {
  position: absolute;
  width: 1px;
  background: var(--border);
}
.org-connector-h {
  position: absolute;
  height: 1px;
  background: var(--border);
  width: 14px;
}

.visibility-badges {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.visibility-badge {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
}
.visibility-badge.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Forms ── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}
.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.1px;
}
.form-input,
.form-select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-input:focus,
.form-select:focus {
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}
.form-input::placeholder { color: var(--text-tertiary); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235a6a7e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-input-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.form-row {
  display: flex;
  gap: 16px;
}
.form-row .form-group { flex: 1; }
.form-hint {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: -2px;
}
.form-error {
  font-size: 11.5px;
  color: var(--red);
  margin-top: -2px;
}
.form-input.error,
.form-select.error {
  border-color: var(--red);
}
.form-input.error:focus,
.form-select.error:focus {
  box-shadow: 0 0 0 3px rgba(168,50,50,0.1);
}
textarea.form-input {
  min-height: 80px;
  resize: vertical;
}

/* ── Status Badges ── */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
}
.status-draft {
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.status-submitted {
  background: var(--highlight-light);
  color: #8b6d14;
}
.status-approved {
  background: var(--green-light);
  color: var(--green);
}
.status-rejected {
  background: var(--red-light);
  color: var(--red);
}
.status-pending {
  background: #fff5eb;
  color: #8a4b12;
  border: 1px solid #f0d9b8;
}

/* Count badge on a dashboard card (Approvals Pending), same look as the nav badge. */
.dash-card-has-badge { position: relative; }
.dash-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Nav Badge ── */

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--red);
  color: #fff;
  margin-left: 4px;
  line-height: 1;
}

/* ── Dashboard Approval Card Icon ── */

.dash-card-icon-amber {
  background: #fff3e0;
  color: #dd6b20;
}

/* ── Recommendation Updates (dashboard) ── */

.ru-group {
  padding: 8px 16px;
}
.ru-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.ru-group .ru-row:last-child,
.ru-indirect .ru-row:last-child {
  border-bottom: none;
}
.ru-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.ru-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ru-text {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.35;
}
.ru-view-btn {
  flex-shrink: 0;
  font-size: 12px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.ru-indirect-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px 12px;
  border: none;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.ru-indirect-toggle svg {
  transition: transform 0.15s;
  flex-shrink: 0;
}
.ru-indirect {
  padding: 0 16px 8px;
  background: var(--surface-alt);
}
.ru-indirect .ru-row {
  opacity: 0.78;
}
.ru-indirect .ru-text {
  font-size: 13px;
  color: var(--text-secondary);
}
.ru-empty {
  padding: 20px 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  text-align: center;
}

/* ── Toast / Notification ── */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease-out;
  max-width: 380px;
}
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }
.toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 2px;
  display: flex;
  margin-left: auto;
  flex-shrink: 0;
}
.toast-close:hover { color: #fff; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Empty State ── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}
.empty-state-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--surface-alt);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: var(--text-tertiary);
}
.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.empty-state-text {
  font-size: 13px;
  color: var(--text-tertiary);
  max-width: 300px;
  line-height: 1.5;
}

/* ── Admin Details ── */

.admin-details-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-details-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-details-toolbar-left .form-select {
  min-width: 180px;
}
.admin-details-count {
  font-size: 12.5px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.admin-details-toolbar-right {
  display: flex;
  gap: 8px;
}

.admin-details-table-wrap {
  overflow: hidden;
}
.admin-details-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 900px;
}
.admin-details-table thead th {
  padding: 8px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-primary);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
/* A table whose header floats while the rows scroll. The card around it clips
   overflow and the page itself scrolls, so a sticky header needs its own
   vertical scroll box to stick to: this wrapper is that box. */
.table-scroll-sticky {
  max-height: calc(100vh - 240px);
  overflow: auto;
}
.table-scroll-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-alt);
}
.admin-details-table tbody td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-details-table tbody tr:last-child td {
  border-bottom: none;
}
.admin-details-table tbody tr:hover {
  background: var(--surface-alt);
}
.admin-details-table .adm-col-actions {
  width: 48px;
  text-align: center;
}

.adm-input {
  width: 100%;
  min-width: 70px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.adm-input:focus {
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 2px rgba(26,58,92,0.1);
}
.adm-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  min-width: 80px;
}
.adm-json {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  min-width: 120px;
}
.adm-select {
  min-width: 90px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%235a6a7e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 22px;
}
.adm-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}
.adm-cell-pk {
  position: relative;
}
.adm-pk-edit {
  font-weight: 500;
  padding-right: 22px;
}
.adm-pk-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.5;
}
.adm-derived {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  padding: 0 2px;
  white-space: nowrap;
}
.adm-cell-center {
  text-align: center;
}
.adm-row-new td {
  background: rgba(13,115,119,0.04);
}

.adm-delete {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.adm-delete:hover {
  background: var(--red-light);
}

/* Coach typeahead */
.adm-cell-coach {
  position: relative;
}
.coach-ta-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}
.coach-ta-input {
  min-width: 160px;
}
.coach-ta-clear {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 3px;
  flex-shrink: 0;
}
.coach-ta-clear:hover {
  color: var(--red);
  background: var(--red-light);
}
.coach-ta-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  min-width: 260px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  z-index: 50;
  margin-top: 2px;
}
.coach-ta-item {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  transition: background 0.1s;
}
.coach-ta-item:hover {
  background: var(--accent-light);
}
.coach-ta-item strong {
  font-weight: 600;
  color: var(--text-primary);
}
.coach-ta-item span {
  font-size: 11px;
  color: var(--text-tertiary);
}
.coach-ta-empty {
  color: var(--text-tertiary);
  cursor: default;
  font-style: italic;
}
.coach-ta-empty:hover {
  background: transparent;
}

/* Level row drag handle */
.level-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: 4px;
  color: var(--text-tertiary);
  cursor: grab;
  user-select: none;
}
.level-grip:hover {
  color: var(--accent);
  background: var(--accent-light);
}
.level-grip:active { cursor: grabbing; }
tr.level-dragging { opacity: 0.4; }

/* Three-dot per-level menu (Duplicate / Remove) */
.level-menu-btn {
  color: var(--text-tertiary);
  border-radius: 4px;
}
.level-menu-btn:hover {
  color: var(--accent);
  background: var(--accent-light);
}
.level-menu-popover {
  display: none;
  position: fixed;
  z-index: 10000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 4px;
  min-width: 190px;
}
.level-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}
.level-menu-item:hover { background: var(--gray-100); }
.level-menu-item-danger { color: var(--danger, #dc2626); }
.level-menu-item-danger:hover { background: rgba(220,38,38,0.08); }
.level-menu-empty {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Nav search ("Your Access") */
.nav-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: 4px;
}
.nav-search-icon {
  position: absolute;
  left: 8px;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}
#nav-search-input {
  width: 150px;
  padding: 5px 8px 5px 26px;
  font-size: 12px;
  font-family: inherit;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  outline: none;
  transition: width 0.16s, background 0.16s, border-color 0.16s;
}
#nav-search-input::placeholder { color: rgba(255, 255, 255, 0.4); }
#nav-search-input:focus {
  width: 220px;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
}
.nav-search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 340px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 200;
  padding: 4px;
}
.nav-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
}
.nav-search-item:hover,
.nav-search-item.active { background: var(--accent-light); }
.nav-search-avatar {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-search-name {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.3;
}
.nav-search-title {
  font-size: 11.5px;
  color: var(--text-tertiary);
  line-height: 1.3;
}
.nav-search-text { flex: 1; min-width: 0; }
.nav-search-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.nav-search-action {
  padding: 2px 8px;
  font-size: 11px;
  font-family: inherit;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}
.nav-search-action:hover {
  color: var(--text-primary);
  border-color: var(--accent-mid);
}
.nav-search-empty {
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

/* Sortable headers */
.adm-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.12s;
}
.adm-sortable:hover {
  color: var(--accent);
}

/* Admin checkbox (red) */
.adm-admin-check {
  accent-color: var(--red) !important;
}
.adm-orphan-badge {
  cursor: help;
  font-size: 14px;
  margin-right: 2px;
  vertical-align: middle;
}

/* Value typeahead */
.adm-cell-vta {
  position: relative;
}
.vta-wrap {
  position: relative;
}
.vta-input {
  min-width: 120px;
}
.vta-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  min-width: 180px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  z-index: 50;
  margin-top: 2px;
}
.vta-item {
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12.5px;
  transition: background 0.1s;
}
.vta-item:hover {
  background: var(--accent-light);
}
.vta-empty {
  color: var(--text-tertiary);
  cursor: default;
  font-style: italic;
}
.vta-empty:hover {
  background: transparent;
}

/* ── Paste-from-Excel Panel ── */

.adm-paste-panel {
  padding: 20px 24px;
  margin-bottom: 16px;
  border: 2px dashed var(--accent);
  background: var(--accent-light);
}
.adm-paste-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.adm-paste-header strong {
  font-size: 15px;
  color: var(--text-primary);
}
.adm-paste-hint {
  display: block;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.adm-paste-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  background: #fff;
  color: var(--text-primary);
}
.adm-paste-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.adm-paste-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.adm-paste-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
}
.adm-paste-badge-new {
  background: #dcfce7;
  color: #166534;
}
.adm-paste-badge-update {
  background: #dbeafe;
  color: #1e40af;
}
.adm-paste-preview-scroll {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.adm-paste-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.adm-paste-preview-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
.adm-paste-preview-table th {
  background: var(--surface-alt);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.adm-paste-preview-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-light, #f1f1f1);
  color: var(--text-primary);
}
.adm-paste-preview-table tbody tr:last-child td {
  border-bottom: none;
}
.adm-paste-row-new { background: rgba(34, 197, 94, 0.04); }
.adm-paste-row-update { background: rgba(59, 130, 246, 0.04); }
.adm-paste-status {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
}
.adm-paste-status-new { background: #dcfce7; color: #166534; }
.adm-paste-status-update { background: #dbeafe; color: #1e40af; }
.adm-paste-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: flex-end;
}
.adm-paste-btn-replace {
  background: #fff !important;
  color: var(--red) !important;
  border: 1px solid var(--red) !important;
}
.adm-paste-btn-replace:hover {
  background: rgba(239, 68, 68, 0.06) !important;
}

/* ── Responsive ── */

@media (max-width: 1024px) {
  .main-wrapper { padding: 24px 20px 48px; }
  .topnav { padding: 0 20px; }

  .kpi-strip { grid-template-columns: repeat(3, 1fr); }

  .grid-2, .grid-3, .grid-2-3, .grid-3-2 {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }

  .info-bar { flex-wrap: wrap; }
}

@media (max-width: 768px) {
  .topnav { padding: 0 16px; height: 56px; }
  .topnav-brand { font-size: 14px; }
  .topnav-logo { height: 24px; }
  .topnav-links { display: none; }

  .main-wrapper { padding: 20px 16px 40px; }

  .page-header { flex-direction: column; gap: 12px; }
  .page-header-right { padding-top: 0; }
  .page-header h1 { font-size: 20px; }
  .avatar-lg { width: 44px; height: 44px; font-size: 16px; }

  .kpi-strip { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 18px; }

  .grid-2, .grid-3, .grid-2-3, .grid-3-2 {
    grid-template-columns: 1fr;
  }

  .dashboard-grid { grid-template-columns: 1fr; }

  .info-bar { flex-direction: column; display: flex; }
  .info-bar-item { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .info-bar-item:last-child { border-bottom: none; }

  .info-bar-group .info-bar-row { flex-direction: column; }
  .info-bar-group .info-bar-item { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .info-bar-group .info-bar-item:last-child { border-bottom: none; }
  .info-bar-group .info-bar-row + .info-bar-row { border-top: none; }

  .section-header { margin-top: 24px; }

  .data-table, .team-table, .adj-table { font-size: 12px; }
  .data-table thead th,
  .team-table thead th { font-size: 10px; padding: 8px 10px; }
  .data-table tbody td,
  .team-table tbody td { padding: 8px 10px; }

  .form-row { flex-direction: column; gap: 0; }

  .modal { margin: 16px; padding: 24px; }

  .login-card { margin: 16px; padding: 32px 24px; }

  .rec-grid { grid-template-columns: 1fr; }
}

/* Department Levels page — sidebar nav + layout */
.dept-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.dept-sidebar {
  position: sticky;
  top: 68px;
  width: 180px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 12px 0;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
}
.dept-sidebar-title {
  padding: 4px 16px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}
.dept-sidebar-group + .dept-sidebar-group { margin-top: 10px; }
.dept-sidebar-parent {
  display: block;
  padding: 4px 16px 3px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
a.dept-sidebar-parent:hover {
  background: var(--surface-alt);
  color: var(--accent);
}
.dept-parent-banner {
  margin: 4px 0 10px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--accent-light);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
}
.dept-sidebar-link {
  display: block;
  padding: 5px 16px 5px 26px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.dept-sidebar-link:hover {
  background: var(--surface-alt);
  color: var(--text-primary);
}
.dept-sidebar-link.active {
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
  background: var(--accent-light);
}
.dept-main {
  flex: 1;
  min-width: 0;
}

@media (max-width: 1024px) {
  .dept-sidebar { display: none; }
  .dept-layout { gap: 0; }
}

/* Employee chips (Department Levels page) */
.emp-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  font-size: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  white-space: nowrap;
}
.emp-chip-movable { padding: 1px 4px; }
.emp-chip-name { padding: 0 2px; }
.emp-move-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}
.emp-move-btn:hover:not(:disabled) { background: var(--border); color: var(--text-primary); }
.emp-move-btn:disabled { opacity: 0.2; cursor: default; }
/* Loading spinner */
/* Department Lead chips */
.dl-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 10px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  white-space: nowrap;
  color: var(--text-primary);
}
.dl-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}

.access-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}
.access-pill-yes {
  color: var(--accent);
  background: var(--accent-light);
}
.access-pill-muted {
  color: var(--text-tertiary);
}
.access-toggle input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}
.dl-chip-remove:hover {
  background: var(--red);
  color: #fff;
}

/* ── Summary accent-bar card (D V2) ── */
.summary-dv2-band {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--accent);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  gap: 0;
}
.summary-dv2-left {
  display: flex; align-items: center; gap: 14px;
}
.summary-dv2-role {
  font-size: 20px; font-weight: 700; letter-spacing: -0.3px;
  color: var(--text-primary); line-height: 1.2;
}
.summary-dv2-team {
  font-size: 14px; font-weight: 600; color: var(--text-primary); margin-top: 2px;
}
.summary-dv2-emp {
  font-size: 12.5px; color: var(--text-secondary); margin-top: 3px;
}
.summary-dv2-divider {
  width: 1px; align-self: stretch;
  background: var(--border); margin: 0 20px;
}
.summary-dv2-stats {
  display: flex; flex-direction: column; gap: 4px;
}
.summary-dv2-stat {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; gap: 16px;
}
.summary-dv2-stat .sdv2-label {
  color: var(--text-secondary); white-space: nowrap;
}
.summary-dv2-stat .sdv2-val {
  font-weight: 600; color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
}
.summary-dv2-stat .sdv2-val.sdv2-accent {
  color: var(--accent);
}

/* ── Department Budget Page ── */
.team-icon {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), var(--accent-mid));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff; flex-shrink: 0;
}
.budget-cap-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.budget-cap-row:last-child { border-bottom: none; }
.budget-cap-label { font-weight: 500; }
.budget-cap-label.bold { font-weight: 700; }
.budget-cap-value {
  font-family: 'JetBrains Mono', monospace; font-size: 14px;
}
.budget-cap-value.bold { font-weight: 700; }
.budget-cap-value.big { font-size: 17px; font-weight: 700; }
.budget-cap-value.positive { color: var(--green); }
.budget-cap-value.negative { color: var(--red); }

.dist-bar {
  display: flex; height: 40px; border-radius: 8px; overflow: hidden;
  gap: 2px; margin-bottom: 12px;
}
.dist-seg {
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  font-size: 14px; font-weight: 700; color: #fff; border-radius: 6px;
  transition: all 0.2s;
}
.dist-seg-label {
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.3px; opacity: 0.8;
}
.dist-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.dist-legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-secondary);
}
.dist-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.market-indicator {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
}
.market-pip { width: 8px; height: 8px; border-radius: 50%; }
.market-below { background: var(--red); }
.market-low { background: var(--highlight); }
.market-mid { background: var(--green); }
.market-high { background: var(--accent-mid); }

.kpi-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-tertiary); margin-bottom: 6px;
}
.kpi-value {
  font-family: 'JetBrains Mono', monospace; font-size: 22px; font-weight: 500;
  letter-spacing: -0.5px; line-height: 1.2;
}
.kpi-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }

.status-badge {
  display: inline-flex; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
}
.status-badge.status-draft { background: var(--highlight-light); color: #8b6d14; }
.status-badge.status-submitted { background: var(--green-light); color: var(--green); }
.status-badge.status-approved { background: var(--green-light); color: var(--green); }
.status-badge.status-pending { background: #fff5eb; color: #8a4b12; border: 1px solid #f0d9b8; }
.status-badge.status-rejected { background: var(--red-light); color: var(--red); }
.status-badge.status-flagged { background: var(--red-light); color: var(--red); }
.status-badge.status-none { background: var(--surface-alt); color: var(--text-tertiary); }

.data-table tfoot td {
  padding: 12px 12px;
  font-weight: 700;
  border-top: 2px solid var(--border-strong);
  background: var(--surface-alt);
}

.dept-budget-selector {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
}
.dept-budget-selector label {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
}
.dept-budget-selector select {
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border);
  font-family: inherit; font-size: 13px; background: var(--surface);
  color: var(--text-primary); cursor: pointer;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Equity Section ── */

table.eq-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.eq-table th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--text-secondary);
  padding: 10px 12px; border-bottom: 2px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.03em;
}
table.eq-table td {
  padding: 11px 12px; border-bottom: 1px solid var(--border);
}
table.eq-table tr:last-child td { border-bottom: none; }
table.eq-table .align-right { text-align: right; }
table.eq-table .align-center { text-align: center; }
table.eq-table tfoot td {
  padding: 12px 12px; font-weight: 700;
  border-top: 2px solid var(--border-strong); background: var(--surface-alt);
}

.eq-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.eq-summary-row:last-child { border-bottom: none; }
.eq-summary-label { font-size: 13px; color: var(--text-secondary); }
.eq-summary-val {
  font-size: 13.5px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.eq-vesting-bar {
  display: flex; height: 10px; border-radius: 5px; overflow: hidden;
  background: var(--border);
}
.eq-vesting-fill {
  background: var(--accent); transition: width 0.4s;
}
.eq-vesting-labels {
  display: flex; justify-content: space-between;
  font-size: 11.5px; color: var(--text-secondary); margin-top: 6px;
}

.eq-grant-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 100px;
}
.eq-pill-vested { background: var(--green-light); color: var(--green); }
.eq-pill-vesting { background: var(--highlight-light); color: var(--highlight); }

/* Completeness Audit gap chips, colored by who fixes the gap. */
.audit-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  margin: 1px 0;
  border-radius: 100px;
  white-space: nowrap;
  text-decoration: none;
}
a.audit-chip:hover { text-decoration: underline; }
.audit-chip-lead { background: var(--blue-light); color: var(--blue); }
.audit-chip-admin { background: var(--red-light); color: var(--red); }
.audit-chip-coach { background: var(--highlight-light); color: var(--highlight); }

/* Recommendation Review status tracker: a row of steps with checkmarks on
   the finished ones, and a "Next step" panel holding the main action. */
.rt-card {
  display: grid;
  grid-template-columns: 1fr 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin: -8px 0 16px;
}
.rt-track { padding: 18px 14px 14px; min-width: 0; }
.rt-steps { display: grid; }
.rt-step { position: relative; text-align: center; padding: 0 4px; min-width: 0; }
.rt-step::before { content: ''; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.rt-step:first-child::before { display: none; }
.rt-step.is-done::before, .rt-step.is-current::before, .rt-step.is-rejected::before { background: var(--green); }
.rt-dot {
  position: relative; z-index: 1;
  width: 32px; height: 32px; margin: 0 auto 8px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  background: var(--surface); border: 2px solid var(--border-strong); color: var(--text-tertiary);
}
.rt-step.is-done .rt-dot { background: var(--green); border-color: var(--green); color: #fff; }
.rt-step.is-current .rt-dot { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-light); }
.rt-step.is-current .rt-dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.rt-step.is-rejected .rt-dot { background: var(--red); border-color: var(--red); color: #fff; }
.rt-name { font-size: 12.5px; font-weight: 600; color: var(--text-tertiary); }
.rt-step.is-done .rt-name { color: var(--text-primary); }
.rt-step.is-current .rt-name { color: var(--accent); font-weight: 700; }
.rt-step.is-rejected .rt-name { color: var(--red); font-weight: 700; }
.rt-who { font-size: 11.5px; color: var(--text-secondary); line-height: 1.35; margin-top: 2px; }
.rt-when { font-size: 11px; color: var(--text-tertiary); }
.rt-reject-note {
  margin-top: 12px; padding: 9px 12px;
  background: var(--red-light); border: 1px solid #f1c9c9; border-radius: var(--radius);
  font-size: 12.5px; color: var(--red);
}
.rt-reject-note em { color: #7e2424; }
.rt-panel {
  border-left: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 14px 16px;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
}
.rt-panel-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); }
.rt-panel-text { font-size: 13px; color: var(--text-primary); line-height: 1.45; }
.rt-panel .btn { justify-content: center; }
.rt-panel .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.rt-hint { font-size: 11px; color: var(--text-tertiary); text-align: center; }
.rt-done-badge { align-self: flex-start; }
.rt-decide { display: flex; gap: 8px; }
.rt-decide .btn { flex: 1; justify-content: center; font-weight: 600; }
.btn.rt-approve { background: var(--green); border-color: var(--green); color: #fff; }
.btn.rt-reject { background: none; border-color: var(--red); color: var(--red); }
.rt-reject-form { display: flex; gap: 6px; }
.rt-reject-form .form-input { flex: 1; min-width: 0; font-size: 12.5px; padding: 6px 8px; }
.btn.rt-reject-send { background: var(--red); border-color: var(--red); color: #fff; font-size: 12px; padding: 6px 10px; }
.aq-actions .btn.aq-rec { padding: 4px 9px; color: var(--accent); border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; }
.aq-actions .btn.aq-rec:hover { border-color: var(--accent-mid); }
@media (max-width: 900px) {
  .rt-card { grid-template-columns: 1fr; }
  .rt-panel { border-left: none; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .rt-track { overflow-x: auto; }
  .rt-steps { min-width: 520px; }
}

/* Approvals queue: one compact row per raise. */
.aq-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.aq-select-all { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.aq-hint { font-size: 12px; color: var(--text-tertiary); margin-left: auto; }
.aq-table { font-size: 13px; }
.aq-table td { vertical-align: middle; }
.aq-table .aq-check { width: 28px; padding-right: 0; }
.aq-name { font-weight: 600; white-space: nowrap; }
.aq-sub { font-size: 11.5px; color: var(--text-tertiary); }
.aq-pay { white-space: nowrap; }
.aq-arrow { color: var(--text-tertiary); margin: 0 2px; }
.aq-reason { white-space: nowrap; }
.aq-actions { text-align: right; white-space: nowrap; }
.aq-actions .btn { font-size: 12px; padding: 4px 8px; }
.aq-actions .btn + .btn { margin-left: 2px; }
.btn.aq-approve { background: var(--green); color: #fff; border-color: var(--green); font-weight: 600; }
.btn.aq-approve:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.aq-reject { background: none; color: var(--red); border-color: var(--red); font-weight: 600; }
.btn.aq-reject-send { background: var(--red); color: #fff; border-color: var(--red); font-weight: 600; font-size: 12.5px; }
.aq-reject-row td { background: var(--surface-alt); }
.aq-table thead th { white-space: nowrap; }
.aq-table .aq-sub { white-space: nowrap; }
.aq-table .aq-clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
a.aq-name { display: block; color: var(--text-primary); text-decoration: none; }
a.aq-name:hover { color: var(--accent); text-decoration: underline; }
