: ${error.message}
                    </div>
                `;
            });
    }

    function closeCaseModal() {
        document.getElementById('caseDetailsModal').style.display = 'none';
    }

    // Case Edit Modal
    function showEditCase(caseID) {
        // Close details modal if open
        closeCaseModal();
        
        const modal = document.getElementById('caseEditModal');
        const content = document.getElementById('caseEditContent');
        
        // Show modal with loading 