﻿/* =====================================================
   MODULO HEADER IMAGENES
   SOLO PARA ESTA PAGINA
   ===================================================== */

body.module-main-theme.headerimagenes-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff !important;
    background-image: none !important;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    background-color: #ffffff;
    color: #21166f;
}

    /* =====================================================
   HEADER SUPERIOR
   ===================================================== */

    body.module-main-theme.headerimagenes-page .header-bg {
        background: #ffffff !important;
        background-size: cover;
        background-position: center;
        min-height: 84px;
        border-bottom: 1px solid rgba(33,22,111,.08);
    }

    body.module-main-theme.headerimagenes-page .header-bg-inner {
        min-height: 84px;
        display: flex;
        align-items: center;
        background: transparent !important;
    }

    /* LOGO + TEXTO INTRANET */
    body.module-main-theme.headerimagenes-page .navbar-brand {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px;
    }

        body.module-main-theme.headerimagenes-page .navbar-brand::before {
            content: "Intranet";
            font-size: 1.15rem;
            font-weight: 550;
            color: #21166f;
            order: 1;
        }

    body.module-main-theme.headerimagenes-page .brandimage {
        height: 58px !important;
        max-height: 58px !important;
        width: auto !important;
        object-fit: contain;
        order: 2;
    }

    body.module-main-theme.headerimagenes-page .navbar .nav-link,
    body.module-main-theme.headerimagenes-page .navbar .navbar-brand,
    body.module-main-theme.headerimagenes-page .navbar .btn,
    body.module-main-theme.headerimagenes-page .navbar a,
    body.module-main-theme.headerimagenes-page .navbar form button {
        color: #21166f !important;
        text-shadow: none !important;
    }

    /* =====================================================
   BARRA DEL MENU RAPIDO
   ===================================================== */

    body.module-main-theme.headerimagenes-page .topbar-links {
        max-width: 1280px;
        margin: 0 auto 14px auto;
        padding: 9px 14px !important;
        min-height: 54px;
        background: #21166f;
        border: none;
        border-radius: 18px;
        box-shadow: none;
        gap: 10px;
    }

        body.module-main-theme.headerimagenes-page .topbar-links > .small {
            display: flex !important;
            align-items: center;
            min-height: 100%;
            margin: 0;
            padding-right: 8px;
            line-height: 1.1;
            white-space: nowrap;
            font-size: .92rem;
        }

        body.module-main-theme.headerimagenes-page .topbar-links .small,
        body.module-main-theme.headerimagenes-page .topbar-links .text-muted,
        body.module-main-theme.headerimagenes-page .topbar-links b {
            color: #ffffff !important;
        }

    body.module-main-theme.headerimagenes-page .quick-nav-wrap {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    body.module-main-theme.headerimagenes-page .quick-nav {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 4px 10px !important;
        white-space: nowrap;
        font-size: .85rem;
    }

    body.module-main-theme.headerimagenes-page .quick-link {
        color: #ffffff !important;
        text-decoration: none !important;
        font-weight: 700;
        font-size: .88rem;
        line-height: 1.05;
        padding: 2px 4px;
        border-radius: 8px;
        transition: all .18s ease;
        white-space: nowrap;
    }

        body.module-main-theme.headerimagenes-page .quick-link:hover {
            background: rgba(255,255,255,.08);
            color: #d4ad45 !important;
        }

    /* =====================================================
   DROPDOWN DEL MENU
   ===================================================== */

    body.module-main-theme.headerimagenes-page .quick-dd {
        position: relative;
    }

    body.module-main-theme.headerimagenes-page .quick-dd-menu {
        position: absolute;
        top: 100%;
        left: 0;
        margin-top: 2px;
        min-width: 260px;
        background: #ffffff;
        border: 1px solid rgba(33,22,111,.12);
        border-radius: 14px;
        box-shadow: 0 18px 35px rgba(33,22,111,.14);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 8px;
        display: none;
        z-index: 2000;
    }

    body.module-main-theme.headerimagenes-page .quick-dd-menu-wide {
        min-width: 320px;
        max-height: 320px;
        overflow-y: auto;
    }

    body.module-main-theme.headerimagenes-page .quick-dd:hover > .quick-dd-menu,
    body.module-main-theme.headerimagenes-page .quick-dd.open > .quick-dd-menu {
        display: block;
    }

    body.module-main-theme.headerimagenes-page .quick-dd-item {
        display: block;
        color: #21166f !important;
        text-decoration: none !important;
        font-size: .88rem;
        font-weight: 600;
        padding: 8px 10px;
        border-radius: 10px;
        transition: background .15s ease, color .15s ease;
    }

        body.module-main-theme.headerimagenes-page .quick-dd-item:hover {
            background: #eef2ff;
            color: #21166f !important;
        }

    body.module-main-theme.headerimagenes-page .quick-dd:hover > .quick-link,
    body.module-main-theme.headerimagenes-page .quick-dd.open > .quick-link {
        color: #d4ad45 !important;
        background: rgba(255,255,255,.08);
    }

    /* botón hamburguesa */
    body.module-main-theme.headerimagenes-page .quick-nav-toggle {
        border: none;
        background: #21166f;
        color: #ffffff;
        border-radius: 10px;
        padding: 6px 10px;
        font-weight: 800;
    }

/* =====================================================
   CONTENEDOR DEL MODULO
   ===================================================== */

.headerimg-theme-page {
    flex: 1 0 auto;
    padding: 10px 0 32px;
    background: #ffffff;
}

.module-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 12px;
}

