/* ═══════════════════════════════════════════════════════════════
   🚀 FUTURISTIC DARK THEME - VARIABLES GLOBALES
   ═══════════════════════════════════════════════════════════════ */
:root {
    /* Colores principales - Neón sobre negro */
    --primary: #00ff88;
    --primary-dark: #00cc6a;
    --primary-light: rgba(0, 255, 136, 0.1);
    --primary-glow: 0 0 20px rgba(0, 255, 136, 0.5), 0 0 40px rgba(0, 255, 136, 0.3);
    
    /* Colores secundarios - Cian futurista */
    --accent: #00d4ff;
    --accent-glow: 0 0 20px rgba(0, 212, 255, 0.5);
    
    /* Colores de acento para UI (neón verde) */
    --accent-primary: #00ff88;
    --accent-secondary: #00d4ff;
    
    /* Colores premium - Dorado */
    --gold-accent: #ffd700;
    --gold-light: rgba(255, 215, 0, 0.1);
    --gold-glow: 0 0 20px rgba(255, 215, 0, 0.5);
    
    /* Fondos oscuros */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --bg-card: rgba(15, 15, 15, 0.8);
    --bg-glass: rgba(20, 20, 20, 0.7);
    
    /* Textos */
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #606060;
    
    /* Bordes y efectos */
    --border: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(0, 255, 136, 0.3);
    
    /* Sombras futuristas */
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-neon: 0 0 30px rgba(0, 255, 136, 0.2), 0 0 60px rgba(0, 255, 136, 0.1);
    --shadow-float: 0 20px 50px rgba(0, 0, 0, 0.5);
    
    /* Glassmorphism */
    --glass-blur: blur(20px);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* Otros */
    --radius: 16px;
    --radius-sm: 8px;
    --font-main: 'Poppins', 'Inter', system-ui, sans-serif;
    
    /* Transiciones */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ═══════════════════════════════════════════════════════════════
   ✨ ANIMACIONES FUTURISTAS
   ═══════════════════════════════════════════════════════════════ */

@keyframes slideIn {
    from {
        transform: translateX(100px) scale(0.9);
        opacity: 0;
        filter: blur(10px);
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

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

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px var(--primary), 0 0 10px var(--primary), 0 0 20px rgba(0, 255, 136, 0.3);
    }
    50% {
        box-shadow: 0 0 10px var(--primary), 0 0 20px var(--primary), 0 0 40px rgba(0, 255, 136, 0.5);
    }
}

@keyframes float3D {
    0%, 100% {
        transform: translateY(0) rotateX(0deg) rotateY(0deg);
    }
    25% {
        transform: translateY(-5px) rotateX(2deg) rotateY(1deg);
    }
    50% {
        transform: translateY(-10px) rotateX(0deg) rotateY(-1deg);
    }
    75% {
        transform: translateY(-5px) rotateX(-2deg) rotateY(1deg);
    }
}

@keyframes scanLine {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100vh);
    }
}

@keyframes borderFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes rotateGlow {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

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

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

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

/* ═══════════════════════════════════════════════════════════════
   📦 RESET Y BASE
   ═══════════════════════════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Fondo animado con grid futurista */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(0, 255, 136, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(0, 212, 255, 0.05) 0%, transparent 40%),
        radial-gradient(ellipse at 0% 100%, rgba(0, 255, 136, 0.03) 0%, transparent 40%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    z-index: -2;
}

/* Grid pattern futurista */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    animation: fadeIn 1s ease-out;
}

/* ═══════════════════════════════════════════════════════════════
   🔔 NOTIFICACIONES FUTURISTAS
   ═══════════════════════════════════════════════════════════════ */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-float);
    z-index: 9999;
    animation: slideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 400px;
    overflow: hidden;
    font-size: 0.9rem;
    line-height: 1.5;
}

.notification div {
    white-space: pre-wrap;
}

.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: shimmer 2s infinite;
}

.notification-success {
    border-left: 3px solid var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-neon);
}

.notification-error {
    border-left: 3px solid #ff4444;
    color: #ff6b6b;
    box-shadow: 0 0 30px rgba(255, 68, 68, 0.2);
}

.notification-info {
    border-left: 3px solid var(--accent);
    color: var(--accent);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   📑 TABS DE MENÚ - ESTILO FUTURISTA
   ═══════════════════════════════════════════════════════════════ */

.menu-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    perspective: 1000px;
}

.menu-tab {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-smooth);
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.menu-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.2), transparent);
    transition: left 0.5s;
}

.menu-tab:hover::before {
    left: 100%;
}

.menu-tab:hover {
    transform: translateY(-3px) rotateX(5deg);
    border-color: var(--border-glow);
    color: var(--text-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.menu-tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--bg-primary);
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: var(--primary-glow);
    animation: glowPulse 2s infinite;
}

.menu-editor {
    animation: fadeIn 0.5s ease-out;
}

/* ═══════════════════════════════════════════════════════════════
   🧭 NAVEGACIÓN FUTURISTA
   ═══════════════════════════════════════════════════════════════ */

.main-nav {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
    transition: all var(--transition-smooth);
}

.main-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--accent), var(--primary), transparent);
    background-size: 200% 100%;
    animation: borderFlow 3s linear infinite;
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    transition: transform var(--transition-smooth);
}

.nav-logo:hover {
    transform: scale(1.05);
}

.logo-img {
    width: auto;
    height: 50px;
    filter: drop-shadow(0 0 10px var(--primary));
    transition: all var(--transition-smooth);
    animation: float3D 6s ease-in-out infinite;
}

.logo-img:hover {
    filter: drop-shadow(0 0 20px var(--primary));
    transform: rotate(10deg);
}

.logo-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.75rem 0.25rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-smooth);
    position: relative;
    font-size: 0.9rem;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all var(--transition-smooth);
    transform: translateX(-50%);
    box-shadow: var(--primary-glow);
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 80%;
}

.nav-link:hover {
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

/* 💎 ENLACE PREMIUM ESPECIAL */
.nav-link.premium-link {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
}

/* 👤 INFO DE USUARIO EN NAV */
.nav-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.15);
    border-radius: 25px;
    margin-left: 12px;
}

.nav-user-avatar {
    font-size: 1.3rem;
    line-height: 1;
}

.nav-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-user-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
}

.nav-user-role {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    display: inline-block;
    text-align: center;
}

/* Badge Coach */
.coach-badge {
    color: #111;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    box-shadow: 0 0 8px rgba(0,255,136,0.4);
}

/* Badge Premium */
.premium-badge {
    color: #111;
    background: linear-gradient(90deg, #ffd700, #ffaa00);
    box-shadow: 0 0 8px rgba(255,215,0,0.5);
}

/* Badge Normal */
.normal-badge {
    color: var(--text-primary);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
}

.nav-logout-btn {
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    transform: scale(1.1);
}

/* ⚙ Botón de configuración de usuario */
.nav-settings-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary, #aaa);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.nav-settings-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary, #00ff88);
    color: var(--accent-primary, #00ff88);
    transform: rotate(90deg) scale(1.1);
}

/* ⚙ Modal de configuración de usuario */
.us-section {
    margin-bottom: 16px;
}

.us-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.us-field {
    margin-bottom: 12px;
}

.us-field label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary, #aaa);
    margin-bottom: 4px;
    font-weight: 500;
}

.us-email-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.us-email-row .form-input {
    flex: 1;
}

.us-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary, #888);
    margin-top: 3px;
}

