root = Card([header, incidentSection, severitySection, resourceSection, shelterSection, routesSection, weatherSection, affectedSection, volunteerSection, donationSection, aidSection, commsSection, roadsSection, hospSection, tasksSection, actionsSection, followUps], "card", "column", "xl")
header = Card([headerTitle, headerMeta, headerBadges], "sunk", "column", "xs")
headerTitle = CardHeader("Emergency Response Coordination Center", "Unified command view")
headerMeta = TextContent("Last updated 14:32 UTC · Incident timeline active", "small")
headerBadges = Card([badgeActive, badgeZone1, badgeZone3], "clear", "row", "xs")
badgeActive = Badge("Operations active", "destructive")
badgeZone1 = Badge("Zone 1 critical", "destructive")
badgeZone3 = Badge("Zone 3 flooding", "secondary")
incidentSection = Card([incidentHeading, incidentsTable], "sunk", "column", "m")
incidentHeading = Heading("Active incidents by zone", "h2")
incidentsTable = Table([incidentZone, incidentType, incidentSeverity])
incidentZone = Col("Zone", ["Zone 1", "Zone 2", "Zone 3", "Zone 4", "Zone 5"])
incidentType = Col("Incident", ["Utility fire", "Flooding", "Structural collapse", "Landslide", "Gas leak"])
incidentSeverity = Col("Severity", ["Critical", "Major", "Moderate", "Major", "Minor"])
severitySection = Card([severityHeading, severityChart, severityCallout], "sunk", "column", "m")
severityHeading = Heading("Overall severity summary", "h2")
severityChart = SingleStackedBarChart(["Critical", "Major", "Moderate", "Minor"], [1, 2, 1, 1])
severityCallout = Callout("warning", "Severity alert", "Zone 1 and Zone 2 remain at critical response levels; additional teams requested.")
resourceSection = Card([resourceHeading, resourcesTable], "sunk", "column", "m")
resourceHeading = Heading("Vehicles, personnel & supplies available", "h2")
resourcesTable = Table([resType, resAvailable, resStatus])
resType = Col("Resource", ["Vehicles", "Personnel", "Water (L)", "Food packs", "Medical kits", "Generators"])
resAvailable = Col("Available", [34, 148, "12,000", 5200, 840, 12])
resStatus = Col("Status", ["In service", "On duty", "Stocked", "Stocked", "Stocked", "Operational"])
shelterSection = Card([shelterHeading, sheltersTable], "sunk", "column", "m")
shelterHeading = Heading("Shelter capacity & occupancy", "h2")
sheltersTable = Table([shelterName, shelterCapacity, shelterOccupancy, shelterUtil])
shelterName = Col("Shelter", ["North High School", "Community Center", "Fairgrounds", "St. Mary's Hall"])
shelterCapacity = Col("Capacity", [300, 150, 500, 200])
shelterOccupancy = Col("Occupancy", [212, 98, 341, 55])
shelterUtil = Col("Utilization", ["71%", "65%", "68%", "28%"])
routesSection = Card([routesHeading, routesTable], "sunk", "column", "m")
routesHeading = Heading("Evacuation route status", "h2")
routesTable = Table([routeName, routeStatus, routeNotes])
routeName = Col("Route", ["Route 1 — Coastal Hwy", "Route 2 — Ridge Rd", "Route 3 — River Rd", "Route 4 — Mountain Pass"])
routeStatus = Col("Status", ["Open", "Congested", "Open", "Closed"])
routeNotes = Col("Notes", ["Clear flow", "Heavy traffic, moving", "Partly flooded", "Landslide at mile 12"])
weatherSection = Card([weatherHeading, weatherChart, weatherCallout], "sunk", "column", "m")
weatherHeading = Heading("Weather forecast — next 48 hours", "h2")
weatherChart = LineChart(["0h", "6h", "12h", "18h", "24h", "30h", "36h", "42h", "48h"], [tempSeries, precipSeries], "natural", "Hour", "mm / °C")
tempSeries = Series("Temperature (°C)", [24, 23, 22, 21, 20, 19, 18, 18, 17])
precipSeries = Series("Precipitation (mm)", [2, 5, 12, 18, 22, 15, 8, 4, 2])
weatherCallout = Callout("warning", "Heavy rain expected", "Up to 25 mm in the next 24 hours; flooding risk along Route 3.")
affectedSection = Card([affectedHeading, affectedTable], "sunk", "column", "m")
affectedHeading = Heading("People rescued & casualties", "h2")
affectedTable = Table([affectedMetric, affectedCount])
affectedMetric = Col("Metric", ["People rescued", "Casualties", "Missing"])
affectedCount = Col("Count", [1247, 56, 12])
volunteerSection = Card([volunteerHeading, volunteersTable], "sunk", "column", "m")
volunteerHeading = Heading("Volunteers on duty", "h2")
volunteersTable = Table([volName, volAssignment, volStatus])
volName = Col("Volunteer", ["A. Ruiz", "M. Chen", "D. Okafor", "S. Patel", "L. Novak", "K. Jensen"])
volAssignment = Col("Assignment", ["Shelter intake", "Supply distribution", "Route 2 traffic control", "Medical triage", "Comms relay", "Damage assessment"])
volStatus = Col("Status", ["On duty", "On duty", "On duty", "On duty", "On duty", "Rotating"])
donationSection = Card([donationHeading, donationsTable], "sunk", "column", "m")
donationHeading = Heading("Donations received", "h2")
donationsTable = Table([donSource, donType, donAmount])
donSource = Col("Source", ["Cash fund", "Red Cross", "Corporate drive", "Food bank", "Pharmacy chain"])
donType = Col("Type", ["Funds", "Mixed supplies", "Blankets", "Food packs", "Medical kits"])
donAmount = Col("Amount", ["$432,000", "240 boxes", "1,800", "3,200", "650"])
aidSection = Card([aidHeading, aidRequestsTable], "sunk", "column", "m")
aidHeading = Heading("Aid requests awaiting action", "h2")
aidRequestsTable = Table([reqId, reqType, reqQty, reqPriority])
reqId = Col("Request", ["AR-204", "AR-205", "AR-206", "AR-207"])
reqType = Col("Type", ["Water", "Generators", "Medical staff", "Pumps"])
reqQty = Col("Quantity", ["4,000 L", "6 units", "12 people", "8 units"])
reqPriority = Col("Priority", ["High", "High", "Critical", "Medium"])
commsSection = Card([commsHeading, commsTable], "sunk", "column", "m")
commsHeading = Heading("Communication channels", "h2")
commsTable = Table([chanName, chanStatus, chanNote])
chanName = Col("Channel", ["Satellite uplink", "VHF radio", "Public alert", "Cell network", "Data link"])
chanStatus = Col("Status", ["Up", "Up", "Up", "Degraded", "Down"])
chanNote = Col("Note", ["Primary", "Backup active", "Live", "65% coverage", "Repair crew en route"])
roadsSection = Card([roadsHeading, roadsTable], "sunk", "column", "m")
roadsHeading = Heading("Road closures", "h2")
roadsTable = Table([roadName, roadSegment, roadReason])
roadName = Col("Road", ["Coastal Hwy", "River Rd", "Mountain Pass", "Old Mill Rd"])
roadSegment = Col("Segment", ["Mile 3–7", "Mile 0–9", "Mile 10–15", "Mile 2–4"])
roadReason = Col("Reason", ["Flooding", "Flooding", "Landslide", "Debris"])
hospSection = Card([hospHeading, hospTable], "sunk", "column", "m")
hospHeading = Heading("Nearby hospitals — free beds", "h2")
hospTable = Table([hospName, hospFree, hospTotal, hospEr])
hospName = Col("Hospital", ["St. Mary's", "General Hospital", "Northside Medical", "County Care"])
hospFree = Col("Free beds", [42, 18, 27, 9])
hospTotal = Col("Total beds", [200, 150, 120, 80])
hospEr = Col("ER status", ["Open", "Open", "Diverting", "Open"])
tasksSection = Card([tasksHeading, tasksTable], "sunk", "column", "m")
tasksHeading = Heading("Open tasks", "h2")
tasksTable = Table([taskName, taskAssignee, taskPriority])
taskName = Col("Task", ["Restore Zone 3 power", "Deliver water to Fairgrounds", "Clear Route 2 debris", "Set up field hospital", "Patch data link"])
taskAssignee = Col("Assignee", ["J. Miller", "R. Costa", "Crew 5", "D. Okafor", "T. Nguyen"])
taskPriority = Col("Priority", ["High", "High", "Medium", "Critical", "High"])
actionsSection = Card([actionsHeading, requestForm, broadcastForm, focusForm, sitrepForm], "sunk", "column", "l")
actionsHeading = Heading("Operations actions", "h2")
requestForm = Form("resource-request", requestButtons, [requestTypeField, requestQtyField, requestZoneField])
requestTypeField = FormControl("Resource type", requestTypeSelect)
requestTypeSelect = Select("resource_type", [optWater, optGenerators, optMedical, optFood, optPersonnel], "Select type")
optWater = SelectItem("water", "Water")
optGenerators = SelectItem("generators", "Generators")
optMedical = SelectItem("medical", "Medical supplies")
optFood = SelectItem("food", "Food packs")
optPersonnel = SelectItem("personnel", "Personnel")
requestQtyField = FormControl("Quantity", requestQtyInput, "Amount needed")
requestQtyInput = Input("quantity", "e.g. 4000", "number")
requestZoneField = FormControl("Zone", requestZoneSelect)
requestZoneSelect = Select("zone", [zone1, zone2, zone3, zone4, zone5], "Select zone")
zone1 = SelectItem("zone1", "Zone 1")
zone2 = SelectItem("zone2", "Zone 2")
zone3 = SelectItem("zone3", "Zone 3")
zone4 = SelectItem("zone4", "Zone 4")
zone5 = SelectItem("zone5", "Zone 5")
requestButtons = Buttons([requestSubmit])
requestSubmit = Button("Request resources", null, "primary")
broadcastForm = Form("broadcast-update", broadcastButtons, [broadcastMsgField, broadcastChannelField])
broadcastMsgField = FormControl("Message", broadcastMsgInput)
broadcastMsgInput = TextArea("message", "Write the update citizens should see...", 4)
broadcastChannelField = FormControl("Channel", broadcastChannelSelect)
broadcastChannelSelect = Select("channel", [bchanAlert, bchanRadio, bchanAll], "Select channel")
bchanAlert = SelectItem("alert", "Public alert")
bchanRadio = SelectItem("radio", "VHF radio")
bchanAll = SelectItem("all", "All channels")
broadcastButtons = Buttons([broadcastSubmit])
broadcastSubmit = Button("Broadcast update", null, "primary")
focusForm = Form("focus-zone", focusButtons, [focusZoneField])
focusZoneField = FormControl("Zone", focusZoneSelect)
focusZoneSelect = Select("zone", [zone1, zone2, zone3, zone4, zone5], "Select zone to focus")
focusButtons = Buttons([focusSubmit])
focusSubmit = Button("Focus on zone", null, "primary")
sitrepForm = Form("situation-report", sitrepButtons, [sitrepZoneField, sitrepSeverityField, sitrepNoteField])
sitrepZoneField = FormControl("Zone", sitrepZoneSelect)
sitrepZoneSelect = Select("zone", [zone1, zone2, zone3, zone4, zone5], "Select zone")
sitrepSeverityField = FormControl("Severity", sitrepSeverityRadio)
sitrepSeverityRadio = RadioGroup("severity", [sevCrit, sevMajor, sevMod, sevMinor], "moderate")
sevCrit = RadioItem("Critical", "Immediate threat to life", "critical")
sevMajor = RadioItem("Major", "Significant impact", "major")
sevMod = RadioItem("Moderate", "Contained but active", "moderate")
sevMinor = RadioItem("Minor", "Low impact", "minor")
sitrepNoteField = FormControl("Notes", sitrepNoteInput)
sitrepNoteInput = TextArea("notes", "Describe conditions on the ground...", 4)
sitrepButtons = Buttons([sitrepSubmit])
sitrepSubmit = Button("File situation report", null, "primary")
followUps = FollowUpBlock([fZone1, fDeploy, fShelters])
fZone1 = FollowUpItem("Show me Zone 1 detail view")
fDeploy = FollowUpItem("Deploy additional medical teams")
fShelters = FollowUpItem("Update shelter occupancy")