/* Hallmark · shape: app screen · genre: modern-minimal · theme: Wayfind (deal 3/3, seed software-pickleball-club-managers-6183·f2b93e0a·2026-10-22·r0) · redesign: full
 * nav: kept sidebar shell, paper-2 rail with a 2px ink edge, ink-filled current item · signature: the courts board, an ink departure board with the ball-lime "now" and open slots · states: full, empty (bookings filter, arrivals), resolved (attention cards), pending (offers) · wayfind: platform, ball lime in place of amber
 * axes: light/mono/cool · posture: committed · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V4 · weakest: H, four stats and three cards still compete with the board; the stats lost their cards and became one ruled strip, the cards became signs with the time as the figure */
/* Hallmark · finish-review: subagent · fix · 4 dashboard findings · 4 resolved (board back to 1560px and readable, three attention cards at 1440, wider booking column, phone rows on a grid) · gap: the full bookings list runs long beside a pinned check-ins panel */
/* Hallmark · reworded "Needs your attention 7" to "Needs your attention" with the count as a sibling badge · 38iii names the accented count inside the head */
/* Hallmark · reworded "Today's bookings" to "Today’s bookings" · F1 typographic quotes */
/* Hallmark · waive 64 · Chivo Mono sets every label and table head · the Wayfind board face is the material of the whole dashboard */
/* Hallmark · waive 39b · the 24px buttons are the two halves of a double-booked court block on the timeline · a conflict splits one 56px court row into two lanes, and the session popover opens from either */
/* Hallmark · waive 72 · the clipped text is a session title ending in an ellipsis inside a short timeline block · board blocks are as wide as their minutes, and the full title is in the aria-label and the popover */
/* Hallmark · answered F4 · an app screen: cobalt New booking is the one primary; ink fills mark the chosen tab and each card’s own action */
@import url("./tokens.css");
@import url("./base.css");

:root {
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.2rem; --text-xl: 1.44rem; --text-2xl: 1.728rem; --text-3xl: 2.074rem;
  --text-display-s: 1.44rem; --text-display: 1.728rem; --text-section: 1.2rem; --text-title: 1rem; --text-lead: 1rem;
  --sidebar: 264px;
  --topbar: 64px;
  --pad: var(--space-lg);
}

body { font-size: var(--text-sm); line-height: 1.5; }
h1 { font-size: var(--text-3xl); line-height: 1.05; max-width: none; }
h2 { font-size: var(--text-section); letter-spacing: -0.02em; line-height: 1.2; max-width: none; }
h3 { font-size: var(--text-title); letter-spacing: -0.02em; max-width: none; }
strong { font-weight: 800; }
em { font-style: normal; }
ul { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--color-muted); }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: var(--z-sticky-nav);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  width: var(--sidebar);
  padding: var(--space-md) var(--space-sm);
  border-right: var(--rule-bar) solid var(--color-ink);
  background: var(--color-paper-2);
  overflow-y: auto;
}

.sb-logo { min-height: 40px; padding: 0 var(--space-xs); }
.sb-logo:focus-visible { outline-offset: 0; }

.club-switch {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  min-height: 48px;
  padding: var(--space-2xs) var(--space-sm) var(--space-2xs) var(--space-2xs);
  border: var(--rule-bar) solid var(--color-ink);
  background: var(--color-paper-3);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-micro) steps(1);
}
.club-switch:hover { background: var(--color-paper); }
.club-switch:active { background: var(--color-paper-2); }
.club-switch:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.club-badge {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--color-ink);
  color: var(--color-ball);
  font-weight: 800;
  font-size: var(--text-xs);
}
.club-meta { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.club-meta strong { font-size: var(--text-sm); }
.club-meta span { font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; }

.sb-nav { display: grid; gap: var(--space-3xs); }
.sb-nav a,
.sb-foot > a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 40px;
  padding: 0 var(--space-sm);
  color: var(--color-ink-2);
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--dur-micro) steps(1), color var(--dur-micro) steps(1);
}
.sb-nav svg,
.sb-foot svg,
.icon-btn svg,
.search svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.sb-nav a:hover,
.sb-foot > a:hover { background: var(--color-paper); color: var(--color-ink); }
.sb-nav a:focus-visible,
.sb-foot > a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.sb-nav a.active { background: var(--color-ink); color: var(--color-paper); }
.sb-count {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  margin-left: auto;
  padding: 0 var(--space-2xs);
  background: var(--color-error);
  color: var(--color-accent-ink);
  font-size: var(--text-xs);
  font-weight: 800;
}
.sb-nav a.active .sb-count { background: var(--color-ball); color: var(--color-ball-ink); }
.sb-count-muted { background: transparent; border: var(--rule-hair) solid var(--color-ink); color: var(--color-ink); }

