/* ============================================================
   Quay 1 x Jambo — Broker Portal
   Shared styles: tokens, layout, components
   ============================================================ */

@font-face {
  font-family: "Gotham";
  src: url("../brand-assets/fonts/Gotham-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gotham";
  src: url("../brand-assets/fonts/Gotham-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gotham";
  src: url("../brand-assets/fonts/Gotham-Book.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* brand */
  --brand-blue: #3c5aa5;
  --brand-blue-700: #2e4680;
  --brand-blue-800: #23365f;
  --brand-blue-100: #e9edf9;
  --brand-blue-50: #f4f6fc;
  --brand-accent: #fdc503;
  --brand-accent-600: #e0ac00;
  --brand-accent-100: #fff6d9;
  --logo-red: #d20a03;
  --logo-red-100: #fbe6e5;
  --logo-skyblue: #98c6ed;
  --logo-skyblue-700: #2d88d2;

  /* semantic */
  --status-pending: var(--brand-accent-600);
  --status-pending-bg: var(--brand-accent-100);
  --status-approved: #1e8e5a;
  --status-approved-bg: #e4f5ec;
  --status-denied: var(--logo-red);
  --status-denied-bg: var(--logo-red-100);

  /* ink */
  --ink: #1b2333;
  --ink-soft: #5b6472;
  --ink-faint: #8b93a3;

  /* surfaces */
  --surface: #ffffff;
  --surface-sunken: #ffffff;
  --border: #e3e7f0;
  --border-soft: #edf0f6;
  --table-line: #c7ced9;

  /* shadows — layered, color-tinted */
  --shadow-sm: 0 1px 2px rgba(61, 91, 166, 0.07), 0 1px 1px rgba(27, 35, 51, 0.04);
  --shadow-md: 0 6px 16px rgba(61, 91, 166, 0.12), 0 2px 6px rgba(27, 35, 51, 0.06);
  --shadow-lg: 0 16px 40px rgba(61, 91, 166, 0.16), 0 6px 14px rgba(27, 35, 51, 0.08);
  --shadow-float: 0 24px 56px rgba(27, 35, 51, 0.22), 0 10px 20px rgba(61, 91, 166, 0.14);

  /* motion */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);

  /* spacing tokens */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface-sunken);
  color: var(--ink);
  font-family: "Gotham", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
}

/* #app-root is the direct flex child of body that needs to grow — .page-content's
   flex:1 alone can't push the footer down since it isn't a direct child of body. */
#app-root {
  display: flex;
  flex-direction: column;
  flex: 1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

/* ---------- Typography ---------- */

.title {
  text-transform: uppercase;
  font-family: "Gotham", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  margin: 0;
}

/* Hand-drawn squiggle underline — matches the reference site's Squarespace
   text-highlight decoration: same stroke color (#98c6ed, effectively
   identical to --logo-skyblue) and the same stroke-linecap:square /
   stroke-linejoin:bevel treatment. Squarespace generates a unique
   randomized wobble per instance rather than reusing one fixed asset, so
   these two variants (single pass / the reference's "drawn twice" layered
   look) are hand-authored in that style — alternate between them when a
   page has more than one white-background heading.

   Rendered as a real inline <svg><path> (not a background-image) so it can
   "draw itself" with stroke-dasharray/stroke-dashoffset: each path starts
   fully undrawn and js/squiggle.js's IntersectionObserver adds .is-visible
   once the heading has scrolled well into the viewport (not merely peeking
   in at the bottom edge), which is what triggers the reveal transition. */
.title--squiggle {
  display: inline-block;
  position: relative;
  padding-bottom: 16px;
}

.title__squiggle-svg {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 16px;
  overflow: visible;
  pointer-events: none;
}

.title__squiggle-svg path {
  fill: none;
  stroke: #98c6ed;
  stroke-width: 6;
  stroke-linecap: square;
  stroke-linejoin: bevel;
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  /* linear, not --ease-smooth: that curve is heavily front-loaded (most of
     the line draws in the first half, then crawls the rest of the way to
     0), which reads as an almost-instant snap rather than a hand drawing
     at a steady pace. */
  transition: stroke-dashoffset 1.6s linear;
}

.title--squiggle.is-visible .title__squiggle-svg path {
  stroke-dashoffset: 0;
}

/* The second stroke of the double-pass variant starts its draw-on a beat
   after the first, echoing a hand re-tracing the line. */
.title__squiggle-svg path:nth-child(2) {
  transition-delay: 0.36s;
}

@media (prefers-reduced-motion: reduce) {
  .title__squiggle-svg path {
    stroke-dashoffset: 0;
    transition: none;
  }
}

.subtitle {
  font-family: "Gotham", sans-serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  font-family: "Gotham", sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--brand-blue);
  margin: 0;
}

