:root {
  color-scheme: light;
  --ink: #102d42;
  --ink-soft: #23465d;
  --teal: #147a9b;
  --green: #197f66;
  --coral: #f2a18f;
  --paper: #f4f7f7;
  --white: #fff;
  --muted: #61717e;
  --line: #d8e1e5;
  --warning: #a75c12;
  --danger: #a83b45;
  --shadow: 0 18px 50px rgb(16 45 66 / 12%);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}
body,
button,
input,
select,
textarea {
  font: inherit;
}
button,
input,
select,
textarea {
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
[hidden] {
  display: none !important;
}
.shell {
  width: min(1280px, calc(100% - 40px));
  margin-inline: auto;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 200;
  left: 16px;
  top: -80px;
  padding: 10px 16px;
  background: var(--white);
}
.skip-link:focus {
  top: 16px;
}
:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgb(20 122 155 / 38%);
  outline-offset: 3px;
}

.admin-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(16px);
}
.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--white);
  background: var(--teal);
  font-weight: 900;
  box-shadow: 0 9px 22px rgb(20 122 155 / 23%);
}
.brand-copy {
  display: grid;
  line-height: 1.05;
}
.brand-copy strong {
  font-size: 16px;
}
.brand-copy small {
  margin-top: 4px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}
.header-session {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}
.session-role {
  padding: 5px 9px;
  border-radius: 999px;
  color: #0e5e4a;
  background: #dff4ec;
  font-weight: 850;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-weight: 850;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.button:hover {
  transform: translateY(-1px);
}
.button-primary {
  color: var(--white);
  background: var(--green);
  box-shadow: 0 12px 24px rgb(25 127 102 / 20%);
}
.button-light {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 10px 28px rgb(0 0 0 / 14%);
}
.button-quiet {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}
.button-danger {
  color: var(--danger);
  border: 1px solid #e2b8bc;
  background: #fff6f6;
}
.button-small {
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 10px;
  font-size: 13px;
}
.button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.16em;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2 {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
h1 {
  margin-bottom: 16px;
  font-size: clamp(38px, 5vw, 68px);
}
h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 46px);
}

.access-state,
.access-denied {
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  text-align: left;
}
.access-state h1,
.access-denied h1 {
  max-width: 680px;
  font-size: clamp(35px, 5vw, 58px);
}
.access-state p,
.access-denied p {
  color: var(--muted);
}
.access-denied {
  flex-direction: column;
  align-items: flex-start;
  max-width: 720px;
}
.loading-ring {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 4px solid #d9e7ea;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.admin-hero {
  padding: 72px 0;
  color: var(--white);
  background:
    radial-gradient(circle at 86% 0, #207899 0, transparent 32%),
    linear-gradient(135deg, #102d42, #173f52);
}
.hero-grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}
.admin-hero h1 {
  max-width: 850px;
  margin-bottom: 14px;
}
.admin-hero .eyebrow {
  color: #8fdfcb;
}
.hero-copy {
  max-width: 680px;
  margin-bottom: 0;
  color: #d3e1e7;
  font-size: 18px;
}
.dashboard,
.bookings-section {
  padding-block: 64px 0;
}
.bookings-section {
  padding-bottom: 80px;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.last-update {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.summary-card {
  min-height: 162px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 12px 32px rgb(16 45 66 / 7%);
}
.summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.summary-card strong {
  margin-block: 8px 2px;
  font-family: Georgia, serif;
  font-size: 46px;
  line-height: 1;
}
.summary-card small {
  margin-top: auto;
  color: var(--muted);
}
.summary-card.pending {
  border-top: 5px solid #e69a33;
}
.summary-card.active {
  border-top: 5px solid var(--green);
}
.summary-card.classes {
  border-top: 5px solid var(--teal);
}
.summary-card.customers {
  border-top: 5px solid var(--coral);
}

.reservations-heading {
  align-items: center;
}
.filters {
  display: flex;
  gap: 12px;
}
.filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.filters input,
.filters select {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #bdcbd1;
  border-radius: 10px;
  background: var(--white);
}
.filters input {
  width: min(300px, 34vw);
}
.table-frame {
  position: relative;
  min-height: 190px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 18px 20px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #e8edef;
}
th {
  color: var(--muted);
  background: #f7f9f9;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fbfdfd;
}
.customer-cell {
  min-width: 230px;
}
.customer-cell strong,
.pack-cell strong {
  display: block;
}
.customer-cell small,
.pack-cell small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}
.progress-cell {
  min-width: 170px;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
}
.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ecee;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
  color: #305062;
  background: #e8f0f3;
  font-size: 12px;
  font-weight: 850;
}
.status-badge.awaiting_payment,
.status-badge.customer_reported {
  color: #7e490c;
  background: #fff1d8;
}
.status-badge.confirmed {
  color: #0d614b;
  background: #def4eb;
}
.status-badge.completed {
  color: #235b72;
  background: #deedf3;
}
.status-badge.rejected {
  color: #913943;
  background: #fae5e7;
}
.amount {
  white-space: nowrap;
  font-weight: 850;
}
.empty-state,
.table-loading {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}
.empty-state p {
  margin: 4px 0 0;
  color: var(--muted);
}
.table-loading {
  flex-direction: row;
  gap: 13px;
  color: var(--muted);
}
.table-loading .loading-ring {
  width: 24px;
  height: 24px;
  border-width: 3px;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(5 23 33 / 68%);
  backdrop-filter: blur(8px);
}
.booking-modal {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 36px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 30px 90px rgb(0 0 0 / 35%);
}
.modal-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  font-size: 25px;
}
.detail-header {
  padding-right: 58px;
}
.detail-title {
  margin-bottom: 6px;
  font-family: Georgia, serif;
  font-size: clamp(32px, 5vw, 50px);
  line-height: 1.05;
}
.detail-subtitle {
  color: var(--muted);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-block: 26px;
}
.detail-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafa;
}
.detail-card h3 {
  margin-bottom: 14px;
}
.detail-list {
  display: grid;
  gap: 9px;
  margin: 0;
}
.detail-list div {
  display: grid;
  grid-template-columns: minmax(115px, 0.45fr) 1fr;
  gap: 12px;
}
.detail-list dt {
  color: var(--muted);
}
.detail-list dd {
  margin: 0;
  font-weight: 750;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}
