:root {
    /* Paleta de colores Premium Oscura */
    --bg-color: #0d1117; /* Fondo tipo GitHub oscuro */
    --card-bg: #161b22; /* Fondo de la tarjeta */
    --text-main: #ffffff;
    --text-secondary: #8b949e;
    
    /* Acento Principal: Degradado Fitness */
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --accent-color: #4facfe;
    
    /* Colores de las Categorías de Salud (Versión Neón Sutil) */
    --cat-low: #5dade2;      /* Azul bajo */
    --cat-normal: #2ecc71;   /* Verde salud */
    --cat-over: #f1c40f;     /* Amarillo aviso */
    --cat-ob-1: #e67e22;     /* Naranja */
    --cat-ob-2: #e74c3c;     /* Rojo */
    --cat-ob-3: #8e44ad;     /* Morado extremo */
    
    --border-color: rgba(255, 255, 255, 0.08);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Contenedor Principal (La Tarjeta) */
.imc-app-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 90%;
    max-width: 950px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    box-sizing: border-box;
}

/* Diseño de dos columnas */
.main-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

/* --- COLUMNA IZQUIERDA: INPUTS --- */
.inputs-section label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* Botones de Género Modernos */
.gender-selector {
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 30px;
}
.gender-btn {
    flex: 1;
    padding: 14px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s ease;
}
.gender-btn.active {
    background: #30363d;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Sliders y Controles Numéricos Unificados */
.control-group {
    margin-bottom: 25px;
}
.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.number-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--accent-color);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 10px;
    width: 70px;
    text-align: right;
    outline: none;
}
/* Estilo moderno del slider (range) */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #21262d;
    border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--accent-gradient);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -7px;
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.5);
}

/* --- COLUMNA DERECHA: RESULTADOS --- */
.results-section {
    text-align: center;
    background: rgba(0,0,0,0.1);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid var(--border-color);
}

.score-title {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 2px;
}

/* El número grande del IMC con el color dinámico */
#imc-number {
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    margin: 10px 0;
    transition: 0.3s ease;
}

#imc-category-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 25px;
}

/* Bloque de info táctica (lo amarillo en tu imagen) */
.tactical-info {
    background: rgba(241, 196, 15, 0.08);
    border: 1px solid #f1c40f;
    border-radius: 12px;
    padding: 15px;
    color: #f1c40f;
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.water-rec {
    color: var(--accent-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 30px;
}

/* Botones de acción principales (Degradado Neón) */
.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
    transition: 0.3s ease;
    width: 100%;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.5);
}

/* --- PARTE INFERIOR: TABLA DE CLASIFICACIÓN MODERNA --- */
.table-section {
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
}

.table-title {
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
}

.imc-visual-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

/* Cada bloque de la tabla inferior */
.visual-block {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    font-size: 0.75rem;
    transition: 0.3s ease;
    color: var(--text-secondary);
    border: 1px solid transparent;
}
.visual-block span {
    display: block;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 3px;
}

/* Highlight dinámico para el bloque activo */
.visual-block.active {
    background: rgba(255, 255, 255, 0.05);
    border-color: currentColor; /* Usa el color definido por JS */
    transform: scale(1.03);
    color: white;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .main-layout { grid-template-columns: 1fr; }
    .imc-app-card { padding: 25px; }
    #imc-number { font-size: 4.5rem; }
    .imc-visual-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Responsive para móviles *//* Responsive para móviles *//* Responsive para móviles */

/* CONTENEDOR DE TARJETAS */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

/* LA TARJETA (RUTINA-CARD) */
.rutina-card {
    background: #161b22; /* Fondo oscuro táctico */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.rutina-card:hover {
    transform: translateY(-5px);
    border-color: #4facfe; /* Brillo azul al pasar el mouse */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ENCABEZADO DE LA TARJETA (Nivel y Tiempo) */
.rutina-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tag-nivel {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 8px;
    letter-spacing: 1px;
}

.tiempo {
    color: #8b949e;
    font-size: 0.75rem;
    font-weight: 600;
}

/* TÍTULOS */
.rutina-card h3 {
    margin: 0 0 20px 0;
    font-size: 1.4rem;
    color: #ffffff;
    font-weight: 700;
}

/* LISTA DE EJERCICIOS */
.ejercicios-list {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
    flex-grow: 1; /* Empuja el botón hacia abajo */
}

.ejercicios-list li {
    color: #c9d1d9;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
}

.ejercicios-list li:last-child {
    border-bottom: none;
}

/* BOTÓN GUARDAR (ESTILO TÁCTICO) */
.btn-action {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    width: 100%;
    letter-spacing: 1px;
    transition: 0.3s;
    text-transform: uppercase;
}

.btn-action:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

/* AJUSTE PARA MÓVILES */
@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* --- CONTENEDOR DE RUTINAS --- */
.rutinas-page {
    background-color: #0d1117; /* Fondo oscuro profundo */
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container-rutinas {
    width: 100%;
    max-width: 1100px; /* Evita que las tarjetas se estiren demasiado */
}

/* --- GRID DE TARJETAS --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* --- ESTILO DE LA TARJETA (RUTINA-CARD) --- */
.rutina-card {
    background: #161b22; /* El color exacto de tu index */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.rutina-card:hover {
    transform: translateY(-5px);
    border-color: #4facfe;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* --- ENCABEZADO INTERNO DE LA TARJETA --- */
.rutina-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tag-nivel {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 8px;
    text-transform: uppercase;
}

.tiempo {
    color: #8b949e;
    font-size: 0.75rem;
}

/* --- TEXTOS --- */
.rutina-card h3 {
    color: #ffffff;
    font-size: 1.4rem;
    margin: 10px 0 20px 0;
    font-weight: 700;
}

.ejercicios-list {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
    flex-grow: 1; /* Esto hace que todos los botones se alineen abajo */
}

.ejercicios-list li {
    color: #c9d1d9;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

/* --- BOTÓN GUARDAR (DEGRADADO NEÓN) --- */
.btn-action {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: 0.3s;
}

.btn-action:hover {
    filter: brightness(1.1);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}