/* ============================================================
   JR FITNESS - Sistema de Diseño Principal
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ────────────────────────────────────────────── */
:root {
  /* Colores marca JR Fitness */
  --primary:        #5cb870;
  --primary-dark:   #4a9d5c;
  --primary-light:  #7ed491;
  --primary-bg:     #f0faf2;
  --primary-10:     rgba(92, 184, 112, .10);
  --primary-20:     rgba(92, 184, 112, .20);

  /* Neutros */
  --dark:           #111827;
  --dark-2:         #1f2937;
  --gray-700:       #374151;
  --gray-600:       #4b5563;
  --gray-500:       #6b7280;
  --gray-400:       #9ca3af;
  --gray-300:       #d1d5db;
  --gray-200:       #e5e7eb;
  --gray-100:       #f3f4f6;
  --gray-50:        #f9fafb;
  --white:          #ffffff;

  /* Semánticos */
  --danger:         #ef4444;
  --danger-bg:      #fef2f2;
  --warning:        #f59e0b;
  --warning-bg:     #fff7ed;
  --info:           #3b82f6;
  --info-bg:        #eff6ff;
  --success:        #10b981;
  --success-bg:     #ecfdf5;

  /* Layout */
  --sidebar-w:      260px;
  --topbar-h:       64px;
  --bottom-nav-h:   64px;
  --impersonation-bar-h: 0px;

  /* Radios */
  --r-sm:  6px;
  --r:     10px;
  --r-md:  14px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-full:9999px;

  /* Sombras */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-md:  0 10px 15px rgba(0,0,0,.10), 0 4px 6px rgba(0,0,0,.05);
  --shadow-lg:  0 20px 25px rgba(0,0,0,.10), 0 10px 10px rgba(0,0,0,.04);

  /* Transición */
  --ease: cubic-bezier(.4,0,.2,1);
  --dur:  180ms;
}

/* ── Modo oscuro (Dark Theme Tokens & Overrides) ───────────── */
body.dark-mode {
  --dark:           #f3f4f6;
  --dark-2:         #e5e7eb;
  --gray-700:       #e5e7eb;
  --gray-600:       #d1d5db;
  --gray-500:       #9ca3af;
  --gray-400:       #6b7280;
  --gray-300:       #374151;
  --gray-200:       #1f2937;
  --gray-100:       #151d2a;
  --gray-50:        #0b0f17;
  --white:          #111827;
  --primary-bg:     #064e3b;
  --primary-10:     rgba(16, 185, 129, .20);
  --primary-20:     rgba(16, 185, 129, .35);
  --shadow-xs:      0 1px 2px rgba(0,0,0,.4);
  --shadow-sm:      0 2px 4px rgba(0,0,0,.5);
  --shadow:         0 4px 12px rgba(0,0,0,.5);
  --shadow-md:      0 10px 20px rgba(0,0,0,.6);
  --shadow-lg:      0 20px 30px rgba(0,0,0,.7);
}

body.dark-mode {
  background: #0b0f17 !important;
  color: #f3f4f6 !important;
}

body.dark-mode .sidebar {
  background: #111827 !important;
  border-right-color: #1f2937 !important;
}

body.dark-mode .topbar {
  background: #111827 !important;
  border-bottom-color: #1f2937 !important;
  color: #ffffff !important;
}

body.dark-mode .bottom-nav {
  background: #111827 !important;
  border-top-color: #1f2937 !important;
}

body.dark-mode .card,
body.dark-mode .calendar-card,
body.dark-mode .admin-table-wrapper,
body.dark-mode .stat-card,
body.dark-mode .modal-box {
  background: #111827 !important;
  border-color: #1f2937 !important;
  color: #f3f4f6 !important;
}

body.dark-mode .card-header {
  border-bottom-color: #1f2937 !important;
}

body.dark-mode table th {
  background: #1f2937 !important;
  color: #f3f4f6 !important;
  border-bottom-color: #374151 !important;
}

body.dark-mode table td {
  border-bottom-color: #1f2937 !important;
  color: #e5e7eb !important;
}

body.dark-mode table tr:hover td {
  background: #151d2a !important;
}

body.dark-mode .form-input,
body.dark-mode select,
body.dark-mode textarea {
  background: #1f2937 !important;
  color: #ffffff !important;
  border-color: #374151 !important;
}

body.dark-mode .form-input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
}

body.dark-mode .slot-card {
  background: #151d2a !important;
  border-color: #1f2937 !important;
}

body.dark-mode .btn-secondary {
  background: #1f2937 !important;
  border-color: #374151 !important;
  color: #f3f4f6 !important;
}

body.dark-mode .btn-secondary:hover {
  background: #374151 !important;
}

/* ── Estado activo para chips y botones de modales (Alto Contraste) ─────── */
body.dark-mode .btn-secondary.active,
.btn-secondary.active {
  background: var(--primary) !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.45) !important;
}

body.dark-mode .qp-vpack-btn.active,
.qp-vpack-btn.active {
  background: #0891b2 !important;
  border-color: #06b6d4 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 14px rgba(8, 145, 178, 0.55) !important;
}

.qp-vpack-btn.active span,
body.dark-mode .qp-vpack-btn.active span {
  color: #ffffff !important;
}

.qp-vpack-btn.active span[id^="qp-vpack-price-"],
body.dark-mode .qp-vpack-btn.active span[id^="qp-vpack-price-"] {
  color: #e0f2fe !important;
  font-weight: 700 !important;
}

body.dark-mode #qp-method-chips button.active,
#qp-method-chips button.active {
  background: #059669 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.45) !important;
}

body.dark-mode .qp-vpack-btn:not(.active),
body.dark-mode #qp-method-chips button:not(.active) {
  background: #111827 !important;
  border-color: #374151 !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
}

body.dark-mode .qp-vpack-btn:not(.active) span[id^="qp-vpack-price-"] {
  color: #64748b !important;
}

/* ── Chips activos para el modal Registrar Cobro (modal-payment) ─────────────── */
#pf-method-chips button.active,
body.dark-mode #pf-method-chips button.active {
  background: #059669 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.45) !important;
}

#pf-plan-chips button.active,
body.dark-mode #pf-plan-chips button.active {
  background: #2563eb !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.45) !important;
}

#pf-voucher-chips button.active,
body.dark-mode #pf-voucher-chips button.active {
  background: #0891b2 !important;
  border-color: #06b6d4 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 12px rgba(8, 145, 178, 0.45) !important;
}

#pf-preset-chips button.active,
body.dark-mode #pf-preset-chips button.active {
  background: #7c3aed !important;
  border-color: #8b5cf6 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.45) !important;
}

/* ── Botones de Pestañas de Gamificación ──────────────────────────────────── */
.gamif-tab-btn {
  padding: 0.55rem 1.15rem;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.gamif-tab-btn:hover {
  color: var(--dark);
  background: var(--gray-200);
}

body.dark-mode .gamif-tab-btn:hover {
  background: #1e293b !important;
  color: #f8fafc !important;
}

.gamif-tab-btn.active {
  background: var(--primary) !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

/* ── Podio Visual de Tótems (Gamificación) ─────────────────────────────────── */
.gamif-totem-podium-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 0.65rem;
  align-items: end;
  margin-top: 0.5rem;
}

.gamif-totem-podium-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: 14px;
  padding: 0.9rem 0.5rem;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

body.dark-mode .gamif-totem-podium-card {
  background: #111827 !important;
}

.gamif-totem-podium-card:hover {
  transform: translateY(-3px);
}

.gamif-totem-podium-card.gold {
  transform: scale(1.04);
  padding: 1.15rem 0.6rem;
  z-index: 2;
}

.gamif-totem-rank-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.gamif-totem-podium-card.placeholder {
  visibility: hidden;
}

@media (max-width: 640px) {
  .gamif-totem-podium-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: stretch;
  }
  .gamif-totem-podium-card.gold {
    transform: none;
    order: -1;
  }
}

body.dark-mode #pf-plan-chips button:not(.active),
body.dark-mode #pf-voucher-chips button:not(.active),
body.dark-mode #pf-method-chips button:not(.active),
body.dark-mode #pf-preset-chips button:not(.active) {
  background: #111827 !important;
  border-color: #374151 !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
}

/* ── Overrides oscuros para Pantalla de Horarios y Admin ─────── */
body.dark-mode .ind-class-card {
  background: #111827 !important;
  color: #f3f4f6 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .ind-class-card [style*="background:var(--gray-50)"] {
  background: #1f2937 !important;
  border-bottom-color: #374151 !important;
}

body.dark-mode .ind-class-card .form-input,
body.dark-mode .ind-class-card .form-select,
body.dark-mode .ind-class-card input,
body.dark-mode .ind-class-card select {
  background: #1f2937 !important;
  color: #ffffff !important;
  border-color: #374151 !important;
}

body.dark-mode .sched-tabs {
  border-bottom-color: #1f2937 !important;
}

body.dark-mode .sched-tab {
  color: #9ca3af !important;
}

body.dark-mode .sched-tab:hover {
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.1) !important;
}

body.dark-mode .sched-tab.active {
  color: #34d399 !important;
  border-bottom-color: #10b981 !important;
}

body.dark-mode .sched-tab-status.closed {
  color: #6b7280 !important;
}

body.dark-mode [style*="background:var(--gray-50)"] {
  background: #111827 !important;
  border-color: #1f2937 !important;
  color: #f3f4f6 !important;
}

body.dark-mode [style*="background:#fff7ed"],
body.dark-mode [style*="background:#fff1f2"],
body.dark-mode [style*="background:#fef2f2"],
body.dark-mode [style*="background:#fef3c7"] {
  background: rgba(30, 41, 59, 0.7) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

body.dark-mode [style*="color:#9a3412"],
body.dark-mode [style*="color:#c2410c"],
body.dark-mode [style*="color:#991b1b"],
body.dark-mode [style*="color:#b91c1c"] {
  color: #f87171 !important;
}

body.dark-mode [style*="background:var(--primary-bg)"] {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

/* Botón Actuar como usuario y cajas de alerta armónicas */
.btn-impersonate {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.4rem 0.9rem;
  border-radius: var(--r);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: all var(--dur) var(--ease);
}
.btn-impersonate:hover {
  background: rgba(99, 102, 241, 0.22);
  color: #4f46e5;
}
body.dark-mode .btn-impersonate {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.4);
}
body.dark-mode .btn-impersonate:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
}

