/* ==== NAVBAR SUPERIOR ==== */
.navbar-top {
    position: fixed;
    top: 0;
    left: 250px;
    width: calc(100% - 250px);
    height: 72px;
    z-index: 1030;
    background: var(--apolo-primary, #063d53);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-family: var(--app-font-family, "Segoe UI", Tahoma, Arial, sans-serif);
    transition: left 0.3s ease, width 0.3s ease;
}

/* ==== CONTENEDOR GENERAL ==== */
.app-container {
    display: flex;
    min-height: 100vh;
    margin-top: 72px;
}

/* ==== SIDEBAR ==== */
.sidebar {
    background-color: var(--apolo-primary, #063d53);
    color: white;
    width: 250px;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, transform 0.3s ease;
    font-family: var(--app-font-family, "Segoe UI", Tahoma, Arial, sans-serif);
}

/* ==== SIDEBAR COLAPSADO ==== */
.sidebar.collapsed {
    width: 70px;
}

/* Ocultar textos al colapsar */
.sidebar.collapsed .menu-label,
.sidebar.collapsed .sidebar-title {
    display: none;
}

/* Centrar iconos al colapsar */
.sidebar.collapsed #sidebarMainMenu > .nav-item > .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar.collapsed #sidebarMainMenu > .nav-item > .nav-link i {
    margin-right: 0 !important;
}

.sidebar.collapsed .bi-chevron-down,
.sidebar.collapsed .sidebar-section-toggle .ms-auto {
    display: none !important;
}

/* ==== ENCABEZADO ==== */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 0.75rem 1.05rem 0.75rem;
    background-color: var(--apolo-primary, #063d53);
    border-bottom: 1px solid rgba(244, 245, 247, 0.9);
}

.sidebar-title {
    color: #f8fafc;
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==== BOTÓN TOGGLER ==== */
.sidebar-toggler {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggler:hover {
    background-color: rgba(255, 255, 255, 0.14);
}

/* ==== MENÚ ==== */
.navbar-menu .nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-menu {
    flex: 1;


    
    overflow-y: auto;
    overflow-x: visible;
    padding-bottom: 1rem;
}

.navbar-menu::-webkit-scrollbar {
    width: 8px;
}

.navbar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 8px;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: white;
    text-decoration: none;
    transition: background-color 0.2s ease;
    font-weight: 600;
    letter-spacing: .15px;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.14);
}

.sidebar .nav-link i {
    font-size: 1.2rem;
}

.sidebar-section-toggle {
    background: rgba(6, 61, 83, 0.86);
    border: none;
}

.sidebar #sidebarMainMenu > .nav-item {
    position: relative;
}

.sidebar-group.is-open > .sidebar-section-toggle {
    background: rgba(11, 87, 116, 0.96);
}

.sidebar-group.is-open > .sidebar-section-toggle .bi-chevron-down {
    transform: rotate(180deg);
}

.sidebar-section-toggle .bi-chevron-down {
    transition: transform 0.2s ease;
}

.sidebar-submenu {
    display: none;
    list-style: none;
    margin: 0;
}

.sidebar-group.is-open > .sidebar-submenu {
    display: block;
    background: rgba(2, 31, 43, 0.2);
}

.sidebar-submenu .nav-link {
    justify-content: flex-start;
}

