/* Rally dashboard — Operate. The world lends type, palette, density
   and one move: issues are sign plates, and the same plates mark the grid. */

html {
  font-size: 15px;
}
body {
  background: var(--galv-1);
  line-height: 1.4;
  font-size: 0.95rem;
}

h1, h2, h3, p {
  margin: 0;
}
.dim {
  color: var(--ink-3);
}

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

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px 16px;
  background: var(--green);
  color: var(--white);
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
.rail__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}
.rail__brand {
  background: var(--white);
  color: var(--green);
  box-shadow: inset 0 0 0 3px var(--white), inset 0 0 0 5px var(--green);
  font-size: 1rem;
}
.rail__close {
  display: none;
}
.club {
  padding: 12px 12px 12px;
  border-radius: 10px;
  background: var(--green-deep);
}
.club__name {
  font-weight: 800;
  font-size: 1.05rem;
}
.club__meta {
  margin-top: 2px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78);
}
.rail__nav {
  display: grid;
  gap: 2px;
}
.rail__nav a,
.rail__settings {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px 7px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 150ms, color 150ms;
}
.rail__nav a svg,
.rail__settings svg {
  width: 19px;
  height: 19px;
  flex: none;
  margin-top: -2px;
}
.rail__nav a:hover,
.rail__settings:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}
.rail__nav a.is-active {
  background: var(--white);
  color: var(--green-ink);
  font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--white), inset 0 0 0 3.5px var(--green);
}
.rail__badge {
  margin-left: auto;
  min-width: 22px;
  padding: 3px 6px 1px;
  border-radius: 6px;
  background: var(--warn);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}
.rail__badge[hidden] {
  display: none;
}
.rail__badge--quiet {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
}
.rail__foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
}
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.me__name,
.me__role {
  display: block;
}
.me__name {
  font-weight: 700;
  font-size: 0.92rem;
}
.me__role {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}
.rail :focus-visible {
  outline-color: var(--warn);
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  padding-top: 2px;
  border-radius: 50%;
  background: var(--galv-2);
  color: var(--ink-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.avatar--rail {
  width: 34px;
  height: 34px;
  background: var(--warn);
  color: var(--ink);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(10, 20, 14, 0.45);
}

/* ---------- Top bar ---------- */
.main {
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 28px;
  background: rgba(246, 247, 244, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--galv-2);
}
.icon-btn.topbar__menu {
  display: none;
}
.topbar__title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}
.topbar h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.topbar__date {
  color: var(--ink-2);
  font-size: 0.95rem;
  white-space: nowrap;
}
.now-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 4px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--galv-3);
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
}
.now-pill__dot {
  width: 8px;
  height: 8px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--stop);
  box-shadow: 0 0 0 3px var(--stop-tint);
}
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search svg {
  position: absolute;
  left: 11px;
  width: 17px;
  height: 17px;
  color: var(--ink-3);
  pointer-events: none;
}
.search input {
  width: 270px;
  height: 38px;
  padding: 3px 34px 0 36px;
  border: 0;
  border-radius: 8px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--galv-3);
  font-size: 0.92rem;
  outline: none;
  caret-color: var(--green);
  transition: box-shadow 140ms;
}
.search input::placeholder {
  color: var(--ink-3);
}
.search input:focus {
  box-shadow: inset 0 0 0 2px var(--green), 0 0 0 3px rgba(245, 196, 0, 0.55);
}
.search kbd {
  position: absolute;
  right: 9px;
  padding: 2px 6px 0;
  border-radius: 4px;
  background: var(--galv-1);
  box-shadow: inset 0 0 0 1px var(--galv-3);
  font: 600 0.75rem var(--mono);
  color: var(--ink-3);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 2px 14px 0;
  border: 0;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 140ms, box-shadow 140ms, color 140ms, transform 140ms var(--ease-out);
}
.btn svg {
  width: 16px;
  height: 16px;
  margin-top: -2px;
}
.btn--primary {
  background: var(--green);
  color: var(--white);
}
.btn--primary:hover {
  background: var(--green-deep);
}
.btn--primary:active {
  transform: translateY(1px);
}
.btn--ghost {
  background: var(--white);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--galv-3);
}
.btn--ghost:hover {
  box-shadow: inset 0 0 0 1px var(--ink-3);
  background: var(--galv-0);
}
.btn--danger {
  background: var(--stop);
  color: var(--white);
}
.btn--danger:hover {
  background: #951c13;
}
.btn--link {
  height: auto;
  padding: 4px 2px;
  background: none;
  color: var(--green-ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.btn--sm {
  height: 30px;
  padding: 2px 11px 0;
  font-size: 0.84rem;
}
.btn[disabled] {
  cursor: default;
  opacity: 0.55;
  transform: none;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
}
.icon-btn:hover {
  background: var(--galv-2);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}
.icon-btn--sm {
  width: 30px;
  height: 30px;
}
.icon-btn--sm svg {
  width: 16px;
  height: 16px;
}

/* ---------- Work area ---------- */
.work {
  display: grid;
  gap: 22px;
  padding: 20px 28px 40px;
}

.dayline dl {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  border-radius: 12px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--galv-2);
}
.dayline dl > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 10px;
  flex: 1 1 160px;
  padding: 12px 18px 10px;
  border-right: 1px solid var(--galv-2);
}
.dayline dl > div:last-child {
  border-right: 0;
}
.dayline dt {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-3);
}
.dayline dd {
  margin: 2px 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.dayline__sub {
  font-size: 0.8rem;
  color: var(--ink-3);
}

.section-head,
.panel__head {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
}
.section-head {
  margin-bottom: 12px;
}
.section-head h2,
.panel__head h2 {
  font-size: 1.15rem;
  font-weight: 800;
}
.section-head__count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink-2);
}
.section-head__count .num {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 2px 6px 0;
  border-radius: 6px;
  background: var(--warn);
  color: var(--ink);
  font-weight: 800;
}
.triage.is-clear .section-head__count .num {
  background: var(--green);
  color: var(--white);
}