p {
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- Layout shell ---------- */

.page-content {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-5);
}

.container-narrow {
  max-width: 480px;
  margin: 0 auto;
}

/* ---------- Nav ---------- */

/* Sticky lives on #app-nav (the actual flex item in body), not on .site-nav
   itself — a sticky element whose immediate parent is a shrink-wrapped flex
   item with no extra height has no room to stick and silently no-ops. */
#app-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: transparent;
}

.site-nav {
  isolation: isolate;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(27, 35, 51, 0.06);
  max-width: 100%;
  margin: 0 auto;
  border-radius: 0;
  transition: max-width 0.35s var(--ease-smooth), margin 0.35s var(--ease-smooth),
    border-radius 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
}

/* Collapses the full-width bar into a floating pill once the page has
   scrolled past the top — toggled by layout.js's scroll listener. */
.site-nav.is-scrolled {
  max-width: 1100px;
  margin: 14px auto 0;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 30px rgba(27, 35, 51, 0.14), 0 2px 10px rgba(27, 35, 51, 0.08);
}

.site-nav__inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--space-5);
  height: 84px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-5);
  transition: height 0.35s var(--ease-smooth);
}

.site-nav.is-scrolled .site-nav__inner {
  height: 66px;
}

.site-nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  justify-self: start;
}

.site-nav__brand img {
  height: 40px;
  width: auto;
  display: block;
}

/* Quay 1's mark is a reversed (white-text) lockup — it needs a dark
   chip behind it whenever it sits on a light surface (nav, footer, login form side). */
.brand-badge {
  display: inline-flex;
  align-items: center;
  background: var(--brand-blue-800);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  box-shadow: var(--shadow-sm);
}

/* flex-shrink:0 on all three pieces of the lockup: without it, a squeezed
   nav shrinks the fixed-size badge span (width/height set, so only its
   width gives — cropping the flag) while the plain <img> shrinks cleanly
   (replaced elements keep their aspect ratio), so the two logos drifted out
   of sync. Pinning both to their natural size keeps them shrinking (i.e.
   not shrinking) together instead. */
.site-nav__brand .brand-badge {
  padding: 0;
  overflow: hidden;
  width: 74px;
  height: 34px;
  flex-shrink: 0;
}

.site-nav__brand .brand-badge img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.site-nav__brand-amp {
  font-family: "Gotham", sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.site-nav__brand-jambo {
  height: 32px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  justify-self: center;
}

.site-nav__link {
  position: relative;
  text-decoration: none;
  font-family: "Gotham", sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  padding: 10px 4px;
  margin: 0 var(--space-3);
  transition: color 0.2s var(--ease-smooth);
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--logo-skyblue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-spring);
}

.site-nav__link:hover {
  color: var(--ink);
}

.site-nav__link:hover::after {
  transform: scaleX(1);
}

.site-nav__link:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 3px;
  border-radius: 3px;
}

.site-nav__link.is-active {
  color: var(--brand-blue);
  font-weight: 700;
}

.site-nav__link.is-active::after {
  transform: scaleX(1);
}

.site-nav__right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  justify-self: end;
}

.site-nav__user {
  text-align: right;
  line-height: 1.25;
}

.site-nav__user-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
}

.site-nav__user-role {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

/* Same blue as the hero, on hover, for the logout button specifically
   (not a sitewide .btn-ghost change). */
.btn-ghost.site-nav__logout:hover {
  background: var(--logo-skyblue);
  border-color: var(--logo-skyblue);
  color: #fff;
}

.site-nav__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

.site-nav__menu-btn:hover {
  background: var(--brand-blue-50);
}

.site-nav__menu-btn:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.site-nav__menu-icon-bar {
  transition: transform 0.2s var(--ease-smooth), opacity 0.2s var(--ease-smooth);
  transform-origin: center;
}

.site-nav__menu-btn.is-open .site-nav__menu-icon-bar--top {
  transform: translateY(5px) rotate(45deg);
}

.site-nav__menu-btn.is-open .site-nav__menu-icon-bar--mid {
  opacity: 0;
}

.site-nav__menu-btn.is-open .site-nav__menu-icon-bar--bot {
  transform: translateY(-5px) rotate(-45deg);
}

.site-nav__mobile-panel {
  display: none;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-5) var(--space-4);
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
}

.site-nav__mobile-panel[hidden] {
  display: none;
}

.site-nav__mobile-links {
  display: flex;
  flex-direction: column;
}

.site-nav__mobile-links .site-nav__link {
  margin: 0;
  padding: var(--space-3) 0;
}

