/* Rally dashboard: a working screen in the Rally world.
   The world lends type, palette, density and one move: the pegboard. */

.app {
  --ground: #eceff1;
  --panel: #ffffff;
  --line: #d9dccb;
  --line-2: #e7e9dd;
  --text-2: #4a5030;
  --text-3: #5f6545;
  --ok: #2f6b1f;
  --ok-bg: #e3efd6;
  --warn-bg: #ffe6d6;
  --warn-ink: #9a3412;
  --info-bg: #dfe9f6;
  --rail-w: 236px;
  background: var(--ground);
  font-size: 14px;
  line-height: 1.45;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--ball);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ballmark {
  width: 26px;
  height: 26px;
  stroke: none;
}
.ballmark circle[fill='none'] {
  stroke: currentColor;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: #c3c7ad;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

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

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  background: var(--ink);
  color: #d6dac2;
  overflow-y: auto;
}
.rail-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 8px 14px;
  color: var(--ball);
  text-decoration: none;
}
.rail-brand .stamp {
  font-size: 23px;
  line-height: 1;
}
.club-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: var(--radius-m);
  background: #232a10;
  color: #f2f4e6;
  text-align: left;
  cursor: pointer;
}
.club-switch:hover {
  background: #2b3314;
}
.club-switch strong {
  display: block;
  font-size: 13.5px;
}
.club-switch small {
  display: block;
  font-size: 12px;
  color: #a9ae90;
}
.club-dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ball);
  color: var(--ink);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 850;
  font-stretch: 120%;
  font-size: 12px;
}

.rail-nav {
  display: grid;
  gap: 2px;
}
.rail-nav a,
.rail-foot > a {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  color: #c9cdb4;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.rail-nav a:hover,
.rail-foot > a:hover {
  background: #232a10;
  color: #fff;
}
.rail-nav a[aria-current='page'] {
  background: var(--ball);
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}
.rail-count {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--orange);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.rail-count.is-quiet {
  background: #333b17;
  color: #e3e6d2;
}
.rail-nav a[aria-current='page'] .rail-count {
  background: var(--ink);
  color: var(--ball);
}
.rail-foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
}
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 2px;
  border-top: 1px solid #2b3314;
}
.me strong {
  display: block;
  color: #f2f4e6;
  font-size: 13.5px;
}
.me small {
  display: block;
  font-size: 12px;
  color: #a9ae90;
}
.me-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--court);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}

/* ---------- Yellow band ---------- */
.band {
  padding: 18px 28px 12px;
  background: var(--ball);
  box-shadow: inset 0 -1px 0 rgba(21, 26, 11, 0.12);
}
.band-row {
  display: flex;
  align-items: center;
  gap: 20px;
}
.band-title {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  min-width: 0;
}
.band-title h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}
.band-date {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-2);
}
.band-now {
  display: inline-block;
  padding: 1px 9px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--ball);
  font-weight: 700;
  font-size: 13px;
}
.band-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}
.band-meta svg {
  width: 16px;
  height: 16px;
}
.band-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search svg {
  position: absolute;
  left: 12px;
  color: var(--ink-3);
  pointer-events: none;
}
.search input {
  width: 300px;
  height: 40px;
  padding: 0 34px 0 38px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--white-ball);
  box-shadow: inset 0 1px 3px rgba(21, 26, 11, 0.22), inset 0 0 0 1px rgba(21, 26, 11, 0.2);
  font-size: 14px;
}
.search input::placeholder {
  color: #6b7150;
}
.search input:focus-visible {
  outline: 3px solid var(--court);
  outline-offset: 1px;
}
.search kbd {
  position: absolute;
  right: 10px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(21, 26, 11, 0.3);
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-3);
}
.rail-toggle {
  display: none;
}

