/* Rally — manager dashboard */

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

.app {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px 18px;
  background: var(--court-deep);
  color: rgba(255, 255, 255, 0.8);
}
.sidebar .logo { color: #fff; padding: 0 8px; }
.club-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.club-switch:hover { background: rgba(255, 255, 255, 0.09); }
.club-badge {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: #f0e3c4; color: #7a4a12;
  font-family: var(--font-display); font-weight: 750; font-size: 13px;
}
.club-text { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.club-text strong { font-size: 14px; }
.club-text span { font-size: 12px; color: rgba(255, 255, 255, 0.55); }
.club-switch svg { color: rgba(255, 255, 255, 0.5); }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
}
.side-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side-nav a.active { background: rgba(216, 241, 74, 0.12); color: var(--ball); }
.side-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-count {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--clay);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.side-foot { margin-top: auto; display: grid; gap: 14px; }
.plan-chip {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
  display: grid;
  gap: 6px;
}
.plan-chip span { color: #fff; font-weight: 600; }
.plan-chip small { color: rgba(255, 255, 255, 0.55); }
.plan-meter { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.plan-meter i { display: block; height: 100%; background: var(--ball); border-radius: inherit; }
.me { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.me strong { display: block; color: #fff; font-size: 13.5px; }
.me small { color: rgba(255, 255, 255, 0.55); font-size: 12px; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--ball); color: var(--court-ink);
  font-weight: 700; font-size: 12.5px;
}
.avatar.sm { width: 30px; height: 30px; font-size: 11px; background: var(--paper-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- Topbar ---------- */
.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 32px;
  background: rgba(246, 244, 238, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.hello { color: var(--ink-3); font-size: 13px; font-weight: 500; }
.topbar h1 { font-size: 26px; letter-spacing: -0.03em; }
.topbar-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}
.chip-now strong { color: var(--ink); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 0 3px rgba(212, 85, 47, 0.18); }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-3);
  width: 260px;
}
.search:focus-within { border-color: var(--court); box-shadow: 0 0 0 3px rgba(29, 90, 66, 0.12); }
.search input { border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); width: 100%; }

/* ---------- Layout ---------- */
.content {
  padding: 24px 32px 48px;
  display: grid;
  gap: 24px;
  max-width: 1560px;
}
.row { display: grid; gap: 24px; align-items: start; }
.row-bookings { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); }
.row-week { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); }

.panel, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.panel { padding: 20px 22px; min-width: 0; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.panel-head h2, .section-title h2 { font-size: 18px; letter-spacing: -0.02em; }
.panel-sub { color: var(--ink-3); font-size: 13px; margin-top: 3px; }
.muted { color: var(--ink-3); font-weight: 400; }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.ta-r { text-align: right; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  vertical-align: middle;
}
.pill svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pill-red { background: var(--clay-soft); color: #a93c1b; }
.pill-green { background: var(--court-soft); color: var(--court); }
.pill-amber { background: var(--amber-soft); color: #7a520a; }
.pill-grey { background: var(--paper-2); color: var(--ink-2); }
.pill-ball { background: var(--ball); color: var(--court-ink); height: 19px; font-size: 10.5px; }
.pill-live { background: #e6f4ea; color: #137a3c; }
.pill-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------- KPIs ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.kpi {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}
.kpi-label { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.kpi-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.kpi-value small { font-size: 17px; color: var(--ink-3); font-weight: 500; letter-spacing: -0.01em; }
.kpi-foot { font-size: 12.5px; color: var(--ink-3); }
.kpi-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi-delta {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.kpi-delta.up { background: var(--court-soft); color: var(--court); }
.kpi-delta.down { background: var(--clay-soft); color: #a93c1b; }
.bar { height: 6px; border-radius: 999px; background: var(--paper-2); overflow: hidden; margin: 2px 0; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--court); transition: width 0.4s; }
.bar-ball i { background: linear-gradient(90deg, var(--ball-deep), var(--ball)); }
.pips { display: flex; gap: 4px; margin: 2px 0; }
.pips i { flex: 1; height: 6px; border-radius: 3px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.pips i.on { background: var(--court); box-shadow: none; }

/* ---------- Needs you ---------- */
.section-title { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; }
.section-title p { color: var(--ink-3); font-size: 13px; }
.count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--clay);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  vertical-align: 3px;
}
.count.zero { background: var(--court); }

.needs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.need-card {
  padding: 18px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.need-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--line-2);
}
.need-card.tone-clay::before { background: var(--clay); }
.need-card.tone-amber::before { background: var(--amber); }
.need-card.is-resolved::before { background: var(--court); }
.need-card.is-resolved.is-neutral::before { background: var(--ink-3); }
.need-card.is-resolved { background: linear-gradient(180deg, #fbfdfb, #fff); }
.nc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nc-when { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.nc-when strong { color: var(--ink); }
.need-card h3 { font-size: 18px; letter-spacing: -0.02em; line-height: 1.2; }
.nc-body { color: var(--ink-2); font-size: 13.5px; }
.nc-body strong { color: var(--ink); }
.nc-why { font-size: 12.5px; color: var(--ink-3); }
.nc-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nc-actions-split { justify-content: space-between; padding-top: 12px; border-top: 1px dashed var(--line); }
.nc-hint { font-size: 12.5px; color: var(--ink-3); }

.clash { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.clash li {
  display: flex;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.clash li div { display: flex; flex-direction: column; min-width: 0; }
.clash strong { font-size: 13.5px; }
.clash span:not(.clash-bar) { font-size: 12.5px; color: var(--ink-3); }
.clash-bar { width: 4px; border-radius: 2px; flex: none; }
.clash-bar.t-booking { background: var(--court); }
.clash-bar.t-ladder { background: var(--sky); }

.nc-fix {
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--court-soft);
  color: var(--court-ink);
  font-size: 13px;
}
.nc-fix-warn { background: var(--amber-soft); color: #5a3d07; }
.nc-fix-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 2px; opacity: 0.75; }

.subs, .wls { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sub, .wl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.sub:first-child, .wl:first-child { border-top: 0; padding-top: 2px; }
.sub div, .wl > div { display: flex; flex-direction: column; min-width: 0; }
.sub strong, .wl strong { font-size: 13.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sub span, .wl > div > span { font-size: 12.5px; color: var(--ink-3); }
.sub .sub-avail { color: var(--court); font-weight: 500; }
.sub.is-off { opacity: 0.55; }
.sub.is-off .sub-avail { color: var(--ink-3); }
.sub-na { font-size: 12px; color: var(--ink-3); }
.asking { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--court);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.wl-open { margin-top: 6px; font-size: 12.5px; border-radius: 8px; padding: 6px 9px; }
.wl-open.good { background: var(--court-soft); color: var(--court-ink); }
.wl-open.warn { background: var(--amber-soft); color: #5a3d07; }
.wl-open.none { background: var(--paper); color: var(--ink-3); }
.wl-open em { display: block; font-style: normal; margin-top: 3px; font-weight: 500; }
.wl.is-booked > div > span { color: var(--court); }

.needs-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.need-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 170px auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.need-row:first-child { border-top: 0; }
.need-ico {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
}
.need-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tone-amber .need-ico { background: var(--amber-soft); color: var(--amber); }
.tone-clay .need-ico { background: var(--clay-soft); color: var(--clay); }
.need-row.is-done .need-ico { background: var(--court-soft); color: var(--court); }
.need-text { display: flex; flex-direction: column; min-width: 0; }
.need-text strong { font-size: 14px; }
.need-text span { font-size: 12.5px; color: var(--ink-3); }
.need-when { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.need-actions { display: flex; gap: 6px; justify-content: flex-end; }
.need-row.is-done .need-text strong { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.need-row.is-done .need-text span { color: var(--court); }
.need-row.is-done .need-when { color: var(--court); }

/* ---------- Schedule grid ---------- */
.schedule { padding-bottom: 14px; }
.legend { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-booking { background: #dcebe2; box-shadow: inset 3px 0 var(--court); }
.sw-open { background: #f1f8c8; box-shadow: inset 3px 0 var(--ball-deep); }
.sw-league { background: var(--sky-soft); box-shadow: inset 3px 0 var(--sky); }
.sw-clinic { background: var(--plum-soft); box-shadow: inset 3px 0 var(--plum); }
.sw-hold { background: #fff; box-shadow: inset 0 0 0 1.5px var(--amber); }
.sw-conflict { background: var(--clay-soft); box-shadow: inset 0 0 0 1.5px var(--clay); }

.grid-scroll {
  overflow-x: auto;
  margin: 0 -22px;
  padding: 0 22px 6px;
  scrollbar-width: thin;
}
.grid { position: relative; }
.g-head { display: flex; height: 30px; }
.g-corner { width: 112px; flex: none; position: sticky; left: -22px; background: var(--card); z-index: 6; }
.g-hours { position: relative; flex: none; }
.g-hours span {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.g-hours span:first-child { transform: none; }
.g-hours span:nth-last-child(2) { transform: translateX(-100%); }
.g-hours .g-prime {
  top: -2px;
  transform: none;
  height: 0;
  font-size: 0;
}
.g-row { display: flex; height: 60px; position: relative; }
.g-row + .g-row .g-lane, .g-row + .g-row .g-label { border-top: 1px solid var(--line); }
.g-head + .g-row .g-lane, .g-head + .g-row .g-label { border-top: 1px solid var(--line); }
.g-label {
  width: 112px;
  flex: none;
  position: sticky;
  left: -22px;
  z-index: 6;
  background: var(--card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 22px;
  border-right: 1px solid var(--line);
}
.g-label strong { font-size: 13.5px; }
.g-label span { font-size: 11.5px; color: var(--ink-3); }
.g-row.has-conflict .g-label strong { color: #a93c1b; }
.g-row.has-conflict .g-label::after {
  content: "";
  position: absolute;
  left: 8px; top: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--clay);
  transform: translateY(-50%);
}
.g-lane { position: relative; flex: none; z-index: 1; }

.g-overlay { position: absolute; top: 30px; bottom: 0; left: 112px; pointer-events: none; }
.g-prime-band {
  position: absolute; top: -30px; bottom: 0;
  background: rgba(216, 241, 74, 0.13);
  border-left: 1px dashed rgba(150, 170, 20, 0.45);
  border-right: 1px dashed rgba(150, 170, 20, 0.45);
  z-index: 0;
}
.g-prime-band::before {
  content: "Prime time";
  position: absolute;
  top: 6px; right: 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: #6b7a0a;
}
.g-past {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: repeating-linear-gradient(135deg, rgba(18, 32, 26, 0.022) 0 6px, transparent 6px 12px);
  z-index: 0;
}
.g-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); opacity: 0.6; z-index: 0; }
.g-now {
  position: absolute; top: -8px; bottom: 0;
  width: 2px; margin-left: -1px;
  background: var(--clay);
  z-index: 4;
}
.g-now span {
  position: absolute; top: -16px; left: 50%;
  transform: translateX(-50%);
  background: var(--clay); color: #fff;
  font-size: 10.5px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.blk {
  position: absolute;
  top: 6px;
  height: calc(100% - 12px);
  margin-left: 1.5px;
  border: 0;
  border-radius: 7px;
  padding: 5px 8px 5px 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  overflow: hidden;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.25;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.2s;
}
.blk strong, .blk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.blk strong { font-weight: 650; display: flex; align-items: center; gap: 5px; }
.blk span { font-size: 11px; opacity: 0.78; }
.blk:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(18, 32, 26, 0.45); z-index: 3; }

.blk.t-booking { background: #dcebe2; color: #123f2e; box-shadow: inset 3px 0 var(--court); }
.blk.t-open { background: #f1f8c8; color: #48520a; box-shadow: inset 3px 0 var(--ball-deep); }
.blk.t-league, .blk.t-ladder { background: var(--sky-soft); color: #1f4590; box-shadow: inset 3px 0 var(--sky); }
.blk.t-clinic, .blk.t-lesson, .blk.t-program { background: var(--plum-soft); color: #4f2d88; box-shadow: inset 3px 0 var(--plum); }
.blk.t-maint { background: repeating-linear-gradient(135deg, var(--paper-2) 0 5px, #e6e2d6 5px 10px); color: var(--ink-3); }
.blk.t-hold { background: #fffaf0; color: #7a520a; box-shadow: inset 0 0 0 1.5px var(--amber); border: 0; }
.blk.t-hold strong::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); animation: blink 1.4s infinite; }

.blk.s-done { opacity: 0.55; }
.blk.s-noshow { opacity: 0.85; background: repeating-linear-gradient(135deg, #fbefe9 0 5px, #fff 5px 10px); color: #a93c1b; box-shadow: inset 3px 0 var(--clay); }
.blk.s-live { box-shadow: inset 3px 0 var(--court), 0 0 0 1.5px rgba(29, 90, 66, 0.35); }
.blk.t-program.s-live { box-shadow: inset 3px 0 var(--plum), 0 0 0 1.5px rgba(115, 71, 184, 0.35); }

.blk.lane-top { top: 4px; height: calc(50% - 5px); padding-top: 2px; padding-bottom: 2px; }
.blk.lane-bot { top: calc(50% + 1px); height: calc(50% - 5px); padding-top: 2px; padding-bottom: 2px; }
.blk.lane-top span, .blk.lane-bot span { display: none; }
.blk.is-conflict {
  background: #fdeee8;
  color: #8f2f12;
  box-shadow: inset 0 0 0 1.5px var(--clay);
  animation: conflictPulse 2s ease-in-out infinite;
}
@keyframes conflictPulse { 50% { box-shadow: inset 0 0 0 1.5px var(--clay), 0 0 0 3px rgba(212, 85, 47, 0.18); } }
.blk.is-flag { box-shadow: inset 3px 0 var(--plum), inset 0 0 0 1.5px var(--clay); }
.blk.is-flag span { color: #a93c1b; opacity: 1; font-weight: 600; }
.warn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--clay); flex: none; display: inline-block; }
.blk.is-dim { opacity: 0.2; }
.blk.is-match { box-shadow: inset 0 0 0 2px var(--ink); opacity: 1; z-index: 2; }
.blk.is-flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(216, 241, 74, 0.95); transform: scale(1.03); } 100% { box-shadow: 0 0 0 10px rgba(216, 241, 74, 0); transform: none; } }

/* ---------- Bookings table ---------- */
.tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--paper-2);
  gap: 2px;
}
.tabs button {
  border: 0;
  background: transparent;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.tabs button span { font-weight: 500; color: var(--ink-3); margin-left: 3px; font-variant-numeric: tabular-nums; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.table-wrap { max-height: 520px; overflow: auto; margin: 0 -22px -20px; border-top: 1px solid var(--line); }
.bk-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.bk-table th {
  position: sticky; top: 0; z-index: 1;
  background: #fbfaf7;
  text-align: left;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.bk-table th:first-child, .bk-table td:first-child { padding-left: 22px; }
.bk-table th:last-child, .bk-table td:last-child { padding-right: 22px; }
.bk-table th:nth-child(1) { width: 132px; }
.when-cell small { display: block; color: var(--ink-3); font-size: 12px; }
.nav-count[hidden] { display: none; }
.bk-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.bk-table tr:last-child td { border-bottom: 0; }
.bk-table tr:hover td { background: #fcfbf8; }
.bk-table tr.is-past td { color: var(--ink-3); }
.link-cell {
  display: flex; align-items: flex-start; gap: 10px;
  border: 0; background: none; padding: 0; text-align: left; cursor: pointer;
}
.link-cell strong { font-weight: 600; }
.link-cell:hover strong { text-decoration: underline; text-underline-offset: 2px; }
.link-cell strong { white-space: nowrap; }
.link-cell small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.link-cell .pill { margin-left: 4px; height: 19px; font-size: 10.5px; }
.dot { width: 9px; height: 9px; border-radius: 3px; flex: none; margin-top: 5px; display: inline-block; }
.dot.t-booking { background: var(--court); }
.dot.t-open { background: var(--ball-deep); }
.dot.t-league, .dot.t-ladder { background: var(--sky); }
.dot.t-clinic, .dot.t-lesson, .dot.t-program { background: var(--plum); }
.dot.t-hold { background: var(--amber); }
.dot.t-maint { background: var(--ink-3); }
.ci-cell { display: flex; align-items: center; gap: 8px; }
.ci-cell .num { min-width: 34px; }
.mini-bar { width: 36px; height: 5px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--court); border-radius: inherit; }
.pay { font-size: 12.5px; white-space: nowrap; }
.pay::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.pay-paid::before { background: var(--court); }
.pay-desk { color: #7a520a; }
.pay-desk::before { background: var(--amber); }
.pay-plan { color: var(--ink-3); }
.pay-plan::before { background: var(--line-2); }
.empty { text-align: center; color: var(--ink-3); padding: 36px 12px !important; }

/* ---------- Check-ins ---------- */
.ci-meter { margin-bottom: 8px; }
.ci-big { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ci-big .num { font-family: var(--font-display); font-size: 36px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--court); }
.ci-big span:last-child { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.ci-big small { color: var(--ink-3); }
.feed { list-style: none; margin: 8px 0 0; padding: 0; }
.feed li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.feed li.is-fresh { animation: freshIn 1.6s ease-out; }
@keyframes freshIn { 0% { background: rgba(216, 241, 74, 0.45); } 100% { background: transparent; } }
.feed li > div:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.feed strong { font-size: 13.5px; }
.feed li > div:nth-child(2) span { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-meta { text-align: right; font-size: 12.5px; display: flex; flex-direction: column; }
.feed-meta small { color: var(--ink-3); font-size: 11.5px; }
.avatar.tag-junior { background: var(--plum-soft); color: #573394; box-shadow: none; }
.avatar.tag-guest { background: var(--amber-soft); color: #7a520a; box-shadow: none; }
.avatar.tag-dropin { background: #f1f8c8; color: #48520a; box-shadow: none; }
.avatar.tag-staff { background: var(--court); color: var(--ball); box-shadow: none; }
.avatar.tag-member { background: var(--court-soft); color: var(--court); box-shadow: none; }

/* ---------- Revenue ---------- */
.rev-total { text-align: right; }
.rev-total .num { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.rev-total small { color: var(--ink-3); font-size: 12.5px; }
.chart { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; height: 220px; margin-top: 4px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--ink-3); padding-bottom: 34px; text-align: right; }
.chart-y span { transform: translateY(-50%); }
.chart-y span:last-child { transform: translateY(50%); }
.chart-bars { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; padding-bottom: 34px; }
.chart-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.chart-bars::after { content: ""; position: absolute; left: 0; right: 0; bottom: 34px; height: 1px; background: var(--line-2); }
.col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.col-stack {
  width: 100%;
  max-width: 52px;
  display: flex;
  flex-direction: column;
  border-radius: 7px 7px 2px 2px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.seg { display: block; width: 100%; min-height: 2px; }
.seg-actual { background: var(--court); }
.seg-booked { background: repeating-linear-gradient(135deg, #cfe2d7 0 5px, #e3eee8 5px 10px); }
.col.is-today .seg-actual { background: var(--court-deep); }
.col-val { font-size: 11px; color: var(--ink-3); margin-bottom: 4px; white-space: nowrap; }
.col-day { position: absolute; bottom: 0; transform: translateY(100%); padding-top: 6px; font-size: 12px; font-weight: 600; text-align: center; line-height: 1.15; height: 34px; }
.col-day small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; }
.col.is-today .col-day { color: var(--court); }
.col.is-today .col-day::after { content: "Today"; display: block; }
.col.is-today .col-day small { display: none; }
.mix { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.mix-legend-row { display: flex; gap: 16px; font-size: 12px; color: var(--ink-3); margin-bottom: 14px; }
.mix-key { display: inline-flex; align-items: center; gap: 6px; }
.mix-key i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.mix-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; }
.mix-bar i { display: block; }
.mix-legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; font-size: 13px; }
.mix-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 36px; gap: 8px; align-items: center; }
.mix-legend i { width: 10px; height: 10px; border-radius: 3px; }
.mix-legend span { color: var(--ink-3); text-align: right; font-size: 12px; }

/* ---------- No-shows ---------- */
.ns-list { list-style: none; margin: 0; padding: 0; }
.ns-list li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 48px 104px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.ns-list li:first-child { border-top: 0; }
.ns-day { display: flex; flex-direction: column; font-size: 13px; line-height: 1.2; }
.ns-day small { color: var(--ink-3); font-size: 11.5px; }
.ns-list li > div { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 13.5px; }
.ns-list li > div > span:last-child { width: 100%; font-size: 12px; color: var(--ink-3); }
.ns-list .pill { height: 19px; font-size: 10.5px; }
.ns-lost { text-align: right; color: var(--ink-2); font-size: 13px; }
.ns-list li > :last-child { justify-self: end; }
.ns-list li.is-repeat { background: linear-gradient(90deg, rgba(251, 233, 226, 0.6), transparent); margin: 0 -22px; padding-left: 22px; padding-right: 22px; }
.ns-total { border-top: 1px solid var(--line-2) !important; }
.ns-total strong { font-size: 13.5px; }
.ns-total .ns-lost { font-weight: 700; color: var(--ink); }

/* ---------- Drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 30, 22, 0.28); z-index: 40; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: var(--card);
  z-index: 41;
  box-shadow: -20px 0 60px -20px rgba(10, 30, 22, 0.35);
  transform: translateX(105%);
  transition: transform 0.25s cubic-bezier(.2, .8, .2, 1);
  padding: 20px 24px 28px;
  overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.drawer-type { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.drawer-type .dot { margin-top: 0; }
.drawer h2 { font-size: 24px; letter-spacing: -0.03em; margin-bottom: 16px; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--paper-2); }
.d-alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 10px; margin-bottom: 10px;
  background: var(--clay-soft); color: #8f2f12; font-size: 13px;
}
.d-alert svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.d-note { padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; background: var(--paper); font-size: 13px; color: var(--ink-2); }
.d-list { margin: 6px 0 0; display: grid; }
.d-list div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.d-list dt { color: var(--ink-3); }
.d-list dd { margin: 0; }
.d-roster { margin-top: 20px; }
.d-roster-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.d-roster h3 { font-size: 15px; }
.d-roster ul { list-style: none; margin: 0; padding: 0; }
.d-roster li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.d-name { flex: 1; }
.d-actions { margin-top: 22px; display: flex; gap: 8px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  background: var(--court-ink); color: #fff;
  padding: 11px 14px 11px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  max-width: min(560px, calc(100vw - 32px));
}
.toast.show { opacity: 1; transform: none; }
.toast-ico { width: 22px; height: 22px; border-radius: 50%; background: var(--ball); color: var(--court-ink); display: grid; place-items: center; flex: none; }
.toast-ico svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.toast button { border: 0; background: transparent; color: var(--ball); font-weight: 700; cursor: pointer; margin-left: 6px; }

.proto-note { font-size: 12px; color: var(--ink-3); text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1380px) {
  .needs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .needs-grid > :last-child { grid-column: 1 / -1; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .row-bookings, .row-week { grid-template-columns: minmax(0, 1fr); }
  .need-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .need-when { display: none; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar, .content { padding-left: 18px; padding-right: 18px; }
  .needs-grid, .kpis { grid-template-columns: minmax(0, 1fr); }
  .search { width: 100%; }
  .topbar-actions { width: 100%; }
  .need-row { grid-template-columns: 34px minmax(0, 1fr); }
  .need-actions { grid-column: 2; justify-content: flex-start; }
  .mix-legend { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
