/* ============================================
   IronPulse Gym App — Design System
   Dark theme · Neon Green · Sport Yellow
   ============================================ */

:root {
  --bg-primary: #0a0a0b;
  --bg-secondary: #111114;
  --bg-card: #16161a;
  --bg-card-hover: #1c1c22;
  --bg-elevated: #1e1e24;

  --neon-green: #39ff14;
  --neon-green-dim: #2bcc10;
  --neon-green-glow: rgba(57, 255, 20, 0.25);
  --sport-yellow: #ffe600;
  --sport-yellow-dim: #ccba00;
  --sport-yellow-glow: rgba(255, 230, 0, 0.2);

  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  --danger: #ff4757;
  --success: #39ff14;
  --warning: #ffe600;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-glow-green: 0 0 40px rgba(57, 255, 20, 0.15);
  --shadow-glow-yellow: 0 0 40px rgba(255, 230, 0, 0.12);

  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Outfit', sans-serif;

  --sidebar-width: 260px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Tema Claro ---- */
:root[data-theme="light"] {
  --bg-primary: #f4f4f6;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f6f6f8;
  --bg-elevated: #eeeef1;

  --neon-green: #16a34a;
  --neon-green-dim: #15803d;
  --neon-green-glow: rgba(22, 163, 74, 0.18);
  --sport-yellow: #b45309;
  --sport-yellow-dim: #92400e;
  --sport-yellow-glow: rgba(180, 83, 9, 0.14);

  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #8b8b93;

  --border: rgba(0, 0, 0, 0.09);
  --border-hover: rgba(0, 0, 0, 0.18);

  --danger: #dc2626;
  --success: #16a34a;
  --warning: #b45309;

  --shadow-glow-green: 0 0 30px rgba(22, 163, 74, 0.14);
  --shadow-glow-yellow: 0 0 24px rgba(180, 83, 9, 0.12);
}

:root[data-theme="light"] .brand-icon,
:root[data-theme="light"] .sidebar__logo {
  color: var(--neon-green-dim);
}

.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 500;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle__icon-light {
  display: none;
}

:root[data-theme="light"] .theme-toggle__icon-dark {
  display: none;
}

:root[data-theme="light"] .theme-toggle__icon-light {
  display: block;
}

#notifications-toggle {
  right: 4.75rem;
}

#notifications-toggle.notifications-toggle--active {
  color: var(--neon-green);
  border-color: var(--neon-green);
}

@media (max-width: 480px) {
  #notifications-toggle {
    right: 4rem;
  }
}

/* ---- Botón flotante: contactar para contratar la app ---- */

.hire-whatsapp-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  background: #25d366;
  color: #06210f;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  transition: var(--transition);
  animation: fadeIn 0.6s ease;
}

.hire-whatsapp-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(37, 211, 102, 0.55);
}

.hire-whatsapp-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .hire-whatsapp-btn {
    bottom: 1rem;
    right: 1rem;
    padding: 0.85rem;
    border-radius: 50%;
  }

  .hire-whatsapp-btn span {
    display: none;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.hidden {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100vw;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  -webkit-font-smoothing: antialiased;
}

/* ---- Screens & Panels ---- */

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: flex;
}

.app-panel {
  display: none;
  min-height: 100vh;
}

.app-panel.active {
  display: flex;
}

/* ---- Login Screen ---- */

.login-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.login-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
}

.login-glow--green {
  width: 600px;
  height: 600px;
  background: var(--neon-green);
  top: -200px;
  right: -100px;
  opacity: 0.15;
}

.login-glow--yellow {
  width: 500px;
  height: 500px;
  background: var(--sport-yellow);
  bottom: -150px;
  left: -100px;
  opacity: 0.1;
}

.login-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 2rem;
}

.brand {
  text-align: center;
  margin-bottom: 3.5rem;
}

.brand-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  color: var(--neon-green);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 8px var(--neon-green-glow)); }
  50% { filter: drop-shadow(0 0 20px var(--neon-green-glow)); }
}

