/* Estilos personalizados para el menú principal */

/* Items principales del menú - Destaque con fondo gris más oscuro */
.sidebar-menu > li.treeview > a,
.sidebar-menu > li > a[href] {
    background: linear-gradient(90deg, rgba(52, 58, 64, 0.8) 0%, rgba(52, 58, 64, 0.6) 100%);
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #ecf0f1 !important;
}

.sidebar-menu > li > a:hover {
    background: linear-gradient(90deg, rgba(52, 58, 64, 1) 0%, rgba(52, 58, 64, 0.9) 100%);
    border-left-color: #00d4ff;
    color: #fff !important;
}

.sidebar-menu > li.active > a,
.sidebar-menu > li.menu-open > a {
    background: linear-gradient(90deg, rgba(0, 150, 136, 0.9) 0%, rgba(0, 150, 136, 0.7) 100%);
    border-left-color: #00d4ff;
    font-weight: bold;
    color: #fff !important;
}

/* Subitems - Fondo más claro para diferenciar */
.sidebar-menu .treeview-menu {
    background-color: rgba(0, 0, 0, 0.2);
}

.sidebar-menu .treeview-menu > li > a {
    background-color: transparent;
    padding-left: 40px;
    border-left: none;
    color: #aaa !important;
    font-weight: normal;
}

.sidebar-menu .treeview-menu > li > a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff !important;
    border-left: 3px solid #00d4ff;
    padding-left: 37px;
}

.sidebar-menu .treeview-menu > li.active > a {
    background-color: rgba(0, 150, 136, 0.3);
    color: #00d4ff !important;
    font-weight: 600;
    border-left: 3px solid #00d4ff;
    padding-left: 37px;
}

/* Indicador de menú abierto */
.sidebar-menu .treeview-menu > li.active::before {
    content: '';
}

/* AdminLTE 3: evitar que menu-open quede "pegado" */
.sidebar .nav-sidebar .nav-item.menu-open > .nav-link {
    background: rgba(255, 255, 255, 0.06);
    border-left: 4px solid transparent;
    color: #ecf0f1 !important;
    font-weight: 500;
}

/* Solo el link activo debe quedar marcado */
.sidebar .nav-sidebar .nav-item.menu-open > .nav-link:not(.active) {
    background: rgba(255, 255, 255, 0.06) !important;
    border-left-color: transparent !important;
    font-weight: 500;
    color: #ecf0f1 !important;
}

.sidebar .nav-sidebar .nav-item > .nav-link.active,
.sidebar .nav-sidebar .nav-item.menu-open > .nav-link.active {
    background: linear-gradient(90deg, rgba(0, 150, 136, 0.9) 0%, rgba(0, 150, 136, 0.7) 100%);
    border-left: 4px solid #00d4ff;
    color: #fff !important;
    font-weight: bold;
}

.sidebar .nav-sidebar .nav-treeview > .nav-item > .nav-link.active {
    background-color: rgba(0, 150, 136, 0.3);
    color: #00d4ff !important;
    font-weight: 600;
    border-left: 3px solid #00d4ff;
}

/* ------------------------------------------------------------------
   Top-Bar + Dropdown Refresh (Accesibilidad / Notificaciones / Mensajeria)
------------------------------------------------------------------- */

.main-header.navbar {
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 48%, #f6f9fd 100%);
    border-bottom: 1px solid #dce5f0;
    box-shadow: 0 6px 20px rgba(23, 39, 71, 0.08);
}

.main-header .navbar-nav > .nav-item > .nav-link {
    color: #5b6d84;
    transition: all 0.2s ease;
}

.main-header .navbar-nav > .nav-item > .nav-link:hover {
    color: #23406d;
}

.main-header .topbar-icon-link {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f6ff 0%, #e7efff 100%);
    border: 1px solid #d9e5ff;
    margin: 0 4px;
    box-shadow: 0 4px 10px rgba(30, 54, 104, 0.08);
}

.main-header .topbar-icon-link i {
    font-size: 1rem;
}

.main-header .topbar-icon-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(41, 86, 172, 0.18);
    background: linear-gradient(135deg, #e8f0ff 0%, #dde9ff 100%);
}

.main-header .topbar-a11y-link {
    color: #2d63ff !important;
}

.main-header .topbar-notif-link {
    color: #d73762 !important;
}

.main-header .topbar-msg-link {
    color: #11877a !important;
}

.main-header .nav-item .navbar-badge {
    top: 5px;
    right: 5px;
    font-size: 0.68rem;
    padding: 0.28em 0.42em;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.18);
}

.main-header li#topbar-notifications .dropdown-menu,
.main-header li#topbar-messages .dropdown-menu {
    width: 380px;
    max-height: 470px;
    overflow: hidden;
    border: 1px solid #d8e3f3;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(21, 38, 72, 0.2);
    padding: 0;
    margin-top: 10px;
}

.main-header li#topbar-notifications .dropdown-item.dropdown-header,
.main-header li#topbar-messages .dropdown-item.dropdown-header {
    background: linear-gradient(135deg, #2f6bff 0%, #58a6ff 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.94rem;
    letter-spacing: 0.2px;
    padding: 0.9rem 1rem;
}