/* ---------- Buttons ---------- */
.abtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 650;
  font-size: 13.5px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.12s var(--ease-press),
    box-shadow 0.12s var(--ease-press),
    background-color 0.15s;
}
.abtn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}
.abtn:active:not(:disabled) {
  transform: translateY(1px);
}
.abtn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.abtn-ink {
  background: var(--ink);
  color: var(--ball);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3), 0 4px 10px -4px rgba(21, 26, 11, 0.5);
}
.abtn-ink:hover:not(:disabled) {
  background: #283010;
}
.abtn-ink:active:not(:disabled) {
  box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);
}
.abtn-orange {
  background: var(--orange);
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(21, 26, 11, 0.3), 0 4px 10px -4px rgba(21, 26, 11, 0.4);
}
.abtn-orange:hover:not(:disabled) {
  background: #ff7d3b;
}
.abtn-line {
  background: var(--panel);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px #c5c9b1;
}
.abtn-line:hover:not(:disabled) {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.abtn-quiet {
  background: transparent;
  color: var(--ink-2);
  padding: 0 10px;
}
.abtn-quiet:hover:not(:disabled) {
  background: var(--line-2);
}
.abtn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 13px;
}
.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: var(--court);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

/* ---------- Content ---------- */
.content {
  display: grid;
  gap: 20px;
  padding: 20px 28px 40px;
}

.panel {
  min-width: 0;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(21, 26, 11, 0.06), 0 0 0 1px var(--line-2);
}
.panel-head {
  padding: 16px 20px 12px;
}
.panel-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
}
.panel-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 850;
  font-stretch: 118%;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.panel-sub {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--text-3);
}
.count-pill {
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--orange);
  color: var(--ink);
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}
.count-pill.is-zero {
  background: var(--ok-bg);
  color: var(--ok);
}

/* ---------- Stats strip ---------- */
.stats {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.9fr 1.3fr 1fr;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(21, 26, 11, 0.06), 0 0 0 1px var(--line-2);
}
.stat {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 14px 18px 16px;
  color: inherit;
  text-decoration: none;
}
.stat + .stat {
  box-shadow: inset 1px 0 0 var(--line-2);
}
a.stat:hover {
  background: #f7f8f2;
}
.stat:first-child {
  border-radius: 16px 0 0 16px;
}
.stat:last-child {
  border-radius: 0 16px 16px 0;
}
.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
}
.stat-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat-value small {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-3);
}
.stat-delta {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ok);
  letter-spacing: 0;
}
.stat-foot {
  font-size: 12.5px;
  color: var(--text-2);
}
.pegs {
  display: flex;
  gap: 3px;
  height: 8px;
}
.pegs i {
  flex: 1;
  border-radius: 4px;
  background: var(--line);
}
.pegs i.on {
  background: var(--ink);
}
.pegs i.live {
  background: var(--ball-lo);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.pegs i.warn {
  background: var(--orange);
}
.spark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 26px;
}
.spark i {
  flex: 1;
  border-radius: 3px 3px 1px 1px;
  background: var(--ink);
}
.spark i.booked {
  background: repeating-linear-gradient(-45deg, #c4c8ae 0 3px, #e1e4d2 3px 6px);
}
.spark i.today {
  background: linear-gradient(to top, var(--ink) var(--done), #c4c8ae var(--done));
}

/* ---------- Triage ---------- */
.triage {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  min-height: 480px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(21, 26, 11, 0.06), 0 0 0 1px var(--line-2);
}
.triage-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-shadow: inset -1px 0 0 var(--line-2);
}
.issues {
  margin: 0;
  padding: 0 10px 10px;
  list-style: none;
  display: grid;
  gap: 2px;
}
.issue {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: start;
  padding: 11px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.15s;
}
.issue:hover {
  background: #f5f6ef;
}
.issue[aria-selected='true'] {
  background: #f1f3e4;
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.issue:focus-visible {
  outline: 3px solid var(--court);
  outline-offset: -1px;
}
.issue-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--line-2);
  color: var(--ink);
}
.issue-icon svg {
  width: 17px;
  height: 17px;
}
.issue[data-sev='high'] .issue-icon {
  background: var(--orange);
}
.issue[data-sev='mid'] .issue-icon {
  background: var(--ball);
}
.issue-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}
.issue-sub {
  grid-column: 2;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.35;
}
.issue-when {
  grid-row: span 2;
  align-self: start;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--line-2);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.issue[data-sev='high'] .issue-when {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.issue.is-working .issue-when {
  background: var(--info-bg);
  color: var(--court-deep);
}

.all-clear {
  display: grid;
  justify-items: start;
  gap: 6px;
  margin: 8px 10px;
  padding: 18px;
  border-radius: 12px;
  background: var(--ok-bg);
  color: var(--ok);
}
.all-clear strong {
  font-size: 15px;
}

.handled {
  margin: auto 10px 10px;
  padding: 0 10px;
  border-radius: 12px;
  background: #f7f8f2;
}
.handled summary {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-weight: 650;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
}
.handled ul {
  margin: 0;
  padding: 0 0 10px;
  list-style: none;
  display: grid;
  gap: 6px;
}
.handled li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}
.handled li svg {
  width: 15px;
  height: 15px;
  color: var(--ok);
  stroke-width: 2.4;
}
.handled li .linkish {
  margin-left: auto;
  font-size: 12.5px;
}

