* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #1f2937;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 320px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo-container {
    padding: 24px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.logo-container a {
    display: block;
    transition: opacity 0.2s;
}

.logo-container a:hover {
    opacity: 0.8;
}

.logo {
    width: 180px;
    height: auto;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background: #f3f4f6;
    color: #3b82f6;
}

.nav-item.active {
    background: #eff6ff;
    color: #3b82f6;
    border-left: 3px solid #3b82f6;
}

.nav-icon {
    width: 28px;
    height: 28px;
    margin-right: 12px;
    stroke-width: 2.2;
}

.nav-item span {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.expand-icon,
.arrow-icon {
    width: 16px;
    height: 16px;
    margin-left: auto;
}

.nav-item.expandable {
    cursor: pointer;
}

.nav-item.expandable .expand-icon {
    transition: transform 0.3s ease;
}

.nav-item.expandable.active .expand-icon {
    transform: rotate(180deg);
}

.submenu {
    background: #f9fafb;
    padding: 8px 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.submenu.show {
    max-height: 200px;
}

.submenu-item {
    display: block;
    padding: 8px 20px 8px 52px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.submenu-item:hover {
    color: #3b82f6;
    background: #f3f4f6;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    line-height: 1.4;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 320px;
    display: flex;
    flex-direction: column;
}

.header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
    stroke: #6b7280;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-default {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-default svg.avatar-placeholder {
    width: 24px;
    height: 24px;
    stroke: #9ca3af;
}

.user-avatar-default .avatar-img-small {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.user-role {
    font-size: 12px;
    color: #6b7280;
}

/* Dashboard Content */
.dashboard-content {
    padding: 32px;
    flex: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stat-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.stat-filter,
.stat-filter-small {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    color: #6b7280;
    background: #ffffff;
    cursor: pointer;
}

.stat-chart {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
}

.donut-chart {
    width: 100%;
    height: 100%;
}

.chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.chart-percentage {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
}

.stat-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-label {
    flex: 1;
    color: #6b7280;
}

.legend-value {
    font-weight: 600;
    color: #1f2937;
}

.stat-card-small {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card-small h4 {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 12px;
}

.stat-value {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.value-number {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
}

.value-trend {
    font-size: 20px;
    font-weight: 700;
}

.value-trend.up {
    color: #10b981;
}

.value-trend.down {
    color: #ef4444;
}

.value-trend.neutral {
    color: #6b7280;
}

.mini-chart,
.wave-chart {
    width: 100%;
    height: 60px;
}

.mini-chart svg,
.wave-chart svg {
    width: 100%;
    height: 100%;
}

.progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
}

.ring-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.stat-comparison {
    text-align: center;
    margin: 16px 0;
}

.comparison-label {
    font-size: 14px;
    font-weight: 600;
    color: #10b981;
}

/* Chart Container */
.chart-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 32px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.chart-tabs {
    display: flex;
    gap: 8px;
}

.chart-tab {
    padding: 8px 16px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-tab:hover {
    background: #e5e7eb;
}

.chart-tab.active {
    background: #3b82f6;
    color: #ffffff;
}

.chart-area {
    width: 100%;
    height: 300px;
    position: relative;
}

.chart-area svg {
    width: 100%;
    height: 100%;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 11px;
    color: #9ca3af;
}

/* Activity Section */
.activity-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.carousel-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.carousel-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.carousel-btn:hover {
    background: #f3f4f6;
    color: #3b82f6;
}

.carousel-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    cursor: pointer;
    transition: all 0.2s;
}

.dot.active {
    background: #3b82f6;
    width: 24px;
    border-radius: 4px;
}

.more-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.activity-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.activity-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.activity-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 24px;
    font-weight: 600;
}

.activity-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    padding: 16px 16px 8px;
}

.activity-location {
    font-size: 13px;
    color: #6b7280;
    padding: 0 16px 8px;
}

.activity-description {
    font-size: 13px;
    color: #9ca3af;
    padding: 0 16px 16px;
    line-height: 1.5;
}

.activity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #f3f4f6;
    background: #f9fafb;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6b7280;
}

.meta-icon {
    width: 14px;
    height: 14px;
}

/* Overlay para sidebar 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: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .activity-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        box-shadow: none;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .header {
        padding: 12px 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .activity-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-content {
        padding: 16px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-chart {
        width: 150px;
        height: 150px;
    }
    
    .chart-percentage {
        font-size: 24px;
    }
    
    .stat-card-small {
        padding: 16px;
    }
    
    .stat-card-small h4 {
        font-size: 12px;
    }
    
    .value-number {
        font-size: 24px;
    }
    
    .chart-container {
        padding: 16px;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .chart-header h3 {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .header {
        padding: 10px 12px;
    }
    
    .dashboard-content {
        padding: 12px;
    }
    
    .stat-header h3 {
        font-size: 14px;
    }
    
    .stat-filter {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* User Dropdown Menu */
.user-info {
    position: relative;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-info:hover {
    background: #f3f4f6;
}

.dropdown-arrow {
    width: 16px;
    height: 16px;
    stroke: #6b7280;
    transition: transform 0.3s;
}

.user-info:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-radius: 8px;
    margin: 4px 8px;
}

.dropdown-item:first-child {
    margin-top: 8px;
}

.dropdown-item:last-child {
    margin-bottom: 8px;
}

.dropdown-item:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.dropdown-item.logout {
    color: #ef4444;
}

.dropdown-item.logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

.dropdown-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 12px;
}

/* Animación del avatar al abrir menú */
.user-info.active .user-avatar,
.user-info.active .user-avatar-default {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Responsive para el dropdown */
@media (max-width: 768px) {
    .user-dropdown-menu {
        right: -12px;
        min-width: 200px;
    }
    
    .user-details {
        display: none;
    }
    
    .user-info {
        padding: 6px 8px;
    }
    
    .dropdown-arrow {
        display: none;
    }
}

@media (max-width: 480px) {
    .user-dropdown-menu {
        right: -8px;
        min-width: 180px;
    }
    
    .dropdown-item {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Material de Apoyo Section */
.material-apoyo-section {
    padding: 40px 60px;
    background: #f5f5f5;
    min-height: calc(100vh - 80px);
}

.material-apoyo-section .top-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-bottom: 40px;
}

.material-apoyo-section .banner-publicidad {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.material-apoyo-section .banner-publicidad img {
    width: 100%;
    height: auto;
    display: block;
}

.material-apoyo-section .categorias-sidebar {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: fit-content;
}

.material-apoyo-section .categorias-sidebar h2 {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.material-apoyo-section .cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1200px;
}

.material-apoyo-section .curso-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 380px;
}

.material-apoyo-section .curso-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.material-apoyo-section .curso-image {
    width: 100%;
    height: auto;
    min-height: 180px;
    max-height: 220px;
    overflow: hidden;
    position: relative;
    background: white;
    display: flex;
    align-items: flex-start;
}

.material-apoyo-section .curso-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 60%, rgba(255, 255, 255, 0.85) 100%);
    pointer-events: none;
}

.material-apoyo-section .curso-image img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    object-position: center top;
    display: block;
}