/* =====================================================
   CABECERA DEL MODULO
   ===================================================== */

.module-header {
    background: #ffffff;
    border: 1px solid rgba(33,22,111,.10);
    border-radius: 18px;
    padding: 18px 22px;
    box-shadow: 0 10px 24px rgba(33,22,111,.08);
}

.module-title {
    color: #21166f;
    font-size: 1.9rem;
    font-weight: 800;
    margin: 0;
}

.module-subtitle {
    color: #475569;
    font-size: .98rem;
    margin-top: 3px;
}

/* =====================================================
   ALERTAS
   ===================================================== */

.module-alert-success {
    border-radius: 14px;
    border: 1px solid #bbf7d0;
    background: #ecfdf5;
    color: #166534;
    box-shadow: 0 6px 14px rgba(33,22,111,.06);
}

.module-alert-danger {
    border-radius: 14px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    box-shadow: 0 6px 14px rgba(33,22,111,.06);
}

/* =====================================================
   TARJETAS
   ===================================================== */

.module-card {
    border: 1px solid rgba(33,22,111,.10) !important;
    border-radius: 20px !important;
    background: #ffffff !important;
    box-shadow: 0 16px 34px rgba(33,22,111,.08) !important;
    overflow: hidden;
}

    .module-card .card-body {
        padding: 1.35rem 1.35rem;
    }

.module-card-title {
    color: #21166f;
    font-weight: 800;
    font-size: 1.1rem;
}

/* =====================================================
   LABELS / TEXTOS
   ===================================================== */

.module-label {
    color: #21166f;
    font-weight: 700;
    margin-bottom: .35rem;
}

.module-help {
    color: #64748b;
    font-size: .82rem;
}

.module-main-text {
    color: #334155;
}

.module-muted {
    color: #64748b;
}

.module-empty {
    color: #64748b;
    padding: 1.2rem !important;
    text-align: center;
}

/* =====================================================
   INPUTS
   ===================================================== */

.module-input,
.headerimg-theme-page .form-control,
.headerimg-theme-page .form-select {
    border-radius: 12px;
    border: 1px solid rgba(33,22,111,.14);
    background: #f8f9ff;
    color: #21166f;
    box-shadow: none;
}

    .module-input:focus,
    .headerimg-theme-page .form-control:focus,
    .headerimg-theme-page .form-select:focus {
        border-color: #21166f;
        box-shadow: 0 0 0 0.2rem rgba(33,22,111,.12);
        background: #ffffff;
    }

.module-check .form-check-input:checked {
    background-color: #21166f;
    border-color: #21166f;
}

/* =====================================================
   BOTONES
   ===================================================== */

