:root {
  --bg: #f3f3f3;
  --ink: #0f0f0f;
  --line: #0f0f0f;
  --surface: #ffffff;
  --muted: #5b5b5b;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Arial Narrow", Arial, sans-serif;
  color: var(--ink);
  min-height: 100vh;
}

a {
  color: var(--ink);
}

.shell {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

.site-header {
  border-bottom: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  backdrop-filter: blur(6px);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  text-decoration: none;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.site-nav {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

  .site-nav a,
  .link-button {
    border: 1px solid var(--line);
    padding: 0.4rem 0.65rem;
    background: #fff;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
  }

  .site-nav a,
  .site-nav .link-button {
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
  }

  .site-nav .inline-form {
    margin: 0;
  }

  .site-nav .link-button {
    appearance: none;
    -webkit-appearance: none;
    min-height: 0;
  }

.page-content {
  padding: 2rem 0 4rem;
}

.hero {
  margin-bottom: 1rem;
  border: 2px solid var(--line);
  background: #f5f5f5;
  padding: 1.4rem;
}

.booking-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.club-logo {
  width: min(220px, 36vw);
  height: auto;
  padding: 0.3rem;
  flex-shrink: 0;
}

.hero h1 {
  margin: 0.2rem 0;
  font-size: clamp(1.35rem, 3.2vw, 2.05rem);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  line-height: 1.2;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.panel {
  border: 2px solid var(--line);
  background: var(--surface);
  padding: 1rem;
  margin-top: 1rem;
}

  .panel.compact {
    max-width: 420px;
  }

.error-panel {
  background: #f9e8e8;
}

.success-panel {
  background: #e7f1fb;
}

.grid {
  display: grid;
  gap: 0.9rem;
}

  .grid.two {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .grid.one {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid.three {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .grid.four {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
}

input,
select,
button,
.button-link {
  border: 1px solid var(--line);
  padding: 0.55rem;
  font: inherit;
  background: #fff;
}

label input,
label select {
  width: 100%;
  min-width: 0;
}

select {
  padding-right: 2rem;
}

.cell-select {
  width: 100%;
  min-width: 0;
  display: block;
}

button,
.button-link {
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  min-height: 44px;
  background: #000;
  color: #fff;
  border-color: #000;
}

.link-button {
  background: #000;
  color: #fff;
  border-color: #000;
}

.button-ghost {
  background: #ececec;
}

.button-danger {
  background: #f9e8e8;
  color: #7a1e1e;
  border-color: #7a1e1e;
}

.mono-table {
  width: 100%;
  border-collapse: collapse;
}

  .mono-table th,
  .mono-table td {
    border: 1px solid var(--line);
    padding: 0.55rem;
    text-align: left;
    vertical-align: top;
  }

  .mono-table th {
    background: #efefef;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.07em;
  }

.total-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
}

.total {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 900;
}

.total-panel h2 {
  margin: 0 0 0.45rem;
}

.total-panel button {
  align-self: end;
}

.small-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.status-success {
  color: #1f7a35;
  font-weight: 700;
}

.status-failed {
  color: #7a1e1e;
  font-weight: 700;
}

.inline-actions,
.inline-form {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin: 0;
}

.admin-form {
  align-items: end;
}

.full-width-button {
  width: 100%;
}

.panel-form {
  display: flex;
  flex-direction: column;
}

.panel-action {
  margin-top: auto;
}

.toggle-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 44px;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 26px;
}

  .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
  }

.toggle-slider {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  background: #fff;
  transition: 0.2s;
}

  .toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: var(--line);
    transition: 0.2s;
  }

.toggle-switch input:checked + .toggle-slider {
  background: #d6d6d6;
}

  .toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
  }

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.45;
}

.top-gap {
  margin-top: 1rem;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.booking-table {
  min-width: 760px;
}

  .booking-table .cell-select {
    min-width: 130px;
  }

.admin-table {
  min-width: 760px;
}

.session-detail-actions {
  width: 1%;
  white-space: nowrap;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-width: 0;
  min-height: 0;
  padding: 0;
  line-height: 1;
  color: #000;
  background: #fff;
  border-color: transparent;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: #efefef;
  border-color: var(--line);
}

.icon-button svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-table input[data-session-detail-control],
.admin-table select[data-session-detail-control] {
  width: 100%;
  min-width: 8rem;
}

.admin-table input[data-session-detail-control]:required:user-invalid,
.admin-table select[data-session-detail-control]:required:user-invalid {
  border-color: #b42318;
  background: #fff5f5;
}

.row-error td {
  background: #f9e8e8;
  color: #7a1e1e;
  font-weight: 700;
}

.session-create-form .grid.three,
.session-edit-form .grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.session-create-form .grid.two,
.session-edit-form .grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.session-accordion {
  border-top: 1px dashed var(--line);
  padding-top: 1rem;
  margin-top: 1rem;
}

.session-accordion summary {
  cursor: pointer;
}

.session-accordion summary h3 {
  display: inline;
}

.session-edit-form {
  margin-top: 1rem;
}

.plain-list {
  margin: 0;
  padding-left: 1rem;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
  margin-left: 0.35rem;
}

.site-footer {
  border-top: 2px solid var(--line);
  padding: 1rem 0 2rem;
  background: #f5f5f5;
}

@media (max-width: 870px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .booking-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .club-logo {
    width: min(260px, 75vw);
    align-self: center;
  }

  .total-panel {
    grid-template-columns: minmax(0, 1fr);
    align-items: flex-start;
  }

  .session-create-form .grid.three,
  .session-create-form .grid.two,
  .session-edit-form .grid.three,
  .session-edit-form .grid.two {
    grid-template-columns: minmax(0, 1fr);
  }

  .booking-details .grid.two {
    grid-template-columns: minmax(0, 1fr);
  }

  .booking-sessions .table-scroll {
    overflow-x: visible;
  }

  .booking-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
  }

  .booking-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .booking-table tbody {
    display: block;
  }

  .booking-table tr {
    display: grid;
    gap: 0.35rem;
    border: 1px solid var(--line);
    padding: 0.85rem;
    background: #fff;
  }

  .booking-table td {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: baseline;
    border: 0;
    padding: 0.18rem 0;
  }

  .booking-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    line-height: 1.25;
    text-transform: uppercase;
  }

  .booking-table .booking-session {
    align-items: start;
    padding-bottom: 0.45rem;
  }

  .booking-table .booking-session-summary {
    min-width: 0;
  }

  .booking-table .booking-session strong {
    display: block;
    font-size: 1rem;
    line-height: 1.2;
  }

  .booking-table .booking-choice {
    align-items: center;
    border-top: 1px dashed var(--line);
    margin-top: 0.35rem;
    padding-top: 0.75rem;
  }

  .booking-table .booking-choice::before {
    align-self: center;
  }

  .booking-table .booking-choice .cell-select {
    min-width: 0;
    width: 100%;
    max-width: 24rem;
  }

  .admin-table {
    min-width: 680px;
  }
}