.site-nav__mobile-links .site-nav__link::after {
  display: none;
}

.site-nav__mobile-logout {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.site-nav__mobile-logout:hover {
  background: var(--logo-skyblue);
  color: #fff;
  border-radius: var(--radius-sm);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--logo-skyblue);
  padding: var(--space-6) var(--space-5);
}

.site-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

.site-footer__partnership {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3) var(--space-4);
}

.site-footer__partnership img.footer-logo-jambo {
  height: 27px;
  width: auto;
}

/* The footer mark links out to the Jambo site — plain opacity fade,
   no color shift needed since the mark is single-color already. */
.site-footer__logo-link {
  display: inline-flex;
  transition: opacity 0.15s ease;
}

.site-footer__logo-link:hover {
  opacity: 0.8;
}

.site-footer__logo-link:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.site-footer__copyright {
  width: 100%;
  text-align: center;
  margin: var(--space-4) 0 0;
  font-size: 12px;
  color: #fff;
  opacity: 0.85;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: "Gotham", sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  border-radius: var(--radius-pill);
  padding: 12px 24px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s var(--ease-smooth), background-color 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth), border-color 0.2s var(--ease-smooth);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--brand-blue);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--brand-blue-700);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--brand-blue-800);
  outline-offset: 2px;
}

/* Pending-count signal — hidden until JS fills in a >0 count. Corner
   variant sits on a button (which needs position:relative); nav variant
   sits inline right after a nav link's label. */
.notif-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--logo-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border-radius: var(--radius-pill);
}

.notif-badge--corner {
  position: absolute;
  top: -8px;
  right: -8px;
  box-shadow: 0 0 0 2px #fff;
}

.notif-badge--nav {
  margin-left: 6px;
  vertical-align: 2px;
}

.btn-accent {
  background: var(--logo-skyblue);
  color: #fff;
  box-shadow: 0 6px 16px rgba(105, 162, 255, 0.28), 0 2px 6px rgba(27, 35, 51, 0.08);
}

.btn-accent:hover {
  background: var(--logo-skyblue-700);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(105, 162, 255, 0.36), 0 4px 10px rgba(27, 35, 51, 0.1);
}

.btn-accent:focus-visible {
  outline: 2px solid var(--brand-blue-800);
  outline-offset: 2px;
}

.btn-ghost {
  background: transparent;
  color: var(--brand-blue);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--brand-blue-50);
  border-color: var(--brand-blue-100);
  transform: translateY(-2px);
}

.btn-ghost:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.btn-danger {
  background: var(--surface);
  color: var(--logo-red);
  border-color: var(--logo-red-100);
}

.btn-danger:hover {
  background: var(--logo-red-100);
  transform: translateY(-2px);
}

.btn-danger:focus-visible {
  outline: 2px solid var(--logo-red);
  outline-offset: 2px;
}

.btn-success {
  background: var(--surface);
  color: var(--status-approved);
  border-color: var(--status-approved-bg);
}

.btn-success:hover {
  background: var(--status-approved-bg);
  transform: translateY(-2px);
}

.btn-success:focus-visible {
  outline: 2px solid var(--status-approved);
  outline-offset: 2px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-icon {
  padding: 12px;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-block {
  width: 100%;
}

/* ---------- Surfaces / depth system ---------- */

.surface-base {
  background: var(--surface-sunken);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-smooth);
}

.card-elevated {
  box-shadow: var(--shadow-lg);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-floating {
  box-shadow: var(--shadow-float);
}

/* ---------- Hero (dashboard) ---------- */

/* A true full-bleed hero band — spans the viewport edge to edge, sits flush
   under the nav, and caps off with a straight line, rather than floating
   inset as a rounded card like the rest of the dashboard's cards. It's
   already a direct child of #app-root (which has no width constraint of
   its own), so it's full-bleed by default — no 100vw/negative-margin trick
   needed, and that trick was the cause of a horizontal scrollbar: 100vw
   includes the scrollbar's own width in most browsers, so on a page tall
   enough to scroll vertically, the hero ended up wider than the visible
   viewport. */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--logo-skyblue);
}

.hero__content {
  position: relative;
  padding: var(--space-7) var(--space-7);
  max-width: 640px;
  text-align: center;
}

/* flying_cash_recolored.svg is a transparent currentColor icon (defined once
   as a <symbol> and referenced via <use>) — tinted solid white so it sits on
   the hero's solid blue fill without any background card. */
.hero__decor--cash,
.hero__decor--cash-2 {
  position: absolute;
  color: #fff;
  z-index: 1;
}

