/* ===== IMPORTAR FUENTE ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ===== VARIABLES ===== */
:root {
    --bg-body: #fafaf9;        /* Blanco roto/crema muy suave */
    --bg-surface: #ffffff;
    --bg-subtle: #f5f5f4;
    --primary: #0f172a;        /* Azul tinta muy oscuro (para textos principales) */
    --accent: #4f46e5;         /* Índigo vibrante (moderno, no genérico) */
    --accent-hover: #4338ca;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e7e5e4;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.main-header {
    background-color: var(--bg-body);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header h1 {
    color: #1e293b;
}
.main-header h1 span {
    color: #a855f7;
}

/* ===== NAVEGACIÓN ===== */
#mainNav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
#mainNav a:hover {
    color: var(--primary);
    background-color: var(--bg-subtle);
}
#mainNav a.active {
    color: var(--primary);
    background-color: var(--bg-subtle);
    font-weight: 600;
}

/* ===== CONTENEDOR ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 2rem;
    flex: 1;
    width: 100%;
}

/* ===== TÍTULOS ===== */
.page-title { margin-bottom: 3rem; max-width: 600px; }
.page-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--primary);
    margin-bottom: 1rem;
    line-height: 1.1;
}
.page-title p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* ===== TARJETAS ===== */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.08);
    border-color: #d6d3d1;
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    flex-grow: 1;
}

/* ===== BOTONES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    width: fit-content;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background-color: var(--bg-subtle);
}

/* ===== FORMULARIOS ===== */
.form-group { display: flex; flex-direction: column; margin-bottom: 1.5rem; }
.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.form-group input, .form-group select, .form-group textarea {
    padding: 0.8rem 1rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ===== FOOTER ===== */
.main-footer {
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    padding: 2rem;
    font-size: 0.9rem;
    margin-top: auto;
    text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .header-container { flex-direction: column; align-items: flex-start; gap: 1rem; padding: 1.5rem; }
    #mainNav { width: 100%; overflow-x: auto; }
    .container { padding: 2rem 1.5rem; }
    .page-title h2 { font-size: 2rem; }
}

/* ===== ESTILOS PARA FORMULARIOS COMPACTOS (CONFIGURACIÓN) ===== */
.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.card-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.card-section h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Miembros del comité (filas compactas) */
.miembro-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.2fr 40px;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f0f4f8;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    box-shadow: -4px -4px 10px rgba(255, 255, 255, 0.8), 4px 4px 10px rgba(163, 177, 198, 0.2);
}
.miembro-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.miembro-row .form-group {
    margin: 0 !important;
}
.miembro-row label {
    font-size: 0.75rem !important;
    margin-bottom: 0.2rem !important;
}

/* Botón de borrar cuadrado y centrado */
.btn-icon {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #ef4444;
    border-radius: 6px;
    cursor: pointer;
    height: 42px;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.9rem;
    padding: 0;
}
.btn-icon:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

/* Ajustes responsive para formularios */
@media (max-width: 1024px) {
    .grid-form {
        grid-template-columns: 1fr;
    }
    .miembro-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding-bottom: 1rem;
        border-bottom: 1px dashed var(--border);
    }
    .btn-icon {
        width: 100%;
    }
}

/* ===== ESTILOS PARA SELECTORES (DESPLEGABLES) ===== */
select {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2364748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right .7rem top 50%;
    background-size: .65rem auto;
}
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* =========================================
   MAGIA PARA LA PÁGINA DE FASES
   ========================================= */

/* Contenedor principal de la fase */
.fase-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    padding: 0;
    overflow: hidden;
    margin-bottom: 3rem;
}

/* Cabecera de la Fase (Estilo banner superior) */
.fase-header-custom {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 2.5rem 3rem;
    border-bottom: 1px solid #f1f5f9;
}

.fase-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.fase-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
}

/* Bloques de los pasos */
.paso-bloque {
    padding: 2.5rem 3rem;
    border-bottom: 1px solid #f1f5f9;
}
.paso-bloque:last-child {
    border-bottom: none;
}

.paso-titulo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #4f46e5; /* Índigo, nuestro color de acento */
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Grid de la información (Cajas blancas con borde sutil) */
.info-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(0,0,0,0.05);
    border-color: #cbd5e1;
}

.info-box strong {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.info-box p {
    margin: 0;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.5;
    font-weight: 500;
}

/* Formulario en línea (Estilo "Tarjeta de acción") */
.form-inline .form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.4rem;
}

/* Botón generador */
.btn-generar {
    width: 100%;
    padding: 1rem;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-generar:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.4);
}

