root = Card([header, uptimeCard, resourceChartCard, errorCallout, incidentsSection, regionSelect, slowEndpointTable, alertThresholdForm, acknowledgeButton])
header = CardHeader("Service Health Overview")
uptimeHeader = CardHeader("Uptime this quarter")
uptimeValue = TextContent("99.9%", "large")
uptimeCard = Card([uptimeHeader, uptimeValue])
resourceChartTitle = CardHeader("Resource Usage (24h)")
cpuSeries = Series("CPU", [20,25,30,35,40])
memorySeries = Series("Memory", [45,50,55,60,65])
resourceChart = LineChart(labels: ["0h","6h","12h","18h","24h"], series: [cpuSeries, memorySeries], variant: "linear", xLabel: "Hour", yLabel: "Usage (%)")
resourceChartCard = Card([resourceChartTitle, resourceChart])
errorCallout = Callout(variant: "warning", title: "Error Rate", description: "1.2%")
incidentsHeader = CardHeader("Open Incidents")
incident1 = ListItem(title: "Database Outage (Critical)", subtitle: "Primary DB down", image: null, actionLabel: null)
incident2 = ListItem(title: "API Error (Warning)", subtitle: "High latency", image: null, actionLabel: null)
incidentsList = ListBlock([incident1, incident2])
incidentsSection = Card([incidentsHeader, incidentsList])
regionSelect = Select("region_filter", [regionNorth, regionSouth, regionEast, regionWest], "Select a region")
regionNorth = SelectItem("North", "North")
regionSouth = SelectItem("South", "South")
regionEast = SelectItem("East", "East")
regionWest = SelectItem("West", "West")
colEndpoint = Col("Endpoint", ["login", "checkout", "profile", "search", "payment"], "string")
colLatency = Col("Latency (ms)", [210,185,170,160,150], "number")
slowEndpointTable = Table(columns: [colEndpoint, colLatency])
thresholdInput = Input("threshold", "200", "number", rules: ["min:0"], value: "200")
thresholdField = FormControl("Alert threshold (ms)", thresholdInput)
formButtons = Buttons([saveBtn, cancelBtn])
saveBtn = Button("Save", null, "primary")
cancelBtn = Button("Cancel", null, "secondary")
alertThresholdForm = Form("alert-threshold", formButtons, [thresholdField])
acknowledgeButton = Button("Acknowledge Incident", null, "secondary")