/* Estilos para menú lateral */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --top-navbar-height: 60px;
    --sidebar-bg: #2c3e50;
    --sidebar-hover: #34495e;
    --sidebar-active: #3498db;
    --transition-speed: 0.3s;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #1a252f 100%);
    color: white;
    transition: all var(--transition-speed) ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    min-height: var(--top-navbar-height);
}

.sidebar-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-title-text {
    display: none;
}

.sidebar-toggle {
    padding: 0;
    font-size: 1.2rem;
    display: none;
}

.sidebar.collapsed .sidebar-toggle {
    display: block;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu-item {
    margin: 5px 10px;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-menu-link:hover {
    background: var(--sidebar-hover);
    color: white;
    transform: translateX(5px);
}

.sidebar-menu-item.active .sidebar-menu-link {
    background: var(--sidebar-active);
    color: white;
    box-shadow: 0 2px 8px rgba(52,152,219,0.3);
}

.sidebar-menu-link i {
    font-size: 1.2rem;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.sidebar.collapsed .sidebar-menu-link span {
    display: none;
}

.sidebar.collapsed .sidebar-menu-link {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .sidebar-menu-link i {
    margin-right: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    padding: 10px;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-user-info i {
    font-size: 1.5rem;
    margin-right: 10px;
}

.sidebar.collapsed .sidebar-user-info span {
    display: none;
}

.sidebar.collapsed .sidebar-user-info {
    justify-content: center;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed) ease;
    min-height: 100vh;
    background: #f8f9fa;
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Top Navbar */
.top-navbar {
    position: sticky;
    top: 0;
    z-index: 999;
    height: var(--top-navbar-height);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.top-navbar .navbar-brand {
    margin-left: 10px;
}

#menuToggle {
    border: none;
    background: none;
    padding: 5px 10px;
    cursor: pointer;
}

#menuToggle:hover {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block !important;
    }
}

/* Overlay para móvil */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar.show ~ .sidebar-overlay {
    display: block;
}

/* Animaciones */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.sidebar.show {
    animation: slideIn var(--transition-speed) ease;
}