/* ---------- Triage plates ---------- */
.triage__grid {
  display: grid;
  gap: 16px;
}
.triage__plates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.plate {
  --tone: var(--warn);
  --tone-tint: var(--warn-tint);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--galv-2), var(--shadow-plate);
  overflow: hidden;
}
.plate.is-changed {
  animation: plate-swap 520ms var(--ease-out);
}
.plate.is-changed .plate__head {
  animation: plate-head 700ms var(--ease-out);
}
@keyframes plate-swap {
  from { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--galv-2), 0 14px 28px -12px rgba(20, 28, 23, 0.35); }
  to { transform: none; }
}
@keyframes plate-head {
  from { clip-path: inset(0 70% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
.plate--temp { --tone: var(--temp); --tone-tint: var(--temp-tint); }
.plate--service { --tone: var(--service); --tone-tint: var(--service-tint); }
.plate--resolved { --tone: var(--green); --tone-tint: var(--green); }
.plate--resolved .plate__head {
  color: var(--white);
  box-shadow: inset 0 0 0 3px var(--green), inset 0 0 0 4.5px rgba(255, 255, 255, 0.85);
  border-radius: 12px 12px 0 0;
}
.plate--resolved .plate__time {
  box-shadow: none;
  color: var(--green-ink);
}
.plate--resolved .plate__body {
  padding-bottom: 0;
}

.plate__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 11px;
  background: var(--tone-tint);
  border-bottom: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
}
.plate__sym {
  width: 30px;
  height: 30px;
}
.plate__title {
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.2;
  padding-top: 2px;
}
.plate__time {
  padding: 4px 8px 2px;
  border-radius: 6px;
  background: var(--white);
  box-shadow: inset 0 0 0 1.5px var(--ink);
  font-weight: 800;
  font-size: 0.82rem;
  white-space: nowrap;
}
.plate__body {
  display: grid;
  gap: 12px;
  padding: 14px 14px 4px;
  flex: 1;
  align-content: start;
}
.plate__facts,
.plate__wl {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.plate__facts li {
  display: grid;
  gap: 1px;
}
.plate__who {
  font-weight: 700;
  font-size: 0.92rem;
}
.plate__when {
  font-size: 0.84rem;
  color: var(--ink-3);
}
.plate__hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--galv-2);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--green-ink);
}
.hint-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--green);
}
.plate__hint--wait {
  color: var(--service);
  align-items: center;
}
.plate__hint--stop {
  color: var(--stop);
}
.plate__done {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.plate__done strong {
  color: var(--ink);
}
.plate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 14px;
}