.sb-foot { display: grid; gap: var(--space-xs); margin-top: auto; }
.sb-plan {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-xs);
  padding: var(--space-sm);
  background: var(--color-ink);
  color: var(--color-paper);
  font-size: var(--text-xs);
}
.sb-plan span:first-child { font-weight: 800; }
.sb-plan-meta { color: var(--color-ball); }

.main { min-width: 0; margin-left: var(--sidebar); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: var(--topbar);
  padding: 0 var(--pad);
  border-bottom: var(--rule-bar) solid var(--color-ink);
  background: var(--color-paper);
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  border: var(--rule-bar) solid transparent;
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
  transition: background-color var(--dur-micro) steps(1), border-color var(--dur-micro) steps(1);
}
.icon-btn:hover { border-color: var(--color-ink); }
.icon-btn:active { background: var(--color-paper-2); }
.icon-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.icon-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 var(--space-3xs);
  background: var(--color-error);
  color: var(--color-accent-ink);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.menu-btn { display: none; }

.search {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex: 1;
  min-width: 0;
  max-width: 480px;
  height: 40px;
  padding: 0 var(--space-xs) 0 var(--space-sm);
  border: var(--rule-bar) solid var(--color-ink);
  background: var(--color-paper-3);
  color: var(--color-muted);
}
.search:focus-within { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--color-ink);
  outline: none;
}
.search input::placeholder { color: var(--color-muted); }
.search kbd {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: var(--rule-hair) solid var(--color-muted);
  color: var(--color-ink-2);
  font: 500 var(--text-xs)/1 var(--font-body);
}

.topbar-right { display: flex; align-items: center; gap: var(--space-sm); margin-left: auto; }
.clock {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  margin-right: var(--space-xs);
  font-size: var(--text-xs);
  color: var(--color-muted);
  white-space: nowrap;
}
.clock strong { font-size: var(--text-sm); color: var(--color-accent); }
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--color-ball);
  color: var(--color-ball-ink);
  font-weight: 800;
  font-size: var(--text-xs);
}

/* ---------- Content ---------- */
.content {
  display: grid;
  gap: var(--space-xl);
  max-width: 1600px;
  padding: var(--space-xl) var(--pad) var(--space-2xl);
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-lg);
}
.page-title { display: grid; gap: var(--space-xs); }
.page-date { color: var(--color-muted); font-weight: 500; }
.page-sub { font-size: var(--text-md); color: var(--color-ink-2); }
.page-sub strong { color: var(--color-error); }
.page-sub strong.ok { color: var(--color-success); }

.page-facts {
  display: grid;
  grid-template-columns: repeat(3, auto);
  border: var(--rule-bar) solid var(--color-ink);
  background: var(--color-paper-3);
}
.page-facts > div { padding: var(--space-sm) var(--space-md); border-left: var(--rule-hair) solid var(--color-rule); }
.page-facts > div:first-child { border-left: 0; }
.page-facts dt { font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); }
.page-facts dd { font-weight: 500; white-space: nowrap; }

/* KPIs: one ruled strip, no cards */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: var(--rule-bar) solid var(--color-ink);
  border-bottom: var(--rule-bar) solid var(--color-ink);
}
.kpi {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: var(--space-2xs);
  padding: var(--space-md) var(--space-lg) var(--space-md);
  border-left: var(--rule-hair) solid var(--color-rule);
}
.kpi:first-child { padding-left: 0; border-left: 0; }
.kpi:last-child { padding-right: 0; }
.kpi-label { font-size: var(--text-sm); font-weight: 500; letter-spacing: 0; color: var(--color-muted); }
.kpi-value { font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.kpi-of { font-size: var(--text-lg); color: var(--color-muted); letter-spacing: -0.02em; }
.kpi-sub { color: var(--color-ink-2); font-size: var(--text-xs); }
.kpi-sub strong { color: var(--color-ink); }
.kpi-bar { height: 8px; margin-top: var(--space-xs); background: var(--color-paper-2); }
.kpi-bar span { display: block; height: 100%; background: var(--color-ink); }
.kpi-bar-blue span { background: var(--color-accent); }
.delta { font-weight: 800; }
.delta.up,
.delta.good { color: var(--color-success); }
.delta.down { color: var(--color-error); }

.spark { display: flex; align-items: flex-end; gap: var(--space-2xs); height: 28px; margin-top: var(--space-xs); }
.spark span { flex: 1; background: var(--color-ink); }
.spark span.today { background: var(--color-accent); }
.spark span.booked { background: var(--color-paper-2); outline: 1px dashed var(--color-muted); outline-offset: -1px; }

.dots { display: flex; gap: var(--space-xs); margin-top: var(--space-xs); }
.nd { display: grid; justify-items: center; gap: var(--space-3xs); flex: 1; }
.nd i { min-height: 14px; font-style: normal; font-size: 8px; line-height: 14px; color: var(--color-error); }
.nd b { font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); }
.nd.future b { color: var(--color-rule); }