.brand-title {
  font-family: var(--font-display);
  font-size: 4rem;
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.brand-title .accent {
  color: var(--neon-green);
}

.brand-tagline {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 300;
}

.install-btn {
  margin-top: 2rem;
  animation: fadeIn 0.5s ease;
}

/* ---- Acceso rápido de Demo ---- */

.demo-access {
  width: 100%;
  max-width: 400px;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.5s ease;
}

.demo-access__title {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.demo-access__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.demo-access__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.demo-access__btn svg {
  width: 22px;
  height: 22px;
  color: var(--neon-green);
}

.demo-access__btn:hover,
.demo-access__btn:focus-visible {
  border-color: var(--neon-green);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px var(--neon-green-glow);
  transform: translateY(-2px);
}

.login-divider {
  width: 100%;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Unified Login Form ---- */

.login-form-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.5s ease;
}

.login-hint {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.login-hint strong {
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.8rem;
}

.login-hint p {
  margin-bottom: 0.35rem;
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
}

.login-hint span {
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---- Sidebar ---- */

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.sidebar__logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--neon-green), var(--neon-green-dim));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--bg-primary);
  font-weight: 700;
}

.sidebar__logo--client {
  background: linear-gradient(135deg, var(--sport-yellow), var(--sport-yellow-dim));
}

.sidebar__logo--trainer {
  background: linear-gradient(135deg, #818cf8, #6366f1);
}

.sidebar__name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
}

.sidebar__role {
  display: block;
  font-size: 0.75rem;
  color: var(--neon-green);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.sidebar--client .sidebar__role {
  color: var(--sport-yellow);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(57, 255, 20, 0.08);
  color: var(--neon-green);
  border: 1px solid rgba(57, 255, 20, 0.15);
}

.sidebar--client .nav-item.active {
  background: rgba(255, 230, 0, 0.08);
  color: var(--sport-yellow);
  border-color: rgba(255, 230, 0, 0.15);
}

.sidebar--trainer .sidebar__role {
  color: #818cf8;
}

.sidebar--trainer .nav-item.active {
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.2);
}

.sidebar__logout {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  margin-top: auto;
}

.sidebar__logout svg {
  width: 18px;
  height: 18px;
}

.sidebar__logout:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(255, 71, 87, 0.05);
}

.client-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.client-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sport-yellow), #ff9500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--bg-primary);
  flex-shrink: 0;
}

.client-avatar--large {
  width: 80px;
  height: 80px;
  font-size: 1.5rem;
}

.client-avatar--trainer {
  background: linear-gradient(135deg, #818cf8, #6366f1);
}

.client-name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---- Main Content ---- */

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2rem;
  min-height: 100vh;
}

/* Header para celulares (botón de menú oculto en compu) */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.2rem;
  margin-right: 0.5rem;
}

.mobile-menu-btn svg {
  width: 28px;
  height: 28px;
}

.topbar__mobile-flex {
  display: flex;
  align-items: center;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.topbar__title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.topbar__subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.topbar__stats {
  display: flex;
  gap: 0.75rem;
}

.stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  text-align: center;
}

.stat-pill--yellow {
  border-color: rgba(255, 230, 0, 0.2);
}

.stat-pill__value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--neon-green);
  line-height: 1;
}

.stat-pill--yellow .stat-pill__value {
  color: var(--sport-yellow);
}

.stat-pill__label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.topbar__badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.2);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--neon-green);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--neon-green);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ---- Content Sections ---- */

.content-section {
  display: none;
  animation: fadeIn 0.35s ease;
}

.content-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Badges ---- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--vip {
  background: rgba(255, 230, 0, 0.12);
  color: var(--sport-yellow);
  border: 1px solid rgba(255, 230, 0, 0.25);
}

.badge--daily {
  background: rgba(57, 255, 20, 0.1);
  color: var(--neon-green);
  border: 1px solid rgba(57, 255, 20, 0.2);
}

