:root {
  color-scheme: light;
  --ink: #1d252c;
  --muted: #65717d;
  --paper: #fffdf8;
  --surface: #f5f1e8;
  --panel: #ffffff;
  --line: #ded6c8;
  --teal: #0f766e;
  --teal-dark: #0a5852;
  --coral: #d85b3f;
  --gold: #d59d2b;
  --green: #2e7d55;
  --red: #a84632;
  --shadow: 0 18px 44px rgb(29 37 44 / 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  min-height: 74px;
  padding: 12px 28px;
  border-bottom: 1px solid rgb(222 214 200 / 0.86);
  background: rgb(255 253 248 / 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 850;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.desktop-nav,
.account-actions,
.segmented,
.mobile-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.desktop-nav button,
.account-actions button,
.segmented button,
.mobile-nav button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.91rem;
  font-weight: 750;
}

button.active,
.desktop-nav button:hover,
.account-actions button:hover,
.segmented button:hover,
.mobile-nav button:hover {
  background: var(--ink);
  color: white;
}

main {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 88px;
}

.hero {
  position: relative;
  min-height: 520px;
  display: grid;
  align-content: end;
  gap: 24px;
  overflow: hidden;
  padding: 46px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgb(12 18 24 / 0.86), rgb(12 18 24 / 0.35) 58%, rgb(12 18 24 / 0.16)),
    var(--hero-image) center / cover;
  color: white;
  box-shadow: var(--shadow);
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f5c65b;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 18px;
  font-size: clamp(2.7rem, 7vw, 5.9rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 1.24rem;
  letter-spacing: 0;
}

.hero-text {
  max-width: 650px;
  margin-bottom: 0;
  color: rgb(255 255 255 / 0.86);
  font-size: 1.08rem;
  line-height: 1.55;
}

.booking-dock {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr auto;
  gap: 10px;
  width: min(900px, 100%);
  padding: 12px;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.94);
  color: var(--ink);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
}

.primary-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  border: 0;
  border-radius: 6px;
  background: var(--coral);
  color: white;
  padding: 0 18px;
  font-weight: 850;
  text-decoration: none;
}

.primary-action:hover {
  background: #b94730;
}

.primary-action:disabled {
  cursor: not-allowed;
  background: #aeb5bc;
}

.primary-action.full {
  width: 100%;
}

.primary-action.compact {
  min-height: 36px;
  padding: 0 14px;
}

.secondary-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 16px;
  font-weight: 850;
}

.secondary-action:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.secondary-link,
.panel-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 6px;
  color: var(--teal-dark);
  font-weight: 850;
  text-decoration: none;
}

.secondary-link {
  border: 1px solid var(--line);
  background: white;
}

.secondary-link:hover,
.panel-link:hover {
  color: var(--coral);
}

.panel-link {
  margin-top: 14px;
}

.facility-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-actions,
.inline-controls,
.social-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  align-items: center;
}

.inline-controls {
  margin-bottom: 16px;
}

.inline-controls label {
  min-width: 180px;
}

.facility-strip span,
.notice,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgb(255 255 255 / 0.92);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
}

.notice {
  margin: 18px 0 0;
  background: #fff4d6;
  color: #6e4a08;
}

.section-grid,
.admin-grid,
.booking-layout {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
  align-items: stretch;
}

.section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.booking-layout,
.admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel,
.workspace,
.program-card,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgb(29 37 44 / 0.07);
}

.panel,
.workspace,
.program-card {
  padding: 20px;
}

.panel-heading,
.workspace-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.lead-panel {
  min-height: 460px;
}

.image-panel {
  display: grid;
  grid-template-rows: 250px auto;
  gap: 18px;
  padding: 0;
  overflow: hidden;
}

.image-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-panel div {
  padding: 0 20px 22px;
}

.image-panel p:last-child,
.program-card p,
.small-copy {
  color: var(--muted);
  line-height: 1.55;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.metric {
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 18px;
}

.metric strong {
  font-size: 2.3rem;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-weight: 700;
}

.workspace {
  margin-top: 18px;
}

.narrow-workspace {
  max-width: 780px;
}

.auth-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  margin-top: 18px;
}