.hero__decor--cash svg,
.hero__decor--cash-2 svg {
  display: block;
  width: 100%;
  height: auto;
}

.hero__decor--cash {
  top: 36px;
  right: 5%;
  width: 236px;
  animation: cash-wiggle-right 1.4s ease-in-out 0.5s 1 both;
}

.hero__decor--cash-2 {
  bottom: 32px;
  left: 4%;
  width: 177px;
  /* Starts once the right-hand icon's wiggle has finished (0.5s delay + 1.4s
     duration) so the two play one after the other, not together. */
  animation: cash-wiggle-left 1.4s ease-in-out 1.9s 1 both;
}

@keyframes cash-wiggle-right {
  0% { transform: rotate(7deg); }
  10% { transform: rotate(-3deg); }
  30% { transform: rotate(17deg); }
  50% { transform: rotate(-3deg); }
  70% { transform: rotate(17deg); }
  90%, 100% { transform: rotate(7deg); }
}

@keyframes cash-wiggle-left {
  0% { transform: scaleX(-1) rotate(8deg); }
  10% { transform: scaleX(-1) rotate(-2deg); }
  30% { transform: scaleX(-1) rotate(18deg); }
  50% { transform: scaleX(-1) rotate(-2deg); }
  70% { transform: scaleX(-1) rotate(18deg); }
  90%, 100% { transform: scaleX(-1) rotate(8deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__decor--cash {
    animation: none;
    transform: rotate(7deg);
  }
  .hero__decor--cash-2 {
    animation: none;
    transform: scaleX(-1) rotate(8deg);
  }
}

@media (max-width: 860px) {
  /* Both icons at full size would overlap the centered hero text on a
     narrow screen — shrink and tuck both into their corners instead of
     hiding either one. */
  .hero__decor--cash {
    top: 16px;
    right: 3%;
    width: 110px;
  }
  .hero__decor--cash-2 {
    bottom: 14px;
    left: 3%;
    width: 90px;
  }
}

.hero__eyebrow {
  color: #fff;
  text-transform: uppercase;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.16em;
}

.hero .title {
  color: #fff;
  font-size: clamp(28px, 4vw, 44px);
  margin-top: var(--space-2);
}

.hero p {
  color: rgba(255, 255, 255, 0.85);
  margin: var(--space-3) auto 0;
  max-width: 46ch;
}

/* ---------- Stat cards ---------- */

/* No margin-top: this is always the first element in .page-content on the
   dashboard, so the top gap comes from the container's own padding — kept
   equal to its bottom padding so the gap under the hero matches the gap
   above the footer. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-4);
}

.stat-card {
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.stat-card__value {
  font-family: "Gotham", sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--brand-blue);
  margin-top: var(--space-2);
  white-space: nowrap;
}

.stat-card__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  font-weight: 500;
}

.stat-card--accent .stat-card__value { color: var(--logo-skyblue-700); }
.stat-card--danger .stat-card__value { color: var(--logo-red); }
.stat-card--success .stat-card__value { color: var(--status-approved); }

/* ---------- Quick actions ---------- */

.action-grid {
  display: grid;
  /* 280px min-basis caps this at 3 columns even at the page's max content
     width (1180px) — a 4th would need more room than that leaves. */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.action-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  padding-right: 90px;
  padding-bottom: var(--space-7);
  overflow: hidden;
}

.action-card__icon {
  position: absolute;
  right: -70px;
  bottom: -70px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--brand-blue-100);
  color: var(--brand-blue);
  box-shadow: var(--shadow-md);
  transition: transform 0.25s var(--ease-spring), background-color 0.25s var(--ease-smooth);
}

.action-card__icon svg {
  position: absolute;
  top: 23px;
  left: 23px;
  width: 84px;
  height: 84px;
}

.action-card:hover .action-card__icon {
  background: var(--logo-skyblue);
  color: #fff;
  transform: scale(1.08) rotate(-4deg);
}

.action-card__title {
  font-family: "Gotham", sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.action-card__desc {
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- Section headers ---------- */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.section-head .title {
  font-size: 24px;
}

.section-head__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: help;
  transition: border-color 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth);
}

.help-tip:hover,
.help-tip:focus-visible {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  outline: none;
}

.help-tip::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  max-width: 220px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s var(--ease-smooth), transform 0.15s var(--ease-smooth);
  z-index: 20;
}

.help-tip:hover::after,
.help-tip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-4);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

label {
  font-family: "Gotham", sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
}

.field-hint {
  font-size: 12px;
  color: var(--ink-faint);
}

.input-prefix {
  position: relative;
}

.input-prefix__symbol {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Gotham", sans-serif;
  font-weight: 500;
  color: var(--ink-faint);
  pointer-events: none;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="file"],