/* ---------- Needs attention ---------- */
.attention { display: grid; gap: var(--space-md); }
.section-title { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.section-title h2 { font-size: var(--text-xl); }
.count-pill {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 var(--space-xs);
  background: var(--color-error);
  color: var(--color-accent-ink);
  font-weight: 800;
}
.count-pill.clear { background: var(--color-success); }
.section-note { color: var(--color-muted); font-size: var(--text-xs); }
.section-title .section-note { margin-left: auto; }

.attn-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-md);
  align-items: start;
}
.attn-card {
  container-type: inline-size;
  display: grid;
  gap: var(--space-md);
  padding: 0 0 var(--space-lg);
  border: var(--rule-bar) solid var(--color-ink);
  background: var(--color-paper-3);
  scroll-margin: calc(var(--topbar) + var(--space-lg));
}
.attn-card > h3,
.attn-body { padding-inline: var(--space-lg); }
.attn-card > h3 { font-size: var(--text-xl); line-height: 1.15; }

/* The sign: an ink plate with the time as its figure */
.attn-head {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  background: var(--color-ink);
  color: var(--color-paper);
}
.attn-plate { display: grid; gap: var(--space-3xs); padding: var(--space-sm) var(--space-lg) var(--space-md); }
.attn-kind { font-size: var(--text-xs); font-weight: 500; color: var(--color-ink-muted); }
.attn-time { font-size: var(--text-3xl); line-height: 1; letter-spacing: -0.04em; color: var(--color-ball); }
.attn-when {
  align-self: start;
  margin: var(--space-sm) var(--space-sm) 0 0;
  padding: var(--space-2xs) var(--space-xs);
  font-size: var(--text-xs);
  font-weight: 800;
  white-space: nowrap;
}
.attn-red .attn-when { background: var(--color-error); color: var(--color-accent-ink); }
.attn-amber .attn-when { background: var(--color-warn-on-ink); color: var(--color-ink); }
.attn-red .attn-head { box-shadow: inset 0 -4px 0 var(--color-error); }
.attn-amber .attn-head { box-shadow: inset 0 -4px 0 var(--color-warn-on-ink); }
.attn-blue .attn-head { box-shadow: inset 0 -4px 0 var(--color-accent); }

.attn-card.is-resolved { border-color: var(--color-rule); background: var(--color-paper); }
.attn-card.is-resolved .attn-head { background: var(--color-paper-2); color: var(--color-ink); box-shadow: none; }
.attn-card.is-resolved .attn-kind { color: var(--color-muted); }
.attn-card.is-resolved .attn-time { color: var(--color-ink-2); }
.attn-card.is-resolved .attn-when { background: var(--color-success); color: var(--color-accent-ink); }

.attn-card.flash { animation: flash 900ms var(--ease-out); }
@keyframes flash {
  0%, 40% { outline: 4px solid var(--color-ball); outline-offset: 4px; }
  100% { outline: 4px solid transparent; outline-offset: 4px; }
}

.attn-body { display: grid; gap: var(--space-md); }
.attn-text { color: var(--color-ink-2); }

.clash { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--space-xs); align-items: stretch; }
.clash-item {
  display: grid;
  align-content: start;
  gap: var(--space-2xs);
  padding: var(--space-sm);
  background: var(--color-error-wash);
  font-size: var(--text-xs);
  line-height: 1.4;
}
.clash-item strong { font-size: var(--text-sm); }
.clash-vs { align-self: center; font-weight: 800; color: var(--color-error); }
@container (max-width: 30rem) {
  .clash { grid-template-columns: minmax(0, 1fr); }
  .clash-vs { justify-self: start; }
}

.tag {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-ink-2);
}
.tag::before { content: ""; width: 10px; height: 10px; background: var(--c, var(--color-muted)); flex-shrink: 0; }

.hint {
  padding: var(--space-sm) var(--space-md);
  border-left: var(--rule-bar) solid var(--color-ink);
  background: var(--color-paper-2);
  color: var(--color-ink-2);
}
.hint-small { font-size: var(--text-xs); }

.choices { display: grid; gap: var(--space-xs); }
.choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-sm);
  align-items: start;
  padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-sm);
  border: var(--rule-bar) solid var(--color-rule);
  background: var(--color-paper-3);
  cursor: pointer;
  transition: border-color var(--dur-micro) steps(1), background-color var(--dur-micro) steps(1);
}
.choice:hover { border-color: var(--color-ink-2); }
.choice:has(input:checked) { border-color: var(--color-ink); background: var(--color-paper); }
.choice input { width: 18px; height: 18px; margin: var(--space-3xs) 0 0; accent-color: var(--color-ink); }
.choice input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.choice > span { display: block; line-height: 1.4; }
.choice-sub { display: block; margin-top: var(--space-2xs); font-size: var(--text-xs); color: var(--color-muted); }
.rec,
.warn,
.muted-tag {
  display: inline-block;
  margin: var(--space-2xs) 0 0;
  padding: 0 var(--space-2xs);
  font-size: var(--text-xs);
  font-weight: 800;
}
.rec { background: var(--color-ball); color: var(--color-ball-ink); }
.warn { background: var(--color-warn-wash); color: var(--color-warn); }
.muted-tag { background: var(--color-paper-2); color: var(--color-muted); }
.coach { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-sm); align-items: start; }