.alert-box-warning {
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: var(--r);
  padding: 1rem 1.25rem;
}
.alert-box-warning .alert-title { font-weight: 700; font-size: .875rem; color: #9a3412; margin-bottom: .2rem; }
.alert-box-warning .alert-desc  { font-size: .8rem; color: #c2410c; }

body.dark-mode .alert-box-warning {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}
body.dark-mode .alert-box-warning .alert-title { color: #fbbf24 !important; }
body.dark-mode .alert-box-warning .alert-desc  { color: #fef3c7 !important; }

.alert-box-danger {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: var(--r);
  padding: 1rem 1.25rem;
}
.alert-box-danger .alert-title { font-weight: 700; font-size: .875rem; color: #991b1b; margin-bottom: .2rem; }
.alert-box-danger .alert-desc  { font-size: .8rem; color: #b91c1c; }

body.dark-mode .alert-box-danger {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}
body.dark-mode .alert-box-danger .alert-title { color: #f87171 !important; }
body.dark-mode .alert-box-danger .alert-desc  { color: #fca5a5 !important; }
body.dark-mode .alert-box-danger .alert-desc strong { color: #ffffff !important; }

body.dark-mode [style*="background:var(--primary-bg)"] strong {
  color: #60a5fa !important;
}

body.dark-mode .tbl-btn {
  background: #1f2937 !important;
  border-color: #374151 !important;
  color: #f3f4f6 !important;
}

body.dark-mode .tbl-btn:hover:not(:disabled) {
  background: #374151 !important;
}

body.dark-mode .tbl-page-num {
  color: #9ca3af !important;
}

body.dark-mode option {
  background: #111827 !important;
  color: #ffffff !important;
}

/* ── Strip Semanal Calendario (.week-day) Modo oscuro ─────── */
body.dark-mode .week-day {
  background: #111827 !important;
  border-color: #1f2937 !important;
  color: #f3f4f6 !important;
}

body.dark-mode .week-day:hover {
  background: #1f2937 !important;
  border-color: #374151 !important;
}

body.dark-mode .week-day.selected {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45) !important;
}

body.dark-mode .week-day.today:not(.selected) {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: #10b981 !important;
  color: #34d399 !important;
}

body.dark-mode .week-day.closed-day:not(.selected) {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  opacity: 0.65;
}

body.dark-mode .week-day.closed-day:not(.selected) .week-day-name,
body.dark-mode .week-day.closed-day:not(.selected) .week-day-num {
  color: #9ca3af !important;
}

body.dark-mode .closed-dot {
  color: #ef4444 !important;
}

body.dark-mode .btn-theme-toggle {
  background: #1f2937;
  border: 1px solid #374151;
  color: #f3f4f6;
  padding: 0.55rem 0.9rem;
  border-radius: var(--r);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

body.dark-mode .btn-theme-toggle:hover {
  background: #374151;
}

.btn-theme-toggle {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--dark);
  padding: 0.4rem 0.75rem;
  border-radius: var(--r);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 0.35rem;
  transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
  background: var(--gray-200);
}

.topbar-theme-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 8px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  /* Prevenir scroll horizontal global */
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Prevenir scroll horizontal global */
  overflow-x: hidden;
  max-width: 100vw;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* ── Scrollbar personalizada ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE (Ultra-High Contrast & Modern Design)
   ═══════════════════════════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 20%, #152238 0%, #0b0f17 100%);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 600px 400px at 70% 30%, rgba(16, 185, 129, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 400px 300px at 20% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  background: #111827;
  border-radius: var(--r-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.12);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.login-card__header {
  background: #1f2937;
  padding: 2rem 1.75rem 1.5rem;
  text-align: center;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.login-card__header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 3px;
  background: #10b981;
  border-radius: 3px 3px 0 0;
}

.login-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 14px;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.login-logo {
  height: 52px;
  width: auto;
  display: block;
}

.login-title {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.login-title span {
  color: #10b981;
}

.login-subtitle {
  color: #9ca3af;
  font-size: .85rem;
  margin-top: .25rem;
  font-weight: 500;
}

.login-card__body {
  padding: 1.75rem 1.75rem 2rem;
  background: #111827;
}

/* Tabs login/register */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #1f2937;
  border-radius: var(--r);
  padding: 4px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab {
  padding: .6rem 1rem;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-500);
  transition: all var(--dur) var(--ease);
  text-align: center;
}

.auth-tab.active {
  background: var(--white);
  color: var(--dark);
  box-shadow: var(--shadow-xs);
}

/* Form */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-input {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r);
  font-size: .95rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  outline: none;
  appearance: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-10);
}

.form-input::placeholder { color: var(--gray-400); }

.form-input-icon {
  position: relative;
}

.form-input-icon .form-input {
  padding-left: 2.75rem;
}

.form-input-icon .icon {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
  font-size: 1rem;
}

/* Scoped High-Contrast Login Card Form Controls */
.login-card .form-label {
  color: #f3f4f6 !important;
  font-weight: 700 !important;
}

.login-card .form-input {
  background: #1f2937 !important;
  color: #ffffff !important;
  border: 1.5px solid #374151 !important;
  font-size: 0.95rem !important;
}

.login-card .form-input:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
}

.login-card .form-input::placeholder {
  color: #9ca3af !important;
}

.login-card .form-input-icon .icon {
  color: #10b981 !important;
}

.login-card .btn-primary {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  padding: 0.85rem !important;
  border-radius: var(--r) !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
  cursor: pointer;
  width: 100%;
}

.login-card .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.55) !important;
}

/* Photo upload */
.photo-upload-area {
  border: 2px dashed var(--gray-200);
  border-radius: var(--r-md);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  position: relative;
}

.photo-upload-area:hover { border-color: var(--primary); background: var(--primary-bg); }
.photo-upload-area input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-upload-area .upload-icon { font-size: 2rem; margin-bottom: .5rem; }
.photo-upload-area p { font-size: .85rem; color: var(--gray-500); }
.photo-upload-area strong { color: var(--primary); }

.photo-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin: .5rem auto 0;
  display: none;
  border: 3px solid var(--primary);
}

/* Botón primario */
.btn-primary {
  width: 100%;
  padding: .85rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  box-shadow: 0 4px 14px rgba(92,184,112,.4);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--dur) var(--ease);
}

.btn-primary:hover::after { background: rgba(255,255,255,.08); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* Alert error login */
.login-error {
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  border-radius: var(--r);
  padding: .75rem 1rem;
  font-size: .875rem;
  color: #991b1b;
  margin-bottom: 1rem;
  display: none;
}

/* ═══════════════════════════════════════════════════════════
   MAIN APP LAYOUT
   ═══════════════════════════════════════════════════════════ */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  height: calc(100vh - var(--impersonation-bar-h));
  position: fixed;
  left: 0;
  top: var(--impersonation-bar-h);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), top var(--dur) var(--ease), height var(--dur) var(--ease);
  overflow-y: auto;
}

.sidebar-logo {
  padding: .75rem 1rem .6rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.sidebar-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff !important;
  padding: 0.35rem 0.6rem;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.sidebar-logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1;
}

.sidebar-logo-text span { color: var(--primary); }

/* Perfil en sidebar */
.sidebar-profile {
  padding: .6rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.sidebar-profile:hover { background: var(--gray-50); }

.sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: visible;
  position: relative;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name  { font-size: .875rem; font-weight: 600; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: .75rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Navegación */
.sidebar-nav {
  flex: 1;
  padding: .35rem .75rem;
}

.nav-section-label {
  font-size: .675rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-400);
  padding: .45rem .5rem .2rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .42rem .75rem;
  border-radius: var(--r);
  font-size: .85rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  margin-bottom: 1px;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--dark);
}

.nav-item.active {
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-weight: 600;
}

.nav-item .nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: var(--white);
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: var(--r-full);
  min-width: 20px;
  text-align: center;
}

/* Botón logout en sidebar */
.sidebar-footer {
  padding: .6rem 1rem;
  border-top: 1px solid var(--gray-100);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .4rem .75rem;
  border-radius: var(--r);
  font-size: .8rem;
  font-weight: 500;
  color: var(--gray-500);
  transition: all var(--dur) var(--ease);
}

.btn-logout:hover { background: var(--danger-bg); color: var(--danger); }

/* Badge de estado suscripción */
.subscription-badge {
  padding: .6rem 1rem;
  margin: .5rem 1rem;
  border-radius: var(--r);
  font-size: .8rem;
  font-weight: 500;
}
.subscription-badge.paid    { background: var(--success-bg); color: #065f46; }
.subscription-badge.unpaid  { background: var(--warning-bg); color: #92400e; }
.subscription-badge.expired { background: var(--danger-bg);  color: #991b1b; }
.subscription-badge.pending { background: var(--info-bg);    color: #1e40af; }

/* ── Topbar mobile ────────────────────────────────────────── */
.topbar {
  display: none;
  position: fixed;
  top: var(--impersonation-bar-h);
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  align-items: center;
  padding: 0 1rem;
  gap: 1rem;
  z-index: 300;
  transition: top var(--dur) var(--ease);
}

.topbar-menu-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--dark);
  flex-shrink: 0;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  flex: 1;
}

.topbar-logo img {
  height: 32px;
  width: auto;
}

/* ── Main content ─────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding-top: var(--impersonation-bar-h);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Evitar overflow horizontal que cause scroll lateral */
  overflow-x: hidden;
  min-width: 0;
  transition: padding-top var(--dur) var(--ease);
}

.main-inner {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
  /* Prevenir que contenido interno cause overflow */
  box-sizing: border-box;
  overflow-x: hidden;
  min-width: 0;
}

/* ── Overlay mobile sidebar ───────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--impersonation-bar-h);
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,.5);
  z-index: 190;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease, top var(--dur) var(--ease);
}
.sidebar-overlay.active {
  pointer-events: auto;
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════
   CALENDARIO / WEEK SELECTOR
   ═══════════════════════════════════════════════════════════ */

.calendar-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.calendar-date-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
}

.week-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--gray-600);
  background: var(--white);
  flex-shrink: 0;
  transition: all var(--dur) var(--ease);
}

.week-nav-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }

/* Week strip */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .5rem;
  margin-bottom: 1.75rem;
  background: var(--white);
  border-radius: var(--r-md);
  padding: .75rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--gray-200);
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .5rem .2rem .4rem;
  border-radius: var(--r);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  position: relative;
  border: 1.5px solid transparent;
  background: var(--white);
  min-height: 64px;
  justify-content: space-between;
}

.week-day:hover {
  background: var(--gray-50);
  border-color: var(--gray-200);
}

