ing');
            const data = document.getElementById('deviceAnalyticsData');
            
            loading.style.display = 'flex';
            data.style.display = 'none';
            
            loadDeviceAnalytics(currentDeviceId, period);
        }

        function toggleBookingHistory() {
            const table = document.getElementById('customerBookingsTable');
            const icon = document.getElementById('bookingToggleIcon');
            const text = document.getElementById('bookingToggle