.us-avatar-picker {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.us-avatar-opt {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color, #333);
    background: var(--bg-secondary, #1a1a2e);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.us-avatar-opt:hover {
    border-color: var(--accent-primary, #00ff88);
    transform: scale(1.15);
}

.us-avatar-opt.active {
    border-color: var(--accent-primary, #00ff88);
    background: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.us-divider {
    border: none;
    border-top: 1px solid var(--border-color, #333);
    margin: 16px 0;
}

.us-error {
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 6px;
}

.us-danger-zone {
    padding: 12px;
    background: rgba(239, 68, 68, 0.04);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 10px;
}

.us-verify-field {
    padding: 10px;
    background: rgba(0, 255, 136, 0.04);
    border: 1px solid rgba(0, 255, 136, 0.15);
    border-radius: 8px;
}

/* 🔒 Link bloqueado para plan normal */
.nav-link.plan-locked {
    opacity: 0.45;
    cursor: not-allowed;
    position: relative;
}

.nav-link.plan-locked::after {
    content: '🔒';
    font-size: 0.7rem;
    margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   🎫 BANNER DE PLAN (arriba del contenido)
   ═══════════════════════════════════════════════════════════════ */

.plan-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 2rem;
    font-size: 0.83rem;
    font-weight: 500;
    flex-wrap: wrap;
}

.plan-banner-normal {
    background: linear-gradient(90deg,
        rgba(0,255,136,0.07) 0%,
        rgba(0,212,255,0.05) 100%);
    border-bottom: 1px solid rgba(0,255,136,0.15);
    color: var(--text-secondary);
}

.plan-banner-premium {
    background: linear-gradient(90deg,
        rgba(255,215,0,0.08) 0%,
        rgba(255,165,0,0.04) 100%);
    border-bottom: 1px solid rgba(255,215,0,0.2);
    color: #ffd700;
}

.plan-banner-upgrade {
    color: var(--primary);
    font-size: 0.78rem;
}

@media (max-width: 768px) {
    .nav-user-info {
        margin-left: 0;
        margin-top: 10px;
        justify-content: center;
    }
    .nav-user-details {
        display: none;
    }
    .plan-banner {
        padding: 0.5rem 1rem;
        font-size: 0.78rem;
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }
}

.nav-link.premium-link:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.1));
    border-color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    color: #ffd700;
}

.nav-link.premium-link::before {
    background: linear-gradient(90deg, #ffd700, #ffaa00);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.nav-link.premium-link.active {
    color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.1));
}

/* 🍔 MENÚ HAMBURGUESA MÓVIL */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1002;
    position: relative;
}

.mobile-menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 0 10px var(--primary);
}

.mobile-menu-toggle:hover span {
    box-shadow: 0 0 20px var(--primary);
}

/* Animación del botón hamburguesa cuando está activo */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Overlay oscuro cuando el menú está abierto */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998; /* Debe estar DEBAJO del nav-menu (z-index: 1000) */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════════
   📦 CONTENEDOR PRINCIPAL
   ═══════════════════════════════════════════════════════════════ */

.main-content-blur {
    filter: blur(4px);
    transition: filter 0.3s ease;
    pointer-events: none;
}

.main-container {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    perspective: 1000px;
    overflow-x: hidden;
    box-sizing: border-box;
}

#app-container {
    animation: fadeIn 0.6s ease-out;
    transform-style: preserve-3d;
    overflow-x: hidden;
    max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   👣 FOOTER FUTURISTA
   ═══════════════════════════════════════════════════════════════ */

.footer {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 4rem;
    position: relative;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 255, 136, 0.02) 100%);
}

.footer-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.footer-logo-img {
    width: auto;
    height: 36px;
    opacity: 0.6;
    filter: drop-shadow(0 0 6px var(--primary));
    transition: opacity var(--transition-smooth);
}

.footer-logo-img:hover {
    opacity: 0.9;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* ═══════════════════════════════════════════════════════════════
   📱 RESPONSIVE - MEJORADO PARA MÓVIL/TABLET
   ═══════════════════════════════════════════════════════════════ */

/* 📱 Tablets, Laptops y Pantallas ≤1470px - MENÚ HAMBURGUESA */
@media (max-width: 1470px) {
    /* Mostrar botón hamburguesa */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Ocultar menú de escritorio y convertir en drawer lateral */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh; /* safe height para móviles con barra de navegación */
        background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 5rem 1.25rem 2rem;
        gap: 0.15rem;
        box-shadow: -10px 0 50px rgba(0, 0, 0, 0.8);
        border-left: 2px solid var(--border-glow);
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        z-index: 1000;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Menú abierto */
    .nav-menu.active {
        right: 0;
    }
    
    /* Items del menú móvil */
    .nav-menu li {
        width: 100%;
        opacity: 0;
        transform: translateX(50px);
        transition: all 0.3s ease;
    }
    
    .nav-menu.active li {
        opacity: 1;
        transform: translateX(0);
    }
    
    /* Animación escalonada de items */
    .nav-menu.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-menu.active li:nth-child(2) { transition-delay: 0.15s; }
    .nav-menu.active li:nth-child(3) { transition-delay: 0.2s; }
    .nav-menu.active li:nth-child(4) { transition-delay: 0.25s; }
    .nav-menu.active li:nth-child(5) { transition-delay: 0.3s; }
    
    .nav-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        padding: 1.2rem 1.5rem;
        margin-bottom: 0.5rem;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        text-align: left;
        font-size: 1rem;
        background: var(--bg-glass);
        position: relative;
        overflow: hidden;
    }
    
    .nav-link::after {
        content: '→';
        position: absolute;
        right: 1.5rem;
        opacity: 0;
        transition: all 0.3s ease;
        color: var(--primary);
    }
    
    .nav-link:hover::after,
    .nav-link.active::after {
        opacity: 1;
        right: 1rem;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: var(--primary-light);
        border-color: var(--primary);
        transform: translateX(8px);
        box-shadow: var(--primary-glow);
    }
    
    .nav-link::before {
        display: none;
    }
    
    /* Logo más pequeño en pantallas ≤1470px */
    .logo-img {
        width: auto;
        height: 44px;
    }
    
    .logo-text {
        font-size: 1.15rem;
    }
    
    .main-container {
        padding: 1rem;
        margin-top: 1rem;
    }
}

/* 🖥️ Tablets grandes y laptops medianos (1024px y menos) */
@media (max-width: 1024px) {
    .logo-img {
        width: auto;
        height: 38px;
    }
    .logo-text {
        font-size: 1.1rem;
    }
    .nav-menu {
        width: 300px;
        max-width: 85vw;
        padding: 4.5rem 1.15rem 2rem;
    }
}

/* 📱 Tablets medianos (768px y menos) */
@media (max-width: 768px) {
    .main-nav {
        padding: 0.8rem 1rem;
    }

    .nav-menu {
        width: 280px;
        max-width: 82vw;
        padding: 4.5rem 1rem 2rem;
    }
    
    .nav-link {
        font-size: 0.95rem;
        padding: 1.1rem 1.3rem;
    }

    /* Logo */
    .logo-img {
        width: auto;
        height: 34px;
    }
    
    .logo-text {
        font-size: 1rem;
    }

    .main-container {
        padding: 0.8rem;
        margin-top: 0.5rem;
    }
}

/* 📱 iPhone y móviles (480px y menos) */
@media (max-width: 480px) {
    .main-nav {
        padding: 0.6rem 0.8rem;
    }

    .nav-menu {
        width: 260px;
        max-width: 88vw;
        padding: 4rem 0.9rem 1.5rem;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 1rem 1.2rem;
    }

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

    .logo-text {
        font-size: 0.95rem;
    }

    .main-container {
        padding: 0.5rem;
        margin-top: 0.3rem;
    }

    /* Botones más grandes para touch */
    .btn {
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
        min-height: 44px; /* Tamaño mínimo touch de Apple */
    }
}