/* 1. Día Seleccionado (Primary Green) */
.week-day.selected {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--white) !important;
  box-shadow: 0 4px 12px rgba(92, 184, 112, 0.35);
}

/* 2. Día Actual / Hoy (cuando NO está seleccionado) */
.week-day.today:not(.selected) {
  border-color: var(--primary);
  background: var(--primary-bg);
}

/* 3. Día Cerrado / Inactivo (cuando NO está seleccionado) */
.week-day.closed-day:not(.selected) {
  background: var(--gray-100);
  border-color: var(--gray-200);
  opacity: 0.85;
}

.week-day-name {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gray-500);
  letter-spacing: .04em;
}

.week-day.selected .week-day-name { color: rgba(255,255,255,.8); }

.week-day-num {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
}

.week-day.selected .week-day-num { color: var(--white); }

/* ═══════════════════════════════════════════════════════════
   TARJETAS DE CLASE
   ═══════════════════════════════════════════════════════════ */

.classes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.class-card {
  background: var(--white);
  border-radius: var(--r-md);
  border: 1.5px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.class-card:hover { box-shadow: var(--shadow); border-color: var(--gray-300); }

.class-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem .75rem;
  border-bottom: 1px solid var(--gray-100);
}

.class-card__title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.class-card__meta {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.class-time-badge {
  font-size: .9rem;
  font-weight: 700;
  color: var(--dark-2);
}

.class-instructor {
  font-size: .8rem;
  color: var(--gray-500);
  margin-top: .1rem;
}

.class-card__body {
  padding: .75rem 1.25rem;
}

/* Grid de avatares */
.attendees-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
  min-height: 44px;
  align-items: flex-start;
}

.attendee-slot {
  width: 44px;
  flex-shrink: 0;
}

.attendee-slot.clickable-avatar {
  cursor: pointer !important;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.attendee-slot.clickable-avatar:hover {
  transform: scale(1.15);
  filter: brightness(1.15);
  z-index: 10;
}

.attendee-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--white);
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
  position: relative;
}

.attendee-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attendee-avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--white);
}

.attendee-slot-empty {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gray-100);
  border: 2px dashed var(--gray-300);
}

/* Tooltip on avatar */
.attendee-avatar[title] { cursor: default; }

.class-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  gap: 1rem;
}

.capacity-info {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--gray-500);
}

.capacity-icon { color: var(--gray-400); }

.capacity-bar {
  width: 80px;
  height: 6px;
  background: var(--gray-200);
  border-radius: 99px;
  overflow: hidden;
}

.capacity-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width .3s var(--ease);
}

.capacity-fill.full { background: var(--danger); }
.capacity-fill.almost { background: var(--warning); }

/* Botones de clase */
.btn-book {
  padding: .55rem 1.25rem;
  border-radius: var(--r);
  font-size: .875rem;
  font-weight: 600;
  transition: all var(--dur) var(--ease);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.btn-book.book {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(92,184,112,.35);
}

.btn-book.book:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(92,184,112,.45); }

.btn-book.cancel {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.btn-book.cancel:hover { background: #fecaca; }

.btn-book.full {
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
}

.btn-book.past {
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
  font-style: italic;
}

.btn-book.booked-by-me {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid #bbf7d0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--gray-400);
}

.empty-state-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; color: var(--gray-500); font-weight: 600; margin-bottom: .5rem; }
.empty-state p  { font-size: .9rem; }

/* ═══════════════════════════════════════════════════════════
   MIS RESERVAS
   ═══════════════════════════════════════════════════════════ */

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.booking-card {
  background: var(--white);
  border-radius: var(--r);
  border: 1.5px solid var(--gray-200);
  padding: .65rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow var(--dur) var(--ease);
  margin-bottom: .4rem;
}

.booking-card:hover { box-shadow: var(--shadow-sm); }

.booking-card.past { opacity: .65; }

.booking-class-color {
  width: 4px;
  height: 38px;
  border-radius: 99px;
  flex-shrink: 0;
}

.booking-info { flex: 1; min-width: 0; }

.booking-name { font-size: .9rem; font-weight: 700; color: var(--dark); }
.booking-meta { font-size: .775rem; color: var(--gray-500); margin-top: .15rem; display: flex; gap: .65rem; flex-wrap: wrap; }
.booking-meta span { display: flex; align-items: center; gap: .2rem; }

/* Filas super compactas para el historial de reservas */
.past-booking-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .35rem .75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--r);
  font-size: .8rem;
}

.past-booking-color {
  width: 3px;
  height: 16px;
  border-radius: 99px;
  flex-shrink: 0;
}

.past-booking-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  min-width: 0;
}

.past-booking-date { font-weight: 600; color: var(--dark); }
.past-booking-time { color: var(--gray-600); }
.past-booking-name { font-weight: 700; color: var(--dark); }
.past-booking-instructor { color: var(--gray-500); font-size: .75rem; }

/* Tabla densa y compacta para historial masivo */
.compact-history-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r);
  overflow: hidden;
  font-size: .8rem;
}

.compact-history-table th {
  background: var(--gray-100);
  padding: .4rem .75rem;
  font-size: .725rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-500);
  letter-spacing: .04em;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.compact-history-table td {
  padding: .35rem .75rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--dark);
}

.compact-history-table tr:last-child td {
  border-bottom: none;
}

.compact-history-table tr:hover td {
  background: var(--gray-50);
}

/* Pestañas para modal de ficha de usuario y perfil */
.user-modal-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.25rem;
  gap: .25rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.user-modal-tabs::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.modal-tab-btn {
  padding: .55rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  margin-bottom: -2px;
}

.modal-tab-btn:hover {
  color: var(--dark);
}

.modal-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.modal-tab-btn.modal-tab-danger {
  color: #b45309;
}
.modal-tab-btn.modal-tab-danger:hover {
  color: #92400e;
  background: #fff7ed;
}
.modal-tab-btn.modal-tab-danger.active {
  color: #dc2626;
  border-bottom-color: #dc2626;
}

.btn-cancel-booking {
  padding: .45rem .9rem;
  border-radius: var(--r);
  font-size: .8rem;
  font-weight: 600;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
  transition: all var(--dur) var(--ease);
  flex-shrink: 0;
}

.btn-cancel-booking:hover { background: #fecaca; }

/* ═══════════════════════════════════════════════════════════
   PERFIL
   ═══════════════════════════════════════════════════════════ */

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-200);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-xs);
}

.profile-avatar-big {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
  overflow: visible;
  position: relative;
}

.profile-avatar-big img { width: 100%; height: 100%; object-fit: cover; }

.profile-info { flex: 1; }
.profile-name { font-size: 1.3rem; font-weight: 700; color: var(--dark); }
.profile-email { font-size: .875rem; color: var(--gray-500); margin-top: .15rem; }

/* Plan card — unificado con el estilo general de la web */
.plan-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-left: 4px solid var(--primary);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-width: 0;
  transition: box-shadow var(--dur) var(--ease);
}
.plan-card:hover { box-shadow: var(--shadow); }

.plan-card.expired {
  border-left-color: var(--danger);
  background: #fff8f8;
  border-color: #fecaca;
}

body.dark-mode .plan-card {
  background: var(--card-bg, #1e293b);
  border-color: rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary);
}

body.dark-mode .plan-card.expired {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  border-left-color: #ef4444;
}

body.dark-mode .plan-card.expired .plan-details h3 {
  color: #f87171 !important;
}

body.dark-mode .plan-card.expired .plan-details p {
  color: #fca5a5 !important;
}

body.dark-mode .plan-card.expired .plan-details p strong {
  color: #ffffff !important;
}

