/* ===========================
   Gerry's Spinning Classes
   NHC-Inspired Design System
   =========================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f8f9fb;
  color: #1a1a2e;
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

:root {
  --primary:      #141414;   /* dark brand bar (matches logo background) */
  --secondary:    #2563EB;   /* brand blue — buttons, links, tabs, highlights */
  --accent:       #2563EB;   /* brand blue — book actions, dots, badges */
  --accent-dark:  #1D4ED8;   /* darker blue for hovers */
  --input-border: #c7ccd6;
  --input-focus:  #2563EB;
  --bg:           #f8f9fb;
  --card-bg:      #ffffff;
  --text:         #1a1a2e;
  --text-muted:   #6b7280;
  --border:       #e8edf3;
  --danger:       #ef4444;
  --danger-bg:    #fef2f2;
}

/* ===== HEADER ===== */
.app-header {
  background: var(--primary);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.header-brand { display: flex; align-items: center; gap: 12px; color: white; }
.header-logo {
  width: 38px; height: 38px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px; color: white; flex-shrink: 0;
}
.header-logo-img {
  width: 40px; height: 40px;
  border-radius: 10px;
  object-fit: cover; flex-shrink: 0;
  background: #000;
}
.auth-logo-img {
  width: 64px; height: 64px;
  border-radius: 14px;
  object-fit: cover;
  display: block; margin: 0 auto 16px;
  background: #000;
}
.header-title { font-size: 15px; font-weight: 600; line-height: 1.2; }
.header-sub { font-size: 11px; color: rgba(255,255,255,0.6); }
.header-right { display: flex; align-items: center; gap: 12px; position: relative; }
.header-user-name { font-size: 13px; color: rgba(255,255,255,0.85); }
.back-btn {
  display: inline-flex; align-items: center; gap: 5px;
  color: rgba(255,255,255,0.85); font-size: 13px; font-weight: 500;
  text-decoration: none;
  background: rgba(255,255,255,0.1);
  border-radius: 8px; padding: 6px 12px;
  transition: background 0.2s; white-space: nowrap;
}
.back-btn:hover { background: rgba(255,255,255,0.2); color: white; }

/* ===== BURGER MENU ===== */
.burger-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  border: none; background: rgba(255,255,255,0.1);
  border-radius: 8px; cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  transition: background 0.2s;
}
.burger-btn:hover { background: rgba(255,255,255,0.2); }
.burger-bar {
  display: block; width: 18px; height: 2px;
  background: white; border-radius: 2px;
}
.burger-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--card-bg); min-width: 180px;
  z-index: 200; border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  border-radius: 12px; overflow: hidden;
  animation: slideDown 0.16s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.burger-item {
  display: flex; align-items: center;
  width: 100%; padding: 13px 18px;
  font-size: 14px; font-weight: 500; color: var(--text);
  text-decoration: none; border: none; background: none;
  text-align: left; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.burger-item:last-child { border-bottom: none; }
.burger-item:hover { background: #f0f4f8; }
.burger-item.danger { color: var(--danger); }

/* ===== PAGE LAYOUT ===== */
.page { max-width: 600px; margin: 0 auto; padding: 32px 16px 80px; }
.page-wide { max-width: 960px; margin: 0 auto; padding: 32px 16px 80px; }

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px 22px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}
.card-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 18px; }