.class-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
  padding: 24px;
  border-radius: 18px;
  color: var(--white);
  background: var(--ink);
}
.class-form h3,
.class-form .form-help,
.class-form button {
  grid-column: 1 / -1;
}
.class-form h3 {
  margin-bottom: 0;
}
.class-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
}
.class-form input,
.class-form select,
.class-form textarea,
.reject-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #7990a0;
  border-radius: 9px;
  color: var(--ink);
  background: var(--white);
}
.class-form textarea {
  min-height: 96px;
  resize: vertical;
}
.class-form .full {
  grid-column: 1 / -1;
}
.form-help {
  margin: 0;
  color: #c4d5dd;
  font-size: 12px;
}
.history {
  margin-top: 28px;
}
.history-list {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}
.history-item {
  display: grid;
  grid-template-columns: 138px 140px 1fr;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.history-item time {
  font-weight: 850;
}
.history-item span {
  color: var(--muted);
}
.reject-form {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
  padding: 18px;
  border: 1px solid #f0c7ca;
  border-radius: 14px;
  background: #fff7f7;
}
.reject-form label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 800;
}
.reject-form textarea {
  min-height: 78px;
  resize: vertical;
}
.toast {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  max-width: min(440px, calc(100% - 44px));
  padding: 14px 18px;
  border-radius: 12px;
  color: var(--white);
  background: var(--ink);
  box-shadow: 0 18px 50px rgb(0 0 0 / 28%);
}
.toast.error {
  background: #7f2932;
}

@media (max-width: 980px) {
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .reservations-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .filters {
    width: 100%;
  }
  .filters label,
  .filters input,
  .filters select {
    width: 100%;
  }
  .table-frame {
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  table,
  tbody {
    display: block;
  }
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  tbody {
    display: grid;
    gap: 14px;
  }
  tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--white);
    box-shadow: 0 10px 25px rgb(16 45 66 / 7%);
  }
  td {
    display: block;
    padding: 0;
    border: 0;
  }
  td:last-child {
    display: flex;
    align-items: end;
    justify-content: flex-end;
  }
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 28px, 1280px);
  }
  .header-inner {
    min-height: 68px;
  }
  .header-session [data-admin-email],
  .session-role {
    display: none;
  }
  .admin-hero {
    padding: 48px 0;
  }
  .hero-grid,
  .section-heading,
  .filters {
    align-items: flex-start;
    flex-direction: column;
  }
  .hero-grid .button {
    width: 100%;
  }
  .dashboard {
    padding-top: 42px;
  }
  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .summary-card {
    min-height: 140px;
    padding: 18px;
  }
  .summary-card strong {
    font-size: 38px;
  }
  .filters {
    gap: 10px;
  }
  tbody tr {
    grid-template-columns: 1fr;
  }
  td:last-child {
    justify-content: stretch;
  }
  td:last-child .button {
    width: 100%;
  }
  .booking-modal {
    padding: 28px 18px;
    border-radius: 18px;
  }
  .detail-grid,
  .class-form {
    grid-template-columns: 1fr;
  }
  .class-form label,
  .class-form h3,
  .class-form .full,
  .class-form .form-help,
  .class-form button {
    grid-column: 1;
  }
  .detail-actions .button {
    flex: 1 1 100%;
  }
  .history-item {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (max-width: 440px) {
  .brand-copy small {
    display: none;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .summary-card {
    min-height: 128px;
  }
  .modal-backdrop {
    padding: 8px;
  }
  .booking-modal {
    max-height: calc(100dvh - 16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