.wl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
}
.wl + .wl {
  padding-top: 10px;
  border-top: 1px solid var(--galv-1);
}
.wl__offer {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--green-ink);
}
.wl__text {
  display: grid;
  min-width: 0;
}
.wl__text .plate__when {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 2px 10px 0;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.chip svg {
  width: 14px;
  height: 14px;
  margin-top: -2px;
}
.chip--ok {
  background: var(--green-tint);
  color: var(--green-ink);
}
.chip--wait {
  background: var(--service-tint);
  color: var(--service);
}

.spinner {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 800ms linear infinite;
}
@keyframes spin {
  to { transform: rotate(1turn); }
}

/* Also today */
.also {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  border-radius: 12px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--galv-2);
  padding: 4px 16px;
}
.also h3 {
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
}
.also__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.also__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 6px 10px;
  padding: 12px 14px;
  border-left: 1px solid var(--galv-2);
}
.also__ic {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--galv-1);
  color: var(--ink-2);
}
.also__ic svg {
  width: 16px;
  height: 16px;
}
.also__text {
  display: grid;
}
.also__title {
  font-weight: 700;
  font-size: 0.9rem;
}
.also__meta {
  font-size: 0.82rem;
  color: var(--ink-3);
}
.also__item .btn,
.also__done {
  grid-column: 2;
  justify-self: start;
}
.also__done {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--green-ink);
  white-space: nowrap;
}
.also__item.is-done .also__ic {
  background: var(--green-tint);
  color: var(--green);
}
.also__item.is-done .also__title {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

/* ---------- Panels ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: stretch;
}
.arrivals,
.bookings {
  display: flex;
  flex-direction: column;
}
.split--b {
  grid-template-columns: minmax(0, 1fr) 380px;
}
.panel {
  border-radius: 12px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--galv-2);
  min-width: 0;
}
.panel__head {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--galv-2);
}
.panel__meta {
  margin-left: auto;
  font-size: 0.86rem;
  color: var(--ink-3);
}

.seg {
  display: inline-flex;
  margin-left: auto;
  padding: 3px;
  border-radius: 8px;
  background: var(--galv-1);
  box-shadow: inset 0 0 0 1px var(--galv-2);
}
.seg button {
  height: 28px;
  padding: 2px 12px 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-3);
}
.seg button[aria-pressed="true"] {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 28, 23, 0.14), inset 0 0 0 1px var(--galv-3);
}

/* ---------- Court grid ---------- */
.courts__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 10px 18px 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-3);
}
.courts__legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.sw {
  display: inline-block;
  width: 20px;
  height: 12px;
  border-radius: 3px;
}
.sw--book { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.sw--open { background: var(--green-tint); box-shadow: inset 0 0 0 1.5px var(--green-line); }
.sw--league { background: var(--brown-tint); box-shadow: inset 0 0 0 1.5px #d4bfac; }
.sw--clinic { background: var(--ink-2); }
.sw--free { box-shadow: inset 0 0 0 1px var(--galv-3); background-image: repeating-linear-gradient(135deg, transparent 0 4px, var(--galv-2) 4px 5px); }

.courts__scroll {
  overflow-x: auto;
  padding: 8px 18px 18px;
}
.cg {
  --label: 52px;
  position: relative;
  display: grid;
  grid-template-columns: var(--label) repeat(var(--slots), minmax(26px, 1fr));
  grid-template-rows: 26px repeat(8, 56px);
  row-gap: 4px;
  min-width: 720px;
}
.cg--day {
  grid-template-columns: var(--label) repeat(var(--slots), minmax(17px, 1fr));
  min-width: 860px;
}
.cg__hour {
  align-self: end;
  padding: 0 0 5px 5px;
  border-left: 1px solid var(--galv-3);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cg__court {
  grid-column: 1;
  display: grid;
  align-items: center;
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--white);
  box-shadow: -18px 0 0 var(--white);
}
.cg__corner {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--white);
  box-shadow: -18px 0 0 var(--white);
}
.court-plate {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 32px;
  padding-top: 3px;
  border-radius: 7px;
  background: var(--green);
  color: var(--white);
  font-weight: 800;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 3.5px var(--white);
}
.court-plate--sm {
  width: auto;
  min-width: 26px;
  height: 24px;
  padding: 2px 5px 0;
  border-radius: 5px;
  font-size: 0.8rem;
  box-shadow: inset 0 0 0 1.5px var(--green), inset 0 0 0 2.5px var(--white);
}
.cg__lane {
  border-radius: 7px;
  background: var(--galv-0);
}

.blk {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  margin: 3px 2px;
  padding: 3px 8px 1px;
  border: 0;
  border-radius: 6px;
  text-align: left;
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.2;
  transition: box-shadow 140ms, transform 140ms var(--ease-out), opacity 200ms;
}
.blk:hover {
  transform: translateY(-1px);
  z-index: 3;
}
.blk__t,
.blk__s {
  max-width: 100%;
  overflow: hidden;
}
.blk__t {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}
.blk__s {
  white-space: nowrap;
}
.blk__t {
  font-weight: 700;
}
.blk__s {
  font-size: 0.7rem;
  opacity: 0.78;
  font-variant-numeric: tabular-nums;
}
.blk--book { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--ink-3); color: var(--ink); }
.blk--book:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.blk--open { background: var(--green-tint); box-shadow: inset 0 0 0 1.5px var(--green-line); color: var(--green-ink); }
.blk--open:hover { box-shadow: inset 0 0 0 2px var(--green); }
.blk--league { background: var(--brown-tint); box-shadow: inset 0 0 0 1.5px #d4bfac; color: var(--brown-deep); }
.blk--league:hover { box-shadow: inset 0 0 0 2px var(--brown); }
.blk--clinic { background: var(--ink-2); color: var(--white); }
.blk--clinic:hover { background: var(--ink); }
.blk--free {
  background-image: repeating-linear-gradient(135deg, transparent 0 7px, var(--galv-2) 7px 8px);
  box-shadow: inset 0 0 0 1px var(--galv-3);
  color: var(--ink-3);
}
.blk--free .blk__t {
  font-weight: 600;
}
.blk--free:hover {
  background-color: var(--green-tint);
  box-shadow: inset 0 0 0 1.5px var(--green);
  color: var(--green-ink);
}
.blk--free.is-past {
  visibility: hidden;
}

/* State marks: the sign plates on the grid */
.blk--half {
  margin-block: 2px;
  padding: 1px 8px 0;
  font-size: 0.72rem;
}
.blk--half .blk__t {
  -webkit-line-clamp: 1;
}
.blk--half-a { align-self: start; height: 25px; padding-left: 20px; }
.blk--half-b { align-self: end; height: 25px; padding-left: 20px; }
.blk.is-conflict {
  background: var(--warn-tint);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
  overflow: visible;
}
.blk.is-conflict .blk__t {
  overflow: hidden;
}
.blk__flag {
  position: absolute;
  z-index: 2;
  width: 28px;
  height: 28px;
  left: -10px;
  top: 12px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}
.blk.is-nocoach {
  box-shadow: inset 0 0 0 3px var(--temp);
  overflow: visible;
}
.blk__flag--in {
  position: static;
  width: 20px;
  height: 20px;
  margin-bottom: 1px;
  filter: none;
}
.blk.is-nocoach:has(.blk__flag--in) {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}
.blk.is-cancelled {
  background: var(--galv-1);
  color: var(--ink-3);
  box-shadow: inset 0 0 0 1px var(--galv-3);
  text-decoration: line-through;
}
.blk.is-past {
  background: var(--galv-1);
  color: var(--ink-3);
  box-shadow: inset 0 0 0 1px var(--galv-3);
}
.blk.is-past:hover {
  box-shadow: inset 0 0 0 1.5px var(--ink-3);
}
.blk.is-live::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--stop);
}
.blk--free.is-past {
  visibility: hidden;
}
.blk.is-dim {
  opacity: 0.25;
}
.blk.is-hit {
  box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 3px var(--warn);
}
.blk.is-flash {
  animation: flash 1.3s var(--ease-out);
}
@keyframes flash {
  0% { box-shadow: 0 0 0 0 rgba(245, 196, 0, 0.95); transform: scale(1.04); }
  100% { box-shadow: 0 0 0 10px rgba(245, 196, 0, 0); transform: none; }
}

