/* Rally — club manager dashboard ("Today")
   Paper desk, ink scoreboard, court-blue schedule board. */

body {
  font-size: 15px;
  background: var(--paper);
}

/* Session-type fills (used by tags, timeline blocks, legend dots, table dots) */
.t-booking { --c: var(--court); --c-bg: var(--card); --c-ink: var(--ink); }
.t-open { --c: #7d8b00; --c-bg: var(--ball); --c-ink: var(--ink); }
.t-league { --c: var(--violet); --c-bg: #ddd5f3; --c-ink: #2c2155; }
.t-ladder { --c: #17675a; --c-bg: #c8eadf; --c-ink: #0f3d35; }
.t-clinic { --c: #b0521b; --c-bg: #fbd7b9; --c-ink: #5a2706; }
.t-lesson { --c: #a03566; --c-bg: #f5d2e2; --c-ink: #521532; }
.t-maint { --c: #6b7280; --c-bg: #e3e1db; --c-ink: var(--ink-2); }

/* ---------- Shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px 16px;
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.sb-logo {
  padding: 4px 8px 2px;
  color: var(--ink);
}

.club-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-1);
}

.club-switch:hover {
  border-color: var(--ink);
}

.club-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--court);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.04em;
}

.club-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.25;
}

.club-meta strong {
  font-size: 15px;
}

.club-meta span {
  font-size: 13px;
  color: var(--muted);
}

.sb-nav,
.sb-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sb-nav a,
.sb-foot a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--dur-1), color var(--dur-1);
}

.sb-nav a:hover,
.sb-foot a:hover {
  background: rgba(20, 26, 34, 0.06);
  color: var(--ink);
}

.sb-nav svg,
.sb-foot svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sb-nav a.active {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

.sb-nav a.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: var(--ball);
}

.sb-count {
  margin-left: auto;
  min-width: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sb-nav a.active .sb-count {
  background: var(--ball);
  color: var(--ink);
}

.sb-count-muted {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  line-height: 18px;
}

.sb-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sb-plan {
  margin-top: 8px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
}

.sb-plan-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 600;
}

.sb-plan-meta {
  color: var(--muted);
  font-weight: 500;
}

.sb-courts {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  margin-top: 8px;
}

.sb-courts i {
  height: 14px;
  border-radius: 2px;
  background: var(--court);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), inset 0 -7px 0 -6px rgba(255, 255, 255, 0.7);
}

.sb-courts i.free {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ---------- Main + top bar ---------- */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 32px;
  background: rgba(245, 243, 238, 0.94);
  border-bottom: 1px solid var(--line);
}

@supports (backdrop-filter: blur(1px)) {
  .topbar {
    background: rgba(245, 243, 238, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: background-color var(--dur-1), border-color var(--dur-1);
}

.icon-btn:hover {
  background: rgba(20, 26, 34, 0.06);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--paper);
}

.menu-btn {
  display: none;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 440px;
  height: 40px;
  padding: 0 10px 0 12px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}

.search:focus-within {
  border-color: var(--court);
  box-shadow: 0 0 0 3px var(--court-100);
}

.search svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  outline: none;
}

.search input::placeholder {
  color: var(--faint);
}

.search kbd {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  font-family: var(--font);
  font-size: 12px;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.clock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-right: 6px;
  font-size: 14px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.clock strong {
  font-weight: 700;
}

.clock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--go);
  box-shadow: 0 0 0 3px var(--go-50);
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ball);
  border: 1.5px solid var(--ink);
  font-weight: 700;
  font-size: 13px;
}

/* ---------- Content ---------- */
.content {
  width: 100%;
  max-width: 1480px;
  padding: 28px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 32px;
  flex-wrap: wrap;
}

.page-kicker {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--court);
}

.page-head h1 {
  margin-top: 2px;
  font-family: var(--display);
  font-size: clamp(36px, 3.6vw, 50px);
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1;
}

.page-sub {
  margin-top: 10px;
  font-size: 17px;
  color: var(--ink-2);
}

.page-sub strong {
  font-weight: 700;
  color: var(--red);
}

.page-sub strong.ok {
  color: var(--go);
}

.page-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--ink-2);
  white-space: nowrap;
}

