:root {
  --bg: #06152e;
  --surface: #0c1e3f;
  --surface-soft: #102650;
  --text: #f8fbff;
  --muted: #b6c6e3;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.1);
  --success: #9be2bc;
  --warning: #ffd58b;
  --error: #ffb4bf;
  --shadow: 0 24px 60px rgba(1, 9, 22, 0.34);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(61, 100, 188, 0.22), transparent 26%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.08), transparent 20%),
    linear-gradient(180deg, #061225 0%, #081833 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.6;
}

.calendar-page,
.page-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.calendar-shell,
.section-panel,
.admin-hero {
  background: rgba(8, 25, 53, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.calendar-shell {
  padding: 18px;
}

.calendar-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 8px 10px 22px;
}

.calendar-branding {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-logo {
  display: block;
  width: min(100%, 220px);
  height: auto;
  object-fit: contain;
}

.calendar-kicker,
.week-label,
.eyebrow,
.card-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
}

.calendar-topbar h1,
.admin-hero h1,
.section-panel h2,
.booking-form h2 {
  margin: 0;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.calendar-topbar h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  max-width: 14ch;
}

.calendar-subtitle,
.section-note,
.admin-login-panel p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.98rem;
}

.calendar-rules {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.calendar-rules span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 180px;
  padding: 0 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.calendar-board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
}

.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.month-label {
  font-size: clamp(1.6rem, 3vw, 2rem);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.toolbar-actions > * {
  flex-shrink: 0;
}

.icon-button,
.today-button,
.primary-button,
.ghost-button {
  appearance: none;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.icon-button,
.today-button,
.primary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.primary-button {
  min-height: 52px;
  border-color: #204fb3;
  background: linear-gradient(180deg, #2d66db 0%, #214fb3 100%);
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(33, 79, 179, 0.28);
}

.ghost-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.icon-button:hover,
.today-button:hover,
.primary-button:hover,
.ghost-button:hover,
.day-slot:hover:not(:disabled) {
  transform: translateY(-2px);
}

.icon-button:disabled,
.today-button:disabled,
.ghost-button:disabled,
.primary-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.status-message,
.form-feedback {
  min-height: 24px;
  margin: 0;
  padding: 14px 24px 0;
  font-size: 0.95rem;
  color: var(--muted);
}

[data-tone='success'] {
  color: var(--success);
}

[data-tone='warning'] {
  color: var(--warning);
}

[data-tone='error'] {
  color: var(--error);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: stretch;
}

.calendar-day {
  min-height: 420px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: rgba(7, 21, 44, 0.5);
}

.calendar-day:last-child {
  border-right: none;
}

.day-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 84px;
}

.day-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
}

.day-name {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.calendar-day.is-today .day-number {
  background: #ffffff;
  color: #0c1e3f;
}

.calendar-day.has-slot {
  background: linear-gradient(180deg, rgba(16, 38, 80, 0.92) 0%, rgba(10, 29, 61, 0.82) 100%);
}

.day-empty {
  display: none !important;
}

.calendar-day:not(.has-slot) .day-note,
.calendar-day:not(.has-slot) .day-empty {
  display: none;
}

.calendar-day.is-open {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.calendar-day.is-open .day-header {
  position: relative;
}

.calendar-day.is-open .day-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 12%;
  bottom: -10px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
}

.day-month {
  font-size: 0.88rem;
  color: var(--muted);
}

.day-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
}

.day-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.day-slot,
.day-empty,
.day-blocked {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: 16px;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.day-slot {
  cursor: pointer;
}

.day-slot strong,
.day-empty strong,
.day-blocked strong {
  font-size: 1rem;
}

.day-slot small,
.day-empty small,
.day-blocked small,
.selected-slot span,
.mini-stats span {
  color: var(--muted);
}

.day-slot.is-available {
  border-color: rgba(255, 255, 255, 0.92);
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 12px 30px rgba(0, 0, 0, 0.18);
  color: #0c1e3f;
}

.day-slot.is-available strong {
  font-size: 1.15rem;
}

.day-slot.is-available small {
  font-weight: 700;
  color: #0c1e3f;
}

.day-blocked {
  opacity: 0.7;
}

.booking-dialog {
  width: min(520px, calc(100% - 24px));
  border: none;
  border-radius: 28px;
  padding: 0;
  background: transparent;
}

.success-dialog {
  width: min(480px, calc(100% - 24px));
  border: none;
  border-radius: 28px;
  padding: 0;
  background: transparent;
}

.booking-dialog::backdrop,
.success-dialog::backdrop {
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(4px);
}

.booking-form {
  padding: 26px;
  border-radius: 28px;
  background: #ffffff;
  display: grid;
  gap: 16px;
  box-shadow: 0 28px 64px rgba(6, 21, 46, 0.2);
}

.success-card {
  padding: 30px;
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fd 100%);
  color: #152033;
  display: grid;
  gap: 14px;
  box-shadow: 0 24px 60px rgba(1, 9, 22, 0.22);
}

.success-card .calendar-kicker,
.success-card h2,
.success-card p {
  color: #152033;
  margin: 0;
}

.success-card h2 {
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  line-height: 1.1;
}

.success-message {
  color: #42526b !important;
  line-height: 1.6;
}

.booking-form,
.booking-form .calendar-kicker,
.booking-form h2,
.booking-form label,
.booking-form input,
.booking-form .selected-slot,
.booking-form .ghost-button {
  color: #152033;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.dialog-header > div {
  min-width: 0;
}

.booking-form label,
.admin-login-form label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  color: #9db1d7;
  font-weight: 600;
}

