@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
    --main-color: #3E8DA8;
    --hover-color: #347a91;
}

/* =========================
   BASE
========================= */
body {
    padding-top: 110px !important;
}

nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--main-color);
    z-index: 10000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.12);
}

nav .navbar {
    height: 100%;
    max-width: 1250px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: auto;
    padding: 0 16px;
    position: relative;
}

.logo {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.logo a {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.logo img {
    border-radius: 50%;
    margin-right: 10px;
    width: 35px;
    height: 35px;
    object-fit: cover;
    flex-shrink: 0;
}

.logo-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-toggle-btn,
.menu-close-btn {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.menu-toggle-btn i,
.menu-close-btn i {
    line-height: 1;
}

.info-bar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: 35px;
    background: #ffffff;
    border-bottom: 1px solid #ddd;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    z-index: 9998;
    overflow: hidden;
    white-space: nowrap;
}

#saludo-pc,
#fechaHora-pc {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logo {
    display: none;
}

.menu-overlay {
    display: none;
}

/* =========================
   ESCRITORIO
========================= */
@media (min-width: 769px) {
    .menu-toggle-btn {
        display: none !important;
    }

    .nav-links {
        position: static;
        width: auto;
        height: 100%;
        background: transparent;
        padding: 0;
        overflow: visible;
        box-shadow: none;
        left: auto;
        flex: 0 0 auto;
    }

    .links {
        display: flex;
        list-style: none;
        height: 100%;
        margin: 0;
        padding: 0;
        align-items: center;
    }

    .links li {
        position: relative;
        display: flex;
        align-items: center;
        padding: 0 12px;
        height: 100%;
    }

    .links li a {
        color: #fff;
        text-decoration: none;
        font-size: 13px;
        font-weight: 500;
        transition: 0.3s;
        white-space: nowrap;
    }

    .links li:hover > a {
        color: #d1f0ff;
    }

    .dropdown-toggle {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .sub-menu {
        position: absolute;
        top: 70px;
        left: 0;
        width: 260px;
        background: var(--main-color);
        display: none;
        border-radius: 0 0 10px 10px;
        box-shadow: 0 8px 15px rgba(0,0,0,0.2);
        max-height: 420px;
        overflow-y: auto;
        list-style: none;
        padding: 0;
        margin: 0;
        z-index: 10001;
    }

    .links li:hover .sub-menu {
        display: block;
    }

    .sub-menu li {
        width: 100%;
        height: auto;
        padding: 0;
    }

    .sub-menu li a {
        display: block;
        width: 100%;
        padding: 10px 16px;
        color: #fff;
        text-decoration: none;
        font-size: 13px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        white-space: normal;
        line-height: 1.35;
    }

    .sub-menu li a:hover {
        background-color: var(--hover-color);
        color: #d1f0ff;
        padding-left: 22px;
    }

    .arrow {
        transition: transform 0.25s ease;
    }
}

/* =========================
   MÓVIL
========================= */
@media (max-width: 768px) {
    nav .navbar {
        justify-content: space-between;
        gap: 10px;
    }

    .menu-toggle-btn {
        display: flex !important;
        flex: 0 0 auto;
        width: 34px;
        height: 34px;
    }

    .menu-toggle-btn i {
        font-size: 30px;
        color: #fff;
    }

    .logo {
        justify-content: center;
    }

    .logo a {
        font-size: 16px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: min(82vw, 320px);
        height: 100vh;
        background: var(--main-color);
        transition: left 0.3s ease;
        z-index: 20000;
        padding: 16px 16px 24px;
        overflow-y: auto;
        box-shadow: 8px 0 24px rgba(0,0,0,0.25);
    }

    .nav-links.active {
        left: 0;
    }

    .menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 19999;
        display: none;
    }

    .menu-overlay.active {
        display: block;
    }

    .sidebar-logo {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        color: #fff;
        margin-bottom: 18px;
        font-size: 22px;
        position: sticky;
        top: 0;
        background: var(--main-color);
        z-index: 2;
        padding-bottom: 10px;
    }

    .menu-close-btn {
        width: 34px;
        height: 34px;
    }

    .menu-close-btn i {
        font-size: 30px;
        color: #fff;
    }

    .links {
        display: block !important;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .links > li {
        display: block !important;
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .links > li > a,
    .dropdown-toggle {
        display: flex !important;
        align-items: center;
        width: 100%;
        padding: 12px 0;
        color: #fff;
        text-decoration: none;
        font-size: 15px;
        line-height: 1.3;
    }

    .links > li > a span,
    .dropdown-toggle span {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        flex: 1;
    }

    .dropdown-toggle .arrow {
        margin-left: auto;
        flex-shrink: 0;
    }

    .sub-menu {
        display: none;
        list-style: none;
        margin: 0 0 8px;
        padding: 6px 0 8px 12px;
        background: rgba(0,0,0,0.10);
        border-radius: 10px;
    }

    .sub-menu li {
        width: 100%;
    }

    .sub-menu li a {
        display: block;
        width: 100%;
        padding: 10px 12px;
        color: #fff;
        text-decoration: none;
        font-size: 13px;
        line-height: 1.35;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .sub-menu li:last-child a {
        border-bottom: none;
    }

    .sub-menu li a:hover {
        background: var(--hover-color);
        color: #d1f0ff;
    }

    .has-dropdown.is-active .sub-menu {
        display: block !important;
    }

    .has-dropdown.is-active .arrow {
        transform: rotate(180deg);
    }

    .arrow {
        transition: transform 0.25s ease;
        flex-shrink: 0;
    }

    .info-bar {
        font-size: 10px;
        padding: 6px 10px;
    }
}

/* =========================
   MÓVIL PEQUEÑO
========================= */
@media (max-width: 480px) {
    .logo a {
        font-size: 15px;
    }

    .logo img {
        width: 32px;
        height: 32px;
        margin-right: 8px;
    }

    .info-bar {
        font-size: 9.5px;
    }

    .nav-links {
        width: min(86vw, 300px);
    }
}


/* Corrección para evitar doble icono en los dropdowns */
.dropdown-toggle {
    position: relative;
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* 1. Quitamos cualquier marcador de lista o flecha de sistema */
.has-dropdown, .dropdown-toggle {
    list-style: none !important;
}

.dropdown-toggle::after {
    display: none !important; /* Esto mata al triángulo intruso ▶️ */
    content: none !important;
}

/* 2. Aseguramos que el Boxicon sea el único visible */
.arrow {
    display: inline-block !important;
    font-family: 'boxicons' !important; /* Fuerza la fuente de Boxicons */
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
}

/* 3. Ajuste de rotación en escritorio (hover) */
@media (min-width: 769px) {
    .links li:hover .arrow {
        transform: rotate(180deg);
    }
}
