/* Court booking product UI — club-themed day board on the website */

:root {
  --cb-primary: #ff6b35;
  --cb-secondary: #0d1b2e;
  --cb-ink: #f6f5f5;
  --cb-muted: rgba(255, 255, 255, 0.68);
  --cb-row: 64px;
  --cb-gutter: 52px;
  --cb-inspector: 380px;
  --cb-radius: 10px;
  --cb-nav-h: 64px;
}

html,
body.cb-page {
  min-height: 100%;
}

body.cb-page {
  margin: 0;
  background: #f6f5f5;
  color: var(--cb-ink);
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  scroll-padding-top: var(--cb-nav-h);
}

.cb-app {
  display: flex;
  flex-direction: column;
  background: var(--cb-secondary);
  min-height: 70vh;
}

.cb-status,
.cb-denied {
  max-width: 520px;
  margin: 72px auto;
  padding: 32px 24px;
  text-align: center;
  color: var(--cb-ink);
}

.cb-status h1,
.cb-denied h1 {
  font-size: 1.5rem;
  margin: 0 0 12px;
}

.cb-status p,
.cb-denied p {
  color: var(--cb-muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

.cb-chrome {
  position: sticky;
  top: var(--cb-nav-h);
  z-index: 90;
  background: var(--cb-secondary);
}

.cb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--cb-secondary);
}

.cb-club {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.cb-club img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
}

.cb-club h1 {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 700;
}

.cb-club p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--cb-muted);
}

.cb-date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cb-date-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  min-height: 40px;
  max-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  cursor: pointer;
}

.cb-date-picker:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cb-date-picker span {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  pointer-events: none;
}

.cb-date-picker input[type="date"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  background: transparent;
  color: transparent;
  font-size: 16px;
}

.cb-date-picker input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.cb-date-nav .cb-btn {
  min-height: 40px;
  padding: 8px 12px;
}

.cb-toolbar-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.cb-btn {
  appearance: none;
  border: 0;
  background: var(--cb-primary);
  color: #0d1b2e;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.88rem;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
}

.cb-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cb-btn-ghost,
.cb-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.cb-btn-ghost.is-on {
  background: var(--cb-primary);
  color: #0d1b2e;
  border-color: var(--cb-primary);
}

.cb-btn-danger {
  background: #e11d48;
  color: #fff;
}

.cb-btn-text {
  background: transparent;
  color: var(--cb-primary);
  padding: 8px 10px;
}

.cb-seg {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 3px;
}

.cb-seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cb-muted);
  font-family: inherit;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  min-height: 38px;
}

.cb-seg button.is-active {
  background: var(--cb-primary);
  color: #0d1b2e;
}

.cb-select,
.cb-input,
.cb-textarea {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.92rem;
  min-height: 44px;
  width: 100%;
}

.cb-textarea {
  min-height: 88px;
  resize: vertical;
}

.cb-select option {
  color: #111;
}

.cb-caption {
  margin: 0 20px 10px;
  color: var(--cb-muted);
  font-size: 0.88rem;
}

.cb-caption.warn {
  color: #fb923c;
}

.cb-workspace {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.cb-board-wrap {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 8px 12px 32px;
}

.cb-board {
  min-width: 640px;
}

.cb-board-header,
.cb-board-body {
  display: grid;
  grid-template-columns: var(--cb-gutter) repeat(var(--cb-court-count, 1), minmax(140px, 1fr));
  gap: 8px;
  align-items: start;
}

.cb-board-header {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--cb-secondary);
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.cb-court-name {
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cb-hours {
  position: relative;
}

.cb-hour {
  height: var(--cb-hour-h, var(--cb-row));
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: right;
  padding-top: 6px;
  padding-right: 4px;
}

.cb-column {
  position: relative;
  display: flex;
  flex-direction: column;
}

.cb-track {
  width: 100%;
  border: 0;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 6px 8px;
  text-align: left;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--cb-primary);
  background: color-mix(in srgb, var(--cb-primary) 16%, transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.cb-track.is-free {
  outline: 1px dashed color-mix(in srgb, var(--cb-primary) 55%, transparent);
  outline-offset: -1px;
}

.cb-track.is-none {
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.04);
  cursor: default;
}

.cb-track.is-leftover,
.cb-track.is-locked {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.25);
  cursor: default;
}

.cb-occ,
.cb-gap {
  position: absolute;
  left: 0;
  right: 0;
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  text-align: left;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
}

.cb-occ strong,
.cb-gap strong {
  display: block;
  font-size: 0.84rem;
}

.cb-occ span,
.cb-gap span {
  display: block;
  font-size: 0.72rem;
  opacity: 0.85;
}

.cb-gap {
  background: color-mix(in srgb, var(--cb-primary) 16%, transparent);
  color: var(--cb-primary);
  outline: 1px dashed color-mix(in srgb, var(--cb-primary) 55%, transparent);
}

.cb-inspector {
  width: var(--cb-inspector);
  flex: 0 0 var(--cb-inspector);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  padding: 16px 18px 28px;
  overflow: auto;
}

.cb-inspector h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.cb-inspector p.lead {
  color: var(--cb-muted);
  font-size: 0.88rem;
  margin: 0 0 16px;
}

.cb-field {
  margin-bottom: 12px;
}

.cb-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--cb-muted);
}