/* ── Mascot Theme Classes ─────────────────────────────────────────── */
.mascot-theme-1 {
  --mascot-accent: #d97706;
  --mascot-accent-dark: #b45309;
  --mascot-light-bg: linear-gradient(135deg, #fffdfa 0%, #fef3c7 45%, #ffffff 100%);
  --mascot-light-border: #fde68a;
  --mascot-dark-bg: linear-gradient(135deg, #1e293b 0%, #78350f 50%, #451a03 100%);
  --mascot-dark-border: rgba(245, 158, 11, 0.45);
  --mascot-badge-bg-light: #fef3c7;
  --mascot-badge-color-light: #b45309;
  --mascot-glow: rgba(245, 158, 11, 0.25);
}

.mascot-theme-2 {
  --mascot-accent: #059669;
  --mascot-accent-dark: #047857;
  --mascot-light-bg: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 45%, #ffffff 100%);
  --mascot-light-border: #a7f3d0;
  --mascot-dark-bg: linear-gradient(135deg, #0f172a 0%, #064e3b 50%, #022c22 100%);
  --mascot-dark-border: rgba(16, 185, 129, 0.45);
  --mascot-badge-bg-light: #dcfce7;
  --mascot-badge-color-light: #047857;
  --mascot-glow: rgba(16, 185, 129, 0.25);
}

.mascot-theme-3 {
  --mascot-accent: #2563eb;
  --mascot-accent-dark: #1d4ed8;
  --mascot-light-bg: linear-gradient(135deg, #f0f7ff 0%, #e0e7ff 45%, #ffffff 100%);
  --mascot-light-border: #c7d2fe;
  --mascot-dark-bg: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #172554 100%);
  --mascot-dark-border: rgba(59, 130, 246, 0.45);
  --mascot-badge-bg-light: #e0e7ff;
  --mascot-badge-color-light: #1d4ed8;
  --mascot-glow: rgba(59, 130, 246, 0.25);
}

.mascot-theme-4 {
  --mascot-accent: #ea580c;
  --mascot-accent-dark: #c2410c;
  --mascot-light-bg: linear-gradient(135deg, #fffaf5 0%, #ffedd5 45%, #ffffff 100%);
  --mascot-light-border: #fed7aa;
  --mascot-dark-bg: linear-gradient(135deg, #0f172a 0%, #7c2d12 50%, #431407 100%);
  --mascot-dark-border: rgba(249, 115, 22, 0.45);
  --mascot-badge-bg-light: #ffedd5;
  --mascot-badge-color-light: #c2410c;
  --mascot-glow: rgba(249, 115, 22, 0.25);
}

.mascot-theme-5 {
  --mascot-accent: #ca8a04;
  --mascot-accent-dark: #a16207;
  --mascot-light-bg: linear-gradient(135deg, #fefef2 0%, #fef9c3 45%, #ffffff 100%);
  --mascot-light-border: #fef08a;
  --mascot-dark-bg: linear-gradient(135deg, #0f172a 0%, #713f12 50%, #422006 100%);
  --mascot-dark-border: rgba(234, 179, 8, 0.45);
  --mascot-badge-bg-light: #fef9c3;
  --mascot-badge-color-light: #a16207;
  --mascot-glow: rgba(234, 179, 8, 0.25);
}

/* ── Banner Unificado de Perfil con Mascota ────────────────────────── */
.unified-profile-hero,
.mascot-plan-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--r-lg);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: var(--mascot-light-bg, var(--white));
  border: 1.5px solid var(--mascot-light-border, var(--gray-200));
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  color: var(--dark);
}

.unified-profile-hero:hover,
.mascot-plan-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.uph-user-section {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  min-width: 250px;
  flex-shrink: 0;
}

.uph-user-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.uph-user-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark, #0f172a);
  letter-spacing: -0.01em;
}

.uph-user-email {
  font-size: 0.85rem;
  color: var(--gray-500, #64748b);
}

.uph-user-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.3rem;
  flex-wrap: wrap;
}

.uph-meta-item {
  font-size: 0.78rem;
  color: var(--gray-600, #475569);
}

.uph-divider {
  width: 1px;
  align-self: stretch;
  background: var(--mascot-light-border, var(--gray-200));
  margin: 0 0.25rem;
  flex-shrink: 0;
}

.uph-mascot-section {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  min-width: 0;
}

.uph-mascot-avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.uph-mascot-details {
  flex: 1;
  min-width: 0;
}

.mascot-avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.mascot-svg-wrapper {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--mascot-light-border, var(--gray-200));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.unified-profile-hero:hover .mascot-svg-wrapper,
.mascot-plan-banner:hover .mascot-svg-wrapper {
  transform: scale(1.05) rotate(-2deg);
}

.mascot-svg-wrapper svg {
  width: 100%;
  height: 100%;
  display: block;
}

.mascot-badge-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--mascot-badge-bg-light, var(--gray-100));
  color: var(--mascot-badge-color-light, var(--gray-700));
}

.mascot-plan-info {
  flex: 1;
  min-width: 0;
}

.mascot-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.mascot-totem-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mascot-accent-dark, var(--primary));
}

.mascot-status-tag {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: 8px;
}

.mascot-status-tag.active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.mascot-status-tag.expired {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.mascot-plan-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--dark, #0f172a);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.mascot-plan-title span {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--mascot-accent-dark, var(--primary));
  opacity: 1;
  margin-left: 0.35rem;
}

.mascot-plan-slogan {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--gray-600, #475569);
  margin: 0.3rem 0 0.65rem 0;
  line-height: 1.35;
}

.mascot-pills-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.mascot-pill {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--dark, #0f172a);
  background: #ffffff;
  border: 1px solid var(--mascot-light-border, var(--gray-200));
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.mascot-pill strong {
  color: var(--dark, #0f172a);
  font-weight: 800;
}

/* ── MODO OSCURO (Intenso, VIP, luminoso) ─────────────────────────────────── */
body.dark-mode .unified-profile-hero,
body.dark-mode .mascot-plan-banner {
  background: var(--mascot-dark-bg, var(--card-bg));
  border: 1.5px solid var(--mascot-dark-border, rgba(255, 255, 255, 0.15));
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  color: #ffffff;
}

body.dark-mode .unified-profile-hero:hover,
body.dark-mode .mascot-plan-banner:hover {
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.45);
}

body.dark-mode .uph-user-name {
  color: #ffffff;
}

body.dark-mode .uph-user-email {
  color: rgba(255, 255, 255, 0.75);
}

body.dark-mode .uph-meta-item {
  color: rgba(255, 255, 255, 0.85);
}

body.dark-mode .uph-divider {
  background: rgba(255, 255, 255, 0.18);
}

body.dark-mode .mascot-svg-wrapper {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  box-shadow: 0 8px 22px var(--mascot-glow);
}

body.dark-mode .mascot-badge-tag {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

body.dark-mode .mascot-totem-tag {
  color: rgba(255, 255, 255, 0.8);
}

body.dark-mode .mascot-status-tag.active {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.4);
}

body.dark-mode .mascot-status-tag.expired {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

body.dark-mode .mascot-plan-title {
  color: #ffffff;
}

body.dark-mode .mascot-plan-title span {
  color: #ffffff;
  opacity: 0.85;
}

body.dark-mode .mascot-plan-slogan {
  color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .mascot-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

body.dark-mode .mascot-pill strong {
  color: #ffffff;
}

@media (max-width: 1024px) {
  .unified-profile-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    padding: 1.25rem;
  }
  .uph-divider {
    width: 100%;
    height: 1px;
    margin: 0;
  }
  .uph-user-section {
    min-width: 0;
  }
}

@media (max-width: 600px) {
  .uph-mascot-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }
  .uph-mascot-avatar-col {
    flex-direction: row;
    gap: 0.75rem;
  }
  .uph-mascot-avatar-col .mascot-svg-wrapper {
    width: 72px;
    height: 72px;
  }
  .mascot-plan-title {
    font-size: 1.2rem;
  }
}

/* Banner de alerta por cuota caducada */
.alert-expired-banner {
  background: #fff1f2;
  border: 1.5px solid #fecaca;
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .85rem;
}

.alert-expired-banner .alert-title {
  font-weight: 700;
  color: #991b1b;
  font-size: .925rem;
}

.alert-expired-banner .alert-text {
  color: #b91c1c;
  font-size: .825rem;
  margin-top: .15rem;
}

body.dark-mode .alert-expired-banner {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

body.dark-mode .alert-expired-banner .alert-title {
  color: #f87171;
}

body.dark-mode .alert-expired-banner .alert-text {
  color: #fca5a5;
}

body.dark-mode .alert-expired-banner .alert-text strong {
  color: #ffffff;
}

.plan-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  background: var(--primary-bg);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.plan-card.expired .plan-icon { background: var(--danger-bg); }

.plan-details { flex: 1; min-width: 0; }
.plan-details h3 { font-size: 1.05rem; font-weight: 700; color: var(--dark); margin-bottom: .2rem; }
.plan-details p { font-size: .83rem; color: var(--gray-500); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; }
.plan-details p strong { color: var(--gray-700); font-weight: 600; }

.plan-details .plan-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--primary-bg);
  color: var(--primary-dark);
  border: 1px solid var(--primary-light);
  padding: .2rem .75rem;
  border-radius: var(--r-full);
  font-size: .78rem;
  font-weight: 700;
  margin-top: .5rem;
}
.plan-card.expired .plan-pill {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #fecaca;
}

/* ═══════════════════════════════════════════════════════════
   PANEL ADMIN
   ═══════════════════════════════════════════════════════════ */

.admin-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.75rem;
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab-btn {
  padding: .65rem 1.1rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.admin-tab-btn:hover { color: var(--dark); }
.admin-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* User row admin */
.user-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  border-radius: var(--r);
  transition: background var(--dur) var(--ease);
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
}

.user-row:hover { background: var(--gray-50); }

.user-row-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
  overflow: hidden;
}

.user-row-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-row-info { flex: 1; min-width: 0; }
.user-row-name { font-size: .9rem; font-weight: 600; color: var(--dark); }
.user-row-meta { font-size: .775rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: .25rem .7rem;
  border-radius: var(--r-full);
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.status-pill.pending  { background: var(--info-bg);    color: #1e40af; }
.status-pill.approved { background: var(--success-bg); color: #065f46; }
.status-pill.rejected { background: var(--danger-bg);  color: #991b1b; }
.status-pill.paid     { background: var(--success-bg); color: #065f46; }
.status-pill.unpaid   { background: var(--warning-bg); color: #92400e; }
.status-pill.expired  { background: var(--danger-bg);  color: #991b1b; }

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  padding: 1.25rem;
  text-align: center;
}

.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: var(--dark); line-height: 1; }
.stat-card .stat-label { font-size: .8rem; color: var(--gray-500); margin-top: .35rem; }
.stat-card .stat-icon  { font-size: 1.5rem; margin-bottom: .5rem; }

/* ═══════════════════════════════════════════════════════════
   MODALES
   ═══════════════════════════════════════════════════════════ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  place-items: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal-backdrop.open { display: grid; animation: fadeIn .15s var(--ease); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 580px;
  max-height: calc(92vh - 2rem);
  display: flex;
  flex-direction: column;
  animation: slideUp .2s var(--ease);
  overflow: hidden;
}

.modal-box.modal-lg { max-width: 900px; }
.modal-box.modal-xl { max-width: 1100px; }

@media (min-width: 1024px) {
  .modal-backdrop {
    padding: 2.25rem 2rem;
  }
  .modal-box {
    max-width: 640px;
  }
  .modal-box.modal-lg {
    max-width: 960px;
  }
  .modal-box.modal-xl {
    max-width: 1180px;
  }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.modal-title { font-size: 1.1rem; font-weight: 800; color: var(--dark); }

.modal-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--gray-500);
  transition: all var(--dur) var(--ease);
  cursor: pointer;
}

.modal-close:hover { background: var(--gray-100); color: var(--dark); }

.modal-body {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  max-height: calc(88vh - 120px);
  -webkit-overflow-scrolling: touch;
}
.modal-footer {
  padding: 1.1rem 1.75rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   TOASTS / NOTIFICACIONES
   ═══════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 1rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  gap: .5rem;
  z-index: 1000;
  width: calc(100% - 2rem);
  max-width: 400px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .875rem 1.1rem;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  font-size: .875rem;
  font-weight: 500;
  pointer-events: auto;
  animation: toastIn .25s var(--ease);
  cursor: pointer;
}

@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.toast.out {
  animation: toastOut .25s var(--ease) forwards;
}

@keyframes toastOut {
  to { transform: translateY(20px); opacity: 0; }
}

.toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }
.toast-msg  { flex: 1; line-height: 1.4; }

.toast.success { background: var(--dark); color: var(--white); }
.toast.error   { background: var(--danger); color: var(--white); }
.toast.warning { background: var(--warning); color: var(--white); }
.toast.info    { background: var(--info); color: var(--white); }

/* ═══════════════════════════════════════════════════════════
   MISC UTILITIES
   ═══════════════════════════════════════════════════════════ */

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
}

.card-title { font-size: .95rem; font-weight: 700; color: var(--dark); }

.card-body { padding: 1.25rem; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: var(--r-full);
  font-size: .75rem;
  font-weight: 700;
}

.badge-green  { background: var(--success-bg); color: #047857; border: 1px solid #a7f3d0; }
.badge-red    { background: var(--danger-bg);  color: #b91c1c; border: 1px solid #fecaca; }
.badge-gray   { background: var(--gray-100);   color: var(--gray-600); border: 1px solid var(--gray-200); }
.badge-yellow { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-blue   { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

body.dark-mode .badge-green  { background: rgba(16, 185, 129, 0.20) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.35) !important; }
body.dark-mode .badge-red    { background: rgba(239, 68, 68, 0.20) !important; color: #fca5a5 !important; border-color: rgba(239, 68, 68, 0.35) !important; }
body.dark-mode .badge-gray   { background: rgba(255, 255, 255, 0.08) !important; color: #9ca3af !important; border-color: rgba(255, 255, 255, 0.12) !important; }
body.dark-mode .badge-yellow { background: rgba(245, 158, 11, 0.18) !important; color: #fbbf24 !important; border-color: rgba(245, 158, 11, 0.35) !important; }
body.dark-mode .badge-blue   { background: rgba(59, 130, 246, 0.18) !important; color: #93c5fd !important; border-color: rgba(59, 130, 246, 0.35) !important; }

/* Badges distintivos de método de pago */
.badge-cash  { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; font-weight: 700; }
.badge-card  { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; font-weight: 700; }
.badge-bizum { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; font-weight: 700; }

body.dark-mode .badge-cash  { background: rgba(245, 158, 11, 0.18) !important; color: #fbbf24 !important; border-color: rgba(245, 158, 11, 0.35) !important; }
body.dark-mode .badge-card  { background: rgba(99, 102, 241, 0.18) !important; color: #a5b4fc !important; border-color: rgba(99, 102, 241, 0.35) !important; }
body.dark-mode .badge-bizum { background: rgba(16, 185, 129, 0.18) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.35) !important; }

/* ── Gamificación Component Styles (Light & Dark) ───────────────────── */
.gamif-hero-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 60%, #f0fdf4 100%);
  border: 1px solid #a7f3d0;
  border-radius: var(--r-md);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.08);
}

.gamif-hero-bg-icon {
  position: absolute;
  right: -20px;
  top: -20px;
  font-size: 8rem;
  opacity: 0.12;
  pointer-events: none;
}

.gamif-hero-tag {
  font-size: .8rem;
  font-weight: 800;
  color: #059669;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .3rem;
}

.gamif-hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 .3rem;
  color: #064e3b;
}

.gamif-hero-desc {
  font-size: .875rem;
  color: #047857;
  margin: 0;
  max-width: 600px;
}

.gamif-hero-streak-box {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #ffffff;
  padding: .6rem 1rem;
  border-radius: 12px;
  border: 1px solid #6ee7b7;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

.gamif-hero-streak-label {
  font-size: .725rem;
  color: #047857;
  font-weight: 700;
  text-transform: uppercase;
}

.gamif-hero-streak-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #d97706;
}

/* Dark Mode Overrides for Gamif Hero */
body.dark-mode .gamif-hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: var(--shadow) !important;
}

body.dark-mode .gamif-hero-bg-icon {
  opacity: 0.06 !important;
}

body.dark-mode .gamif-hero-tag {
  color: var(--primary) !important;
}

body.dark-mode .gamif-hero-title {
  color: #ffffff !important;
}

body.dark-mode .gamif-hero-desc {
  color: #94a3b8 !important;
}

body.dark-mode .gamif-hero-streak-box {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
}

body.dark-mode .gamif-hero-streak-label {
  color: #94a3b8 !important;
}

body.dark-mode .gamif-hero-streak-val {
  color: #f59e0b !important;
}

.gamif-subcard {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  transition: background var(--dur) var(--ease);
}
.gamif-subcard:hover {
  background: var(--white);
}
body.dark-mode .gamif-subcard {
  background: #151d2a !important;
  border-color: #1f2937 !important;
}
body.dark-mode .gamif-subcard:hover {
  background: #1a2436 !important;
}

.gamif-podium-card {
  background: var(--gray-100);
  border-radius: 14px;
  padding: 1rem 0.6rem;
  text-align: center;
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  align-items: center;
}
body.dark-mode .gamif-podium-card {
  background: #151d2a !important;
  border-color: #1f2937 !important;
}

.gamif-podium-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(251, 191, 36, 0.04) 100%);
  border-radius: 14px;
  padding: 1.1rem 0.6rem;
  text-align: center;
  border: 2px solid #f59e0b;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-6px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.15);
}
body.dark-mode .gamif-podium-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(251, 191, 36, 0.08) 100%) !important;
  border-color: #fbbf24 !important;
}

.gamif-podium-grid {
  display: grid;
  grid-template-columns: 1fr 1.08fr 1fr;
  gap: .6rem;
  margin-bottom: 1.25rem;
  align-items: flex-end;
}

.gamif-podium-rank { font-size: 1.4rem; margin-bottom: .2rem; }
.gamif-podium-avatar {
  border-radius: 50%;
  position: relative;
  margin-bottom: .4rem;
  border: 2px solid #94a3b8;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gamif-podium-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
}
.gamif-podium-name {
  font-weight: 700;
  font-size: .825rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--dark);
}
.gamif-podium-count {
  font-size: .75rem;
  color: var(--primary);
  font-weight: 800;
}

.gamif-filter-btn {
  padding: .25rem .6rem;
  font-size: .75rem;
  font-weight: 700;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.gamif-filter-btn:hover {
  color: var(--dark);
}

.gamif-filter-btn.active {
  background: var(--white);
  color: var(--primary-dark);
  box-shadow: var(--shadow-xs);
}

body.dark-mode .gamif-filter-btn.active {
  background: #111827 !important;
  color: var(--primary) !important;
}

.gamif-badges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.gamif-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--gray-100);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
}
body.dark-mode .gamif-list-row {
  background: #151d2a !important;
  border-color: #1f2937 !important;
}

/* Spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Loading screen */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 1.25rem;
}

.loading-screen .logo-load { font-size: 3rem; animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .6; } to { opacity: 1; } }

.loading-screen p { color: rgba(255,255,255,.6); font-size: .9rem; }

/* Divider */
.divider { height: 1px; background: var(--gray-200); margin: 1.5rem 0; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* Btn secundario */
.btn-secondary {
  padding: .65rem 1.25rem;
  border-radius: var(--r);
  font-size: .875rem;
  font-weight: 600;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-600);
  background: var(--white);
  transition: all var(--dur) var(--ease);
}

.btn-secondary:hover { background: var(--gray-100); border-color: var(--gray-300); }

/* Btn danger */
.btn-danger {
  padding: .65rem 1.25rem;
  border-radius: var(--r);
  font-size: .875rem;
  font-weight: 600;
  background: var(--danger);
  color: var(--white);
  transition: all var(--dur) var(--ease);
}

.btn-danger:hover { filter: brightness(1.1); }

/* Select / Input extras */
.form-select {
  width: 100%;
  padding: .65rem 2rem .65rem .85rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r);
  font-size: .95rem;
  color: var(--dark);
  background: var(--white) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") no-repeat right .4rem center / 14px 14px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-10); }

/* Search */
.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: .65rem 1rem .65rem 2.5rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r);
  font-size: .9rem;
  outline: none;
  transition: border-color var(--dur) var(--ease);
}

