/* Establece el layout principal en pantalla completa usando flexbox */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
}

.layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* NAVBAR (arriba) */
.custom-navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: all 0.3s ease;
}

.custom-navbar .navbar {
    padding: 0.75rem 1.25rem;
}

.custom-navbar .navbar-brand {
    font-weight: 700;
    color: #1a1a1a;
    transition: color 0.2s;
    font-size: 1.15rem;
}

.custom-navbar .navbar-brand:hover {
    color: #3b82f6;
}

.custom-navbar .nav-link {
    font-weight: 500;
    color: #4b5563;
    padding: 0.5rem 0.85rem;
    margin: 0 0.15rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

.custom-navbar .nav-link:hover, 
.custom-navbar .nav-link.active {
    color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.06);
}

.custom-navbar .dropdown-menu {
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    padding: 0.5rem 0;
}

.custom-navbar .dropdown-item {
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    color: #4b5563;
    transition: all 0.2s;
}

.custom-navbar .dropdown-item:hover {
    background-color: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
}

/* CONTENIDO (crece para llenar el espacio disponible) */
.contenido {
    flex: 1;
    padding: 1.75rem 1.5rem;
    background-color: #f8fafc;
    width: 100%;
}

/* FOOTER (pegado al fondo) */
.footer {
    background-color: #1e293b;
    color: white;
    text-align: center;
    padding: 1rem;
}

/* Centrar enlaces */
.navbar-nav.mx-auto {
    justify-content: center;
}

.custom-navbar .navbar-text {
    font-weight: 500;
    color: #4b5563;
    margin-right: 1rem;
    padding: 0.5rem 0;
}

.custom-navbar .navbar-text u {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 600;
}

/* Asegurar tablas responsivas */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Botones con accesibilidad táctil en móvil */
button, input[type="submit"], input[type="button"], a.btn {
    min-height: 38px;
    touch-action: manipulation;
}

/* ==========================================================================
   MEDIA QUERIES PARA RESPONSIVIDAD MÓVIL Y DESKTOP
   ========================================================================== */
@media (min-width: 992px) {
    .custom-navbar .container-fluid {
        position: relative;
    }
    .custom-navbar .navbar-nav.mx-auto {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .contenido {
        padding: 1rem 0.75rem;
    }

    .custom-navbar .navbar {
        padding: 0.6rem 0.85rem;
    }

    .custom-navbar .nav-link {
        padding: 0.6rem 0.75rem;
        margin: 0.15rem 0;
    }
}

@media (max-width: 480px) {
    .contenido {
        padding: 0.75rem 0.5rem;
    }
}