.cg__past {
  position: absolute;
  top: 26px;
  bottom: 0;
  left: var(--label);
  width: calc((100% - var(--label)) * var(--f));
  background: repeating-linear-gradient(90deg, transparent 0 3px, rgba(20, 28, 23, 0.035) 3px 4px);
  z-index: 0;
  pointer-events: none;
  border-radius: 7px 0 0 7px;
}
.cg__now {
  position: absolute;
  top: 18px;
  bottom: -4px;
  left: calc(var(--label) + (100% - var(--label)) * var(--f));
  width: 2px;
  margin-left: -1px;
  background: var(--stop);
  z-index: 0;
  pointer-events: none;
}
.cg__now span {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 6px 0;
  border-radius: 4px;
  background: var(--stop);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Arrivals ---------- */
.arrivals__list {
  flex: 1 1 0;
  min-height: 320px;
  overflow-y: auto;
  padding: 4px 0 8px;
}
.arr-group__label {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 18px 6px;
  background: var(--white);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.arr-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.arr {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 18px;
}
.arr + .arr {
  border-top: 1px solid var(--galv-1);
}
.arr.is-hidden {
  display: none;
}
.arr__text {
  display: grid;
  min-width: 0;
}
.arr__name {
  font-weight: 700;
  font-size: 0.9rem;
}
.arr__meta {
  font-size: 0.8rem;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arr__side {
  display: flex;
  align-items: center;
  gap: 8px;
}
.arr__late {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--temp-ink);
  background: var(--temp-tint);
  padding: 3px 6px 1px;
  border-radius: 5px;
  white-space: nowrap;
}
.arr__ok {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green-ink);
  font-variant-numeric: tabular-nums;
}
.arr__ok svg {
  width: 15px;
  height: 15px;
  margin-top: -2px;
}
.arr.is-in .avatar {
  background: var(--green-tint);
  color: var(--green-ink);
}
.arr--group .court-plate {
  width: 30px;
}
.arr__count {
  font-weight: 800;
  font-size: 0.95rem;
}
.arr__count span {
  font-weight: 600;
  color: var(--ink-3);
}

/* ---------- Bookings table ---------- */
.tabs {
  display: inline-flex;
  gap: 2px;
  margin-left: 8px;
}
.tabs button {
  flex: none;
  white-space: nowrap;
  height: 30px;
  padding: 2px 10px 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-3);
}
.tabs button .num {
  margin-left: 3px;
  font-weight: 600;
  opacity: 0.8;
}
.tabs button:hover {
  background: var(--galv-1);
  color: var(--ink);
}
.tabs button[aria-selected="true"] {
  background: var(--ink);
  color: var(--white);
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green);
}
.table-wrap {
  flex: 1 1 0;
  min-height: 420px;
  overflow: auto;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.tbl[hidden] {
  display: none;
}
.tbl thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 12px 7px;
  background: var(--galv-0);
  border-bottom: 1px solid var(--galv-2);
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-3);
  white-space: nowrap;
}
.tbl thead th:first-child,
.tbl td:first-child {
  padding-left: 18px;
}
.tbl th button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
}
.tbl th button svg {
  width: 13px;
  height: 13px;
  opacity: 0.45;
}
.tbl th[aria-sort="ascending"] {
  color: var(--ink);
}
.tbl th[aria-sort="ascending"] svg {
  opacity: 1;
}
.tbl td {
  padding: 9px 12px 7px;
  border-bottom: 1px solid var(--galv-1);
  vertical-align: middle;
}
.tbl tbody tr:hover td {
  background: var(--galv-0);
}
.tbl tr.is-past td {
  color: var(--ink-3);
}
.tbl tr.is-flagged td {
  background: #fffbea;
}
.t-time {
  white-space: nowrap;
  font-weight: 700;
}
.t-time .dim {
  font-weight: 500;
}
.t-name {
  min-width: 200px;
}
.t-title,
.t-sub {
  display: block;
}
.t-title {
  font-weight: 700;
}
.t-sub {
  font-size: 0.8rem;
  color: var(--ink-3);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px 1px;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--galv-1);
  color: var(--ink-2);
}
.badge svg {
  width: 15px;
  height: 15px;
  margin: -2px 0 0 -2px;
}
.badge--paid { background: var(--green-tint); color: var(--green-ink); }
.badge--pass { background: var(--galv-1); color: var(--ink-2); }
.badge--due { background: var(--service-tint); color: var(--service); }
.badge--live { background: var(--stop-tint); color: var(--stop); }
.badge--partial { background: var(--green-tint); color: var(--green-ink); }
.badge--done { background: transparent; color: var(--ink-3); padding-left: 0; }
.badge--noshow { background: var(--stop-tint); color: var(--stop); }
.badge--conflict { background: var(--warn); color: var(--ink); }
.badge--nocoach { background: var(--temp-tint); color: var(--temp-ink); }
.badge--cancel { background: var(--galv-1); color: var(--ink-3); text-decoration: line-through; }