select,
textarea {
  font-family: "Gotham", sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

textarea {
  resize: vertical;
  min-height: 90px;
  font-family: "Gotham", sans-serif;
}

.input-prefix input {
  padding-left: 32px;
}

input[type="file"] {
  padding: 8px;
  color: var(--ink-faint);
  font-size: 13px;
  cursor: pointer;
}

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  font-family: "Gotham", sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--brand-blue);
  background: var(--brand-blue-50);
  border: 1.5px solid var(--brand-blue-100);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  margin-right: 12px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-smooth), border-color 0.2s var(--ease-smooth), transform 0.15s var(--ease-spring);
}

input[type="file"]:hover::file-selector-button,
input[type="file"]:hover::-webkit-file-upload-button {
  background: var(--brand-blue-100);
  transform: translateY(-1px);
}

input[type="file"]:focus-visible::file-selector-button,
input[type="file"]:focus-visible::-webkit-file-upload-button {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px var(--brand-blue-100);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-faint);
}

.form-divider {
  border: none;
  border-top: 1px solid #000;
  margin: var(--space-5) 0;
}

/* ---------- Roadmap / stage tracker ---------- */
.roadmap {
  display: flex;
  align-items: flex-start;
  min-width: 560px;
}

.roadmap__node {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 4px;
}

/* connector line: sits behind the dot, joining this node to the previous one */
.roadmap__node:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 17px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.roadmap__node.is-done:not(:first-child)::before,
.roadmap__node.is-current:not(:first-child)::before {
  background: var(--brand-blue);
}

.roadmap__dot {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Gotham", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-faint);
}

.roadmap__node.is-done .roadmap__dot {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}

.roadmap__node.is-current .roadmap__dot {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  box-shadow: 0 0 0 4px var(--brand-blue-100);
}

.roadmap__label {
  margin-top: 8px;
  min-height: 34px; /* keeps dates aligned when a label wraps to 2 lines */
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-soft);
}

.roadmap__node.is-current .roadmap__label {
  color: var(--brand-blue);
}

.roadmap__date {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-faint);
  min-height: 13px;
}

/* Fit all 6 nodes on a phone without horizontal scroll. Circles stay on a
   single straight line; labels alternate above / below so each one has
   room. Less card padding keeps the circles a decent size. */