.attn-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }

.resolved {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-success-wash);
  color: var(--color-ink);
}
.resolved p { margin-top: var(--space-2xs); color: var(--color-ink-2); }
.resolved-ico svg { width: 20px; height: 20px; fill: none; stroke: var(--color-success); stroke-width: 2.4; stroke-linecap: square; }
.resolved-muted { background: var(--color-paper-2); }
.resolved-muted .resolved-ico svg { stroke: var(--color-muted); }

/* Avatars: square initials */
.av {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--color-paper-2);
  color: var(--color-ink);
  font-size: var(--text-xs);
  font-weight: 800;
}
.av-sm { width: 28px; height: 28px; font-size: 11px; }
.av-green { background: var(--color-success-wash); color: var(--color-success); }
.av-blue { background: var(--color-accent-wash); color: var(--color-accent); }
.av-violet { background: var(--color-paper-2); color: var(--color-ink-2); }
.av-red { background: var(--color-error-wash); color: var(--color-error); }
.av-ball { background: var(--color-ball); color: var(--color-ball-ink); }

/* Waitlist */
.wait-list { display: grid; }
.wait-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-xs) var(--space-sm);
  padding: var(--space-md) 0;
  border-top: var(--rule-hair) solid var(--color-rule);
}
.wait-item:first-child { padding-top: 0; border-top: 0; }
.wait-main { display: grid; gap: var(--space-2xs); min-width: 0; }
.wait-top { display: grid; }
.wait-top .muted { font-size: var(--text-xs); }
.wait-meta { font-size: var(--text-xs); color: var(--color-muted); }
.match {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-2xs);
  padding: var(--space-2xs) var(--space-xs);
  background: var(--color-accent-wash);
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: 500;
}
.match.ok { background: var(--color-success-wash); color: var(--color-success); }
.match.blocked { background: var(--color-paper-2); color: var(--color-ink-2); }
.match.pending { background: var(--color-warn-wash); color: var(--color-warn); }
.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.wait-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--space-xs); }

/* Smaller items */
.todo-wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-md); align-items: start; }
.todo { border-top: var(--rule-bar) solid var(--color-ink); border-bottom: var(--rule-bar) solid var(--color-ink); }
.todo-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-md);
  align-items: center;
  min-height: 64px;
  padding: var(--space-sm) 0;
  border-top: var(--rule-hair) solid var(--color-rule);
}
.todo-item:first-child { border-top: 0; }
.todo-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; }
.tone-red { color: var(--color-error); }
.tone-amber { color: var(--color-warn); }
.tone-blue { color: var(--color-accent); }
.tone-green { color: var(--color-success); }
.todo-main { display: grid; min-width: 0; }
.todo-main span { font-size: var(--text-xs); color: var(--color-muted); }
.todo-item.done .todo-main strong { color: var(--color-ink-2); }
.todo-actions { display: flex; gap: var(--space-xs); }

.staff { padding: var(--space-md); background: var(--color-paper-2); }
.card-title { margin-bottom: var(--space-sm); font-size: var(--text-md); }
.staff-list { display: grid; gap: var(--space-sm); }
.staff-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-sm); align-items: center; }
.staff-list div { display: grid; min-width: 0; line-height: 1.35; }
.staff-list div span { font-size: var(--text-xs); color: var(--color-muted); }
.staff-st { font-size: var(--text-xs); font-weight: 800; white-space: nowrap; }
.st-ball { color: var(--color-ink-2); }
.st-green { color: var(--color-success); }
.st-blue { color: var(--color-accent); }
.st-red { color: var(--color-error); }

/* ---------- Cards and their heads ---------- */
.card { min-width: 0; }
.card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}
.card-head h2 { font-size: var(--text-xl); }
.card-head .section-note { margin-top: var(--space-2xs); }
.card-head .section-note strong { color: var(--color-ink); }

/* ---------- The courts board ---------- */
.schedule {
  padding: var(--space-lg) 0 var(--space-md);
  background: var(--color-ink);
  color: var(--color-paper);
  scroll-margin: var(--topbar);
}
.schedule .card-head { padding-inline: var(--space-lg); }
.schedule .section-note { color: var(--color-ink-muted); }
.schedule .section-note strong { color: var(--color-ball); }
.schedule :focus-visible { outline-color: var(--color-focus-on-ink); }

.legend { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); font-size: var(--text-xs); color: var(--color-ink-muted); }
.legend li { display: inline-flex; align-items: center; gap: var(--space-xs); }
.tdot { display: inline-block; width: 10px; height: 10px; flex-shrink: 0; background: var(--c, var(--color-muted)); }
.tdot.t-open-slot { background: transparent; outline: 1px dashed var(--color-ball); outline-offset: -1px; }