.empty {
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 28px 18px;
  color: var(--ink-3);
  font-size: 0.9rem;
}
.empty[hidden] {
  display: none;
}
.empty__title {
  font-weight: 800;
  color: var(--ink);
  font-size: 1rem;
}
.empty .btn {
  margin-top: 6px;
}

/* ---------- Week ---------- */
.week__rev,
.week__ns {
  padding: 16px 18px 18px;
}
.week__ns {
  border-top: 1px solid var(--galv-2);
}
.week__label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-3);
}
.week__big {
  margin-top: 2px;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.week__delta {
  margin-top: 2px;
  font-size: 0.84rem;
  color: var(--ink-3);
}
.up {
  color: var(--green);
  font-weight: 800;
}
.down {
  color: var(--stop);
  font-weight: 800;
}

.bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  height: 150px;
  margin-top: 16px;
}
.bar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 4px;
  min-width: 0;
}
.bar__val {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-3);
}
.bar__col {
  position: relative;
  align-self: end;
  width: 100%;
  height: var(--h);
  border-radius: 5px 5px 2px 2px;
  background: var(--green);
  overflow: hidden;
}
.bar__booked {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--p);
  background: var(--green-tint) repeating-linear-gradient(135deg, transparent 0 4px, rgba(12, 91, 58, 0.25) 4px 5px);
  box-shadow: inset 0 0 0 1.5px var(--green);
  border-radius: 5px 5px 0 0;
}
.bar.is-future .bar__col {
  background: transparent;
}
.bar.is-future .bar__booked {
  border-radius: 5px 5px 2px 2px;
}
.bar__day {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-3);
}
.bar.is-today .bar__day {
  color: var(--white);
  background: var(--ink);
  padding: 1px 6px 0;
  border-radius: 4px;
}
.week__mix {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  font-size: 0.86rem;
}
.week__mix li {
  display: flex;
  justify-content: space-between;
  padding: 5px 0 3px;
  border-bottom: 1px dashed var(--galv-2);
  color: var(--ink-2);
}
.week__mix li .num {
  font-weight: 700;
  color: var(--ink);
}
.week__ns-num {
  margin-top: 2px;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
}
.week__ns-of {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-3);
}
.ns-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.nsd {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.nsd__dots {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
  height: 46px;
  justify-content: flex-start;
}
.nsd__dots i {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  background: var(--stop);
}
.nsd__dots i.is-empty {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--galv-3);
}
.nsd__day {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-3);
}
.nsd.is-today .nsd__day {
  color: var(--white);
  background: var(--ink);
  padding: 1px 6px 0;
  border-radius: 4px;
}
.repeat {
  margin-top: 16px;
}
.repeat__title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.repeat ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.repeat li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--galv-1);
}
.repeat__text {
  display: grid;
}
.repeat__name {
  font-weight: 700;
  font-size: 0.9rem;
}
.repeat__meta {
  font-size: 0.8rem;
  color: var(--ink-3);
}