.module-btn-primary {
    background: #ffffff;
    color: #21166f;
    border: 1px solid #21166f;
    border-radius: 10px;
    padding: .5rem .85rem;
    font-size: .92rem;
    font-weight: 700;
    transition: all .18s ease;
}

    .module-btn-primary:hover {
        background: #21166f;
        color: #ffffff;
        border-color: #21166f;
    }

.module-btn-secondary {
    background: #ffffff;
    color: #21166f;
    border: 1px solid #21166f;
    border-radius: 8px;
    padding: .38rem .68rem;
    font-size: .84rem;
    line-height: 1.05;
    font-weight: 700;
    transition: all .18s ease;
}

    .module-btn-secondary:hover {
        background: #21166f;
        color: #ffffff;
        border-color: #21166f;
    }

.module-btn-danger {
    background: #ffffff;
    color: #c62828;
    border: 1px solid #c62828;
    border-radius: 8px;
    padding: .34rem .55rem;
    font-size: .82rem;
    line-height: 1;
    font-weight: 700;
}

    .module-btn-danger:hover {
        background: #c62828;
        color: #ffffff;
    }

.module-table .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.module-table .module-btn-secondary {
    min-height: 32px;
}

.module-table .module-btn-danger {
    min-height: 30px;
    min-width: 30px;
    padding: .3rem .45rem;
}

/* =====================================================
   BOTONES DE ACCIONES EN TABLA (MISMA FILA)
   ===================================================== */

.module-table td:last-child {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .module-table td:last-child .btn,
    .module-table td:last-child .module-btn-secondary,
    .module-table td:last-child .module-btn-danger {
        display: inline-flex;
        align-items: center;
    }

/* =====================================================
   TABLA
   ===================================================== */

.module-table-wrap {
    border-radius: 16px;
    overflow: hidden;
}

.module-table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

    .module-table thead th {
        background: #21166f;
        color: #ffffff;
        font-weight: 700;
        border: 0 !important;
        padding: .95rem .85rem;
        font-size: .9rem;
    }

    .module-table tbody tr {
        background: #ffffff;
        transition: background .15s ease;
    }

        .module-table tbody tr:nth-child(even) {
            background: #f8f9ff;
        }

        .module-table tbody tr:hover {
            background: #eef2ff;
        }

    .module-table td {
        border-color: #e4ebfb !important;
        padding: .9rem .85rem;
        vertical-align: middle;
    }

/* =====================================================
   PREVIEW
   ===================================================== */

.module-preview-table {
    border-color: #d6def3 !important;
    box-shadow: 0 4px 10px rgba(33,22,111,.08);
    border-radius: 10px;
}

.header-preview-box {
    border: 1px solid rgba(33,22,111,.12);
    border-radius: 14px;
    padding: 10px;
    text-align: center;
    background: #f8f9ff;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.header-preview-img {
    max-height: 140px;
    max-width: 100%;
    display: none;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(33,22,111,.08);
}

.header-preview-empty {
    color: #64748b;
    font-size: .92rem;
}

/* =====================================================
   BADGES
   ===================================================== */

.module-badge-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    font-weight: 700;
}

.module-badge-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    font-weight: 700;
}

.module-badge-gray {
    background: #f1f5f9;
    color: #374151;
    border: 1px solid #cbd5e1;
    font-weight: 700;
}

/* =====================================================
   FOOTER
   ===================================================== */