.t-booking { --c: var(--type-booking); }
.t-open { --c: var(--type-open); }
.t-league { --c: var(--type-league); }
.t-ladder { --c: var(--type-ladder); }
.t-clinic { --c: var(--type-clinic); }
.t-lesson { --c: var(--type-lesson); }
.t-maint { --c: var(--type-maint); }

.timeline-scroll { overflow-x: auto; scrollbar-color: var(--color-ink-rule) var(--color-ink); }
.timeline-scroll:focus-visible { outline-offset: -2px; }
.timeline { --label: 112px; position: relative; min-width: 1560px; }

.tl-head { display: flex; height: 52px; }
.tl-corner { position: sticky; left: 0; z-index: 6; flex: none; width: var(--label); background: var(--color-ink); }
.tl-hours { position: relative; flex: 1; }
.tl-hours span {
  position: absolute;
  bottom: var(--space-xs);
  transform: translateX(-50%);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-ink-muted);
}
.tl-hours span:first-of-type { transform: none; }
.tl-hours span:last-of-type { transform: translateX(-100%); }
.tl-prime-label {
  position: absolute;
  top: 0;
  height: 18px;
  border-top: var(--rule-bar) solid var(--color-ball);
  color: var(--color-ball);
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.tl-row { display: flex; height: 56px; border-top: var(--rule-hair) solid var(--color-ink-rule); }
.tl-row:last-child { border-bottom: var(--rule-hair) solid var(--color-ink-rule); }
.tl-label {
  position: sticky;
  left: 0;
  z-index: 6;
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: var(--label);
  padding-left: var(--space-lg);
  border-right: var(--rule-hair) solid var(--color-ink-rule);
  background: var(--color-ink);
  line-height: 1.25;
}
.tl-label strong { font-size: var(--text-sm); }
.tl-label span { font-size: 11px; color: var(--color-ink-muted); }

.tl-track { position: relative; flex: 1; }
.tl-prime { position: absolute; top: 0; bottom: 0; background: var(--color-ink-raised); }
.tl-past {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: repeating-linear-gradient(135deg, transparent 0 6px, var(--color-ink-raised) 6px 7px);
}
.tl-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--color-ink-rule); opacity: 0.6; }

.tl-open {
  position: absolute;
  top: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-xs);
  border: 1px dashed var(--color-ink-muted);
  color: var(--color-ink-muted);
  font-size: 11px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
}
.tl-open.prime { border: var(--rule-bar) dashed var(--color-ball); color: var(--color-ball); font-weight: 800; }