/* Responsive */
@media (max-width: 1024px) {
    .info-grid, .fase-header-custom, .paso-bloque {
        padding: 1.5rem;
    }
    .fase-title {
        font-size: 1.4rem;
    }
}

/* ===== MEJORAS VISUALES PARA CONFIGURACIÓN ===== */

/* Fondo general más cálido */
body {
    background-color: #f8fafc;
}

/* Las tarjetas de sección (Empresa, Comité, Fechas) */
.card-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
}

.card-section h3 {
    font-size: 1.25rem;
    color: #0f172a;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Etiquetas de las secciones internas (Por la Empresa / Por los Trabajadores) */
.card-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #4f46e5;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-section h4::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: #4f46e5;
    border-radius: 2px;
}

/* Botón de añadir miembro */
.btn-secondary {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    color: #475569;
    font-weight: 500;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    transition: all 0.2s;
}
.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #4f46e5;
    color: #4f46e5;
}

/* Responsive */
@media (max-width: 1024px) {
    .miembro-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 1rem;
        align-items: stretch;
    }
    .btn-icon {
        width: 100%;
    }
}

/* ===== MAGIA VISUAL DEFINITIVA (Relieve, Sombras y Color) ===== */

body {
    /* Un fondo ligeramente degradado hacia el azul para que no sea plano */
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    background-attachment: fixed;
}

/* 1. Tarjetas de Sección (Datos de la empresa, comité, etc.) */
.card-section {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    /* Sombra suave y elevada */
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.05), 
                0 0 0 1px rgba(15, 23, 42, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -15px rgba(15, 23, 42, 0.08), 
                0 0 0 1px rgba(15, 23, 42, 0.02);
}

/* 2. Títulos de las secciones con un toque de color */
.card-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

/* 3. Inputs y Selects (Efecto de relieve) */
.form-group input, 
.form-group select, 
.form-group textarea {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: #1e293b;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.form-group input:hover, 
.form-group select:hover {
    border-color: #cbd5e1;
    background-color: #ffffff;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    background-color: #ffffff;
    border-color: #6366f1; /* Índigo brillante */
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), inset 0 2px 4px rgba(0,0,0,0.01);
    outline: none;
}

/* 4. Filas de Miembros del Comité (Cajas con relieve) */
.miembro-row {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.miembro-row:hover {
    border-color: #c7d2fe;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.08);
}

/* 5. Botón de guardar más imponente */
.btn-primary {
    background: #4f46e5; /* Índigo */
    color: white;
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.4);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(79, 70, 229, 0.5);
}

/* 6. Botón de añadir miembro */
.btn-secondary {
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    color: #64748b;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s;
}
.btn-secondary:hover {
    border-color: #4f46e5;
    color: #4f46e5;
    background: #eef2ff;
}

/* =========================================
   EFECTO 3D (NEUMORFISMO SUAVE)
   ========================================= */

/* Fondo base ligeramente gris para que resalten las sombras */
body {
    background-color: #f0f4f8 !important; 
    background-image: none !important;
}

/* 1. Tarjetas principales (Relieve hacia fuera) */
.card-section {
    background: #f0f4f8;
    border-radius: 20px;
    border: 1px solid #ffffff;
    box-shadow: 
        -8px -8px 16px rgba(255, 255, 255, 0.8), /* Luz arriba-izquierda */
        8px 8px 16px rgba(163, 177, 198, 0.3);   /* Sombra abajo-derecha */
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    transition: box-shadow 0.2s;
}

.card-section:hover {
    box-shadow: 
        -10px -10px 20px rgba(255, 255, 255, 0.9),
        10px 10px 20px rgba(163, 177, 198, 0.4);
}

/* 2. Inputs y Selects (Relieve hundido o "inset") */
.form-group input, 
.form-group select, 
.form-group textarea {
    background-color: #f0f4f8 !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 0.85rem 1rem !important;
    color: #1e293b !important;
    font-weight: 500;
    box-shadow: 
        inset 4px 4px 8px rgba(163, 177, 198, 0.4),
        inset -4px -4px 8px rgba(255, 255, 255, 0.9) !important;
    transition: all 0.2s ease;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none !important;
    box-shadow: 
        inset 2px 2px 4px rgba(163, 177, 198, 0.4),
        inset -2px -2px 4px rgba(255, 255, 255, 0.9),
        0 0 0 3px rgba(79, 70, 229, 0.2) !important;
}

/* 3. Filas de Miembros (Relieve hacia fuera, más sutil) */
.miembro-row {
    background: #f0f4f8;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        -4px -4px 10px rgba(255, 255, 255, 0.8),
        4px 4px 10px rgba(163, 177, 198, 0.2);
    padding: 1.25rem;
    margin-bottom: 1rem;
    align-items: end;
}