@media (max-width: 640px) {
  .roadmap-card {
    padding: var(--space-4) var(--space-2);
  }
  .roadmap {
    min-width: 0;
  }
  .roadmap__node {
    position: relative;
    justify-content: center;
    min-height: 128px;
    padding: 0;
  }
  .roadmap__dot {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
  /* connector line runs through the centred dots */
  .roadmap__node:not(:first-child)::before {
    top: 50%;
    margin-top: -1px;
  }
  .roadmap__label,
  .roadmap__date {
    position: absolute;
    left: -2px;
    right: -2px;
    margin: 0;
    min-height: 0;
  }
  .roadmap__label {
    font-size: 10px;
  }
  .roadmap__date {
    font-size: 9px;
    white-space: nowrap;
  }
  /* odd nodes (1st, 3rd, 5th): label + date below the circle */
  .roadmap__node:nth-child(odd) .roadmap__label {
    top: calc(50% + 21px);
  }
  .roadmap__node:nth-child(odd) .roadmap__date {
    top: calc(50% + 49px);
  }
  /* even nodes (2nd, 4th, 6th): label + date above the circle */
  .roadmap__node:nth-child(even) .roadmap__date {
    bottom: calc(50% + 22px);
  }
  .roadmap__node:nth-child(even) .roadmap__label {
    bottom: calc(50% + 36px);
  }
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.checkbox-field input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-field__box {
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: background-color 0.2s var(--ease-smooth), border-color 0.2s var(--ease-smooth);
}

.checkbox-field__box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s var(--ease-spring);
}

.checkbox-field input:checked + .checkbox-field__box {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}

.checkbox-field input:checked + .checkbox-field__box::after {
  transform: rotate(45deg) scale(1);
}

.checkbox-field input:focus-visible + .checkbox-field__box {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.checkbox-field__text {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.form-error {
  font-size: 13px;
  color: var(--logo-red);
  margin-top: var(--space-2);
  display: none;
}

.form-error.is-visible {
  display: block;
}

.form-success {
  font-size: 13px;
  color: var(--status-approved);
  margin-top: var(--space-2);
  display: none;
}

.form-success.is-visible {
  display: block;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 4px;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending);
}

.badge-approved {
  background: var(--status-approved-bg);
  color: var(--status-approved);
}

.badge-denied {
  background: var(--status-denied-bg);
  color: var(--status-denied);
}

.badge-role {
  background: var(--brand-blue-100);
  color: var(--brand-blue);
}

/* ---------- Table ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--table-line);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

thead th {
  text-align: left;
  font-family: "Gotham", sans-serif;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  padding: 9px 14px;
  border-bottom: 1px solid var(--table-line);
  border-right: 1px solid var(--table-line);
  background: var(--surface-sunken);
  white-space: nowrap;
}

thead th:last-child {
  border-right: none;
}

.col-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s var(--ease-smooth), background-color 0.15s var(--ease-smooth);
}

.col-sortable:hover {
  color: var(--brand-blue);
  background: var(--brand-blue-50);
}

.sort-indicator {
  display: inline-block;
  margin-left: 4px;
  color: var(--brand-blue);
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--table-line);
  border-right: 1px solid var(--table-line);
  font-size: 14px;
  color: var(--ink);
  vertical-align: middle;
}

tbody td:last-child {
  border-right: none;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background-color 0.2s var(--ease-smooth);
}

tbody tr:nth-child(even) {
  background: rgba(27, 35, 51, 0.035);
}

tbody tr:hover {
  background: var(--brand-blue-100);
}

tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--brand-blue);
}

.row-clickable:active {
  background: rgba(60, 90, 165, 0.22);
}

.cell-muted {
  color: var(--ink-soft);
  font-size: 13px;
}

.status-cell {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.status-cell-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending);
}

.status-cell-approved {
  background: var(--status-approved-bg);
  color: var(--status-approved);
}

.status-cell-denied {
  background: var(--status-denied-bg);
  color: var(--status-denied);
}

.clients-table {
  table-layout: fixed;
  width: 100%;
}

/* Broker/Status/Submitted stay a fixed size; Client, Division and Budget
   have no explicit width so table-layout:fixed splits the remaining space
   between them evenly, filling the full table width with no leftover gap. */
.clients-table .col-broker { width: 170px; }
.clients-table .col-status { width: 110px; }
.clients-table .col-submitted { width: 120px; }

/* Below this, a 6-column table is unreadable even with horizontal scroll —
   turn each row into a stacked card of label/value pairs instead. */
@media (max-width: 640px) {
  .table-wrap {
    overflow-x: visible;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .clients-table,
  .clients-table .col-broker,
  .clients-table .col-status,
  .clients-table .col-submitted {
    min-width: 0;
    width: auto;
  }

  .clients-table,
  .clients-table thead,
  .clients-table tbody,
  .clients-table tr,
  .clients-table td {
    display: block;
    width: auto;
  }

  .clients-table thead {
    display: none;
  }

  .clients-table tbody tr {
    margin-bottom: var(--space-4);
    border: 1px solid var(--table-line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  .clients-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .clients-table tbody tr:nth-child(even) {
    background: var(--surface);
  }

  .clients-table tbody tr:hover td:first-child {
    box-shadow: none;
  }

  .clients-table tbody td {
    border-right: none;
    white-space: normal;
    text-align: left;
  }

  .clients-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-family: "Gotham", sans-serif;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-faint);
    margin-bottom: 3px;
  }

  .clients-table tbody .col-client {
    background: var(--surface-sunken);
    font-weight: 500;
  }

  .clients-table .cell-truncate {
    overflow: visible;
    text-overflow: clip;
  }
}

.cell-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-clickable {
  cursor: pointer;
}

.row-clickable:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: -2px;
}

.cell-actions {
  display: flex;
  gap: var(--space-2);
}

/* ---------- Division chips (divisions.html) ---------- */

.area-group {
  margin-bottom: var(--space-5);
}

.area-group__name {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.area-group__name .subtitle {
  font-size: 15px;
}

.area-group__count {
  font-size: 12px;
  color: var(--ink-faint);
  background: var(--surface-sunken);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-blue-800);
  background: var(--brand-blue-50);
  border: 1px solid var(--brand-blue-100);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  transition: transform 0.2s var(--ease-spring), background-color 0.2s var(--ease-smooth);
}

.chip:hover {
  background: var(--brand-blue-100);
  transform: translateY(-1px);
}

/* Flags a division name that appears under more than one area in a CSV
   preview — the upload is blocked until these are resolved. */
.chip--error {
  color: var(--status-denied);
  background: var(--status-denied-bg);
  border-color: var(--status-denied);
}

/* CSV preview diff: a division name not currently in the list — will be
   inserted on upload. */
.chip--added {
  color: var(--status-approved);
  background: var(--status-approved-bg);
  border-color: var(--status-approved);
}

/* CSV preview diff: a division currently in the list but missing from the
   uploaded file. Shown for visibility only — uploads never delete
   divisions, so this one is kept exactly as-is. */
.chip--removed {
  color: var(--status-denied);
  background: var(--status-denied-bg);
  border-color: var(--status-denied);
  text-decoration: line-through;
}

/* ---------- Account search dropdown (Division Brokers "Add broker") ---------- */

.broker-suggest {
  position: relative;
}

.broker-suggest__menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  padding: var(--space-2) 0;
}

.broker-suggest__menu.is-open {
  display: block;
}

.broker-suggest__item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 7px 14px;
  cursor: pointer;
  transition: background-color 0.15s var(--ease-smooth);
}

