/* ===== RESET Y VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #005baa;
    --primary-dark: #00417a;
    --accent: #ffd166;
    --success: #28a745;
    --danger: #dc3545;
    --dark: #1a1a2e;
    --light: #f4f7fb;
    --border: #e0e6ed;
    --text: #333;
    --gray: #6b7280;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--light);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ===== NAVBAR ===== */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--dark);
}

.brand-icon {
    font-size: 2rem;
}

.brand strong {
    display: block;
    font-size: 1.05rem;
    color: var(--primary);
}

.brand small {
    display: block;
    font-size: 0.75rem;
    color: var(--gray);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.92rem;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    display: block;
}

.nav-links a:hover {
    background: var(--light);
    color: var(--primary);
}

.nav-links a.active {
    background: var(--primary);
    color: #fff;
}

.nav-links a.disabled {
    color: #b0b7c3;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.nav-links a.disabled::after {
    content: '🔒';
    margin-left: 5px;
    font-size: 0.75rem;
}

/* Botón hamburguesa */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dark);
    transition: 0.3s;
    margin: 0 auto;
}

/* ===== HERO (HOME) ===== */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.hero p {
    font-size: 1.05rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.92;
}

/* ===== MÓDULOS (HOME) ===== */
.modulos {
    flex: 1;
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 40px;
    font-weight: 600;
}

.grid-modulos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.modulo-card {
    background: #fff;
    border-radius: 15px;
    padding: 35px 30px;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    position: relative;
}

.modulo-card.activo {
    border-color: var(--primary);
    cursor: pointer;
}

.modulo-card.activo:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 91, 170, 0.2);
}

.modulo-icon {
    font-size: 2.8rem;
    margin-bottom: 15px;
}

.modulo-card h3 {
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 10px;
}

.modulo-card p {
    color: var(--gray);
    font-size: 0.92rem;
    flex-grow: 1;
    margin-bottom: 20px;
}

.modulo-btn {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.92rem;
}

.modulo-card.deshabilitado {
    opacity: 0.6;
    filter: grayscale(0.5);
    cursor: not-allowed;
}

.modulo-badge {
    display: inline-block;
    align-self: flex-start;
    background: #f0f0f0;
    color: var(--gray);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== PAGE HEADER (para páginas internas) ===== */
.page-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 45px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.page-header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.page-content {
    flex: 1;
    padding-top: 30px;
    padding-bottom: 30px;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark);
    color: #fff;
    padding: 22px 0;
    text-align: center;
    font-size: 0.88rem;
    margin-top: auto;
}

.footer .small {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 5px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 800px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 10px 15px;
        box-shadow: 0 6px 20px rgba(0,0,0,0.1);
        gap: 5px;
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        pointer-events: none;
        opacity: 0;
    }

    .nav-links.active {
        transform: translateY(0);
        pointer-events: auto;
        opacity: 1;
    }

    .nav-links a {
        padding: 12px 16px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero {
        padding: 60px 0;
    }

    .section-title {
        font-size: 1.5rem;
    }
}