or
            document.getElementById('deviceAnalyticsPeriod').value = 'all';
            
            // Load analytics data
            loadDeviceAnalytics(deviceId, 'all');
        }

        function closeDeviceAnalytics() {
            const modal = document.getElementById('deviceAnalyticsModal');
            modal.style.display = 'none';
            
            // Destroy chart if exists
            if (deviceRevenueChart) {
                deviceRevenueChart.destroy();
                deviceRevenue