.chip + .chip {
  border-left: 1px solid var(--line);
}

.chip svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.chip-green {
  color: var(--go);
  font-weight: 600;
}

.chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--go);
}

/* ---------- Scoreboard (KPIs) ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  overflow: hidden;
}

.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px 22px 18px;
  min-height: 176px;
}

.kpi + .kpi {
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.kpi-label {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c3cad4;
}

.kpi-value {
  margin-top: 4px;
  font-family: var(--display);
  font-size: 60px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.kpi-of {
  font-size: 30px;
  font-weight: 600;
  color: #9aa3af;
}

.kpi-sub {
  margin-top: 6px;
  font-size: 14px;
  color: #c3cad4;
  line-height: 1.35;
}

.kpi-sub strong {
  color: #fff;
}

.kpi-bar {
  margin-top: auto;
  height: 6px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.kpi-bar span {
  display: block;
  height: 100%;
  background: var(--ball);
  transition: width var(--dur-3) var(--ease-out);
}

.kpi-bar-court span {
  background: #8fb2db;
}

.delta {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.delta.up,
.delta.good {
  color: #8fe0b1;
}

.delta.down {
  color: #ffab9c;
}

.spark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 34px;
  margin-top: auto;
}

.spark span {
  flex: 1;
  min-height: 3px;
  background: #e8ebef;
  border-radius: 1px 1px 0 0;
}

.spark span.today {
  background: var(--ball);
}

.spark span.booked {
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0 2px, transparent 2px 5px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.dots {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: auto;
}

.nd {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nd i {
  display: flex;
  gap: 3px;
  height: 8px;
}

.nd u {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff8a76;
}

.nd b {
  font-size: 12px;
  font-weight: 600;
  color: #c3cad4;
}

.nd.future b {
  color: #7d8794;
}

/* ---------- Section titles ---------- */
.section-title,
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px 20px;
  flex-wrap: wrap;
}

.section-title {
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 20px;
}

.section-title h2,
.card-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
}

.section-note {
  font-size: 14px;
  color: var(--muted);
}

.section-note strong {
  color: var(--ink);
}

.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.count-pill.clear {
  background: var(--go);
}

/* ---------- Needs attention: run-sheet ---------- */
.attn-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

.runsheet {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* The vertical "tonight" line connecting the rails */
.runsheet::before {
  content: "";
  position: absolute;
  left: 52px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--line) 0 6px, transparent 6px 10px);
}

.attn-card {
  --tone: var(--court);
  --tone-50: var(--court-50);
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 0;
  scroll-margin: 96px;
}

.attn-red {
  --tone: var(--red);
  --tone-50: var(--red-50);
}

.attn-amber {
  --tone: var(--amber);
  --tone-50: var(--amber-50);
}

.attn-rail {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-top: 14px;
  padding-right: 12px;
}

.rail-time {
  padding: 4px 0 6px;
  background: var(--paper);
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink-2);
}

.rail-time span {
  display: block;
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.rail-time-sm {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  line-height: 0.95;
}

.rail-sub {
  background: var(--paper);
  padding-bottom: 4px;
  font-size: 13px;
  color: var(--muted);
}

.attn-when {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--tone);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.attn-content {
  min-width: 0;
  padding: 18px 22px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--tone);
  border-radius: var(--radius);
  transition: border-color var(--dur-2), opacity var(--dur-2);
}

.attn-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.attn-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--tone-50);
  color: var(--tone);
}

.attn-ico svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attn-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tone);
}

.attn-head h3 {
  margin-top: 2px;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.05;
}

.attn-body {
  margin-top: 16px;
}

.attn-text {
  font-size: 16px;
  color: var(--ink-2);
  max-width: 64ch;
}

/* Resolved */
.attn-card.is-resolved {
  --tone: var(--go);
  --tone-50: var(--go-50);
}

.attn-card.is-resolved .attn-content {
  background: transparent;
  border-style: solid;
}