.search-box input:focus { border-color: var(--primary); }

.search-box .search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

/* Page title */
.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: .25rem;
}

.page-subtitle {
  font-size: .9rem;
  color: var(--gray-500);
  margin-bottom: 1.75rem;
}

/* Color swatches para clases */
.color-swatches {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s;
}

.color-swatch.selected { border-color: var(--dark); transform: scale(1.2); }

/* Bottom nav (mobile) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  z-index: 200;
  align-items: center;
  justify-content: space-around;
  padding: 0 .5rem;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  padding: .35rem .25rem;
  border-radius: var(--r);
  cursor: pointer;
  color: var(--gray-400);
  transition: color var(--dur) var(--ease);
  flex: 1;
  max-width: 72px;
}

.bottom-nav-item .bn-icon { font-size: 1.25rem; }
.bottom-nav-item .bn-label { font-size: .65rem; font-weight: 600; }
.bottom-nav-item.active { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  :root { --sidebar-w: 280px; }

  /* Sidebar oculta por defecto en mobile */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    z-index: 2500;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-footer {
    padding-bottom: calc(.6rem + env(safe-area-inset-bottom, 0px));
  }

  .sidebar-overlay { display: block; pointer-events: none; }

  .topbar { display: flex; z-index: 1000; }

  /* Main content en mobile */
  .main-content {
    margin-left: 0;
    padding-top: calc(var(--topbar-h) + var(--impersonation-bar-h));
    padding-bottom: 0 !important;
    min-height: auto !important;
    width: 100%;
    box-sizing: border-box;
    overflow-x: clip;
  }

  .main-inner {
    padding: 1rem 0.75rem calc(var(--bottom-nav-h) + 1.25rem + env(safe-area-inset-bottom, 0px)) 0.75rem !important;
    width: 100%;
    box-sizing: border-box;
    overflow-x: clip;
  }

  /* ── Responsive Gamificación Layout Fixes ───────────────────────────── */
  .gamif-hero-card {
    padding: 1.25rem 1rem !important;
  }
  .gamif-hero-card > div {
    flex-direction: column;
    align-items: stretch !important;
  }
  .gamif-hero-streak-box {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  .gamif-podium-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: .5rem !important;
  }

  .gamif-podium-card, .gamif-podium-gold {
    transform: none !important;
    padding: .65rem .85rem !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    text-align: left !important;
    border-radius: 12px !important;
    box-shadow: none !important;
  }

  .gamif-podium-gold {
    order: -2 !important;
  }

  .gamif-podium-rank {
    font-size: 1.2rem !important;
    margin-bottom: 0 !important;
    width: 28px !important;
    text-align: center;
    flex-shrink: 0;
  }

  .gamif-podium-avatar {
    margin-bottom: 0 !important;
    margin-right: .65rem !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
  }
  .gamif-podium-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
  }

  .gamif-podium-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  .gamif-podium-name {
    font-weight: 700;
    font-size: .85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--dark);
    flex: 1;
    min-width: 0;
  }

  .gamif-podium-count {
    font-size: .8rem;
    color: var(--primary);
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 0.5rem;
  }

  .gamif-badges-grid {
    grid-template-columns: 1fr !important;
  }
  .gamif-subcard {
    padding: .75rem .85rem !important;
  }

  /* Bottom nav: siempre fija */
  .bottom-nav {
    display: flex;
    padding-bottom: env(safe-area-inset-bottom, 0);
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0));
    z-index: 1000;
  }

  /* Week strip: swipe bar horizontal en mobile */
  .week-strip {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.4rem !important;
    padding: 0.5rem 0.25rem !important;
    justify-content: flex-start !important;
  }
  .week-strip::-webkit-scrollbar { display: none; }
  .week-day {
    min-width: 54px !important;
    flex-shrink: 0 !important;
    padding: 0.5rem 0.2rem !important;
  }
  .week-day-name { font-size: 0.65rem !important; }
  .week-day-num  { font-size: 1rem !important; }

  /* Schedule Tabs en Admin: swipe horizontal */
  .sched-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.45rem !important;
    padding-bottom: 0.5rem !important;
  }
  .sched-tabs::-webkit-scrollbar { display: none; }
  .sched-tab {
    flex-shrink: 0 !important;
    padding: 0.65rem 1rem !important;
    font-size: 0.88rem !important;
  }

  /* Ocultar cabecera horizontal de tabla en mobile */
  .tbl-header-row {
    display: none !important;
  }

  .tbl-wrapper {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .tbl-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  /* Filas de cliente en tablas Admin (Adapta a Cards Móviles Limpias) */
  .user-table-row {
    background: var(--white) !important;
    border: 1px solid var(--gray-200) !important;
    border-radius: 16px !important;
    padding: 0.85rem 0.9rem !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03) !important;
    flex-wrap: wrap !important;
    gap: 0.4rem 0.6rem !important;
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body.dark-mode .user-table-row {
    background: #1f2937 !important;
    border-color: #374151 !important;
  }

  .user-table-row > div:nth-child(1) {
    align-self: flex-start;
  }

  .user-table-row > div:nth-child(2) {
    flex: 1 1 50% !important;
    min-width: 0 !important;
  }

  .user-table-row > div:nth-child(3) {
    text-align: right !important;
    margin-left: auto !important;
    font-weight: 700 !important;
  }

  .user-table-row > div:nth-child(4),
  .user-table-row > div:nth-child(5),
  .user-table-row > div:nth-child(6) {
    width: auto !important;
    font-size: 0.78rem !important;
    margin-top: 0.2rem !important;
  }

  /* Botones de acción en mobile */
  .user-table-row > div:last-child {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    justify-content: flex-start !important;
    margin-top: 0.5rem !important;
    border-top: 1px solid var(--gray-100) !important;
    padding-top: 0.65rem !important;
    display: flex !important;
    gap: 0.4rem !important;
    box-sizing: border-box !important;
  }

  body.dark-mode .user-table-row > div:last-child {
    border-top-color: #374151 !important;
  }

  .user-table-row .btn-action {
    flex: 1 1 0px !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: 100% !important;
    justify-content: center !important;
    padding: 0.48rem 0.25rem !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    border-radius: 9px !important;
    box-sizing: border-box !important;
  }

  /* Grid de stats */
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Grid 2/3/4 col -> 1 col */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* Toast arriba en mobile */
  .toast-container { bottom: auto; top: calc(var(--topbar-h) + .75rem); }

  /* Modal full en mobile */
  .modal-backdrop {
    z-index: 3000 !important;
    padding: 0;
    align-items: flex-end;
  }
  .modal-box {
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-width: 100%;
    max-height: calc(92vh - env(safe-area-inset-bottom, 0px));
    animation: slideUpMobile .25s var(--ease);
    margin-bottom: 0;
  }
  .modal-box.modal-lg { border-radius: var(--r-xl) var(--r-xl) 0 0; max-width: 100%; }

  .modal-body {
    padding: 1.1rem 1rem calc(2rem + env(safe-area-inset-bottom, 0px)) 1rem !important;
    max-height: calc(85vh - 90px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .user-modal-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.35rem !important;
    padding-bottom: 0.35rem !important;
    margin-bottom: 0.85rem !important;
    border-bottom: 1px solid var(--gray-200);
  }
  .user-modal-tabs::-webkit-scrollbar { display: none; }
  .modal-tab-btn {
    flex-shrink: 0 !important;
    padding: 0.45rem 0.75rem !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
  }

  @keyframes slideUpMobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  /* Plan card en mobile */
  .plan-card {
    padding: 1rem;
    gap: .75rem;
  }
  .plan-details { min-width: 0; overflow: hidden; }
  .plan-details p {
    font-size: .78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Profile card info en mobile */
  .profile-hero { flex-wrap: wrap; }
  .profile-hero .profile-info { min-width: 0; flex: 1; }

  /* Tablas con scroll interno */
  .datatable-wrapper,
  .payments-table-wrap,
  .admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--r);
  }

  /* Class cards en mobile */
  .class-card__footer {
    flex-wrap: wrap;
    gap: .5rem;
  }

  .attendees-grid {
    max-width: 100%;
    overflow: hidden;
  }
  .attendee-slot, .attendee-avatar, .attendee-slot-empty {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
  }

  /* User modal tabs: scroll horizontal sin desbordar */
  .user-modal-tabs {
    overflow-x: auto;
    overflow-y: hidden !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
  }
  .user-modal-tabs::-webkit-scrollbar { display: none; }

  /* Booking rows en mobile */
  .booking-item {
    flex-wrap: wrap;
    gap: .5rem;
  }
}

