/* =============================================
   NAV — Red de Salud Aguaytía
   Sidebar vertical · Blanco glass
   ============================================= */

:root {
    --nav-text: #374151;
    --nav-text-hover: #111827;
    --nav-accent: #1e3a5f;
    --nav-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== Sidebar ===== */
.main-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* ===== Logo ===== */
.sidebar-logo {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sidebar-logo img {
    height: 40px;
    width: auto;
}

/* ===== Navegación ===== */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav > ul > li {
    margin: 0;
}

.sidebar-nav > ul > li > a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1.5rem;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--nav-text);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.sidebar-nav > ul > li > a:hover {
    color: var(--nav-text-hover);
    background: rgba(0, 0, 0, 0.04);
}

.sidebar-nav > ul > li > a.active {
    color: var(--nav-accent);
    background: rgba(30, 58, 95, 0.08);
    font-weight: 600;
}

/* Icono */
.nav-icon {
    width: 18px;
    height: 18px;
    opacity: 0.6;
}

.sidebar-nav > ul > li > a:hover .nav-icon,
.sidebar-nav > ul > li > a.active .nav-icon {
    opacity: 1;
}

/* ===== Dropdown ===== */
.dropdown {
    position: relative;
}

.dropdown > a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    cursor: pointer;
}

/* Flecha */
.dropdown > a::after {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.3s;
    opacity: 0.5;
    margin-left: auto;
}

.dropdown.is-open > a::after {
    transform: rotate(225deg) translateY(1px);
}

/* ===== Submenu ===== */
.submenu {
    max-height: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.02);
    transition: max-height 0.3s var(--nav-ease);
}

.dropdown.is-open > .submenu {
    max-height: 500px;
}

.submenu li a {
    display: flex;
    align-items: center;
    padding: 0.55rem 1.5rem 0.55rem 3.5rem;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--nav-text);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.submenu li a:hover {
    color: var(--nav-text-hover);
    background: rgba(0, 0, 0, 0.04);
}

/* ===== Contenido principal ===== */
.main-content {
    margin-left: 200px;
    min-height: 100vh;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .main-sidebar {
        width: 180px;
    }

    .main-content {
        margin-left: 180px;
    }
}