.attn-card.is-resolved .attn-head h3 {
  color: var(--ink-2);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(28, 107, 69, 0.55);
}

.attn-card.is-resolved .rail-time {
  color: var(--muted);
}

.attn-card.is-resolved .rail-time span {
  color: var(--muted);
}

.resolved {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--go-50);
  animation: settle var(--dur-3) var(--ease-out);
}

.resolved-muted {
  background: var(--paper-2);
}

.resolved-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--go);
  color: #fff;
}

.resolved-muted .resolved-ico {
  background: var(--ink-2);
}

.resolved-ico svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.resolved strong {
  font-size: 16px;
}

.resolved p {
  margin-top: 2px;
  color: var(--ink-2);
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Clash */
.clash {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(196, 49, 29, 0.05) 8px 10px);
}

.clash-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  min-width: 0;
  font-size: 14px;
  color: var(--ink-2);
}

.clash-item strong {
  margin-top: 6px;
  font-size: 17px;
  color: var(--ink);
}

.clash-item .muted {
  color: var(--muted);
  font-size: 13px;
}

.clash-vs {
  display: grid;
  place-items: center;
  position: relative;
}

.clash-vs::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1.5px dashed var(--red);
}

.clash-vs span {
  position: relative;
  padding: 4px 6px;
  background: var(--red);
  color: #fff;
  border-radius: 3px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  line-height: 1;
}

.tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 6px;
  border-radius: 3px;
  background: var(--c-bg);
  color: var(--c-ink);
  box-shadow: inset 3px 0 0 var(--c), inset 0 0 0 1px rgba(20, 26, 34, 0.12);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hint {
  margin-top: 14px;
  padding-left: 12px;
  border-left: 3px solid var(--ball-600);
  font-size: 15px;
  color: var(--ink-2);
}

.hint strong {
  color: var(--ink);
}

.hint-small {
  font-size: 14px;
  border-left-color: var(--line);
  color: var(--muted);
}

/* Choices */
.choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  transition: border-color var(--dur-1), background-color var(--dur-1), box-shadow var(--dur-1);
}

.choice:hover {
  border-color: var(--ink-2);
}

.choice:has(input:checked) {
  border-color: var(--ink);
  background: #fdfdf4;
  box-shadow: inset 4px 0 0 var(--ball), 0 0 0 1px var(--ink);
}

.choice input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--ink);
  cursor: pointer;
}

.choice strong {
  font-size: 15px;
  font-weight: 600;
}

.choice-sub {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: var(--muted);
}

.coach {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.rec,
.warn,
.muted-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.rec {
  background: var(--go-50);
  color: var(--go);
}

.warn {
  background: var(--amber-50);
  color: var(--amber);
}

.muted-tag {
  background: var(--paper-2);
  color: var(--muted);
}

.attn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 16px;
}

/* Avatars */
.av {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.av-sm {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.av-green { background: var(--go-50); color: var(--go); }
.av-blue { background: var(--court-100); color: var(--court-700); }
.av-violet { background: var(--violet-50); color: var(--violet); }
.av-red { background: var(--red-50); color: var(--red); }
.av-ball { background: var(--ball); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }

/* Waitlist */
.wait-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-2);
}

.wait-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}

.wait-main {
  flex: 1;
  min-width: 0;
}

.wait-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}

.wait-top strong {
  font-size: 16px;
}

.wait-top .muted {
  color: var(--ink-2);
  font-size: 14px;
}

.wait-meta {
  font-size: 13px;
  color: var(--muted);
}

.match {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 3px;
  background: var(--court-50);
  color: var(--court-700);
  font-size: 14px;
  font-weight: 600;
}

.match.blocked {
  background: var(--amber-50);
  color: var(--amber);
}

.match.pending {
  background: var(--paper-2);
  color: var(--ink-2);
}

.match.ok {
  background: var(--go-50);
  color: var(--go);
}

.spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.wait-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
}

