xpense'}`;
                    messageDiv.className = 'form-message error';
                }
                setTimeout(() => {
                    messageDiv.textContent = '';
                    messageDiv.className = 'form-message';
                }, 3000);
            } catch (error) {
                console.error('Error adding expense:', error);
                const messageDiv = document.getElementById('formMessage');
                messageDiv.textContent = 'Error: Failed to add expense';
        