@media (max-width: 400px) {
  .week-strip { gap: .15rem; padding: .4rem; }
  .attendee-avatar, .attendee-slot, .attendee-slot-empty { width: 32px; height: 32px; }
  .plan-icon { font-size: 1.75rem; }
}

/* ── Day alerts (compactos) ───────────────────────────────────────────────── */
.day-alert {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .9rem;
  border-radius: var(--r);
  font-size: .82rem;
  font-weight: 500;
  margin-bottom: .85rem;
}

.day-alert--holiday {
  background: var(--warning-bg);
  border: 1px solid #fde68a;
  color: #92400e;
}

.day-alert--closed {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
}

/* ── Divisor de franja horaria ────────────────────────────────────────────── */
.period-divider {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .65rem;
}

.period-divider__label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  flex-shrink: 0;
}

.period-divider__label--morning  { color: #d97706; }
.period-divider__label--afternoon { color: #7c3aed; }

.period-divider__hours {
  font-size: .72rem;
  color: var(--gray-400);
  white-space: nowrap;
  flex-shrink: 0;
}

.period-divider__line {
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ── Semana: estados y días ────────────────────────────────────────────────── */
.week-day.today:not(.selected) .week-day-name { color: var(--primary); font-weight: 700; }
.week-day.today:not(.selected) .week-day-num  { color: var(--primary-dark); font-weight: 800; }

.week-day.closed-day:not(.selected) .week-day-num  { color: var(--gray-400); }
.week-day.closed-day:not(.selected) .week-day-name { color: var(--gray-400); }

.week-day-status {
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.closed-dot {
  font-size: .7rem;
  font-weight: 800;
  color: var(--danger);
  line-height: 1;
}

.week-day.selected .closed-dot {
  color: rgba(255,255,255,.9);
}

.day-status-icon {
  font-size: .65rem;
  line-height: 1;
}

/* ── Mediodía ─────────────────────────────────────────────────────────────── */
.period-divider__label--midday    { color: #0369a1; }

/* ── Alertas de día ──────────────────────────────────────────────────────── */
.day-alert {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1rem;
  border-radius: var(--r);
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: .85rem;
  border: 1.5px solid transparent;
}

.day-alert--holiday {
  background: #fefce8;
  border-color: #fde68a;
  color: #92400e;
}

.day-alert--closed {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* ── Badge genérico gris ─────────────────────────────────────────────────── */
.badge-gray {
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

/* ── Barra de color de reserva en mis reservas ───────────────────────────── */
.booking-class-color {
  width: 4px;
  border-radius: 99px;
  align-self: stretch;
  flex-shrink: 0;
  min-height: 36px;
}

/* ── Grid 3 columnas ─────────────────────────────────────────────────────── */
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
}

/* ── Schedule admin: scroll horizontal en móvil ─────────────────────────── */
.schedule-day-row > div:last-child {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Pestañas de días de la semana (Grandes & Estilizadas) ────────────────── */
.sched-tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 0.5rem;
}

.sched-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-700);
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.sched-tab:hover {
  color: var(--primary-dark);
  background: var(--primary-bg);
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

.sched-tab.active {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  border-color: #059669 !important;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
}

.sched-tab-day {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.sched-tab-status {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  background: var(--gray-100);
  color: var(--gray-600);
  line-height: 1;
}

.sched-tab-status.open {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}

.sched-tab.active .sched-tab-status {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

body.dark-mode .sched-tab {
  background: #1f2937 !important;
  border-color: #374151 !important;
  color: #e5e7eb !important;
}

body.dark-mode .sched-tab:hover {
  background: #374151 !important;
  color: #34d399 !important;
}

body.dark-mode .sched-tab.active {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45) !important;
}

body.dark-mode .sched-tab-status.open {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #34d399 !important;
}

body.dark-mode .sched-tab-status.closed {
  background: #374151 !important;
  color: #9ca3af !important;
}

/* ── Panel de un día / Configuración (oculto por defecto) ──────────────────────────────── */
.hidden { display: none !important; }
.sched-panel { display: block; }
.sched-panel.hidden { display: none !important; }

/* ── Grid de 3 franjas responsive ─────────────────────────────────────── */
.sched-periods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .85rem;
}

@media (max-width: 900px) {
  .sched-periods-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .sched-periods-grid { grid-template-columns: 1fr; }
  .sched-tab { padding: .55rem .7rem; font-size: .75rem; }
}


/* ── Botones de Acción Elegantes y Armónicos en Tablas ───────────────────── */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.42rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1;
  width: auto;
  min-width: max-content;
  box-sizing: border-box;
}

.btn-action:hover {
  transform: translateY(-1px);
}

.btn-action-purple {
  background: #f3e8ff;
  color: #7e22ce !important;
  border: 1px solid #d8b4fe;
}

.btn-action-purple:hover {
  background: #e9d5ff;
  color: #6b21a8 !important;
  border-color: #c084fc;
}

.btn-action-secondary {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155 !important;
}

.btn-action-secondary:hover {
  background: #e2e8f0;
  color: #0f172a !important;
  border-color: #94a3b8;
}

.btn-action-success {
  background: #ecfdf5;
  color: #047857 !important;
  border: 1px solid #a7f3d0;
}

.btn-action-success:hover {
  background: #d1fae5;
  color: #065f46 !important;
  border-color: #6ee7b7;
}

.btn-action-danger {
  background: #fef2f2;
  color: #b91c1c !important;
  border: 1px solid #fecaca;
}

.btn-action-danger:hover {
  background: #fee2e2;
  color: #991b1b !important;
  border-color: #fca5a5;
}

/* Modo oscuro - Tonalidades MATE y elegantes */
body.dark-mode .btn-action-secondary {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}

body.dark-mode .btn-action-secondary:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

body.dark-mode .btn-action-purple {
  background: rgba(168, 85, 247, 0.15) !important;
  border-color: rgba(168, 85, 247, 0.35) !important;
  color: #c084fc !important;
}

body.dark-mode .btn-action-purple:hover {
  background: rgba(168, 85, 247, 0.28) !important;
  color: #e9d5ff !important;
  border-color: rgba(168, 85, 247, 0.5) !important;
}

body.dark-mode .btn-action-success {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #34d399 !important;
}

body.dark-mode .btn-action-success:hover {
  background: rgba(16, 185, 129, 0.28) !important;
  color: #6ee7b7 !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
}

body.dark-mode .btn-action-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #f87171 !important;
}

body.dark-mode .btn-action-danger:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}

/* ── Tabla compacta de clientes ─────────────────────────────────────────── */
.users-table-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 1.1rem;
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-400);
}

.user-table-row {
  display: flex !important;
  align-items: center !important;
  gap: .75rem;
  padding: .6rem 1.1rem !important;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background .12s;
  min-height: 0 !important;
}

.user-table-row:hover { background: var(--gray-50); }
.user-table-row:last-child { border-bottom: none; }

/* ── Stats en línea ─────────────────────────────────────────────────────── */
.stat-inline {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .75rem;
  border-radius: 99px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  font-size: .82rem;
  color: var(--gray-600);
}

.stat-inline-val {
  font-weight: 800;
  font-size: .95rem;
  color: var(--dark);
}

.stat-inline-val.info    { color: var(--info); }
.stat-inline-val.success { color: var(--success); }
.stat-inline-val.danger  { color: var(--danger); }

/* ── Chips de filtro ─────────────────────────────────────────────────────── */
.filter-chip {
  padding: .35rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  border-radius: 99px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-500);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.filter-chip:hover  { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Panel de franja horaria desactivada ─────────────────────────────────── */
.period-config {
  transition: opacity .2s;
}

.period-disabled {
  opacity: .55;
}

/* El checkbox y su label SIEMPRE son clicables, aunque el panel esté disabled */
.period-disabled input[type="checkbox"],
.period-disabled label[for] {
  opacity: 1 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* ── Estilos para AdminTable (Tablas buscables, paginables y ordenables) ── */
.tbl-wrapper {
  overflow-x: auto;
  border-radius: var(--r);
  border: 1px solid var(--gray-200);
  background: #fff;
  margin-bottom: 1.5rem;
}

.tbl-header-row,
.user-table-row {
  min-width: 880px;
}

.tbl-header-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
}

.tbl-th {
  user-select: none;
  display: flex;
  align-items: center;
  gap: .3rem;
}

.table-head-sortable {
  cursor: pointer;
  transition: color .15s;
}

.table-head-sortable:hover {
  color: var(--primary-dark);
}

.tbl-th.sorted {
  color: var(--primary);
  font-weight: 800;
}

.tbl-sort-icon {
  font-size: .65rem;
  color: var(--primary);
}

.tbl-body {
  min-height: 50px;
}

.tbl-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.1rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  font-size: .82rem;
  flex-wrap: wrap;
  gap: .75rem;
}

.tbl-page-info {
  color: var(--gray-600);
}

.tbl-page-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tbl-page-btns {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: nowrap !important;
}

.tbl-btn {
  padding: .35rem .6rem;
  font-size: .78rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--gray-300);
  background: #fff;
  color: var(--dark);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.tbl-btn:hover:not(:disabled) {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.tbl-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.tbl-page-num {
  font-size: .8rem;
  font-weight: 700;
  padding: 0 .4rem;
  color: var(--gray-700);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .tbl-pagination {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
    padding: 0.75rem 0.6rem !important;
  }

  .tbl-page-info {
    text-align: center !important;
    font-size: 0.78rem !important;
  }

  .tbl-page-controls {
    justify-content: space-between !important;
    width: 100% !important;
    gap: 0.4rem !important;
  }

  .tbl-page-btns {
    justify-content: flex-end !important;
    gap: 0.2rem !important;
  }

  .tbl-btn {
    padding: 0.35rem 0.45rem !important;
    font-size: 0.75rem !important;
  }
}

@media (max-width: 400px) {
  .tbl-btn-label {
    display: none !important;
  }
}

/* ── Selector de Tema de Igual Tamaño (Segmented Control) ───────────────── */
.theme-selector-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: var(--gray-100);
  border: 1px solid var(--border-color);
  border-radius: var(--r);
}

body.dark-mode .theme-selector-group {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.theme-option-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 145px;
  height: 38px;
  padding: 0 1.15rem;
  border-radius: calc(var(--r) - 2px);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--gray-500);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.theme-option-btn:hover {
  color: var(--dark);
}

.theme-option-btn.active {
  background: var(--primary);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

body.dark-mode .theme-option-btn.active {
  background: var(--primary);
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.45);
}

@media (max-width: 480px) {
  .theme-selector-group {
    width: 100%;
  }
  .theme-option-btn {
    flex: 1;
    min-width: 0;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   🎂 CUMPLEAÑOS & CORONA DE CUMPLEAÑERO/A
   ───────────────────────────────────────────────────────────────────────────── */
.attendee-avatar-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.attendee-avatar-wrapper.is-birthday-slot {
  margin-top: 6px;
}

.birthday-crown-badge {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5)) drop-shadow(0 0 10px rgba(245,158,11,0.9));
  animation: crownFloatGlow 1.8s infinite ease-in-out;
  z-index: 30;
  pointer-events: none;
}

@keyframes crownFloatGlow {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateX(-50%) translateY(-4px) rotate(6deg) scale(1.15); }
}

