:root {
  color-scheme: dark;
  --bg: #07100f;
  --ink: #f5f7ef;
  --muted: #98aaa3;
  --panel: rgba(14, 27, 25, 0.84);
  --panel-strong: rgba(20, 37, 33, 0.94);
  --field: rgba(5, 13, 13, 0.72);
  --line: rgba(194, 230, 211, 0.14);
  --line-strong: rgba(194, 230, 211, 0.26);
  --green: #69e6ad;
  --green-2: #20b982;
  --gold: #f0c765;
  --red: #ff6b6b;
  --blue: #8ec7ff;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 6%, rgba(105, 230, 173, 0.2), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(240, 199, 101, 0.13), transparent 28%),
    linear-gradient(135deg, #07100f 0%, #0d1719 48%, #0b1210 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.background-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #06100c;
  font-weight: 900;
  padding: 0 18px;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(32, 185, 130, 0.2);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    opacity 160ms ease,
    background 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button.secondary,
button.ghost {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  box-shadow: none;
}

button.ghost {
  min-height: 42px;
}

button.full {
  width: 100%;
  margin-top: 14px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.shell {
  width: min(1460px, calc(100vw - 34px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  min-height: 168px;
  margin-bottom: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(20, 37, 33, 0.86), rgba(11, 19, 18, 0.58)),
    linear-gradient(90deg, rgba(105, 230, 173, 0.12), transparent);
  box-shadow: var(--shadow);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  line-height: 1.1;
}

.intro,
.section-head p {
  max-width: 720px;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.health {
  min-width: 142px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  padding: 12px 14px;
  text-align: center;
}

.health.ok {
  color: var(--green);
}

.health.bad {
  color: var(--red);
}

.grid {
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.profile-panel,
.command-panel,
.jobs-panel {
  padding: 20px;
}

.profile-panel {
  position: sticky;
  top: 16px;
  align-self: start;
}

.main-panel {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--field);
  color: var(--ink);
  font-weight: 800;
  padding: 0 13px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input::placeholder {
  color: rgba(245, 247, 239, 0.45);
}

input:focus,
select:focus {
  border-color: rgba(105, 230, 173, 0.72);
  background: rgba(2, 9, 9, 0.88);
  box-shadow: 0 0 0 4px rgba(105, 230, 173, 0.12);
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  margin-top: 10px;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.26);
  color: var(--muted);
  font-weight: 850;
  line-height: 1.38;
  padding: 13px 14px;
}

.message.success {
  border-color: rgba(105, 230, 173, 0.35);
  color: var(--green);
}

.message.warn {
  border-color: rgba(240, 199, 101, 0.35);
  color: var(--gold);
}

.days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.day {
  min-height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 12, 12, 0.62);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.day {
  display: grid;
  gap: 5px;
  padding: 13px;
}

.day.active {
  border-color: rgba(105, 230, 173, 0.76);
  background: rgba(105, 230, 173, 0.1);
  outline: 1px solid rgba(105, 230, 173, 0.46);
}

.day.loaded small {
  color: var(--green);
}

.day.failed {
  border-color: rgba(240, 199, 101, 0.38);
}

.day.failed small {
  color: var(--gold);
}

.day span,
.job span {
  color: var(--muted);
  font-weight: 800;
}

.day small,
.job small {
  color: rgba(245, 247, 239, 0.62);
  font-weight: 750;
  line-height: 1.35;
}

.slots {
  display: block;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.slots-head,
.slots-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 12, 12, 0.62);
  padding: 14px;
  margin-bottom: 10px;
}

.slots-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.slots-head h3 {
  margin: 0;
  font-size: 22px;
}

.slots-head strong {
  color: var(--green);
}

.slots-empty {
  color: var(--muted);
  font-weight: 850;
}

.tee-sheet {
  min-width: 900px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(245, 247, 239, 0.05);
}

.tee-row {
  --slot-colour: rgba(105, 230, 173, 0.86);
  position: relative;
  display: grid;
  grid-template-columns: 82px minmax(180px, 1.25fr) minmax(130px, 0.72fr) minmax(200px, 1fr) minmax(200px, 1fr) 148px;
  align-items: center;
  gap: 16px;
  min-height: 54px;
  padding: 9px 12px 9px 17px;
  border-bottom: 1px solid rgba(245, 247, 239, 0.06);
  background: rgba(236, 242, 236, 0.08);
  color: var(--ink);
  cursor: pointer;
}

.tee-row:nth-child(odd):not(.tee-header) {
  background: rgba(236, 242, 236, 0.13);
}

.tee-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--slot-colour);
}

.tee-row.active {
  outline: 2px solid rgba(105, 230, 173, 0.74);
  outline-offset: -2px;
  background: rgba(105, 230, 173, 0.17);
}

.tee-row.bookable .sheet-time {
  color: var(--green);
}

.tee-row.unavailable {
  cursor: default;
}

.tee-row.unavailable::before {
  background: rgba(240, 199, 101, 0.72);
}

.tee-header {
  min-height: 38px;
  background: rgba(0, 121, 189, 0.88);
  color: #f7fbff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  cursor: default;
}

.tee-header::before {
  display: none;
}

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

.sheet-time {
  font-size: 19px;
  font-weight: 950;
}

.sheet-booking,
.sheet-format,
.sheet-players {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sheet-booking strong,
.sheet-format strong,
.sheet-players span {
  overflow-wrap: anywhere;
}

.sheet-booking small,
.sheet-format small,
.sheet-muted {
  color: rgba(245, 247, 239, 0.68);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.sheet-action {
  min-height: 36px;
  width: 100%;
  border-radius: 4px;
  border: 0;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

.sheet-action.primary {
  background: #1f92d0;
  color: #ffffff;
}

.sheet-action.disabled {
  background: rgba(245, 247, 239, 0.18);
  color: rgba(245, 247, 239, 0.72);
  cursor: not-allowed;
}

.jobs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.job {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 12, 12, 0.62);
  padding: 14px;
}

.job strong {
  color: var(--ink);
}

.job.success {
  border-color: rgba(105, 230, 173, 0.54);
}

.job.failed,
.job.expired {
  border-color: rgba(255, 107, 107, 0.54);
}

.empty {
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 1020px) {
  .grid,
  .booking-row {
    grid-template-columns: 1fr;
  }

  .profile-panel {
    position: static;
  }

  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100vw - 20px, 1460px);
    padding-top: 10px;
  }

  .topbar,
  .profile-panel,
  .command-panel,
  .jobs-panel {
    padding: 15px;
  }

  .inline-form,
  .actions {
    grid-template-columns: 1fr;
  }

  .actions button,
  .top-actions button,
  .health {
    width: 100%;
  }

  h1 {
    font-size: 42px;
  }
}
