exclamation-triangle"></i>
                        Error loading case form: ${error.message}
                    </div>
                `;
            });
    }

    function closeEditCaseModal() {
        document.getElementById('caseEditModal').style.display = 'none';
    }

    function saveCase(caseID, formData) {
        const submitBtn = document.querySelector('#editCaseForm button[type="submit"]');
        const originalText = submitBtn.innerHTML;
        
        // Show loading state
        submit