/* Flow Lending Partner Portal.
   Brand tokens extracted from flowlending.ca (Webflow):
   flg-blue #2457f8, flg-blue-light #288bf9, flg-blue-shade #f8f8fc,
   typeface Open Sauce Sans (self-hosted). No build step; no inline styles
   (CSP) — anything dynamic is an SVG attribute or a class. */

@font-face {
  font-family: "Open Sauce Sans";
  font-weight: 400;
  src: url("../fonts/OpenSauceSans-Regular.d403e7db578f.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Open Sauce Sans";
  font-weight: 500;
  src: url("../fonts/OpenSauceSans-Medium.a4a325e7176f.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Open Sauce Sans";
  font-weight: 600;
  src: url("../fonts/OpenSauceSans-SemiBold.b64e96c48abe.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Open Sauce Sans";
  font-weight: 700;
  src: url("../fonts/OpenSauceSans-Bold.8d4d7b277e98.ttf") format("truetype");
  font-display: swap;
}

:root {
  --navy: #2457f8;        /* flg-blue: primary brand blue */
  --navy-2: #1c46d8;      /* darker hover state of flg-blue */
  --navy-3: #1537ad;      /* pressed / current-page on the blue header */
  --blue-light: #288bf9;  /* flg-blue-light */
  --ink: #0a0a0a;
  --muted: #5b6577;       /* 5.6:1 on white, 5.3:1 on --bg */
  --line: #e4e6f0;
  --bg: #f8f8fc;          /* flg-blue-shade */
  --card: #ffffff;
  --accent: #288bf9;
  --accent-soft: #eaf3fe;
  --good: #15803d;
  --bad: #b91c1c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(10, 10, 30, 0.04), 0 4px 16px rgba(10, 10, 30, 0.05);
  --tap: 44px;            /* minimum touch target */
  --tabbar-h: 60px;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }

body {
  margin: 0;
  font-family: "Open Sauce Sans", "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-2); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--card); color: var(--navy); padding: 0.5rem 0.9rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }

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

/* ---------- header / primary nav ---------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 1.5rem;
  min-height: 60px;
  background: var(--navy);
  color: #fff;
  position: relative;
  z-index: 20;
}
.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: var(--tap);
}
.brand img { height: 26px; width: auto; display: block; }
.brand span {
  color: #e3ecff;
  font-weight: 500;
  font-size: 0.85rem;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  padding-left: 0.7rem;
}
#site-nav { display: flex; gap: 0.15rem; margin-left: 0.5rem; margin-right: auto; }
#site-nav a {
  color: #e8efff;
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
}
#site-nav a:hover { background: var(--navy-2); color: #fff; }
#site-nav a[aria-current="page"] { background: var(--navy-3); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
#site-nav a:focus-visible { outline-color: #fff; }

.user-menu { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
details.menu { position: relative; }
details.menu > summary {
  list-style: none;
  cursor: pointer;
  color: #e8efff;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.35);
  user-select: none;
}
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary:hover, details.menu[open] > summary, details.menu[data-current] > summary { background: var(--navy-2); color: #fff; }
details.menu > summary:focus-visible { outline-color: #fff; }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 13rem;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(10, 10, 30, 0.18);
  padding: 0.4rem;
  z-index: 30;
}
.menu-panel a, .menu-panel .link-button {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--ink);
  text-decoration: none;
  padding: 0.55rem 0.8rem;
  min-height: var(--tap);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  background: none;
  border: 0;
}
.menu-panel a:hover, .menu-panel .link-button:hover { background: var(--accent-soft); color: var(--navy); }
.menu-panel form { margin: 0; }
.menu-meta { margin: 0.2rem 0.8rem 0.4rem; color: var(--muted); font-size: 0.8rem; line-height: 1.4; border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; }
.menu-badge {
  background: #fff; color: var(--navy);
  border-radius: 999px; min-width: 1.25rem; height: 1.25rem; padding: 0 0.35rem;
  font-size: 0.75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; color: var(--navy); font-weight: 700; font-size: 0.85rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.menu-account > summary { padding-left: 0.3rem; border: 0; }
.menu-name { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- mobile tab bar ---------- */
.tabbar { display: none; }
@media (max-width: 800px) {
  #site-nav { display: none; }
  .site-header { padding: 0 1rem; gap: 0.75rem; }
  .brand span { display: none; }
  .menu-name { display: none; }
  .menu-account > summary { padding: 0.3rem; }
  body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--card);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 20px rgba(10, 10, 30, 0.06);
    z-index: 20;
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--muted); text-decoration: none; font-size: 0.7rem; font-weight: 600; min-height: var(--tap);
  }
  .tabbar a svg { display: block; }
  .tabbar a[aria-current="page"] { color: var(--navy); }
  .tabbar a[aria-current="page"] svg { stroke-width: 2.2; }
}

/* ---------- layout ---------- */
main { max-width: 76rem; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }
.site-footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 1.5rem; }