.material-apoyo-section .curso-info {
    padding: 18px 20px 20px 20px;
}

.material-apoyo-section .curso-info h3 {
    color: #6b6b6b;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
    letter-spacing: 0.3px;
}

.material-apoyo-section .instructor {
    color: #6b6b6b;
    font-size: 12px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.material-apoyo-section .instructor strong {
    font-weight: 700;
    color: #4a4a4a;
}

.material-apoyo-section .btn-ver-mas {
    background: #0088cc;
    color: white;
    border: none;
    padding: 9px 22px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    width: auto;
    display: inline-block;
}

.material-apoyo-section .btn-ver-mas:hover {
    background: #0077b3;
}

/* Responsive Material de Apoyo */
@media (max-width: 1200px) {
    .material-apoyo-section .top-container {
        grid-template-columns: 1fr;
    }

    .material-apoyo-section .categorias-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .material-apoyo-section {
        padding: 30px 20px;
    }

    .material-apoyo-section .cursos-grid {
        grid-template-columns: 1fr;
    }

    .material-apoyo-section .top-container {
        margin-bottom: 30px;
        gap: 20px;
    }

    .material-apoyo-section .banner-publicidad {
        border-radius: 10px;
    }

    .material-apoyo-section .categorias-sidebar {
        padding: 20px;
        border-radius: 10px;
    }

    .material-apoyo-section .categorias-sidebar h2 {
        font-size: 18px;
    }

    .material-apoyo-section .curso-card {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .material-apoyo-section {
        padding: 20px 15px;
    }

    .material-apoyo-section .top-container {
        gap: 15px;
        margin-bottom: 20px;
    }

    .material-apoyo-section .banner-publicidad {
        border-radius: 8px;
    }

    .material-apoyo-section .categorias-sidebar {
        padding: 16px;
        border-radius: 8px;
    }

    .material-apoyo-section .categorias-sidebar h2 {
        font-size: 16px;
    }

    .material-apoyo-section .curso-card {
        border-radius: 12px;
    }

    .material-apoyo-section .curso-image {
        height: 200px;
        min-height: 200px;
        max-height: 200px;
    }

    .material-apoyo-section .curso-image img {
        width: 100%;
        height: 100%;
        max-height: none;
        object-fit: cover;
        object-position: center top;
    }

    .material-apoyo-section .curso-info {
        padding: 16px 18px 18px 18px;
    }

    .material-apoyo-section .curso-info h3 {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .material-apoyo-section .instructor {
        font-size: 11px;
        margin-bottom: 14px;
    }

    .material-apoyo-section .btn-ver-mas {
        padding: 8px 20px;
        font-size: 11px;
    }
}
