-- Add Case Detail modal with tabs
INSERT INTO ui_modals (name, config, tenant_id, branch_id)
SELECT 'Case Detail', '{"title":"Case Detail","body":[{"type":"tabs","tabs":[{"label":"Hours","elements":[{"type":"button","label":"Add Hour","onClick":"openCaseHourForm"},{"type":"table","id":"caseHoursTbl","options":{"tableName":"case_hours","addButton":false,"showGlobalSearch":false}}]},{"label":"Documents","elements":[{"type":"button","label":"Upload Document","onClick":"uploadCaseDocument"},{"type":"table","id":"caseDocsTbl","options":{"tableName":"documents","addButton":false,"showGlobalSearch":false}}]},{"label":"Invoices","elements":[{"type":"html","html":"<p>Coming soon...</p>"}]},{"label":"Payments","elements":[{"type":"html","html":"<p>Coming soon...</p>"}]}]}],"footer":[{"type":"button","label":"Close","onClick":"closeModal"}]}' , NULL, NULL
WHERE NOT EXISTS (SELECT 1 FROM ui_modals WHERE name = 'Case Detail');
