             if (!categoryColors[category]) {
                    categoryColors[category] = colorPalette[index % colorPalette.length];
                }
            });
        }

        function calculateCategoryBreakdown(expenses) {
            const categoryTotals = {};
            let totalAmount = 0;
            expenses.forEach(exp => {
                if (exp.amount < 0 && !disabledCategories.has(exp.category)) {
                    const amount = Math.abs(exp.amount);
                    categoryT