/* detail pane */
.triage-detail {
  min-width: 0;
  padding: 20px 24px 24px;
  outline: none;
}
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.detail h3 {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 850;
  font-stretch: 115%;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.detail-lede {
  margin: 8px 0 0;
  max-width: 70ch;
  font-size: 14.5px;
  color: var(--text-2);
}
.countdown {
  flex: none;
  display: grid;
  justify-items: end;
  gap: 2px;
  font-size: 12px;
  color: var(--text-3);
}
.countdown strong {
  font-size: 20px;
  line-height: 1.1;
  color: var(--ink);
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}
.facts {
  gap: 0 24px;
}
.fact {
  padding: 10px 0 2px;
  box-shadow: inset 0 2px 0 var(--line);
}
.fact-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.fact-top strong {
  font-size: 14.5px;
}
.fact p {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}
.fact.is-conflict {
  box-shadow: inset 0 1px 0 var(--orange-deep);
}
.fact.is-conflict .fact-top strong::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--orange);
  vertical-align: 2px;
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--line-2);
  color: var(--text-2);
}
.tag-ink {
  background: var(--ink);
  color: var(--ball);
}
.tag-olive {
  background: var(--olive);
  color: #fff;
}
.tag-court {
  background: var(--court);
  color: #fff;
}
.tag-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.tag-warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.tag-orange {
  background: var(--orange);
  color: var(--ink);
}
.tag-info {
  background: var(--info-bg);
  color: var(--court-deep);
}
.tag-line {
  background: transparent;
  box-shadow: inset 0 0 0 1px #c5c9b1;
}

.excerpt {
  margin-top: 16px;
  padding: 14px 16px 10px;
  border-radius: 14px;
  background: var(--ball-lo);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), inset 0 -2px 0 rgba(21, 26, 11, 0.08);
}
.excerpt-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
}
.excerpt .board {
  --label: 74px;
  --row: 32px;
  --hole-r: 4.5px;
  padding-top: 26px;
}

.options {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}
.options legend {
  margin-bottom: 8px;
  padding: 0;
  font-weight: 700;
  font-size: 13.5px;
}
.option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: start;
  padding: 11px 14px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
}
.option:hover {
  box-shadow: inset 0 0 0 1.5px #a6ab8b;
}
.option:has(input:checked) {
  box-shadow: inset 0 0 0 2px var(--ink);
  background: #fafbf4;
}
.option:has(input:focus-visible) {
  outline: 3px solid var(--court);
  outline-offset: 1px;
}
.option input {
  appearance: none;
  margin: 1px 0 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, #d2d6be 0 5px, #9ea385 5.5px);
  outline: none;
}
.option input:checked {
  background: var(--ink);
  box-shadow: 0 2px 2px rgba(21, 26, 11, 0.35);
}
.option strong {
  font-size: 14px;
}
.option p {
  grid-column: 2;
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}
.option .tag {
  grid-row: 1;
  grid-column: 3;
}
.option.is-blocked {
  cursor: not-allowed;
  opacity: 0.7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}
.actions .hint {
  font-size: 12.5px;
  color: var(--text-3);
}