.tl-block {
  position: absolute;
  top: 6px;
  bottom: 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0 var(--space-xs) 0 var(--space-lg);
  border: var(--rule-hair) solid var(--color-ink-rule);
  background: var(--color-ink-2);
  color: var(--color-paper);
  text-align: left;
  line-height: 1.2;
  overflow: hidden;
  cursor: pointer;
  transition: background-color var(--dur-micro) steps(1), border-color var(--dur-micro) steps(1);
}
.tl-block::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 8px;
  height: 8px;
  background: var(--c);
}
.tl-block:hover { z-index: 3; border-color: var(--color-paper); }
.tl-block:active { background: var(--color-ink-rule); }
.tl-block:focus-visible { z-index: 3; outline: 2px solid var(--color-focus-on-ink); outline-offset: 1px; }
.tl-title,
.tl-sub { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tl-title { font-size: 12px; font-weight: 800; }
.tl-sub { margin-top: var(--space-3xs); font-size: 11px; color: var(--color-ink-muted); }

.tl-block.st-done { background: var(--color-ink-raised); color: var(--color-ink-muted); }
.tl-block.st-live { border: var(--rule-bar) solid var(--color-ball); }
.tl-live { position: absolute; top: 8px; right: 6px; width: 8px; height: 8px; background: var(--color-ball); }
.st-live .tl-title { padding-right: var(--space-sm); }
.tl-block.st-noshow { background: var(--color-ink-raised); color: var(--color-ink-muted); border-style: dashed; }
.tl-block.st-noshow .tl-title,
.tl-block.st-cancelled .tl-title { text-decoration: line-through; }
.tl-block.st-cancelled { background: transparent; color: var(--color-ink-muted); border-style: dashed; }
.tl-block.st-pending { border: var(--rule-bar) dashed var(--color-warn-on-ink); }
.tl-block.conflict { background: var(--color-error); border-color: var(--color-error-on-ink); color: var(--color-accent-ink); }
.tl-block.conflict::before { background: var(--color-accent-ink); }
.tl-block.conflict.lane-0 { top: 3px; bottom: 50%; margin-bottom: 1px; }
.tl-block.conflict.lane-1 { top: 50%; bottom: 3px; margin-top: 1px; }
.tl-block.conflict .tl-sub { display: none; }
.tl-block.conflict::before,
.tl-block.conflict.lane-1::before { top: calc(50% - var(--space-2xs)); }
.tl-block.st-nocoach { border: var(--rule-bar) solid var(--color-warn-on-ink); }
.tl-flag {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background: var(--color-accent-ink);
  color: var(--color-error);
  font-size: 11px;
  font-weight: 800;
}
.st-nocoach .tl-flag { background: var(--color-warn-on-ink); color: var(--color-ink); }
.st-nocoach .tl-title,
.st-nocoach .tl-sub,
.conflict .tl-title { padding-right: var(--space-lg); }

.tl-now {
  position: absolute;
  top: 22px;
  bottom: 0;
  left: calc(var(--label) + (100% - var(--label)) * var(--now));
  z-index: 4;
  width: 2px;
  margin-left: -1px;
  background: var(--color-ball);
  pointer-events: none;
}
.tl-now span {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -100%);
  padding: var(--space-3xs) var(--space-xs);
  background: var(--color-ball);
  color: var(--color-ball-ink);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

/* ---------- Bookings and check-ins ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: var(--space-xl); align-items: start; }
.two-col-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.bookings { scroll-margin: calc(var(--topbar) + var(--space-md)); }

.seg { display: flex; }
.seg button {
  min-height: 36px;
  padding: 0 var(--space-sm);
  border: var(--rule-bar) solid var(--color-ink);
  margin-left: calc(-1 * var(--rule-bar));
  background: var(--color-paper-3);
  color: var(--color-ink);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-micro) steps(1), color var(--dur-micro) steps(1);
}
.seg button:first-child { margin-left: 0; }
.seg button:hover { background: var(--color-paper-2); }
.seg button:active { background: var(--color-paper); }
.seg button:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--color-focus); outline-offset: 2px; }
.seg button[aria-selected="true"] { background: var(--color-ink); color: var(--color-paper); font-weight: 800; }

.table-wrap { border-bottom: var(--rule-bar) solid var(--color-ink); }
.table { width: 100%; border-collapse: collapse; }
.table th {
  position: relative;
  padding: var(--space-xs) var(--space-sm);
  border-bottom: var(--rule-bar) solid var(--color-ink);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-muted);
  text-align: left;
  white-space: nowrap;
}
.table th:first-child,
.table td:first-child { padding-left: 0; }
.table td {
  padding: var(--space-sm);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table tbody tr { cursor: pointer; transition: background-color var(--dur-micro) steps(1); }
.table tbody tr:hover { background: var(--color-paper-3); }
.table tbody tr:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.table td.empty { padding: var(--space-xl) 0; color: var(--color-muted); text-align: center; cursor: default; }
.nowrap { white-space: nowrap; }
.table td:nth-child(3) { min-width: 24ch; }
.table td:nth-child(2) { width: 1%; }
.warn-text { color: var(--color-warn); font-weight: 800; }
.row-done td { color: var(--color-muted); }
.row-conflict td:first-child { box-shadow: inset 4px 0 0 var(--color-error); padding-left: var(--space-sm); }

.bk { display: flex; align-items: flex-start; gap: var(--space-xs); min-width: 0; }
.bk .tdot { margin-top: var(--space-2xs); }
.bk div { display: grid; min-width: 0; line-height: 1.35; }
.bk span { font-size: var(--text-xs); color: var(--color-muted); }

.pay { display: inline-block; padding: var(--space-3xs) var(--space-xs); font-size: var(--text-xs); font-weight: 500; white-space: nowrap; }
.pay.paid { background: var(--color-success-wash); color: var(--color-success); }
.pay.due { background: var(--color-warn-wash); color: var(--color-warn); font-weight: 800; }
.pay.sent { background: var(--color-accent-wash); color: var(--color-accent); }
.pay.pass { background: var(--color-paper-2); color: var(--color-ink-2); }
.pay.refunded { background: var(--color-paper-2); color: var(--color-muted); text-decoration: line-through; }
.pay.none { color: var(--color-muted); }

.status { display: inline-block; font-size: var(--text-xs); font-weight: 800; white-space: nowrap; color: var(--color-ink-2); }
.s-live { padding: var(--space-3xs) var(--space-xs); background: var(--color-ball); color: var(--color-ball-ink); }
.s-conflict { padding: var(--space-3xs) var(--space-xs); background: var(--color-error); color: var(--color-accent-ink); }
.s-nocoach { padding: var(--space-3xs) var(--space-xs); background: var(--color-warn-wash); color: var(--color-warn); }
.s-noshow,
.s-done,
.s-cancelled { color: var(--color-muted); font-weight: 500; }
.s-pending { color: var(--color-warn); }
.s-upcoming { color: var(--color-ink-2); font-weight: 500; }

.checkins { position: sticky; top: calc(var(--topbar) + var(--space-md)); padding: var(--space-lg); border: var(--rule-bar) solid var(--color-ink); background: var(--color-paper-3); }
.sub-title { margin: var(--space-md) 0 var(--space-xs); font-size: var(--text-sm); font-weight: 500; letter-spacing: 0; color: var(--color-muted); }
.checkins .card-head + .sub-title { margin-top: 0; }
.arrivals { display: grid; border-top: var(--rule-bar) solid var(--color-ink); }
.arrival {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.arr-time { display: grid; line-height: 1.3; }
.arr-time span { font-size: 11px; color: var(--color-muted); }
.arr-main { display: grid; gap: var(--space-2xs); min-width: 0; }
.arr-who { font-weight: 800; }
.late { display: inline-block; padding: 0 var(--space-2xs); background: var(--color-warn-wash); color: var(--color-warn); font-size: 11px; font-weight: 800; }
.faces { display: flex; gap: var(--space-2xs); }
.face {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--color-rule);
  color: var(--color-muted);
  font-size: 10px;
  font-weight: 500;
}
.face.in { border-color: var(--color-success); background: var(--color-success); color: var(--color-accent-ink); font-weight: 800; }
.arrivals .empty,
.recent .empty { padding: var(--space-md) 0; color: var(--color-muted); }

.recent { display: grid; }
.recent li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-xs) 0;
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.recent li:last-child { border-bottom: 0; }
.recent li div { display: grid; line-height: 1.3; }
.recent li div span,
.recent time { font-size: var(--text-xs); color: var(--color-muted); }
.recent li.fresh time { color: var(--color-success); font-weight: 800; }

/* ---------- Revenue and no-shows ---------- */
.rev-total { display: grid; justify-items: end; text-align: right; }
.rev-total strong { font-size: var(--text-3xl); letter-spacing: -0.04em; line-height: 1.1; }
.rev-total span { font-size: var(--text-xs); color: var(--color-muted); }
.rev-total span strong { font-size: inherit; letter-spacing: 0; color: var(--color-ink); }
.rev-body { display: grid; gap: var(--space-lg); padding-top: var(--space-md); border-top: var(--rule-bar) solid var(--color-ink); }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-xs); height: 220px; }
.bar-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: var(--space-2xs); min-width: 0; }
.bar-val { font-size: 11px; color: var(--color-muted); text-align: center; white-space: nowrap; }
.bar { background: var(--color-ink); min-height: 4px; }
.bar-col.today .bar { background: var(--color-accent); }
.bar-col.today .bar-val,
.bar-col.today .bar-day { color: var(--color-accent); font-weight: 800; }
.bar-col.booked .bar { background: var(--color-paper-2); outline: 1px dashed var(--color-muted); outline-offset: -1px; }
.bar-day { padding-top: var(--space-2xs); border-top: var(--rule-hair) solid var(--color-ink); font-size: var(--text-xs); text-align: center; color: var(--color-ink-2); }