.auth-panel {
  display: grid;
  align-content: center;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 16px 0;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.feature-list span {
  min-height: 54px;
  display: grid;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf1;
  padding: 12px;
  font-weight: 800;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(10, minmax(86px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.timeline button {
  min-height: 62px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf1;
  color: var(--ink);
  padding: 8px;
}

.timeline button.active {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}

.court-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.court-map.compact {
  grid-template-columns: repeat(5, minmax(110px, 1fr));
}

.court-tile,
.trainer-tile {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  text-align: left;
}

.court-tile:disabled {
  cursor: default;
}

.court-tile span,
.trainer-tile span {
  color: var(--muted);
  font-weight: 760;
}

.court-tile strong,
.trainer-tile strong {
  font-size: 1.02rem;
}

.court-tile.open,
.trainer-tile.open {
  background: #e8f4ee;
  border-color: #b6d8c5;
}

.court-tile.busy,
.trainer-tile.busy {
  background: #f8e6df;
  border-color: #edc4b8;
}

.trainer-tile {
  background: #fff6dd;
  border-color: #ebd292;
}

.form-panel {
  display: grid;
  gap: 14px;
}

.receipt-panel dl {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.receipt-panel div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-weight: 760;
}

dd {
  margin: 0;
  font-weight: 840;
}

.programs {
  margin-top: 18px;
}

.program-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.program-card {
  min-height: 250px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
}

.program-card span {
  color: var(--coral);
  font-size: 0.84rem;
  font-weight: 850;
}

.program-card button,
.list-row button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 800;
}

.program-card button:hover,
.list-row button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.stack-list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row span:first-child {
  display: grid;
  gap: 3px;
}

.list-row small {
  color: var(--muted);
}

.status-pill {
  background: #eef0f2;
}

.status-pill.is-open {
  background: #e7f4ec;
  color: var(--green);
}

.status-pill.is-busy,
.status-pill.is-due {
  background: #f9e8df;
  color: var(--red);
}

.settings-panel {
  grid-column: 1 / -1;
}

.admin-form-row,
.bulk-grid,
.weekday-row,
.button-row {
  display: grid;
  gap: 10px;
}

.admin-form-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  margin-bottom: 14px;
}

.admin-form-row button,
.button-row button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 800;
}

.bulk-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bulk-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfb;
}

.bulk-card h4 {
  margin: 0;
}

.weekday-row {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row label,
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.button-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-list {
  gap: 6px;
}

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

.setting-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.editable-settings label {
  min-height: 96px;
  align-content: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf1;
}

.hours-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.hours-row {
  display: grid;
  grid-template-columns: 80px repeat(2, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hours-row strong {
  align-self: center;
}

.setting-grid span {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf1;
}

.setting-grid small {
  color: var(--muted);
}

.mobile-nav {
  display: none;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
    padding: 10px 16px;
  }

  .desktop-nav {
    display: none;
  }

  .hero {
    min-height: 620px;
    padding: 28px;
  }

  .booking-dock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-action {
    grid-column: 1 / -1;
  }

  .dashboard-grid,
  .section-grid,
  .booking-layout,
  .admin-grid,
  .admin-form-row,
  .bulk-grid,
  .program-grid,
  .auth-workspace {
    grid-template-columns: 1fr;
  }

  .metric-row,
  .setting-grid,
  .weekday-row,
  .button-row,
  .feature-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .court-map,
  .court-map.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    box-shadow: var(--shadow);
  }

  .mobile-nav button {
    padding: 0 6px;
  }
}

@media (max-width: 640px) {
  main {
    width: min(100% - 20px, 1220px);
    padding-top: 12px;
  }

  .brand small,
  .account-actions .status-pill {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 20px;
  }

  h1 {
    font-size: clamp(2.15rem, 13vw, 3.4rem);
    line-height: 0.94;
  }

  .hero-text {
    font-size: 1rem;
    line-height: 1.38;
  }

  input,
  select {
    min-height: 40px;
  }

  .booking-dock {
    gap: 8px;
    padding: 10px;
  }

  .facility-strip {
    display: none;
  }

  .booking-dock,
  .metric-row,
  .setting-grid,
  .feature-list,
  .social-grid,
  .hours-row {
    grid-template-columns: 1fr;
  }

  .court-tile,
  .trainer-tile {
    min-height: 96px;
  }
}
