/* Layout Dashboard */
.dashboard-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #343a40;
    position: fixed;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    padding: 1rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    padding: 1rem;
}

.sidebar-brand img {
    max-width: 30px;
    margin-right: 10px;
}

/* Menu Sidebar */
.sidebar-menu {
    padding: 1rem 0;
}

.sidebar-menu .nav-item {
    width: 100%;
}

.sidebar-menu .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

.sidebar-menu .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-menu .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-menu .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Contenuto Principale */
.main-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-height: 100vh;
    transition: all 0.3s;
    background-color: #f8f9fa;
}

.main-content.expanded {
    margin-left: 60px;
    width: calc(100% - 60px);
}

/* Header Dashboard */
.dashboard-header {
    background-color: #fff;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.dashboard-title {
    margin: 0;
    font-size: 1.5rem;
}

/* Card Dashboard */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-card-icon i {
    font-size: 24px;
    color: #0d6efd;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-card-label {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Progress Cards */
.progress-card {
    background: #fff;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.progress-card .progress {
    height: 8px;
    margin-top: 0.5rem;
}

/* Activity Timeline */
.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline-item {
    padding-left: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dee2e6;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #0d6efd;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.quick-action-button {
    background: #fff;
    border: none;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s;
}

.quick-action-button:hover {
    background-color: #f8f9fa;
    transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar.expanded {
        width: 250px;
    }
    
    .main-content {
        margin-left: 60px;
        width: calc(100% - 60px);
    }
    
    .main-content.expanded {
        margin-left: 250px;
        width: calc(100% - 250px);
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card-value {
        font-size: 1.5rem;
    }
}

/* Dark Mode */
.dark-mode {
    background-color: #1a1a1a;
    color: #fff;
}

.dark-mode .sidebar {
    background-color: #2d2d2d;
}

.dark-mode .main-content {
    background-color: #1a1a1a;
}

.dark-mode .card,
.dark-mode .stat-card,
.dark-mode .progress-card {
    background-color: #2d2d2d;
    color: #fff;
}

.dark-mode .timeline-item::before {
    background-color: #404040;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}