.rev-breakdown { display: grid; gap: var(--space-2xs); }
.rev-breakdown .stack { display: flex; height: 12px; margin-bottom: var(--space-sm); }
.rev-breakdown .stack span { height: 100%; }
.rev-breakdown li:not(.stack) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 48px;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-2xs) 0;
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.rev-breakdown li:last-child { border-bottom: 0; }
.sw { width: 10px; height: 10px; }
.rb-amt { font-weight: 800; text-align: right; }
.rb-pct { color: var(--color-muted); text-align: right; }
.stack .tone-green, .sw.tone-green { background: var(--type-booking); }
.stack .tone-orange, .sw.tone-orange { background: var(--type-ladder); }
.stack .tone-ball, .sw.tone-ball { background: var(--type-open); }
.stack .tone-indigo, .sw.tone-indigo { background: var(--type-league); }
.stack .tone-gray, .sw.tone-gray { background: var(--type-maint); }

.ns-list { display: grid; border-top: var(--rule-bar) solid var(--color-ink); }
.ns-list li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: var(--space-sm);
  align-items: center;
  min-height: 56px;
  padding: var(--space-xs) 0;
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.ns-day { font-weight: 800; color: var(--color-ink-2); }
.ns-main { display: grid; min-width: 0; line-height: 1.35; }
.ns-main span { font-size: var(--text-xs); color: var(--color-muted); }
.repeat { justify-self: start; padding: 0 var(--space-2xs); background: var(--color-error-wash); color: var(--color-error); font-size: 11px; font-weight: 800; }
.noshows .hint { margin-top: var(--space-md); }

.proto-note { padding-top: var(--space-md); border-top: var(--rule-hair) solid var(--color-rule); font-size: var(--text-xs); color: var(--color-muted); }

