/* ============================================================
   PEAK OS — design system
   PEAK Health & Wellness Center · Coeur d'Alene · Hayden · Post Falls
   Tokens lifted from their own Elementor theme: warm near-black #25201c,
   bone #eae9e4, bronze #b06b00, gold #d19900, taupe #675d53, Montserrat.
   Their mark is a WHITE knockout, which is why the shell is warm charcoal
   rather than light — the logo dictates the surface, not the other way round.
   ============================================================ */

:root {
  /* brand — bronze is action, gold is money, never a surface */
  --ink:       #25201c;
  --ink-2:     #322b26;
  --ink-3:     #423931;
  --ink-t:     #A79C91;
  --ink-t2:    #7C7268;

  --bronze:    #b06b00;
  --bronze-hi: #c87d0a;
  --bronze-dp: #8a5400;
  --bronze-1:  #FBF3E6;
  --bronze-2:  #F2E2C6;
  --bronze-3:  #E2C79A;
  --gold:      #d19900;
  --gold-1:    #FDF6E3;

  /* status */
  --ok:      #2F7D52;  --ok-1:   #E9F4ED;
  --warn:    #A9760B;  --warn-1: #FCF3E1;
  --bad:     #B23A26;  --bad-1:  #F9EAE6;
  --info:    #3D5F8A;  --info-1: #EBF0F7;

  /* neutrals — warm, to match the brand rather than a cold grey SaaS */
  --canvas:   #F5F3F0;
  --surface:  #FFFFFF;
  --surface-2:#FBFAF8;
  --bone:     #eae9e4;
  --border:   #E4E0D9;
  --border-2: #EEEBE5;
  --border-3: #F4F2ED;
  --text:     #241F1B;
  --text-2:   #5E564E;
  --text-3:   #8C8378;

  --r-xs: 4px; --r-sm: 6px; --r: 9px; --r-lg: 13px; --r-xl: 18px;
  --sh-1: 0 1px 2px rgba(37,32,28,.06), 0 1px 1px rgba(37,32,28,.04);
  --sh-2: 0 2px 6px rgba(37,32,28,.07), 0 1px 2px rgba(37,32,28,.05);
  --sh-3: 0 12px 32px rgba(37,32,28,.14), 0 2px 8px rgba(37,32,28,.06);
  --rail-w: 15.5rem;
  --rail-w-c: 4.25rem;
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 13.5px; line-height: 1.5;
  color: var(--text); background: var(--canvas);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -.018em; }
h1 { font-size: 21px; }
h3 { font-size: 14px; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--bronze-2); }
.ic { width: 15px; height: 15px; flex: 0 0 auto; vertical-align: -2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D6D0C6; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }

/* ============================================================ demo banner */
.demo-flag {
  display: flex; align-items: center; gap: 9px; padding: 7px 16px;
  background: var(--ink); color: #CBC0B4; font-size: 11.5px;
}
.demo-flag .ic { color: var(--gold); }
.demo-flag b { color: #fff; font-weight: 600; }

/* ============================================================ shell */
.app { display: flex; height: calc(100vh - 30px); overflow: hidden; }
.rail {
  width: var(--rail-w); flex: 0 0 var(--rail-w); background: var(--ink);
  display: flex; flex-direction: column; transition: width .18s ease, flex-basis .18s ease;
  position: relative; z-index: 40;
}
.app.rail-collapsed .rail { width: var(--rail-w-c); flex-basis: var(--rail-w-c); }

.rail-brand { display: flex; flex-direction: column; align-items: flex-start; padding: 17px 15px 13px; }
/* PEAK's mark is white artwork, so it sits directly on the charcoal — no plate needed */
.brand-lockup { width: 132px; height: auto; display: block; }
.brand-mark { width: 30px; height: auto; display: none; }
.brand-os {
  display: block; color: var(--ink-t2); font-size: 8.5px; letter-spacing: .18em;
  text-transform: uppercase; font-weight: 700; margin-top: 9px; padding-left: 2px;
}
.app.rail-collapsed .brand-lockup, .app.rail-collapsed .brand-os { display: none; }
.app.rail-collapsed .brand-mark { display: block; }
.app.rail-collapsed .rail-brand { align-items: center; padding-left: 0; padding-right: 0; }

.rail-nav { flex: 1; overflow-y: auto; padding: 2px 8px 12px; }
.rail-nav::-webkit-scrollbar-thumb { background: #4A4038; background-clip: content-box; border: 3px solid transparent; }
/* the divider between table stakes and what only PEAK gets */
.nav-split {
  display: flex; align-items: center; gap: 9px; margin: 16px 10px 7px;
  color: var(--ink-t2); font-size: 9px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; white-space: nowrap;
}
.nav-split::after { content: ""; flex: 1; height: 1px; background: var(--ink-3); }
.app.rail-collapsed .nav-split { margin: 12px 8px; }
.app.rail-collapsed .nav-split span { display: none; }

.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 7.5px 10px; border-radius: var(--r-sm); color: var(--ink-t);
  font-size: 13px; font-weight: 500; position: relative; margin-bottom: 1px;
  transition: background .12s ease, color .12s ease;
}
.nav-item .ic { width: 16px; height: 16px; opacity: .85; }
.nav-item:hover { background: var(--ink-2); color: #EFE7DC; }
.nav-item.on { background: var(--ink-3); color: #fff; font-weight: 600; }
.nav-item.on .ic { opacity: 1; color: var(--gold); }
.nav-item.on::before {
  content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--gold);
}
.nav-item .nav-label { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; }
.nav-count {
  font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 9px;
  background: var(--bad); color: #fff;
}
.nav-count.q { background: var(--ink-3); color: var(--ink-t); }
.app.rail-collapsed .nav-label, .app.rail-collapsed .nav-count { display: none; }
.app.rail-collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }

/* nested capability rows */
.nav-kids { position: relative; margin: 1px 0 3px; }
.nav-kids::before { content: ""; position: absolute; left: 18px; top: 2px; bottom: 6px; width: 1px; background: var(--ink-3); }
.nav-item.is-child { padding-left: 10px; font-size: 12.5px; color: var(--ink-t2); }
.nav-item.is-child .nav-tick { width: 16px; height: 16px; flex: 0 0 16px; position: relative; }
.nav-item.is-child .nav-tick::after {
  content: ""; position: absolute; left: 8px; top: 50%; width: 7px; height: 1px;
  background: var(--ink-3); transform: translateY(-50%);
}
.nav-item.is-child:hover { color: #EFE7DC; }
.nav-item.is-child.on { color: #fff; font-weight: 600; }
.nav-item.is-child.on .nav-tick::after { background: var(--gold); width: 9px; }
.app.rail-collapsed .nav-kids::before { display: none; }
.app.rail-collapsed .nav-item.is-child { display: none; }

.rail-foot { padding: 10px 12px 13px; border-top: 1px solid var(--ink-2); }
.rail-user { display: flex; align-items: center; gap: 10px; width: 100%; }
.ru-t { display: flex; flex-direction: column; text-align: left; min-width: 0; }
.ru-1 { color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ru-2 { color: var(--ink-t2); font-size: 10.5px; white-space: nowrap; }
.app.rail-collapsed .ru-t { display: none; }
.app.rail-collapsed .rail-user { justify-content: center; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar {
  height: 54px; flex: 0 0 54px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
}
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center;
  color: var(--text-2); position: relative;
}
.icon-btn:hover { background: var(--border-3); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }
.search {
  flex: 0 1 340px; display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text-3); background: var(--surface-2);
}
.search svg { width: 15px; height: 15px; }
.search .kbd {
  margin-left: auto; font-size: 10px; font-weight: 600; color: var(--text-3);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; background: #fff;
}
.sp { flex: 1; }
.club-btn {
  display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); font-size: 12.5px;
}
.club-btn:hover { border-color: var(--bronze-3); }
.club-btn b { font-weight: 650; }
.club-btn .cb-n { color: var(--text-3); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.club-pin { width: 22px; height: 22px; border-radius: 5px; background: var(--bronze-1); color: var(--bronze); display: grid; place-items: center; }
.club-pin svg { width: 13px; height: 13px; }

.page { flex: 1; overflow-y: auto; }
.page-in { padding: 22px 26px 40px; max-width: 1560px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.ph-t { min-width: 0; }
.ph-sub { color: var(--text-2); font-size: 12.5px; margin-top: 4px; max-width: 92ch; line-height: 1.55; }
.ph-act { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.ph-n { color: var(--text-3); font-size: 11px; }

/* ============================================================ atoms */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
  font-size: 12.5px; font-weight: 550; color: var(--text); box-shadow: var(--sh-1);
}
.btn:hover { border-color: var(--bronze-3); background: var(--surface-2); }
.btn .ic { width: 14px; height: 14px; }
.btn-pri { background: var(--bronze); border-color: var(--bronze); color: #fff; }
.btn-pri:hover { background: var(--bronze-hi); border-color: var(--bronze-hi); }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--border-3); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 11.5px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px;
  font-size: 10.5px; font-weight: 650; background: var(--border-3); color: var(--text-2);
  border: 1px solid var(--border-2); white-space: nowrap;
}
.chip .ic { width: 11px; height: 11px; }
.chip.ok { background: var(--ok-1); color: var(--ok); border-color: #CDE6D9; }
.chip.warn { background: var(--warn-1); color: var(--warn); border-color: #EFDDB6; }
.chip.bad { background: var(--bad-1); color: var(--bad); border-color: #F0CFC7; }
.chip.gold { background: var(--gold-1); color: var(--bronze-dp); border-color: var(--bronze-3); }
.chip.info { background: var(--info-1); color: var(--info); border-color: #CFDBEC; }
.avatar {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--ink-3); letter-spacing: .01em;
}
.avatar.sm { width: 24px; height: 24px; flex-basis: 24px; font-size: 9.5px; }
.avatar.a1 { background: linear-gradient(150deg, var(--bronze-hi), var(--bronze-dp)); }
.avatar.a2 { background: linear-gradient(150deg, #4E6E8E, #33506D); }
.avatar.a3 { background: linear-gradient(150deg, #5E7F63, #3E6046); }
.avatar.a4 { background: linear-gradient(150deg, #8A6E93, #5F4A6B); }
.avatar.a5 { background: linear-gradient(150deg, #A0764F, #77522F); }
.avatar.a6 { background: linear-gradient(150deg, #6D6A63, #4A4741); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.panel-h {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border-2);
}
.panel-b { padding: 15px 16px; }
.panel-b.tight { padding: 0; }
.panel-f { padding: 11px 16px; border-top: 1px solid var(--border-2); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.sect-label { font-size: 9px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--text-3); margin-bottom: 7px; }
.quote { background: var(--surface-2); border-left: 2px solid var(--bronze-3); padding: 10px 13px; border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.boundary { display: flex; gap: 9px; align-items: flex-start; background: var(--warn-1); border: 1px solid #EFDDB6; border-radius: var(--r-sm); padding: 10px 12px; font-size: 11.5px; color: #6B4C08; }
.boundary .ic { width: 14px; height: 14px; color: var(--warn); margin-top: 1px; }
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.split { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-18 { gap: 18px; }
.mt-6 { margin-top: 6px; } .mt-14 { margin-top: 14px; } .mt-18 { margin-top: 18px; }
.tiny { font-size: 11px; } .num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); } .muted-3 { color: var(--text-3); }
.strong { font-weight: 700; }
.tline { display: inline-flex; align-items: center; gap: 6px; }

/* ONE bordered metric band, never a row of four KPI cards */
.band {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  overflow: hidden; box-shadow: var(--sh-1);
}
.band-cell { padding: 13px 17px; border-right: 1px solid var(--border-2); }
.band-cell:last-child { border-right: 0; }
.band-k { font-size: 9px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--text-3); }
.band-v { font-size: 23px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.band-v.bad { color: var(--bad); } .band-v.gold { color: var(--bronze-dp); } .band-v.ok { color: var(--ok); }
.band-s { font-size: 11px; color: var(--text-2); margin-top: 2px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 8px 13px; font-size: 12.5px; font-weight: 550; color: var(--text-2);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--bronze-dp); border-bottom-color: var(--bronze); font-weight: 650; }

.empty { padding: 34px 20px; text-align: center; color: var(--text-3); }
.empty .ic { width: 26px; height: 26px; color: var(--border); }
.e-t { font-weight: 650; color: var(--text-2); margin-top: 8px; font-size: 13px; }
.e-s { font-size: 11.5px; margin-top: 3px; }

/* ============================================================ master / detail */
.md { display: grid; grid-template-columns: 360px minmax(0,1fr); gap: 14px; align-items: start; }
.md-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.md-list-h { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border-2); background: var(--surface-2); }
.md-list-h .sect-label { margin: 0; }
.md-row { display: block; width: 100%; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border-3); position: relative; }
.md-row:hover { background: var(--surface-2); }
.md-row.on { background: var(--bronze-1); }
.md-row.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--bronze); }
/* min-width:0 is load-bearing: a grid item defaults to min-width:auto, so an
   overflow-x:auto rail inside it widens the whole column instead of scrolling. */
.md-pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; min-width: 0; }
.md-pane .panel-b { min-width: 0; }
.flow { min-width: 0; }

/* ============================================================================
   RHYTHM STRIP — the signature component.
   12 weeks of one member's own badge-ins with THEIR baseline band drawn across
   it. A global "30 days inactive" rule cannot express this: the point is that
   the floor is different for every member.
   ============================================================================ */
.rhythm { display: block; }
.rhythm-bars { display: flex; align-items: flex-end; gap: 3px; height: 46px; position: relative; }
.rhythm-band {
  position: absolute; left: 0; right: 0; background: var(--bronze-1);
  border-top: 1px dashed var(--bronze-3); border-bottom: 1px dashed var(--bronze-3);
  pointer-events: none; z-index: 0;
}
.rhythm-wk { flex: 1 1 0; min-width: 4px; position: relative; z-index: 1; display: flex; align-items: flex-end; height: 100%; }
.rhythm-b { width: 100%; border-radius: 2px 2px 0 0; background: var(--ink-t); }
.rhythm-wk.ok  .rhythm-b { background: linear-gradient(180deg, #6E8F74, #4E7156); }
.rhythm-wk.low .rhythm-b { background: linear-gradient(180deg, #DFA24A, #B8791F); }
.rhythm-wk.out .rhythm-b { background: linear-gradient(180deg, #D07A63, #A6402A); }
.rhythm-wk.zero .rhythm-b { height: 2px !important; background: var(--border); }
.rhythm-foot { display: flex; justify-content: space-between; margin-top: 5px; font-size: 9.5px; color: var(--text-3); }
.rhythm-sm .rhythm-bars { height: 26px; gap: 2px; }
/* .slot is a component-scoped name; do not reuse a bare utility here */
.rh-slot {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text-2);
}
.rh-slot.miss { background: var(--bad-1); border-color: #F0CFC7; color: var(--bad); text-decoration: line-through; }

/* ============================================================================
   HOUSEHOLD TREE — a membership is a household, not a person. A 4-seat plan
   carried by one person is a cancellation already in motion, and no gym
   platform shows it because they all model the member as the unit.
   ============================================================================ */
.hh { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.hh-top { display: flex; align-items: center; gap: 11px; padding: 12px 15px; background: var(--surface-2); border-bottom: 1px solid var(--border-2); }
.hh-plan { font-size: 12.5px; font-weight: 650; }
.hh-rate { font-size: 16px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hh-carry { display: flex; align-items: center; gap: 3px; }
.hh-seat { width: 9px; height: 9px; border-radius: 2px; background: var(--border); }
.hh-seat.live { background: var(--ok); }
.hh-seat.cold { background: var(--bad); }
.hh-seat.dim  { background: var(--warn); }
.hh-body { padding: 4px 0; }
.hh-row { display: grid; grid-template-columns: 150px minmax(0,1fr) 92px; gap: 12px; align-items: center; padding: 9px 15px; border-bottom: 1px solid var(--border-3); }
.hh-row:last-child { border-bottom: 0; }
.hh-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hh-nm { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hh-age { font-size: 10px; color: var(--text-3); }
.hh-state { font-size: 10.5px; font-weight: 650; text-align: right; }
.hh-state.live { color: var(--ok); } .hh-state.cold { color: var(--bad); } .hh-state.dim { color: var(--warn); }

/* ============================================================================
   COURT & LANE GRID — resource x hour. The constraint in this business is
   bookable inventory, not floor space, so the grid IS the operating picture.
   ============================================================================ */
.cg-wrap { overflow-x: auto; padding-bottom: 4px; }
/* table-layout:fixed is required, not cosmetic: auto layout sizes each hour column to
   its content, so a 12p column full of dead hours renders three times wider than 6a
   and the grid stops reading as a time matrix. Every hour must be the same width. */
.cg { border-collapse: separate; border-spacing: 0; min-width: 860px; width: 100%; table-layout: fixed; }
.cg th { font-size: 9.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 0 0 7px; text-align: center; }
.cg th.res { text-align: left; width: 132px; padding-left: 2px; }
.cg td.res { font-size: 11.5px; font-weight: 600; color: var(--text-2); padding-right: 10px; white-space: nowrap; }
.cg-cell { padding: 2px; }
/* state classes are namespaced: a bare `.empty` collided with the global empty-state
   utility (34px padding) and silently blew every dead-hour cell up to 70px tall. */
.cg-b { display: block; width: 100%; height: 21px; border-radius: 3px; position: relative; }
.cg-b.is-full   { background: linear-gradient(180deg, #4E7156, #3B5A42); }
.cg-b.is-booked { background: #93AF99; }
.cg-b.is-light  { background: #D9DED3; }
.cg-b.is-empty  { background: repeating-linear-gradient(135deg, #EFEDE7 0 4px, #F7F6F2 4px 8px); border: 1px dashed var(--border); }
.cg-b .wait {
  position: absolute; top: -5px; right: -3px; font-size: 8.5px; font-weight: 700; line-height: 1;
  background: var(--bad); color: #fff; border-radius: 7px; padding: 2px 4px;
}
.cg-key { display: flex; gap: 14px; flex-wrap: wrap; font-size: 10.5px; color: var(--text-2); margin-top: 10px; }
.cg-key i { width: 13px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 5px; vertical-align: 0; }

/* ============================================================================
   CLUB FINGERPRINT — each club drawn by the assets it actually has, so the
   three read as three different buildings rather than three identical cards.
   ============================================================================ */
.fp { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); gap: 14px; }
.fp-club { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; box-shadow: var(--sh-1); }
.fp-h { padding: 13px 15px 11px; border-bottom: 1px solid var(--border-2); }
.fp-n { font-size: 14px; font-weight: 700; letter-spacing: -.02em; }
.fp-a { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.fp-b { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 9px; }
.fp-asset { display: grid; grid-template-columns: 18px minmax(0,1fr) auto; gap: 9px; align-items: center; }
.fp-asset .ic { width: 15px; height: 15px; color: var(--bronze); }
.fp-l { font-size: 11.5px; color: var(--text-2); }
/* the count is drawn, not written — 4 lanes reads as four marks */
.fp-pips { display: flex; gap: 3px; }
.fp-pip { width: 7px; height: 14px; border-radius: 2px; background: var(--bronze-2); border: 1px solid var(--bronze-3); }

/* ============================================================================
   AGENT BENCH — an agent is a worker with a reach and a leash, not a document.
   The path runs left to right into a barrier it cannot cross alone.
   ============================================================================ */
.agx-bench { display: flex; flex-direction: column; gap: 10px; }
.agx { display: grid; grid-template-columns: 224px minmax(0,1fr) 246px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.agx-id { padding: 15px 16px; border-right: 1px solid var(--border-2); background: var(--surface-2); display: flex; flex-direction: column; gap: 9px; }
.agx-id-t { display: flex; flex-direction: column; gap: 3px; }
.agx-name { font-size: 13px; font-weight: 650; line-height: 1.3; }
.agx-when { font-size: 10.5px; color: var(--text-3); line-height: 1.45; display: flex; gap: 5px; align-items: flex-start; }
.agx-when .ic { width: 11px; height: 11px; flex: 0 0 11px; margin-top: 2px; }
.agx-run { margin-top: auto; font-size: 10.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.agx-live { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(47,125,82,.16); }
.agx-path { display: grid; grid-template-columns: minmax(0,1fr) 18px minmax(0,1.25fr) 18px minmax(0,1fr); padding: 15px 14px; }
.agx-st { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.agx-st.is-work { padding: 0 13px; border-left: 1px dashed var(--border); border-right: 1px dashed var(--border); margin: 0 2px; }
.agx-k { font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 1px; }
.agx-k.is-stop { color: var(--bad); }
.agx-job { font-size: 11.5px; line-height: 1.5; color: var(--text-2); margin: 0; }
.agx-tag { font-size: 10.5px; line-height: 1.35; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 4px; padding: 2.5px 7px; max-width: 100%; }
.agx-tag.is-out { background: var(--bronze-1); border-color: var(--bronze-3); color: var(--bronze-dp); }
.agx-flow { position: relative; align-self: center; height: 1px; }
.agx-flow::before { content: ""; position: absolute; left: 1px; right: 6px; top: 0; height: 1px; background: var(--border); }
.agx-flow::after { content: ""; position: absolute; right: 2px; top: -3px; border-left: 5px solid var(--border); border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; }
.agx-stop { display: flex; align-items: stretch; background: var(--bad-1); }
.agx-bar { flex: 0 0 9px; background: repeating-linear-gradient(135deg, #B23A26 0 4px, #E7BDB2 4px 8px); border-left: 1px solid #B23A26; border-right: 1px solid #B23A26; }
.agx-stop-b { padding: 15px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.agx-no { font-size: 10.5px; line-height: 1.4; color: var(--bad); font-weight: 500; position: relative; padding-left: 13px; }
.agx-no::before { content: ""; position: absolute; left: 0; top: 6px; width: 8px; height: 1.5px; background: var(--bad); border-radius: 1px; }
.agx-hand { margin-top: auto; padding-top: 8px; font-size: 10.5px; color: var(--text-2); }
.agx-hand b { color: var(--text); font-size: 12px; }
.agx-lede { font-size: 12.5px; color: var(--text-2); max-width: 70ch; margin: 2px 0 14px; line-height: 1.55; }

/* ============================================================ flow rail */
.flow { display: flex; align-items: stretch; overflow-x: auto; padding: 4px 0 10px; }
.rail-more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent);
             mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); }
/* position:relative is load-bearing. Without it the connector pseudo-element resolves
   against the initial containing block, so it sits at page coordinates inside the
   horizontally scrolled rail and drags documentElement.scrollWidth out with it —
   a page-wide horizontal scrollbar caused by a 14px decorative line. */
.flow-node { flex: 0 0 152px; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 11px; background: var(--surface); position: relative; }
.flow-node + .flow-node { margin-left: 26px; }
.flow-node + .flow-node::before { content: ""; position: absolute; left: -20px; top: 14px; width: 14px; height: 1px; background: var(--border); }
.flow-k { font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.flow-k .ic { width: 11px; height: 11px; }
.flow-l { font-size: 12px; font-weight: 600; line-height: 1.3; }
.flow-d { font-size: 10.5px; color: var(--text-2); margin-top: 4px; line-height: 1.4; }
.flow-node.is-gate { border-color: #EFDDB6; background: var(--warn-1); }
.flow-node.is-gate .flow-k { color: var(--warn); }
.flow-node.is-trigger { border-color: var(--bronze-3); background: var(--bronze-1); }
.flow-node.is-trigger .flow-k { color: var(--bronze-dp); }
.flow-node.is-wait { background: var(--surface-2); flex-basis: 108px; }
.flow-node.is-end { border-style: dashed; }

/* ============================================================ tables + misc */
.tbl th { text-align: left; font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); padding: 9px 14px; border-bottom: 1px solid var(--border-2); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border-3); font-size: 12.5px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click:hover td { background: var(--surface-2); cursor: pointer; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

.bar { height: 6px; border-radius: 3px; background: var(--border-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--bronze); border-radius: 3px; }
.bar.ok > i { background: var(--ok); }
.bar.gold > i { background: var(--gold); }

/* dunning ladder: three dots, the third turns red where the agent stopped */
.ladder { display: inline-flex; gap: 4px; align-items: center; }
.ladder i { width: 7px; height: 7px; border-radius: 50%; background: var(--border); display: block; }
.ladder i.on { background: var(--warn); }
.ladder i.stop { background: var(--bad); }

/* program ladder */
.plad { display: flex; align-items: center; gap: 0; }
.plad-s { flex: 1; height: 5px; background: var(--border-2); position: relative; }
.plad-s:first-child { border-radius: 3px 0 0 3px; }
.plad-s:last-child { border-radius: 0 3px 3px 0; }
.plad-s.done { background: var(--bronze); }
.plad-s.now { background: var(--gold); }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 92vw; background: var(--surface);
  box-shadow: var(--sh-3); z-index: 60; transform: translateX(100%); transition: transform .22s ease;
  display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border-2); }
.drawer-b { flex: 1; overflow-y: auto; padding: 16px 18px 30px; }
.scrim { position: fixed; inset: 0; background: rgba(37,32,28,.34); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.modal { position: fixed; inset: 0; display: none; place-items: center; z-index: 65; padding: 20px; }
.modal.on { display: grid; }
.modal-in { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-3); width: 560px; max-width: 100%; max-height: 86vh; overflow-y: auto; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { display: flex; align-items: center; gap: 9px; background: var(--ink); color: #fff; padding: 10px 15px; border-radius: var(--r-sm); font-size: 12.5px; box-shadow: var(--sh-3); }
.toast .ic { color: #8FD3A8; }

.rail-toggle { display: none; }
@media (max-width: 1180px) {
  .md { grid-template-columns: 300px minmax(0,1fr); }
  .agx { grid-template-columns: 200px minmax(0,1fr); }
  .agx-stop { grid-column: 1 / -1; border-top: 1px solid var(--border-2); }
}
@media (max-width: 900px) {
  .rail {
    position: fixed; left: 0; top: 30px; bottom: 0; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: var(--sh-3);
  }
  .app.nav-open .rail { transform: none; }
  .rail-toggle { display: grid; }
  .page-in { padding: 16px 14px 34px; }
  .md { grid-template-columns: minmax(0,1fr); }
  .g-2, .g-3 { grid-template-columns: minmax(0,1fr); }
  .band { grid-auto-flow: row; }
  .band-cell { border-right: 0; border-bottom: 1px solid var(--border-2); }
  .search { display: none; }
  .agx { grid-template-columns: minmax(0,1fr); }
  .agx-id { border-right: 0; border-bottom: 1px solid var(--border-2); }
  .agx-path { grid-template-columns: minmax(0,1fr); gap: 13px; }
  .agx-flow { height: 13px; justify-self: start; margin-left: 4px; }
  .agx-flow::before { left: 0; right: auto; top: 0; bottom: 4px; width: 1px; height: auto; }
  .agx-flow::after { right: auto; left: -3px; top: auto; bottom: -1px; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 5px solid var(--border); border-bottom: 0; }
  .agx-st.is-work { border-left: 0; border-right: 0; padding: 0; margin: 0; }
  .hh-row { grid-template-columns: minmax(0,1fr) 80px; }
  .hh-row .rhythm { grid-column: 1 / -1; }
}