/* 4. Botón de la "X" (Relieve hacia fuera en rojo suave) */
.btn-icon {
    background: #f0f4f8;
    border: none;
    color: #ef4444;
    border-radius: 50%; /* Más redondo y orgánico */
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        -3px -3px 6px rgba(255, 255, 255, 0.8),
        3px 3px 6px rgba(163, 177, 198, 0.3);
    transition: all 0.1s;
    cursor: pointer;
}

.btn-icon:hover {
    box-shadow: 
        inset 3px 3px 6px rgba(163, 177, 198, 0.3),
        inset -3px -3px 6px rgba(255, 255, 255, 0.8);
    color: #b91c1c;
}

.btn-icon:active {
    box-shadow: 
        inset 4px 4px 8px rgba(163, 177, 198, 0.4),
        inset -4px -4px 8px rgba(255, 255, 255, 0.9);
}

/* 5. Botón de Guardar (Relieve elevado) */
.btn-primary {
    background: #6366f1;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 600;
    box-shadow: 
        -4px -4px 10px rgba(255, 255, 255, 0.6),
        4px 4px 10px rgba(99, 102, 241, 0.4);
    transition: all 0.1s;
}

.btn-primary:hover {
    background: #4f46e5;
    box-shadow: 
        -6px -6px 12px rgba(255, 255, 255, 0.7),
        6px 6px 12px rgba(79, 70, 229, 0.5);
}

.btn-primary:active {
    box-shadow: 
        inset 4px 4px 8px rgba(0, 0, 0, 0.2),
        inset -4px -4px 8px rgba(255, 255, 255, 0.2);
}

/* 6. Botón Añadir miembro */
.btn-secondary {
    background: #f0f4f8;
    border: none;
    color: #475569;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.6rem 1.2rem;
    box-shadow: 
        -4px -4px 10px rgba(255, 255, 255, 0.8),
        4px 4px 10px rgba(163, 177, 198, 0.3);
}

.btn-secondary:hover {
    color: #4f46e5;
    box-shadow: 
        -6px -6px 12px rgba(255, 255, 255, 0.9),
        6px 6px 12px rgba(163, 177, 198, 0.4);
}

/* ===== ENLACES A GUÍAS DENTRO DE LAS TARJETAS ===== */
.link-guia {
    display: inline-block;
    margin-top: 0.8rem;
    font-size: 0.75rem;
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    background: #e0e7ff;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    transition: all 0.2s;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.link-guia:hover {
    background: #6366f1;
    color: #ffffff;
    text-decoration: none;
}

.fase-tarjeta.activa .link-guia {
    background: #f1f5f9;
    color: #475569;
}

.fase-tarjeta.activa .link-guia:hover {
    background: #6366f1;
    color: #ffffff;
}

/* ===== SUB-PESTAÑAS DE LA FASE 2 ===== */
.tab-btn {
    padding: 0.6rem 1rem;
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s;
}
.tab-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.tab-btn.active {
    background: var(--primary);
    color: white;
}
.sub-tab-content {
    display: none;
}
.sub-tab-content.active {
    display: block;
}


/* ===== NAVEGACIÓN ESTILO PESTAÑAS ===== */
/* Colores de etiqueta y llave según tipo */
.tab-grupo-obligatorio .tab-grupo-etiqueta {
    color: #4f46e5;
}
.tab-grupo-recomendado .tab-grupo-etiqueta {
    color: #10b981;
}
.tab-grupo-herramienta .tab-grupo-etiqueta {
    color: #94a3b8;
}

.tab-grupo-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid transparent;
}

