@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: none;
    }
    .sidebar.open {
        left: 0;
        box-shadow: 4px 0 12px rgba(0,0,0,0.15);
    }
    .right-panel {
        position: fixed;
        right: -300px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        width: 280px;
        transition: right 0.3s ease;
        box-shadow: none;
    }
    .right-panel.open {
        right: 0;
        box-shadow: -4px 0 12px rgba(0,0,0,0.15);
    }
    .mobile-menu-btn, .mobile-config-btn {
        display: flex !important;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .chart-type-selector {
        flex-wrap: wrap;
    }
    .nav-btn span {
        display: none;
    }
}

.mobile-menu-btn, .mobile-config-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-card);
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.mobile-menu-btn:hover, .mobile-config-btn:hover {
    background: var(--bg-main);
    color: var(--primary);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.mobile-overlay.show {
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: #fff;
    margin-top: 16px;
    font-size: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
