* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f6fa;
  color: #1a1d2e;
  height: 100vh;
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Mobile Header (desktop: hidden) ── */
#mobile-header { display: none; }
#sidebar-overlay { display: none; }

/* ── Left Nav ── */
#nav {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  box-shadow: 1px 0 2px rgba(0,0,0,0.04), 2px 0 8px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  padding: 28px 16px;
  gap: 4px;
}

#nav .logo {
  font-size: 22px;
  font-weight: 800;
  color: #2B3FE6;
  margin-bottom: 28px;
  padding-left: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: #6b7280;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}

.nav-item:hover { background: #f0f2ff; color: #2B3FE6; }
.nav-item.active { background: #eef0fd; color: #2B3FE6; font-weight: 600; }

.nav-item svg { flex-shrink: 0; }

/* ── Nav Filters (sidebar filters section) ── */
.nav-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 4px 8px;
  border-top: 1px solid #e8eaf0;
  margin-top: 8px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9ca3af;
  text-transform: uppercase;
  padding: 0 8px 2px;
}

/* ── Right Content ── */
#content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tab-panel { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.tab-panel.active { display: flex; }

/* ── Login Page ── */
#login-page {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100%;
  gap: 20px;
}

.login-logo {
  font-size: 32px;
  font-weight: 800;
  color: #2B3FE6;
}

.login-subtitle {
  font-size: 15px;
  color: #6b7280;
}

#login-error {
  color: #c0392b;
  font-size: 14px;
  min-height: 20px;
}

/* ── Loading ── */
.stat-cards-loading { display: flex; justify-content: center; padding: 40px 0; grid-column: 1 / -1; }
.upcoming-loading { display: flex; justify-content: center; padding: 24px 0; }

.spinner {
  width: 20px; height: 20px;
  border: 2px solid #e8eaf0;
  border-top-color: #2B3FE6;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.resource-loading {
  opacity: 0.4;
  pointer-events: none;
}

#fc-root {
  position: relative;
}

.column-spinner {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  z-index: 15;
  pointer-events: none;
}

.column-spinner-icon {
  width: 40px;
  height: 40px;
  border: 4px solid #e8eaf0;
  border-top-color: #2B3FE6;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.stat-spinner { display: inline-block; width: 18px; height: 18px; vertical-align: middle; }

/* ── Dashboard ── */
#dashboard {
  padding: 40px 48px;
  overflow-y: auto;
}

.pull-indicator {
  height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 13px;
}

#dashboard h1 {
  font-size: 32px; font-weight: 800; color: #1a1d2e;
  margin-bottom: 6px;
  text-wrap: balance;
}

#dashboard .subtitle {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #9ca3af; margin-top: 28px; margin-bottom: 12px;
}

.stat-cards { display: flex; flex-direction: column; gap: 12px; }

.stat-card {
  background: #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-body { flex: 1; }

.stat-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  color: #9ca3af; text-transform: uppercase; margin-bottom: 4px;
}

.stat-value {
  font-size: 28px; font-weight: 800; color: #1a1d2e; line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-value .stat-total {
  font-size: 16px; font-weight: 500; color: #6b7280;
}

.stat-value .stat-unit {
  font-size: 16px; font-weight: 500; color: #6b7280; margin-left: 4px;
}


/* ── Upcoming Classes ── */
.upcoming-section { margin-top: 28px; }

.upcoming-section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #9ca3af; margin-bottom: 12px;
}

.upcoming-loading { display: flex; justify-content: center; padding: 24px 0; }