.card-compact { padding: 12px 16px; margin-bottom: 14px; }
.card-title-sm { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ===== NEXT SESSION (compact reminder) ===== */
.next-session-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.next-session-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.next-session-icon { font-size: 20px; flex-shrink: 0; }
.next-session-title { font-size: 14px; font-weight: 600; }
.next-session-meta { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.next-session-empty {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-muted); padding: 2px 0;
}
.next-session-empty .icon { font-size: 20px; }

/* ===== AUTH PAGE ===== */
.auth-page {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  background: white;
  border-radius: 20px;
  padding: 36px 28px 32px;
  width: 100%; max-width: 420px;
  box-shadow: 0 6px 30px rgba(0,0,0,0.1);
}
.auth-logo {
  width: 56px; height: 56px;
  background: var(--primary);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; color: white;
  margin: 0 auto 16px;
}
.auth-title { font-size: 22px; font-weight: 600; text-align: center; margin-bottom: 4px; }
.auth-subtitle { font-size: 13.5px; color: var(--text-muted); text-align: center; margin-bottom: 28px; }

.auth-switch {
  font-size: 13.5px; color: var(--text-muted);
  text-align: center; margin-top: 20px;
}
.auth-switch a { color: var(--secondary); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* ===== NHC PILL INPUTS ===== */
.form-group { margin-bottom: 14px; }

.form-input {
  width: 100%;
  padding: 15px 22px;
  border: 1.5px solid var(--input-border);
  border-radius: 50px;
  font-size: 15px; color: var(--text);
  background: white; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(59,108,197,0.1);
}
.form-input::placeholder { color: #888; }
.form-input.error { border-color: var(--danger); }
.form-input:disabled { background: #f5f7fa; color: var(--text-muted); }

/* Square inputs (admin forms) */
.form-input-sq {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--input-border);
  border-radius: 10px;
  font-size: 14px; color: var(--text);
  background: white; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input-sq:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(59,108,197,0.1);
}
select.form-input-sq { cursor: pointer; }

.form-label {
  display: block; font-size: 12.5px;
  font-weight: 500; color: var(--text-muted);
  margin-bottom: 5px;
}
.helper-text {
  font-size: 12.5px; color: var(--text-muted);
  text-align: center; margin: 6px 0 12px;
  line-height: 1.55; padding: 0 4px;
}
.error-msg {
  font-size: 12px; color: var(--danger);
  margin-top: 4px; padding-left: 8px;
  display: none;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center;
  justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 50px;
  font-size: 15px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  border: 1.5px solid transparent;
  width: 100%; letter-spacing: 0.2px;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* NHC outlined blue */
.btn-outline {
  background: white;
  border-color: var(--secondary);
  color: var(--secondary);
}
.btn-outline:hover:not(:disabled) { background: var(--secondary); color: white; }

/* Solid green */
.btn-green {
  background: var(--accent);
  border-color: var(--accent); color: white;
}
.btn-green:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }

/* Solid blue */
.btn-blue {
  background: var(--secondary);
  border-color: var(--secondary); color: white;
}
.btn-blue:hover:not(:disabled) { background: #2d5ab0; }

/* Outline gray */
.btn-gray {
  background: white; border-color: #ccc; color: #666;
  font-size: 14px; padding: 10px 20px;
}
.btn-gray:hover:not(:disabled) { border-color: #999; color: #333; }

/* Danger */
.btn-danger-outline {
  background: white; border-color: var(--danger); color: var(--danger);
  font-size: 13px; padding: 8px 16px;
}
.btn-danger-outline:hover:not(:disabled) { background: var(--danger); color: white; }

.btn-sm { padding: 8px 16px; font-size: 13px; width: auto; }
.btn-xs { padding: 5px 12px; font-size: 12px; width: auto; border-radius: 20px; }

/* ===== OTP BOXES ===== */
.otp-container { display: flex; gap: 8px; justify-content: center; margin: 24px 0; }
.otp-box {
  width: 48px; height: 56px;
  border: 1.5px solid var(--input-border);
  border-radius: 12px; font-size: 22px; font-weight: 600;
  text-align: center; outline: none; transition: all 0.2s;
  color: var(--primary); -moz-appearance: textfield;
}
.otp-box::-webkit-outer-spin-button,
.otp-box::-webkit-inner-spin-button { -webkit-appearance: none; }
.otp-box:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(59,108,197,0.12); }
.otp-box.filled { border-color: var(--accent); background: #f0faf4; }

/* ===== CALENDAR ===== */
.calendar-nav {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 16px;
}
.calendar-month { font-size: 17px; font-weight: 600; }
.cal-nav-btn {
  width: 34px; height: 34px;
  border: 1.5px solid var(--border); border-radius: 50%;
  background: white; color: var(--text-muted);
  font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.cal-nav-btn:hover { border-color: var(--secondary); color: var(--secondary); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day-hdr {
  text-align: center; font-size: 11px; font-weight: 600;
  color: var(--text-muted); padding: 8px 0;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.cal-day {
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; border-radius: 10px; position: relative;
  transition: all 0.15s; font-size: 13px; color: var(--text);
}
.cal-day:hover:not(.empty):not(.past) { background: #f0f4f8; }
.cal-day.empty, .cal-day.past { color: #ccc; cursor: default; }
.cal-day.today .day-num {
  background: var(--secondary); color: white;
  border-radius: 50%;
}
.cal-day.selected { background: #eff4ff; border-radius: 10px; }
.day-num { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.class-dot {
  width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%; margin-top: 2px;
}

/* ===== CLASS CARDS ===== */
.class-card {
  background: white; border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 12px; transition: box-shadow 0.2s;
}
.class-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.class-card.cancelled { border-left-color: #ccc; opacity: 0.6; }
.class-card.booked {
  background: #eff6ff;
  border-color: var(--accent);
  border-left-width: 6px;
}
.class-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.class-name { font-size: 15px; font-weight: 600; }
.class-time { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.class-instructor { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.cap-badge {
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  white-space: nowrap; flex-shrink: 0;
}
.cap-available { background: #f0faf4; color: var(--accent-dark); }
.cap-full { background: #fef2f2; color: var(--danger); }
.cap-low { background: #fffbeb; color: #b45309; }
.class-card-actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.booked-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--accent); font-weight: 500;
}
.attendees-link {
  background: none; border: none; cursor: pointer;
  font-size: 12.5px; font-weight: 500; color: var(--secondary);
  padding: 8px 4px; margin-left: auto;
}
.attendees-link:hover { text-decoration: underline; }

/* ===== SESSION COVERED BANNER ===== */
.session-covered-banner {
  background: #eff6ff; border: 1px solid var(--accent);
  color: var(--accent-dark); font-weight: 600; font-size: 13px;
  text-align: center; padding: 10px 14px; border-radius: 10px;
  margin-bottom: 12px;
}

/* ===== SPINNER ===== */
.spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--border); border-top-color: var(--secondary);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin: 32px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-wrap { text-align: center; padding: 32px; color: var(--text-muted); font-size: 14px; }

/* ===== TOAST ===== */
.toast-wrap {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%); z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; min-width: 240px;
}
.toast {
  padding: 12px 22px; border-radius: 50px; font-size: 14px;
  font-weight: 500; text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  animation: toastIn 0.3s ease; pointer-events: all;
}
.toast-ok  { background: var(--accent);     color: white; }
.toast-err { background: var(--danger);     color: white; }
.toast-inf { background: var(--secondary);  color: white; }
@keyframes toastIn { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== ALERT ===== */
.alert {
  padding: 12px 16px; border-radius: 10px;
  font-size: 14px; margin-bottom: 16px;
}
.alert-err { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-ok  { background: #f0faf4; color: #065f46; border: 1px solid #a7f3d0; }
.alert-inf { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ===== ADMIN TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  background: #f8f9fb; padding: 11px 14px; text-align: left;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
tbody tr:hover { background: #f9fbfc; }
tbody td { padding: 11px 14px; vertical-align: middle; }

.s-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.s-active    { background: #f0faf4; color: var(--accent-dark); }
.s-cancelled { background: #fef2f2; color: var(--danger); }
.s-confirmed { background: #f0faf4; color: var(--accent-dark); }
.s-full      { background: #fff7ed; color: #c05621; }
.s-pending   { background: #fff7ed; color: #c05621; }

/* ===== STATS ===== */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: white; border-radius: 14px; padding: 18px 14px;
  text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.stat-num { font-size: 28px; font-weight: 700; color: var(--secondary); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== TABS ===== */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 11px 18px; border: none; background: transparent;
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.2s;
}
.tab-btn.active { color: var(--secondary); border-bottom-color: var(--secondary); }

/* ===== FORM GRID ===== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== ATTENDEE ACCORDION ===== */
.attendee-toggle {
  background: none; border: none; color: var(--secondary);
  font-size: 13px; cursor: pointer; padding: 0; font-weight: 500;
}
.attendee-list { display: none; margin-top: 12px; }
.attendee-list.open { display: block; }
.attendee-row {
  display: flex; justify-content: space-between;
  padding: 8px 4px; font-size: 13px;
  border-bottom: 1px solid #f0f4f8;
}
.attendee-row:last-child { border-bottom: none; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-icon { font-size: 40px; margin-bottom: 10px; }
.empty-state p { font-size: 15px; margin-bottom: 4px; }
.empty-state small { font-size: 13px; }

/* ===== DIVIDER ===== */
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--accent); }
.text-danger { color: var(--danger); }
.mt-4 { margin-top: 16px; }
.mt-2 { margin-top: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-2 { margin-bottom: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.fw-600 { font-weight: 600; }

/* ===== ATTENDEE MODAL (Feature 1) ===== */
.attendee-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.attendee-modal {
  background: white; border-radius: 16px;
  padding: 28px 24px; width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.attendee-modal.has-two { max-width: 720px; }
.attendee-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.attendee-modal-header h2 {
  font-size: 16px; font-weight: 600; margin: 0;
}
.attendee-modal-close {
  width: 32px; height: 32px; border: none; background: #f0f4f8;
  border-radius: 50%; font-size: 18px; cursor: pointer; color: #666;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.attendee-modal-close:hover { background: #e0e4e8; }
.attendee-panels {
  display: flex; gap: 16px;
}
.attendee-panel {
  flex: 1;
  background: #f8f9fb; border-radius: 10px; padding: 14px;
}
.attendee-panel h3 {
  font-size: 14px; font-weight: 600; margin-bottom: 10px;
  color: var(--secondary);
}
.attendee-panel ul {
  list-style: none; padding: 0; margin: 0;
}
.attendee-panel ul li {
  font-size: 14px; line-height: 1.8;
  padding: 4px 0;
  border-bottom: 1px solid #e8edf3;
}
.attendee-panel ul li:last-child { border-bottom: none; }

/* ===== WHATSAPP FAB (Feature 2) ===== */
.whatsapp-fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 56px; height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  cursor: pointer; z-index: 400;
  transition: transform 0.2s, box-shadow 0.2s;
}
.whatsapp-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* ===== FOOTER (Feature 2) ===== */
.app-footer {
  padding: 24px; text-align: center;
  font-size: 13px; color: var(--text-muted);
  margin-top: auto;
}
.app-footer a {
  color: var(--secondary); font-weight: 500;
  transition: color 0.15s;
}
.app-footer a:hover { color: var(--primary); text-decoration: underline; }

/* ===== GALLERY ===== */
.gallery-add-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.gallery-add-fab {
  width: 48px; height: 48px; flex-shrink: 0;
  background: var(--accent);
  border: none; border-radius: 50%;
  color: white; font-size: 26px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.gallery-add-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.gallery-upload-status {
  font-size: 13px; color: var(--text-muted);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.gallery-thumb {
  aspect-ratio: 1 / 1; padding: 0; border: none;
  border-radius: 12px; overflow: hidden; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  transition: transform 0.15s, box-shadow 0.15s;
  background: #f0f4f8;
}
.gallery-thumb:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.18); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gallery-lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.gallery-lightbox {
  position: relative;
  display: flex; flex-direction: column;
  width: 100%; height: 100%;
  max-width: 900px; max-height: 90vh;
}
.gallery-lightbox-img {
  flex: 1; width: 100%; min-height: 0;
  object-fit: contain;
}
.gallery-lightbox-close {
  position: absolute; top: -4px; right: -4px;
  width: 36px; height: 36px; border: none; background: rgba(255,255,255,0.15);
  color: white; border-radius: 50%; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s; z-index: 1;
}
.gallery-lightbox-close:hover { background: rgba(255,255,255,0.3); }
.gallery-nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: none; background: rgba(255,255,255,0.15);
  color: white; border-radius: 50%; font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.gallery-nav-btn:hover { background: rgba(255,255,255,0.3); }
.gallery-nav-prev { left: 8px; }
.gallery-nav-next { right: 8px; }
.gallery-lightbox-footer {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 14px 0 4px;
}
.gallery-lightbox-counter { color: rgba(255,255,255,0.8); font-size: 13px; }
.gallery-lightbox-footer .btn { width: auto; padding: 10px 20px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .auth-card { padding: 28px 18px 24px; }
  .card { padding: 18px 14px; }
  .modal-overlay { padding: 24px 10px; }
  .modal { padding: 20px 16px; }
  .stats-row { gap: 8px; }
  .stat-card { padding: 12px 6px; }
  .stat-num { font-size: 20px; }
  .stat-label { font-size: 11px; }
  .form-row { grid-template-columns: 1fr; }
  .otp-box { width: 40px; height: 50px; font-size: 20px; }
  .page-wide { padding: 20px 12px 48px; }
  .app-header { padding: 0 12px; height: 56px; }
  .header-title { font-size: 13px; }
  .header-sub  { font-size: 10px; }
  .header-logo-img { width: 32px; height: 32px; border-radius: 8px; }
  .header-user-name { font-size: 12px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .back-btn { font-size: 12px; padding: 5px 10px; }

  /* Calendar */
  .calendar-grid { gap: 2px; }
  .cal-day { font-size: 12px; border-radius: 8px; }
  .day-num { width: 24px; height: 24px; font-size: 12px; }
  .class-dot { width: 5px; height: 5px; }

  /* Class cards */
  .class-card { padding: 14px 12px; }
  .class-name  { font-size: 14px; }
  .class-time, .class-instructor { font-size: 12px; }
  .class-card-actions { flex-wrap: wrap; gap: 8px; }
  .attendees-link { width: 100%; text-align: center; margin-left: 0; }

  /* Bike grid — keep table layout on mobile */
  .bike-grid th,
  .bike-grid td { padding: 6px 6px; font-size: 12px; }
  .bike-grid .bike-col { width: 36px; }

  /* Attendee modal */
  .attendee-modal { padding: 20px 14px; border-radius: 14px; }
  .attendee-modal.has-two { max-width: 100%; }
  .attendee-panels { flex-direction: column; gap: 12px; }

  /* Next session */
  .next-session-row { flex-wrap: wrap; gap: 8px; }
  .next-session-title { font-size: 13px; }
  .next-session-meta  { font-size: 11px; }

  /* Bike fit strip */
  .bike-fit-strip { padding: 8px 10px; font-size: 12px; }

  /* Buttons */
  .btn { font-size: 14px; padding: 12px 18px; }
  .btn-sm { font-size: 12px; padding: 7px 14px; }
  .session-covered-banner { font-size: 12px; }
}

/* ===== ADMIN TABLES → CARDS ON SMALL SCREENS ===== */
@media (max-width: 700px) {
  .tabs {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  .tab-btn { white-space: nowrap; flex-shrink: 0; padding: 11px 14px; font-size: 13px; }

  .table-wrap table:not(.bike-grid),
  .modal table:not(.bike-grid) {
    display: block;
  }
  .table-wrap table:not(.bike-grid) thead,
  .modal table:not(.bike-grid) thead {
    display: none;
  }
  .table-wrap table:not(.bike-grid) tbody,
  .modal table:not(.bike-grid) tbody {
    display: block;
  }
  .table-wrap table:not(.bike-grid) tbody tr,
  .modal table:not(.bike-grid) tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px 14px;
    margin-bottom: 10px;
  }
  .table-wrap table:not(.bike-grid) tbody td,
  .modal table:not(.bike-grid) tbody td {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid #f0f4f8;
    text-align: left;
  }
  .table-wrap table:not(.bike-grid) tbody td:last-child,
  .modal table:not(.bike-grid) tbody td:last-child {
    border-bottom: none;
  }
  .table-wrap table:not(.bike-grid) tbody td::before,
  .modal table:not(.bike-grid) tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 3px;
  }
  .table-wrap table:not(.bike-grid) tbody td.actions-cell,
  .modal table:not(.bike-grid) tbody td.actions-cell {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  }
  .table-wrap table:not(.bike-grid) tbody td.actions-cell::before,
  .modal table:not(.bike-grid) tbody td.actions-cell::before {
    flex-basis: 100%;
  }
}

/* ===== BIKE FIT STRIP ===== */
.bike-fit-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: #f8f9fb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
}
.bike-fit-label {
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
  white-space: nowrap;
}
.bike-fit-pill {
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  color: var(--text);
}
.bike-fit-pill strong { color: var(--accent); }
.bike-fit-edit {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}
.bike-fit-edit:hover { background: var(--accent); color: white; }

/* ===== PROFILE PAGE ===== */
.profile-form .form-group { margin-bottom: 16px; }
.profile-form label.form-label { margin-bottom: 6px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .profile-grid { grid-template-columns: 1fr; } }

/* ===== CLASS CARD ROW (side by side slots) ===== */
/* Two same-day sessions, grouped and shown side by side (even on mobile) */
.session-pair {
  border: 1px solid var(--border); border-radius: 14px;
  padding: 12px; margin-bottom: 12px; background: #fafbfc;
}
.session-pair .session-covered-banner { margin-bottom: 10px; }

.class-cards-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* 3+ classes on same day: single column so cards don't orphan */
.class-cards-col { display: grid; grid-template-columns: 1fr; gap: 10px; }
.class-cards-row .class-card { margin-bottom: 0; padding: 12px 10px; }
.class-cards-row .class-card-top { flex-direction: column; gap: 6px; }
.class-cards-row .cap-badge { align-self: flex-start; }
.class-cards-row .class-name { font-size: 13.5px; }
.class-cards-row .class-time,
.class-cards-row .class-instructor { font-size: 11.5px; }
.class-cards-row .class-card p.text-sm { font-size: 11.5px; }
.class-cards-row .class-card-actions { flex-direction: column; align-items: stretch; gap: 6px; margin-top: 10px; }
.class-cards-row .class-card-actions .btn { width: 100%; }
.class-cards-row .booked-label { justify-content: center; }
.class-cards-row .attendees-link { margin-left: 0; text-align: center; }

@media (max-width: 360px) {
  .session-pair { padding: 8px; }
  .class-cards-row { gap: 6px; }
  .class-cards-row .class-card { padding: 10px 8px; }
  .class-cards-row .class-name { font-size: 12.5px; }
}

/* ===== BIKE GRID (attendee spreadsheet view) ===== */
.bike-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.bike-grid th,
.bike-grid td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
.bike-grid thead th {
  background: #f8f9fb;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.bike-grid .bike-col {
  width: 52px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  background: #fafbfc;
}
.bike-grid td.empty-bike {
  color: #c0c4cc;
  font-style: italic;
}
.bike-grid td.taken {
  background: #f0f4f8;
}
.bike-grid td.mine {
  background: #ecfdf5;
  color: var(--accent);
  font-weight: 600;
}
.bike-grid td.available {
  cursor: pointer;
  background: white;
  transition: background 0.15s;
}
.bike-grid td.available:hover {
  background: #eff4ff;
  color: var(--secondary);
}
.bike-grid td.locked {
  cursor: default;
  opacity: 0.45;
}
.bike-grid td.locked:hover {
  background: inherit;
  color: #c0c4cc;
}
.slot-hint {
  font-size: 12px; color: var(--text-muted);
  margin: 0 0 8px; font-style: italic;
}
/* Inline "Request a swap" link inside slot hint */
.swap-request-inline {
  background: none; border: none; padding: 0;
  color: var(--secondary); font-size: 12px; font-style: italic;
  font-weight: 600; cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.swap-request-inline:hover { color: var(--primary); }

/* Swap request button on class card (full class) */
.btn-swap-request {
  background: white;
  border-color: var(--secondary);
  color: var(--secondary);
  font-size: 14px; padding: 10px 20px;
}
.btn-swap-request:hover:not(:disabled) { background: var(--secondary); color: white; }


/* ===== ABOUT HINT ("?" button, bottom-left) ===== */
.about-hint {
  position: fixed; left: 14px; bottom: 14px; z-index: 50;
  width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--card-bg); color: var(--text-muted);
  font: 600 13px/1 inherit; cursor: pointer; opacity: 0.7;
}
.about-hint:hover, .about-hint:focus-visible { opacity: 1; color: var(--text); }
.about-hint-panel {
  position: fixed; left: 14px; bottom: 48px; z-index: 50;
  width: min(280px, calc(100vw - 28px)); padding: 12px 14px;
  background: var(--card-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); font-size: 13px;
}
.about-hint-panel[hidden] { display: none; }
.about-hint-panel p { margin: 6px 0 0; color: var(--text-muted); line-height: 1.45; }