.people {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.person {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.avatar {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--line-2);
  font-weight: 700;
  font-size: 12.5px;
}
.avatar.is-court {
  background: var(--court);
  color: #fff;
}
.avatar.is-out {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.person strong {
  font-size: 14px;
}
.person p {
  grid-column: 2;
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}
.person .person-act {
  grid-row: span 2;
  grid-column: 3;
  display: flex;
  gap: 6px;
  align-items: center;
}
.status-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ok);
}
.status-line svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}
.status-line.is-wait {
  color: var(--court-deep);
}
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.roster {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.roster li {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--line-2);
  font-size: 12.5px;
  font-weight: 600;
}

.resolved-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--ok-bg);
  color: #1f4a13;
}
.resolved-banner svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}
.resolved-banner p {
  margin: 0;
  flex: 1;
  font-size: 14px;
}
.resolved-banner .linkish {
  color: #1f4a13;
}

.fee-list {
  margin-top: 14px;
}

/* ---------- Board panel ---------- */
.board-panel .panel-head {
  padding-bottom: 10px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 20px;
  height: 9px;
  border-radius: var(--radius-pill);
}
.legend i[data-type='booking'] {
  background: var(--ink);
}
.legend i[data-type='open'] {
  background: var(--white-ball);
  box-shadow: inset 0 0 0 1px #c5c9b1;
}
.legend i[data-type='league'] {
  background: var(--olive);
}
.legend i[data-type='clinic'] {
  background: var(--court);
}
.legend i[data-type='hold'] {
  background: repeating-linear-gradient(-45deg, var(--white-ball) 0 3px, #d9dcc8 3px 6px);
  box-shadow: 0 0 0 1.5px var(--ink) inset;
}
.legend i[data-type='conflict'] {
  background: var(--orange);
}
.board-well {
  margin: 0 12px 12px;
  padding: 12px 14px 8px;
  border-radius: 14px;
  background: var(--ball-lo);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), inset 0 -2px 0 rgba(21, 26, 11, 0.08);
}
.board-scroll {
  overflow-x: auto;
  padding-top: 24px;
}
#day-board {
  --label: 96px;
  --row: 36px;
  min-width: 1000px;
}
.plug.is-selected {
  outline: 3px solid var(--court);
  outline-offset: 1px;
}

/* ---------- Split: arrivals + week ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: start;
}
.arrivals-tally {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}
.arrivals-tally strong {
  color: var(--ink);
}
.arrivals {
  padding: 0 12px;
}
.slot {
  padding: 6px 0 4px;
}
.slot + .slot {
  box-shadow: inset 0 1px 0 var(--line-2);
}
.slot-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
}
.slot-head .slot-time {
  color: var(--ink);
  font-size: 13.5px;
}
.slot-head .tag {
  margin-left: auto;
}
.arrival {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 4px 8px;
  border-radius: 10px;
}
.arrival:hover {
  background: #f7f8f2;
}
.arrival-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 600;
}
.arrival-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.arrival-meta {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.checkin {
  min-width: 104px;
}
.checkin.is-in {
  background: var(--ok-bg);
  color: var(--ok);
  box-shadow: none;
}
.group-count {
  display: flex;
  align-items: center;
  gap: 8px;
}
.group-count .pegs {
  width: 120px;
}
.recent {
  margin: 8px 12px 14px;
  padding: 12px 8px 0;
  box-shadow: inset 0 1px 0 var(--line-2);
}
.recent h3,
.noshows h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}
.recent ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}
.recent li {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 8px;
  font-size: 13px;
}
.recent li time {
  color: var(--text-3);
}
.recent li span:last-child {
  color: var(--text-3);
}
.recent li.is-new {
  animation: flash 1.6s var(--ease-out);
}
@keyframes flash {
  0% {
    background: var(--ball);
  }
}

/* week */
.week {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 20px;
  padding: 0 20px 16px;
}
.week-total {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 14px;
}
.week-total strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 112%;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.week-total span {
  font-size: 13px;
  color: var(--text-2);
}
.bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  height: 170px;
  align-items: end;
}
.bar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  min-width: 0;
  text-align: center;
}
.bar-v {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text-2);
  margin-bottom: 4px;
}
.bar-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 8px 8px 3px 3px;
  overflow: hidden;
}
.bar-col .actual {
  background: var(--ink);
}
.bar-col .booked {
  background: repeating-linear-gradient(-45deg, #c4c8ae 0 4px, #e1e4d2 4px 8px);
}
.bar-d {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
}
.bar.is-today .bar-d {
  color: var(--ink);
}
.bar.is-today .bar-d::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  margin: 3px auto 0;
  border-radius: 50%;
  background: var(--ink);
}
.bar-key {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
}
.bar-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bar-key i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--ink);
}
.bar-key i.b {
  background: repeating-linear-gradient(-45deg, #c4c8ae 0 3px, #e1e4d2 3px 6px);
}
.mix {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  align-content: start;
}
.mix li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  font-size: 13px;
}
.mix li b {
  font-weight: 650;
}
.mix-bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 6px;
  background: var(--line-2);
  overflow: hidden;
}
.mix-bar i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--olive);
}
.mix h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}