/* 📱 iPhone pequeños (360px y menos) */
@media (max-width: 360px) {
    .nav-menu {
        width: 100vw;
        max-width: 100vw;
        padding: 3.8rem 0.75rem 1.5rem;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 0.9rem 1rem;
    }

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

    .logo-text {
        font-size: 0.85rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   📱 OPTIMIZACIONES TÁCTILES PARA iOS/ANDROID Y PANTALLAS ≤1470px
   ═══════════════════════════════════════════════════════════════ */

/* Mejorar inputs y formularios para dispositivos táctiles */
@media (max-width: 1470px) {
    /* Inputs más grandes y fáciles de tocar */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    textarea,
    select {
        min-height: 44px; /* Tamaño mínimo táctil iOS */
        font-size: 16px !important; /* Prevenir zoom en iOS */
        padding: 0.75rem 1rem;
    }
    
    textarea {
        min-height: 120px;
    }
    
    /* Botones más grandes para touch */
    .btn,
    button {
        min-height: 44px;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        touch-action: manipulation; /* Mejorar respuesta táctil */
        -webkit-tap-highlight-color: rgba(0, 255, 136, 0.2);
    }
    
    /* Mejorar botones pequeños */
    .btn-small {
        min-height: 40px;
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    /* Mejorar espaciado entre elementos interactivos */
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-row {
        gap: 1rem;
    }
    
    /* Mejorar tabs/pestañas para touch */
    .menu-tab {
        min-height: 44px;
        padding: 0.875rem 1.25rem;
    }
    
    /* Mejorar selectores de presets */
    .preset-btn {
        min-height: 48px;
        padding: 1rem 1.25rem;
    }
    
    /* Desactivar efectos hover en touch */
    @media (hover: none) {
        .btn:hover,
        .nav-link:hover,
        .menu-tab:hover {
            transform: none;
        }
    }
}

/* Optimizaciones específicas para iPhone/iPad */
@media (max-width: 768px) {
    /* Formularios en una sola columna */
    .form-row,
    .form-row-3 {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-row > *,
    .form-row-3 > * {
        width: 100% !important;
        flex: 1 1 100%;
    }
    
    /* Aumentar tamaño de fuente para mejor legibilidad */
    body {
        font-size: 15px;
    }
    
    h1, .form-section-title {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    /* Mejorar contenedores */
    .nutrition-container,
    .training-container,
    .premium-recipes-container {
        display: block !important;
    }
    
    .nutrition-form,
    .training-form,
    .recipes-form {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .nutrition-preview,
    .training-preview,
    .recipes-preview {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 2rem;
        position: static !important;
    }
    
    /* Mejorar modales en móvil */
    .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Mejorar notificaciones */
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100vw - 20px);
    }
}

/* iPhone y móviles pequeños */
@media (max-width: 480px) {
    /* Reducir padding general */
    .form-section {
        padding: 1rem;
    }
    
    /* Botones en columna en móvil */
    .btn-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* Mejorar grid de presets */
    .premium-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Ajustar tabs para móvil */
    .menu-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .menu-tab {
        width: 100%;
        text-align: center;
    }
}

    .main-container {
        padding: 0.8rem;
    }


/* Muy pequeño (320px) */
@media (max-width: 360px) {
    .nav-logo .logo-text {
        font-size: 0.95rem;
    }

    .nav-link {
        font-size: 0.7rem;
        padding: 0.5rem 0.4rem;
    }

    .nav-menu li {
        min-width: 100px;
    }
}
    
    .menu-tabs > * {
        flex: 1; 
        display: flex;
        flex-direction: column; 
        align-items: center;
        justify-content: center;
        
        background: rgba(255, 255, 255, 0.08); 
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        padding: 10px 5px;
        margin-right: 0; 
        
        font-size: 0 !important; 
    }

    .menu-tabs > *:active {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(0.98);
    }

    body::after {
        background-size: 20px 20px; 
    }

/*add responsive to tablets*/



/* ═══════════════════════════════════════════════════════════════
   🎨 UTILIDADES Y EFECTOS ADICIONALES
   ═══════════════════════════════════════════════════════════════ */

/* Efecto hover 3D para cards */
.hover-3d {
    transition: transform var(--transition-smooth);
    transform-style: preserve-3d;
}

.hover-3d:hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(-5deg);
}

/* Efecto de brillo en bordes */
.glow-border {
    position: relative;
}

.glow-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--primary), var(--accent), var(--primary));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-smooth);
    filter: blur(10px);
}

.glow-border:hover::before {
    opacity: 1;
}

/* Scrollbar futurista */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    box-shadow: var(--primary-glow);
}

/* Selección de texto */
::selection {
    background: var(--primary);
    color: var(--bg-primary);
}

/* ═══════════════════════════════════════════════════════════════
   ⚠️ MENSAJES DE ERROR Y CARGA
   ═══════════════════════════════════════════════════════════════ */

.loading-message,
.error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
}

.error-message {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    border: 2px solid rgba(255, 68, 68, 0.3);
    border-radius: 12px;
    margin: 2rem;
}
/* ═══════════════════════════════════════════════════════════════
   ✨ OPCIONES PREMIUM - CHECKBOXES ESTILIZADOS
   ═══════════════════════════════════════════════════════════════ */

.premium-options-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, rgba(0, 255, 136, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}

.premium-options-section::before {
    content: '✨';
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    opacity: 0.3;
}

.premium-options-section .form-section-title {
    color: var(--gold-accent);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.premium-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.premium-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    font-size: 0.9rem;
}

.premium-checkbox:hover {
    border-color: var(--primary);
    background: rgba(0, 255, 136, 0.05);
    transform: translateY(-2px);
}

.premium-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.premium-checkbox .checkmark {
    position: relative;
    height: 22px;
    width: 22px;
    min-width: 22px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.premium-checkbox:hover .checkmark {
    border-color: var(--primary);
}

.premium-checkbox input:checked ~ .checkmark {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.premium-checkbox .checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid var(--bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.premium-checkbox input:checked ~ .checkmark::after {
    display: block;
}

/* Checkbox premium dorado (para features especiales) */
.premium-checkbox.gold:hover {
    border-color: var(--gold-accent);
    background: rgba(255, 215, 0, 0.05);
}

.premium-checkbox.gold input:checked ~ .checkmark {
    background: linear-gradient(135deg, var(--gold-accent) 0%, #daa520 100%);
    border-color: var(--gold-accent);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* Checkbox deshabilitado */
.premium-checkbox.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.premium-checkbox.disabled:hover {
    transform: none;
    border-color: var(--border);
    background: var(--bg-card);
}

/* Etiqueta "próximamente" */
.premium-checkbox .coming-soon {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--gold-accent);
    color: var(--bg-primary);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
   ✨ SUBSECCIONES PREMIUM
   ═══════════════════════════════════════════════════════════════ */

.premium-subsection {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.premium-subsection:last-of-type {
    margin-bottom: 15px;
}

.premium-subsection-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Grid de configuración premium */
.premium-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed rgba(255, 215, 0, 0.2);
}

.premium-config-grid .form-group {
    margin-bottom: 0;
}

.premium-config-grid .form-group label {
    font-size: 0.8rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.premium-config-grid .form-group input,
.premium-config-grid .form-group select {
    height: 42px;
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════════
   📱 RESPONSIVE PARA CHECKBOXES PREMIUM
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .premium-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .premium-checkbox {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   🎠 CARRUSEL DE PRESETS (NUTRICIÓN Y ENTRENAMIENTO)
   ═══════════════════════════════════════════════════════════════ */

/* Contenedor principal de presets */
.presets-section {
    margin-bottom: 25px;
}

.presets-section .presets-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.presets-section .presets-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

/* Búsqueda y filtros de presets */
.preset-search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.preset-search-filters .search-box {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 8px;
    padding: 8px 15px;
    flex: 1;
    min-width: 180px;
    max-width: 280px;
    transition: all 0.3s ease;
}

.preset-search-filters .search-box:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.preset-search-filters .search-box .search-icon {
    margin-right: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.preset-search-filters .search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    flex: 1;
    outline: none;
    width: 100%;
}

.preset-search-filters .search-box input::placeholder {
    color: var(--text-muted);
}

.preset-search-filters .clear-search {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.preset-search-filters .clear-search:hover {
    color: var(--accent-primary);
}

/* Filter chips para presets */
.preset-search-filters .filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.preset-search-filters .filter-chip {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.preset-search-filters .filter-chip:hover {
    background: rgba(0, 255, 136, 0.2);
    color: var(--text-primary);
}

.preset-search-filters .filter-chip.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    font-weight: 600;
    border-color: var(--accent-primary);
}

/* Filtro de nivel para entrenamiento */
.preset-search-filters .level-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preset-search-filters .level-filter label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.preset-search-filters .level-filter select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 136, 0.2);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

.preset-search-filters .level-filter select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Contador de presets */
.presets-counter {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.presets-counter span {
    color: var(--accent-primary);
    font-weight: 600;
}

.presets-counter .highlight {
    color: var(--accent-secondary);
    font-weight: 500;
}

/* Contenedor del carrusel de presets */
.presets-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botones de navegación del carrusel */
.presets-carousel-container .carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 50%;
    color: #000;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.presets-carousel-container .carousel-prev {
    left: -15px;
}

.presets-carousel-container .carousel-next {
    right: -15px;
}

.presets-carousel-container .carousel-nav:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 255, 136, 0.5);
}

/* Carrusel de presets */
.presets-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 10px 5px 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) rgba(0, 0, 0, 0.3);
}

.presets-carousel::-webkit-scrollbar {
    height: 6px;
}

.presets-carousel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.presets-carousel::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
}

.preset-card-wrapper {
    scroll-snap-align: start;
    flex: 0 0 auto;
    position: relative;
}

/* Barra CRUD - Crear nueva plantilla */
.preset-crud-bar {
    display: flex;
    justify-content: flex-end;
    padding: 0 8px;
    margin-bottom: 8px;
}

/* Botones de acción en tarjetas de presets (editar/eliminar) */
.preset-card-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.preset-card-wrapper:hover .preset-card-actions,
.recipe-card-wrapper:hover .preset-card-actions {
    opacity: 1;
}

.preset-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.6);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.preset-edit-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.6);
}