.class-item {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.class-item:active { background: #f5f6fa; transform: scale(0.96); }

.class-item-time {
  font-size: 13px; font-weight: 700; color: #2B3FE6;
  text-transform: uppercase; letter-spacing: 0.04em;
}

.class-item-name { font-size: 18px; font-weight: 700; color: #1a1d2e; text-wrap: balance; }

.class-item-meta { font-size: 14px; color: #6b7280; }

.upcoming-empty {
  font-size: 14px; color: #9ca3af; padding: 12px 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ── Calendar ── */
#calendar { display: flex; flex-direction: column; overflow: hidden; flex: 1; }

.toggle-full {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #4b5563; cursor: pointer;
  white-space: nowrap; user-select: none;
  padding: 6px 12px; border: 1.5px solid #d1d5db; border-radius: 10px;
  background: #fff;
}
.toggle-full input { display: none; }
.toggle-full .toggle-track {
  width: 36px; height: 20px; border-radius: 10px;
  background: #d1d5db; position: relative; transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-full input:checked + .toggle-track { background: #2B3FE6; }
.toggle-full .toggle-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
}
.toggle-full input:checked + .toggle-track::after { transform: translateX(16px); }

/* Area selector */
.area-select {
  width: 100%;
  padding: 8px 30px 8px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: #1a1d2e;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.area-select:hover { border-color: #2B3FE6; }
.area-select:focus { outline: none; border-color: #2B3FE6; }

/* View switcher (sidebar — hidden on desktop, shown on mobile) */
#sidebar-view-section { display: none; }

.view-switcher {
  display: flex;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  overflow: hidden;
}

.view-btn {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.view-btn:not(:last-child) { border-right: 1.5px solid #d1d5db; }
.view-btn:hover { background: #f0f2ff; color: #2B3FE6; }
.view-btn:active { transform: scale(0.96); }
.view-btn.active { background: #2B3FE6; color: #fff; }

/* Inline club list */
.club-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.club-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  transition: background 0.15s, transform 0.15s;
}

.club-item:hover { background: #f5f6fa; }
.club-item:active { transform: scale(0.96); }
.club-item input[type=checkbox] { accent-color: #2B3FE6; width: 15px; height: 15px; flex-shrink: 0; }

.club-item-all {
  font-weight: 600;
  background: #f5f6fa;
  color: #2B3FE6;
  border-bottom: 1px solid #e8eaf0;
  margin-bottom: 4px;
  border-radius: 7px 7px 0 0;
}

/* ── Calendar Loading Overlay ── */
.cal-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  gap: 10px;
  color: #6b7280;
  font-size: 15px;
  backdrop-filter: blur(2px);
}

.cal-loading-overlay.visible { display: flex; }

/* Inline calendar status */
.cal-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px;
  color: #6b7280;
  font-size: 15px;
  width: 100%;
}

/* ── FullCalendar Container ── */
#cal-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #fff;
}

#fc-root {
  height: 100%;
}

/* ── FullCalendar Theme Overrides ── */
.fc {
  --fc-border-color: #e8eaf0;
  --fc-today-bg-color: rgba(43, 63, 230, 0.04);
  --fc-now-indicator-color: #e74c3c;
  --fc-button-bg-color: #fff;
  --fc-button-border-color: #d1d5db;
  --fc-button-text-color: #1a1d2e;
  --fc-button-hover-bg-color: #f0f2ff;
  --fc-button-hover-border-color: #2B3FE6;
  --fc-button-active-bg-color: #2B3FE6;
  --fc-button-active-border-color: #2B3FE6;
  --fc-page-bg-color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.fc .fc-toolbar { padding: 12px 16px; }
@media (min-width: 769px) {
  .fc .fc-toolbar { padding-right: 64px; }
}
.fc .fc-toolbar-title { font-size: 16px; font-weight: 700; color: #1a1d2e; }

.fc .fc-button {
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 6px 14px !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-shadow: none !important;
}

.fc .fc-button-group > .fc-button { border-radius: 0 !important; }
.fc .fc-button-group > .fc-button:first-child { border-radius: 8px 0 0 8px !important; }
.fc .fc-button-group > .fc-button:last-child { border-radius: 0 8px 8px 0 !important; }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: #fff !important; }

.fc .fc-timegrid-slot { height: 48px; }
.fc .fc-timegrid-slot-label { font-size: 11px; color: #9ca3af; }
.fc .fc-col-header-cell-cushion { font-size: 13px; font-weight: 600; padding: 10px 4px; }
.fc .fc-scrollgrid { border: none; }

/* Event styling */
.fc .fc-timegrid-event { border-radius: 6px; border: none; overflow: hidden; transition: transform 0.15s; }
.fc .fc-timegrid-event:active { transform: scale(0.96); }
.fc .fc-timegrid-event .fc-event-main { padding: 4px 6px; overflow: hidden; }

.fc-event-inner {
  display: flex;
  flex-direction: column;
  gap: 1px;
  height: 100%;
  overflow: hidden;
}

.fc-event-name {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
}

.fc-event-time,
.fc-event-coach {
  font-size: 10px !important;
  font-weight: 500 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.fc-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  white-space: nowrap;
  margin-top: auto;
  align-self: flex-start;
}

/* Event states */
.fc-event.ev-default, .fc-event.ev-low-spots {
  background: #fff !important;
  border-left: 3px solid var(--club-color, #2B3FE6) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.ev-default .fc-event-name, .ev-low-spots .fc-event-name { color: #1a1d2e; }
.ev-default .fc-event-time, .ev-low-spots .fc-event-time { color: #374151; }
.ev-default .fc-event-coach, .ev-low-spots .fc-event-coach { color: #6b7280; }
.ev-default .fc-badge { background: #e6f7f5; color: #1A9E8C; }
.ev-low-spots .fc-badge { background: #fef2f2; color: #dc2626; }

.fc-event.ev-booked {
  background: var(--club-color, #2B3FE6) !important;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--club-color, #2B3FE6) 30%, transparent);
  color: #fff;
}
.ev-booked .fc-badge { background: rgba(255,255,255,0.25); color: #fff; }
.ev-booked .fc-badge-full-tag { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.7); font-weight: 600; }
.fc-badge-row { display: flex; gap: 4px; align-items: center; margin-top: auto; }

.fc-event.ev-full {
  background: #f9fafb !important;
  border-left: 3px solid #d1d5db !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.ev-full .fc-event-name { color: #4b5563; }
.ev-full .fc-event-time { color: #6b7280; }
.ev-full .fc-event-coach { color: #6b7280; }
.ev-full .fc-badge { background: #f0f1f5; color: #9ca3af; }

/* Available events render above full ones */
.fc-event.ev-default, .fc-event.ev-low-spots { z-index: 3 !important; }
.fc-event.ev-booked { z-index: 4 !important; }
.fc-event.ev-full { z-index: 1 !important; }

/* Resource column headers */
.fc .fc-resource-header { font-size: 12px; font-weight: 600; padding: 8px 4px; }

/* ── Class Modal ── */
#class-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
#class-modal-overlay.visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0s linear 0s;
}

#class-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 420px;
  width: 90%;
  padding: 28px 28px 24px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 0.2s cubic-bezier(0.2,0,0,1), transform 0.2s cubic-bezier(0.2,0,0,1);
}
#class-modal-overlay.visible #class-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none;
  cursor: pointer; color: #9ca3af;
  padding: 4px;
  line-height: 0;
}
#modal-close::before {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 40px; height: 40px;
  transform: translate(-50%, -50%);
}
#modal-close:hover { color: #1a1d2e; }
#modal-close:active { transform: scale(0.96); }

#modal-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
#modal-status-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
#modal-full-tag {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: #f0f1f5; color: #9ca3af;
}
.badge-booked { background: #eef0fd; color: #2B3FE6; }
.badge-full { background: #f0f1f5; color: #9ca3af; }
.badge-available { background: #e6f7f5; color: #1A9E8C; }
.badge-low-spots { background: #fef2f2; color: #dc2626; }

#modal-class-name {
  font-size: 22px; font-weight: 800; color: #1a1d2e;
  margin-bottom: 4px; line-height: 1.2;
  text-wrap: balance;
}

#modal-club-name {
  font-size: 14px; color: #6b7280; margin-bottom: 16px;
}

.modal-details {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 16px;
}

.modal-detail-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: #4b5563;
}
.modal-detail-row svg { flex-shrink: 0; color: #9ca3af; }

#modal-cancel-policy {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.policy-refundable { background: #e6f7f5; color: #0f766e; text-align: center; }
.policy-nonrefundable { background: #f0f1f5; color: #6b7280; text-align: center; }
.policy-expired { background: #fef2f2; color: #991b1b; text-align: center; }
.policy-info { background: #e6f7f5; color: #0f766e; text-align: center; }

#modal-message {
  display: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}
.msg-success { display: block; background: #e6f7f5; color: #0f766e; }
.msg-error { display: block; background: #fef2f2; color: #991b1b; text-align: center; }

#modal-actions { display: flex; flex-direction: column; gap: 8px; }

.modal-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.15s;
}
.modal-btn:hover:not(:disabled) { opacity: 0.85; }
.modal-btn:active:not(:disabled) { transform: scale(0.96); }
.modal-btn:disabled { cursor: not-allowed; opacity: 0.6; }

.btn-book { background: #2B3FE6; color: #fff; }
.btn-cancel { background: #fff; border: 1.5px solid #e74c3c; color: #e74c3c; }
.btn-confirm-cancel { background: #e74c3c; color: #fff; }
.btn-keep { background: #f5f6fa; color: #4b5563; }
.btn-disabled { background: #f0f1f5; color: #9ca3af; }
.btn-calendar { display: flex; align-items: center; justify-content: center; gap: 8px; background: #f5f6fa; color: #4b5563; text-decoration: none; box-sizing: border-box; }
#modal-calendar { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.calendar-hint { font-size: 12px; color: #9ca3af; text-align: center; }

/* ── Bottom Nav (desktop: hidden) ── */
#bottom-nav { display: none; }

/* ── Mobile (≤ 768px) ── */
@media (max-width: 768px) {

  /* Mobile top header */
  #mobile-header {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.03);
    padding: 0 8px;
    z-index: 100;
    gap: 4px;
  }

  .mobile-icon-btn {
    width: 44px; height: 44px;
    border: none; background: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: #1a1d2e;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.15s;
  }
  #hamburger-btn { visibility: hidden; }
  .mobile-icon-btn:active { background: #f0f2ff; transform: scale(0.96); }

  .mobile-title {
    flex: 1;
    font-size: 18px; font-weight: 800;
    color: #2B3FE6;
    padding-left: 4px;
  }

  .mobile-today-btn {
    padding: 7px 16px;
    border-radius: 20px;
    background: #eef0fd;
    color: #2B3FE6;
    border: none;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.15s;
  }
  .mobile-today-btn:active { background: #dde1fc; transform: scale(0.96); }

  /* Left nav becomes a slide-in sidebar */
  #nav {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    flex-direction: column;
    padding: 0 0 24px;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    gap: 0;
  }

  #nav.open { transform: translateX(0); }

  #nav .logo {
    display: flex;
    padding: 20px 20px 16px;
    font-size: 22px;
    margin-bottom: 4px;
  }

  /* Nav items: keep horizontal row layout inside sidebar */
  .nav-item {
    margin: 2px 12px;
    padding: 12px 14px;
    gap: 12px;
    font-size: 15px;
  }

  /* Remove the pill-on-icon highlight (that was for bottom tab bar) */
  .nav-item.active svg {
    background: none;
    border-radius: 0;
    padding: 0;
    box-sizing: initial;
  }

  /* Filters section full-width inside sidebar */
  .nav-filters {
    padding: 12px 16px 8px;
    margin-top: 4px;
  }

  /* Show sidebar view switcher on mobile, but hide the "VIEW" label */
  #sidebar-view-section { display: block; }
  #sidebar-view-section .nav-section-label { display: none; }

  /* Hide FC toolbar view buttons and today on mobile */
  .fc .fc-header-toolbar .fc-button-group:last-child { display: none; }
  .fc .fc-today-button { display: none; }

  /* Hide sidebar tab items on mobile (tabs are in bottom nav) */
  .nav-item[data-tab] { display: none; }

  .area-select { width: 100%; }
  .club-list { max-height: none; }
  .nav-filters { overflow-y: auto; flex: 1; }

  /* Bottom nav bar */
  #bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 56px;
    background: #fff;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.04), 0 -2px 8px rgba(0,0,0,0.03);
    z-index: 100;
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: none;
    cursor: pointer;
    color: #6b7280;
    font-size: 11px;
    font-weight: 500;
    padding: 0;
    transition: color 0.15s, transform 0.15s;
  }
  .bottom-nav-item.active { color: #2B3FE6; }
  .bottom-nav-item:active { transform: scale(0.96); }
  .bottom-nav-item svg { flex-shrink: 0; }

  /* Sidebar backdrop */
  #sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 150;
    display: block;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  }
  #sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0s linear 0s;
  }

  /* Content: pad top for mobile header, bottom for bottom nav */
  #content {
    padding-bottom: 56px;
    padding-top: 56px;
  }

  #dashboard {
    padding: 24px 16px 16px;
    flex: 1;
    overflow-y: auto;
  }

  #upcoming-classes {
    padding-bottom: 16px;
  }

  #dashboard h1 { font-size: 26px; }
  #dashboard .subtitle { margin-bottom: 20px; }

  .stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

  .stat-card { padding: 12px 14px; gap: 8px; }

  .stat-card:nth-child(-n+2) {
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-card:nth-child(3) { grid-column: 1 / -1; }

  .stat-icon { width: 36px; height: 36px; font-size: 17px; }

  .stat-value { font-size: 22px; }

  .upcoming-section { margin-top: 20px; }

  /* Compact calendar events for narrow columns */
  .fc .fc-timegrid-event .fc-event-main { padding: 2px 4px; }
  .fc-event-name {
    font-size: 11px;
    word-break: break-word;
  }
  .fc-event-time,
  .fc-event-coach {
    font-size: 9px !important;
  }
  .fc-badge { font-size: 9px; padding: 0 4px; }
}

/* ── Promo Modal ── */
.promo-overlay {
  position: fixed; inset: 0;
  z-index: 300;
  background: #000;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.promo-overlay.visible { opacity: 1; }

.promo-container {
  width: 100%; height: 100%;
  overflow: hidden;
  position: relative;
}

/* ── Presets ── */

#preset-section { display: flex; flex-direction: column; gap: 6px; }

.preset-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px;
}

.preset-add-btn {
  position: relative;
  width: 24px; height: 24px; border-radius: 50%;
  border: none; background: #eef0fd;
  color: #2B3FE6; font-size: 15px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.15s;
}
.preset-add-btn::before {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 40px; height: 40px;
  transform: translate(-50%, -50%);
}
.preset-add-btn:hover { background: #dde1fc; }
.preset-add-btn:active { transform: scale(0.96); }

.preset-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; }

.preset-chip {
  display: inline-flex; align-items: center; gap: 0;
  border-radius: 20px; border: 1.5px solid #d1d5db; background: #fff;
  font-size: 12px; font-weight: 600; color: #4b5563;
  overflow: hidden; max-width: 150px; user-select: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.preset-chip.active { border-color: #2B3FE6; box-shadow: 0 2px 8px rgba(43,63,230,0.25); }

.preset-chip-name {
  flex: 1; min-width: 0; padding: 8px 10px 8px 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.preset-chip-name:hover { background: #eef0fd; color: #2B3FE6; }
.preset-chip-name:active { transform: scale(0.96); }
.preset-chip.active .preset-chip-name { background: #2B3FE6; color: #fff; }
.preset-chip.active .preset-chip-name:hover { background: #1e2fb5; }

/* ⋮ button — always visible, never hover-gated */
.preset-chip-menu-btn {
  padding: 8px 10px; border: none; background: #f5f6fa;
  border-left: 1px solid #e8eaf0; cursor: pointer;
  color: #6b7280; font-size: 14px; line-height: 1;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.preset-chip-menu-btn:hover { background: #e8eaf0; color: #1a1d2e; }
.preset-chip-menu-btn:active { transform: scale(0.96); }
.preset-chip.active .preset-chip-menu-btn {
  background: #1e2fb5; border-left: none; color: #c7cef7;
}
.preset-chip.active .preset-chip-menu-btn:hover { background: #1828a0; color: #fff; }

/* ── Preset Modal ── */
#preset-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
#preset-modal-overlay.visible {
  opacity: 1; visibility: visible;
  transition: opacity 0.2s ease, visibility 0s linear 0s;
}

#preset-modal {
  background: #fff; border-radius: 14px; width: 320px; max-width: 90vw;
  padding: 24px 24px 20px; box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  position: relative; display: flex; flex-direction: column; gap: 14px;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 0.2s cubic-bezier(0.2,0,0,1), transform 0.2s cubic-bezier(0.2,0,0,1);
}
#preset-modal-overlay.visible #preset-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}
#preset-modal h3 { font-size: 16px; font-weight: 700; color: #1a1d2e; margin: 0; }

.preset-modal-close-btn {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; cursor: pointer; color: #9ca3af; padding: 2px; line-height: 0;
  transition: color 0.15s, transform 0.15s;
}
.preset-modal-close-btn::before {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 40px; height: 40px;
  transform: translate(-50%, -50%);
}
.preset-modal-close-btn:hover { color: #1a1d2e; }
.preset-modal-close-btn:active { transform: scale(0.96); }

.preset-name-input {
  width: 100%; padding: 9px 12px; border: 1.5px solid #d1d5db;
  border-radius: 9px; font-size: 14px; font-family: inherit; color: #1a1d2e;
  outline: none; transition: border-color 0.15s; box-sizing: border-box;
}
.preset-name-input:focus { border-color: #2B3FE6; }

.preset-update-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #4b5563; cursor: pointer;
}

.preset-modal-error { font-size: 12px; color: #dc2626; min-height: 16px; margin: -8px 0 0; }

.preset-modal-actions { display: flex; gap: 8px; align-items: center; }

.preset-modal-btn {
  padding: 8px 18px; border-radius: 8px; font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; font-family: inherit; transition: opacity 0.15s, transform 0.15s;
}
.preset-modal-btn:hover { opacity: 0.85; }
.preset-modal-btn:active { transform: scale(0.96); }
.preset-modal-btn-primary { background: #2B3FE6; color: #fff; }
.preset-modal-btn-secondary { background: #f0f1f5; color: #4b5563; }
.preset-modal-btn-danger { background: #fdecea; color: #c0392b; }

/* ── Profile button & popover ── */
.header-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

#desktop-profile-btn {
  display: none;
}
@media (min-width: 769px) {
  #desktop-profile-btn {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 9px; right: 20px; z-index: 100;
    width: 36px; height: 36px; border-radius: 50%;
    background: #fff; border: 1px solid #e8eaf0;
    cursor: pointer; color: #1a1d2e;
    transition: background 0.15s;
  }
  #desktop-profile-btn:hover { background: #f0f2ff; }
}

#profile-popover {
  position: fixed; z-index: 400;
  background: #fff; border: 1px solid #e8eaf0;
  border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 0;
  min-width: 220px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.15s cubic-bezier(0.2,0,0,1), transform 0.15s cubic-bezier(0.2,0,0,1), visibility 0s linear 0s;
}
#profile-popover[hidden] {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(0.97);
  transition: opacity 0.15s cubic-bezier(0.2,0,0,1), transform 0.15s cubic-bezier(0.2,0,0,1), visibility 0s linear 0.15s;
}
#profile-email {
  font-size: 13px; color: #6b7280;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f1f5;
}
#logout-btn {
  background: none; border: none;
  padding: 12px 0 0;
  font-size: 14px; color: #4b5563;
  cursor: pointer; text-align: center; font-family: inherit; font-weight: 500;
  transition: color 0.15s;
}
#logout-btn:hover { color: #2B3FE6; }