h1 { font-size: 1.6rem; line-height: 1.2; color: var(--ink); margin: 0 0 0.35rem; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; color: var(--ink); margin: 0 0 0.6rem; }
.subtle { color: var(--muted); font-size: 0.9rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.eyebrow { margin: 0 0 0.15rem; color: var(--navy); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.lede { font-size: 1.1rem; line-height: 1.5; margin: 0 0 1.25rem; max-width: 52rem; }
.lede strong { font-weight: 600; }
.freshness { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.82rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.freshness strong { font-weight: 600; color: var(--ink); }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.page-head > div { min-width: 0; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.page-head .subtle { margin: 0.2rem 0 0; }
.page-head input[type="search"], .toolbar input[type="search"] {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 16rem;
  min-height: var(--tap);
  font-size: 0.95rem;
  background: var(--card);
}
/* A link that looks like an on/off switch (no JS: it reloads with ?param). */
.switch {
  display: inline-flex; align-items: center; gap: 0.55rem; min-height: var(--tap);
  color: var(--ink); text-decoration: none; font-size: 0.92rem; white-space: nowrap;
}
.switch::before {
  content: ""; width: 2.25rem; height: 1.3rem; border-radius: 999px; flex: none;
  background: var(--line) radial-gradient(circle at 0.65rem 50%, #fff 0.5rem, transparent 0.53rem);
  transition: background-color 0.15s;
}
.switch[aria-checked="true"]::before {
  background: var(--navy) radial-gradient(circle at 1.6rem 50%, #fff 0.5rem, transparent 0.53rem);
}
.switch:hover::before { filter: brightness(0.95); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }
.period-form { display: flex; align-items: center; gap: 0.5rem; }
.period-form button[hidden] { display: none; }

/* Scrolls sideways on narrow phones. The baseline is an inset shadow so the
   active tab's underline covers it without overflowing (a -1px margin made a
   1px vertical scroll). */
.subnav {
  display: flex; gap: 0.25rem; margin: 0 0 1rem;
  box-shadow: inset 0 -1px 0 var(--line);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  padding: 0.6rem 0.2rem; margin-right: 1rem; min-height: var(--tap);
  display: inline-flex; align-items: center; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.subnav a:hover { color: var(--navy); }
.subnav a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--navy); }

/* ---------- tiles (headline numbers) ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.9rem 1rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  min-height: 6.4rem;
  box-shadow: var(--shadow);
}
a.tile:hover { border-color: var(--accent); }
.tile-label { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.tile-value { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile-of { font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.tile-meta { font-size: 0.78rem; color: var(--muted); }
.sparkline { position: absolute; right: 0.9rem; bottom: 0.8rem; width: 5.5rem; height: 1.75rem; color: var(--navy); opacity: 0.9; }
.tile:has(.sparkline) { padding-right: 7rem; }
.delta-up { color: var(--good); }
.delta-down { color: var(--bad); }
.tiles-3 { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.info-dot {
  display: inline-grid; place-items: center; width: 1rem; height: 1rem; border-radius: 50%;
  border: 1px solid currentColor; font-size: 0.66rem; font-weight: 600; font-style: italic;
  cursor: help; opacity: 0.75;
}
.info-dot:hover, .info-dot:focus { opacity: 1; color: var(--navy); }

/* ---------- cards + short lists (Home) ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.card > h2 { margin-bottom: 0.25rem; }
.card > .subtle { margin: 0 0 0.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 0.9rem; margin-bottom: 0.9rem; }
.mini-list { list-style: none; margin: 0.25rem 0 0; padding: 0; }
.mini-list li {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0.35rem; min-height: var(--tap);
  border-top: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.mini-list li:first-child { border-top: 0; }
.mini-list li.has-modal:hover, .mini-list li.has-link:hover { background: #f2f6ff; }
.mini-rank { width: 1.4rem; color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; text-align: right; flex: none; }
.mini-main { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.mini-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-meta { color: var(--muted); font-size: 0.8rem; }
.mini-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; text-align: right; }
.mini-value .muted { font-weight: 400; }
.mini-empty { color: var(--muted); font-size: 0.9rem; }
.card-link { display: inline-flex; align-items: center; min-height: var(--tap); margin-top: 0.25rem; font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.card-link::after { content: " →"; }
.card-link:hover { text-decoration: underline; }
.empty-state { text-align: left; }
.empty-state h2 { margin-bottom: 0.3rem; }
.empty-state p { margin: 0.3rem 0; }

/* ---------- tables ---------- */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
}
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  background: #eef2fe;
  color: var(--navy);
  padding: 0.6rem 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
  border-bottom: 1px solid var(--line);
}
.data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table th[data-dir="asc"]::after { content: " ↑"; color: var(--accent); }
.data-table th[data-dir="desc"]::after { content: " ↓"; color: var(--accent); }
.data-table td { padding: 0.55rem 0.8rem; border-top: 1px solid var(--line); }
.data-table tbody tr:first-child td { border-top: 0; }
.data-table tbody tr:hover { background: #f2f6ff; }
.data-table tr[hidden] { display: none; }

/* People tables: taller rows (tap targets), name column emphasised. */
.people-table td { padding: 0.7rem 0.7rem; height: var(--tap); }
.people-table th { padding-left: 0.7rem; padding-right: 0.7rem; white-space: normal; }
.people-table .with-copy { display: inline; white-space: normal; }
.people-table .badge { white-space: nowrap; }
@media (max-width: 1280px) {
  .people-table .badge-level { white-space: normal; border-radius: 10px; }
}
.people-table .cell-name { font-weight: 600; min-width: 10rem; }
.people-table .cell-email { max-width: 16rem; }
.cell-rank { color: var(--muted); }
.quiet-link { color: var(--ink); text-decoration: none; }
.quiet-link:hover { color: var(--navy); text-decoration: underline; }

/* Tablet: scroll sideways, keep the name column in view. */
@media (max-width: 1000px) and (min-width: 641px) {
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
  .people-table .cell-name { position: sticky; left: 0; background: var(--card); z-index: 1; }
  .people-table tbody tr:hover .cell-name { background: #f2f6ff; }
}

/* Phone: each row becomes a card — rank + name + one key number on the
   first line, then one short fact per line. Columns marked .cell-minor are
   left out (they live in the broker dialog). */
@media (max-width: 640px) {
  .data-table:not(.no-cards) { display: block; border: 0; background: none; box-shadow: none; overflow: visible; }
  .data-table:not(.no-cards) thead { display: none; }
  .data-table:not(.no-cards) tbody { display: block; }
  .data-table:not(.no-cards) tbody tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    column-gap: 0.5rem;
    row-gap: 0.15rem;
    align-items: baseline;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 0.75rem 0.9rem; margin-bottom: 0.5rem; box-shadow: var(--shadow);
  }
  .data-table:not(.no-cards) tbody tr[hidden] { display: none; }
  .data-table:not(.no-cards) td { display: block; padding: 0; border: 0; height: auto; grid-column: 1 / -1; }
  .data-table:not(.no-cards) td.cell-rank { grid-column: 1; grid-row: 1; font-size: 0.85rem; }
  .data-table:not(.no-cards) td.cell-rank::after { content: "."; }
  .data-table:not(.no-cards) td.cell-name { grid-column: 2; grid-row: 1; min-width: 0; font-size: 1rem; }
  .data-table:not(.no-cards) tbody tr:not(:has(.cell-rank)) td.cell-name { grid-column: 1 / 3; }
  .data-table:not(.no-cards) td.cell-key { grid-column: 3; grid-row: 1; text-align: right; font-weight: 600; font-size: 1rem; white-space: nowrap; }
  .data-table:not(.no-cards) td.cell-minor { display: none; }
  .data-table:not(.no-cards) td:not(.cell-name):not(.cell-key):not(.cell-rank) {
    font-size: 0.85rem; color: var(--muted); text-align: left;
  }
  .data-table:not(.no-cards) td[data-label]:not(.cell-key):not(.cell-name)::before {
    content: attr(data-label); color: var(--muted); margin-right: 0.4rem;
  }
  .data-table:not(.no-cards) td[data-label]:not(.cell-key):not(.cell-name) .badge { font-size: 0.75rem; }
  .data-table:not(.no-cards) td[colspan] { color: var(--muted); }
  .people-table .copy-btn { display: none; }
  .table-bar { flex-wrap: wrap; }
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  vertical-align: middle;
}
.badge-active, .badge-hire { background: #e7f6ec; color: var(--good); }
.badge-departed, .badge-depart { background: #fdecec; color: var(--bad); }
.badge-level { background: var(--accent-soft); color: var(--navy); }
.badge-broker { background: #eef0f5; color: #475569; }
.badge-assistant { background: #fff4e0; color: #9a5b00; }
.badge-mine { background: var(--navy); color: #fff; }
.badge-high { background: #e7f6ec; color: var(--good); }
.badge-medium { background: #fff4e0; color: #9a5b00; }
.badge-low { background: #eef0f5; color: #475569; }
.badge-tier { background: var(--accent-soft); color: var(--navy); }
h1 .badge-mine { font-size: 0.8rem; vertical-align: middle; position: relative; top: -0.15em; }

/* ---------- forms / buttons / messages ---------- */
.auth-card {
  max-width: 26rem;
  margin: 3rem auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.25rem; color: var(--navy); }
.auth-card label { display: block; margin: 0.9rem 0 0.25rem; font-size: 0.9rem; font-weight: 600; }
.auth-card input,
.auth-card select,
.auth-card form p input,
.auth-card form p select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}
.auth-card form p { margin: 0.7rem 0; }
.auth-card .helptext { color: var(--muted); font-size: 0.8rem; display: block; margin-top: 0.2rem; }
.auth-card ul { color: var(--muted); font-size: 0.85rem; padding-left: 1.2rem; }
.errorlist { color: var(--bad); font-size: 0.85rem; padding-left: 1.2rem; }
/* Meet the team: request form */
.meeting-form label { display: block; margin: 0.9rem 0 0.3rem; font-size: 0.9rem; font-weight: 600; }
.meeting-form input[type="text"], .meeting-form textarea {
  width: 100%; padding: 0.6rem 0.75rem; min-height: var(--tap);
  border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit;
}
.meeting-form .choices { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.meeting-form .choices label { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-weight: 500; }
.meeting-form button { margin-top: 1rem; }
.errors { color: var(--bad); font-size: 0.9rem; }

button, .button {
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1.3rem;
  min-height: var(--tap);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover, .button:hover { background: var(--navy-2); }
.button-secondary { background: var(--card); color: var(--navy); border: 1px solid var(--line); }
.button-secondary:hover { background: var(--accent-soft); }
button.danger { background: #fdecec; color: var(--bad); }
button.danger:hover { background: #fbdcdc; }
.auth-card button { width: 100%; margin-top: 1.2rem; }

select {
  padding: 0.45rem 0.7rem;
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 0.9rem;
  font-family: inherit;
}

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li {
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  background: var(--accent-soft);
  border: 1px solid #c8dffc;
}
.messages li.error, .messages li.warning { background: #fdecec; border-color: #f5c6c6; }

.issue-alert {
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  margin: 0 0 1rem;
  font-size: 0.9rem;
  background: #fff7e6;
  border: 1px solid #f5d9a6;
}
.issue-actions { white-space: nowrap; }
.issue-actions form { display: inline; }
.issue-actions button { padding: 0.3rem 0.6rem; min-height: 36px; font-size: 0.8rem; margin: 0.1rem; }

/* ---------- team changes / contacts / resources ---------- */
.staffing-month { margin-bottom: 1.5rem; }
.staffing-month h2 { margin-bottom: 0.5rem; }
.staffing-month h2 .subtle { font-weight: 400; }
.staffing-list { list-style: none; padding: 0; margin: 0; }
.staffing-list li {
  display: flex; align-items: center; gap: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  min-height: var(--tap);
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
}
.staffing-main { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.staffing-meta, .staffing-notes { color: var(--muted); font-size: 0.85rem; }
.staffing-date { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

.contact-list { list-style: none; padding: 0; margin: 0; max-width: 52rem; }
.contact-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 1.1rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
}
.contact-avatar {
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--navy);
  font-weight: 700; font-size: 0.9rem; letter-spacing: 0.02em;
  display: inline-flex; align-items: center; justify-content: center;
}
.contact-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.contact-main strong { font-size: 1rem; }
.contact-links { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; min-width: 0; width: 20rem; }
.contact-links a {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--ink); text-decoration: none; font-size: 0.92rem;
  padding: 0.2rem 0; min-height: 32px; overflow-wrap: anywhere;
}
.contact-links a svg { color: var(--muted); flex: none; }
.contact-links a:hover { color: var(--navy); text-decoration: underline; }
@media (max-width: 640px) {
  .contact-row { grid-template-columns: auto 1fr; row-gap: 0.4rem; }
  .contact-links { grid-column: 1 / -1; width: auto; }
}

.resource-list { list-style: none; padding: 0; margin: 0; }
.resource-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 1.1rem;
  min-height: var(--tap);
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
}
.resource-list a { font-weight: 600; text-decoration: none; }
.resource-list a::after { content: " →"; color: var(--muted); }

.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 2rem; max-width: 50rem; box-shadow: var(--shadow); }
.prose h2 { margin-top: 1.4rem; }
.prose table { border-collapse: collapse; }
.prose td, .prose th { border: 1px solid var(--line); padding: 0.4rem 0.7rem; }
@media (max-width: 640px) { .prose { padding: 1.1rem 1rem; } }

.row-actions { display: flex; gap: 0.4rem; }
.row-actions form { margin: 0; }

/* ---------- lender type tabs + ranked bars ---------- */
.type-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.6rem;
  margin: 1rem 0 1rem;
}
.type-tab {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.3;
  min-height: var(--tap);
}
.type-tab:hover { border-color: var(--accent); text-decoration: none; }
.type-tab.active { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: var(--accent-soft); }
.type-tab-name { font-weight: 600; font-size: 0.88rem; display: flex; align-items: center; gap: 0.4rem; }
.type-tab-volume { font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.type-tab-meta { font-size: 0.76rem; color: var(--muted); }
.type-dot { flex: none; }
@media (max-width: 640px) {
  .type-tabs { display: flex; overflow-x: auto; gap: 0.5rem; padding-bottom: 0.25rem; scroll-snap-type: x mandatory; }
  .type-tab { flex: 0 0 11rem; scroll-snap-align: start; }
}

.lender-chart { margin-bottom: 1rem; }
.bar-chart { list-style: none; margin: 0; padding: 0; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) 1fr auto 3.5rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.4rem;
  min-height: 2.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.bar-row.has-link:hover, .bar-row.has-modal:hover { background: #f2f6ff; }
.bar-row.is-mine { background: var(--accent-soft); }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bar-name .quiet-link { color: inherit; }
.bar { width: 100%; height: 10px; display: block; }
.bar-track { fill: #eef0f6; }
.bar-fill { fill: #8fb0f7; }
.bar-row.is-mine .bar-fill { fill: var(--navy); }
.bar-row.is-other .bar-fill { fill: #c3c7d3; }
.bar-row.is-other .bar-name { color: var(--muted); }
.bar-volume { white-space: nowrap; }
.bar-share { color: var(--muted); text-align: right; }
@media (max-width: 640px) {
  .bar-row { grid-template-columns: 1fr auto; grid-template-areas: "name volume" "bar bar"; gap: 0.15rem 0.75rem; padding: 0.5rem 0.4rem; }
  .bar-name { grid-area: name; }
  .bar-volume { grid-area: volume; }
  .bar { grid-area: bar; }
  .bar-share { display: none; }
}

.is-mine { background: var(--accent-soft); }
.data-table tbody tr.is-mine:hover { background: #dfeafe; }
.lender-detail h2 { margin: 1.5rem 0 0.6rem; }
.lender-detail h2 .subtle { font-weight: 400; }
.lender-detail .card { margin-bottom: 0.9rem; }
.lender-detail .footnote { margin: 0.3rem 0 0; }

/* ---------- broker details: a side sheet, bottom sheet on phones ---------- */
.has-modal, .has-link { cursor: pointer; }
tr.has-link:focus-visible, li.has-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
tr.has-modal:focus-visible, li.has-modal:focus-visible { outline: 2px solid var(--accent); }

#broker-modal {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(100vw, 32rem);
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 2rem 1.75rem 1.75rem;
  overflow-y: auto;
  box-shadow: -20px 0 50px rgba(10, 10, 30, 0.2);
}
#broker-modal::backdrop { background: rgba(10, 10, 30, 0.4); }
@media (max-width: 640px) {
  #broker-modal {
    inset: auto 0 0 0;
    width: 100%;
    height: auto;
    max-height: 88dvh;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    padding: 1.5rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
    box-shadow: 0 -20px 50px rgba(10, 10, 30, 0.2);
  }
}
#broker-modal h2 { margin: 0 0 0.2rem; font-size: 1.3rem; padding-right: 2rem; }
.modal-sub { margin: 0 0 1.1rem; color: var(--muted); font-size: 0.95rem; }
.modal-fields { margin: 0; }
.modal-fields div {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}
.modal-fields dt { color: var(--muted); font-size: 0.88rem; min-width: 7.5rem; margin: 0; flex-shrink: 0; }
.modal-fields dd {
  margin: 0; font-size: 0.95rem; flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 0.35rem;  /* copy button stays beside the email */
}
.modal-fields dd a { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) {  /* label above the value: room for long emails */
  .modal-fields div { flex-direction: column; align-items: stretch; gap: 0.15rem; }
}
.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: var(--tap); height: var(--tap); min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.3rem;
}
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-actions { margin-top: 1.25rem; }
.modal-actions .button[hidden] { display: none; }

.modal-lenders { margin-top: 1.5rem; }
.modal-lenders h3 { margin: 0 0 0.75rem; font-size: 0.88rem; color: var(--muted); font-weight: 600; }
/* Donut on top, the lender list full width below it, so names aren't cut off. */
.modal-lenders-body { display: flex; flex-direction: column; align-items: stretch; gap: 1rem; }
.modal-donut { flex: none; align-self: center; }
.modal-donut .donut-total { font-size: 4.6px; font-weight: 600; fill: var(--ink); }
.modal-lender-list { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.modal-lender-list li {
  display: grid;
  grid-template-columns: auto 1fr auto 3rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.modal-lender-list li:first-child { border-top: 0; }
.modal-lender-list .lender-dot { flex: none; }
.modal-lender-list .lender-name { overflow-wrap: anywhere; }
.modal-lender-list .lender-share { color: var(--muted); text-align: right; }
.modal-lender-list .is-mine .lender-name { font-weight: 600; color: var(--navy); }
.modal-lender-list .is-mine { background: var(--accent-soft); margin: 0 -0.5rem; padding-inline: 0.5rem; border-radius: 6px; }
.modal-lenders-body { position: relative; }
.donut-slice { cursor: default; }
.donut-tip {
  position: absolute; z-index: 1; pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  background: var(--ink); color: #fff; border-radius: 6px;
  padding: 0.35rem 0.6rem; font-size: 0.85rem; white-space: nowrap;
  font-variant-numeric: tabular-nums; box-shadow: 0 4px 14px rgba(10, 10, 30, 0.25);
}
.donut-tip[hidden] { display: none; }
.modal-lender-list li.is-hover { background: var(--bg); margin: 0 -0.5rem; padding-inline: 0.5rem; border-radius: 6px; }
.modal-lender-list li.is-mine.is-hover { background: var(--accent-soft); }
.modal-lenders-none { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.9rem; }
.modal-lenders-none[hidden] { display: none; }
.modal-lender-list .lender-total { color: var(--muted); }
.modal-lender-list .lender-total .lender-volume { font-weight: 600; color: var(--ink); }

/* ---------- copy buttons ---------- */
.with-copy { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.copy-btn {
  background: transparent;
  color: var(--muted);
  width: 28px; height: 28px; min-height: 0;
  padding: 0;
  margin-left: 0.25rem;
  border-radius: 6px;
  line-height: 0;
  vertical-align: middle;
}
.copy-btn:hover { background: var(--accent-soft); color: var(--navy); }
.copy-btn.copied { color: var(--good); }
.copy-btn.copied svg { display: none; }
.copy-btn.copied::after { content: "✓"; font-size: 0.85rem; line-height: 1; }
@media (hover: hover) {
  .people-table .copy-btn { opacity: 0; transition: opacity 0.15s; }
  .people-table tr:hover .copy-btn,
  .people-table .copy-btn:focus-visible,
  .people-table .copy-btn.copied { opacity: 1; }
}

/* ---------- table counts / pagination ---------- */
.table-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 0 0 0.5rem; }
.table-summary { margin: 0; color: var(--muted); font-size: 0.88rem; }
.page-size { color: var(--muted); font-size: 0.88rem; white-space: nowrap; }
.page-size select {
  margin-left: 0.35rem;
  padding: 0.25rem 0.5rem;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit;
}
.table-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.3rem; margin: 1rem 0 0; }
.table-pager[hidden] { display: none; }
.table-pager button {
  background: var(--card);
  color: var(--navy);
  border: 1px solid var(--line);
  padding: 0.35rem 0.75rem;
  min-height: 40px;
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 2.4rem;
}
.table-pager button:hover:not(:disabled) { background: var(--accent-soft); }
.table-pager button.current { background: var(--navy); color: #fff; border-color: var(--navy); }
.table-pager button:disabled { color: var(--muted); cursor: default; opacity: 0.5; }
.pager-gap { color: var(--muted); padding: 0 0.2rem; }

/* ---------- manage pages ---------- */
.sync-run { margin-bottom: 1.5rem; }
.sync-run h2 { margin-bottom: 0.4rem; }
.sync-failed h2 { color: var(--bad); }
.sync-notes { white-space: pre-wrap; font-size: 0.78rem; color: var(--muted); margin: 0; font-family: ui-monospace, monospace; }
.lender-form { display: flex; gap: 0.4rem; align-items: center; }
.lender-form button { min-height: 36px; padding: 0.3rem 0.9rem; }
@media (max-width: 640px) {
  .data-table.no-cards { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---------- events (Resources page) ---------- */
.events { margin-bottom: 1.75rem; }
.event-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.event-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 1.1rem;
  min-height: var(--tap);
  box-shadow: var(--shadow);
}
.event-date {
  flex: none;
  width: 3.6rem;
  text-align: center;
  background: var(--accent-soft);
  color: var(--navy);
  border-radius: 10px;
  padding: 0.35rem 0;
  line-height: 1.15;
}
.event-month { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.event-day { display: block; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.event-body { min-width: 0; }
.event-body h3 { margin: 0; font-size: 1rem; }
.event-body h3 a { text-decoration: none; }
.event-body h3 a:hover { text-decoration: underline; }
.event-when { margin: 0.1rem 0 0; font-size: 0.9rem; }
.event-body .subtle { margin: 0.15rem 0 0; }

/* ---------- Home redesign: hero, opportunity, people, feed ---------- */
.hero {
  color: #fff;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(40, 139, 249, 0.55), transparent 60%),
    radial-gradient(40rem 24rem at -10% 120%, rgba(10, 20, 90, 0.45), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, #1a3fd6 100%);
  padding: 2.25rem 1.5rem 1.4rem;
  margin-bottom: -4rem; /* the first card overlaps the hero's foot */
}
.hero-inner {
  max-width: 73rem; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 2.5rem; align-items: end;
}
.hero-eyebrow { margin: 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #cfe0ff; }
.hero-figure {
  margin: 0.35rem 0 0; font-size: clamp(3.2rem, 7vw, 5.6rem); line-height: 0.95; font-weight: 700;
  letter-spacing: -0.035em; font-variant-numeric: tabular-nums;
}
.hero-caption { margin: 0.55rem 0 1rem; font-size: 1.1rem; color: #e3ecff; }
.hero-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.75rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip-up { background: #fff; color: var(--navy); box-shadow: none; }
.hero-fresh { max-width: 73rem; margin: 1.6rem auto 4rem; }
.hero-caption .info-dot { font-size: 0.62rem; vertical-align: 0.15em; margin-left: 0.15rem; color: #cfe0ff; }
.hero-caption .info-dot:hover, .hero-caption .info-dot:focus { color: #fff; }
.hero-inner { margin-bottom: 4rem; }
.hero-fresh .freshness { margin: 0; color: #bcd0ff; font-size: 0.75rem; }
.hero-fresh .freshness strong { color: #e3ecff; }
.hero-fresh .info-dot:hover, .hero-fresh .info-dot:focus { color: #fff; }
a.chip-rank { color: #fff; text-decoration: none; }
a.chip-rank:hover { background: rgba(255, 255, 255, 0.24); }
a.chip-link { color: #fff; text-decoration: none; background: transparent; }
a.chip-link:hover { background: rgba(255, 255, 255, 0.14); }

.week-chart { margin: 0; position: relative; }
.week-chart svg { display: block; width: 100%; height: 9.5rem; overflow: visible; }
.wk { cursor: pointer; outline: none; }
.wk-hit { fill: transparent; }
.wk-line { stroke: #fff; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.wk-dot { stroke: #fff; stroke-width: 0; stroke-linecap: round; transition: stroke-width 0.12s; }
.wk.is-latest .wk-dot { stroke-width: 11px; }
.wk.is-active .wk-dot { stroke-width: 13px; }
.wk-guide { stroke: rgba(255, 255, 255, 0.45); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.wk.is-active .wk-guide { opacity: 1; }
.week-tip {
  position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 10px)); pointer-events: none;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.05rem; min-width: 9.5rem;
  padding: 0.55rem 0.8rem 0.6rem; border-radius: 12px; background: #fff; color: var(--ink);
  box-shadow: 0 12px 32px rgba(8, 20, 80, 0.3); white-space: nowrap;
}
.week-tip::after {
  content: ""; position: absolute; left: var(--arrow, 50%); bottom: -5px; width: 10px; height: 10px;
  background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 2px;
}
.week-tip[hidden] { display: none; }
.week-tip-range { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.week-tip-amount { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.week-tip-vs { font-size: 0.75rem; font-weight: 600; color: var(--good); }
.week-tip-vs.is-down { color: var(--bad); }
.week-tip-vs:empty { display: none; }
.week-chart figcaption {
  display: flex; justify-content: space-between; margin-top: 0.45rem;
  font-size: 0.72rem; color: #bcd0ff; letter-spacing: 0.02em;
}
.week-chart figcaption span:nth-child(2) { font-weight: 600; color: #e3ecff; }

/* The opportunity band: the reason a BDM opens the portal. */
.opportunity {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1.25fr; gap: 0;
  background: var(--card); border-radius: 18px; overflow: hidden;
  box-shadow: 0 10px 40px rgba(14, 30, 110, 0.14), 0 1px 3px rgba(14, 30, 110, 0.08);
  margin-bottom: 2.25rem;
}
.opp-block { padding: 1.6rem 1.75rem; }
.opp-money { background: #0d1b4f; color: #fff; display: flex; flex-direction: column; align-items: flex-start; }
.opp-figure { margin: 0; font-size: 2.6rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.opp-figure span { font-size: 1.1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.opp-text { margin: 0.4rem 0 1rem; font-size: 1rem; color: var(--muted); max-width: 26rem; }
.opp-money .opp-text { color: #b8c6f2; }
.opp-money .button { margin-top: auto; }
.dots { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 0.6rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #e3e7f2; display: inline-block; flex: none; }
.dot.is-on { background: var(--navy); }
.dots-legend { margin: 0; font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.dots-legend .dot { width: 9px; height: 9px; }
.dots-legend .dot:not(:first-child) { margin-left: 0.6rem; }
.button-light { background: #fff; color: #0d1b4f; }
.button-light:hover { background: #e3ecff; color: #0d1b4f; }

.section { margin-bottom: 2.25rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.section-head h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.01em; }
.section-head .card-link { margin: 0; min-height: 0; }
.section-count { font-size: 0.85rem; font-weight: 500; color: var(--muted); margin-left: 0.4rem; }
.grid-2 + .section, .grid-2 { margin-bottom: 2.25rem; }

/* People to call: one card per broker. */
.people {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 0.9rem;
}
.person {
  display: flex; flex-direction: column; gap: 0.1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem 1.1rem 1rem;
  box-shadow: var(--shadow); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.person:hover { transform: translateY(-2px); border-color: #c9d7fd; box-shadow: 0 8px 28px rgba(14, 30, 110, 0.1); }
.person-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.65rem; }
.avatar-lg {
  width: 2.75rem; height: 2.75rem; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--blue-light), var(--navy)); color: #fff; font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em;
}
.person-name { font-weight: 600; font-size: 1.02rem; line-height: 1.25; }
.person-meta { font-size: 0.8rem; color: var(--muted); }
.person-value { margin-top: 0.7rem; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.share-bar { display: block; width: 100%; height: 6px; margin-top: 0.85rem; }
.share-bar .bar-fill { fill: var(--navy); }
.person-share { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }
.person-actions { display: flex; gap: 0.45rem; margin-top: 0.9rem; }
.person-actions .button { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 40px; text-decoration: none; }
.person-actions svg { width: 17px; height: 17px; }
.person-call { flex: 1; }
.button-icon { flex: none; width: 44px; padding: 0; background: var(--accent-soft); color: var(--navy); }
.button-icon:hover { background: #d8e7fd; color: var(--navy); }

/* Activity feed. */
.feed { list-style: none; margin: 0; padding: 0.35rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.feed li { display: flex; align-items: center; gap: 0.85rem; padding: 0.7rem 0.75rem; border-radius: 10px; min-height: var(--tap); }
.feed li + li { border-top: 1px solid var(--line); }
.feed li.has-modal:hover { background: #f2f6ff; }
.feed .mini-empty { padding: 0.9rem; }
.feed-icon { width: 2rem; height: 2rem; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: 0.85rem; background: var(--accent-soft); color: var(--navy); }
.feed-first { background: #e7f6ec; color: var(--good); }
.feed-more { background: #e7f6ec; color: var(--good); }
.feed-hire { background: #fff4e0; color: #9a5b00; }
.feed-depart { background: #fdecec; color: var(--bad); }
.feed-text { flex: 1; min-width: 0; color: var(--muted); }
.feed-text strong { color: var(--ink); font-weight: 600; }
.feed-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-value.muted { font-weight: 500; }

/* Flow-wide Home: podium + ranked bars. */
.grid-2 .card { border-radius: 16px; padding: 1.25rem 1.35rem; position: relative; z-index: 1; }
.hero + main .grid-2:first-child .card { box-shadow: 0 10px 40px rgba(14, 30, 110, 0.12), 0 1px 3px rgba(14, 30, 110, 0.06); border: 0; }
.podium { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.podium li {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.1rem;
  padding: 1rem 0.5rem 0.9rem; border-radius: 14px; background: var(--bg); cursor: pointer;
}
.podium li:hover { background: #eef3ff; }
.podium .avatar-lg { margin-bottom: 0.4rem; }
.podium .person-value { margin-top: 0.25rem; font-size: 1.3rem; }
.podium .person-name { font-size: 0.92rem; }
.podium-1 { background: linear-gradient(180deg, #eaf1ff, #f8f8fc) !important; box-shadow: inset 0 0 0 1px #c9d7fd; }
.podium-1 .avatar-lg { width: 3.25rem; height: 3.25rem; font-size: 1.05rem; }
.podium-rank {
  position: absolute; top: 0.55rem; left: 0.6rem; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.72rem; font-weight: 700; background: #fff; color: var(--navy);
  box-shadow: 0 1px 3px rgba(14, 30, 110, 0.15);
}
.podium-1 .podium-rank { background: var(--navy); color: #fff; }
.rank-bars { list-style: none; margin: 0; padding: 0; }
.rank-bars li {
  display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem; grid-template-areas: "label value" "bar value";
  column-gap: 1rem; row-gap: 0.3rem; align-items: center; padding: 0.6rem 0.35rem; border-radius: 10px; cursor: pointer;
}
.rank-bars li:hover { background: #f2f6ff; }
.rank-bars-label { grid-area: label; display: flex; justify-content: space-between; gap: 0.5rem; font-weight: 600; font-size: 0.95rem; }
.rank-bars-label .muted { font-weight: 500; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.rank-bars svg { grid-area: bar; display: block; width: 100%; height: 10px; }
.rank-bars li:first-child .bar-fill { fill: var(--navy); }
.rank-bars-value { grid-area: value; text-align: right; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .week-chart svg { height: 6.5rem; }
  .opportunity { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero { padding: 1.5rem 1rem 1rem; }
  .hero-fresh { margin-bottom: 4rem; }
  .opp-block { padding: 1.25rem; }
  .opp-figure { font-size: 2.2rem; }
  /* A swipeable strip instead of a tall stack. */
  .people {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0.6rem;
    margin: 0 -1.5rem; padding: 0.25rem 1.5rem 0.75rem; scrollbar-width: none;
  }
  .people::-webkit-scrollbar { display: none; }
  .person { flex: 0 0 72%; scroll-snap-align: center; }
  .person { padding: 0.9rem; }
  .person-value { font-size: 1.3rem; }
  .podium { gap: 0.4rem; }
  .podium .person-value { font-size: 1.05rem; }
}

/* ---------- Target agents: pill filter + legend up top ---------- */
.level-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.25rem 0 0.6rem; }
.level-pill {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 38px; padding: 0.3rem 0.95rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font-weight: 600; font-size: 0.9rem; text-decoration: none;
}
.level-pill span { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.level-pill:hover { border-color: var(--accent); }
.level-pill.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.level-pill.active span { color: #cfe0ff; }
.level-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 0 0 1.1rem; font-size: 0.8rem; color: var(--muted); }
.level-legend .badge { margin-right: 0.3rem; }
.cell-sub { display: block; font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.share-cell { display: inline-flex; align-items: center; gap: 0.55rem; font-variant-numeric: tabular-nums; }
.share-cell svg { width: 4.5rem; height: 6px; flex: none; }
.share-cell .bar-fill { fill: var(--navy); }
.targets-table td.cell-key { font-weight: 700; }

/* ---------- Section pages: compact hero, pill tabs, cleaner tables ---------- */
.hero-page { margin-bottom: 0; padding: 1.75rem 1.5rem 0; }
.band { max-width: 73rem; margin: 0 auto 1.25rem; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem 3rem; flex-wrap: wrap; }
.band-title { margin: 0; font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; color: #fff; }
.band-sub { margin: 0.35rem 0 0; color: #cfe0ff; font-size: 0.98rem; }
.band-info .info-dot { font-size: 0.7rem; vertical-align: 0.5em; margin-left: 0.4rem; color: #cfe0ff; letter-spacing: 0; }
.band-sub .info-dot { font-size: 0.6rem; vertical-align: 0.15em; margin-left: 0.15rem; }
.band-stats { display: flex; gap: 2.5rem; }
.band-stat { min-width: 9rem; }
.band-stats .band-stat + .band-stat { padding-left: 2.5rem; border-left: 1px solid rgba(255, 255, 255, 0.2); }
.band-figure { margin: 0; font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.band-figure span { font-size: 1.05rem; font-weight: 500; color: #bcd0ff; letter-spacing: 0; }
.band-label { margin: 0.3rem 0 0; font-size: 0.82rem; color: #cfe0ff; }
.band-bar { display: block; width: 100%; height: 6px; margin-top: 0.55rem; }
.band-bar-track { fill: rgba(255, 255, 255, 0.2); }
.band-bar-fill { fill: #fff; }
.hero-figure-name { font-size: clamp(2rem, 4.5vw, 3.2rem) !important; letter-spacing: -0.03em; }
/* Section tabs: underlined, sitting on the band's bottom edge. */
.hero-tabs { max-width: 73rem; margin: 0 auto; display: flex; gap: 1.6rem; overflow-x: auto; scrollbar-width: none; }
.hero-tabs::-webkit-scrollbar { display: none; }
.hero-tabs a {
  display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; min-height: 44px;
  padding: 0 0 2px; border-bottom: 3px solid transparent;
  font-size: 0.92rem; font-weight: 600; color: #bcd0ff; text-decoration: none;
}
.hero-tabs a span { font-weight: 500; color: #9fb8f5; font-variant-numeric: tabular-nums; }
.hero-tabs a:hover { color: #fff; }
.hero-tabs a[aria-current="page"] { color: #fff; border-bottom-color: #fff; }
.hero-tabs a[aria-current="page"] span { color: #dbe6ff; }
.hero-tabs .type-dot { flex: none; }
.hero-page + main { padding-top: 1.75rem; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin: 0 0 1rem; }
.toolbar input[type="search"] { flex: 1 1 18rem; max-width: 26rem; }
.toolbar .period-form { margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Tables: quieter header, airier rows, rounder card. */
.data-table { border-radius: 16px; border-color: #e8eaf3; box-shadow: 0 1px 2px rgba(14, 30, 110, 0.04), 0 8px 24px rgba(14, 30, 110, 0.05); }
.data-table th {
  background: #fbfbfe; color: var(--muted); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.data-table th[data-dir]::after { color: var(--navy); }
.people-table td { padding-top: 0.8rem; padding-bottom: 0.8rem; }
.data-table td.cell-key { font-weight: 700; }
.data-table .cell-rank { font-weight: 600; color: #9aa3b8; }
.name-cell { display: inline-flex; align-items: center; gap: 0.75rem; }
.avatar-sm {
  width: 2.2rem; height: 2.2rem; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--blue-light), var(--navy)); color: #fff; font-size: 0.76rem; font-weight: 700;
}
.cell-actions { text-align: right; width: 1%; white-space: nowrap; }
.row-actions { display: inline-flex; gap: 0.35rem; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--navy); text-decoration: none;
}
.icon-btn:hover { background: var(--navy); color: #fff; }
.icon-btn svg { width: 16px; height: 16px; }
.lender-chart { border-radius: 16px; margin-bottom: 1.25rem; }

.podium-wide { margin: 0 0 1.25rem; gap: 0.9rem; }
.podium-wide li { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 1.4rem 0.75rem 1.2rem; }
.podium-wide li:hover { background: #fbfcff; border-color: #c9d7fd; }
.podium-wide .person-value { font-size: 1.6rem; }
.podium-wide .person-name { font-size: 1.02rem; }

@media (max-width: 640px) {
  .hero-page .hero-inner { margin-bottom: 1rem; }
  .hero-page { padding: 1.25rem 1rem 0; }
  .hero-tabs { margin: 0 -1rem; padding: 0 1rem; gap: 1.2rem; }
  .band-stats { gap: 1.5rem; }
  .band-stats .band-stat + .band-stat { padding-left: 1.5rem; }
  .data-table:not(.no-cards) td.cell-actions { grid-column: 3; grid-row: 2; text-align: right; width: auto; }
  .podium-wide { gap: 0.4rem; }
  .podium-wide .person-value { font-size: 1.1rem; }
  .podium-wide .person-name { font-size: 0.85rem; }
}
.month-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.month-switch a {
  min-width: 3.1rem; min-height: 34px; padding: 0 0.8rem; border-radius: 999px; display: inline-grid; place-items: center;
  color: #dbe6ff; font-size: 0.88rem; font-weight: 600; text-decoration: none;
}
.month-switch a:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.month-switch a[aria-current="page"] { background: #fff; color: var(--navy); }