.footer {
    margin-top: auto;
    flex-shrink: 0;
    background: #ffffff !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid rgba(33,22,111,.08) !important;
}

    .footer,
    .footer a,
    .footer .text-muted,
    .footer .float-start,
    .footer .float-end {
        color: #21166f !important;
    }

        .footer a:hover {
            color: #d4ad45 !important;
        }

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 991.98px) {
    body.module-main-theme.headerimagenes-page {
        background-attachment: scroll;
        background-position: center top;
    }

        body.module-main-theme.headerimagenes-page .topbar-links {
            flex-direction: column;
            align-items: stretch !important;
            gap: 10px;
        }

        body.module-main-theme.headerimagenes-page .quick-nav-wrap {
            flex: 1 1 0;
            min-width: 0;
            display: flex;
            justify-content: flex-end;
            align-items: center;
        }

        body.module-main-theme.headerimagenes-page .quick-nav {
            display: none;
            width: 100%;
            flex-direction: column;
            align-items: stretch;
            gap: 6px !important;
            margin-top: 8px;
        }

            body.module-main-theme.headerimagenes-page .quick-nav.is-open {
                display: flex;
            }

        body.module-main-theme.headerimagenes-page .quick-link {
            width: 100%;
            display: block;
        }

        body.module-main-theme.headerimagenes-page .quick-dd-menu {
            position: static;
            display: none;
            min-width: 100%;
            margin-top: 6px;
            box-shadow: none;
            border-radius: 12px;
        }

        body.module-main-theme.headerimagenes-page .quick-dd.open > .quick-dd-menu {
            display: block;
        }

    .module-header {
        padding: 16px 18px;
    }

    .module-title {
        font-size: 1.45rem;
    }

    .module-card .card-body {
        padding: 1rem;
    }

    .module-table thead th,
    .module-table td {
        white-space: nowrap;
    }
}

/* =====================================================
   IMAGEN DEL HEADER A LA IZQUIERDA DE CERRAR SESIÓN
   ===================================================== */

.header-right-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.header-side-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    overflow: hidden;
}

.header-side-image:hover {
    transform: scale(1.05);
    transition: transform .2s ease;
}

.header-side-image {
    display: block;
    height: 60px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(33,22,111,.12);
}

/* Si quieres que en home combine mejor */
.home-main-theme .header-side-image {
    box-shadow: 0 4px 12px rgba(33,22,111,.10);
}

/* En módulos */
body.module-main-theme .header-side-image {
    box-shadow: 0 4px 12px rgba(33,22,111,.12);
}

@media (max-width: 991.98px) {
    .header-right-tools {
        width: 100%;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 8px;
    }

    .header-side-image {
        height: 42px;
        max-width: 180px;
    }
}

@media (max-width: 575.98px) {
    .header-side-visual {
        display: none;
    }
}

/* Videos */

.header-bg {
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.header-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.header-bg-inner {
    position: relative;
    z-index: 2;
}

.header-bg-video-mode::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.header-side-image {
    display: block;
    height: 52px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(33,22,111,.12);
    transition: transform .2s ease;
}

    /* Hover suave */
    .header-side-image:hover {
        transform: scale(1.03);
    }

/* =====================================================
   NOTIFICACIONES ENCIMA DEL MENÚ SIN ROMPER DROPDOWNS
   HEADER IMAGENES
   ===================================================== */

body.module-main-theme.headerimagenes-page .header-bg,
body.module-main-theme.headerimagenes-page .header-bg-inner,
body.module-main-theme.headerimagenes-page header,
body.module-main-theme.headerimagenes-page .navbar,
body.module-main-theme.headerimagenes-page .navbar-collapse,
body.module-main-theme.headerimagenes-page .container,
body.module-main-theme.headerimagenes-page .container-fluid {
    overflow: visible !important;
}

/* Dropdowns del menú normales */
body.module-main-theme.headerimagenes-page .quick-dd {
    position: relative !important;
}

body.module-main-theme.headerimagenes-page .quick-dd-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    margin-top: 2px !important;
    z-index: 2000 !important;
}

/* Campana encima del menú */
body.module-main-theme.headerimagenes-page .header-right-tools,
body.module-main-theme.headerimagenes-page .notification-wrapper,
body.module-main-theme.headerimagenes-page .notification-bell,
body.module-main-theme.headerimagenes-page .notifications-wrapper {
    position: relative !important;
    z-index: 9999999 !important;
}

/* Panel de notificaciones encima de todo */
body.module-main-theme.headerimagenes-page .notification-dropdown,
body.module-main-theme.headerimagenes-page .dropdown-notifications,
body.module-main-theme.headerimagenes-page .notifications-dropdown-menu,
body.module-main-theme.headerimagenes-page .notification-panel {
    position: absolute !important;
    z-index: 99999999 !important;
}

/* Menú debajo de las notificaciones */
body.module-main-theme.headerimagenes-page .topbar-links {
    z-index: 1 !important;
}