.booking-form input,
.admin-login-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.booking-form input {
  border-color: #d7e0ec;
  color: #152033;
}

.booking-form input:focus,
.admin-login-form input:focus {
  outline: none;
  border-color: #2d66db;
  box-shadow: 0 0 0 4px rgba(45, 102, 219, 0.12);
  background: #ffffff;
}

.selected-slot {
  padding: 16px 18px;
  border-radius: 18px;
  background: #f4f7fb;
  border: 1px solid #dbe4f0;
}

.selected-slot span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.selected-slot strong {
  display: block;
  line-height: 1.35;
  word-break: break-word;
}

.selected-slot strong,
.mini-stats strong {
  font-size: 1.1rem;
}

.section-panel,
.admin-hero {
  padding: 32px;
  margin-bottom: 24px;
}

.section-heading,
.admin-hero,
.admin-login-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.admin-body {
  min-height: 100vh;
}

.admin-shell {
  padding-top: 24px;
}

.admin-hero {
  padding: 32px;
  align-items: center;
  grid-template-columns: none;
}

.admin-main {
  display: grid;
  gap: 24px;
}

.admin-login-panel {
  align-items: center;
}

.admin-login-form {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
}

.mini-stats {
  display: flex;
  gap: 12px;
}

.mini-stats article {
  min-width: 120px;
  padding: 14px 16px;
  border-radius: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}

th,
td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(90, 71, 51, 0.1);
}