.broker-suggest__item:hover {
  background: var(--brand-blue-50);
}

.broker-suggest__item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.broker-suggest__item-email {
  font-size: 12px;
  color: var(--ink-faint);
}

/* ---------- Upload dropzone ---------- */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  background: var(--brand-blue-50);
  transition: border-color 0.2s var(--ease-smooth), background-color 0.2s var(--ease-smooth);
  cursor: pointer;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--brand-blue);
  background: var(--brand-blue-100);
}

.dropzone__icon {
  font-size: 28px;
  color: var(--brand-blue);
}

/* ---------- Login page ---------- */

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.login-visual {
  position: relative;
  background: var(--logo-skyblue);
  display: flex;
  align-items: flex-end;
  padding: var(--space-8);
}

.login-visual__quote {
  color: #fff;
  max-width: 420px;
}

.login-visual__quote .eyebrow {
  color: #fff;
}

.login-visual__quote .subtitle {
  color: #fff;
  font-size: 20px;
  line-height: 1.5;
  font-weight: 700;
}

.login-visual__quote p {
  color: rgba(255, 255, 255, 0.85);
  margin-top: var(--space-3);
}

/* Anchored by `bottom` off the same center point as .login-visual__cash
   (rather than a `top` %) so it sits a fixed gap above the icon
   regardless of viewport height: icon is 200px wide / ~150px tall, so
   half its height (75px) plus a breathing-room gap (~24px) = 100px. */
.login-visual__cta {
  position: absolute;
  left: 50%;
  bottom: calc(50% + 100px);
  transform: translateX(-50%);
  text-align: center;
  color: #fff;
}

.login-visual__cta-text {
  font-family: "Gotham", sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
  margin: 0;
  white-space: nowrap;
}

/* Same icon/wiggle treatment as the dashboard hero's flying-cash decor
   (see .hero__decor--cash / @keyframes cash-wiggle-right) — reused here
   since this panel is now a solid-color hero in the same style. */
.login-visual__cash {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  color: #fff;
  transform: translate(-50%, -50%);
}

/* Centering translate lives on the wrapper above; the wiggle's own
   rotate() animates the svg instead so the two transforms don't clobber
   each other. */
.login-visual__cash svg {
  display: block;
  width: 100%;
  height: auto;
  animation: cash-wiggle-right 1.4s ease-in-out 0.6s 1 both;
}

@media (prefers-reduced-motion: reduce) {
  .login-visual__cash svg {
    animation: none;
    transform: rotate(7deg);
  }
}

.login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--surface);
}

.login-card {
  width: 100%;
  max-width: 380px;
}

/* Jambo sign-in logo (brand-assets/jambo-logo.svg). */
.login-card__brands {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.login-card__brand-logo {
  height: 48px;
  width: auto;
  display: block;
}

.login-card .title {
  font-size: 26px;
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.login-card .subtitle {
  color: var(--ink-soft);
  font-weight: 400;
  font-size: 14px;
  text-align: center;
  margin-top: var(--space-2);
  margin-bottom: var(--space-6);
}

@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-visual {
    display: none;
  }
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 27, 46, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 100;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-float);
  animation: modal-in 0.28s var(--ease-spring);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-5);
  color: var(--ink-faint);
}

.empty-state__icon {
  font-size: 32px;
  margin-bottom: var(--space-3);
}

/* ---------- Charts (stats page) — dataviz skill palette, scoped ---------- */

.viz-root {
  color-scheme: light;
  --viz-surface: #ffffff;
  --viz-text-primary: #0b0b0b;
  --viz-text-secondary: #52514e;
  --viz-text-muted: #898781;
  --viz-gridline: #e1e0d9;
  --viz-axis: #c3c2b7;
  --viz-series-1: #2a78d6;
}