/* Side column: smaller items + staff */
.attn-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.side-title {
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.todo,
.staff-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.todo-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.todo-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.todo-ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tone-red.todo-ico { background: var(--red-50); color: var(--red); }
.tone-amber.todo-ico { background: var(--amber-50); color: var(--amber); }
.tone-blue.todo-ico { background: var(--court-50); color: var(--court); }
.tone-green.todo-ico { background: var(--go-50); color: var(--go); }

.todo-main strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.todo-main span {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.4;
}

.todo-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.todo-actions:empty {
  display: none;
}

.todo-item.done {
  animation: settle var(--dur-3) var(--ease-out);
}

.todo-item.done strong {
  color: var(--go);
}

.staff-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}

.staff-list li > div {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.staff-list strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.staff-list span:not(.av) {
  font-size: 13px;
  color: var(--muted);
}

.staff-st {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
}

.st-ball { background: var(--ball); color: var(--ink); }
.st-green { background: var(--go-50); color: var(--go); }
.st-blue { background: var(--court-50); color: var(--court-700); }
.st-red { background: var(--red-50); color: var(--red); }

/* Highlight when jumped to */
.flash .attn-content,
.flash.card {
  animation: flash 1.4s var(--ease-out);
}

@keyframes flash {
  0%,
  35% {
    box-shadow: 0 0 0 4px var(--ball), 0 0 0 5px var(--ink);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ---------- Generic card ---------- */
.card {
  min-width: 0;
  padding: 20px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.card-head {
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}

.card-head .section-note {
  margin-top: 6px;
}

/* ---------- Schedule board ---------- */
.schedule {
  padding-bottom: 18px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--ink-2);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tdot {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: var(--c-bg);
  box-shadow: inset 3px 0 0 var(--c), inset 0 0 0 1px rgba(20, 26, 34, 0.35);
}

.tdot.t-open-slot {
  background: transparent;
  box-shadow: none;
  border: 1.5px dashed var(--court);
}

.timeline-scroll {
  overflow-x: auto;
  margin: 8px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 2px;
  background: var(--court);
  /* Court surround, outside the painted boundary line */
  box-shadow: 0 0 0 8px var(--court);
  scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

.timeline {
  --label: 104px;
  position: relative;
  min-width: 1560px;
  color: #fff;
}

.tl-head {
  display: flex;
  height: 44px;
}

.tl-corner {
  position: sticky;
  left: 0;
  z-index: 6;
  flex: none;
  width: var(--label);
  background: var(--court);
}

.tl-hours {
  position: relative;
  flex: 1;
}

.tl-hours span {
  position: absolute;
  bottom: 6px;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  color: #dbe5f1;
  font-variant-numeric: tabular-nums;
}

.tl-hours span:first-of-type {
  transform: none;
}

.tl-hours span:last-of-type {
  transform: translateX(-100%);
}

.tl-prime-label {
  position: absolute;
  top: 2px;
  height: 18px;
  border-top: 2px solid var(--ball);
  color: var(--ball);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
  line-height: 16px;
}

.tl-row {
  display: flex;
  height: 58px;
  border-top: 2px solid rgba(255, 255, 255, 0.78);
}

.tl-row:last-child {
  border-bottom: 2px solid rgba(255, 255, 255, 0.78);
}

.tl-label {
  position: sticky;
  left: 0;
  z-index: 6;
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: var(--label);
  padding-left: 8px;
  background: var(--court-700);
  border-right: 2px solid rgba(255, 255, 255, 0.78);
  line-height: 1.15;
}

.tl-label strong {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tl-label span {
  font-size: 12px;
  color: #c9d7e8;
}

.tl-track {
  position: relative;
  flex: 1;
}

.tl-prime {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(220, 240, 60, 0.1);
}

.tl-past {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: rgba(16, 40, 65, 0.42);
}

.tl-grid {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.13);
}

.tl-open {
  position: absolute;
  top: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  padding: 0 9px;
  border: 1.5px dashed rgba(255, 255, 255, 0.55);
  border-radius: 3px;
  color: #dbe5f1;
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
}

.tl-open.prime {
  border-color: var(--ball);
  color: var(--ball);
  background: rgba(220, 240, 60, 0.08);
}

.tl-block {
  position: absolute;
  top: 7px;
  bottom: 7px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0 8px 0 11px;
  border: 0;
  border-radius: 3px;
  background: var(--c-bg);
  color: var(--c-ink);
  box-shadow: inset 4px 0 0 var(--c);
  text-align: left;
  line-height: 1.2;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1);
}

.tl-block:hover {
  z-index: 3;
  transform: translateY(-1px);
  box-shadow: inset 4px 0 0 var(--c), 0 6px 14px rgba(8, 20, 35, 0.4);
}

.tl-block:focus-visible {
  z-index: 5;
  outline: 3px solid var(--ball);
  outline-offset: 1px;
}

.tl-title,
.tl-sub {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tl-title {
  font-size: 13px;
  font-weight: 700;
}

.tl-sub {
  margin-top: 1px;
  font-size: 12px;
  opacity: 0.82;
}

/* Finished sessions become ghost tags on the court */
.tl-block.st-done {
  --c: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
  color: #e3eaf3;
}

.tl-block.st-live {
  box-shadow: inset 4px 0 0 var(--c), 0 0 0 2px var(--ball);
}

.tl-live {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--go);
  animation: live 1.8s ease-out infinite;
}

@keyframes live {
  0% {
    box-shadow: 0 0 0 0 rgba(28, 107, 69, 0.55);
  }
  100% {
    box-shadow: 0 0 0 7px rgba(28, 107, 69, 0);
  }
}

.tl-block.st-noshow {
  --c: rgba(255, 255, 255, 0.4);
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0 5px, rgba(255, 255, 255, 0.03) 5px 10px);
  color: #e3eaf3;
}

.tl-block.st-noshow .tl-title,
.tl-block.st-cancelled .tl-title {
  text-decoration: line-through;
}

.tl-block.st-cancelled {
  --c: transparent;
  background: transparent;
  color: #dbe5f1;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45);
}

.tl-block.st-pending {
  box-shadow: inset 4px 0 0 var(--c), inset 0 0 0 2px var(--c);
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(87, 68, 151, 0.12) 6px 8px);
}

.tl-block.conflict {
  --c: var(--red);
  --c-ink: #fff;
  background: repeating-linear-gradient(135deg, #c4311d 0 6px, #ad2814 6px 12px);
  color: #fff;
  box-shadow: 0 0 0 1.5px #fff;
}

.tl-block.conflict.lane-0 {
  top: 4px;
  bottom: 50%;
  margin-bottom: 1px;
}

.tl-block.conflict.lane-1 {
  top: 50%;
  bottom: 4px;
  margin-top: 1px;
}

.tl-block.conflict .tl-sub {
  display: none;
}

.tl-block.st-nocoach {
  box-shadow: inset 4px 0 0 var(--c), 0 0 0 2.5px #ffb547;
}

.tl-flag {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-top: -8.5px;
  border-radius: 50%;
  background: #fff;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.st-nocoach .tl-flag {
  background: #ffb547;
  color: var(--ink);
}

.st-nocoach .tl-title,
.st-nocoach .tl-sub,
.conflict .tl-title {
  padding-right: 20px;
}

.tl-now {
  position: absolute;
  top: 26px;
  bottom: 0;
  left: calc(var(--label) + (100% - var(--label)) * var(--now));
  width: 2px;
  margin-left: -1px;
  background: var(--ball);
  z-index: 4;
  pointer-events: none;
}

.tl-now span {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translate(-50%, -100%);
  padding: 1px 7px;
  border-radius: 3px;
  background: var(--ball);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Two-column rows ---------- */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.bookings {
  display: flex;
  flex-direction: column;
}

.two-col-even {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}

/* ---------- Bookings table ---------- */
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius);
  background: var(--paper-2);
}

.seg button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color var(--dur-1), color var(--dur-1);
}

.seg button:hover {
  color: var(--ink);
  background: rgba(20, 26, 34, 0.05);
}

.seg button[aria-selected="true"] {
  background: var(--ink);
  color: #fff;
}

.table-wrap {
  /* Fills whatever height the check-ins column sets; scrolls inside */
  flex: 1 1 0;
  min-height: 420px;
  overflow: auto;
  margin: 0 -22px -22px;
  border-top: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
}

.table th:first-child,
.table td:first-child {
  padding-left: 22px;
}

.table th:last-child,
.table td:last-child {
  padding-right: 22px;
}

.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}