.birthday-avatar-ring {
  border: 3px solid #f59e0b !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.95), 0 0 24px rgba(251, 191, 36, 0.6) !important;
  animation: birthdayAuraPulse 1.8s infinite alternate ease-in-out;
}

@keyframes birthdayAuraPulse {
  0% {
    border-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.8), 0 0 15px rgba(251, 191, 36, 0.4);
  }
  100% {
    border-color: #fbbf24;
    box-shadow: 0 0 18px rgba(245, 158, 11, 1), 0 0 28px rgba(236, 72, 153, 0.8);
  }
}

.birthday-toast-banner {
  background: linear-gradient(135deg, #f59e0b 0%, #ec4899 50%, #8b5cf6 100%);
  color: #ffffff;
  padding: 1.25rem 1.5rem;
  border-radius: var(--r-lg);
  box-shadow: 0 10px 25px rgba(236, 72, 153, 0.3);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 5px 20px rgba(245, 158, 11, 0.3); }
  100% { box-shadow: 0 10px 30px rgba(236, 72, 153, 0.5); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   🎉 TEMÁTICAS ESTACIONALES: SAN VALENTÍN, HALLOWEEN, NAVIDADES
   ───────────────────────────────────────────────────────────────────────────── */
#seasonal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* ❄️ Navidades: Copos de nieve (Adaptativo a Modo Claro / Oscuro) */
.snowflake {
  position: absolute;
  top: -20px;
  color: #3b82f6;
  font-size: 1.1rem;
  user-select: none;
  pointer-events: none;
  opacity: 0.65;
  animation: fallLinear linear infinite;
  filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.4));
}

body.dark-mode .snowflake {
  color: #ffffff;
  opacity: 0.45;
  filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.7));
}

@keyframes fallLinear {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(105vh) rotate(360deg); }
}

/* 💘 San Valentín: Corazones flotantes */
.floating-heart {
  position: absolute;
  bottom: -20px;
  color: #ec4899;
  font-size: 1.2rem;
  user-select: none;
  pointer-events: none;
  opacity: 0.4;
  animation: floatUp ease-in infinite;
  filter: drop-shadow(0 2px 6px rgba(236,72,153,0.3));
}

@keyframes floatUp {
  0% { transform: translateY(0) scale(0.8) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-105vh) scale(1.3) rotate(20deg); opacity: 0; }
}

/* 🦇 Halloween: Murciélagos voladores interactivos */
.flying-bat {
  position: fixed;
  left: -100px;
  top: 15vh;
  font-size: 2.3rem;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  animation: flyBat 15s linear infinite;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
  transition: transform 0.2s ease, opacity 0.3s ease;
  padding: 10px;
  z-index: 9999;
}

.flying-bat:hover {
  transform: scale(1.35);
}

@keyframes flyBat {
  0% { left: -100px; top: 12vh; transform: scaleX(1); }
  25% { top: 65vh; }
  50% { left: 105vw; top: 30vh; transform: scaleX(1); }
  51% { transform: scaleX(-1); }
  75% { top: 78vh; }
  100% { left: -100px; top: 12vh; transform: scaleX(-1); }
}

@media (max-width: 768px) {
  .flying-bat {
    font-size: 1.85rem;
    padding: 10px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   🏆 TROFEOS SECRETOS Y PSN BADGES
   ───────────────────────────────────────────────────────────────────────────── */
.secret-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.secret-badge-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.secret-badge-card--locked {
  background: rgba(241, 245, 249, 0.6);
  border-style: dashed;
  opacity: 0.75;
}

body.dark-mode .secret-badge-card--locked {
  background: rgba(30, 41, 59, 0.4);
  border-color: rgba(255, 255, 255, 0.15);
}

.secret-badge-card--unlocked {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.4) 0%, rgba(253, 230, 138, 0.2) 100%);
  border: 1px solid #f59e0b;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}

body.dark-mode .secret-badge-card--unlocked {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.3) 0%, rgba(180, 83, 9, 0.15) 100%);
  border-color: #f59e0b;
}

.secret-badge-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--gray-100, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.secret-badge-card--unlocked .secret-badge-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.secret-badge-info {
  flex: 1;
}

.secret-badge-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--dark, #0f172a);
}