.demo-note {
  font-size: 0.82rem;
  color: var(--ink-3);
}

/* ---------- Popover ---------- */
.pop {
  position: fixed;
  z-index: 40;
  width: 320px;
  padding: 14px;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 0 0 1px var(--galv-3), 0 18px 40px -12px rgba(10, 20, 14, 0.35);
  animation: pop-in 160ms var(--ease-out);
}
.pop[hidden] {
  display: none;
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.pop__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.pop__title {
  font-weight: 800;
  font-size: 1rem;
}
.pop__sub {
  font-size: 0.82rem;
  color: var(--ink-3);
}
.pop__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.pop__coach {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-2);
}
.pop__people {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 0.86rem;
}
.pop__people li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0 3px;
  border-top: 1px solid var(--galv-1);
}
.pop__in {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green-ink);
  font-weight: 700;
  font-size: 0.8rem;
}
.pop__in svg {
  width: 14px;
  height: 14px;
  margin-top: -2px;
}
.pop__due {
  color: var(--ink-3);
  font-size: 0.8rem;
}
.pop__no {
  color: var(--stop);
  font-weight: 700;
  font-size: 0.8rem;
}
.pop__line {
  margin-top: 10px;
  font-size: 0.86rem;
  color: var(--ink-2);
}
.pop__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: grid;
  justify-items: end;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 8px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 12px 28px -10px rgba(10, 20, 14, 0.5);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms, transform 260ms var(--ease-out);
}
.toast.is-in {
  opacity: 1;
  transform: none;
}
.toast__ic {
  width: 18px;
  height: 18px;
  color: var(--warn);
  flex: none;
  margin-top: -2px;
}
.toast button {
  margin-left: 6px;
  padding: 5px 10px 3px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  font-weight: 700;
  font-size: 0.84rem;
}
.toast button:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* ---------- Responsive ---------- */
@media (max-width: 1360px) {
  .also {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 12px;
  }
  .also__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .also__item {
    border-left: 0;
    border-top: 1px solid var(--galv-2);
    padding-inline: 0 14px;
  }
}