.table tbody tr {
  cursor: pointer;
  transition: background-color var(--dur-1);
}

.table tbody tr:hover {
  background: #faf8f1;
}

.table tbody tr:focus-visible {
  outline: 3px solid var(--court);
  outline-offset: -3px;
}

.table .num {
  text-align: right;
}

.nowrap {
  white-space: nowrap;
}

.table td:first-child {
  font-weight: 600;
}

.bk {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.bk .tdot {
  margin-top: 3px;
}

.bk strong {
  display: block;
  font-weight: 600;
}

.bk span:not(.tdot) {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.warn-text {
  color: var(--amber);
  font-weight: 700;
}

.row-conflict {
  background: var(--red-50);
}

.row-conflict td:first-child {
  box-shadow: inset 4px 0 0 var(--red);
}

.row-nocoach td:first-child {
  box-shadow: inset 4px 0 0 var(--amber);
}

.row-done {
  color: var(--muted);
}

.empty {
  padding: 28px 22px !important;
  text-align: center;
  color: var(--muted);
}

/* Payment + status labels */
.pay,
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pay.paid { background: var(--go-50); color: var(--go); }
.pay.due { background: var(--amber-50); color: var(--amber); box-shadow: inset 0 0 0 1px rgba(146, 84, 0, 0.35); }
.pay.sent { background: var(--court-50); color: var(--court-700); }
.pay.pass { background: var(--paper-2); color: var(--ink-2); }
.pay.refunded { background: var(--paper-2); color: var(--muted); text-decoration: line-through; }
.pay.none { color: var(--muted); padding-left: 0; }

.status {
  padding: 0;
  color: var(--muted);
  font-weight: 600;
}

.status.s-live {
  padding: 2px 8px;
  background: var(--ink);
  color: #fff;
}

.status.s-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ball);
}