.badge--monthly {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge--active {
  background: rgba(57, 255, 20, 0.12);
  color: var(--neon-green);
  border: 1px solid rgba(57, 255, 20, 0.25);
}

.badge--expired {
  background: rgba(255, 71, 87, 0.12);
  color: var(--danger);
  border: 1px solid rgba(255, 71, 87, 0.25);
}

.badge--trainer {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge--plan-0 {
  background: rgba(244, 114, 182, 0.12);
  color: #f472b6;
  border: 1px solid rgba(244, 114, 182, 0.25);
}

.badge--plan-1 {
  background: rgba(45, 212, 191, 0.12);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.25);
}

.badge--plan-2 {
  background: rgba(251, 146, 60, 0.12);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.25);
}

.badge--inactive {
  background: rgba(161, 161, 170, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(161, 161, 170, 0.25);
}

/* ---- Toolbar & Search ---- */

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  flex: 1;
  max-width: 400px;
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--neon-green);
  box-shadow: 0 0 0 3px var(--neon-green-glow);
}

.search-box svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  width: 100%;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.checkbox-option input {
  accent-color: var(--neon-green);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.form-input--compact {
  width: auto;
  min-width: 160px;
  padding: 0.65rem 0.85rem;
  flex: 0 0 auto;
}

.family-link-adder {
  display: grid;
  grid-template-columns: 2fr 1.5fr auto;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn--primary {
  background: var(--neon-green);
  color: var(--bg-primary);
}

.btn--primary:hover {
  background: var(--neon-green-dim);
  box-shadow: var(--shadow-glow-green);
  transform: translateY(-1px);
}

.btn--secondary {
  background: transparent;
  color: var(--sport-yellow);
  border: 1px solid rgba(255, 230, 0, 0.3);
}

.btn--secondary:hover {
  background: rgba(255, 230, 0, 0.08);
  box-shadow: var(--shadow-glow-yellow);
  transform: translateY(-1px);
}

.btn--full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn--danger-ghost {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255, 71, 87, 0.35);
}

.btn--danger-ghost:hover {
  background: rgba(255, 71, 87, 0.08);
}

.btn--success-ghost {
  background: transparent;
  color: var(--neon-green);
  border: 1px solid rgba(57, 255, 20, 0.35);
}

.btn--success-ghost:hover {
  background: rgba(57, 255, 20, 0.08);
}

.chart-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.chart-legend__item {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.chart-legend__item--green {
  color: var(--neon-green);
}

.chart-legend__item--yellow {
  color: var(--sport-yellow);
}

.chart-legend__item--red {
  color: var(--danger);
}

.progress-chart-wrap {
  padding: 1.5rem;
}

.progress-chart-wrap svg {
  width: 100%;
  height: 220px;
  display: block;
}

.progress-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.progress-summary__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.progress-summary__label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.progress-summary__value {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.progress-summary__value--down {
  color: var(--neon-green);
}

.progress-summary__value--up {
  color: var(--sport-yellow);
}

/* ---- Evaluación física: wizard tipo Typeform ---- */

.eval-wizard-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.eval-wizard-nav {
  grid-template-columns: 1fr 1fr 1fr;
}

.eval-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.eval-review-section {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.85rem;
}

.eval-review-section strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--neon-green);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.eval-review-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.eval-review-section li {
  color: var(--text-secondary);
}

.eval-details {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
}

.eval-details summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--neon-green);
  font-weight: 600;
  list-style: none;
}

.eval-details summary::-webkit-details-marker {
  display: none;
}

.eval-details summary::before {
  content: '▸ ';
}

.eval-details[open] summary::before {
  content: '▾ ';
}

.eval-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.eval-detail-grid > div {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
}

.eval-detail-grid__label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.eval-detail-grid__value {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---- Roadmap de progreso (wizard de rutina del socio) ---- */

.roadmap-track {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem 0;
  overflow-x: auto;
}

.roadmap-node {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  z-index: 1;
  margin-right: 22px;
  padding: 0;
}

.roadmap-node:last-child {
  margin-right: 0;
}

.roadmap-node:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 2px;
  background: var(--border);
}

.roadmap-node--done {
  background: var(--neon-green);
  border-color: var(--neon-green);
  color: var(--bg-primary);
}

.roadmap-node--done:not(:last-child)::after {
  background: var(--neon-green);
}