/* ---------- Popover ---------- */
.popover {
  position: fixed;
  z-index: var(--z-modal);
  width: min(360px, calc(100% - var(--space-lg)));
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  border: var(--rule-bar) solid var(--color-ink);
  background: var(--color-paper-3);
  box-shadow: var(--shadow-card);
}
.pop-head { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.pop-close { margin-left: auto; margin-right: calc(-1 * var(--space-sm)); }
.popover h3 { font-size: var(--text-lg); }
.pop-alert { margin-top: var(--space-sm); padding: var(--space-xs) var(--space-sm); background: var(--color-error-wash); color: var(--color-error); font-size: var(--text-xs); }
.popover dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-xs) var(--space-md); margin-top: var(--space-md); font-size: var(--text-xs); }
.popover dt { color: var(--color-muted); }
.popover dd { font-weight: 500; }
.pop-actions { display: flex; gap: var(--space-xs); margin-top: var(--space-md); padding-top: var(--space-md); border-top: var(--rule-hair) solid var(--color-rule); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: var(--space-lg); bottom: var(--space-lg); z-index: var(--z-toast); display: grid; gap: var(--space-xs); justify-items: end; }
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  max-width: 420px;
  padding: var(--space-sm) var(--space-md);
  border: var(--rule-bar) solid var(--color-ink);
  background: var(--color-ink);
  color: var(--color-paper);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
}
.toast.in { opacity: 1; transform: none; }
.toast-ico { display: grid; place-items: center; flex-shrink: 0; width: 20px; height: 20px; background: var(--color-ball); color: var(--color-ball-ink); font-weight: 800; font-size: var(--text-xs); }
.toast-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: square; }
.toast-info .toast-ico { background: var(--color-paper); color: var(--color-ink); }

@media (prefers-reduced-motion: reduce) {
  .toast { transform: none; transition: opacity var(--dur-short) linear; }
  .attn-card.flash { animation: none; outline: 4px solid var(--color-ball); outline-offset: 4px; }
  .spinner { animation: none; border-right-color: currentColor; opacity: 0.6; }
}

/* ---------- Narrower screens ---------- */
@media (max-width: 90rem) {
  .page-head { grid-template-columns: minmax(0, 1fr); }
  .page-facts { justify-self: start; }
}

@media (max-width: 80rem) {
  .attn-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #cardConflict { grid-column: 1 / -1; }
}

@media (max-width: 75rem) {
  .two-col,
  .two-col-even,
  .todo-wrap { grid-template-columns: minmax(0, 1fr); }
  .checkins { position: static; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { padding-left: 0; border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: var(--rule-hair) solid var(--color-rule); }
  .kpi:nth-child(2) { padding-right: 0; }
}

@media (max-width: 60rem) {
  :root { --pad: var(--space-md); }
  .sidebar { transform: translateX(-100%); transition: transform var(--dur-short) var(--ease-out); box-shadow: none; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-card); }
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
  .clock { display: none; }
  .attn-grid { grid-template-columns: minmax(0, 1fr); }
  .page-facts { grid-template-columns: minmax(0, 1fr); justify-self: stretch; }
  .page-facts > div { border-left: 0; border-top: var(--rule-hair) solid var(--color-rule); }
  .page-facts > div:first-child { border-top: 0; }
  .page-facts dd { white-space: normal; }
}

@media (max-width: 40rem) {
  .topbar { gap: var(--space-xs); }
  .search kbd { display: none; }
  .topbar-right { gap: var(--space-2xs); }
  #newBookingBtn { padding: 0 var(--space-sm); font-size: 0; gap: 0; }
  #newBookingBtn svg { width: 16px; height: 16px; }
  .avatar { display: none; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi { padding-inline: 0; border-left: 0; border-top: var(--rule-hair) solid var(--color-rule); }
  .kpi:first-child { border-top: 0; }
  .clash { grid-template-columns: minmax(0, 1fr); }
  .clash-vs { justify-self: center; }
  .seg { overflow-x: auto; max-width: 100%; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem 3.5rem; align-items: center; gap: var(--space-2xs) var(--space-sm); padding: var(--space-sm) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
  .table td { padding: 0; border: 0; min-width: 0; }
  .table td:nth-child(3) { grid-column: 1 / -1; grid-row: 1; min-width: 0; }
  .table td:nth-child(2) { width: auto; }
  .table td.num { text-align: right; }
  .table td:nth-child(5) { grid-column: 1; }
  .table td:nth-child(6) { grid-column: 2 / -1; text-align: right; }
  .row-conflict td:first-child { box-shadow: none; padding-left: 0; }
  .table td.empty { grid-column: 1 / -1; }
  .todo-item { grid-template-columns: auto minmax(0, 1fr); }
  .todo-actions { grid-column: 2; flex-wrap: wrap; }
  .arrival { grid-template-columns: 64px minmax(0, 1fr); }
  .arrival .btn { grid-column: 2; justify-self: start; }
  .attn-card > h3,
  .attn-body { padding-inline: var(--space-md); }
  .attn-plate { padding-inline: var(--space-md); }
  .checkins { padding: var(--space-md); }
  .bars { height: 180px; }
  .bar-val { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