.sidebar.collapsed .sidebar-submenu {
    position: absolute;
    top: 0;
    left: calc(100% + 8px);
    min-width: 250px;
    padding: 0.35rem !important;
    border-radius: 14px;
    background: rgba(4, 30, 42, 0.98);
    box-shadow: 0 16px 36px rgba(2, 18, 26, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1065;
}

.sidebar.collapsed .sidebar-group.is-open > .sidebar-submenu {
    display: block;
}

.sidebar.collapsed .sidebar-submenu .nav-link {
    justify-content: flex-start;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
}

.sidebar.collapsed .sidebar-submenu .nav-link i {
    margin-right: 0.75rem !important;
}

.sidebar.collapsed .submenu-label {
    display: inline;
    white-space: normal;
}

/* ==== CONTENIDO PRINCIPAL ==== */
.main-content {
    flex-grow: 1;
    margin-left: 250px;
    padding: 1.5rem;
    background-color: var(--apolo-bg, #f7fafc);
    min-height: calc(100vh - 72px);
    transition: margin-left 0.3s ease;
}

/* Ajuste cuando sidebar está colapsado */
.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
}

body.sidebar-collapsed .navbar-top {
    left: 70px;
    width: calc(100% - 70px);
}

body.sidebar-collapsed .main-content {
    margin-left: 70px;
}

/* ==== RESPONSIVE (MÓVIL) ==== */
@media (max-width: 768px) {
    .navbar-top {
        left: 0;
        width: 100%;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 250px;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    /* En móvil no se reduce a 70px */
    .sidebar.collapsed {
        width: 250px;
    }

    .sidebar.collapsed .menu-label {
        display: inline;
    }

    .sidebar.collapsed .sidebar-submenu {
        position: static;
        min-width: 0;
        padding: 0 !important;
        border-radius: 0;
        box-shadow: none;
        border: 0;
        background: rgba(2, 31, 43, 0.2);
    }

    .main-content {
        margin-left: 0;
    }
}
.nav {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.apolo-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.apolo-topbar {
    background: var(--apolo-primary, #063d53);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 12px rgba(6, 61, 83, 0.22);
}

.apolo-topbar-inner {
    height: 72px !important;
}

.apolo-topbar .apolo-brand {
    padding: 0.15rem 0.2rem;
    border-radius: 8px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.apolo-topbar .apolo-brand:hover {
    background: transparent;
}

.apolo-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.62rem;
    padding: 0.34rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.apolo-user-trigger:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.32);
}

.apolo-user-trigger:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.apolo-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.apolo-user-meta {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.1;
    max-width: 320px;
}

.apolo-user-name {
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apolo-user-role {
    color: #dbeafe;
    font-size: 0.74rem;
    font-weight: 600;
}

.apolo-user-unit {
    color: #bfdbfe;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apolo-user-arrow {
    width: 16px;
    height: 16px;
    fill: #dbeafe;
    flex: 0 0 auto;
}

.apolo-alert-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-right: 0.75rem;
    border-radius: 999px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.apolo-alert-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
}

.apolo-alert-link i {
    font-size: 1rem;
}

.apolo-alert-badge {
    position: absolute;
    top: -5px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
}

/* css de la vistas privadas. */
.apolo-brand-logo {
    width: 360px;
    height: 120px;
    border-radius: 12px;
    padding: 8px;
    object-fit: contain;
    /* box-shadow: 0 4px 12px rgba(2, 26, 56, 0.22); */
}

/* css, logo de las vistas publicas */
 .application-logo-image {
    width: 560px !important;
    height: 220px !important;
    
}



.apolo-nav-brand-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.08;
    min-width: 0;
}

.apolo-nav-brand-system {
    display: block;
    color: #ffffff;
    font-size: clamp(0.9rem, 1.45vw, 1.18rem);
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

.apolo-nav-brand-name {
    display: block;
    margin-top: 0.12rem;
    color: #dbeafe;
    font-size: clamp(0.86rem, 1.25vw, 1.05rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.apolo-brand-text {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .4px;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

.apolo-brand-sub {
    display: block;
    font-size: .66rem;
    color: #cbd5e1;
    font-weight: 500;
    letter-spacing: .4px;
}

.sidebar.collapsed .apolo-brand {
    justify-content: center;
    width: 100%;
}



@media (max-width: 1024px) {
    .apolo-user-meta {
        max-width: 220px;
    }
}

@media (max-width: 640px) {
    .apolo-brand {
        gap: 8px;
    }

    /* .apolo-brand-logo {
        width: 320px;
        height: auto;
        display: block;
    } */

    .apolo-nav-brand-system {
        max-width: 68vw;
        font-size: 0.78rem;
        white-space: normal;
    }

    .apolo-nav-brand-name {
        font-size: 0.82rem;
    }
}