.roadmap-node--current {
  border-color: var(--sport-yellow);
  background: var(--sport-yellow);
  color: var(--bg-primary);
  transform: scale(1.2);
}

/* ---- Mi Cuenta (socio): términos y condiciones ---- */

.terms-text {
  margin-top: 1rem;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.terms-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.terms-text strong {
  color: var(--text-primary);
}

.attendee-paid-btn {
  flex-shrink: 0;
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* ---- Data Table ---- */

.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%; /* Asegura que la tarjeta no supere el ancho del contenedor */
}

.table-scroll {
  overflow-x: auto;
  width: 100%; /* Permite scroll solo en la tabla, no en toda la pantalla */
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.text-muted {
  color: var(--text-muted);
}

.data-table th {
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr.member-row--inactive {
  opacity: 0.5;
}

.member-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.member-name {
  font-weight: 600;
}

.member-email {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

.table-actions button {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  display: flex;
}

.table-actions button:hover {
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.table-actions button svg {
  width: 16px;
  height: 16px;
}

.table-actions button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.table-actions button:disabled:hover {
  border-color: var(--border);
  color: var(--text-secondary);
}

/* ---- Payments ---- */

.payments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.payment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.payment-card__header {
  padding: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.payment-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.payment-card__icon svg {
  width: 24px;
  height: 24px;
}

.payment-card__icon--link {
  background: rgba(57, 255, 20, 0.1);
  color: var(--neon-green);
}

.payment-card__icon--qr {
  background: rgba(255, 230, 0, 0.1);
  color: var(--sport-yellow);
}

.payment-card__header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.payment-card__header p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.payment-card__body {
  padding: 1.75rem;
}

.payment-card__body--center {
  text-align: center;
}

.link-result {
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
  min-height: 52px;
  display: flex;
  align-items: center;
  word-break: break-all;
}

.link-result__placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.link-result__url {
  color: var(--neon-green);
  font-size: 0.85rem;
  font-family: monospace;
}

.qr-display {
  margin-bottom: 1.25rem;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem;
  margin-bottom: 1.25rem;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.qr-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

.qr-amount {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--sport-yellow);
  margin-top: 0.75rem;
}

/* ---- QR Code Pattern ---- */

.qr-code {
  display: inline-grid;
  gap: 2px;
  padding: 12px;
  background: #fff;
  border-radius: var(--radius-sm);
}

.qr-code--large {
  width: 180px;
  height: 180px;
}

.qr-code--credential {
  width: 160px;
  height: 160px;
}

.qr-cell {
  background: #000;
  border-radius: 1px;
}

.qr-cell--white {
  background: transparent;
}

.qr-code svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---- Access Control ---- */

.access-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.scanner-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}

.scanner-card__viewport {
  margin-bottom: 1.5rem;
}

.scanner-frame {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  margin: 0 auto;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: var(--neon-green);
  border-style: solid;
}

.scanner-corner--tl { top: 16px; left: 16px; border-width: 3px 0 0 3px; }
.scanner-corner--tr { top: 16px; right: 16px; border-width: 3px 3px 0 0; }
.scanner-corner--bl { bottom: 16px; left: 16px; border-width: 0 0 3px 3px; }
.scanner-corner--br { bottom: 16px; right: 16px; border-width: 0 3px 3px 0; }

.scanner-line {
  position: absolute;
  left: 20px;
  right: 20px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-green), transparent);
  animation: scan-line 2.5s ease-in-out infinite;
  box-shadow: 0 0 12px var(--neon-green-glow);
}

@keyframes scan-line {
  0%, 100% { top: 20%; opacity: 0.5; }
  50% { top: 80%; opacity: 1; }
}

.scanner-icon {
  color: var(--text-muted);
  opacity: 0.3;
}

.scanner-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.scanner-icon svg {
  width: 64px;
  height: 64px;
}

.scanner-card h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.scanner-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.access-log {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.access-log h3 {
  font-size: 1rem;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.access-log__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.access-log__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.access-log__empty svg {
  width: 40px;
  height: 40px;
  opacity: 0.3;
}

.access-entry {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--neon-green);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.access-entry--denied {
  border-left-color: var(--danger);
}

.access-entry__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(57, 255, 20, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--neon-green);
}

.access-entry__info {
  flex: 1;
}

.access-entry__name {
  font-weight: 600;
  font-size: 0.9rem;
}

.access-entry__time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.access-entry__status {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neon-green);
}

.access-entry--denied .access-entry__status {
  color: var(--danger);
}

/* ---- Exercises / Routine ---- */

.routine-header {
  margin-bottom: 1.5rem;
}

.routine-progress__bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.routine-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-green), var(--sport-yellow));
  border-radius: 999px;
  transition: width 0.5s ease;
}