.tab-grupo-obligatorio .tab-grupo-tabs { border-bottom-color: #4f46e5; }
.tab-grupo-recomendado .tab-grupo-tabs { border-bottom-color: #10b981; }
.tab-grupo-herramienta .tab-grupo-tabs { border-bottom-color: #94a3b8; }

.tab {
    padding: 0.6rem 1rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.15s ease;
    position: relative;
    top: 2px;
}

.tab:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.tab.tab-activa {
    background: #ffffff;
    font-weight: 600;
    border-color: #e2e8f0;
    border-bottom-color: #ffffff;
    z-index: 1;
}

.tab.tab-obligatorio.tab-activa { color: #4f46e5; }
.tab.tab-recomendado.tab-activa { color: #10b981; }
.tab.tab-herramienta.tab-activa { color: #64748b; }

/* Responsive: en pantallas pequeñas, scroll horizontal */
@media (max-width: 900px) {
    .tab-grupo-etiqueta {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    padding-bottom: 0.3rem;
    pointer-events: none;
}
    .tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}



/* ===== NAVEGACIÓN CON GRUPOS Y LLAVES ===== */
.tab-grupo {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: 1.5rem;
}

.tab-grupo-etiqueta {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    padding-bottom: 0.3rem;
    pointer-events: none;
}

.tab-grupo-obligatorio .tab-grupo-etiqueta {
    color: #4f46e5;
}
.tab-grupo-recomendado .tab-grupo-etiqueta {
    color: #10b981;
}

.tab-grupo-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid transparent;
}
.tab-grupo-obligatorio .tab-grupo-tabs { border-bottom-color: #4f46e5; }
.tab-grupo-recomendado .tab-grupo-tabs { border-bottom-color: #10b981; }

.tab {
    padding: 0.6rem 1rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.15s ease;
    position: relative;
    top: 2px;
}

.tab:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.tab.tab-activa {
    background: #ffffff;
    font-weight: 600;
    border-color: #e2e8f0;
    border-bottom-color: #ffffff;
    z-index: 1;
}
.tab.tab-obligatorio.tab-activa { color: #4f46e5; }
.tab.tab-recomendado.tab-activa { color: #10b981; }

@media (max-width: 900px) {
    .tab-grupo-etiqueta {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    padding-bottom: 0.3rem;
    pointer-events: none;
}
    .tab { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
}


/* ===== ENLACES DE CABECERA (INICIO Y CONFIGURACIÓN) ===== */
.header-link {
    font-size: 0.85rem;
    color: #64748b;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.header-link:hover {
    background: #f1f5f9;
    color: #1e293b;
}
.header-link-activa {
    color: #4f46e5;
    background: #eef2ff;
    font-weight: 600;
}

/* ===== NAVEGACIÓN CON GRUPOS Y LLAVES (sin cajas) ===== */
.tab-grupo {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: 1.2rem;
}

.tab-grupo-etiqueta {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    padding-bottom: 0.3rem;
    pointer-events: none;
}

.tab-grupo-obligatorio .tab-grupo-etiqueta {
    color: #4f46e5;
}
.tab-grupo-recomendado .tab-grupo-etiqueta {
    color: #10b981;
}

.tab-grupo-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid transparent;
}
.tab-grupo-obligatorio .tab-grupo-tabs { border-bottom-color: #4f46e5; }
.tab-grupo-recomendado .tab-grupo-tabs { border-bottom-color: #10b981; }

.tab {
    padding: 0.6rem 1rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.15s ease;
    position: relative;
    top: 2px;
}

.tab:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.tab.tab-activa {
    background: #ffffff;
    font-weight: 600;
    border-color: #e2e8f0;
    border-bottom-color: #ffffff;
    z-index: 1;
}
.tab.tab-obligatorio.tab-activa { color: #4f46e5; }
.tab.tab-recomendado.tab-activa { color: #10b981; }

@media (max-width: 900px) {
    .tab-grupo-etiqueta {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    padding-bottom: 0.3rem;
    pointer-events: none;
}
    .tab { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
}


/* ===== ASISTENTES EN ACTAS ===== */
.asistente-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    padding: 0.25rem 0;
}
.asistente-row span {
    color: #334155;
    line-height: 1.3;
}
.select-asistencia {
    min-width: 130px;
    width: auto;
    padding: 0.4rem 1.8rem 0.4rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    background-position: right 0.4rem center;
    background-size: 0.6rem auto;
    cursor: pointer;
    flex-shrink: 0;
}
.select-asistencia:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}


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

/* ===== RESPONSIVE PARA MÓVILES Y TABLETS ===== */

/* Tablets (hasta 1024px) */
@media (max-width: 1024px) {
    .container { padding: 2rem 1.5rem; }
    .page-title h2 { font-size: 2rem; }
    .header-container { flex-wrap: wrap; gap: 1rem; }
    .header-link { padding: 0.3rem 0.5rem; font-size: 0.8rem; }
    .tab { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
}

/* Móviles (hasta 768px) */
@media (max-width: 1024px) {
    /* Cabecera */
    .header-container {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }
    .header-container h1 { font-size: 1.1rem; }
    .header-link { font-size: 0.75rem; padding: 0.3rem 0.5rem; }
    /* Navegación de pestañas */
    .tab-grupo { padding-top: 1rem; }
    .tab-grupo-etiqueta {
        font-size: 0.5rem;
        padding-bottom: 0.2rem;
    }
    .tab {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Contenido general */
    .container { padding: 1.5rem 1rem; }
    .page-title h2 { font-size: 1.5rem; }
    .page-title p { font-size: 0.95rem; }
    .card { padding: 1.25rem; }
    .card-section { padding: 1.25rem; }

    /* Grids: 1 columna en móvil */
    .grid-form,
    .info-grid,
    .form-inline,
    [style*="grid-template-columns: repeat(auto-fit"],
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Asistentes en actas: apilados */
    .asistente-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    .asistente-row .select-asistencia {
        width: 100% !important;
        margin-top: 0.25rem;
    }

    /* Miembros del comité: apilados */
    .miembro-row {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
        padding: 1rem;
    }

    /* Botones: ancho completo en móvil */
    .btn, .btn-generar, .btn-backup {
        width: 100%;
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
    }

    /* Editor Quill: más pequeño */
    .ql-toolbar { font-size: 0.8rem; }
    .ql-container { font-size: 0.85rem; }

    /* Tablas: scroll horizontal */
    table { display: block; overflow-x: auto; white-space: nowrap; }

    /* Avisos y tarjetas: padding reducido */
    [style*="padding: 1.5rem"] { padding: 1rem !important; }
    [style*="padding: 2rem"] { padding: 1rem !important; }

    /* Footer: apilado */
    .main-footer {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        padding: 1rem;
    }
}

/* Móviles muy pequeños (hasta 480px) */
@media (max-width: 480px) {
    .page-title h2 { font-size: 1.3rem; }
    .tab-grupo-etiqueta { font-size: 0.45rem; letter-spacing: 0; }
    .tab { padding: 0.35rem 0.5rem; font-size: 0.7rem; }
    .header-container h1 { font-size: 1rem; }
    .card h3, .card-section h3 { font-size: 1.05rem; }
}












/* ===== NAV EN MÓVIL: PILLS CON DEGRADADO INDICADOR ===== */
@media (max-width: 1024px) {
    /* Contenedor del nav: scroll horizontal con degradado a la derecha */
    /* Ocultar barra de scroll nativa y poner una fina */
    /* Degradado en el borde derecho para indicar que hay más */
    
    
    /* Ocultar las etiquetas de grupo en móvil */
    .tab-grupo-etiqueta {
        display: none;
    }
    
    /* Grupos: sin padding extra, las pestañas se ven todas juntas */
    .tab-grupo {
        flex-shrink: 0;
        padding-top: 0;
        display: flex;
    }
    .tab-grupo-tabs {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.5rem;
        border-bottom: none;
    }
    .tab-grupo-obligatorio .tab-grupo-tabs,
    .tab-grupo-recomendado .tab-grupo-tabs {
        border-bottom: none;
    }
    
    /* Pestañas tipo "pill" */
    .tab {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        border-radius: 20px;
        border: 1px solid #e2e8f0;
        background: #ffffff;
        color: #64748b;
        position: static;
        box-shadow: 0 1px 2px rgba(0,0,0,0.02);
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }
    .tab.tab-activa {
        background: #4f46e5;
        color: #ffffff;
        font-weight: 600;
        border-color: #4f46e5;
        box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
    }
    .tab.tab-recomendado.tab-activa {
        background: #10b981;
        color: #ffffff;
        border-color: #10b981;
        box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
    }
    
    /* Punto de color a la izquierda de cada pestaña (indica el grupo) */
    .tab::before {
        content: '';
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        flex-shrink: 0;
    }
    .tab.tab-obligatorio::before { background: #4f46e5; }
    .tab.tab-recomendado::before { background: #10b981; }
    .tab.tab-herramienta::before { background: #94a3b8; }
    .tab.tab-activa::before { background: #ffffff; }
    
    /* Cabecera: enlaces arriba en una fila */
    .header-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
    
    /* Contenedor del nav sin padding lateral extra */
    header .main-header > div[style*="max-width: 1200px"],
    header .main-header > div[style*="max-width: 1100px"] {
        padding: 0 0 0.5rem 0 !important;
        max-width: 100% !important;
    }
}


/* ===== INDICADOR DE PESTAÑAS (solo visible en móvil) ===== */
#indicador-pestanas {
    display: none !important; /* Oculto SIEMPRE en escritorio y tablet */
}

@media (max-width: 1024px) {
    #indicador-pestanas {
        display: block !important;
        text-align: center;
        font-size: 0.7rem;
        color: #94a3b8;
        padding: 0.4rem 0;
        font-style: italic;
        background: #f1f5f9;
        border-bottom: 1px solid #e2e8f0;
        letter-spacing: 0.03em;
    }
}

/* ===== SELECTOR DE USUARIO: OCULTO POR DEFECTO ===== */
/* Solo se muestra en páginas que lo necesitan (Actas, Reuniones) */
body.mostrar-selector /* ===== OCULTAR NAV DE PESTAÑAS EN LA PÁGINA DE INICIO ===== */
body.page-inicio #mainNav {
    display: none;
}


/* Enlaces de la cabecera (Inicio, Reuniones, Actas, Configuración) */
.header-link {
    color: #6b21a8;
    font-weight: 500;
}
.header-link:hover {
    background: #e9d5ff;
    color: #4c1d95;
}
.header-link-activa {
    background: #e9d5ff;
    color: #4c1d95;
    font-weight: 700;
}

/* Selector de usuario */
/* Botón Guía de Uso */
#guia-uso-btn {
    background: #f3e8ff;
    border: 1px solid #e9d5ff;
    color: #6b21a8;
}
#guia-uso-btn:hover {
    background: #e9d5ff;
    border-color: #d8b4fe;
}

/* Pestañas de navegación (tabs-nav) */
.tab {
    color: #7c3aed;
}
.tab:hover {
    background: #f3e8ff;
    color: #4c1d95;
}
.tab.tab-activa {
    background: #ffffff;
    color: #6b21a8;
    border-color: #e9d5ff;
    border-bottom-color: #ffffff;
}
.tab-grupo-obligatorio .tab-grupo-etiqueta {
    color: #7c3aed;
}
.tab-grupo-recomendado .tab-grupo-etiqueta {
    color: #a855f7;
}


/* ===== CABECERA CON PALETA PASTEL Y ESTRUCTURA LIMPIA ===== */
.main-header {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-bottom: 1px solid #e9d5ff;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.main-header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #1e293b;
    margin: 0;
    white-space: nowrap;
}
.main-header h1 span {
    color: #a855f7;
}

/* Enlaces de la cabecera */
.header-link {
    font-size: 0.85rem;
    color: #6b21a8;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.header-link:hover {
    background: #e9d5ff;
    color: #4c1d95;
}
.header-link-activa {
    background: #e9d5ff;
    color: #4c1d95;
    font-weight: 600;
}

/* Selector de usuario y botón de guía */
.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
/* Botón Guía de Uso */
#guia-uso-btn {
    padding: 0.4rem 0.8rem;
    background: #f3e8ff;
    border: 1px solid #e9d5ff;
    color: #6b21a8;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
}
#guia-uso-btn:hover {
    background: #e9d5ff;
    border-color: #d8b4fe;
}

/* Pestañas de navegación */
.tab {
    color: #7c3aed;
}
.tab:hover {
    background: #f3e8ff;
    color: #4c1d95;
}
.tab.tab-activa {
    background: #ffffff;
    color: #6b21a8;
    border-color: #e9d5ff;
    border-bottom-color: #ffffff;
}
.tab-grupo-obligatorio .tab-grupo-etiqueta {
    color: #7c3aed;
}
.tab-grupo-recomendado .tab-grupo-etiqueta {
    color: #a855f7;
}

/* Responsive: en móvil, apilar todo */
@media (max-width: 1024px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .header-controls {
        justify-content: space-between;
    }
}


/* ===== SELECTOR DE USUARIO (único, limpio) ===== */
.user-selector {
    display: none; /* Oculto por defecto */
}
body.mostrar-selector .user-selector {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}
.user-selector span {
    font-size: 0.8rem;
    color: #7c3aed;
}
.user-selector select {
    padding: 0.4rem;
    border-radius: 6px;
    border: 1px solid #e9d5ff;
    background: #ffffff;
    color: #4c1d95;
    font-size: 0.85rem;
}

/* Forzar ocultación del nav en Inicio (máxima prioridad) */
html body.page-inicio nav#mainNav.tabs-nav,
html body.page-inicio #mainNav {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}


/* ===== NAVEGACIÓN DE PESTAÑAS (ÚNICO BLOQUE LIMPIO) ===== */
.tabs-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 1.5rem;
    padding: 0.5rem 0.5rem 0 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border-bottom: 2px solid #e2e8f0;
    width: 100%;
    max-width: 100%;
    touch-action: pan-x;
}

/* Ocultar scrollbar en Chrome/Safari (pero mantener funcionalidad) */
.tabs-nav::-webkit-scrollbar {
    height: 4px;
}
.tabs-nav::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* Grupos */
.tab-grupo {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: 1.5rem;
    flex-shrink: 0;
}

.tab-grupo-etiqueta {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    padding-bottom: 0.4rem;
    pointer-events: none;
}

.tab-grupo-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid transparent;
}

/* Colores de grupo */
.tab-grupo-obligatorio .tab-grupo-tabs { border-bottom-color: #4f46e5; }
.tab-grupo-recomendado .tab-grupo-tabs { border-bottom-color: #10b981; }
.tab-grupo-obligatorio .tab-grupo-etiqueta { color: #4f46e5; }
.tab-grupo-recomendado .tab-grupo-etiqueta { color: #10b981; }

/* Pestañas */
.tab {
    padding: 0.6rem 1rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.15s ease;
    position: relative;
    top: 2px;
    flex-shrink: 0;
}

.tab:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.tab.tab-activa {
    background: #ffffff;
    font-weight: 600;
    border-color: #e2e8f0;
    border-bottom-color: #ffffff;
    z-index: 1;
}

.tab.tab-obligatorio.tab-activa { color: #4f46e5; }
.tab.tab-recomendado.tab-activa { color: #10b981; }

/* Responsive: en móvil, ajustar tamaños */
@media (max-width: 768px) {
    .tabs-nav { gap: 1rem; padding: 0.5rem 0.5rem 0 0.5rem; }
    .tab-grupo-etiqueta { font-size: 0.55rem; }
    .tab { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
}

/* ===== OCULTAR NAV DE PESTAÑAS EN PÁGINAS QUE NO SON DEL PLAN ===== */
body.sin-nav-tabs .tabs-nav {
    display: none !important;
}

/* ===== CONTADOR DE PLAZO EN LA CABECERA ===== */
#contador-plazo {
    font-size: 0.7rem;
    font-weight: 600;
    text-align: right;
    margin-top: 0.25rem;
    white-space: nowrap;
    padding-right: 0.5rem;
}





/* ===== CABECERA EN MÓVIL: ORDEN Y VISIBILIDAD ===== */
@media (max-width: 768px) {
    .header-container {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 0.75rem;
        gap: 0.25rem;
    }
    
    /* Título a la izquierda */
    .header-container h1 {
        font-size: 0.95rem;
        margin: 0;
        order: 1;
        white-space: nowrap;
    }
    
    /* Controles a la derecha (Guía + Contador) */
    .header-controls {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 0.4rem !important;
        order: 2;
        margin-left: auto;
        flex-wrap: nowrap;
    }
    
    #guia-uso-btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    #contador-plazo {
        font-size: 0.6rem;
        margin-top: 0 !important;
        padding-right: 0 !important;
        white-space: nowrap;
    }
    
    /* Enlaces en una fila debajo, con scroll horizontal */
    .header-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
}


/* ===== ENLACES DE CABECERA (ÚNICO BLOQUE LIMPIO) ===== */
#headerLinks {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.header-link {
    font-size: 0.85rem;
    color: #6b21a8;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.header-link:hover {
    background: #e9d5ff;
    color: #4c1d95;
}

.header-link-activa {
    background: #e9d5ff;
    color: #4c1d95;
    font-weight: 600;
}

/* Responsive: en móvil, enlaces en fila con scroll */
@media (max-width: 768px) {
    #headerLinks {
        display: flex !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.1rem;
        order: 3;
        width: 100%;
        justify-content: flex-start;
        padding: 0.25rem 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    #headerLinks::-webkit-scrollbar {
        display: none;
    }
    .header-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* FORZAR VISIBILIDAD DE ENLACES EN MÓVIL (MÁXIMA PRIORIDAD) */
@media (max-width: 768px) {
    #headerLinks {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        order: 3 !important;
        margin: 0.5rem 0 0 0 !important;
        padding: 0 !important;
        background: transparent !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        gap: 0.25rem !important;
    }
    #headerLinks .header-link {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #6b21a8 !important;
        font-size: 0.75rem !important;
        padding: 0.3rem 0.5rem !important;
        white-space: nowrap !important;
    }
}

/* Quitar el borde de foco del enlace del título */
.header-container h1 a {
    text-decoration: none;
    color: inherit;
    outline: none;
}
.header-container h1 a:focus {
    outline: none;
    box-shadow: none;
}
/* Opcional: efecto hover sutil */
.header-container h1 a:hover {
    opacity: 0.8;
}

/* ===== SCROLL HORIZONTAL CONTROLADO EN MÓVIL ===== */
@media (max-width: 768px) {
    .tabs-nav {
        touch-action: pan-x;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100vw;
    }
}

/* ===== FIX PARA EL PASO 1 EN MÓVIL: EVITAR DESBORDAMIENTO ===== */
@media (max-width: 768px) {
    /* Forzar que los grids del Paso 1 se apilen en una columna */
    .paso-bloque .info-grid,
    .paso-bloque /* Asegurar que los inputs y selects no se salgan */
    .paso-bloque input,
    .paso-bloque select,
    .paso-bloque textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Contener el bloque completo */
    .paso-bloque {
        overflow: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .contenido-fase {
        overflow: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ===== FIX PARA QUE LOS GRIDS DE LA FASE 1 SE APILEN EN MÓVIL ===== */
@media (max-width: 768px) {
    /* Forzar que todos los form-inline e info-grid se apilen en 1 columna */
    .form-inline,
    .info-grid,
    .paso-bloque .form-inline,
    .paso-bloque /* Asegurar que los inputs y selects no se salgan */
    /* Contener el bloque completo del paso */
    .paso-bloque {
        overflow: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Contener el contenido de la fase */
    .contenido-fase {
        overflow: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 1rem !important;
    }
}

@media (max-width: 768px) {
    .form-inline > div[style*="grid-column: span 2"] {
        grid-column: span 1 !important;
    }
}

/* ===== FIX DEFINITIVO PARA LA FASE 1 EN MÓVIL ===== */
@media (max-width: 768px) {
    /* Forzar 1 columna en todos los grids de la Fase 1 */
    .contenido-fase .form-inline,
    .contenido-fase .info-grid,
    .paso-bloque .form-inline,
    .paso-bloque .info-grid,
    .form-inline,
    /* Forzar que los inputs, selects y textareas ocupen todo el ancho */
    .contenido-fase input,
    .contenido-fase select,
    .contenido-fase textarea,
    .paso-bloque input,
    .paso-bloque select,
    .paso-bloque textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    /* Quitar cualquier span 2 en móvil */
    .contenido-fase [style*="grid-column: span 2"],
    .paso-bloque [style*="grid-column: span 2"] {
        grid-column: span 1 !important;
    }

    /* Contener los bloques */
    .contenido-fase,
    .paso-bloque {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 1rem !important;
        box-sizing: border-box !important;
    }
}


/* ===== FORM-INLINE E INFO-GRID (ÚNICO BLOQUE LIMPIO) ===== */
.form-inline {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.info-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(0,0,0,0.05);
    border-color: #cbd5e1;
}

.info-box strong {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.info-box p {
    margin: 0;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.5;
    font-weight: 500;
}

/* Responsive: en móvil, 1 columna */
@media (max-width: 768px) {
    .form-inline,
    .info-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
    }
    .form-inline > div,
    .info-grid > div {
        grid-column: span 1 !important;
    }
}

/* ===== TARJETAS DE PASO EN MÓVIL: BOTÓN DEBAJO DEL TEXTO ===== */
@media (max-width: 768px) {
    /* Forzar que las tarjetas de paso permitan wrap */
    #fase1-lista-pasos > div,
    #fase2-lista-pasos > div {
        flex-wrap: wrap !important;
        align-items: flex-start !important;
    }
    
    /* El botón ocupa todo el ancho (o se alinea a la izquierda) */
    #fase1-lista-pasos > div > button,
    #fase2-lista-pasos > div > button {
        width: 100% !important;
        margin-top: 0.75rem;
        justify-content: center;
    }
    
    /* Ajustar el texto de la explicación */
    #fase1-lista-pasos > div > div > p,
    #fase2-lista-pasos > div > div > p {
        font-size: 0.85rem;
        line-height: 1.6;
    }
}

/* ===== SELECTS DE LA TABLA DE MEDIDAS ===== */
#tabla-medidas-contenedor select {
    width: 100% !important;
    min-width: 140px;
    padding: 0.4rem 2rem 0.4rem 0.6rem !important;
    background-position: right 0.6rem center !important;
    font-size: 0.85rem !important;
    box-sizing: border-box;
}

#tabla-medidas-contenedor input[type="text"] {
    width: 100% !important;
    padding: 0.4rem 0.6rem !important;
    font-size: 0.85rem !important;
    box-sizing: border-box;
}

/* ===== TABLA DE SEGUIMIENTO: ANCHO MÍNIMO DE COLUMNAS ===== */
#tabla-seguimiento-contenedor table th:nth-child(5),
#tabla-seguimiento-contenedor table td:nth-child(5),
#tabla-seguimiento-contenedor table th:nth-child(6),
#tabla-seguimiento-contenedor table td:nth-child(6),
#tabla-seguimiento-contenedor table th:nth-child(7),
#tabla-seguimiento-contenedor table td:nth-child(7),
#tabla-seguimiento-contenedor table th:nth-child(8),
#tabla-seguimiento-contenedor table td:nth-child(8) {
    min-width: 180px;
}