.status.s-conflict,
.status.s-nocoach,
.status.s-noshow,
.status.s-pending,
.status.s-cancelled {
  padding: 2px 8px;
}

.status.s-conflict { background: var(--red); color: #fff; }
.status.s-nocoach { background: var(--amber-50); color: var(--amber); }
.status.s-noshow { background: var(--red-50); color: var(--red); }
.status.s-pending { background: var(--violet-50); color: var(--violet); }
.status.s-cancelled { background: var(--paper-2); color: var(--muted); }
.status.s-done { color: var(--muted); font-weight: 500; }
.status.s-upcoming { color: var(--ink-2); }

/* ---------- Check-ins ---------- */
.sub-title {
  margin: 4px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.arrivals,
.recent {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.arrival {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}

.arr-time {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.arr-time strong {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.arr-time span {
  font-size: 13px;
  color: var(--muted);
}

.arr-who {
  font-weight: 600;
}

.late {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 3px;
  background: var(--amber-50);
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
}

.faces {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.face {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px dashed #9aa1aa;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.face.in {
  border: 1.5px solid var(--go);
  background: var(--go);
  color: #fff;
}

.arrivals .empty,
.recent .empty {
  padding: 16px 0 !important;
  text-align: left;
}

.recent li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-2);
}

.recent li > div {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.recent strong {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
}

.recent span:not(.av) {
  font-size: 13px;
  color: var(--muted);
}

.recent time {
  font-size: 13px;
  color: var(--muted);
}

.recent li.fresh {
  animation: settle var(--dur-3) var(--ease-out);
}

.recent li.fresh time {
  color: var(--go);
  font-weight: 700;
}

/* ---------- Revenue ---------- */
.rev-total {
  text-align: right;
  line-height: 1.2;
}

.rev-total strong {
  display: block;
  font-family: var(--display);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
}

.rev-total span {
  font-size: 13px;
  color: var(--muted);
}

.rev-total span strong {
  display: inline;
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
}

.rev-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  height: 220px;
  padding-top: 8px;
  background: repeating-linear-gradient(to top, transparent 0 43px, var(--line-2) 43px 44px);
  border-bottom: 2px solid var(--ink);
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  min-width: 0;
  position: relative;
}

.bar-val {
  margin-bottom: 4px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  color: var(--ink-2);
}

.bar {
  min-height: 4px;
  background: var(--court);
  border-radius: 2px 2px 0 0;
}

.bar-col.today .bar {
  background: var(--ball);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.bar-col.today .bar-val {
  color: var(--ink);
  font-weight: 700;
}

.bar-col.booked .bar {
  background: repeating-linear-gradient(135deg, var(--court-100) 0 4px, transparent 4px 8px);
  box-shadow: inset 0 0 0 1.5px var(--court);
}

.bar-col.booked .bar-val {
  color: var(--muted);
}

.bar-day {
  position: absolute;
  bottom: -26px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.bar-col.today .bar-day {
  color: var(--ink);
  font-weight: 700;
}

.rev-breakdown {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 24px;
}

.rev-breakdown .stack {
  grid-column: 1 / -1;
  display: flex;
  height: 14px;
  margin-bottom: 8px;
  border-radius: 2px;
  overflow: hidden;
  gap: 2px;
}

.rev-breakdown li:not(.stack) {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto 40px;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 14px;
}

.sw {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.rb-amt {
  font-weight: 700;
}

.rb-pct {
  text-align: right;
  color: var(--muted);
}

.tone-green { background: var(--court); }
.tone-orange { background: #c8682a; }
.tone-ball { background: var(--ball); box-shadow: inset 0 0 0 1px rgba(20, 26, 34, 0.45); }
.tone-indigo { background: var(--violet); }
.tone-gray { background: #a3a8ae; }

/* ---------- No-shows ---------- */
.ns-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ns-list li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
}

.ns-day {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.ns-list li:first-child .ns-day {
  color: var(--ink);
}

.ns-main {
  min-width: 0;
  line-height: 1.3;
}

.ns-main strong {
  font-weight: 600;
}

.ns-main span {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.repeat {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 3px;
  background: var(--red-50);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
}

.noshows .hint {
  margin-top: 16px;
}

.proto-note {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ---------- Popover ---------- */
.popover {
  position: fixed;
  z-index: 100;
  width: 360px;
  max-width: calc(100vw - 24px);
  padding: 16px 18px 18px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-pop);
  animation: pop-in var(--dur-2) var(--ease-out);
}

.popover[hidden] {
  display: none;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
}

.pop-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pop-close {
  margin-left: auto;
  width: 36px;
  height: 36px;
  margin-right: -8px;
}

.popover h3 {
  margin-top: 8px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
}

.pop-alert {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--red-50);
  color: #7c1c0e;
  font-size: 14px;
  border-left: 3px solid var(--red);
}

.popover dl {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 7px 12px;
  margin: 12px 0 0;
  font-size: 14px;
}

.popover dt {
  color: var(--muted);
}

.popover dd {
  margin: 0;
  font-weight: 500;
}

.pop-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  padding: 12px 16px 12px 12px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}

.toast.in {
  opacity: 1;
  transform: none;
}

.toast-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ball);
  color: var(--ink);
}

.toast-info .toast-ico {
  background: #fff;
}

.toast-ico svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .attn-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }

  .table-wrap {
    flex: none;
    max-height: 560px;
  }
}

@media (max-width: 1180px) {
  .attn-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .attn-side {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 28px;
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi:nth-child(3) {
    border-left: 0;
  }

  .kpi:nth-child(n + 3) {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }
}

@media (max-width: 1024px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    z-index: 90;
    left: 0;
    top: 0;
    width: 280px;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2);
    box-shadow: var(--shadow-pop);
  }

  .nav-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform var(--dur-2) var(--ease-out);
  }

  .nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(20, 26, 34, 0.4);
  }

  .menu-btn {
    display: grid;
  }

  .topbar {
    padding: 0 20px;
  }

  .content {
    padding: 24px 20px 40px;
  }

  .two-col-even {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar {
    gap: 8px;
    padding: 0 12px;
  }

  .search kbd,
  .clock,
  .avatar {
    display: none;
  }

  .search {
    max-width: none;
  }

  #newBookingBtn {
    padding: 0 12px;
  }

  .content {
    padding: 20px 14px 32px;
    gap: 28px;
  }

  .page-chips {
    flex-direction: column;
    width: 100%;
  }

  .chip {
    white-space: normal;
  }

  .chip + .chip {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .kpi {
    padding: 14px 14px 16px;
    min-height: 160px;
  }

  .kpi-value {
    font-size: 44px;
  }

  .kpi-of {
    font-size: 22px;
  }

  .kpi-sub {
    font-size: 13px;
  }

  .runsheet::before {
    display: none;
  }

  .attn-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .attn-rail {
    flex-direction: row;
    align-items: center;
    padding: 0 0 8px;
    gap: 10px;
  }

  .rail-time,
  .rail-time-sm {
    padding: 0;
    font-size: 15px;
  }

  .rail-time span {
    display: inline;
    font-size: 24px;
  }

  .rail-time-sm br {
    display: none;
  }

  .attn-content {
    padding: 16px 14px 18px;
  }

  .attn-head h3 {
    font-size: 23px;
  }

  .clash {
    grid-template-columns: minmax(0, 1fr);
  }

  .clash-vs {
    padding: 0 16px;
    justify-items: start;
  }

  .clash-vs::before {
    top: 50%;
    bottom: auto;
    left: 0;
    right: 0;
    border-left: 0;
    border-top: 1.5px dashed var(--red);
  }

  .wait-item {
    flex-wrap: wrap;
  }

  .wait-actions {
    width: 100%;
    justify-content: flex-start;
    padding-left: 48px;
  }

  .attn-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .card {
    padding: 16px 14px 18px;
  }

  .table-wrap {
    margin: 0 -14px -18px;
  }

  .table th:first-child,
  .table td:first-child {
    padding-left: 14px;
  }

  .table th:last-child,
  .table td:last-child {
    padding-right: 14px;
  }

  .timeline {
    --label: 74px;
  }

  .tl-label strong {
    font-size: 15px;
  }

  .rev-total {
    text-align: left;
  }

  .rev-breakdown {
    grid-template-columns: minmax(0, 1fr);
  }

  .bars {
    gap: 6px;
  }

  .bar-val {
    font-size: 11px;
  }

  .arrival {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .arrival .btn {
    grid-column: 2;
    justify-self: start;
  }

  .toasts {
    left: 12px;
    right: 12px;
    bottom: 12px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 560px) {
  #newBookingBtn {
    font-size: 0;
    gap: 0;
    width: 44px;
    padding: 0;
  }

  #newBookingBtn svg {
    width: 16px;
    height: 16px;
  }

  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
  }

  .table tr {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas:
      "time court court status"
      "bk bk bk bk"
      "pay pay players players";
    gap: 6px 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-2);
  }

  .table td {
    padding: 0 !important;
    border: 0;
  }

  .table td:nth-child(1) { grid-area: time; }
  .table td:nth-child(2) { grid-area: court; color: var(--muted); }
  .table td:nth-child(3) { grid-area: bk; }
  .table td:nth-child(4) { grid-area: players; text-align: right; }
  .table td:nth-child(4)::after { content: " players"; color: var(--muted); font-size: 13px; }
  .table td:nth-child(5) { grid-area: pay; }
  .table td:nth-child(6) { grid-area: status; justify-self: end; }

  .row-conflict td:first-child,
  .row-nocoach td:first-child {
    box-shadow: none;
  }

  .row-conflict {
    box-shadow: inset 4px 0 0 var(--red);
  }

  .row-nocoach {
    box-shadow: inset 4px 0 0 var(--amber);
  }

  .table tr:has(.empty) {
    display: block;
  }

  .seg {
    width: 100%;
    overflow-x: auto;
  }

  .seg button {
    flex: 1 0 auto;
  }
}