.routine-progress__text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.exercises-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.exercise-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.exercise-card.completed {
  border-color: rgba(57, 255, 20, 0.2);
}

.exercise-card__video {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.exercise-card__video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.exercise-card__video-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

.exercise-card__video-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.exercise-card__play-btn {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(57, 255, 20, 0.9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--bg-primary);
}

.exercise-card__play-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-glow-green);
}

.exercise-card__play-btn svg {
  width: 24px;
  height: 24px;
  margin-left: 3px;
}

.exercise-card__body {
  padding: 1.25rem;
}

.exercise-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.exercise-card__title {
  font-size: 1.1rem;
  font-weight: 700;
}

.exercise-card__number {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--neon-green);
  line-height: 1;
}

.exercise-card__desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.exercise-card__stats {
  display: flex;
  gap: 1rem;
}

.exercise-stat {
  flex: 1;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  text-align: center;
}

.exercise-stat__value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--sport-yellow);
}

.exercise-stat__label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.exercise-card__check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

.exercise-card__check input {
  accent-color: var(--neon-green);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.exercise-card__check label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ---- Trainer Panel: Mis Socios ---- */

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
  font-family: inherit;
  width: 100%;
}

.member-card:hover {
  border-color: #818cf8;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.member-card__top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.member-card__name {
  font-weight: 700;
  font-size: 1rem;
  display: block;
}

.member-card__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.member-card__summary strong {
  color: #818cf8;
}

.member-card__cta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}

.member-card:hover .member-card__cta {
  color: #818cf8;
}

/* ---- Routine Editor ---- */

.routine-editor__header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.routine-editor__header h2 {
  font-size: 1.4rem;
  margin-bottom: 0.2rem;
}

.routine-editor__header--split {
  justify-content: space-between;
  align-items: flex-start;
}

.routine-editor__title {
  font-size: 1.6rem;
  margin-top: 1.25rem;
}

.member-card {
  position: relative;
}

.member-card--static {
  cursor: default;
}

.member-card--static:hover {
  border-color: var(--border);
  transform: none;
  box-shadow: none;
}

.member-card__delete {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.member-card__delete:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.member-card__delete svg {
  width: 15px;
  height: 15px;
}

.member-card__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.member-card__price {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--sport-yellow);
  margin-bottom: 0.85rem;
}

.day-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  margin-bottom: 1.5rem;
}