.noshows {
  margin: 0 20px 16px;
  padding-top: 14px;
  box-shadow: inset 0 1px 0 var(--line-2);
}
.noshows-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.noshows-head p {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mini-table th {
  padding: 6px 8px;
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
  box-shadow: inset 0 -1px 0 var(--line-2);
}
.mini-table td {
  padding: 7px 8px;
  box-shadow: inset 0 -1px 0 var(--line-2);
}
.mini-table tr:last-child td {
  box-shadow: none;
}
.num {
  text-align: right !important;
}

/* ---------- Bookings table ---------- */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--line-2);
}
.tabs button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  font-weight: 650;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.tabs button:hover {
  color: var(--ink);
}
.tabs button[aria-selected='true'] {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(21, 26, 11, 0.2);
}
.tabs button span {
  margin-left: 4px;
  color: var(--text-3);
  font-weight: 600;
}
.table-wrap {
  max-height: 560px;
  overflow: auto;
  margin: 0 8px 8px;
  overscroll-behavior: contain;
}
.table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 12px;
  background: var(--panel);
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
  box-shadow: inset 0 -1px 0 var(--line);
}
.table th button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.table th button:hover {
  color: var(--ink);
}
.table th[aria-sort] button {
  color: var(--ink);
}
.table th[aria-sort] button::after {
  content: '';
  width: 10px;
  height: 10px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 8.5V1.5M1.8 4.6 5 1.4l3.2 3.2' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 8.5V1.5M1.8 4.6 5 1.4l3.2 3.2' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.table th[aria-sort='descending'] button::after {
  transform: rotate(180deg);
}
.table td {
  padding: 9px 12px;
  box-shadow: inset 0 -1px 0 var(--line-2);
  vertical-align: middle;
}
.table tbody tr {
  cursor: pointer;
}
.table tbody tr:hover td {
  background: #f8f9f3;
}
.table tbody tr.is-past td {
  color: var(--text-3);
}
.table .t-time {
  white-space: nowrap;
  font-weight: 650;
}
.table .t-who strong {
  display: block;
  font-weight: 650;
}
.table .t-who small {
  font-size: 12.5px;
  color: var(--text-3);
}
.empty {
  margin: 0;
  padding: 28px 12px;
  text-align: center;
  color: var(--text-2);
}

.demo-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
}

/* ---------- Drawer ---------- */
.drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 40;
  width: min(400px, calc(100vw - 24px));
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px -20px rgba(21, 26, 11, 0.45);
  overflow-y: auto;
  animation: drawer-in 0.35s var(--ease-out);
}
@keyframes drawer-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
.drawer-inner {
  padding: 18px 20px 22px;
}
.drawer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.drawer h2 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 850;
  font-stretch: 115%;
  font-size: 22px;
  line-height: 1.15;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--line-2);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--line);
}
.dl {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px 12px;
  margin: 18px 0 0;
  font-size: 13.5px;
}
.dl dt {
  color: var(--text-3);
}
.dl dd {
  margin: 0;
  font-weight: 600;
}

