{"name": "Case Details", "rows": [{"classes": "card bg-base-100 shadow card-body grid grid-cols-4 gap-4", "columns": [{"classes": "card bg-base-100 shadow p-4 space-y-1", "elements": [{"tag": "h2", "text": "Client Information", "type": "heading", "classes": "card-title"}, {"type": "paragraph", "label": "Name", "classes": "grid grid-cols-2 gap-2", "data_column": "client.name", "label_classes": "font-semibold"}, {"type": "paragraph", "label": "Phone", "classes": "grid grid-cols-2 gap-2", "data_column": "client.phone", "label_classes": "font-semibold"}, {"type": "paragraph", "label": "Email", "classes": "grid grid-cols-2 gap-2", "data_column": "client.email", "label_classes": "font-semibold"}, {"type": "paragraph", "label": "Address", "classes": "grid grid-cols-2 gap-2", "data_column": "client.address", "label_classes": "font-semibold"}, {"type": "paragraph", "label": "City", "classes": "grid grid-cols-2 gap-2", "data_column": "client.city", "label_classes": "font-semibold"}, {"type": "paragraph", "label": "Country", "classes": "grid grid-cols-2 gap-2", "data_column": "client.country", "label_classes": "font-semibold"}, {"type": "paragraph", "label": "Description", "classes": "grid grid-cols-2 gap-2", "data_column": "client.description", "label_classes": "font-semibold"}]}, {"classes": "card bg-base-100 shadow p-4 space-y-1", "elements": [{"tag": "h2", "text": "Case Information", "type": "heading", "classes": "card-title"}, {"type": "paragraph", "label": "Title", "classes": "grid grid-cols-2 gap-2", "data_column": "title", "label_classes": "font-semibold"}, {"type": "paragraph", "label": "Case Number", "classes": "grid grid-cols-2 gap-2", "data_column": "case_number", "label_classes": "font-semibold"}, {"type": "paragraph", "label": "Status", "classes": "grid grid-cols-2 gap-2", "data_column": "status", "label_classes": "font-semibold"}, {"type": "paragraph", "label": "Lead Rep", "classes": "grid grid-cols-2 gap-2", "data_column": "lead_rep_name", "label_classes": "font-semibold"}, {"type": "paragraph", "label": "Opened", "classes": "grid grid-cols-2 gap-2", "data_column": "opened_at", "label_classes": "font-semibold"}, {"type": "paragraph", "label": "Closed", "classes": "grid grid-cols-2 gap-2", "data_column": "closed_at", "label_classes": "font-semibold"}]}, {"classes": "stats", "elements": [{"type": "div", "classes": "stat", "elements": [{"text": "Hours", "type": "div", "classes": "stat-title"}, {"type": "aggregate", "table": "time_entries", "column": "hours", "classes": "stat-value", "function": "sum", "filterField": "time_entry_id"}]}, {"type": "div", "classes": "stat", "elements": [{"text": "Expenses", "type": "div", "classes": "stat-title"}, {"type": "aggregate", "table": "expenses", "column": "amount", "classes": "stat-value", "function": "sum", "filterField": "case_id"}]}, {"type": "div", "classes": "stat", "elements": [{"text": "Total Hours", "type": "div", "classes": "stat-title"}, {"type": "aggregate", "table": "time_entries", "column": "hours", "classes": "stat-value", "function": "sum", "filterField": "time_entry_id"}]}, {"type": "div", "classes": "stat", "elements": [{"text": "Value", "type": "div", "classes": "stat-title"}, {"type": "aggregate", "table": "time_entries", "column": "total", "classes": "stat-value", "function": "sum", "filterField": "time_entry_id"}]}, {"type": "div", "classes": "stat", "elements": [{"text": "Billed Hours", "type": "div", "classes": "stat-title"}, {"type": "aggregate", "table": "time_entries", "column": "hours", "classes": "stat-value", "filters": {"billed_to_client": 1}, "function": "sum", "filterField": "time_entry_id"}]}, {"type": "div", "classes": "stat", "elements": [{"text": "Billed Amount", "type": "div", "classes": "stat-title"}, {"type": "aggregate", "table": "time_entries", "column": "total", "classes": "stat-value", "filters": {"billed_to_client": 1}, "function": "sum", "filterField": "time_entry_id"}]}]}, {"classes": "card bg-base-100 shadow p-4 space-y-1", "elements": [{"type": "paragraph", "label": "Initial Instructions", "data_column": "initial_instructions"}]}]}], "sources": [{"alias": "client", "table": "clients", "foreignKey": "client_id"}, {"table": "time_entries", "foreignKey": "time_entry_id"}]}