.secret-badge-desc {
  font-size: 0.8rem;
  color: var(--gray-500, #64748b);
  margin: 0;
  line-height: 1.35;
}

.secret-badge-status {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
  margin-top: 0.4rem;
  display: inline-block;
}

.secret-badge-status--locked {
  background: #cbd5e1;
  color: #475569;
}

.secret-badge-status--unlocked {
  background: #fef3c7;
  color: #b45309;
}

/* Modal Trofeo Desbloqueado Pop-up */
.trophy-popup-modal {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  padding: 1.25rem 1.5rem;
  border-radius: var(--r-lg);
  border: 2px solid #f59e0b;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 15px rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  animation: trophyPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 380px;
}

@keyframes trophyPop {
  0% { transform: translateY(-50px) scale(0.7); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* ==========================================================================
   ESTILOS LEGALES RGPD & LSSI-CE (JR FITNESS) - SIN SCROLL HORIZONTAL
   ========================================================================== */

/* Capa 1 Informativa RGPD en Formularios */
.rgpd-layer1-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 1.25rem 0 1rem 0;
  font-size: 0.78rem;
  color: #334155;
  line-height: 1.45;
}

body.dark-mode .rgpd-layer1-box {
  background: #1e293b;
  border-color: #334155;
  border-left-color: var(--primary);
  color: #cbd5e1;
}

.rgpd-layer1-title {
  font-weight: 800;
  font-size: 0.82rem;
  color: #0f172a;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

body.dark-mode .rgpd-layer1-title {
  color: #f8fafc;
}

.rgpd-layer1-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rgpd-layer1-list li {
  margin-bottom: 0.25rem;
}

.rgpd-layer1-list a, .legal-link {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
}

.rgpd-layer1-list a:hover, .legal-link:hover {
  color: var(--primary-dark);
}

/* Modal Legal Universal */
.jr-legal-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.jr-legal-modal-card {
  background: #ffffff;
  border-radius: 16px;
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  animation: modalFadeIn 0.25s ease-out;
}

body.dark-mode .jr-legal-modal-card {
  background: #0f172a;
  border-color: #1e293b;
  color: #f1f5f9;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(15px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.jr-legal-modal-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

body.dark-mode .jr-legal-modal-header {
  background: #1e293b;
  border-bottom-color: #334155;
}

.jr-legal-modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: #0f172a !important;
}

body.dark-mode .jr-legal-modal-header h3 {
  color: #f8fafc !important;
}

.jr-legal-modal-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 0 0.5rem;
}

.jr-legal-modal-close:hover {
  color: #0f172a;
}

.jr-legal-tabs-bar {
  display: flex;
  background: #f1f5f9;
  padding: 0.5rem 1rem 0 1rem;
  gap: 0.25rem;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: hidden;
  align-items: flex-end;
  min-height: 48px;
}

body.dark-mode .jr-legal-tabs-bar {
  background: #0f172a;
  border-bottom-color: #334155;
}

.jr-legal-tab-btn {
  flex: 1;
  text-align: center;
  padding: 0.6rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1.3;
}

.jr-legal-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.jr-legal-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #334155;
  flex: 1;
}

.jr-legal-modal-body ul {
  list-style-type: disc !important;
  padding-left: 1.5rem !important;
  margin: 0.5rem 0 1rem 0 !important;
}

.jr-legal-modal-body ol {
  list-style-type: decimal !important;
  padding-left: 1.5rem !important;
  margin: 0.5rem 0 1rem 0 !important;
}

.jr-legal-modal-body li {
  display: list-item !important;
  list-style-type: disc !important;
  margin-bottom: 0.4rem !important;
}

body.dark-mode .jr-legal-modal-body {
  color: #cbd5e1;
}

.jr-legal-modal-body h4 {
  font-size: 0.95rem;
  margin: 1.1rem 0 0.4rem 0;
  color: #0f172a;
}

body.dark-mode .jr-legal-modal-body h4 {
  color: #f8fafc;
}

/* Tablas Sin Scroll Horizontal */
.legal-table-responsive {
  width: 100%;
  overflow: hidden;
  margin: 0.75rem 0;
  border-radius: 8px;
}

.legal-info-table {
  width: 100% !important;
  max-width: 100% !important;
  border-collapse: collapse;
  font-size: 0.82rem;
}

/* Tabla Aviso Legal (2 Columnas) */
.notice-table {
  table-layout: fixed;
}

.notice-table tr td:first-child {
  font-weight: 700;
  width: 30%;
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
  background: rgba(0, 0, 0, 0.015);
}

body.dark-mode .notice-table tr td:first-child {
  background: rgba(255, 255, 255, 0.03);
}

.notice-table tr td:last-child {
  width: 70%;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
}

/* Tabla Cookies (4 Columnas) */
.cookies-table {
  width: 100% !important;
  table-layout: auto !important;
}

.cookies-table th:nth-child(1), .cookies-table td:nth-child(1) { width: 22%; font-weight: 600; }
.cookies-table th:nth-child(2), .cookies-table td:nth-child(2) { width: 22%; }
.cookies-table th:nth-child(3), .cookies-table td:nth-child(3) { width: 42%; word-break: break-word; }
.cookies-table th:nth-child(4), .cookies-table td:nth-child(4) { width: 14%; }

.legal-info-table th, .legal-info-table td {
  padding: 0.55rem 0.75rem;
  border: 1px solid #e2e8f0;
  text-align: left;
}

body.dark-mode .legal-info-table th, body.dark-mode .legal-info-table td {
  border-color: #334155;
}

.legal-summary-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.1rem;
}

.legal-summary-box ul {
  list-style-type: disc !important;
  padding-left: 1.5rem !important;
  margin: 0.4rem 0 0.4rem 0 !important;
}

.legal-summary-box li {
  display: list-item !important;
  list-style-type: disc !important;
  margin-bottom: 0.35rem !important;
}

.jr-legal-modal-footer {
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

body.dark-mode .jr-legal-modal-footer {
  background: #1e293b;
  border-top-color: #334155;
}

.btn-legal-accept {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.4rem;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 8px;
  cursor: pointer;
}

.btn-legal-accept:hover {
  background: var(--primary-dark);
}

/* Banner de Cookies AEPD */
.jr-cookie-banner-wrapper {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2.5rem);
  max-width: 1100px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 1.1rem 1.5rem;
  z-index: 99990;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  animation: bannerSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bannerSlideUp {
  from { transform: translate(-50%, 100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.jr-cookie-banner-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.jr-cookie-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.jr-cookie-text {
  flex: 1;
  font-size: 0.83rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.jr-cookie-text strong {
  color: #ffffff;
  font-weight: 700;
  display: block;
  margin-bottom: 0.2rem;
}

.jr-cookie-text a {
  color: #34d399;
  text-decoration: underline;
}

.jr-cookie-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.btn-cookie-accept {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.2rem;
  font-weight: 700;
  font-size: 0.825rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-cookie-reject {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.825rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-cookie-config {
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  font-size: 0.825rem;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}

.cookie-option-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.85rem;
}

body.dark-mode .cookie-option-card {
  background: #1e293b;
  border-color: #334155;
}

.cookie-option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-desc {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.2rem;
}

body.dark-mode .cookie-desc {
  color: #94a3b8;
}

/* Adaptación Móvil Sin Desplazamiento Horizontal */
@media (max-width: 640px) {
  .jr-legal-modal-backdrop {
    padding: 0.4rem;
  }

  .jr-legal-modal-card {
    max-height: 94vh;
    border-radius: 14px;
    width: 100%;
  }

  .jr-legal-modal-header {
    padding: 0.75rem 1rem;
  }

  .jr-legal-modal-header h3 {
    font-size: 1.05rem !important;
  }

  .jr-legal-tabs-bar {
    padding: 0.4rem 0.25rem 0 0.25rem;
    gap: 0.15rem;
    min-height: 44px;
    overflow-x: hidden !important;
  }

  .jr-legal-tab-btn {
    flex: 1;
    text-align: center;
    padding: 0.45rem 0.15rem;
    font-size: 0.74rem;
    white-space: nowrap;
  }

  .jr-legal-modal-body {
    padding: 0.85rem 0.75rem 1rem 0.75rem;
    font-size: 0.82rem;
    overflow-x: hidden !important;
  }

  .jr-legal-modal-body h4 {
    font-size: 0.9rem;
    margin: 0.9rem 0 0.35rem 0;
  }

  .legal-table-responsive {
    overflow-x: hidden !important;
    overflow: hidden !important;
  }

  .legal-info-table {
    font-size: 0.76rem;
    table-layout: fixed !important;
    width: 100% !important;
  }

  .legal-info-table tr td:first-child {
    width: 35% !important;
    padding: 0.45rem 0.45rem;
    white-space: normal !important;
    word-break: break-word !important;
  }

  .legal-info-table tr td:last-child {
    width: 65% !important;
    padding: 0.45rem 0.45rem;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  .jr-legal-modal-footer {
    padding: 0.65rem 0.85rem;
  }

  .btn-legal-accept {
    width: 100%;
    text-align: center;
    padding: 0.65rem;
    font-size: 0.85rem;
  }

  .jr-cookie-banner-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .jr-cookie-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .btn-cookie-accept, .btn-cookie-reject {
    flex: 1;
    text-align: center;
  }

  /* Transformación de la tabla de cookies en tarjetas en teléfonos */
  .legal-info-table.cookies-table,
  .legal-info-table.cookies-table tbody,
  .legal-info-table.cookies-table tr,
  .legal-info-table.cookies-table td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  .legal-info-table.cookies-table thead {
    display: none !important;
  }

  .legal-info-table.cookies-table tr {
    margin-bottom: 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    background: #f8fafc;
  }

  body.dark-mode .legal-info-table.cookies-table tr {
    background: #1e293b;
    border-color: #334155;
  }

  .legal-info-table.cookies-table td {
    padding: 0.35rem 0 !important;
    border: none !important;
    font-size: 0.82rem;
    background: transparent !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  .legal-info-table.cookies-table td::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: var(--primary);
    display: inline-block;
    min-width: 110px;
  }
}

/* Botón de Rechazar dentro del Modal de Ajustes (Alto Contraste) */
.btn-cookie-reject-modal {
  background: #f1f5f9;
  color: #334155 !important;
  border: 1px solid #cbd5e1;
  padding: 0.6rem 1.1rem;
  font-weight: 700;
  font-size: 0.825rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-cookie-reject-modal:hover {
  background: #e2e8f0;
  color: #0f172a !important;
  border-color: #94a3b8;
}

body.dark-mode .btn-cookie-reject-modal {
  background: #334155;
  color: #f1f5f9 !important;
  border-color: #475569;
}

body.dark-mode .btn-cookie-reject-modal:hover {
  background: #475569;
  color: #ffffff !important;
}

