/* ============================================================================
   ATLAS REDESIGN — Brokerage Network screen styles  (reference screen #18)
   Branch: atlas-redesign-2026-06-29 · tokens only (--r-*), both themes.
   Self-contained under .rd-network (shared primitives redeclared, since the
   .rd-card / .rd-eyebrow primitives are scoped per-screen).
   ========================================================================== */

.rd-network { max-width: var(--r-page-max); margin: 0 auto; }

/* shared primitives (scoped) */
.rd-network .rd-eyebrow {
  font-family: var(--r-font-mono); font-size: var(--r-fs-eyebrow);
  letter-spacing: .12em; text-transform: uppercase; color: var(--r-clay);
  margin: 0 0 5px;
}

/* ---- header ------------------------------------------------------------- */
.rd-network__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.rd-network__h1 {
  margin: 0; font-family: var(--r-font-display); font-size: 27px; font-weight: 600;
  letter-spacing: -.01em; color: var(--r-ink);
}
.rd-network__head-r { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.rd-network__pill {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px;
  border-radius: var(--r-radius-control); background: var(--r-mint-surface); color: var(--r-mint-ink);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.rd-network__pill-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--r-good);
  box-shadow: 0 0 0 3px var(--r-mint-surface);
}
.rd-network__add {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: var(--r-radius-control); border: 1px solid var(--r-border);
  background: var(--r-surface); color: var(--r-ink); font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: border-color var(--r-dur), box-shadow var(--r-dur), transform var(--r-dur);
}
.rd-network__add i { font-size: 14px; color: var(--r-primary); }
.rd-network__add:hover { box-shadow: var(--r-shadow-hover); transform: translateY(-1px); border-color: var(--r-hairline-2); }
.rd-network__add:focus-visible { outline: var(--r-focus); outline-offset: 2px; }

/* ---- KPI strip ---------------------------------------------------------- */
.rd-network__kpis { margin-bottom: 24px; }

/* ---- Offices section ---------------------------------------------------- */
.rd-network__offices-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px;
}
.rd-network__offices-title {
  margin: 0; font-family: var(--r-font-display); font-size: 20px; font-weight: 600;
  letter-spacing: -.01em; color: var(--r-ink);
}
.rd-network__offices-hint { font-size: 12px; color: var(--r-muted); }

.rd-network__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch;
}

/* ---- office card -------------------------------------------------------- */
.rd-network__office {
  display: flex; flex-direction: column; text-align: left; font: inherit; cursor: pointer;
  background: var(--r-surface); border: 1px solid var(--r-border); border-radius: 16px;
  padding: 18px 20px; color: var(--r-body); box-shadow: var(--r-shadow-card);
  transition: box-shadow var(--r-dur), transform var(--r-dur), border-color var(--r-dur);
}
.rd-network__office:hover { box-shadow: var(--r-shadow-hover); transform: translateY(-2px); border-color: var(--r-hairline-2); }
.rd-network__office:focus-visible { outline: var(--r-focus); outline-offset: 2px; }

.rd-network__office-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rd-network__office-id { min-width: 0; }
.rd-network__office-name {
  font-family: var(--r-font-display); font-size: 18px; font-weight: 600;
  letter-spacing: -.01em; color: var(--r-ink); line-height: 1.2;
}
.rd-network__office-loc { font-size: 12px; color: var(--r-muted); margin-top: 3px; }

/* ---- health chip (Strong / Steady / Watch + neutral none) --------------- */
.rd-network__health {
  display: inline-flex; flex: none; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  border-radius: var(--r-radius-pill); padding: 3px 9px;
  color: var(--hl); background: var(--hl-bg);
}
.rd-network__health-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hl); }
.rd-network__health--strong { --hl: var(--r-good);  --hl-bg: var(--r-mint-surface); }
.rd-network__health--steady { --hl: var(--r-amber); --hl-bg: var(--r-chip-risk-surface); }
.rd-network__health--watch  { --hl: var(--r-alert); --hl-bg: var(--r-chip-down-surface); }
.rd-network__health--none   { --hl: var(--r-faint); --hl-bg: var(--r-seg-track); }