th {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.empty-row {
  text-align: center;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .calendar-topbar,
  .calendar-branding,
  .calendar-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-day {
    min-height: 280px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .calendar-page,
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding: 14px 0 24px;
  }

  .calendar-shell,
  .section-panel,
  .admin-hero {
    border-radius: 24px;
  }

  .calendar-shell,
  .section-panel,
  .admin-hero {
    padding: 18px;
  }

  .calendar-topbar h1 {
    max-width: none;
    font-size: 1.7rem;
    line-height: 1.08;
  }

  .calendar-topbar {
    gap: 18px;
    padding: 2px 2px 18px;
  }

  .calendar-branding {
    gap: 14px;
    align-items: flex-start;
  }

  .brand-logo {
    width: min(100%, 160px);
  }

  .calendar-subtitle {
    font-size: 0.94rem;
  }

  .calendar-rules,
  .section-heading,
  .admin-hero,
  .admin-login-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .calendar-rules span {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    padding: 0 16px;
  }

  .calendar-toolbar {
    padding: 18px 16px 16px;
    gap: 14px;
  }

  .toolbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
  }

  .icon-button,
  .today-button,
  .primary-button,
  .ghost-button {
    min-height: 50px;
  }

  .today-button {
    width: 100%;
  }

  .status-message,
  .form-feedback {
    padding: 14px 16px 0;
    font-size: 0.92rem;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .calendar-day {
    min-height: auto;
    padding: 16px;
    gap: 12px;
  }

  .day-header {
    min-height: auto;
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 10px;
  }

  .day-number {
    width: auto;
    height: auto;
    border-radius: 0;
    font-size: 1rem;
    background: transparent;
    justify-content: flex-start;
    padding: 0;
  }

  .calendar-day.is-today .day-number {
    background: transparent;
    color: #ffffff;
  }

  .day-name,
  .day-number,
  .day-month {
    line-height: 1;
  }

  .day-name {
    font-size: 0.88rem;
    letter-spacing: 0.08em;
  }

  .day-month {
    font-size: 0.98rem;
    white-space: nowrap;
  }

  .day-badge {
    justify-self: end;
    margin-left: auto;
  }

  .day-slot,
  .day-empty,
  .day-blocked {
    padding: 14px;
  }

  .day-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
  }

  .day-note {
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .day-slot.is-available {
    width: auto;
    min-width: 122px;
    padding: 12px 14px;
    justify-items: center;
    text-align: center;
    align-self: start;
  }

  .day-slot.is-available small {
    display: none;
  }

  .dialog-header {
    flex-direction: column;
    align-items: stretch;
  }

  .booking-dialog,
  .success-dialog {
    width: calc(100% - 16px);
    max-width: none;
    margin: auto;
  }

  .booking-form,
  .success-card {
    padding: 20px;
    border-radius: 24px;
  }

  .booking-form {
    gap: 14px;
  }

  .booking-form .calendar-kicker {
    margin-bottom: 6px;
  }

  .booking-form h2,
  .success-card h2 {
    font-size: 1.45rem;
  }

  .selected-slot {
    padding: 14px 16px;
  }

  .booking-form input,
  .admin-login-form input {
    min-height: 50px;
    padding: 0 14px;
  }

  .dialog-header .ghost-button {
    align-self: flex-end;
    min-height: 46px;
    padding: 0 16px;
  }

  .booking-form .primary-button,
  .success-card .primary-button {
    width: 100%;
  }

  .selected-slot strong {
    font-size: 1.03rem;
  }

  .success-message {
    font-size: 0.98rem;
  }

  th,
  td {
    padding: 14px 12px;
  }
}

@media (max-width: 420px) {
  .calendar-page,
  .page-shell {
    width: calc(100% - 14px);
  }

  .calendar-shell,
  .section-panel,
  .admin-hero {
    padding: 14px;
    border-radius: 20px;
  }

  .calendar-topbar h1 {
    font-size: 1.5rem;
  }

  .calendar-rules span {
    min-height: 48px;
    font-size: 0.94rem;
  }

  .day-header {
    grid-template-columns: auto auto 1fr;
  }

  .day-badge {
    grid-column: 1 / -1;
    justify-self: start;
    margin-left: 0;
  }

  .day-body {
    grid-template-columns: 1fr;
  }

  .day-slot.is-available {
    width: 100%;
  }

  .calendar-toolbar {
    padding: 16px 14px 14px;
  }

  .month-label {
    font-size: 1.35rem;
  }

  .week-label,
  .calendar-kicker,
  .eyebrow,
  .card-kicker {
    font-size: 0.68rem;
  }

  .booking-form,
  .success-card {
    padding: 18px;
  }

  .dialog-header .ghost-button {
    width: auto;
    min-width: 106px;
  }

  .selected-slot strong {
    font-size: 1rem;
  }
}