* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #0f1115;
  color: #eaeaea;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* FONDO — REGLA Nº2 FASE 4: el fondo oscuro con líneas doradas, puntos y
   logotipo tenue vuelve a ser el fondo oficial de toda la app. Las tarjetas
   flotan sobre él, nunca al revés.
   🆕 FIX: el fondo se construye con piezas independientes ancladas a cada
   esquina REAL de la pantalla (no un único SVG con viewBox fijo + "slice"),
   para que nunca se estire ni se corte en proporciones de pantalla anchas. */
.background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(ellipse 75% 75% at 50% 42%, #13161d 0%, #070809 100%);
}

.bg-arc {
  position: absolute;
  width: 320px;
  height: 320px;
}
.bg-arc svg { width: 100%; height: 100%; display: block; }
.bg-arc-tr { top: 0; right: 0; }
.bg-arc-bl { bottom: 0; left: 0; transform: rotate(180deg); }

.bg-corner {
  position: absolute;
  width: 220px;
  height: 220px;
}
.bg-corner svg { width: 100%; height: 100%; display: block; }
.bg-corner-tl { top: -40px; left: -40px; }
.bg-corner-br { bottom: -40px; right: -40px; transform: rotate(180deg); }

.bg-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(46vw, 230px);
  opacity: 0.16;
}
.bg-logo svg { width: 100%; height: auto; display: block; }

/* APP */
.app {
  max-width: 420px;
  margin: auto;
  padding: 16px;
  padding-bottom: 120px;
}

/* =========================
   ✅ FASE 1: BOTÓN VOLVER UNIVERSAL
   ========================= */

.back-button {
  position: sticky;
  top: 16px;
  left: 16px;
  z-index: 1000;
  background: rgba(42, 47, 63, 0.95);
  backdrop-filter: blur(10px);
  color: #e6d3a3;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.back-button:hover {
  background: rgba(42, 47, 63, 1);
  transform: translateX(-3px);
}

.back-button:active {
  transform: translateX(-3px) scale(0.97);
}

/* =========================
   HEADER / BRAND
   ========================= */

.header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  /* ✅ FASE 1: Logo visible con mejor contraste */
  background: rgba(230, 211, 163, 0.1);
  padding: 4px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text h1 {
  margin: 0;
  font-size: 20px;
  color: #eaeaea;
}

.brand-text span {
  font-size: 11px;
  color: #9a9a9a;
  margin-top: 2px;
}

/* ✅ FASE 1: RACHA EN HEADER - Ahora NO es verde */
.header-streak {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #ff6b6b, #ff8787);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.header-streak:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.streak-flame {
  font-size: 20px;
  animation: flameFlicker 1.5s infinite;
}

@keyframes flameFlicker {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.streak-number {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
}

/* THEME TOGGLE */
.theme-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.theme-icon {
  font-size: 20px;
}

/* =========================
   SISTEMA DE PANTALLAS
   ========================= */

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation-duration: 0.25s;
  animation-fill-mode: both;
}

.screen.active.slide-in {
  animation-name: slideIn;
}

.screen.slide-out {
  animation-name: slideOut;
}

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

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

/* =========================
   CARDS
   ========================= */

