/* =========================================================
   SIDEBAR VERTICAL MODULAR - PROJECTHUB ADMIN
   Paleta: #0F4571, #1769A8, #5FA9D6, #D9B15A, #0C2337
   ========================================================= */

.app-sidebar {
    width: 260px;
    min-width: 260px;
    background: #0C2337;
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 16px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    z-index: 900;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 4px 0 24px rgba(12, 35, 55, 0.12);
    display: flex;
    flex-direction: column;
}

.sidebar-inner {
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar para el sidebar */
.sidebar-inner::-webkit-scrollbar {
    width: 4px;
}

.sidebar-inner::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* Secciones del Menú */
.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section:last-child {
    margin-bottom: 0.5rem;
}

.sidebar-section-title {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748B;
    margin-bottom: 0.5rem;
    padding-left: 0.75rem;
    transition: opacity 0.2s ease;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.68rem 0.95rem;
    border-radius: 10px;
    color: #94A3B8;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    position: relative;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}

.sidebar-icon {
    font-size: 1.25rem;
    color: #64748B;
    min-width: 24px;
    text-align: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sidebar-label {
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

/* Estados Hover */
.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #FFFFFF;
    transform: translateX(3px);
}

.sidebar-link:hover .sidebar-icon {
    color: var(--azul-claro);
    transform: scale(1.1);
}

/* Estado Activo */
.sidebar-menu-item.active .sidebar-link {
    background: linear-gradient(135deg, rgba(23, 105, 168, 0.4) 0%, rgba(15, 69, 113, 0.6) 100%);
    color: #FFFFFF;
    border-color: rgba(95, 169, 214, 0.35);
    box-shadow: 0 4px 14px rgba(15, 69, 113, 0.3);
}

.sidebar-menu-item.active .sidebar-icon {
    color: #5FA9D6;
}

.sidebar-active-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dorado-institucional);
    box-shadow: 0 0 8px var(--dorado-institucional);
    margin-left: auto;
}

/* Pie del Sidebar */
.sidebar-footer {
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.sidebar-btn-quick-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--dorado-institucional) 0%, #C29B45 100%);
    color: #0F2A42;
    font-weight: 700;
    font-size: 0.86rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(217, 177, 90, 0.25);
    transition: all 0.22s var(--ease-spring);
    border: none;
    cursor: pointer;
}

.sidebar-btn-quick-add i {
    font-size: 1.15rem;
}

.sidebar-btn-quick-add:hover {
    color: #0A1C2E;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(217, 177, 90, 0.4);
}



/* =========================================================
   MODO COLAPSADO (DESKTOP COMPACTO)
   ========================================================= */
.app-sidebar.collapsed {
    width: 74px;
    min-width: 74px;
}

.app-sidebar.collapsed .sidebar-section-title,
.app-sidebar.collapsed .sidebar-label,
.app-sidebar.collapsed .sidebar-active-dot,
.app-sidebar.collapsed .sidebar-btn-label,
.app-sidebar.collapsed .sidebar-status-text {
    display: none;
}

.app-sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.app-sidebar.collapsed .sidebar-btn-quick-add {
    padding: 0.75rem 0.5rem;
}

.app-sidebar.collapsed .sidebar-icon {
    font-size: 1.4rem;
}

/* =========================================================
   RESPONSIVE: DRAWER MÓVIL Y TABLET (<= 992px)
   ========================================================= */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 42, 66, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 850;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
    display: block;
}

@media (max-width: 992px) {
    .app-sidebar {
        position: fixed;
        left: -280px;
        top: 70px;
        bottom: 0;
        height: calc(100vh - 70px);
        z-index: 995;
        box-shadow: 10px 0 35px rgba(0, 0, 0, 0.35);
    }

    .app-sidebar.mobile-open {
        left: 0;
        transform: none;
    }
}