.day-tab {
  flex-shrink: 0;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.day-tab:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.day-tab.active {
  background: rgba(57, 255, 20, 0.1);
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.day-tab__count {
  margin-left: 0.35rem;
  opacity: 0.7;
}

.routine-day-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.routine-day-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.day-exercise-item {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
}

.day-exercise-item__row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.day-exercise-item__notes {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.55rem 0.75rem;
}

.day-exercise-item__notes::placeholder {
  color: var(--text-muted);
}

.day-exercise-item__notes:focus {
  outline: none;
  border-color: var(--sport-yellow);
  border-style: solid;
}

.day-exercise-item__thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
  overflow: hidden;
}

.day-exercise-item__thumb svg {
  width: 20px;
  height: 20px;
}

.day-exercise-item__thumb--has-video {
  color: var(--neon-green);
}

.day-exercise-item__info {
  flex: 1;
  min-width: 0;
}

.day-exercise-item__name {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
}

.day-exercise-item__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.day-exercise-item__stats {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.day-exercise-item__stats input {
  width: 44px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 0.4rem;
  text-align: center;
}

.day-exercise-item__stats span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.day-exercise-item__remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.day-exercise-item__remove:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.day-exercise-item__remove svg {
  width: 16px;
  height: 16px;
}

.exercise-picker {
  margin-top: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.exercise-picker__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  max-height: 320px;
  overflow-y: auto;
}

.exercise-picker__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
}

.exercise-picker__item-info {
  flex: 1;
  min-width: 0;
}

.exercise-picker__item-name {
  font-weight: 600;
  font-size: 0.88rem;
  display: block;
}

.exercise-picker__item-muscle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.exercise-picker__item-add {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.exercise-picker__item-add input {
  width: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 0.4rem;
  text-align: center;
}

.exercise-picker__item-add button {
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.25);
  color: var(--neon-green);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.exercise-picker__item-add button:hover {
  background: rgba(57, 255, 20, 0.18);
}

/* ---- Trainer Panel: Biblioteca de Ejercicios ---- */

.library-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.form-row--three {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-divider {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.form-actions--split {
  justify-content: space-between;
}

.form-actions__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-static-badge {
  display: flex;
  align-items: center;
  min-height: 44px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
}

.payment-history-inline {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.payment-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
}

.payment-row__info {
  flex: 1;
  min-width: 0;
}

.payment-row__amount {
  font-weight: 700;
  font-size: 0.95rem;
  display: block;
}

.payment-row__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.payment-row__receipt {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--neon-green);
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
}

.radio-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.radio-option:has(input:checked) {
  border-color: var(--neon-green);
  background: rgba(57, 255, 20, 0.06);
  color: var(--text-primary);
}

.radio-option input {
  accent-color: var(--neon-green);
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.radio-option strong {
  color: var(--text-primary);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.form-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
  resize: vertical;
}

.form-input:focus {
  outline: none;
  border-color: var(--neon-green);
  box-shadow: 0 0 0 3px var(--neon-green-glow);
}

.file-drop {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.file-drop:hover {
  border-color: var(--neon-green);
  color: var(--text-secondary);
}

.file-drop svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.library-card__video {
  position: relative;
}

.library-card__video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.library-card__upload {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(10, 10, 11, 0.75);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.library-card__upload:hover {
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.library-card__upload svg {
  width: 14px;
  height: 14px;
}

.library-card__muscle {
  display: inline-block;
  margin-bottom: 0.5rem;
}

.library-card__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.library-card__actions button {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.library-card__actions button:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ---- Client Wizard: Mi Rutina ---- */

.wizard {
  max-width: 640px;
  margin: 0 auto;
}

.wizard__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.wizard__empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

.wizard__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.wizard__dots {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  padding: 1rem 1rem 0;
}

.wizard__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.wizard__dot.done {
  background: var(--neon-green);
  border-color: var(--neon-green);
}

.wizard__dot.current {
  background: var(--sport-yellow);
  border-color: var(--sport-yellow);
  transform: scale(1.3);
}

.wizard__video {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 1rem 1.5rem 0;
  border-radius: var(--radius-md);
}

.wizard__video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wizard__body {
  padding: 1.5rem;
}

.wizard__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.wizard__counter {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--neon-green);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wizard__muscle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.wizard__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.wizard__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.coach-message-box {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  background: rgba(255, 230, 0, 0.06);
  border: 1px solid rgba(255, 230, 0, 0.2);
  border-radius: var(--radius-md);
}

.coach-message-box label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sport-yellow);
  margin-bottom: 0.5rem;
}

.wizard__notes {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 230, 0, 0.06);
  border: 1px solid rgba(255, 230, 0, 0.2);
  border-radius: var(--radius-md);
}

.wizard__notes strong {
  display: block;
  font-size: 0.75rem;
  color: var(--sport-yellow);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wizard__notes p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.wizard__nav {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.wizard__nav .btn {
  padding: 0.75rem 0.5rem;
  font-size: 0.8rem;
}

#wizard-complete.done {
  background: var(--neon-green);
  color: var(--bg-primary);
}

/* ---- Digital Credential ---- */

.credential-wrapper {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.digital-credential {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--shadow-glow-green);
}

.credential__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: rgba(57, 255, 20, 0.05);
  border-bottom: 1px solid var(--border);
}

.credential__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.credential__logo {
  width: 32px;
  height: 32px;
  background: var(--neon-green);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--bg-primary);
}

.credential__body {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
}

.credential__info h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.credential__id {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-family: monospace;
}

.credential__meta {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.credential__label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.credential__value {
  font-size: 0.9rem;
  font-weight: 600;
}

.credential__qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.credential__qr-hint {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

.credential__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.credential__timestamp {
  font-family: monospace;
}

/* ---- Toast ---- */

.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.35s ease;
  min-width: 300px;
  max-width: 420px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast--success {
  border-left: 3px solid var(--neon-green);
}

.toast--warning {
  border-left: 3px solid var(--sport-yellow);
}

.toast--error {
  border-left: 3px solid var(--danger);
}

.toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast--success .toast__icon { color: var(--neon-green); }
.toast--warning .toast__icon { color: var(--sport-yellow); }
.toast--error .toast__icon { color: var(--danger); }

.toast__message {
  font-size: 0.85rem;
  line-height: 1.4;
}

.toast.toast--out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(40px); }
}

/* ---- Modal genérico ---- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-box {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.2s ease;
}

.modal-box--wide {
  max-width: 860px;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

/* ---- Calendario mensual de Clases ---- */

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.cal-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.cal-weekdays span {
  text-align: center;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.cal-cell {
  min-height: 84px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
}

.cal-cell--empty {
  background: transparent;
  border: none;
}

.cal-cell--today {
  border-color: var(--neon-green);
  box-shadow: 0 0 0 1px var(--neon-green);
}

.cal-cell__day {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.cal-class-pill {
  display: block;
  width: 100%;
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.2);
  color: var(--neon-green);
  border-radius: 4px;
  padding: 0.15rem 0.3rem;
  font-size: 0.65rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-class-pill:hover {
  background: rgba(57, 255, 20, 0.2);
}

/* ---- Scrollbar ---- */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---- Ajustes Responsivos & Menú Hamburguesa Móvil ---- */

@media (max-width: 768px) {
  /* Evitar scroll horizontal global */
  html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  /* Ajustes en el Login para evitar scroll horizontal */
  .login-container {
    padding: 1rem;
  }
  .login-form-container {
    padding: 1.5rem;
  }
  .login-hint p {
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
  }

  /* Ajustes en los paneles principales */
  .app-panel.active {
    display: block;
  }
  
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 1.25rem;
    width: 100%;
    max-width: 100vw;
  }

  /* Ajustes en el encabezado superior */
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }
  
  .topbar__mobile-flex {
    justify-content: flex-start;
  }

  .topbar__title {
    font-size: 1.8rem;
  }

  .brand-title {
    font-size: 2.8rem;
  }

  /* Tarjetas de estadísticas apiladas simétricamente */
  .topbar__stats {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .stat-pill {
    padding: 0.75rem 0.5rem;
  }

  /* Barra de herramientas / Búsqueda y botones apilados */
  .section-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .section-toolbar > * {
    width: 100%;
    max-width: 100%;
  }

  .search-box {
    max-width: 100%;
  }

  /* Override para inputs que tenían ancho fijo en escritorio */
  .form-input--compact {
    min-width: 0;
  }

  /* Evitar que los textos largos en checkbox fuercen el ancho */
  .checkbox-option {
    white-space: normal;
  }

  .exercises-grid,
  .payments-grid,
  .members-grid,
  .library-grid {
    grid-template-columns: 1fr;
  }

  .wizard__video {
    margin: 1rem 1rem 0;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.75rem;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .toast {
    min-width: auto;
  }

  .form-row,
  .form-row--three {
    grid-template-columns: 1fr;
  }

  .form-actions--split {
    flex-direction: column-reverse;
  }

  .form-actions--split .btn {
    width: 100%;
  }

  .form-actions__left {
    flex-direction: column;
    width: 100%;
  }
}

@media (max-width: 700px) {
  .cal-cell {
    min-height: 60px;
  }

  .cal-class-pill {
    font-size: 0.55rem;
  }
}