         const uniqueCategories = [...new Set(allExpenses.map(exp => exp.category))];
                assignCategoryColors(uniqueCategories);
                updateMonthDisplay();
                updateChartAndLegend();
                setupTagInput();
            } catch (error) {
                console.error('Failed to initialize dashboard:', error);
            }
        }

        Chart.defaults.color = '#b3b3b3';
        Chart.defaults.borderColor = '#606060';
        Chart.defaults.font.family = '-ap