/* An explicit 2-column track (not auto-fit/minmax) so the two line-chart
   cards are always exactly equal width. auto-fit's column count depends on
   .stats-grid's own (container) width, while the old media query below
   toggled off viewport width — those two didn't always agree, so in the
   gap between them the grid tried to lay out a 2-span wide card inside a
   1-column track and the charts came out uneven. Single breakpoint now
   drives both the column count and the wide card's span. */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.chart-card--wide {
  grid-column: span 2;
}

@media (max-width: 920px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .chart-card--wide {
    grid-column: span 1;
  }
}

.chart-card__head {
  margin-bottom: var(--space-4);
  text-align: center;
}

.chart-card__title {
  font-size: 15px;
}

.chart-card__head--filterable {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  text-align: left;
}

.chart-card__head--filterable select {
  width: auto;
  min-width: 160px;
}

.chart-card__subtitle {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 2px;
}

.chart-body {
  position: relative;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-svg text {
  font-family: "Gotham", sans-serif;
}

.chart-gridline {
  stroke: var(--viz-gridline);
  stroke-width: 1;
}

.chart-axis-label {
  fill: var(--viz-text-muted);
  font-size: 10px;
}

.chart-line {
  fill: none;
  stroke: var(--viz-series-1);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: var(--viz-series-1);
  opacity: 0.1;
}

.chart-end-label {
  fill: var(--viz-text-primary);
  font-size: 12px;
  font-weight: 500;
}

.chart-crosshair {
  stroke: var(--viz-axis);
  stroke-width: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
}

.chart-hover-dot {
  fill: var(--viz-series-1);
  stroke: var(--viz-surface);
  stroke-width: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
}

.chart-hit-rect {
  fill: transparent;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--viz-text-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.1s;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  z-index: 10;
}

.chart-tooltip.is-visible {
  opacity: 1;
}

.chart-tooltip__value {
  font-weight: 700;
  font-size: 14px;
}

.chart-tooltip__label {
  color: rgba(255, 255, 255, 0.7);
}

.chart-pie-slice {
  stroke: var(--viz-surface);
  stroke-width: 2;
  cursor: pointer;
  transition: opacity 0.15s;
}

.chart-pie-slice-label {
  font-size: 11px;
  font-weight: 500;
  pointer-events: none;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
  justify-content: center;
}

.chart-pie-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 192px;
  flex-wrap: wrap;
}

.chart-legend--side {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: var(--space-3);
  margin-top: 0;
  justify-content: center;
}

.chart-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}

.chart-legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.chart-table-toggle {
  background: none;
  border: none;
  padding: 0;
  margin-top: var(--space-4);
  font-family: "Gotham", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-blue);
  cursor: pointer;
  text-decoration: underline;
}

.chart-table-toggle:hover {
  color: var(--brand-blue-700);
}

.chart-table {
  margin-top: var(--space-3);
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  display: none;
}

.chart-table.is-visible {
  display: table;
}

.chart-table th,
.chart-table td {
  text-align: left;
  padding: 6px 10px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.chart-table th {
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  font-size: 10px;
  white-space: normal;
}

/* ---------- Filters bar ---------- */

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  align-items: center;
}

.filters-bar select,
.filters-bar input {
  width: auto;
  min-width: 160px;
}

/* ---------- Utility ---------- */

.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.items-center { align-items: center; }

.attachment-link {
  color: var(--brand-blue);
  font-weight: 500;
  text-decoration: underline;
}

.attachment-link:hover {
  color: var(--brand-blue-700);
}
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }

.skeleton {
  background: linear-gradient(90deg, var(--border-soft) 25%, var(--border) 50%, var(--border-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.auth-loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .site-nav__links {
    display: none;
  }
  /* With .site-nav__links gone from the grid, auto-placement would shift
     .site-nav__right into the now-vacant middle ("auto") track and squeeze
     .site-nav__brand's track down below the logo's natural width — that's
     what was squishing it. Two explicit tracks (brand content-sized, right
     side taking the rest) keeps the logo at full size and the user info +
     menu button pinned to the right edge. */
  .site-nav__inner {
    grid-template-columns: auto 1fr;
  }
  .site-nav__logout {
    display: none;
  }
  .site-nav__menu-btn {
    display: inline-flex;
  }
  .site-nav__mobile-panel:not([hidden]) {
    display: flex;
  }
  .page-content {
    padding: var(--space-6) var(--space-4);
  }
  .hero__content {
    padding: var(--space-6) var(--space-5);
  }
  .site-footer {
    padding: var(--space-5) var(--space-4);
  }
  .site-footer__partnership {
    gap: var(--space-2) var(--space-3);
  }
  .site-footer__partnership .brand-badge {
    width: 52px;
    height: 24px;
  }
  .site-footer__partnership img.footer-logo-jambo {
    height: 22px;
  }
}