.nb {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.nb label {
  display: grid;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
}
.nb input,
.nb select {
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: #f7f8f2;
  box-shadow: inset 0 0 0 1px #c5c9b1;
  font-size: 14px;
  color: var(--ink);
}
.nb input:focus-visible,
.nb select:focus-visible {
  outline: 3px solid var(--court);
  outline-offset: 1px;
}
.nb-row {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr 1fr;
  gap: 10px;
}
.nb-msg {
  margin: 0;
  min-height: 1em;
  font-size: 13px;
  font-weight: 600;
  color: var(--warn-ink);
}
.nb-msg:empty {
  display: none;
}
.nb .actions {
  margin-top: 0;
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 60;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
}
.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 320px;
  max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #eef0e0;
  font-size: 13.5px;
  box-shadow: 0 12px 30px -10px rgba(21, 26, 11, 0.6);
  animation: toast-in 0.35s var(--ease-out);
}
.toast button {
  margin-left: auto;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--ball);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
@keyframes toast-in {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stat:nth-child(4) {
    box-shadow: inset 0 1px 0 var(--line-2);
  }
  .stat:nth-child(5) {
    box-shadow: inset 1px 0 0 var(--line-2), inset 0 1px 0 var(--line-2);
  }
  .stat:first-child,
  .stat:last-child {
    border-radius: 0;
  }
  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .rail {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-out);
  }
  .rail.is-open {
    transform: none;
    box-shadow: 0 0 0 100vmax rgba(21, 26, 11, 0.45);
  }
  .rail-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--ink);
    color: var(--ball);
    cursor: pointer;
  }
  .triage {
    grid-template-columns: 340px minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .band {
    padding: 14px 16px 10px;
  }
  .band-row {
    flex-wrap: wrap;
  }
  .band-tools {
    width: 100%;
    margin-left: 0;
  }
  .search {
    flex: 1;
  }
  .search input {
    width: 100%;
  }
  .content {
    padding: 14px 12px 32px;
    gap: 14px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat:nth-child(n) {
    box-shadow: inset 0 1px 0 var(--line-2);
  }
  .stat:nth-child(even) {
    box-shadow: inset 1px 0 0 var(--line-2), inset 0 1px 0 var(--line-2);
  }
  .stat:first-child,
  .stat:nth-child(2) {
    box-shadow: none;
  }
  .stat:nth-child(2) {
    box-shadow: inset 1px 0 0 var(--line-2);
  }
  .stat:last-child {
    grid-column: 1 / -1;
  }
  .triage {
    grid-template-columns: 1fr;
  }
  .triage-list {
    box-shadow: inset 0 -1px 0 var(--line-2);
  }
  .triage-detail {
    padding: 18px 16px 20px;
  }
  .facts {
    grid-template-columns: 1fr;
  }
  .week {
    grid-template-columns: 1fr;
  }
  .band-meta {
    font-size: 12.5px;
  }
}

@media (max-width: 520px) {
  .band-title h1 {
    font-size: 28px;
  }
  .band-date {
    font-size: 13px;
  }
  .abtn-ink[data-new-booking] {
    width: 40px;
    padding: 0;
    font-size: 0;
    gap: 0;
  }
  .abtn-ink[data-new-booking] svg {
    width: 18px;
    height: 18px;
  }
  .search kbd {
    display: none;
  }
  .detail-head {
    flex-direction: column;
    gap: 8px;
  }
  .countdown {
    justify-items: start;
    grid-auto-flow: column;
    align-items: baseline;
    gap: 8px;
  }
  .option {
    grid-template-columns: 20px minmax(0, 1fr);
  }
  .option .tag {
    grid-row: auto;
    grid-column: 2;
    justify-self: start;
  }
  .person {
    grid-template-columns: 36px minmax(0, 1fr);
  }
  .person .person-act {
    grid-column: 2;
    grid-row: auto;
    margin-top: 6px;
  }
  .arrival {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .arrival-meta {
    display: none;
  }
  .bars {
    gap: 6px;
  }
  .bar-v {
    font-size: 10px;
  }
}