.preset-delete-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
}

.preset-card-wrapper[data-custom="true"] .preset-carousel-card,
.recipe-card-wrapper[data-custom="true"] .recipe-carousel-card {
    border-color: rgba(168, 85, 247, 0.4);
}

.preset-card-wrapper[data-custom="true"]::after,
.recipe-card-wrapper[data-custom="true"]::after {
    content: '✨';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 12px;
    z-index: 2;
}

/* Tarjeta de preset en carrusel */
.preset-carousel-card {
    width: 180px;
    min-height: 160px;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9), rgba(0, 255, 136, 0.05));
    border: 2px solid rgba(0, 255, 136, 0.2);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preset-carousel-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.3);
}

.preset-carousel-card.selected {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 255, 136, 0.05));
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.preset-carousel-card .preset-icon {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 5px;
}

.preset-carousel-card .preset-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
}

.preset-carousel-card .preset-category {
    font-size: 0.7rem;
    color: var(--accent-primary);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preset-carousel-card .preset-info {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: auto;
}

.preset-carousel-card .preset-info span {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Descripción del preset */
.preset-carousel-card .preset-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Info de menús/días */
.preset-carousel-card .preset-menus,
.preset-carousel-card .preset-days {
    font-size: 0.7rem;
    color: var(--accent-primary);
    text-align: center;
    margin-top: auto;
    font-weight: 600;
}

/* Nivel del preset de entrenamiento */
.preset-carousel-card .preset-level {
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    align-self: center;
}

/* Badge de nivel para presets de entrenamiento */
.preset-carousel-card .level-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.preset-carousel-card .level-principiante {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.preset-carousel-card .level-intermedio {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.preset-carousel-card .level-avanzado {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.preset-carousel-card .level-mixto {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Estilos de nivel aplicados directamente al preset-level */
.preset-carousel-card .preset-level.level-principiante {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.preset-carousel-card .preset-level.level-intermedio {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.preset-carousel-card .preset-level.level-avanzado {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.preset-carousel-card .preset-level.level-mixto {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Mensaje cuando no hay resultados */
.no-presets-message {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   📱 RESPONSIVE PARA CARRUSEL DE PRESETS
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .preset-search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .preset-search-filters .search-box {
        max-width: 100%;
    }
    
    .preset-search-filters .filter-chips {
        justify-content: center;
    }
    
    .presets-carousel-container .carousel-nav {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
    
    .presets-carousel-container .carousel-prev {
        left: -5px;
    }
    
    .presets-carousel-container .carousel-next {
        right: -5px;
    }
    
    .preset-carousel-card {
        width: 160px;
        min-height: 145px;
    }
}

@media (max-width: 480px) {
    .preset-search-filters .filter-chips {
        gap: 6px;
    }
    
    .preset-search-filters .filter-chip {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
    
    .preset-carousel-card {
        width: 145px;
        min-height: 135px;
        padding: 12px;
    }
    
    .preset-carousel-card .preset-icon {
        font-size: 1.6rem;
    }
    
    .preset-carousel-card .preset-name {
        font-size: 0.8rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   🛡️ SISTEMA DE VALIDACIÓN DE CAMPOS
   ═══════════════════════════════════════════════════════════════ */

/* Estado de error */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15), 0 0 12px rgba(239, 68, 68, 0.2) !important;
    animation: shakeField 0.4s ease-in-out;
}

/* Estado válido */
.input-valid {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1), 0 0 8px rgba(34, 197, 94, 0.15) !important;
}

/* Mensaje de error bajo el campo */
.field-error-msg {
    display: block;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 4px;
    padding-left: 4px;
    animation: fadeIn 0.3s ease;
    line-height: 1.3;
}

.field-error-msg::before {
    content: '⚠ ';
    font-size: 0.7rem;
}

/* Animación shake para campos con error */
@keyframes shakeField {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(3px); }
}

/* Guard warning (validación global en vivo) */
.guard-warning {
    display: block;
    color: #ef4444;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 3px;
    padding: 3px 8px;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 4px;
    border-left: 3px solid #ef4444;
    animation: fadeIn 0.25s ease;
    line-height: 1.4;
}

.guard-warning::before {
    content: none; /* Sobreescribir el ::before de field-error-msg */
}

/* Input con guard warning activo */
input.input-error[data-guarded],
textarea.input-error[data-guarded],
select.input-error[data-guarded] {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12), 0 0 8px rgba(239, 68, 68, 0.15) !important;
    animation: shakeField 0.35s ease-in-out;
}

/* Toast de validación */
.validation-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-left: 4px solid #ef4444;
    padding: 16px 24px;
    border-radius: 12px;
    z-index: 10000;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.validation-toast-title {
    color: #ef4444;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.validation-toast-body {
    color: #d1d5db;
    font-size: 0.85rem;
    line-height: 1.5;
}

.validation-toast-body div {
    padding: 2px 0;
}

.validation-toast-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.validation-toast-close:hover {
    color: #ef4444;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   🔐 SECCIÓN DE LOGIN
   ═══════════════════════════════════════════════════════════════ */

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 30%, #111111 70%, #0a0a0a 100%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-overlay::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(0, 255, 136, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(0, 212, 255, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.02) 0%, transparent 40%);
    animation: rotateGlow 30s linear infinite;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6),
                0 0 60px rgba(0, 255, 136, 0.05);
    animation: fadeIn 0.8s ease;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo img {
    width: auto;
    height: 90px;
    filter: drop-shadow(0 0 12px rgba(0, 255, 136, 0.35));
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.login-form-group {
    margin-bottom: 20px;
    position: relative;
}

.login-form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-input {
    width: 100%;
    padding: 14px 16px 16px 44px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.login-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.15);
    background: rgba(0, 0, 0, 0.7);
}

.login-input::placeholder {
    color: var(--text-muted);
}

.login-input-icon {
    position: absolute;
    left: 14px;
    top: 38px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.3s;
}

.login-form-group:focus-within .login-input-icon {
    color: var(--primary);
}

.login-toggle-password {
    position: absolute;
    right: 14px;
    top: 35px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: color 0.3s;
}

.login-toggle-password:hover {
    color: var(--primary);
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 8px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.login-remember input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.login-forgot {
    color: var(--primary);
    font-size: 0.8rem;
    text-decoration: none;
    transition: opacity 0.3s;
}

.login-forgot:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 255, 136, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.login-btn-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

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

.login-role-btn {
    padding: 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.login-role-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.login-role-btn.active {
    border-color: var(--primary);
    background: rgba(0, 255, 136, 0.05);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
}

.login-role-btn .role-icon {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 6px;
}

.login-role-btn .role-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.login-role-btn .role-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    margin-bottom: 16px;
    display: none;
    animation: shakeField 0.4s ease;
}

.login-error.visible {
    display: block;
}

.login-version {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.65rem;
    margin-top: 20px;
    opacity: 0.5;
}

.login-skip-btn {
    width: 100%;
    padding: 12px;
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.login-skip-btn:hover {
    border-color: var(--neon-green, #00ff88);
    color: var(--neon-green, #00ff88);
    background: rgba(0,255,136,0.05);
    box-shadow: 0 0 20px rgba(0,255,136,0.1);
}

/* ═══════════════════════════════════════════════════════════════
   📝 REGISTRO DE USUARIO — FORMULARIO
   ═══════════════════════════════════════════════════════════════ */

/* Botón "Volver al login" */
.login-back-btn {
    width: 100%;
    padding: 11px;
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted, #888);
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    margin-top: 4px;
}
.login-back-btn:hover {
    border-color: var(--neon-green, #00ff88);
    color: var(--neon-green, #00ff88);
    background: rgba(0,255,136,0.04);
}

/* Hint bajo inputs */
.login-field-hint {
    display: block;
    font-size: 0.70rem;
    color: var(--text-muted, #777);
    margin-top: 4px;
    padding-left: 2px;
    opacity: 0.8;
}

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted, #666);
    font-size: 0.78rem;
    margin: 16px 0; 
}

/* Creamos las líneas a los lados */
.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1; 
    border-bottom: 1px solid #444; /* Cambia el color (#444) para que combine con tu fondo oscuro */
}

/* Espaciado para que las líneas no toquen el texto */
.login-divider::before {
    margin-right: 0px;
}

.login-divider::after {
    margin-left: 0px;
}

/* Términos y condiciones */
.register-terms {
    margin: 6px 0 10px;
}
.register-terms .login-remember {
    font-size: 0.78rem;
    color: var(--text-muted, #999);
    gap: 8px;
}
.register-terms a {
    color: var(--neon-green, #00ff88);
    text-decoration: none;
    font-weight: 600;
}
.register-terms a:hover {
    text-decoration: underline;
}

/* Barra de fortaleza de contraseña */
.password-strength-bar {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}
.password-strength-bar > div {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.4s ease, background 0.4s ease;
}
#pwStrengthText {
    transition: color 0.3s ease;
}

/* Botón toggle de contraseña */
.login-toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 24px 0px 0px 0px;
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1;
}
.login-toggle-password:hover { opacity: 1; }

/* Asegura que el icono y el toggle de contraseña no se solapen */
.login-form-group:has(.login-toggle-password) .login-input {
    padding-right: 40px;
}

/* ═══════════════════════════════════════════════════════════════
   📱 LOGIN RESPONSIVE COMPLETO
   ═══════════════════════════════════════════════════════════════ */

/* Tablets grandes (1024px) */
@media (max-width: 1024px) {
    .login-container {
        max-width: 420px;
        padding: 0 24px;
    }
    
    .login-card {
        padding: 40px 36px;
    }
}

/* Tablets (768px) */
@media (max-width: 768px) {
    .login-overlay {
        padding: 20px;
        align-items: flex-start;
        padding-top: 5vh;
        overflow-y: auto;
    }
    
    .login-container {
        max-width: 400px;
        padding: 0 16px;
    }
    
    .login-card {
        padding: 36px 28px;
        border-radius: 20px;
    }
    
    .login-logo img {
        width: auto;
        height: 54px;
    }
    
    .login-logo h1 {
        font-size: 1.4rem;
    }
    
    .login-logo p {
        font-size: 0.82rem;
    }
    
    .login-role-btn .role-icon {
        font-size: 1.6rem;
    }
    
    .login-role-btn .role-name {
        font-size: 0.82rem;
    }
    
    .login-input {
        padding: 12px 14px 12px 40px;
        font-size: 0.9rem;
    }
    
    .login-btn {
        padding: 14px;
        font-size: 0.95rem;
    }
}

/* Móviles (480px) */
@media (max-width: 480px) {
    .login-overlay {
        padding: 12px;
        padding-top: 3vh;
    }
    
    .login-container {
        max-width: 100%;
        padding: 0 8px;
    }
    
    .login-card {
        padding: 28px 20px;
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                    0 0 40px rgba(0, 255, 136, 0.03);
    }
    
    .login-logo {
        margin-bottom: 24px;
    }
    
    .login-logo img {
        width: auto;
        height: 48px;
        margin-bottom: 12px;
    }
    
    .login-logo h1 {
        font-size: 1.25rem;
    }
    
    .login-logo p {
        font-size: 0.78rem;
    }
    
    .login-role-selector {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .login-role-btn {
        padding: 12px 8px;
        border-radius: 10px;
    }
    
    .login-role-btn .role-icon {
        font-size: 1.4rem;
        margin-bottom: 4px;
    }
    
    .login-role-btn .role-name {
        font-size: 0.78rem;
    }
    
    .login-role-btn .role-desc {
        font-size: 0.65rem;
    }
    
    .login-form-group {
        margin-bottom: 16px;
    }
    
    .login-form-group label {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }
    
    .login-input {
        padding: 12px 14px 12px 38px;
        font-size: 16px; /* Previene zoom en iOS */
        border-radius: 10px;
    }
    
    .login-input-icon {
        left: 12px;
        top: 36px;
        font-size: 0.9rem;
    }
    
    .login-toggle-password {
        right: 12px;
        top: 33px;
    }
    
    .login-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .login-remember {
        font-size: 0.78rem;
    }
    
    .login-forgot {
        font-size: 0.78rem;
    }
    
    .login-btn {
        padding: 13px;
        font-size: 0.9rem;
        border-radius: 10px;
        min-height: 48px;
    }
    
    .login-divider {
        margin: 18px 0;
        font-size: 0.7rem;
    }
    
    .login-skip-btn {
        padding: 11px;
        font-size: 0.85rem;
        border-radius: 10px;
        min-height: 44px;
    }
    
    .login-footer {
        margin-top: 20px;
        font-size: 0.75rem;
    }
    
    .login-error {
        padding: 8px 12px;
        font-size: 0.78rem;
        border-radius: 8px;
    }
    
    .login-version {
        margin-top: 16px;
        font-size: 0.6rem;
    }
}

/* iPhone SE / Móviles muy pequeños (360px) */
@media (max-width: 360px) {
    .login-overlay {
        padding: 8px;
        padding-top: 2vh;
    }
    
    .login-card {
        padding: 24px 16px;
        border-radius: 14px;
    }
    
    .login-logo img {
        width: auto;
        height: 40px;
    }
    
    .login-logo h1 {
        font-size: 1.1rem;
    }
    
    .login-logo p {
        font-size: 0.72rem;
    }
    
    .login-role-selector {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .login-role-btn {
        padding: 10px 8px;
        flex-direction: row;
        gap: 10px;
        text-align: left;
    }
    
    .login-role-btn .role-icon {
        font-size: 1.3rem;
        margin-bottom: 0;
    }
    
    .login-input {
        padding: 11px 12px 11px 36px;
        font-size: 16px;
    }
    
    .login-btn {
        padding: 12px;
        font-size: 0.85rem;
    }
    
    .login-skip-btn {
        padding: 10px;
        font-size: 0.8rem;
    }
}

/* Landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .login-overlay {
        align-items: flex-start;
        padding: 10px 20px;
        overflow-y: auto;
    }
    
    .login-container {
        max-width: 380px;
    }
    
    .login-card {
        padding: 20px 28px;
    }
    
    .login-logo {
        margin-bottom: 16px;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .login-logo img {
        width: auto;
        height: 34px;
        margin-bottom: 0;
    }
    
    .login-logo h1 {
        font-size: 1.2rem;
        margin-bottom: 0;
    }
    
    .login-logo p {
        display: none;
    }
    
    .login-role-selector {
        margin-bottom: 12px;
    }
    
    .login-role-btn {
        padding: 8px;
    }
    
    .login-role-btn .role-icon {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }
    
    .login-role-btn .role-desc {
        display: none;
    }
    
    .login-form-group {
        margin-bottom: 12px;
    }
    
    .login-divider {
        margin: 12px 0;
    }
    
    .login-options {
        margin-bottom: 12px;
    }
    
    .login-footer {
        margin-top: 12px;
    }
    
    .login-version {
        margin-top: 8px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   📅 SELECTOR DE DURACIÓN DEL PLAN
   ═══════════════════════════════════════════════════════════════ */

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    opacity: 0.8;
}

.plan-duration-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.duration-chip {
    flex: 1;
    min-width: 85px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-secondary);
}

.duration-chip:hover {
    border-color: rgba(0, 255, 136, 0.4);
    background: rgba(0, 255, 136, 0.05);
    transform: translateY(-2px);
}

.duration-chip.active {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 255, 136, 0.05));
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.duration-chip .duration-weeks {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.duration-chip.active .duration-weeks {
    color: var(--accent-primary);
}

.duration-chip .duration-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.duration-chip .duration-desc {
    font-size: 0.7rem;
    color: var(--accent-primary);
    font-weight: 600;
    opacity: 0.7;
}

.duration-chip.active .duration-desc {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   🔧 PRESET MANAGER - CRUD UI
   ═══════════════════════════════════════════════════════════════ */

/* Header row con botón crear */
.presets-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
}

.presets-header-row .presets-title {
    margin-bottom: 0;
}

.btn-create-preset {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: #000;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-create-preset:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

.btn-create-preset.premium {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.btn-create-preset.premium:hover {
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.btn-create-preset span {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
}

/* Badge "Custom" en cards */
.preset-custom-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    z-index: 2;
}

.preset-card-wrapper {
    position: relative;
}

.preset-card-wrapper.custom-preset .preset-carousel-card {
    border-color: rgba(139, 92, 246, 0.4);
}

.preset-card-wrapper.custom-preset .preset-carousel-card:hover {
    border-color: #8b5cf6;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

/* Acciones de preset (editar/eliminar) */
.preset-card-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 4px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
}

.preset-card-wrapper:hover .preset-card-actions {
    opacity: 1;
    transform: translateY(0);
}

.preset-action-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.preset-action-btn.edit:hover {
    background: rgba(59, 130, 246, 0.5);
    border-color: #3b82f6;
}

.preset-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.5);
    border-color: #ef4444;
}

/* ═══════════════════════════════════════════════════════════════
   📝 PRESET EDITOR PANEL
   ═══════════════════════════════════════════════════════════════ */

/* Editor en el preview container */
.preset-editor-active {
    overflow-y: auto !important;
}

.preset-editor-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.preset-editor-panel.visible {
    opacity: 1;
    transform: translateX(0);
}

.preset-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.12), rgba(0, 0, 0, 0.4));
    border-bottom: 1px solid rgba(0, 255, 136, 0.15);
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.preset-editor-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preset-editor-title span:first-child {
    font-size: 1.3rem;
}

.preset-editor-title h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.preset-editor-title small {
    font-size: 0.7rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preset-editor-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preset-editor-close:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.preset-editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preset-editor-footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}

.preset-editor-footer .btn {
    flex: 1;
}

/* Editor fields */
.pe-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pe-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pe-field-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.pe-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pe-label small {
    text-transform: none;
    font-weight: 400;
    color: var(--text-muted);
}

.pe-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    transition: border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.pe-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.1);
}

.pe-textarea {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    resize: vertical;
    min-height: 50px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.pe-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.pe-color {
    width: 40px;
    height: 34px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.pe-icon-input {
    width: 50px !important;
    text-align: center;
    font-size: 1.2rem !important;
}

.pe-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.15);
}

.pe-info-box {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 8px 10px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    font-size: 0.73rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.pe-capture-section {
    margin-top: 6px;
}

.pe-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 6px 0;
}

.pe-hint {
    display: block;
    text-align: center;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    font-weight: 700;
}

.btn-accent:hover {
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.78rem;
}

.btn-full {
    width: 100%;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════
   🪟 PRESET EDITOR MODAL (fallback)
   ═══════════════════════════════════════════════════════════════ */

.preset-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preset-editor-overlay.visible {
    opacity: 1;
}

.preset-editor-modal-content {
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    background: var(--bg-secondary, #1a1a2e);
    border-radius: 16px;
    border: 1px solid rgba(0, 255, 136, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preset-editor-modal-content .preset-editor-panel {
    height: auto;
    max-height: 85vh;
}

.preset-editor-modal-content .preset-editor-body {
    max-height: 55vh;
}

/* ═══════════════════════════════════════════════════════════════
   🏋️ PRESET EDITOR - DÍAS Y EJERCICIOS
   ═══════════════════════════════════════════════════════════════ */

.pe-section-days-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-add-day {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    border: none;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-day:hover {
    box-shadow: 0 2px 10px rgba(0, 255, 136, 0.4);
    transform: translateY(-1px);
}

#pe-days-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.pe-day-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.pe-day-card:hover {
    border-color: rgba(0, 255, 136, 0.2);
}

.pe-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    gap: 6px;
    user-select: none;
}

.pe-day-header:hover {
    background: rgba(255, 255, 255, 0.07);
}

.pe-day-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.pe-day-number {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    font-weight: 800;
    font-size: 0.7rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.pe-day-name {
    background: transparent;
    border: 1px solid transparent;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    transition: all 0.2s;
}

.pe-day-name:hover,
.pe-day-name:focus {
    border-color: rgba(0, 255, 136, 0.3);
    background: rgba(0, 0, 0, 0.3);
    outline: none;
}

.pe-day-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.pe-day-count {
    font-size: 0.65rem;
    color: var(--text-muted);
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.pe-day-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s;
    opacity: 0.5;
}

.pe-day-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.pe-day-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.pe-day-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s;
    width: 14px;
    text-align: center;
}

.pe-day-body {
    padding: 6px 10px 8px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 2000px;
    opacity: 1;
}

.pe-day-body.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0 10px;
    overflow: hidden;
}

.pe-day-cardio {
    margin-bottom: 6px;
}

.pe-label-sm {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.pe-input-sm {
    padding: 4px 8px !important;
    font-size: 0.72rem !important;
}

/* Exercises Table */
.pe-exercises-table {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    overflow: hidden;
}

.pe-ex-header {
    display: grid;
    grid-template-columns: 1fr 50px 58px 38px 1fr 48px;
    gap: 2px;
    padding: 4px 6px;
    background: rgba(0, 255, 136, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pe-ex-header span {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pe-ex-row {
    display: grid;
    grid-template-columns: 1fr 50px 58px 38px 1fr 48px;
    gap: 2px;
    padding: 2px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.15s;
}

.pe-ex-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.pe-ex-row:last-child {
    border-bottom: none;
}

.pe-ex-input {
    width: 100%;
    padding: 3px 5px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    color: var(--text-primary);
    font-size: 0.68rem;
    transition: all 0.15s;
}

.pe-ex-input:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.pe-ex-input:focus {
    border-color: rgba(0, 255, 136, 0.35);
    background: rgba(0, 0, 0, 0.3);
    outline: none;
}

.pe-ex-input::placeholder {
    color: rgba(255, 255, 255, 0.15);
    font-style: italic;
}

.pe-ex-col-act {
    display: flex;
    align-items: center;
    gap: 1px;
    justify-content: center;
}

.pe-ex-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.6rem;
    opacity: 0;
    transition: all 0.15s;
}

.pe-ex-row:hover .pe-ex-btn {
    opacity: 0.5;
}

.pe-ex-btn:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.1);
}

.pe-ex-del:hover {
    background: rgba(239, 68, 68, 0.15) !important;
}

.pe-add-exercise-row {
    padding: 4px 6px;
}

.btn-add-exercise {
    width: 100%;
    padding: 4px 8px;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.68rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-exercise:hover {
    border-color: rgba(0, 255, 136, 0.3);
    color: var(--accent-primary);
    background: rgba(0, 255, 136, 0.04);
}

/* Show actions always on ALL preset cards */
.preset-card-wrapper .preset-card-actions {
    opacity: 0;
    transition: opacity 0.2s;
}

.preset-card-wrapper:hover .preset-card-actions {
    opacity: 1;
}

/* Recipe card wrapper - base styles now in main preset-card-wrapper section */

/* ═══════════════════════════════════════════════════════════════
   NUTRITION MEAL EDITOR - (pe-meal-card)
   ═══════════════════════════════════════════════════════════════ */

#pe-menus-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.pe-meal-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
}

.pe-meal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.pe-meal-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pe-meal-macros {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 4px;
}

.pe-macro-field {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.pe-macro-field label {
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pe-textarea-sm {
    min-height: 48px;
    resize: vertical;
    font-size: 0.7rem !important;
    padding: 4px 6px !important;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════
   RECIPE EDITOR - Ingredients / Steps / Marinades
   ═══════════════════════════════════════════════════════════════ */

.pe-ing-header {
    grid-template-columns: 1fr 100px 48px !important;
}

.pe-ing-row {
    grid-template-columns: 1fr 100px 48px !important;
}

.pe-step-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
}

.pe-step-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.pe-step-time {
    font-size: 0.68rem;
}

#pe-steps-container,
#pe-marinades-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   📱 RESPONSIVE - DURATION & PRESET MANAGER
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .plan-duration-selector {
        gap: 6px;
    }
    
    .duration-chip {
        min-width: 60px;
        padding: 8px 4px;
    }
    
    .duration-chip .duration-weeks {
        font-size: 1.1rem;
    }
    
    .duration-chip .duration-label {
        font-size: 0.58rem;
    }
    
    .duration-chip .duration-desc {
        font-size: 0.6rem;
    }
    
    .presets-header-row {
        flex-wrap: wrap;
    }
    
    .preset-editor-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .pe-field-row {
        grid-template-columns: 1fr;
    }
    
    .pe-field-row-3 {
        grid-template-columns: 1fr 1fr;
    }

    .pe-ex-header,
    .pe-ex-row {
        grid-template-columns: 1fr 40px 48px 32px 70px 40px;
    }

    .pe-ing-header,
    .pe-ing-row {
        grid-template-columns: 1fr 80px 40px !important;
    }

    .pe-meal-macros {
        grid-template-columns: repeat(2, 1fr);
    }

    .pe-ex-btn {
        opacity: 0.5;
    }
}

@media (max-width: 480px) {
    .duration-chip {
        min-width: 55px;
    }
    
    .btn-create-preset {
        padding: 5px 10px;
        font-size: 0.72rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   WEEK EDITOR TABS & OVERRIDES
   ═══════════════════════════════════════════════════════════ */

#weekEditorSection {
    margin-top: 12px;
}

.week-editor-label {
    font-size: 0.82rem;
    color: var(--text-secondary, #aaa);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.week-editor-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
}

.week-tab {
    position: relative;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border-color, #333);
    background: var(--bg-secondary, #1a1a2e);
    color: var(--text-secondary, #aaa);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 44px;
    text-align: center;
}

.week-tab:hover {
    border-color: var(--accent-primary, #00ff88);
    color: var(--text-primary, #fff);
    background: rgba(0, 255, 136, 0.06);
}

.week-tab.active {
    background: var(--accent-primary, #00ff88);
    color: #000;
    border-color: var(--accent-primary, #00ff88);
    font-weight: 700;
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
}

.week-tab.modified::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff6b6b;
    box-shadow: 0 0 4px rgba(255, 107, 107, 0.5);
}

.week-tab.base-tab {
    border-style: dashed;
    font-style: italic;
}

.week-tab.base-tab.active {
    border-style: solid;
    font-style: normal;
}

/* Override indicators on exercise inputs */
.week-modified {
    border-color: var(--accent-primary, #00ff88) !important;
    background: rgba(0, 255, 136, 0.08) !important;
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.15);
}

.week-override-row {
    position: relative;
    border-left: 3px solid var(--accent-primary, #00ff88);
    padding-left: 6px;
}

.week-override-row .exercise-label::after {
    content: '📅';
    margin-left: 4px;
    font-size: 0.7rem;
}

/* Week view info banner */
.week-view-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--accent-primary, #00ff88);
    margin-bottom: 8px;
}

.week-view-banner .week-view-icon {
    font-size: 1rem;
}

@media (max-width: 480px) {
    .week-tab {
        padding: 5px 10px;
        font-size: 0.7rem;
        min-width: 38px;
    }
    
    .week-editor-tabs {
        gap: 4px;
    }
}

/* ═══════════════════════════════════════════════════════════
   PDF EDITOR MODULE
   ═══════════════════════════════════════════════════════════ */

.pdf-upload-zone {
    border: 2px dashed var(--border-color, #333);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary, #1a1a2e);
}

.pdf-upload-zone:hover,
.pdf-upload-zone.drag-over {
    border-color: var(--accent-primary, #00ff88);
    background: rgba(0, 255, 136, 0.04);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 1rem;
    color: var(--text-primary, #fff);
    margin-bottom: 6px;
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--text-secondary, #aaa);
}

.pdf-loaded-info {
    margin-top: 10px;
}

.pdf-file-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-primary, #fff);
}

.pdf-icon {
    font-size: 1.2rem;
}

.editor-workspace {
    margin-top: 16px;
}

.editor-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}

.editor-pdf-viewer {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color, #333);
}

.editor-tracking-form {
    max-height: 650px;
    overflow-y: auto;
    padding-right: 8px;
}

.editor-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color, #333);
}

/* Tracking form cards */
.tracking-day-card {
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
}

.tracking-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-tertiary, #252545);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-primary, #fff);
}

.tracking-cardio-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 200, 0, 0.15);
    color: #ffc800;
}

.tracking-exercises {
    padding: 8px 12px;
}

.tracking-exercise-row {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.tracking-exercise-row:last-child {
    border-bottom: none;
}

.tracking-ex-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.tracking-ex-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.tracking-ex-planned {
    font-size: 0.7rem;
    color: var(--text-secondary, #aaa);
    font-style: italic;
}

.tracking-ex-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

/* ── Sub-filas de series (Serie 1, 2, 3, 4) ── */
.tracking-series-rows {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 4px;
}

.tracking-serie-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 4px;
    border-radius: 6px;
    background: rgba(255,255,255,0.02);
}

.tracking-serie-row:nth-child(even) {
    background: rgba(255,255,255,0.04);
}

.tracking-serie-num {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-primary, #00ff88);
    min-width: 42px;
    text-align: center;
    white-space: nowrap;
}

.tracking-serie-inputs {
    flex: 1;
}

.tracking-serie-inputs .tracking-input-group label {
    font-size: 0.6rem;
}

.tracking-input-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tracking-input-group label {
    font-size: 0.65rem;
    color: var(--text-secondary, #aaa);
    text-transform: uppercase;
}

.tracking-input {
    padding: 5px 8px !important;
    font-size: 0.8rem !important;
    text-align: center;
}

.tracking-day-notes {
    padding: 8px 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.tracking-day-notes textarea {
    min-height: 40px;
    font-size: 0.8rem;
    resize: vertical;
}

.tracking-week-summary {
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--accent-primary, #00ff88);
    border-radius: 10px;
    padding: 14px;
    margin-top: 12px;
}

.tracking-week-summary h4 {
    margin: 0 0 10px 0;
    color: var(--accent-primary, #00ff88);
    font-size: 0.9rem;
}

.tracking-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Tracking history */
.tracking-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.tracking-history-card {
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 10px;
    padding: 14px;
    transition: border-color 0.2s;
}

.tracking-history-card:hover {
    border-color: var(--accent-primary, #00ff88);
}

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

.history-file-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.history-date {
    font-size: 0.72rem;
    color: var(--text-secondary, #aaa);
}

.history-card-stats {
    font-size: 0.78rem;
    color: var(--text-secondary, #aaa);
    margin-bottom: 10px;
}

.history-card-actions {
    display: flex;
    gap: 6px;
}

@media (max-width: 768px) {
    .editor-split {
        grid-template-columns: 1fr;
    }
    
    .editor-tracking-form {
        max-height: none;
    }
    
    .tracking-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .pdf-upload-zone {
        padding: 24px 12px;
    }
    
    .tracking-ex-inputs {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }
}

/* ═══════════════════════════════════════════════════════
   ✏️ PDF EDITOR v2.0 - Tabs, Campos, Historial
   ═══════════════════════════════════════════════════════ */

/* Editor Main Tabs */
.editor-main-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-secondary, #1a1a2e);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color, #333);
    overflow-x: auto;
}

.editor-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary, #aaa);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.editor-tab:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary, #fff);
}

.editor-tab.active {
    background: var(--accent-primary, #00ff88);
    color: #000;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.3);
}

.editor-tab-content {
    animation: fadeIn 0.2s ease;
}

.editor-tab-content.hidden {
    display: none !important;
}

/* Analysis progress */
.pdf-analysis-progress {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.analysis-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary, #252540);
    border-radius: 2px;
    overflow: hidden;
}

.analysis-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary, #00ff88), var(--accent-secondary, #00d4ff));
    border-radius: 2px;
    animation: analysisProgress 2s ease infinite;
}

@keyframes analysisProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.analysis-text {
    font-size: 0.75rem;
    color: var(--accent-primary, #00ff88);
    white-space: nowrap;
}

/* PDF type badge */
.pdf-type-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    color: var(--text-primary, #fff);
}

.pdf-type-badge.type-training { background: rgba(0, 150, 255, 0.2); color: #4da6ff; }
.pdf-type-badge.type-nutrition { background: rgba(0, 255, 136, 0.2); color: #00ff88; }
.pdf-type-badge.type-recipe { background: rgba(255, 165, 0, 0.2); color: #ffa500; }
.pdf-type-badge.type-unknown { background: rgba(255, 255, 255, 0.1); color: #aaa; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary, #aaa);
}

.empty-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
    opacity: 0.6;
}

/* Detection summary cards */
.detection-summary {
    margin-top: 10px;
}

.detection-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.detection-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 12px;
    text-align: center;
}

.detection-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.detection-label {
    font-size: 0.72rem;
    color: var(--text-secondary, #aaa);
    margin-bottom: 4px;
}

.detection-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary, #00ff88);
}

/* Editable fields */
.fields-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 12px;
}

.fields-section-title {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    color: var(--accent-primary, #00ff88);
    font-weight: 600;
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.field-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field-item.field-wide {
    grid-column: 1 / -1;
}

.field-label {
    font-size: 0.72rem;
    color: var(--text-secondary, #aaa);
    font-weight: 500;
}

.field-input {
    font-size: 0.82rem;
}

/* Editor actions bar */
.editor-actions-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* History filters */
.history-filters {
    margin-bottom: 16px;
}

.history-search-bar {
    margin-bottom: 10px;
}

.history-type-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.history-filter-btn {
    padding: 6px 14px;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 20px;
    color: var(--text-secondary, #aaa);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.history-filter-btn:hover {
    border-color: var(--accent-primary, #00ff88);
    color: var(--text-primary, #fff);
}

.history-filter-btn.active {
    background: var(--accent-primary, #00ff88);
    color: #000;
    border-color: var(--accent-primary, #00ff88);
    font-weight: 600;
}

/* All plans grid */
.all-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.all-plan-card {
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 12px;
    padding: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.all-plan-card:hover {
    border-color: var(--accent-primary, #00ff88);
    transform: translateY(-1px);
}

.all-plan-card.type-nutrition { border-left-color: #00ff88; }
.all-plan-card.type-training { border-left-color: #4da6ff; }
.all-plan-card.type-recipe { border-left-color: #ffa500; }

.plan-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.plan-type-icon {
    font-size: 1.4rem;
}

.plan-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.plan-card-client {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary, #fff);
}

.plan-card-type {
    font-size: 0.72rem;
    color: var(--text-secondary, #aaa);
}

.plan-card-date {
    font-size: 0.7rem;
    color: var(--text-secondary, #aaa);
    white-space: nowrap;
}

.plan-card-actions {
    display: flex;
    gap: 6px;
}

/* ═══════════════════════════════════════════════════════════════
   🎨 BOTONES PREMIUM MEJORADOS
   ═══════════════════════════════════════════════════════════════ */

.btn-premium,
.btn-premium-primary {
    background: linear-gradient(135deg, #c4d600 0%, #dceb50 100%);
    color: #000 !important;
    font-weight: 700 !important;
    border: none !important;
    box-shadow: 0 8px 20px rgba(196, 214, 0, 0.3) !important;
    transition: all var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-premium:hover,
.btn-premium-primary:hover {
    box-shadow: 0 12px 30px rgba(196, 214, 0, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #ddd;
    font-weight: 600;
    transition: all var(--transition-smooth);
}

.btn-secondary:hover {
    background: #e0e0e0;
    border-color: #999;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white !important;
    font-weight: 700 !important;
    border: none !important;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3) !important;
}

.btn-success:hover {
    box-shadow: 0 12px 30px rgba(34, 197, 94, 0.5);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white !important;
    font-weight: 700 !important;
    border: none !important;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3) !important;
}

.btn-danger:hover {
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════════
   📱 RESPONSIVE DESIGN IMPROVEMENTS
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .editor-main-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .editor-tab {
        min-width: auto;
        font-size: 0.75rem;
        padding: 8px 12px;
    }
    
    .detection-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .fields-grid {
        grid-template-columns: 1fr;
    }
    
    .all-plans-grid {
        grid-template-columns: 1fr;
    }
    
    .editor-actions-bar {
        flex-direction: column;
    }

    .nav-dropdown-item.active {
        padding-block-end: 0%;
        padding-right: 10px !important;
}
}

/* ═══════════════════════════════════════════════════════════════
   🗑️ BOTÓN ICONO ELIMINAR - solo el ícono, rojo, efecto 3D
   Compartido entre plan de alimentación (comidas) y plan de
   entrenamiento (ejercicios). No tocar `.btn-remove`: esa clase
   la usan otros módulos (recetas premium, restaurar semana) y
   debe conservar su apariencia actual.
   ═══════════════════════════════════════════════════════════════ */
.btn-icon-trash {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    outline: none;
    color: #ef4444;
    cursor: pointer;
    overflow: visible;
}

.btn-icon-trash::before {
    content: none;
}

.icon-trash-svg {
    width: 19px;
    height: 19px;
    filter: drop-shadow(0 2px 2px rgba(153, 27, 27, 0.55)) drop-shadow(0 1px 0 rgba(255, 255, 255, 0.15));
    transition: transform 0.15s ease, filter 0.15s ease, color 0.15s ease;
}

.btn-icon-trash:hover {
    color: #ff6b6b;
}

.btn-icon-trash:hover .icon-trash-svg {
    transform: scale(1.18) translateY(-1px);
    filter: drop-shadow(0 5px 6px rgba(153, 27, 27, 0.7)) drop-shadow(0 1px 0 rgba(255, 255, 255, 0.2));
}

.btn-icon-trash:active .icon-trash-svg {
    transform: scale(0.9);
}

.btn-icon-trash:disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

.btn-icon-trash:disabled .icon-trash-svg {
    filter: none;
}