.cb-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cb-chip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.cb-chip.is-active {
  background: var(--cb-primary);
  color: #0d1b2e;
  border-color: var(--cb-primary);
}

.cb-type-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.cb-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.cb-error {
  background: rgba(225, 29, 72, 0.18);
  color: #fecdd3;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.cb-ok {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.cb-view {
  padding: 8px 20px 48px;
  width: 100%;
  box-sizing: border-box;
}

.cb-panel {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  color: #fff;
}

.cb-chrome .cb-panel-head {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px 10px;
}

.cb-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
  background: var(--cb-secondary);
}

/* Cached overlay markup must sit in the page under the site nav, never over it. */
.cb-overlay {
  position: relative !important;
  inset: auto !important;
  z-index: auto !important;
  width: 100%;
  min-height: 0;
  overflow: visible;
  background: var(--cb-secondary);
}

.cb-panel-head h2 {
  margin: 0;
}

.cb-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}

.cb-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.cb-card h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.cb-hours-table {
  width: 100%;
  border-collapse: collapse;
}

.cb-hours-table th,
.cb-hours-table td {
  text-align: left;
  padding: 8px 6px;
  font-size: 0.88rem;
}

.cb-hours-table input[type='time'] {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 6px 8px;
}

.cb-table {
  width: 100%;
  border-collapse: collapse;
}

.cb-table th,
.cb-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
}

.cb-toggle {
  position: relative;
  display: inline-block;
  box-sizing: border-box;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  vertical-align: middle;
}

.cb-toggle input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cb-toggle span {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  pointer-events: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cb-toggle span::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}

.cb-toggle input:checked + span {
  background: var(--cb-primary);
  border-color: var(--cb-primary);
}

.cb-toggle input:checked + span::after {
  transform: translateX(20px);
}

.cb-toggle input:focus-visible + span {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cb-players-table {
  width: auto;
  max-width: 100%;
}

.cb-players-table th:last-child,
.cb-players-table td:last-child {
  text-align: left;
  width: auto;
  white-space: nowrap;
  padding-left: 20px;
}

.cb-confirm {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 20, 0.7);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cb-confirm-card {
  width: min(420px, 100%);
  background: #152238;
  border-radius: 14px;
  padding: 22px;
}

.cb-confirm-card h3 {
  margin: 0 0 8px;
}

.cb-confirm-card p {
  color: var(--cb-muted);
  margin: 0 0 18px;
}

.cb-hidden {
  display: none !important;
}

.cb-list-btn {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  color: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  font-family: inherit;
}

.cb-list-btn strong {
  display: block;
}

.cb-list-btn span {
  color: var(--cb-muted);
  font-size: 0.84rem;
}

.cb-search-results {
  max-height: 180px;
  overflow: auto;
  margin-top: 6px;
  background: #152238;
  border-radius: 8px;
}

.cb-search-results button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #fff;
  padding: 10px 12px;
  cursor: pointer;
  font-family: inherit;
}

.cb-search-results button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cb-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

@media (max-width: 960px) {
  .cb-workspace {
    flex-direction: column;
  }

  .cb-inspector {
    width: 100%;
    flex-basis: auto;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .cb-grid-2 {
    grid-template-columns: 1fr;
  }

  .cb-toolbar-actions {
    margin-left: 0;
    width: 100%;
  }

  .cb-date-nav h2 {
    min-width: 0;
    font-size: 0.95rem;
  }
}

@media (max-width: 640px) {
  .cb-board {
    min-width: 520px;
  }
}