@media (max-width: 1180px) {
  .split,
  .split--b {
    grid-template-columns: minmax(0, 1fr);
  }
  .arrivals__list {
    flex: none;
    max-height: 400px;
  }
  .table-wrap {
    flex: none;
    max-height: 520px;
  }
  .search input {
    width: 200px;
  }
}

@media (max-width: 1000px) {
  .triage__plates {
    grid-template-columns: minmax(0, 1fr);
  }
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 40;
    width: 264px;
    transform: translateX(-100%);
    transition: transform 240ms var(--ease-out);
  }
  .rail.is-open {
    transform: none;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
  }
  .rail__close {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
  }
  .rail__close svg {
    width: 18px;
    height: 18px;
  }
  .icon-btn.topbar__menu {
    display: inline-grid;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 10px 16px;
  }
  .topbar__title {
    flex-direction: column;
    gap: 0;
  }
  .topbar h1 {
    font-size: 1.35rem;
  }
  .topbar__date {
    font-size: 0.82rem;
  }
  .now-pill {
    margin-left: auto;
  }
  .topbar__actions {
    width: 100%;
  }
  .search {
    flex: 1;
  }
  .search input {
    width: 100%;
  }
  .search kbd {
    display: none;
  }
  .btn[data-walkin] {
    display: none;
  }
  .btn[data-newbooking] {
    width: 38px;
    padding: 0;
    font-size: 0;
    gap: 0;
  }
  .btn[data-newbooking] svg {
    width: 18px;
    height: 18px;
    margin: 0;
  }
  .work {
    padding: 16px 16px 32px;
    gap: 18px;
  }
  .dayline dl > div {
    flex: 1 1 45%;
    border-right: 0;
    border-bottom: 1px solid var(--galv-2);
  }
  .also__list {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel__head {
    padding: 12px 14px 10px;
  }
  .courts__scroll {
    padding: 8px 14px 14px;
  }
  .tabs {
    margin-left: 0;
    order: 3;
    width: 100%;
    overflow-x: auto;
  }
  .tbl thead {
    display: none;
  }
  .tbl,
  .tbl tbody {
    display: block;
  }
  .tbl tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "court name players"
      "court time time"
      ". pay status";
    gap: 4px 12px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--galv-1);
  }
  .tbl tr.is-flagged {
    background: #fffbea;
  }
  .tbl td,
  .tbl tr.is-flagged td,
  .tbl tbody tr:hover td {
    padding: 0 !important;
    border: 0;
    background: none;
  }
  .tbl td:nth-child(1) { grid-area: time; font-size: 0.82rem; }
  .tbl td:nth-child(2) { grid-area: court; align-self: start; }
  .tbl td:nth-child(3) { grid-area: name; min-width: 0; }
  .tbl td:nth-child(4) { grid-area: players; }
  .tbl td:nth-child(5) { grid-area: pay; justify-self: start; }
  .tbl td:nth-child(6) { grid-area: status; }
  .t-name {
    min-width: 0;
  }
}