.main-header li#topbar-notifications .adminlte-dropdown-content,
.main-header li#topbar-messages .adminlte-dropdown-content {
    max-height: 360px;
    overflow-y: auto;
    background: #fff;
}

.main-header .sia-topbar-item {
    display: block;
    white-space: normal;
    padding: 0.72rem 0.95rem;
    border-bottom: 1px solid #eef3fb;
}

.main-header .sia-topbar-item:last-child {
    border-bottom: 0;
}

.main-header .sia-topbar-item:hover {
    background: #f7faff;
    color: #1f355c;
}

.main-header .sia-topbar-item.is-unread {
    background: linear-gradient(90deg, rgba(77, 136, 255, 0.12), rgba(77, 136, 255, 0));
}

.main-header .sia-topbar-title {
    display: block;
    font-weight: 600;
    color: #253955;
    line-height: 1.25;
    margin-bottom: 2px;
}

.main-header .sia-topbar-meta {
    display: block;
    color: #7c8ca3;
    font-size: 0.77rem;
    margin-bottom: 2px;
}

.main-header .sia-topbar-preview {
    display: block;
    color: #8a97ab;
    font-size: 0.76rem;
    line-height: 1.3;
}

.main-header .sia-chip {
    width: 31px;
    height: 31px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.76rem;
    margin-top: 1px;
}

.main-header .sia-chip-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.main-header .sia-chip-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.main-header .sia-chip-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.main-header .sia-chip-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.main-header .sia-avatar-chip {
    width: 31px;
    height: 31px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    margin-top: 1px;
}

.main-header .sia-topbar-empty {
    color: #7f8ea4;
    font-size: 0.85rem;
    padding: 1rem;
    text-align: center;
}

.main-header .dropdown-menu .dropdown-footer {
    background: #f7faff;
    font-weight: 600;
    color: #2d4f89;
    border-top: 1px solid #e7edf7;
}

.main-header .dropdown-menu .dropdown-footer:hover {
    background: #edf4ff;
    color: #1e3f7a;
}

.main-header .user-menu > .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding-left: 0.95rem;
    border-left: 1px solid #dfe6ef;
    margin-left: 0.4rem;
}

.main-header .user-menu .user-image {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(23, 39, 71, 0.18);
}

.main-header .user-menu > .dropdown-menu {
    border-radius: 14px;
    border: 1px solid #dbe4f1;
    box-shadow: 0 16px 36px rgba(27, 44, 75, 0.18);
}

.main-header .user-menu .user-header {
    background: linear-gradient(135deg, #3454d1 0%, #4f86ff 100%);
}

/* ------------------------------------------------------------------
   Module Pages Refresh (Accesibilidad / Notificaciones / Mensajeria)
------------------------------------------------------------------- */

.module-shell .card {
    border: 1px solid #e4edf8;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(22, 38, 69, 0.06);
    overflow: hidden;
}

.module-shell .card-header {
    border-bottom: 1px solid #edf2fa;
}

.module-shell .card.card-primary > .card-header,
.module-shell .card.card-info > .card-header,
.module-shell .card.card-outline.card-primary > .card-header,
.module-shell .card.card-outline.card-info > .card-header {
    background: linear-gradient(135deg, #2f6bff 0%, #5aa8ff 100%);
    color: #fff;
    border-bottom: 0;
}

.module-shell .card.card-primary > .card-header .card-title,
.module-shell .card.card-info > .card-header .card-title,
.module-shell .card.card-outline.card-primary > .card-header .card-title,
.module-shell .card.card-outline.card-info > .card-header .card-title {
    font-weight: 600;
}

.module-shell .info-box {
    border: 1px solid #e6edf8;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(21, 37, 66, 0.06);
}

.module-shell .info-box .info-box-icon {
    border-radius: 10px;
    margin: 0.45rem;
    min-width: 52px;
    height: 52px;
}

.module-shell .btn {
    border-radius: 10px;
    font-weight: 600;
}

.module-shell .form-control,
.module-shell .custom-select,
.module-shell textarea {
    border-radius: 10px;
    border-color: #d8e2ef;
}

.module-shell .form-control:focus,
.module-shell .custom-select:focus,
.module-shell textarea:focus {
    border-color: #6f9cff;
    box-shadow: 0 0 0 0.2rem rgba(47, 107, 255, 0.16);
}

.module-shell .nav-pills .nav-link {
    border-radius: 999px;
    font-weight: 600;
    color: #5d6f85;
    padding: 0.45rem 0.95rem;
}

.module-shell .nav-pills .nav-link.active {
    background: linear-gradient(135deg, #2f6bff 0%, #4f8bff 100%);
    box-shadow: 0 8px 18px rgba(47, 107, 255, 0.25);
}

.module-shell .table thead th {
    background: #f5f8fd;
    color: #60748e;
    border-top: 0;
    font-size: 0.79rem;
    letter-spacing: 0.28px;
    text-transform: uppercase;
}

.module-shell .table tbody tr:hover {
    background: #f8fbff;
}

.module-shell .badge {
    border-radius: 999px;
    padding: 0.45em 0.7em;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .main-header li#topbar-notifications .dropdown-menu,
    .main-header li#topbar-messages .dropdown-menu {
        width: 94vw;
        right: 3vw;
        left: auto;
    }
}
