-box');
            const legendBox = document.getElementById('customLegend');
            const cashflowSection = document.getElementById('cashflow-section');
            const noDataMessage = document.getElementById('noDataMessage');
            const hasExpenses = monthExpenses.some(e => e.amount < 0);
            if (!hasExpenses) {
                if (pieChart) {
                    pieChart.destroy();
                    pieChart = null;
                }
                chartBox.style.display = 'none