/* ---- GCI headline (dominant number — the card's clearest scale-contrast) - */
.rd-network__office-gci { display: flex; align-items: baseline; gap: 9px; margin-top: 16px; }
.rd-network__office-gci-v {
  font-family: var(--r-font-display); font-size: 36px; font-weight: 600;
  letter-spacing: -.02em; color: var(--r-ink); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.rd-network__office-gci-l {
  font-family: var(--r-font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--r-faint);
}

/* ---- stats row + autopilot bar ------------------------------------------ */
.rd-network__office-stats {
  display: flex; align-items: flex-end; gap: 18px; margin-top: 16px;
  padding-top: 14px; border-top: 1px solid var(--r-hairline);
}
/* stat + autopilot tiles are their own cross-nav targets (data-goto) nested
   inside the office card — give them their own hover/focus affordance so
   they read as independently actionable, not just part of the card lift. */
.rd-network__stat,
.rd-network__auto {
  cursor: pointer;
  padding: 3px 7px;
  margin: -3px -7px;
  border-radius: 8px;
  transition: background var(--r-dur) var(--r-ease);
}
.rd-network__stat:hover,
.rd-network__auto:hover { background: var(--r-well); }
.rd-network__stat:focus-visible,
.rd-network__auto:focus-visible { outline: var(--r-focus); outline-offset: 2px; }

.rd-network__stat { display: flex; flex-direction: column; gap: 2px; flex: none; }
.rd-network__stat-n { font-size: 16px; font-weight: 600; color: var(--r-ink); line-height: 1; font-variant-numeric: tabular-nums; }
.rd-network__stat-l {
  font-family: var(--r-font-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--r-faint);
}
.rd-network__auto { flex: 1; min-width: 0; }
.rd-network__auto-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.rd-network__auto-l {
  font-family: var(--r-font-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--r-faint);
}
.rd-network__auto-v { font-size: 12px; font-weight: 600; color: var(--r-muted); }
.rd-network__auto-bar { height: 6px; border-radius: 4px; background: var(--r-seg-track); overflow: hidden; }
.rd-network__auto-fill { height: 100%; border-radius: 4px; background: var(--r-primary-2); }

/* ---- open-pulse footer cue ---------------------------------------------- */
.rd-network__office-go {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-size: 12px; font-weight: 600; color: var(--r-primary);
  opacity: 0; transform: translateY(2px);
  transition: opacity var(--r-dur), transform var(--r-dur);
}
.rd-network__office-go i { font-size: 13px; }
.rd-network__office:hover .rd-network__office-go,
.rd-network__office:focus-visible .rd-network__office-go { opacity: 1; transform: translateY(0); }
/* a stat tile has its OWN destination — don't claim "Open Pulse" while it's
   the thing under the pointer/focus. */
.rd-network__office:has(.rd-network__stat:hover) .rd-network__office-go,
.rd-network__office:has(.rd-network__auto:hover) .rd-network__office-go,
.rd-network__office:has(.rd-network__stat:focus-visible) .rd-network__office-go,
.rd-network__office:has(.rd-network__auto:focus-visible) .rd-network__office-go {
  opacity: 0;
  transform: translateY(2px);
}

/* ---- add-office tile ---------------------------------------------------- */
.rd-network__add-tile {
  display: flex; flex-direction: column; justify-content: center; text-align: left; font: inherit;
  cursor: pointer; background: var(--r-surface-2);
  border: 1px dashed var(--r-border); border-radius: 16px; padding: 20px; color: var(--r-body);
  transition: border-color var(--r-dur), background var(--r-dur), transform var(--r-dur);
}
.rd-network__add-tile:hover { border-color: var(--r-primary-2); background: var(--r-canvas-raised); transform: translateY(-2px); }
.rd-network__add-tile:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
.rd-network__add-ic {
  width: 40px; height: 40px; border-radius: 11px; background: var(--r-mint-surface); color: var(--r-mint-ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px;
}
.rd-network__add-name {
  font-family: var(--r-font-display); font-size: 16px; font-weight: 600;
  letter-spacing: -.01em; color: var(--r-ink);
}
.rd-network__add-sub { font-size: 12px; color: var(--r-muted); margin-top: 5px; line-height: 1.45; max-width: 34ch; }

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 1160px) {
  .rd-network__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .rd-network__head { flex-direction: column; align-items: flex-start; }
  .rd-network__grid { grid-template-columns: 1fr; }
  .rd-network__office-stats { flex-wrap: wrap; gap: 14px; }
  .rd-network__auto { flex-basis: 100%; }
}