.card {
  background: linear-gradient(180deg, #1a1d26, #161821);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* INPUTS */
input,
select {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: #242836;
  color: #eaeaea;
  margin-bottom: 12px;
  font-size: 15px;
}

input::placeholder {
  color: #aaa;
}

input:focus,
select:focus {
  outline: 2px solid #e6d3a3;
  outline-offset: 2px;
}

/* =========================
   ✅ FASE 1: BOTONES - Verde solo para acciones activas
   ========================= */

button {
  touch-action: manipulation;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* ✅ Botón primario - dorado/crema (no verde) */
.primary {
  background: #e6d3a3;
  color: #111;
  padding: 14px;
  border-radius: 16px;
  border: none;
  width: 100%;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(230, 211, 163, 0.3);
}

.primary:hover {
  background: #f0e0b5;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(230, 211, 163, 0.4);
}

.primary:active {
  transform: translateY(0) scale(0.98);
}

/* ✅ Verde SOLO para acciones en curso/activas */
.primary.active-action {
  background: linear-gradient(135deg, #51cf66, #40c057);
  color: white;
  box-shadow: 0 4px 12px rgba(81, 207, 102, 0.4);
}

.primary.active-action:hover {
  background: linear-gradient(135deg, #5dd675, #4dd067);
}

.secondary {
  background: #2a2f3f;
  color: #eaeaea;
  padding: 14px;
  border-radius: 16px;
  border: none;
  width: 100%;
  font-weight: 500;
  font-size: 15px;
}

.secondary:hover {
  background: #323847;
}

.secondary:active {
  transform: scale(0.98);
}

.secondary-small {
  background: #2a2f3f;
  color: #eaeaea;
  padding: 8px 16px;
  border-radius: 12px;
  border: none;
  font-weight: 500;
  font-size: 13px;
}

.danger {
  background: transparent;
  border: 1px solid #444;
  color: #ff6b6b;
  padding: 12px;
  border-radius: 14px;
  width: 100%;
  font-weight: 500;
}

.danger:hover {
  background: rgba(255, 107, 107, 0.1);
  border-color: #ff6b6b;
}

/* =========================
   WIDGETS / CARDS DASHBOARD
   ========================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.widget {
  background: linear-gradient(180deg, #1a1d26, #161821);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}

.widget.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.widget.clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.5);
}

.widget.clickable:active {
  transform: translateY(-2px);
}

.widget.large {
  grid-column: span 2;
  margin-bottom: 12px;
}

.widget-label {
  display: block;
  font-size: 13px;
  color: #9a9a9a;
  margin-bottom: 8px;
  font-weight: 500;
}

.widget strong {
  display: block;
  font-size: 24px;
  color: #e6d3a3;
  margin-top: 4px;
}

/* =========================
   ✅ FASE 1: CALENDARIO MEJORADO
   ========================= */

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
  padding: 0 4px;
}

.calendar-header button {
  background: rgba(230, 211, 163, 0.1);
  border: none;
  color: #e6d3a3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-header button:hover {
  background: rgba(230, 211, 163, 0.2);
}

.calendar-header strong {
  font-size: 15px;
  color: #eaeaea;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 13px;
  color: #9a9a9a;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ✅ Día de hoy */
.calendar-day.today {
  background: rgba(230, 211, 163, 0.2);
  color: #e6d3a3;
  font-weight: 600;
  border: 2px solid #e6d3a3;
}

/* ✅ FASE 1: Día con entrenamiento registrado */
.calendar-day.trained {
  background: linear-gradient(135deg, #51cf66, #40c057);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(81, 207, 102, 0.3);
}

.calendar-day.trained::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: white;
}

/* ✅ Día con entrenamiento Y es hoy */
.calendar-day.today.trained {
  background: linear-gradient(135deg, #51cf66, #40c057);
  border-color: #51cf66;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(81, 207, 102, 0.3);
  }
  50% {
    box-shadow: 0 4px 16px rgba(81, 207, 102, 0.6);
  }
}

/* Días fuera del mes actual */
.calendar-day.other-month {
  opacity: 0.3;
}

/* ✅ FASE 1: Leyenda del calendario */
.calendar-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #9a9a9a;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.trained {
  background: linear-gradient(135deg, #51cf66, #40c057);
}

.legend-dot.today {
  background: rgba(230, 211, 163, 0.3);
  border: 2px solid #e6d3a3;
}

.legend-dot.streak-active {
  background: linear-gradient(135deg, #ff6b6b, #ff8787);
}

/* =========================
   ✅ FASE 1: PÁGINA DE RACHA DEDICADA
   ========================= */

.streak-hero {
  background: linear-gradient(135deg, #ff6b6b, #ff8787);
  border-radius: 24px;
  padding: 40px 20px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
}

.streak-flame-big {
  font-size: 80px;
  margin-bottom: 16px;
  animation: flameFlicker 1.5s infinite;
}

.streak-current {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.streak-current strong {
  font-size: 48px;
  color: white;
  font-weight: 700;
}

.streak-current span {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.streak-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.streak-stat-card {
  background: linear-gradient(180deg, #1a1d26, #161821);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.streak-stat-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.streak-stat-card strong {
  display: block;
  font-size: 28px;
  color: #e6d3a3;
  margin-bottom: 4px;
}

.streak-stat-card span {
  font-size: 13px;
  color: #9a9a9a;
}

.streak-motivation {
  background: linear-gradient(135deg, rgba(230, 211, 163, 0.1), rgba(230, 211, 163, 0.05));
  border-radius: 16px;
  padding: 20px;
  margin-top: 20px;
  border: 1px solid rgba(230, 211, 163, 0.2);
}

.streak-motivation p {
  margin: 0;
  text-align: center;
  color: #e6d3a3;
  font-size: 15px;
  line-height: 1.6;
}

/* =========================
   BARRA DE PROGRESO
   ========================= */

.bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 8px;
}

.bar.large {
  height: 12px;
}

.bar > div {
  height: 100%;
  background: linear-gradient(90deg, #e6d3a3, #f0e0b5);
  border-radius: 10px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(230, 211, 163, 0.5);
}

/* ✅ Barra verde solo para progreso activo */
.bar > div.active-progress {
  background: linear-gradient(90deg, #51cf66, #40c057);
  box-shadow: 0 0 10px rgba(81, 207, 102, 0.5);
}

/* =========================
   SELECTOR DE EJERCICIO
   ========================= */

.selector {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.exercise-btn {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: #2a2f3f;
  color: #eaeaea;
  font-size: 15px;
  transition: all 0.2s ease;
}

.exercise-btn:active {
  transform: scale(0.97);
}

.exercise-btn.active {
  background: #e6d3a3;
  color: #111;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(230, 211, 163, 0.3);
}

/* =========================
   MODO DE ENTRENAMIENTO
   ========================= */

.exercise-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.mode-card {
  background: linear-gradient(180deg, #1a1d26, #161821);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.mode-card:hover {
  transform: translateY(-2px);
}

.mode-card.active {
  border-color: #e6d3a3;
  background: linear-gradient(180deg, rgba(230, 211, 163, 0.1), rgba(230, 211, 163, 0.05));
}

.mode-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.mode-label {
  font-size: 14px;
  color: #9a9a9a;
  font-weight: 500;
}

.mode-card.active .mode-label {
  color: #e6d3a3;
  font-weight: 600;
}

.workout-mode-content {
  display: none;
}

.workout-mode-content.active {
  display: block;
}

/* =========================
   TARJETAS DE EJERCICIOS
   ========================= */

.section-title {
  font-size: 15px;
  color: #9a9a9a;
  margin: 20px 0 12px 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.exercise-card {
  background: linear-gradient(180deg, #1a1d26, #161821);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
}

.exercise-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.exercise-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.exercise-card-header strong {
  font-size: 16px;
  color: #eaeaea;
}

.delete-exercise-btn {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: #ff6b6b;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.delete-exercise-btn:hover {
  background: rgba(255, 107, 107, 0.2);
  border-color: #ff6b6b;
}

.exercise-card-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  color: #9a9a9a;
}

.muscle-badge {
  background: rgba(230, 211, 163, 0.1);
  color: #e6d3a3;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* =========================
   PESO & SALUD
   ========================= */

.weight-hero-card {
  background: linear-gradient(135deg, #e6d3a3, #f0e0b5);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 20px;
  color: #111;
  box-shadow: 0 10px 30px rgba(230, 211, 163, 0.3);
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

.hero-date {
  font-size: 12px;
  opacity: 0.6;
}

.hero-weight {
  text-align: center;
  margin: 20px 0;
}

.hero-weight strong {
  font-size: 56px;
  font-weight: 700;
  color: #111;
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
  padding: 16px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.hero-stat {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 4px;
  font-weight: 500;
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #111;
}

.hero-progress {
  margin-top: 20px;
}

.progress-label {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
  font-weight: 600;
  opacity: 0.7;
}

.progress-percent {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
}

.weight-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.weight-insights {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.insight-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.insight-icon {
  font-size: 24px;
}

.insight-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.insight-text strong {
  font-size: 15px;
  color: #eaeaea;
}

.insight-text span {
  font-size: 12px;
  color: #9a9a9a;
}

/* =========================
   HISTORIAL
   ========================= */

.history-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: linear-gradient(180deg, #1a1d26, #161821);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.stat-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
}

.stat-card strong {
  display: block;
  font-size: 24px;
  color: #e6d3a3;
  margin-bottom: 4px;
}

.stat-card span {
  font-size: 12px;
  color: #9a9a9a;
}

/* =========================
   MENÚ INFERIOR
   ========================= */

.widget-menu {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 420px;
  width: 100%;
  background: rgba(26, 29, 38, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  padding: 12px 16px 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 999;
}

.widget-menu .widget {
  background: transparent;
  box-shadow: none;
  padding: 8px 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.5;
}

.widget-menu .widget:hover {
  opacity: 0.8;
}

.widget-menu .widget.active,
.widget-menu .widget[style*="opacity: 1"] {
  opacity: 1;
  background: rgba(230, 211, 163, 0.1);
}

.widget-icon {
  font-size: 24px;
}

.widget-menu .widget-label {
  font-size: 11px;
  color: #9a9a9a;
  margin: 0;
}

/* 🆕 FASE 1: con la nueva pestaña Planning, el menú pasa de 5 a 6 ítems.
   Reducimos un poco el padding horizontal en pantallas estrechas para que no se apriete. */
@media (max-width: 380px) {
  .widget-menu { padding: 12px 6px 20px 6px; }
  .widget-menu .widget { padding: 8px 6px; }
  .widget-icon { font-size: 21px; }
  .widget-menu .widget-label { font-size: 9.5px; }
}

/* =========================
   MODALES
   ========================= */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 2000;
  padding: 20px;
  overflow-y: auto;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: linear-gradient(180deg, #1a1d26, #161821);
  border-radius: 24px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  margin: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: modalSlideIn 0.3s ease;
}

.modal-content.large {
  max-width: 500px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #e6d3a3;
  font-size: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-actions button {
  flex: 1;
}

/* =========================
   INPUT MODE TOGGLE
   ========================= */

.input-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.02);
  padding: 4px;
  border-radius: 12px;
}

.mode-btn {
  padding: 10px;
  border: none;
  background: transparent;
  color: #9a9a9a;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: #e6d3a3;
  color: #111;
  font-weight: 600;
}

.input-mode {
  display: none;
}

.input-mode.active {
  display: block;
}

.calculated-total {
  text-align: center;
  color: #9a9a9a;
  font-size: 14px;
  margin-top: 12px;
}

.calculated-total strong {
  color: #e6d3a3;
  font-size: 18px;
}

/* =========================
   TOAST
   ========================= */

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #e6d3a3;
  color: #111;
  padding: 14px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(230, 211, 163, 0.5);
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 320px;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: #ff6b6b;
  color: white;
}

.toast.success {
  background: #51cf66;
  color: white;
}

/* =========================
   ONBOARDING
   ========================= */

.onboarding-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 5000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.onboarding-overlay.active {
  display: flex;
}

.onboarding-content {
  background: linear-gradient(180deg, #1a1d26, #161821);
  border-radius: 32px;
  padding: 40px 32px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  animation: modalSlideIn 0.4s ease;
}

.onboarding-icon {
  font-size: 80px;
  margin-bottom: 20px;
}

.onboarding-content h2 {
  color: #e6d3a3;
  margin: 0 0 16px 0;
  font-size: 24px;
}

.onboarding-content p {
  color: #9a9a9a;
  line-height: 1.6;
  margin: 0 0 32px 0;
  font-size: 15px;
}

.onboarding-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.onboarding-step {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.onboarding-step.active {
  width: 24px;
  border-radius: 4px;
  background: #e6d3a3;
}

.onboarding-actions {
  display: flex;
  gap: 12px;
}

.onboarding-btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 16px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-btn.skip {
  background: transparent;
  color: #9a9a9a;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.onboarding-btn.skip:hover {
  background: rgba(255, 255, 255, 0.05);
}

.onboarding-btn.next {
  background: #e6d3a3;
  color: #111;
}

.onboarding-btn.next:hover {
  background: #f0e0b5;
}

/* =========================
   RUTINAS
   ========================= */

.routines-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.routine-card {
  background: linear-gradient(180deg, #1a1d26, #161821);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
}

.routine-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.routine-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.routine-card-header strong {
  font-size: 16px;
  color: #eaeaea;
}

.routine-card-actions {
  display: flex;
  gap: 8px;
}

.routine-card-actions button {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.routine-card-info {
  font-size: 13px;
  color: #9a9a9a;
  margin-bottom: 12px;
}

.active-routine-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* 🆕 FASE 4 CAMBIO 3: cronómetro único de la sesión de rutina */
.session-timer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(230, 211, 163, 0.08);
  border: 1px solid rgba(230, 211, 163, 0.18);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.session-timer-label {
  font-size: 13px;
  color: #d8d8d8;
}
.session-timer-card strong {
  font-size: 20px;
  font-weight: 700;
  color: #e6d3a3;
  font-variant-numeric: tabular-nums;
}

.routine-progress {
  background: rgba(230, 211, 163, 0.05);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
  color: #9a9a9a;
}

/* =========================
   TODAY SUMMARY
   ========================= */

.today-summary {
  text-align: center;
  background: rgba(230, 211, 163, 0.05);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #9a9a9a;
}

.today-summary strong {
  color: #e6d3a3;
  font-size: 18px;
}

/* =========================
   DASHBOARD ACTIONS
   ========================= */

.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* =========================
   RESPONSIVO
   ========================= */

@media (max-width: 380px) {
  .app {
    padding: 12px;
  }

  .header {
    margin-bottom: 16px;
  }

  .logo {
    width: 48px;
    height: 48px;
  }

  .brand-text h1 {
    font-size: 18px;
  }

  .widget strong {
    font-size: 20px;
  }

  .dashboard-actions {
    grid-template-columns: 1fr;
  }
}

/* =========================
   ✅ PERFIL ESTILO INSTAGRAM
   ========================= */

.profile-header {
  display: flex;
  gap: 16px;
  padding: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
  background: linear-gradient(180deg, #1a1d26, #161821);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.profile-avatar-container {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid #e6d3a3;
  object-fit: cover;
  background: rgba(230, 211, 163, 0.1);
  transition: all 0.2s ease;
}

.profile-avatar-container:hover .profile-avatar {
  transform: scale(1.05);
  filter: brightness(0.8);
}

.avatar-edit-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #e6d3a3, #f0e0b5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(230, 211, 163, 0.4);
}

.profile-info {
  flex: 1;
}

.profile-name {
  margin: 0 0 4px 0;
  font-size: 24px;
  color: #eaeaea;
  font-weight: 700;
}

.profile-bio {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #9a9a9a;
  line-height: 1.4;
}

.profile-info .secondary-small {
  width: 100%;
  margin-top: 8px;
}

/* Stats Grid - Estilo Instagram */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.profile-stat {
  background: linear-gradient(180deg, #1a1d26, #161821);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
}

.profile-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.profile-stat strong {
  display: block;
  font-size: 24px;
  color: #e6d3a3;
  margin-bottom: 4px;
}

.profile-stat span {
  display: block;
  font-size: 12px;
  color: #9a9a9a;
  font-weight: 500;
}

/* Datos físicos Grid */
.profile-data-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.profile-data-item {
  background: rgba(230, 211, 163, 0.05);
  border: 1px solid rgba(230, 211, 163, 0.2);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.data-label {
  display: block;
  font-size: 12px;
  color: #9a9a9a;
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-data-item strong {
  display: block;
  font-size: 20px;
  color: #e6d3a3;
  font-weight: 700;
}

/* Tema claro - Perfil */
body.light-theme .profile-header,
body.light-theme .profile-stat {
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

body.light-theme .profile-avatar {
  border-color: #d4a574;
  background: rgba(212, 165, 116, 0.1);
}

body.light-theme .profile-name {
  color: #111111;
}

body.light-theme .profile-stat strong {
  color: #d4a574;
}

body.light-theme .profile-data-item {
  background: rgba(212, 165, 116, 0.1);
  border-color: rgba(212, 165, 116, 0.3);
}

body.light-theme .profile-data-item strong {
  color: #d4a574;
}

/* =========================
   ✅ TEMA CLARO COMPLETO
   ========================= */

body.light-theme {
  background: #f5f3ef;
  color: #1a1a1a;
}

body.light-theme .background {
  background: linear-gradient(180deg, #f5f3ef, #efece5);
}
body.light-theme .bg-arc,
body.light-theme .bg-corner,
body.light-theme .bg-logo {
  display: none; /* el fondo decorativo dorado es exclusivo del tema oscuro original */
}

body.light-theme .card,
body.light-theme .widget,
body.light-theme .exercise-card,
body.light-theme .mode-card,
body.light-theme .stat-card,
body.light-theme .routine-card,
body.light-theme .streak-stat-card,
body.light-theme .modal-content {
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  color: #1a1a1a;
}

body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme .brand-text h1 {
  color: #1a1a1a;
}

body.light-theme .brand-text span,
body.light-theme .widget-label,
body.light-theme .stat-card span,
body.light-theme .stat-label,
body.light-theme .section-title,
body.light-theme .hero-date,
body.light-theme .insight-text span,
body.light-theme .today-summary,
body.light-theme .exercise-card-info,
body.light-theme .calendar-header strong,
body.light-theme .streak-stat-card span,
body.light-theme .widget-menu .widget-label {
  color: #6b6b6b;
}

body.light-theme .widget strong,
body.light-theme .stat-card strong,
body.light-theme .streak-stat-card strong,
body.light-theme .modal-content h3,
body.light-theme .today-summary strong,
body.light-theme .exercise-card-header strong,
body.light-theme .routine-card-header strong,
body.light-theme .insight-text strong {
  color: #c9a45e;
}

body.light-theme input,
body.light-theme select,
body.light-theme textarea {
  background: #f0ede5;
  color: #1a1a1a;
}

body.light-theme input::placeholder {
  color: #999;
}

body.light-theme .secondary {
  background: #ebe7dd;
  color: #1a1a1a;
}

body.light-theme .secondary:hover {
  background: #ddd6c5;
}

body.light-theme .secondary-small {
  background: #ebe7dd;
  color: #1a1a1a;
}

body.light-theme .primary {
  background: #c9a45e;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(201, 164, 94, 0.3);
}

body.light-theme .primary:hover {
  background: #b8924a;
}

body.light-theme .widget-menu {
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

body.light-theme .calendar-day {
  background: rgba(0, 0, 0, 0.03);
  color: #6b6b6b;
}

body.light-theme .calendar-day:hover {
  background: rgba(0, 0, 0, 0.06);
}

body.light-theme .calendar-day.today {
  background: rgba(201, 164, 94, 0.2);
  color: #c9a45e;
  border-color: #c9a45e;
}

body.light-theme .back-button {
  background: rgba(255, 255, 255, 0.95);
  color: #c9a45e;
}

body.light-theme .bar {
  background: rgba(0, 0, 0, 0.06);
}

body.light-theme .muscle-badge {
  background: rgba(201, 164, 94, 0.15);
  color: #b8924a;
}

body.light-theme .mode-card.active {
  border-color: #c9a45e;
  background: rgba(201, 164, 94, 0.08);
}

body.light-theme .mode-card.active .mode-label {
  color: #c9a45e;
}

body.light-theme .modal {
  background: rgba(0, 0, 0, 0.4);
}

body.light-theme .progress-label,
body.light-theme .progress-percent {
  color: #1a1a1a;
}

body.light-theme .history-stats .stat-card strong {
  color: #c9a45e;
}

body.light-theme hr {
  border-color: rgba(0,0,0,0.1);
}

/* =========================
   ✅ EJERCICIOS PERSONALIZADOS - Header con botón +
   ========================= */
.custom-exercises-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 8px 0;
}

.add-custom-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e6d3a3;
  color: #1a1a1a;
  border: none;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(230, 211, 163, 0.3);
  transition: transform 0.15s ease;
}
.add-custom-btn:hover { transform: scale(1.08); }

body.light-theme .add-custom-btn {
  background: #c9a45e;
  color: #fff;
}

/* =========================
   ✅ RUTINA ACTIVA - Diseño limpio y visual
   ========================= */
.active-routine-exercise {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border-radius: 18px;
  padding: 18px 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(230, 211, 163, 0.08);
  transition: all 0.25s ease;
}
.active-routine-exercise.complete {
  border-color: rgba(81, 207, 102, 0.5);
  background: linear-gradient(180deg, rgba(81, 207, 102, 0.08), rgba(81, 207, 102, 0.02));
}

.ex-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.ex-title-block strong {
  font-size: 17px;
  color: #e6d3a3;
  display: block;
  margin-bottom: 4px;
}
.ex-target-mini {
  font-size: 12px;
  color: #9a9a9a;
}

.ex-progress-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: conic-gradient(#e6d3a3 var(--p, 0%), rgba(255,255,255,0.08) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.ex-progress-ring::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #1a1c24;
}
.ex-progress-ring span {
  position: relative;
  font-size: 12px;
  font-weight: 700;
  color: #e6d3a3;
}
.ex-progress-ring.done {
  background: #51cf66;
}
.ex-progress-ring.done span { color: #fff; }

.ex-counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px 0;
  padding: 10px 4px;
  background: rgba(0,0,0,0.15);
  border-radius: 14px;
}
.counter-decr, .counter-incr {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(230, 211, 163, 0.12);
  color: #e6d3a3;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.counter-incr {
  background: #e6d3a3;
  color: #1a1a1a;
}
.counter-decr:hover { background: rgba(230, 211, 163, 0.2); }
.counter-incr:hover { background: #f0dcaa; }

.ex-counter-display {
  flex: 1;
  text-align: center;
}
.ex-counter-display strong {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  display: inline-block;
}
.ex-counter-display span {
  font-size: 14px;
  color: #9a9a9a;
  margin-left: 4px;
}

.ex-quick-add {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.ex-quick-add button {
  flex: 1;
  padding: 8px 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(230, 211, 163, 0.15);
  border-radius: 10px;
  color: #d4c08f;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ex-quick-add button:hover {
  background: rgba(230, 211, 163, 0.15);
}

.ex-sets-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px dashed rgba(255,255,255,0.06);
}
.set-chips {
  display: flex;
  gap: 6px;
}
.set-chip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(230, 211, 163, 0.3);
  transition: all 0.2s ease;
}
.set-chip.filled {
  background: #51cf66;
  border-color: #51cf66;
}
.ex-sets-label {
  font-size: 12px;
  color: #9a9a9a;
}

/* Tema claro - rutina activa */
body.light-theme .active-routine-exercise {
  background: #ffffff;
  border-color: rgba(0,0,0,0.06);
}
body.light-theme .ex-progress-ring::before { background: #ffffff; }
body.light-theme .ex-counter-display strong { color: #1a1a1a; }
body.light-theme .ex-counter-row { background: #f5f3ef; }
body.light-theme .counter-decr { background: rgba(201, 164, 94, 0.15); color: #c9a45e; }
body.light-theme .counter-incr { background: #c9a45e; color: #fff; }
body.light-theme .ex-quick-add button { background: #f0ede5; color: #6b6b6b; border-color: rgba(0,0,0,0.05); }

/* =========================
   ✅ WORKOUT HEADER COMPACTO
   ========================= */
.workout-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 14px 0;
}
.today-pill {
  background: rgba(230, 211, 163, 0.12);
  border: 1px solid rgba(230, 211, 163, 0.2);
  color: #e6d3a3;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}
.today-pill strong { color: #fff; margin-right: 2px; }
body.light-theme .today-pill {
  background: rgba(201, 164, 94, 0.12);
  color: #b8924a;
  border-color: rgba(201, 164, 94, 0.25);
}
body.light-theme .today-pill strong { color: #1a1a1a; }

.routine-create-btn {
  margin-bottom: 16px;
  width: 100%;
}

/* =========================
   ✅ FIX OVERLAP BOTTOM NAV
   ========================= */
.app {
  padding-bottom: 140px !important;
}
.screen {
  padding-bottom: 24px;
}

/* =========================
   ✅ ANIMACIÓN CELEBRACIÓN AL COMPLETAR RUTINA
   ========================= */
.routine-celebration {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.routine-celebration.show { opacity: 1; pointer-events: all; }

.celebration-burst {
  text-align: center;
  transform: scale(0.5);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.routine-celebration.show .celebration-burst { transform: scale(1); }

.celebration-emoji {
  font-size: 96px;
  animation: bounce-celebrate 0.6s ease-in-out infinite alternate;
  margin-bottom: 12px;
}
@keyframes bounce-celebrate {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-12px) scale(1.1); }
}

.celebration-burst h2 {
  font-size: 26px;
  color: #e6d3a3;
  margin: 0 0 8px 0;
  font-weight: 700;
  text-shadow: 0 4px 20px rgba(230, 211, 163, 0.4);
}
.celebration-burst p {
  color: #fff;
  opacity: 0.85;
  margin: 0;
  font-size: 15px;
}

.confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.confetti {
  position: absolute;
  top: -20px;
  left: calc(((var(--i) * 37) % 100) * 1%);
  width: 10px;
  height: 14px;
  background: var(--c);
  border-radius: 2px;
  animation: confetti-fall 2.2s ease-in forwards;
  animation-delay: calc(var(--i) * 0.04s);
  transform: rotate(0deg);
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0.3; }
}

/* Tema claro - celebración */
body.light-theme .routine-celebration { background: rgba(0,0,0,0.55); }
body.light-theme .celebration-burst h2 { color: #ffd97a; }

/* =========================
   ✅ MODAL CONFIRM CUSTOM
   ========================= */
.confirm-modal-content {
  max-width: 340px;
  text-align: center;
  padding: 28px 22px !important;
}
.confirm-icon {
  font-size: 56px;
  margin-bottom: 8px;
  display: inline-block;
  animation: confirm-pulse 1.2s ease-in-out infinite;
}
@keyframes confirm-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.confirm-modal-content h3 {
  margin: 0 0 10px 0;
  color: #fff;
  font-size: 20px;
}
.confirm-message {
  color: #b0b0b0;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 18px 0;
}
body.light-theme .confirm-modal-content h3 { color: #1a1a1a; }
body.light-theme .confirm-message { color: #6b6b6b; }

/* Modal active (slide-in animation) */
.modal.active {
  display: flex !important;
}
.modal .modal-content {
  animation: modal-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modal-slide-up {
  from { transform: translateY(40px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* =========================
   ✅ SUB-TABS INDIVIDUAL (Básicos / Personalizados)
   ========================= */
.sub-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(230, 211, 163, 0.08);
}
.sub-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: #9a9a9a;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sub-tab.active {
  background: rgba(230, 211, 163, 0.15);
  color: #e6d3a3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.sub-tab:hover:not(.active) {
  color: #d4c08f;
}
.sub-tab-content {
  display: none;
  animation: tab-fade-in 0.3s ease;
}
.sub-tab-content.active {
  display: block;
}
@keyframes tab-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tema claro - sub tabs */
body.light-theme .sub-tabs {
  background: #f0ede5;
  border-color: rgba(0, 0, 0, 0.06);
}
body.light-theme .sub-tab { color: #6b6b6b; }
body.light-theme .sub-tab.active {
  background: #fff;
  color: #c9a45e;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* =========================
   ✅ MEJORAS ESTÉTICAS GLOBALES
   ========================= */

.weight-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.weight-actions button { margin: 0; }

/* Card hover micro-interaction */
.card, .exercise-card, .routine-card, .mode-card, .stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.exercise-card:active, .routine-card:active, .mode-card:active {
  transform: scale(0.98);
}

/* Mejores radios */
.card, .modal-content { border-radius: 20px !important; }
.exercise-card, .routine-card, .stat-card, .widget { border-radius: 16px !important; }


/* =========================
   ✅ ICON BUTTONS SVG (estilo dorado consistente)
   ========================= */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(230, 211, 163, 0.08);
  border: 1px solid rgba(230, 211, 163, 0.15);
  color: #e6d3a3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: rgba(230, 211, 163, 0.18);
  border-color: rgba(230, 211, 163, 0.3);
  transform: scale(1.05);
}
.icon-btn:active { transform: scale(0.95); }

.icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
}

.icon-btn-danger {
  color: #ff8787;
  background: rgba(255, 135, 135, 0.06);
  border-color: rgba(255, 135, 135, 0.15);
}
.icon-btn-danger:hover {
  background: rgba(255, 135, 135, 0.16);
  border-color: rgba(255, 135, 135, 0.3);
  color: #ff6b6b;
}

/* Tema claro - icon buttons */
body.light-theme .icon-btn {
  background: rgba(201, 164, 94, 0.1);
  border-color: rgba(201, 164, 94, 0.2);
  color: #b8924a;
}
body.light-theme .icon-btn:hover {
  background: rgba(201, 164, 94, 0.2);
}
body.light-theme .icon-btn-danger {
  color: #d65555;
  background: rgba(214, 85, 85, 0.08);
  border-color: rgba(214, 85, 85, 0.2);
}

/* Routine actions container */
.routine-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}


/* =========================
   ✅ LOGROS / ACHIEVEMENTS
   ========================= */
.achievements-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.achievement {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(230, 211, 163, 0.08);
  transition: all 0.2s ease;
}
.achievement.unlocked {
  background: linear-gradient(135deg, rgba(230, 211, 163, 0.12), rgba(230, 211, 163, 0.04));
  border-color: rgba(230, 211, 163, 0.4);
  box-shadow: 0 2px 12px rgba(230, 211, 163, 0.08);
}
.achievement.locked {
  opacity: 0.5;
  filter: grayscale(60%);
}
.achievement-icon {
  font-size: 26px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  flex-shrink: 0;
}
.achievement.unlocked .achievement-icon {
  background: rgba(230, 211, 163, 0.18);
}
.achievement-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.achievement-info strong {
  font-size: 13px;
  color: #e6d3a3;
  font-weight: 600;
}
.achievement.locked .achievement-info strong { color: #888; }
.achievement-info span {
  font-size: 11px;
  color: #9a9a9a;
}

/* =========================
   ✅ ÚLTIMOS 7 DÍAS - WEEK DOTS
   ========================= */
.week-dots {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 2px;
}
.week-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  padding: 8px 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.week-dot.trained {
  background: linear-gradient(180deg, rgba(81, 207, 102, 0.18), rgba(81, 207, 102, 0.06));
  border: 1px solid rgba(81, 207, 102, 0.3);
}
.week-dot.today {
  outline: 2px solid #e6d3a3;
  outline-offset: -1px;
}
.week-dot-day {
  font-size: 11px;
  color: #9a9a9a;
  font-weight: 600;
}
.week-dot-circle {
  font-size: 18px;
  line-height: 1;
}
.week-dot.trained .week-dot-circle { font-size: 20px; }
.week-dot:not(.trained) .week-dot-circle { color: #555; }
.week-dot-date {
  font-size: 13px;
  color: #fff;
  font-weight: 700;
}
.week-dot:not(.trained) .week-dot-date { color: #888; }

/* Tema claro - logros + week dots */
body.light-theme .achievement {
  background: #faf7f0;
  border-color: rgba(0, 0, 0, 0.05);
}
body.light-theme .achievement.unlocked {
  background: linear-gradient(135deg, #fff7e0, #fff);
  border-color: rgba(201, 164, 94, 0.4);
}
body.light-theme .achievement-info strong { color: #b8924a; }
body.light-theme .achievement-info span { color: #6b6b6b; }
body.light-theme .week-dot { background: #f5f3ef; }
body.light-theme .week-dot-day { color: #6b6b6b; }
body.light-theme .week-dot-date { color: #1a1a1a; }

/* =========================
   ✅ REST TIMER MODAL
   ========================= */
.rest-timer-content {
  text-align: center;
  max-width: 340px;
  padding: 24px 20px !important;
}
.rest-timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.rest-timer-header h3 {
  margin: 0;
  font-size: 18px;
  color: #e6d3a3;
}

.rest-timer-ring-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 20px 0;
}
.rest-timer-ring {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(#e6d3a3 var(--p, 100%), rgba(255, 255, 255, 0.08) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.4s linear;
}
.rest-timer-ring::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #1a1c24;
}
.rest-timer-ring strong {
  position: relative;
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
body.light-theme .rest-timer-ring::before { background: #fff; }
body.light-theme .rest-timer-ring strong { color: #1a1a1a; }

.rest-timer-quick {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.rest-timer-quick button {
  padding: 12px 8px;
  background: rgba(230, 211, 163, 0.08);
  border: 1px solid rgba(230, 211, 163, 0.18);
  border-radius: 12px;
  color: #e6d3a3;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.rest-timer-quick button:hover { background: rgba(230, 211, 163, 0.18); }
#restTimerPauseBtn {
  background: #e6d3a3;
  color: #1a1a1a;
}

.rest-timer-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.rest-timer-presets button {
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: #d4c08f;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.rest-timer-presets button:hover { background: rgba(230, 211, 163, 0.1); }

/* Botón descanso en ex-quick-add */
.ex-quick-add .ex-rest-btn {
  background: rgba(77, 171, 247, 0.1);
  border-color: rgba(77, 171, 247, 0.3);
  color: #74c0fc;
}
.ex-quick-add .ex-rest-btn:hover {
  background: rgba(77, 171, 247, 0.2);
}

/* Light theme rest timer */
body.light-theme .rest-timer-quick button {
  background: #f0ede5;
  border-color: rgba(0,0,0,0.06);
  color: #b8924a;
}
body.light-theme .rest-timer-presets button {
  background: #faf7f0;
  border-color: rgba(0,0,0,0.05);
  color: #6b6b6b;
}
body.light-theme #restTimerPauseBtn {
  background: #c9a45e;
  color: #fff;
}
body.light-theme .ex-quick-add .ex-rest-btn {
  background: rgba(77, 171, 247, 0.12);
  border-color: rgba(77, 171, 247, 0.35);
  color: #228be6;
}

/* Llama animada más grande en streak page */
.streak-flame-big {
  font-size: 96px;
  filter: drop-shadow(0 4px 20px rgba(230, 100, 0, 0.35));
  animation: flame-pulse 2s ease-in-out infinite;
}
@keyframes flame-pulse {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.08) rotate(2deg); }
}


/* =========================
   ✅ WRAPPED BANNER (Dashboard)
   ========================= */
.wrapped-banner {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 22px 20px;
  margin: 0 0 14px 0;
  cursor: pointer;
  background: linear-gradient(135deg, #fa709a, #fee140);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(250, 112, 154, 0.3);
}
.wrapped-banner:active { transform: scale(0.98); }
.wrapped-banner:hover { box-shadow: 0 12px 28px rgba(250, 112, 154, 0.4); }

.wrapped-banner-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.25), transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.15), transparent 35%);
  pointer-events: none;
}

.wrapped-banner-content {
  position: relative;
  color: #fff;
}
.wrapped-banner-pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.wrapped-banner h3 {
  margin: 4px 0;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}
.wrapped-banner p {
  margin: 4px 0 12px 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  line-height: 1.4;
}
.wrapped-banner-cta {
  display: inline-block;
  background: #fff;
  color: #1a1a1a;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

/* =========================
   ✅ WRAPPED OVERLAY (Spotify-style stories)
   ========================= */
.wrapped-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #000;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
}
.wrapped-overlay.active {
  display: flex;
  opacity: 1;
}

.wrapped-progress {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 3;
}
.wrapped-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}
.wrapped-progress-fill {
  height: 100%;
  background: #fff;
  width: 0%;
  border-radius: 2px;
}

.wrapped-close {
  position: absolute;
  top: 28px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: none;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wrapped-close:active { transform: scale(0.92); }

.wrapped-period-toggle {
  position: absolute;
  top: 28px;
  left: 16px;
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 3px;
  z-index: 4;
}
.wrapped-period-toggle button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.wrapped-period-toggle button.active {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.wrapped-tap-left,
.wrapped-tap-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  z-index: 2;
  cursor: pointer;
}
.wrapped-tap-left { left: 0; }
.wrapped-tap-right { right: 0; }

.wrapped-story {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #000;
  transition: background 0.5s ease;
}

.wrapped-content {
  text-align: center;
  padding: 80px 32px 40px 32px;
  max-width: 480px;
  width: 100%;
  color: #fff;
  animation: wrapped-zoom-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wrapped-zoom-in {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.wrapped-icon {
  font-size: 64px;
  margin-bottom: 16px;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.3));
  animation: wrapped-icon-bounce 1.5s ease-in-out infinite alternate;
}
@keyframes wrapped-icon-bounce {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-8px) scale(1.05); }
}

.wrapped-title {
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.9;
  margin-bottom: 20px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.wrapped-big-number {
  font-size: 96px;
  font-weight: 900;
  line-height: 1;
  margin: 16px 0;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}

.wrapped-big-text {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.1;
  margin: 16px 0;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.wrapped-sub {
  font-size: 16px;
  opacity: 0.95;
  margin-top: 12px;
  line-height: 1.4;
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.wrapped-share-btn {
  margin-top: 28px;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  border: none;
  padding: 14px 32px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}
.wrapped-share-btn:active { transform: scale(0.96); }


/* =========================
   ✅ HISTORIAL - Registros con cards modernas
   ========================= */
.history-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(230, 211, 163, 0.08);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.2s ease;
}
.history-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: rgba(230, 211, 163, 0.6);
  border-radius: 2px 0 0 2px;
}
.history-item.history-kind-individual::before { background: #51cf66; }
.history-item.history-kind-routine::before { background: #4dabf7; }
.history-item.history-kind-routine-completed::before { background: #51cf66; }
.history-item.history-kind-weight::before { background: #e6d3a3; }
.history-item.history-kind-food::before { background: #ffa94d; }

.history-item:active { transform: scale(0.99); }
.history-item:hover { border-color: rgba(230, 211, 163, 0.18); }

.history-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(230, 211, 163, 0.08);
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
}
.history-item.history-kind-individual .history-icon { background: rgba(81, 207, 102, 0.12); }
.history-item.history-kind-routine .history-icon,
.history-item.history-kind-routine-completed .history-icon { background: rgba(77, 171, 247, 0.12); }
.history-item.history-kind-weight .history-icon { background: rgba(230, 211, 163, 0.14); }

.history-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.history-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1px;
}
.history-date {
  font-size: 11px;
  color: #9a9a9a;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.history-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(81, 207, 102, 0.18);
  color: #51cf66;
  letter-spacing: 0.3px;
}

.history-value {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  word-break: break-word;
}
.history-details {
  font-size: 12px;
  color: #b0b0b0;
  line-height: 1.4;
  margin-top: 2px;
}

.history-actions {
  display: flex;
  flex-direction: row;
  gap: 6px;
  flex-shrink: 0;
  align-items: flex-start;
}
.history-actions .icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.history-actions .icon-btn svg { width: 14px; height: 14px; }

/* Tema claro */
body.light-theme .history-item {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
body.light-theme .history-value { color: #1a1a1a; }
body.light-theme .history-details { color: #6b6b6b; }
body.light-theme .history-date { color: #999; }
body.light-theme .history-icon { background: rgba(201, 164, 94, 0.1); }


/* =========================
   ✅ BÚSQUEDA EJERCICIOS
   ========================= */
.exercise-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(230, 211, 163, 0.12);
  border-radius: 14px;
  padding: 8px 12px;
  margin-bottom: 14px;
  transition: border-color 0.2s ease;
}
.exercise-search-bar:focus-within {
  border-color: rgba(230, 211, 163, 0.4);
  background: rgba(255, 255, 255, 0.06);
}
.exercise-search-icon {
  font-size: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}
.exercise-search-bar input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none;
  color: #fff;
  font-size: 14px;
  padding: 6px 0 !important;
  margin: 0 !important;
}
.exercise-search-bar input::placeholder { color: #888; }
.exercise-search-clear {
  background: rgba(230, 211, 163, 0.15);
  border: none;
  color: #e6d3a3;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
body.light-theme .exercise-search-bar { background: #f5f3ef; border-color: rgba(0,0,0,0.06); }
body.light-theme .exercise-search-bar input { color: #1a1a1a; }
body.light-theme .exercise-search-bar input::placeholder { color: #999; }
body.light-theme .exercise-search-clear { background: rgba(201,164,94,0.2); color: #b8924a; }

.empty-search {
  text-align: center;
  color: #888;
  padding: 32px 16px;
  font-size: 14px;
}

/* =========================
   ✅ MUSCLE GROUP ACCORDION
   ========================= */
.muscle-group-section {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(230, 211, 163, 0.08);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.muscle-group-section.expanded {
  border-color: rgba(230, 211, 163, 0.22);
}

.muscle-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 14px;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s ease;
}
.muscle-group-header:hover { background: rgba(230, 211, 163, 0.04); }
.muscle-group-header:active { background: rgba(230, 211, 163, 0.08); }

.mg-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 30px;
  text-align: center;
}
.mg-label {
  font-size: 15px;
  font-weight: 600;
  color: #e6d3a3;
  flex: 1;
}
.mg-count {
  font-size: 11px;
  background: rgba(230, 211, 163, 0.15);
  color: #e6d3a3;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.mg-total {
  font-size: 12px;
  color: #9a9a9a;
  font-weight: 500;
}
.mg-caret {
  color: #e6d3a3;
  font-size: 12px;
  width: 16px;
  text-align: center;
}

.muscle-group-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.muscle-group-section.expanded .muscle-group-body {
  max-height: 4000px;
  padding-bottom: 8px;
}

/* Filas de ejercicio dentro del grupo */
.exercise-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.exercise-row:first-child { border-top: 1px solid rgba(230, 211, 163, 0.1); }

.exercise-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.exercise-row-info strong {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
}
.exercise-row-info span {
  font-size: 11px;
  color: #888;
}

.exercise-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.exercise-row-add {
  width: 36px !important;
  height: 36px;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 20px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  flex-shrink: 0;
  line-height: 1;
}

/* Tema claro acordeón */
body.light-theme .muscle-group-section {
  background: #ffffff;
  border-color: rgba(0,0,0,0.05);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
body.light-theme .muscle-group-section.expanded { border-color: rgba(201,164,94,0.3); }
body.light-theme .mg-label { color: #1a1a1a; }
body.light-theme .mg-count { background: rgba(201,164,94,0.15); color: #b8924a; }
body.light-theme .exercise-row { border-top-color: rgba(0,0,0,0.05); }
body.light-theme .exercise-row-info strong { color: #1a1a1a; }
body.light-theme .exercise-row-info span { color: #6b6b6b; }


/* =========================
   ✅ ROW DE PESO EN RUTINA ACTIVA
   ========================= */
.ex-weight-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(230, 211, 163, 0.05);
  border: 1px solid rgba(230, 211, 163, 0.1);
  border-radius: 12px;
}
.ex-weight-label {
  font-size: 13px;
  font-weight: 600;
  color: #e6d3a3;
  flex-shrink: 0;
}
.ex-weight-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.2) !important;
  border: 1px solid rgba(230, 211, 163, 0.18) !important;
  border-radius: 8px !important;
  color: #fff !important;
  padding: 6px 10px !important;
  font-size: 16px !important;
  font-weight: 600;
  margin: 0 !important;
  width: 80px;
  max-width: 100px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ex-weight-input:focus {
  outline: none;
  border-color: rgba(230, 211, 163, 0.5) !important;
}
.ex-weight-unit {
  font-size: 13px;
  color: #9a9a9a;
  font-weight: 500;
}
.ex-best-mini {
  font-size: 11px;
  color: #888;
  margin-left: auto;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}
.pr-badge {
  margin-left: auto;
  background: linear-gradient(135deg, #fee140, #fa709a);
  color: #1a1a1a;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(250, 112, 154, 0.4);
  animation: pr-glow 1.5s ease-in-out infinite alternate;
  letter-spacing: 0.5px;
}
@keyframes pr-glow {
  from { box-shadow: 0 2px 8px rgba(250, 112, 154, 0.4); }
  to { box-shadow: 0 4px 16px rgba(250, 112, 154, 0.7); }
}

/* Tema claro */
body.light-theme .ex-weight-row {
  background: #faf7f0;
  border-color: rgba(0, 0, 0, 0.06);
}
body.light-theme .ex-weight-label { color: #b8924a; }
body.light-theme .ex-weight-input {
  background: #fff !important;
  border-color: rgba(0,0,0,0.08) !important;
  color: #1a1a1a !important;
}
body.light-theme .ex-best-mini { background: rgba(0,0,0,0.04); color: #6b6b6b; }


/* =========================
   ✅ WRAPPED BANNER - estados de desbloqueo
   ========================= */

/* Banner BLOQUEADO */
.wrapped-banner.wrapped-locked {
  background: linear-gradient(135deg, #2a2d3a, #1c1f29);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  cursor: default;
}
.wrapped-banner.wrapped-locked .wrapped-banner-bg {
  background:
    radial-gradient(circle at 80% 20%, rgba(230, 211, 163, 0.06), transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(230, 211, 163, 0.04), transparent 35%);
}
.wrapped-banner.wrapped-locked h3 { color: #d4c08f; }
.wrapped-banner.wrapped-locked p {
  color: #9a9a9a;
  margin-top: 10px;
}
.wrapped-pill-locked {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e6d3a3 !important;
}
.wrapped-countdown {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 10px 0 6px 0;
}
.wrapped-countdown strong {
  font-size: 38px;
  font-weight: 800;
  color: #e6d3a3;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(230, 211, 163, 0.25);
}
.wrapped-countdown span {
  font-size: 14px;
  color: #b0b0b0;
  font-weight: 500;
}
.wrapped-lock-extra {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #888;
  line-height: 1.4;
}

/* Banner ANUAL (31 dic) - gradient especial dorado-rojo */
.wrapped-banner.wrapped-annual {
  background: linear-gradient(135deg, #f5a623, #f76b1c, #e6d3a3);
  box-shadow: 0 8px 32px rgba(247, 107, 28, 0.4);
  animation: annual-glow 2s ease-in-out infinite alternate;
}
@keyframes annual-glow {
  from { box-shadow: 0 8px 32px rgba(247, 107, 28, 0.4); }
  to   { box-shadow: 0 12px 40px rgba(247, 107, 28, 0.65); }
}
.wrapped-pill-gold {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #d97706 !important;
  font-weight: 800 !important;
}

/* Light theme - locked */
body.light-theme .wrapped-banner.wrapped-locked {
  background: linear-gradient(135deg, #f5f3ef, #ebe7dd);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
body.light-theme .wrapped-banner.wrapped-locked h3 { color: #1a1a1a; }
body.light-theme .wrapped-banner.wrapped-locked p { color: #6b6b6b; }
body.light-theme .wrapped-countdown strong { color: #c9a45e; }
body.light-theme .wrapped-countdown span { color: #6b6b6b; }
body.light-theme .wrapped-lock-extra { border-top-color: rgba(0,0,0,0.08); color: #888; }
body.light-theme .wrapped-pill-locked { background: rgba(201,164,94,0.15) !important; color: #b8924a !important; }


/* =========================
   ✅ HISTORIAL COMPACTO Y EXPANDIBLE
   ========================= */
.history-item {
  padding: 0 !important;
  overflow: hidden;
}
.history-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: default;
  transition: background 0.15s ease;
}
.history-item.has-expandable .history-row-main {
  cursor: pointer;
}
.history-item.has-expandable .history-row-main:hover {
  background: rgba(255, 255, 255, 0.025);
}

.history-icon {
  width: 32px;
  height: 32px;
  font-size: 16px;
  border-radius: 8px;
  flex-shrink: 0;
}

.history-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.history-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.history-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-date {
  font-size: 11px;
  color: #888;
  letter-spacing: 0.3px;
}
.history-badge {
  font-size: 10px;
  font-weight: 800;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #51cf66;
  color: #fff;
  text-transform: none;
  flex-shrink: 0;
  padding: 0;
  letter-spacing: 0;
}

.history-actions { gap: 4px; }
.history-actions .icon-btn { width: 28px; height: 28px; }
.history-actions .icon-btn svg { width: 13px; height: 13px; }

.history-caret {
  color: #e6d3a3;
  font-size: 14px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.history-item.expanded .history-caret { transform: rotate(90deg); }

/* Contenido expandible */
.history-expand-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 14px;
}
.history-item.expanded .history-expand-content {
  max-height: 1000px;
  padding: 8px 14px 14px 14px;
  border-top: 1px dashed rgba(230, 211, 163, 0.12);
  margin-top: 0;
}

.history-expand-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  padding-top: 12px;
}
.he-stat {
  text-align: center;
  padding: 10px 8px;
  background: rgba(230, 211, 163, 0.06);
  border: 1px solid rgba(230, 211, 163, 0.1);
  border-radius: 10px;
}
.he-stat strong {
  display: block;
  font-size: 18px;
  color: #e6d3a3;
  font-weight: 700;
  line-height: 1.1;
}
.he-stat span {
  display: block;
  font-size: 10px;
  color: #9a9a9a;
  margin-top: 2px;
  letter-spacing: 0.2px;
}

.history-expand-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.history-expand-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}
.history-expand-list li span {
  color: #d0d0d0;
}
.history-expand-list li strong {
  color: #e6d3a3;
  font-weight: 600;
  font-size: 12px;
}

/* Tema claro */
body.light-theme .history-title { color: #1a1a1a; }
body.light-theme .history-item.has-expandable .history-row-main:hover { background: rgba(0,0,0,0.025); }
body.light-theme .he-stat { background: #faf7f0; border-color: rgba(0,0,0,0.05); }
body.light-theme .he-stat strong { color: #b8924a; }
body.light-theme .history-expand-list li { background: #f5f3ef; }
body.light-theme .history-expand-list li strong { color: #b8924a; }
body.light-theme .history-expand-list li span { color: #1a1a1a; }
body.light-theme .history-item.expanded .history-expand-content { border-top-color: rgba(0,0,0,0.08); }


/* =========================
   ✅ FONDO PREMIUM CON IMAGEN (dark)
   Sólo aplica en modo oscuro - light theme conserva su fondo claro
   ========================= */
body:not(.light-theme) {
  background-color: #0d1018;
  background-image:
    linear-gradient(180deg, rgba(13,16,24,0.65) 0%, rgba(13,16,24,0.55) 50%, rgba(13,16,24,0.75) 100%),
    url('Images/bg.jpg');
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body:not(.light-theme) .background {
  background: transparent !important;
}

/* ✅ Cards más sólidas para que el contenido prime sobre el fondo decorativo */
body:not(.light-theme) .card,
body:not(.light-theme) .widget,
body:not(.light-theme) .exercise-card,
body:not(.light-theme) .mode-card,
body:not(.light-theme) .stat-card,
body:not(.light-theme) .streak-stat-card,
body:not(.light-theme) .modal-content,
body:not(.light-theme) .muscle-group-section,
body:not(.light-theme) .active-routine-exercise,
body:not(.light-theme) .history-item,
body:not(.light-theme) .achievement,
body:not(.light-theme) .week-dot {
  background-color: rgba(20, 23, 32, 0.88) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Bottom nav un poco más sólida también */
body:not(.light-theme) .widget-menu {
  background-color: rgba(15, 17, 25, 0.92) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* =========================
   ✅ HEADER REBALANCEADO - LOGO MÁS GRANDE
   ========================= */
.header {
  padding-top: 14px;
  padding-bottom: 14px;
}
.logo {
  width: 72px !important;
  height: 72px !important;
  border-radius: 16px !important;
  padding: 6px !important;
  background: rgba(230, 211, 163, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(230, 211, 163, 0.12);
}

.brand { gap: 14px !important; }
.brand-text h1 {
  font-size: 22px !important;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.3px;
}
.brand-text span {
  font-size: 11.5px !important;
  margin-top: 4px !important;
  opacity: 0.85;
}

/* Header-streak y theme-toggle un pelín más pequeños para que no compitan con el logo */
.header-streak {
  padding: 6px 10px !important;
  font-size: 14px !important;
}
.theme-toggle {
  width: 38px !important;
  height: 38px !important;
}

/* Light theme - aún sin imagen pero con cards sólidas iguales */
body.light-theme .card,
body.light-theme .widget,
body.light-theme .modal-content {
  backdrop-filter: blur(8px);
}


/* =========================
   ✅ ROUTINE CARDS - Diseño limpio sin sobrecarga amarilla
   ========================= */
.routine-card {
  --routine-accent: #e6d3a3;
  background: rgba(20, 23, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--routine-accent);
  border-radius: 14px !important;
  padding: 14px 16px !important;
  margin-bottom: 12px;
  transition: transform 0.15s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}
.routine-card:active { transform: scale(0.99); }
.routine-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  border-left-color: var(--routine-accent);
}

/* TOP: Badge inicial + título + acciones */
.routine-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.routine-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(230, 211, 163, 0.1);
  border: 1px solid rgba(230, 211, 163, 0.3);
  font-size: 19px;
  font-weight: 800;
  font-family: 'Segoe UI', system-ui, sans-serif;
  letter-spacing: -1px;
  flex-shrink: 0;
}

.routine-card-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.routine-card-title strong {
  font-size: 16px;
  font-weight: 700;
  color: #f0f0f0;
  line-height: 1.2;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.routine-card-title .routine-description {
  font-size: 12px;
  color: #9a9a9a;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.routine-card .routine-actions {
  gap: 4px;
  flex-shrink: 0;
}
.routine-card .routine-actions .icon-btn {
  width: 32px;
  height: 32px;
}

/* STATS: en línea con separador */
.routine-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 10px;
}
.routine-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.routine-stat strong {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.routine-stat span {
  font-size: 11px;
  color: #888;
  letter-spacing: 0.2px;
}
.routine-stat-divider {
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.08);
}

/* Botón "Comenzar rutina" - estilo ghost/outline con acento */
.routine-start-btn {
  width: 100%;
  background: transparent;
  border: 1.5px solid var(--routine-accent, #e6d3a3);
  color: var(--routine-accent, #e6d3a3);
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.18s ease;
  margin: 0;
}
.routine-start-btn:hover {
  background: var(--routine-accent, #e6d3a3);
  color: #0d1018;
}
.routine-start-btn:active { transform: scale(0.98); }

/* Botón "+ Crear rutina" - estilo secundario, ya no amarillo */
.routine-create-btn {
  background: rgba(230, 211, 163, 0.06) !important;
  border: 1px dashed rgba(230, 211, 163, 0.35) !important;
  color: #e6d3a3 !important;
  font-weight: 600 !important;
}
.routine-create-btn:hover {
  background: rgba(230, 211, 163, 0.12) !important;
  border-style: solid !important;
}

/* Tema claro */
body.light-theme .routine-card {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
body.light-theme .routine-card-title strong { color: #1a1a1a; }
body.light-theme .routine-stats { background: #faf7f0; }
body.light-theme .routine-stat strong { color: #1a1a1a; }
body.light-theme .routine-stat-divider { background: rgba(0,0,0,0.08); }
body.light-theme .routine-start-btn:hover { color: #fff; }
body.light-theme .routine-create-btn {
  background: #faf7f0 !important;
  border-color: rgba(201, 164, 94, 0.4) !important;
  color: #b8924a !important;
}


/* =========================
   ✅ CENTRO DE SUGERENCIAS
   ========================= */
.suggestions-modal-content {
  max-width: 400px;
  padding: 24px 22px !important;
}
.suggestions-header {
  text-align: center;
  margin-bottom: 18px;
}
.suggestions-header h3 {
  margin: 0 0 6px 0;
  font-size: 20px;
  color: #e6d3a3;
}
.suggestions-subtitle {
  margin: 0;
  color: #9a9a9a;
  font-size: 13px;
  line-height: 1.4;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.sg-chip {
  flex: 1;
  min-width: 0;
  background: rgba(230, 211, 163, 0.06);
  border: 1px solid rgba(230, 211, 163, 0.2);
  color: #d4c08f;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.sg-chip:hover { background: rgba(230, 211, 163, 0.12); }
.sg-chip.active {
  background: #e6d3a3;
  color: #1a1a1a;
  border-color: #e6d3a3;
}

.suggestion-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(230, 211, 163, 0.18) !important;
  border-radius: 12px !important;
  color: #fff !important;
  padding: 12px 14px !important;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
  max-height: 280px;
  margin: 0 !important;
  font-family: inherit;
  transition: border-color 0.2s ease;
}
.suggestion-textarea:focus {
  outline: none;
  border-color: rgba(230, 211, 163, 0.45) !important;
}
.suggestion-textarea::placeholder { color: #777; }

.suggestion-counter {
  text-align: right;
  font-size: 11px;
  color: #888;
  margin-top: 4px;
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}

#sendSuggestionBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Tema claro */
body.light-theme .suggestions-header h3 { color: #b8924a; }
body.light-theme .suggestions-subtitle { color: #6b6b6b; }
body.light-theme .sg-chip {
  background: #faf7f0;
  border-color: rgba(201, 164, 94, 0.3);
  color: #b8924a;
}
body.light-theme .sg-chip.active {
  background: #c9a45e;
  color: #fff;
  border-color: #c9a45e;
}
body.light-theme .suggestion-textarea {
  background: #fff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #1a1a1a !important;
}
body.light-theme .suggestion-textarea::placeholder { color: #999; }


/* =========================
   ✅ MODAL SELECT EJERCICIO (rutinas)
   ========================= */
#selectExerciseModal .modal-content {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#selectExerciseModal h3 { flex-shrink: 0; }
#selectExerciseModal .modal-actions { flex-shrink: 0; }

/* Scroll interno de la lista */
#selectExerciseModal #basicExerciseSelectList,
#selectExerciseModal #customExerciseSelectList {
  overflow-y: auto;
  max-height: 35vh;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(230,211,163,0.3) transparent;
}
#selectExerciseModal #basicExerciseSelectList::-webkit-scrollbar,
#selectExerciseModal #customExerciseSelectList::-webkit-scrollbar { width: 5px; }
#selectExerciseModal #basicExerciseSelectList::-webkit-scrollbar-thumb,
#selectExerciseModal #customExerciseSelectList::-webkit-scrollbar-thumb {
  background: rgba(230,211,163,0.3);
  border-radius: 3px;
}

.exercise-select-grid {
  display: grid;
  gap: 4px;
}

.select-group-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px 6px 4px;
  font-size: 12px;
  font-weight: 700;
  color: #e6d3a3;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(230, 211, 163, 0.15);
  margin-top: 6px;
}
.select-group-heading:first-child { margin-top: 0; }
.select-group-heading span { font-size: 16px; }

.exercise-select-item {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(230, 211, 163, 0.12) !important;
  color: #f0f0f0 !important;
  padding: 11px 14px !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  text-align: left !important;
  cursor: pointer;
  margin: 0 !important;
  transition: all 0.15s ease;
  font-weight: 500;
}
.exercise-select-item:hover {
  background: rgba(230, 211, 163, 0.1) !important;
  border-color: rgba(230, 211, 163, 0.3) !important;
}
.exercise-select-item:active {
  background: rgba(230, 211, 163, 0.18) !important;
  transform: scale(0.99);
}

/* Tema claro */
body.light-theme .select-group-heading {
  color: #b8924a;
  border-bottom-color: rgba(201, 164, 94, 0.2);
}
body.light-theme .exercise-select-item {
  background: #faf7f0 !important;
  border-color: rgba(0,0,0,0.06) !important;
  color: #1a1a1a !important;
}
body.light-theme .exercise-select-item:hover {
  background: #f0ede5 !important;
  border-color: rgba(201, 164, 94, 0.3) !important;
}


/* =========================
   ✅ MODAL SELECT EJERCICIO - Acordeón por grupo
   ========================= */
.select-group {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(230, 211, 163, 0.1);
  border-radius: 10px;
  margin-bottom: 6px;
  overflow: hidden;
}
.select-group.expanded { border-color: rgba(230, 211, 163, 0.25); }

.select-group-toggle {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-height: 48px;
  background: transparent;
  border: none;
  color: #e6d3a3;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}
.select-group-toggle:hover { background: rgba(230, 211, 163, 0.06); }

/* ✅ Fix iOS Safari: flex no funciona dentro de <button>.
   Por eso aplicamos flex al span interno. */
.sg-toggle-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  box-sizing: border-box;
}

.select-group-toggle .sg-ico {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  text-align: center;
}
.select-group-toggle .sg-lab {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: #e6d3a3;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.select-group-toggle .sg-num {
  background: rgba(230, 211, 163, 0.15);
  color: #e6d3a3;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  flex-shrink: 0;
  line-height: 1;
}
.select-group-toggle .sg-caret {
  color: #e6d3a3;
  font-size: 11px;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.select-group-items {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 4px 8px 10px 8px;
  border-top: 1px dashed rgba(230, 211, 163, 0.12);
}
.select-group.expanded .select-group-items { display: flex; }

.select-empty {
  text-align: center;
  color: #888;
  padding: 16px 12px;
  font-size: 12px;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

/* Tema claro */
body.light-theme .select-group { background: #faf7f0; border-color: rgba(0,0,0,0.05); }
body.light-theme .select-group.expanded { border-color: rgba(201, 164, 94, 0.3); }
body.light-theme .select-group-toggle .sg-lab { color: #1a1a1a; }
body.light-theme .select-group-toggle .sg-num { background: rgba(201, 164, 94, 0.15); color: #b8924a; }
body.light-theme .select-group-toggle .sg-caret { color: #b8924a; }
body.light-theme .select-group-items { border-top-color: rgba(0,0,0,0.08); }
body.light-theme .select-empty { background: #fff; }



/* =========================
   ✅ ROUTINE BUILDER (ejercicios añadidos en modal "Crear rutina")
   ========================= */
#routineExercisesBuilder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.routine-builder-empty {
  text-align: center;
  color: #888;
  padding: 18px 12px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin: 0;
}

.routine-exercise-item {
  --rb-accent: #e6d3a3;
  background: rgba(28, 31, 41, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid var(--rb-accent);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.routine-exercise-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rb-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.rb-name-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rb-name {
  color: #f4f1ea;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rb-meta {
  font-size: 11.5px;
  color: #9a9a9a;
  letter-spacing: 0.2px;
}

.rb-remove {
  width: 32px;
  height: 32px;
}
.rb-remove svg { width: 15px; height: 15px; }

.routine-exercise-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.routine-exercise-inputs .input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.routine-exercise-inputs .input-group label {
  font-size: 11px;
  color: #9a9a9a;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  margin: 0;
}

.routine-exercise-inputs .input-group input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #f4f1ea;
  padding: 9px 12px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.routine-exercise-inputs .input-group input:focus {
  outline: none;
  border-color: var(--rb-accent, #e6d3a3);
  background: rgba(230, 211, 163, 0.06);
}

/* Tema claro */
body.light-theme .routine-exercise-item {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
body.light-theme .rb-name { color: #1a1a1a; }
body.light-theme .rb-meta { color: #6b6b6b; }
body.light-theme .routine-builder-empty {
  background: #faf7f0;
  border-color: rgba(0, 0, 0, 0.08);
  color: #6b6b6b;
}
body.light-theme .routine-exercise-inputs .input-group label { color: #6b6b6b; }
body.light-theme .routine-exercise-inputs .input-group input {
  background: #faf7f0;
  border-color: rgba(0, 0, 0, 0.08);
  color: #1a1a1a;
}
body.light-theme .routine-exercise-inputs .input-group input:focus {
  background: #fff8e7;
  border-color: #c9a45e;
}

/* =========================
   ✅ FIX: Modal scroll cuando el contenido es más alto que la pantalla
   (evita que el botón "Crear rutina" quede inalcanzable)
   ========================= */
#createRoutineModal {
  align-items: flex-start;
  padding: 24px 16px;
}
#createRoutineModal .modal-content.large {
  margin: auto;
  max-height: none;
}
#createRoutineModal .modal-actions {
  position: sticky;
  bottom: -24px;
  margin: 20px -24px -24px;
  padding: 14px 24px 20px;
  background: linear-gradient(180deg, rgba(22,24,33,0) 0%, rgba(22,24,33,0.96) 35%);
  z-index: 2;
  backdrop-filter: blur(6px);
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

body.light-theme #createRoutineModal .modal-actions {
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.96) 35%);
}

/* En pantallas pequeñas, layout vertical para inputs */
@media (max-width: 380px) {
  .routine-exercise-inputs { grid-template-columns: 1fr 1fr; gap: 8px; }
  .rb-name { font-size: 14px; }
}

/* =========================
   🆕 FASE 1: PLANNING SEMANAL
   ========================= */

.planning-subtitle {
  color: #9a9a9a;
  font-size: 13px;
  margin: 0 0 16px;
  line-height: 1.4;
}

.accent-text {
  color: #e6d3a3;
}

/* Fila horizontal de los 7 días, con scroll (fiel a la maqueta) */
.planning-week-scroll-wrap {
  margin-bottom: 24px;
}

.planning-week-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.planning-week-scroll::-webkit-scrollbar { display: none; }

.planning-day-chip {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 108px;
  background: rgba(20, 23, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.planning-day-chip:active { transform: scale(0.97); }

.planning-day-chip.is-today {
  border: 2px solid #e6d3a3;
  background: rgba(230, 211, 163, 0.07);
}

.planning-day-chip.drag-over {
  border-color: #e6d3a3;
  background: rgba(230, 211, 163, 0.16);
}

.planning-day-chip-name {
  font-size: 13px;
  font-weight: 700;
  color: #d8d8d8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.planning-day-chip-num {
  font-size: 11px;
  font-weight: 500;
  color: #9a9a9a;
}
.planning-day-chip.is-today .planning-day-chip-num {
  color: #e6d3a3;
}

.planning-day-chip-icon {
  font-size: 28px;
  line-height: 1.2;
  margin: 2px 0;
}

.planning-day-chip-routine {
  font-size: 13px;
  font-weight: 600;
  color: #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.planning-day-chip-count {
  font-size: 11px;
  color: #9a9a9a;
}

/* Barra indicadora de progreso del scroll horizontal */
.planning-week-scroll-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}
.planning-week-scroll-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #e6d3a3;
  border-radius: 999px;
  transition: left 0.05s linear;
}

/* Sección "Rutinas disponibles" */
.planning-routines-section {
  margin-bottom: 20px;
}

.planning-routines-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.planning-routines-header h3 {
  margin: 0;
  font-size: 16px;
}

.planning-routines-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.planning-search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 7px 12px;
}
.planning-search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: #f0f0f0;
  font-size: 13px;
  width: 120px;
}
.planning-search-icon {
  font-size: 13px;
  opacity: 0.7;
}

.planning-add-routine-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e6c878;
  color: #1a1a1f;
  border: none;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.planning-add-routine-btn:active { transform: scale(0.93); }

.planning-routines-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.planning-routine-card {
  background: rgba(20, 23, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px;
  cursor: grab;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}
.planning-routine-card:active { cursor: grabbing; }
.planning-routine-card.dragging {
  opacity: 0.4;
  border-color: #e6d3a3;
}

.planning-routine-card-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

.planning-routine-card-name {
  font-size: 14px;
  color: #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-routine-card-count,
.planning-routine-card-duration {
  font-size: 11px;
  color: #9a9a9a;
}

.planning-routine-card-grip {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #555;
  font-size: 12px;
  letter-spacing: -2px;
  transform: rotate(90deg);
}

.planning-drag-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9a9a9a;
  margin: 10px 0 0;
}

/* Fila inferior: Consejo Count + Racha */
.planning-bottom-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.planning-tip-card {
  background: rgba(20, 23, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.planning-tip-icon { font-size: 18px; flex-shrink: 0; }
.planning-tip-card strong {
  display: block;
  color: #e6d3a3;
  font-size: 13px;
  margin-bottom: 4px;
}
.planning-tip-card p {
  margin: 0;
  font-size: 12px;
  color: #b8b8b8;
  line-height: 1.4;
}

.planning-streak-card {
  background: rgba(20, 23, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.planning-streak-label {
  font-size: 11px;
  color: #9a9a9a;
}
.planning-streak-card strong {
  font-size: 16px;
  color: #f0f0f0;
}
.planning-streak-spark {
  width: 100%;
  height: 28px;
  margin-top: 2px;
}

/* Selección activa en modal de asignar rutina */
.exercise-select-item.selected {
  background: rgba(230, 211, 163, 0.18) !important;
  border-color: rgba(230, 211, 163, 0.4) !important;
}

/* Tarjeta HOY (dashboard de Inicio) */
.today-plan-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: visible; /* 🆕 FASE 3: el esqueleto no debe recortarse */
}

.today-plan-empty-text {
  color: #9a9a9a;
  font-size: 13px;
  margin: 4px 0 0;
  line-height: 1.4;
}

.today-plan-card .primary,
.today-plan-card .secondary {
  width: 100%;
}

/* === Tema claro === */
body.light-theme .planning-subtitle { color: #6b6b6b; }

/* Selección activa en modal de asignar rutina */
.exercise-select-item.selected {
  background: rgba(230, 211, 163, 0.18) !important;
  border-color: rgba(230, 211, 163, 0.4) !important;
}

/* === Tema claro === */
body.light-theme .planning-subtitle { color: #6b6b6b; }
body.light-theme .planning-day-chip {
  background: #ffffff;
  border-color: rgba(0,0,0,0.06);
}
body.light-theme .planning-day-chip.is-today {
  background: rgba(201, 164, 94, 0.08);
  border-color: #c9a45e;
}
body.light-theme .planning-day-chip-name { color: #555; }
body.light-theme .planning-day-chip-routine { color: #1a1a1a; }
body.light-theme .planning-day-chip-count { color: #888; }
body.light-theme .planning-search-bar {
  background: #faf7f0;
  border-color: rgba(0,0,0,0.08);
}
body.light-theme .planning-search-bar input { color: #1a1a1a; }
body.light-theme .planning-routine-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.06);
}
body.light-theme .planning-routine-card-name { color: #1a1a1a; }
body.light-theme .planning-tip-card,
body.light-theme .planning-streak-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.06);
}
body.light-theme .planning-tip-card p { color: #555; }
body.light-theme .planning-streak-card strong { color: #1a1a1a; }
body.light-theme .today-plan-empty-text { color: #6b6b6b; }

/* Sin scroll horizontal: el grid de días siempre en columna */
@media (max-width: 380px) {
  .planning-day-body { flex-wrap: wrap; }
}

/* =========================
   🆕 FASE 2: PROGRESO — pestañas internas
   ========================= */

.progress-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(230, 211, 163, 0.08);
}

.progress-tab {
  flex: 1 1 auto;
  min-width: 30%;
  background: transparent;
  border: none;
  color: #9a9a9a;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.progress-tab.active {
  background: rgba(230, 211, 163, 0.15);
  color: #e6d3a3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.progress-tab-content {
  display: none;
}
.progress-tab-content.active {
  display: block;
  animation: fadeInTab 0.2s ease;
}

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

/* Ficha de ejercicio: cronología */
.exercise-timeline {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.exercise-timeline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
}
.exercise-timeline-row:last-child { border-bottom: none; }

.exercise-timeline-date {
  color: #9a9a9a;
}

.exercise-timeline-weight {
  color: #f0f0f0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#progressExercisePicker.exercise-select-grid {
  display: grid;
  gap: 6px;
}

/* =========================
   🆕 Rediseño de Progreso → Resumen
   ========================= */

.progress-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.progress-summary-card {
  position: relative;
  overflow: hidden;
}

.progress-summary-spark {
  width: 100%;
  height: 26px;
  margin-top: 6px;
}

.progress-summary-weekdots {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.progress-summary-daydot {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #666;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 5px 0;
}
.progress-summary-daydot.trained {
  background: rgba(230, 211, 163, 0.18);
  color: #e6d3a3;
}
.progress-summary-daydot.is-today {
  border: 1px solid #e6d3a3;
}

.progress-summary-medal {
  position: absolute;
  right: 14px;
  bottom: 14px;
  font-size: 30px;
  opacity: 0.18;
}

.monthly-glance-card {
  background: rgba(20, 23, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
  margin-top: 14px;
}
.monthly-glance-card h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #f0f0f0;
}

.monthly-glance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.monthly-glance-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}
.monthly-glance-icon { font-size: 16px; opacity: 0.7; }
.monthly-glance-item strong {
  font-size: 15px;
  color: #f0f0f0;
}
.monthly-glance-item span {
  font-size: 10px;
  color: #9a9a9a;
  line-height: 1.2;
}

/* 🆕 FASE 4 CAMBIO 6: frase contextual real bajo el vistazo mensual */
.monthly-glance-context {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  color: #d8d8d8;
  text-align: center;
  line-height: 1.4;
}
.monthly-glance-context:empty { display: none; }

@media (max-width: 360px) {
  .progress-summary-grid { grid-template-columns: 1fr; }
  .monthly-glance-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* === Tema claro === */
body.light-theme .progress-summary-daydot { background: rgba(0,0,0,0.04); color: #999; }
body.light-theme .progress-summary-daydot.trained { background: rgba(201, 164, 94, 0.18); color: #b8924a; }
body.light-theme .monthly-glance-card { background: #ffffff; border-color: rgba(0,0,0,0.06); }
body.light-theme .monthly-glance-card h4 { color: #1a1a1a; }
body.light-theme .monthly-glance-item strong { color: #1a1a1a; }

/* === Tema claro === */
body.light-theme .progress-tabs {
  background: #f0ede5;
  border-color: rgba(0, 0, 0, 0.06);
}
body.light-theme .progress-tab.active {
  background: rgba(201, 164, 94, 0.15);
  color: #b8924a;
}
body.light-theme .exercise-timeline-row {
  border-bottom-color: rgba(0,0,0,0.06);
}
body.light-theme .exercise-timeline-date { color: #6b6b6b; }
body.light-theme .exercise-timeline-weight { color: #1a1a1a; }

/* En pantallas muy estrechas, 5 pestañas en 2 filas sin scroll horizontal */
@media (max-width: 360px) {
  .progress-tab { min-width: 45%; font-size: 12px; padding: 9px 6px; }
}

/* =========================
   🆕 Resumen de rutina — diseño premium (rediseño fiel a referencia)
   ========================= */

#routineSummaryModal .modal-content {
  max-width: 420px;
}

.rs-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 18px;
}

.rs-hero-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 211, 163, 0.18), rgba(230, 211, 163, 0.04));
  border: 1.5px solid rgba(230, 211, 163, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 0 24px rgba(230, 211, 163, 0.15);
}
.rs-hero-check-svg {
  width: 36px;
  height: 36px;
}
.rs-hero-check-svg path {
  stroke: #e6d3a3;
}

.rs-hero h4 {
  margin: 0 0 4px;
  font-size: 19px;
  color: #f0f0f0;
}
.rs-hero p {
  margin: 0;
  font-size: 13px;
  color: #9a9a9a;
  line-height: 1.4;
  max-width: 280px;
}

.rs-routine-name {
  text-align: center;
  font-size: 13px;
  color: #9a9a9a;
  margin: 0 0 14px;
}

.rs-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.rs-stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(230, 211, 163, 0.1);
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}
.rs-stat-icon {
  font-size: 18px;
  margin-bottom: 4px;
}
.rs-stat-label {
  font-size: 11.5px;
  color: #9a9a9a;
}
.rs-stat strong {
  font-size: 22px;
  font-weight: 700;
  color: #f0f0f0;
  margin: 2px 0;
}
.rs-stat-unit {
  font-size: 10.5px;
  color: #7d7d7d;
}
.rs-stat-pr {
  border-color: rgba(230, 211, 163, 0.3);
  background: rgba(230, 211, 163, 0.06);
}
.rs-stat-pr strong { color: #e6d3a3; }

.rs-analysis-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(230, 211, 163, 0.06);
  border: 1px solid rgba(230, 211, 163, 0.15);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.rs-analysis-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.rs-analysis-card .routine-summary-line {
  margin: 0 0 4px;
  color: #e6d3a3;
}
.rs-analysis-card .routine-summary-line:last-child { margin-bottom: 0; }

.rs-highlights h5 {
  margin: 0 0 10px;
  font-size: 13px;
  color: #e6d3a3;
  display: flex;
  align-items: center;
  gap: 4px;
}

.rs-highlights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rs-highlight-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rs-highlight-item strong {
  font-size: 13px;
  color: #f0f0f0;
}
.rs-highlight-sets {
  font-size: 11px;
  color: #9a9a9a;
}
.rs-highlight-diff {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}
.rs-highlight-diff.is-positive { color: #6fcf73; }
.rs-highlight-diff.is-negative { color: #e8a05d; }

/* Reutilizado dentro de .rs-analysis-card */
.routine-summary-line {
  font-size: 13px;
  color: #d8d8d8;
  margin: 0 0 8px;
  line-height: 1.4;
}

/* === Tema claro === */
body.light-theme .rs-hero h4 { color: #1a1a1a; }
body.light-theme .rs-hero p { color: #666; }
body.light-theme .rs-routine-name { color: #666; }
body.light-theme .rs-stat {
  background: #faf7f0;
  border-color: rgba(0,0,0,0.06);
}
body.light-theme .rs-stat strong { color: #1a1a1a; }
body.light-theme .rs-stat-label { color: #777; }
body.light-theme .rs-analysis-card {
  background: rgba(201, 164, 94, 0.08);
  border-color: rgba(201, 164, 94, 0.25);
}
body.light-theme .rs-analysis-card .routine-summary-line { color: #8a6d2f; }
body.light-theme .rs-highlight-item {
  background: #faf7f0;
  border-color: rgba(0,0,0,0.06);
}
body.light-theme .rs-highlight-item strong { color: #1a1a1a; }

/* =========================
   🆕 FASE 3: MASCOTA — EL ESQUELETO ENTRENADOR
   ========================= */

.mascot-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mascot-bubble {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(230, 211, 163, 0.12);
  border-radius: 16px;
  padding: 14px 16px;
  position: relative;
}

.mascot-bubble::after {
  content: '';
  position: absolute;
  right: -7px;
  bottom: 22px;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.03);
  border-right: 1px solid rgba(230, 211, 163, 0.12);
  border-bottom: 1px solid rgba(230, 211, 163, 0.12);
  transform: rotate(-45deg);
}

/* 🆕 Versión sin personaje al lado: ancho completo, sin la cola del globo */
.mascot-bubble-standalone {
  width: 100%;
}
.mascot-bubble-standalone::after {
  display: none;
}

.mascot-bubble-title {
  display: block;
  color: #e6d3a3;
  font-size: 15px;
  margin-bottom: 4px;
}

.mascot-bubble p {
  margin: 0 0 6px;
  font-size: 13px;
  color: #d8d8d8;
  line-height: 1.4;
}
.mascot-bubble p:last-of-type { margin-bottom: 10px; }

.mascot-bubble button {
  width: 100%;
}

.mascot-figure {
  flex: 0 0 auto;
  width: 100px;
  align-self: flex-end;
  overflow: visible;
}
.mascot-figure svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

/* Versión pequeña, para usar dentro de modales (resumen, logros, avisos) */
.mascot-figure-sm {
  width: 56px;
  flex: 0 0 auto;
}
.mascot-figure-sm svg {
  width: 100%;
  height: auto;
  display: block;
}

.mascot-modal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.mascot-modal-row p {
  margin: 0;
  font-size: 14px;
  color: #f0f0f0;
  line-height: 1.4;
}

body.light-theme .mascot-bubble {
  background: #faf7f0;
  border-color: rgba(0,0,0,0.06);
}
body.light-theme .mascot-bubble::after {
  background: #faf7f0;
  border-color: rgba(0,0,0,0.06);
}
body.light-theme .mascot-bubble-title { color: #b8924a; }
body.light-theme .mascot-bubble p { color: #444; }

@media (max-width: 360px) {
  .mascot-figure { width: 76px; }
}

/* =========================
   🆕 FASE 3: Celebración de logro con el esqueleto
   ========================= */

.achievement-celebrate-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(230, 211, 163, 0.08);
  border: 1px solid rgba(230, 211, 163, 0.2);
  border-radius: 14px;
  padding: 14px 16px;
}

.achievement-celebrate-card strong {
  display: block;
  color: #e6d3a3;
  font-size: 16px;
  margin-bottom: 2px;
}

.achievement-celebrate-card span {
  color: #9a9a9a;
  font-size: 13px;
}

body.light-theme .achievement-celebrate-card {
  background: rgba(201, 164, 94, 0.1);
  border-color: rgba(201, 164, 94, 0.25);
}
body.light-theme .achievement-celebrate-card strong { color: #b8924a; }

body.light-theme .session-timer-card {
  background: rgba(201, 164, 94, 0.1);
  border-color: rgba(201, 164, 94, 0.25);
}
body.light-theme .session-timer-label { color: #555; }
body.light-theme .session-timer-card strong { color: #b8924a; }

body.light-theme .monthly-glance-context {
  border-top-color: rgba(0,0,0,0.06);
  color: #444;
}


/* =========================
   AUTENTICACIÓN (login / registro)
   Mismo lenguaje visual que .onboarding-overlay
   ========================= */

.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 6000; /* por encima del onboarding (5000) */
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-overlay.active {
  display: flex;
}

.auth-content {
  background: linear-gradient(180deg, #1a1d26, #161821);
  border-radius: 32px;
  padding: 40px 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  animation: modalSlideIn 0.4s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.auth-icon {
  font-size: 56px;
  margin-bottom: 12px;
}

.auth-content h2 {
  color: #e6d3a3;
  margin: 0 0 8px 0;
  font-size: 24px;
}

.auth-content p.auth-subtitle {
  color: #9a9a9a;
  line-height: 1.5;
  margin: 0 0 28px 0;
  font-size: 14px;
}

.auth-field {
  text-align: left;
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  color: #9a9a9a;
  font-size: 13px;
  margin-bottom: 6px;
  font-weight: 500;
}

.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.auth-field input:focus {
  border-color: #e6d3a3;
  background: rgba(255, 255, 255, 0.07);
}

.auth-field input::placeholder {
  color: #6b6b6b;
}

.auth-error {
  display: none;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: #ff6b6b;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
  line-height: 1.4;
}

.auth-error.active {
  display: block;
}

.auth-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 16px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.auth-btn.primary {
  background: #e6d3a3;
  color: #111;
}

.auth-btn.primary:hover {
  background: #f0e0b5;
}

.auth-btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-switch {
  margin-top: 20px;
  color: #9a9a9a;
  font-size: 14px;
}

.auth-switch a {
  color: #e6d3a3;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-forgot {
  display: block;
  text-align: right;
  margin-top: -8px;
  margin-bottom: 20px;
  color: #9a9a9a;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.auth-forgot:hover {
  color: #e6d3a3;
}

.auth-back {
  display: block;
  margin-top: 16px;
  color: #6b6b6b;
  font-size: 13px;
  cursor: pointer;
}

.auth-back:hover {
  color: #9a9a9a;
}

.auth-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(17,17,17,0.3);
  border-top-color: #111;
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

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

/* =========================
   PERFIL — REDISEÑO PREMIUM
   ========================= */

/* Header */
.profile-header {
  display: flex;
  gap: 16px;
  padding: 20px;
  align-items: flex-start;
  margin-bottom: 16px;
  background: rgba(20, 23, 32, 0.88);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}
.profile-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(230, 211, 163, 0.08);
  border: 1px solid rgba(230, 211, 163, 0.25);
  color: #e6d3a3;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-top: 10px;
}
.profile-edit-btn:hover { background: rgba(230, 211, 163, 0.15); }
.profile-edit-btn svg { stroke: #e6d3a3; }

/* 4 stats en fila */
.profile-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.profile-stat-item {
  background: rgba(20, 23, 32, 0.88);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(10px);
}
.profile-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(230, 211, 163, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.profile-stat-icon svg { stroke: #e6d3a3; }
.profile-stat-item strong {
  font-size: 18px;
  font-weight: 700;
  color: #e6d3a3;
  line-height: 1.1;
}
.profile-stat-item span {
  font-size: 10px;
  color: #9a9a9a;
  line-height: 1.2;
}

/* Card resumen */
.profile-summary-card {
  margin-bottom: 14px;
}
.profile-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.profile-summary-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #f0f0f0;
}
.profile-summary-title svg { stroke: #e6d3a3; }
.profile-summary-more {
  background: none;
  border: none;
  color: #e6d3a3;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.profile-summary-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.profile-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.profile-data-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(230, 211, 163, 0.1);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.data-label {
  display: block;
  font-size: 10px;
  color: #9a9a9a;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.profile-data-item strong {
  display: block;
  font-size: 18px;
  color: #e6d3a3;
  font-weight: 700;
}
.data-unit {
  display: block;
  font-size: 10px;
  color: #6b6b6b;
  margin-top: 1px;
}
.profile-stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.profile-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.profile-progress-label {
  font-size: 12px;
  color: #9a9a9a;
}
.profile-progress-pct {
  font-size: 12px;
  font-weight: 700;
  color: #e6d3a3;
}

/* Accesos rápidos */
.profile-quick-access {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.profile-quick-btn {
  background: rgba(20, 23, 32, 0.88);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  backdrop-filter: blur(10px);
}
.profile-quick-btn:hover { border-color: rgba(230,211,163,0.25); background: rgba(230,211,163,0.06); }
.profile-quick-btn svg { stroke: #e6d3a3; }
.profile-quick-btn span { font-size: 10px; color: #9a9a9a; text-align: center; line-height: 1.2; }

/* Zona de gestión */
.profile-zone-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #f0f0f0;
  margin: 0 0 10px 0;
}
.profile-zone-title svg { stroke: #e6d3a3; }
.profile-management-zone {
  background: rgba(20, 23, 32, 0.88);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 16px;
  backdrop-filter: blur(10px);
  margin-bottom: 20px;
}
.profile-mgmt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 14px 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
  text-align: left;
}
.profile-mgmt-row:last-child { border-bottom: none; padding-bottom: 0; }
.profile-mgmt-row:first-of-type { padding-top: 0; }
.profile-mgmt-row:hover { opacity: 0.8; }
.profile-mgmt-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-mgmt-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(230,211,163,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.profile-mgmt-icon--danger {
  background: rgba(255,107,107,0.08);
}
.profile-mgmt-icon--neutral {
  background: rgba(255,255,255,0.05);
}
.profile-mgmt-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.profile-mgmt-text strong {
  font-size: 14px;
  font-weight: 600;
  color: #f0f0f0;
}
.profile-mgmt-row--danger .profile-mgmt-text strong { color: #ff8787; }
.profile-mgmt-text span { font-size: 12px; color: #9a9a9a; }
.profile-mgmt-arrow { stroke: #9a9a9a; flex-shrink: 0; }
.profile-mgmt-arrow--danger { stroke: #ff8787; }

/* Tema claro */
body.light-theme .profile-header,
body.light-theme .profile-stat-item,
body.light-theme .profile-quick-btn,
body.light-theme .profile-management-zone {
  background: #ffffff;
  border-color: rgba(0,0,0,0.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
body.light-theme .profile-stat-item strong { color: #b8924a; }
body.light-theme .profile-stat-item span { color: #6b6b6b; }
body.light-theme .profile-stat-icon { background: rgba(201,164,94,0.1); }
body.light-theme .profile-stat-icon svg { stroke: #b8924a; }
body.light-theme .profile-edit-btn {
  background: rgba(201,164,94,0.1);
  border-color: rgba(201,164,94,0.3);
  color: #b8924a;
}
body.light-theme .profile-edit-btn svg { stroke: #b8924a; }
body.light-theme .profile-summary-title { color: #1a1a1a; }
body.light-theme .profile-data-item { background: #faf7f0; border-color: rgba(0,0,0,0.06); }
body.light-theme .profile-data-item strong { color: #b8924a; }
body.light-theme .profile-quick-btn span { color: #6b6b6b; }
body.light-theme .profile-quick-btn svg { stroke: #b8924a; }
body.light-theme .profile-zone-title { color: #1a1a1a; }
body.light-theme .profile-zone-title svg { stroke: #b8924a; }
body.light-theme .profile-mgmt-row { border-bottom-color: rgba(0,0,0,0.06); }
body.light-theme .profile-mgmt-text strong { color: #1a1a1a; }
body.light-theme .profile-mgmt-icon { background: rgba(201,164,94,0.1); }
body.light-theme .profile-mgmt-arrow { stroke: #999; }


/* =========================
   SUBPANTALLAS DEL PERFIL
   ========================= */

.profile-subscreen {
  display: none;
  position: fixed;
  inset: 0;
  background: #0d1018;
  z-index: 4000;
  flex-direction: column;
  animation: slideIn 0.25s ease;
  overflow: hidden;
}
.profile-subscreen.active {
  display: flex;
}
.profile-subscreen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(13,16,24,0.98);
  flex-shrink: 0;
}
.profile-subscreen-back {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.profile-subscreen-back svg { stroke: #e6d3a3; }
.profile-subscreen-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #f0f0f0;
}
.profile-subscreen-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 40px;
}

/* Subtitle */
.subscreen-subtitle {
  font-size: 13px;
  color: #9a9a9a;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* Settings rows */
.settings-group {
  margin-bottom: 20px;
}
.settings-group-title {
  font-size: 11px;
  font-weight: 700;
  color: #e6d3a3;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  padding: 0 4px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(20,23,32,0.88);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: opacity 0.15s ease;
  width: 100%;
  text-align: left;
}
.settings-row:hover { opacity: 0.85; }
.settings-row--danger .settings-row-text strong { color: #ff8787; }
.settings-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.settings-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(230,211,163,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-row-icon svg { stroke: #e6d3a3; }
.settings-row-icon--danger { background: rgba(255,107,107,0.08); }
.settings-row-icon--danger svg { stroke: #ff8787; }
.settings-row-text { display: flex; flex-direction: column; gap: 2px; }
.settings-row-text strong { font-size: 14px; color: #f0f0f0; font-weight: 600; }
.settings-row-text span { font-size: 12px; color: #9a9a9a; }

/* Settings toggle pill (tema) */
.settings-toggle-pill {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(230,211,163,0.15);
  border: 1px solid rgba(230,211,163,0.25);
  position: relative;
  flex-shrink: 0;
}
.settings-toggle-pill::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e6d3a3;
  top: 2px;
  left: 2px;
  transition: left 0.2s ease;
}
.settings-toggle-pill.on::after { left: 22px; }

/* Notification switches */
.notif-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.notif-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.notif-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 0.2s ease;
  cursor: pointer;
}
.notif-switch-track::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: left 0.2s ease;
}
.notif-switch input:checked + .notif-switch-track {
  background: #e6d3a3;
  border-color: #e6d3a3;
}
.notif-switch input:checked + .notif-switch-track::after { left: 22px; }
.notif-switch input:checked + .notif-switch-track::after { background: #111; }

.notif-time-input {
  background: rgba(230,211,163,0.08);
  border: 1px solid rgba(230,211,163,0.2);
  border-radius: 8px;
  color: #e6d3a3;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 10px;
  width: auto;
  margin: 0;
}

/* Security FAQ */
.security-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 24px 16px;
  background: rgba(230,211,163,0.04);
  border: 1px solid rgba(230,211,163,0.1);
  border-radius: 16px;
  margin-bottom: 20px;
}
.security-hero p {
  margin: 0;
  font-size: 14px;
  color: #d8d8d8;
  line-height: 1.5;
}
.faq-list { display: flex; flex-direction: column; gap: 6px; }
.faq-item {
  background: rgba(20,23,32,0.88);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
}
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  gap: 12px;
}
.faq-question span {
  font-size: 14px;
  font-weight: 600;
  color: #f0f0f0;
  flex: 1;
  line-height: 1.3;
}
.faq-caret { stroke: #9a9a9a; flex-shrink: 0; transition: transform 0.25s ease; }
.faq-item.open .faq-caret { transform: rotate(180deg); }
.faq-answer {
  display: none;
  padding: 0 16px 14px;
  font-size: 13px;
  color: #9a9a9a;
  line-height: 1.6;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 12px;
}
.faq-item.open .faq-answer { display: block; }

/* Mis datos */
.mydata-list {
  background: rgba(20,23,32,0.88);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}
.mydata-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  gap: 12px;
}
.mydata-row:last-child { border-bottom: none; }
.mydata-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #9a9a9a;
  font-weight: 500;
  flex-shrink: 0;
}
.mydata-label svg { stroke: #9a9a9a; }
.mydata-row span {
  font-size: 14px;
  color: #f0f0f0;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}
.mydata-edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: rgba(230,211,163,0.08);
  border: 1px solid rgba(230,211,163,0.2);
  border-radius: 14px;
  color: #e6d3a3;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.mydata-edit-btn svg { stroke: #e6d3a3; }
.mydata-edit-btn:hover { background: rgba(230,211,163,0.14); }

/* Iconos SVG en menú inferior */
.widget-icon svg { stroke: #e6d3a3; display: block; }
.widget-menu .widget { opacity: 0.5; }
.widget-menu .widget.active,
.widget-menu .widget[style*="opacity: 1"] {
  opacity: 1;
  background: rgba(230,211,163,0.1);
}

/* Header iconos SVG */
.streak-flame svg { stroke: #fff; }
.theme-icon svg { stroke: currentColor; }

/* Tema claro - subpantallas */
body.light-theme .profile-subscreen { background: #f5f3ef; }
body.light-theme .profile-subscreen-header {
  background: rgba(245,243,239,0.98);
  border-bottom-color: rgba(0,0,0,0.06);
}
body.light-theme .profile-subscreen-back { background: rgba(0,0,0,0.05); }
body.light-theme .profile-subscreen-back svg { stroke: #b8924a; }
body.light-theme .profile-subscreen-header h3 { color: #1a1a1a; }
body.light-theme .settings-row {
  background: #fff;
  border-color: rgba(0,0,0,0.06);
}
body.light-theme .settings-row-text strong { color: #1a1a1a; }
body.light-theme .settings-row-icon { background: rgba(201,164,94,0.1); }
body.light-theme .settings-row-icon svg { stroke: #b8924a; }
body.light-theme .faq-item { background: #fff; border-color: rgba(0,0,0,0.06); }
body.light-theme .faq-question span { color: #1a1a1a; }
body.light-theme .mydata-list { background: #fff; border-color: rgba(0,0,0,0.06); }
body.light-theme .mydata-row { border-bottom-color: rgba(0,0,0,0.05); }
body.light-theme .mydata-row span { color: #1a1a1a; }
body.light-theme .security-hero { background: rgba(201,164,94,0.06); border-color: rgba(201,164,94,0.15); }

/* Fix: ocultar botón "← Volver" global cuando hay subpantalla activa */
body:has(.profile-subscreen.active) #backButton {
  display: none !important;
}

/* SVG en iconos de interfaz general */
.widget-icon svg,
.card h3 svg,
.settings-row-icon svg,
.profile-mgmt-icon svg {
  display: inline-block;
  vertical-align: middle;
}

/* ===== SVG outline dorado en todos los iconos de interfaz ===== */
/* Cubre botones, cards, headers, modales, widgets en tema oscuro */
.card svg,
.widget svg,
.btn svg,
.secondary svg,
.primary svg,
.modal svg,
.profile-edit-btn svg,
.mydata-edit-btn svg,
.faq-question svg,
.security-hero svg,
.notif-time-row svg,
.settings-toggle-pill + * svg,
.subscreen-subtitle svg,
button svg:not(.profile-mgmt-arrow):not(.profile-mgmt-arrow--danger):not(.faq-caret) {
  stroke: #e6d3a3;
}

/* Tema claro: dorado oscuro */
body.light-theme .card svg,
body.light-theme .widget svg,
body.light-theme .btn svg,
body.light-theme .secondary svg,
body.light-theme .primary svg,
body.light-theme .modal svg,
body.light-theme .profile-edit-btn svg,
body.light-theme .mydata-edit-btn svg,
body.light-theme button svg:not(.profile-mgmt-arrow):not(.faq-caret) {
  stroke: #b8924a;
}


/* =========================
   MEJORAS UX/UI — Refinamiento visual
   ========================= */

/* 1. Widget Peso — estado vacío */
.widget-empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 4px;
}
.widget-empty-label {
  font-size: 13px;
  color: #9a9a9a;
  font-weight: 500;
}
.widget-empty-cta {
  font-size: 12px;
  color: #e6d3a3;
  font-weight: 600;
  opacity: 0.85;
}

/* 2. Frase motivacional progreso */
.widget-motivation {
  font-size: 11px;
  color: #9a9a9a;
  margin: 6px 0 0 0;
  font-style: italic;
  line-height: 1.4;
  opacity: 0.9;
}

/* 3. Calendario — punto PR dorado */
.calendar-day {
  position: relative;
}
.calendar-pr-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e6d3a3;
  display: block;
  pointer-events: none;
}

/* 4. Biblioteca — label historial */
.exercise-row-history {
  font-size: 11px;
  color: #9a9a9a;
  font-weight: 400;
}

/* 6. Planning — barra dorada inferior */
.planning-day-chip {
  position: relative;
  overflow: hidden;
}
.planning-day-chip-bar {
  display: block;
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, #e6d3a3, #c9a45e);
  opacity: 0.85;
}

/* Tema claro */
body.light-theme .widget-empty-label { color: #6b6b6b; }
body.light-theme .widget-empty-cta { color: #b8924a; }
body.light-theme .widget-motivation { color: #6b6b6b; }
body.light-theme .calendar-pr-dot { background: #b8924a; }
body.light-theme .exercise-row-history { color: #6b6b6b; }
body.light-theme .planning-day-chip-bar {
  background: linear-gradient(90deg, #b8924a, #c9a45e);
}


/* =========================
   MODAL AVISO RACHA EN RIESGO — diseño premium
   ========================= */

.streak-risk-modal {
  text-align: center;
  padding: 36px 28px 28px;
  background: linear-gradient(180deg, #1a1d26, #14161f);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

/* Líneas decorativas de fondo tipo la referencia */
.streak-risk-modal::before,
.streak-risk-modal::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(230, 211, 163, 0.12);
  pointer-events: none;
}
.streak-risk-modal::before {
  width: 300px; height: 300px;
  top: -120px; left: -80px;
}
.streak-risk-modal::after {
  width: 250px; height: 250px;
  bottom: -100px; right: -60px;
}

/* Icono circular dorado */
.streak-risk-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(230, 211, 163, 0.08);
  border: 1.5px solid rgba(230, 211, 163, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  position: relative;
  z-index: 1;
}

/* Títulos */
.streak-risk-title {
  font-size: 22px;
  font-weight: 800;
  color: #e6d3a3;
  margin: 0 0 6px;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.streak-risk-tagline {
  font-size: 15px;
  font-weight: 600;
  color: #c9c9c9;
  margin: 0;
  position: relative;
  z-index: 1;
}

/* Separador */
.streak-risk-divider {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e6d3a3, transparent);
  margin: 18px auto;
  border-radius: 1px;
  position: relative;
  z-index: 1;
}

/* Subtexto */
.streak-risk-sub {
  font-size: 14px;
  color: #9a9a9a;
  line-height: 1.6;
  margin: 0 0 24px;
  position: relative;
  z-index: 1;
}

/* Botones */
.streak-risk-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.streak-risk-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
}

.streak-risk-btn--primary {
  background: linear-gradient(135deg, #e6d3a3, #c9a45e);
  color: #111;
}
.streak-risk-btn--primary:hover { opacity: 0.9; }
.streak-risk-btn--primary svg { fill: #111; }

.streak-risk-btn--secondary {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #d0d0d0;
}
.streak-risk-btn--secondary:hover { background: rgba(255,255,255,0.1); }
.streak-risk-btn--secondary svg { stroke: #d0d0d0; }

/* Tema claro */
body.light-theme .streak-risk-modal {
  background: linear-gradient(180deg, #f5f3ef, #ede9e0);
}
body.light-theme .streak-risk-title { color: #b8924a; }
body.light-theme .streak-risk-sub { color: #6b6b6b; }
body.light-theme .streak-risk-btn--secondary {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.1);
  color: #444;
}


/* =========================
   PROGRESO — REDISEÑO PREMIUM
   ========================= */

/* Header */
.progress-header-premium {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-top: 4px;
}
.progress-header-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(230,211,163,0.08);
  border: 1px solid rgba(230,211,163,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.progress-header-title {
  font-size: 30px;
  font-weight: 800;
  color: #e6d3a3;
  margin: 0 0 2px;
  line-height: 1;
}
.progress-header-sub {
  font-size: 13px;
  color: #9a9a9a;
  margin: 0;
}

/* Tabs premium — una sola fila */
.progress-tabs-premium {
  display: flex;
  align-items: center;
  background: rgba(20,23,32,0.9);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 18px;
  padding: 8px 6px;
  margin-bottom: 20px;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.progress-tabs-premium::-webkit-scrollbar { display: none; }

.ptab-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.progress-tab-premium {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  padding: 8px 6px 10px;
  background: none;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.ptab-icon { display: flex; align-items: center; justify-content: center; }
.ptab-icon svg { stroke: #6b6b6b; transition: stroke 0.2s ease; }
.ptab-label {
  font-size: 11px;
  font-weight: 500;
  color: #6b6b6b;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.ptab-indicator {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  border-radius: 1px;
  background: #e6d3a3;
  transition: width 0.2s ease;
}

/* Estado activo */
.progress-tab-premium.active {
  background: rgba(230,211,163,0.07);
  border: 1px solid rgba(230,211,163,0.2);
}
.progress-tab-premium.active .ptab-icon svg { stroke: #e6d3a3; }
.progress-tab-premium.active .ptab-label { color: #e6d3a3; font-weight: 700; }
.progress-tab-premium.active .ptab-indicator { width: 24px; }

/* Cards de resumen premium */
.progress-summary-grid-premium {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.progress-summary-card-premium {
  display: flex;
  flex-direction: column;
  background: rgba(20,23,32,0.88);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.progress-summary-card-premium:hover {
  border-color: rgba(230,211,163,0.2);
  background: rgba(230,211,163,0.04);
}

.psc-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.psc-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(230,211,163,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.psc-text { display: flex; flex-direction: column; gap: 2px; }
.psc-title {
  font-size: 14px;
  font-weight: 700;
  color: #e6d3a3;
}
.psc-sub {
  font-size: 12px;
  color: #9a9a9a;
  margin: 0;
  line-height: 1.3;
}

/* Fila superior: icono+texto a la izq, valor+flecha a la der */
.progress-summary-card-premium > .psc-left,
.progress-summary-card-premium > .psc-right {
  /* flex row por defecto */
}

/* Redefinir layout para que psc-left y psc-right sean en fila */
.progress-summary-card-premium {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}
.progress-summary-card-premium > .psc-left { flex: 1; min-width: 0; }
.progress-summary-card-premium > .psc-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.psc-right strong {
  font-size: 22px;
  font-weight: 800;
  color: #f0f0f0;
  white-space: nowrap;
}
/* Barra de progreso ocupa todo el ancho */
.progress-summary-card-premium > .bar {
  width: 100%;
  margin-top: 10px;
}
/* Weekdots ocupa todo el ancho */
.progress-summary-card-premium > .progress-summary-weekdots {
  width: 100%;
  margin-top: 8px;
}

/* Tema claro */
body.light-theme .progress-header-icon {
  background: rgba(201,164,94,0.1);
  border-color: rgba(201,164,94,0.2);
}
body.light-theme .progress-header-title { color: #b8924a; }
body.light-theme .progress-header-sub { color: #6b6b6b; }
body.light-theme .progress-tabs-premium {
  background: #fff;
  border-color: rgba(0,0,0,0.06);
}
body.light-theme .ptab-divider { background: rgba(0,0,0,0.06); }
body.light-theme .ptab-icon svg { stroke: #aaa; }
body.light-theme .ptab-label { color: #aaa; }
body.light-theme .progress-tab-premium.active { background: rgba(201,164,94,0.08); border-color: rgba(201,164,94,0.25); }
body.light-theme .progress-tab-premium.active .ptab-icon svg { stroke: #b8924a; }
body.light-theme .progress-tab-premium.active .ptab-label { color: #b8924a; }
body.light-theme .progress-tab-premium.active .ptab-indicator { background: #b8924a; }
body.light-theme .progress-summary-card-premium {
  background: #fff;
  border-color: rgba(0,0,0,0.06);
}
body.light-theme .psc-icon { background: rgba(201,164,94,0.1); }
body.light-theme .psc-title { color: #b8924a; }


/* =========================
   TARJETA HOY — diseño premium
   ========================= */

.today-plan-card-premium {
  background: linear-gradient(145deg, #1a1d26, #14161f);
  border: 1px solid rgba(230,211,163,0.18);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(230,211,163,0.06);
}

.today-plan-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.today-plan-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(230,211,163,0.06);
  border: 1.5px solid rgba(230,211,163,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.today-plan-text { flex: 1; }

.today-plan-title {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: #e6d3a3;
  margin-bottom: 6px;
  line-height: 1.2;
}

.today-plan-body {
  font-size: 14px;
  color: #c0c0c0;
  line-height: 1.5;
}
.today-plan-body p { margin: 0 0 4px; }

.today-plan-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
  opacity: 0.5;
}

.today-plan-action .today-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.18s ease;
  gap: 8px;
  box-sizing: border-box;
}
.today-action-btn--primary {
  background: linear-gradient(135deg, #e6d3a3, #c9a45e);
  color: #111;
}
.today-action-btn--primary svg { stroke: #111; fill: #111; }
.today-action-btn--primary:hover { opacity: 0.9; }

/* Tema claro */
body.light-theme .today-plan-card-premium {
  background: linear-gradient(145deg, #fff, #f5f3ef);
  border-color: rgba(201,164,94,0.25);
}
body.light-theme .today-plan-title { color: #b8924a; }
body.light-theme .today-plan-body { color: #555; }
body.light-theme .today-plan-icon-wrap { border-color: rgba(201,164,94,0.3); }


/* =========================
   SECCIÓN PESO — diseño premium
   ========================= */

.weight-hero-card-premium {
  background: linear-gradient(160deg, #1a1d26, #14161f);
  border: 1px solid rgba(230,211,163,0.15);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 14px;
}

.whcp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.whcp-label {
  font-size: 11px;
  font-weight: 700;
  color: #e6d3a3;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.whcp-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #9a9a9a;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 4px 10px;
}
.whcp-badge svg { stroke: #9a9a9a; }

/* Estado vacío */
.whcp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0 16px;
  gap: 8px;
}
.whcp-empty-icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: rgba(230,211,163,0.07);
  border: 1px solid rgba(230,211,163,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.whcp-empty-title {
  font-size: 20px;
  font-weight: 800;
  color: #e6d3a3;
}
.whcp-empty-sub {
  font-size: 13px;
  color: #9a9a9a;
  margin: 0;
  line-height: 1.5;
}

/* Con datos */
.whcp-weight-display strong {
  display: block;
  font-size: 52px;
  font-weight: 900;
  color: #f0f0f0;
  text-align: center;
  padding: 12px 0;
  line-height: 1;
}

/* Stats 3 columnas */
.whcp-stats {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 12px 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  overflow: hidden;
}
.whcp-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
  gap: 4px;
}
.whcp-stat-divider {
  width: 1px;
  background: rgba(255,255,255,0.07);
  align-self: stretch;
}
.whcp-stat-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #9a9a9a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.whcp-stat-label svg { stroke: #9a9a9a; }
.whcp-stat-value {
  font-size: 16px;
  font-weight: 800;
  color: #f0f0f0;
}

.whcp-motivation {
  font-size: 12px;
  color: #e6d3a3;
  text-align: center;
  margin: 6px 0 14px;
  font-style: italic;
  opacity: 0.8;
}

/* Botones */
.whcp-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.whcp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 10px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.18s ease;
}
.whcp-btn--primary {
  background: linear-gradient(135deg, #e6d3a3, #c9a45e);
  color: #111;
}
.whcp-btn--primary svg { stroke: #111; }
.whcp-btn--secondary {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #d0d0d0;
}
.whcp-btn--secondary svg { stroke: #d0d0d0; }
.whcp-btn:hover { opacity: 0.85; }

/* Grid inferior: 2 columnas */
.weight-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.weight-bottom-card {
  background: rgba(20,23,32,0.9);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wbc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #f0f0f0;
}
.wbc-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(230,211,163,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wbc-danger-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #ff8787;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  margin-top: auto;
}
.wbc-danger-btn svg { stroke: #ff8787; }

/* Tema claro */
body.light-theme .weight-hero-card-premium {
  background: linear-gradient(160deg, #fff, #f5f3ef);
  border-color: rgba(201,164,94,0.2);
}
body.light-theme .whcp-label { color: #b8924a; }
body.light-theme .whcp-empty-title { color: #b8924a; }
body.light-theme .whcp-stat-value { color: #1a1a1a; }
body.light-theme .weight-bottom-card { background: #fff; border-color: rgba(0,0,0,0.06); }
body.light-theme .wbc-header { color: #1a1a1a; }


/* =========================
   PROGRESO RESUMEN — proporciones corregidas
   ========================= */

.prs-card {
  background: rgba(20,23,32,0.9);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 16px;
}
.prs-card.clickable { cursor: pointer; transition: border-color 0.15s; }
.prs-card.clickable:hover { border-color: rgba(230,211,163,0.2); }
.prs-card--wide { width: 100%; box-sizing: border-box; }

.prs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}
.prs-grid .prs-card { margin-bottom: 0; }

/* Row horizontal */
.prs-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.prs-row--top {
  align-items: center;
  margin-bottom: 10px;
}

/* Icono */
.prs-icon-box {
  width: 40px; height: 40px;
  background: rgba(230,211,163,0.08);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.prs-icon-box--sm { width: 30px; height: 30px; border-radius: 8px; }

/* Textos */
.prs-title {
  display: block;
  font-size: 12px; font-weight: 700; color: #e6d3a3; line-height: 1.2;
}
.prs-value {
  display: block;
  font-size: 26px; font-weight: 900; color: #f0f0f0;
  margin: 4px 0 2px; line-height: 1.1;
}
.prs-sub {
  font-size: 11px; color: #9a9a9a; margin: 2px 0 0; line-height: 1.3;
}
.prs-sub--muted { color: #6b6b6b; }
.prs-content { flex: 1; min-width: 0; }

/* Valor grande (grid cards) */
.prs-big strong {
  font-size: 30px; font-weight: 900; color: #f0f0f0;
  line-height: 1; display: block; margin: 2px 0 4px;
}

/* Spark + badge */
.prs-spark-col {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 5px; flex-shrink: 0;
}
.prs-pct-badge {
  font-size: 10px; font-weight: 700;
  border-radius: 20px; padding: 2px 7px;
  background: rgba(81,207,102,0.12);
  border: 1px solid rgba(81,207,102,0.25);
  white-space: nowrap;
}

/* Barra de meta */
.prs-meta-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}
.prs-meta-text {
  font-size: 11px; color: #9a9a9a; white-space: nowrap; flex-shrink: 0;
}
.prs-meta-text strong { color: #e6d3a3; }
.prs-meta-bar {
  flex: 1; height: 3px;
  background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden;
  min-width: 0;
}
.prs-meta-bar > div {
  height: 100%; background: linear-gradient(90deg, #e6d3a3, #c9a45e);
  border-radius: 2px; transition: width 0.4s ease;
}
.prs-meta-rem {
  font-size: 11px; color: #9a9a9a; white-space: nowrap; flex-shrink: 0;
}

/* Dots semana */
.prs-dots { margin-top: 10px; }

/* PRs */
.prs-pr-row {
  display: flex; align-items: baseline; gap: 5px; margin: 4px 0 2px;
}
.prs-pr-label {
  font-size: 14px; color: #9a9a9a; font-weight: 600;
}
.prs-pr-weight {
  display: inline-block;
  background: rgba(230,211,163,0.1);
  border: 1px solid rgba(230,211,163,0.2);
  border-radius: 20px; padding: 1px 7px;
  font-size: 11px; color: #e6d3a3; font-weight: 600; margin-left: 3px;
}
.prs-trophy-bg { flex-shrink: 0; opacity: 0.6; }

/* Motivacional */
.prs-card--motivation {
  display: flex; align-items: center;
  gap: 10px; margin-top: 0; padding: 14px 16px;
}
.prs-card--motivation p {
  flex: 1; font-size: 13px; color: #9a9a9a; margin: 0; line-height: 1.5;
}

/* Tema claro */
body.light-theme .prs-card { background: #fff; border-color: rgba(0,0,0,0.06); }
body.light-theme .prs-title { color: #b8924a; }
body.light-theme .prs-value,
body.light-theme .prs-big strong { color: #1a1a1a; }
body.light-theme .prs-icon-box { background: rgba(201,164,94,0.1); }


/* =========================
   PESO — layout vertical limpio
   ========================= */

/* Cards de sección (evolución + historial) */
.weight-section-card {
  background: rgba(20,23,32,0.9);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}

.wsc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 700;
  color: #f0f0f0;
}
.wsc-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(230,211,163,0.08);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Historial: lista limpia */
.weight-history-list {
  list-style: none;
  padding: 0; margin: 0;
  width: 100%;
}
.weight-history-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 14px;
  color: #f0f0f0;
}
.weight-history-list li:last-child { border-bottom: none; }
.weight-history-list li span { color: #e6d3a3; font-weight: 700; }

/* Botón peligro en sección */
.wsc-danger-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none; border: none;
  color: #ff8787; font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 8px 0 0; margin-top: 6px;
}
.wsc-danger-btn svg { stroke: #ff8787; }

/* Resumen hero card — más espacio */
.weight-hero-card-premium {
  margin-bottom: 12px;
}

/* Tema claro */
body.light-theme .weight-section-card {
  background: #fff;
  border-color: rgba(0,0,0,0.06);
}
body.light-theme .wsc-header { color: #1a1a1a; }
body.light-theme .wsc-icon { background: rgba(201,164,94,0.1); }
body.light-theme .weight-history-list li { color: #1a1a1a; border-bottom-color: rgba(0,0,0,0.05); }
body.light-theme .weight-history-list li span { color: #b8924a; }


/* =========================
   CARD PROGRESO META — ancho completo bien espaciada
   ========================= */

.prs-card--goal-full {
  flex-direction: column;
}
.prs-goal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.prs-goal-value-row {
  text-align: right;
  flex-shrink: 0;
}
.prs-goal-pct {
  display: block;
  font-size: 36px;
  font-weight: 900;
  color: #e6d3a3;
  line-height: 1;
  margin-bottom: 4px;
}
.prs-goal-hint {
  margin: 0;
  font-size: 12px;
  color: #9a9a9a;
}
.prs-goal-bar {
  margin: 0 0 8px;
  height: 6px;
  border-radius: 3px;
}
.prs-goal-remaining {
  margin: 0;
  font-size: 12px;
  color: #6b6b6b;
}

/* Racha horizontal (dots en fila a la derecha) */
.prs-streak-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.prs-dots-horizontal {
  flex-shrink: 0;
}

/* Tema claro */
body.light-theme .prs-goal-pct { color: #b8924a; }
