root = Card([header, overviewRow, incidentsCard, shelterRouteRow, weatherCard, opsRow, aidRow, infraRow, actionRow], "card", "column", "l")
header = CardHeader("Emergency Response Coordination Center", "Unified command dashboard • Updated 14:32 UTC")
overviewRow = Card([severityCard, availabilityCard, outcomeCard], "clear", "row", "m")
severityCard = Card([severityHeading, severityChart], "sunk", "column", "m")
severityHeading = Heading("Overall severity", "h3")
severityChart = PieChart(["Low", "Moderate", "High", "Critical"], [12, 8, 5, 3], "donut")
availabilityCard = Card([availabilityHeading, availabilityTable], "sunk", "column", "m")
availabilityHeading = Heading("Available resources", "h3")
availabilityTable = Table([resCatCol, resCountCol])
resCatCol = Col("Category", ["Vehicles", "Personnel", "Supplies"])
resCountCol = Col("Available", ["32", "124", "850"])
outcomeCard = Card([outcomeHeading, outcomeTable], "sunk", "column", "m")
outcomeHeading = Heading("Population status", "h3")
outcomeTable = Table([metricCol, countCol])
metricCol = Col("Metric", ["Rescued", "Injured", "Fatalities", "Missing"])
countCol = Col("Count", ["1,248", "87", "14", "23"])
incidentsCard = Card([incidentsHeading, incidentsTable], "sunk", "column", "m")
incidentsHeading = Heading("Active incidents by zone", "h3")
incidentsTable = Table([zoneCol, incidentCol, severityCol])
zoneCol = Col("Zone", ["Alpha", "Alpha", "Bravo", "Bravo", "Gamma", "Delta"])
incidentCol = Col("Incident", ["Building collapse", "Gas leak", "Flash flood", "Structure fire", "Landslide", "Power outage"])
severityCol = Col("Severity", ["Critical", "High", "Critical", "Moderate", "High", "Moderate"])
shelterRouteRow = Card([sheltersCard, routesCard], "clear", "row", "m")
sheltersCard = Card([sheltersHeading, sheltersTable], "sunk", "column", "m")
sheltersHeading = Heading("Shelters", "h3")
sheltersTable = Table([shelterNameCol, capacityCol, occupiedCol, availableCol])
shelterNameCol = Col("Shelter", ["Alpha Community Center", "Bravo High School", "Gamma Armory", "Delta Convention Center"])
capacityCol = Col("Capacity", [300, 450, 200, 600])
occupiedCol = Col("Occupied", [182, 327, 154, 210])
availableCol = Col("Available", [118, 123, 46, 390])
routesCard = Card([routesHeading, routesTable], "sunk", "column", "m")
routesHeading = Heading("Evacuation routes", "h3")
routesTable = Table([routeNameCol, statusCol])
routeNameCol = Col("Route", ["Route 1 - North", "Route 2 - East", "Route 3 - South", "Route 4 - West"])
statusCol = Col("Status", ["Open", "Congested", "Closed", "Open"])
weatherCard = Card([weatherHeading, weatherText, weatherChart], "sunk", "column", "m")
weatherHeading = Heading("48-hour weather forecast", "h3")
weatherText = TextContent("Mostly cloudy, heavy rain expected overnight. Wind gusts up to 40 mph.", "default")
weatherChart = LineChart(["Now", "6h", "12h", "18h", "24h", "30h", "36h", "42h", "48h"], [tempSeries, precipSeries], "natural", "Time", "Temp (F)")
tempSeries = Series("Temp (F)", [62, 59, 55, 52, 50, 48, 46, 45, 47])
precipSeries = Series("Precip %", [10, 30, 60, 85, 90, 80, 65, 50, 40])
opsRow = Card([volunteersCard, tasksCard], "clear", "row", "m")
volunteersCard = Card([volunteersHeading, volunteersTable], "sunk", "column", "m")
volunteersHeading = Heading("Volunteers on duty", "h3")
volunteersTable = Table([volunteerNameCol, assignmentCol])
volunteerNameCol = Col("Volunteer", ["Maria G.", "James T.", "Priya S.", "Dan W.", "Elena R."])
assignmentCol = Col("Assignment", ["Shelter intake - Alpha", "Route patrol - Route 2", "Supply distribution - Gamma", "Search & rescue - Delta", "Comms relay - HQ"])
tasksCard = Card([tasksHeading, tasksTable], "sunk", "column", "m")
tasksHeading = Heading("Open tasks", "h3")
tasksTable = Table([taskNameCol, assigneeCol])
taskNameCol = Col("Task", ["Restore power substation", "Clear Route 3 debris", "Distribute water to Delta", "Set up field hospital", "Inspect levee"])
assigneeCol = Col("Assignee", ["Crew A - Ops", "Public Works", "Logistics Team", "Medical Command", "Engineering"])
aidRow = Card([donationsCard, requestsCard], "clear", "row", "m")
donationsCard = Card([donationsHeading, donationsTotal, donationsTable], "sunk", "column", "m")
donationsHeading = Heading("Donations received", "h3")
donationsTotal = TextContent("Total: $184,500 + 2,300 supply items", "small-heavy")
donationsTable = Table([donorCol, itemCol, amountCol])
donorCol = Col("Donor", ["Red Cross", "Acme Corp", "Local fund", "Anonymous"])
itemCol = Col("Item", ["Cash", "Water bottles", "Blankets", "Cash"])
amountCol = Col("Amount", ["$120,000", "1,500 units", "800 units", "$64,500"])
requestsCard = Card([requestsHeading, requestsTable], "sunk", "column", "m")
requestsHeading = Heading("Aid requests awaiting action", "h3")
requestsTable = Table([reqIdCol, reqZoneCol, reqPriorityCol, reqStatusCol])
reqIdCol = Col("Request", ["R-1042", "R-1043", "R-1044", "R-1045"])
reqZoneCol = Col("Zone", ["Alpha", "Bravo", "Gamma", "Delta"])
reqPriorityCol = Col("Priority", ["High", "Critical", "Medium", "High"])
reqStatusCol = Col("Status", ["Pending", "Pending", "Assigned", "Pending"])
infraRow = Card([commsCard, roadsCard, hospitalsCard], "clear", "row", "m")
commsCard = Card([commsHeading, commsTable], "sunk", "column", "m")
commsHeading = Heading("Communication channels", "h3")
commsTable = Table([channelCol, channelStatusCol])
channelCol = Col("Channel", ["Radio - VHF", "Satellite phone", "4G/LTE", "Starlink", "POTS"])
channelStatusCol = Col("Status", ["Up", "Down", "Up", "Up", "Down"])
roadsCard = Card([roadsHeading, roadsTable], "sunk", "column", "m")
roadsHeading = Heading("Road closures", "h3")
roadsTable = Table([roadCol, segmentCol, reasonCol])
roadCol = Col("Road", ["Highway 7", "Route 3", "Maple Ave", "Cedar Bridge"])
segmentCol = Col("Segment", ["Mile 12-18", "Mile 0-5", "Downtown", "Full span"])
reasonCol = Col("Reason", ["Flooding", "Debris", "Gas leak", "Structural damage"])
hospitalsCard = Card([hospitalsHeading, hospitalsTable], "sunk", "column", "m")
hospitalsHeading = Heading("Nearby hospitals", "h3")
hospitalsTable = Table([hospitalNameCol, freeBedsCol, totalBedsCol])
hospitalNameCol = Col("Hospital", ["St. Mary's", "County General", "Northside Medical", "Veterans Memorial"])
freeBedsCol = Col("Free beds", [24, 42, 18, 5])
totalBedsCol = Col("Total beds", [120, 200, 80, 60])
actionRow = Card([actionRow1, actionRow2], "clear", "column", "m")
actionRow1 = Card([focusCard, resourceRequestCard], "clear", "row", "m")
focusCard = Card([focusHeading, focusForm], "sunk", "column", "m")
focusHeading = Heading("Focus on a zone", "h3")
focusForm = Form("focus-zone", focusButtons, [focusField])
focusField = FormControl("Zone", focusSelect)
focusSelect = Select("zone", [zoneAlpha, zoneBravo, zoneGamma, zoneDelta], "Select zone")
zoneAlpha = SelectItem("alpha", "Alpha")
zoneBravo = SelectItem("bravo", "Bravo")
zoneGamma = SelectItem("gamma", "Gamma")
zoneDelta = SelectItem("delta", "Delta")
focusButtons = Buttons([focusBtn])
focusBtn = Button("Set focus", null, "primary")
resourceRequestCard = Card([resourceHeading, resourceForm], "sunk", "column", "m")
resourceHeading = Heading("Request resources", "h3")
resourceForm = Form("resource-request", resourceButtons, [resourceTypeField, quantityField])
resourceTypeField = FormControl("Resource type", resourceSelect)
resourceSelect = Select("resource_type", [resVehicles, resPersonnel, resWater, resFood, resMedical], "Select type")
resVehicles = SelectItem("vehicles", "Vehicles")
resPersonnel = SelectItem("personnel", "Personnel")
resWater = SelectItem("water", "Water")
resFood = SelectItem("food", "Food")
resMedical = SelectItem("medical", "Medical supplies")
quantityField = FormControl("Quantity", quantityInput)
quantityInput = Input("quantity", "Enter quantity", "number")
resourceButtons = Buttons([submitResourceBtn, resetResourceBtn])
submitResourceBtn = Button("Submit request", null, "primary")
resetResourceBtn = Button("Reset", null, "tertiary")
actionRow2 = Card([broadcastCard, sitrepCard], "clear", "row", "m")
broadcastCard = Card([broadcastHeading, broadcastForm], "sunk", "column", "m")
broadcastHeading = Heading("Broadcast update", "h3")
broadcastForm = Form("broadcast", broadcastButtons, [broadcastField])
broadcastField = FormControl("Message", broadcastTextArea)
broadcastTextArea = TextArea("message", "Write public update...", 4)
broadcastButtons = Buttons([broadcastBtn])
broadcastBtn = Button("Send broadcast", null, "primary")
sitrepCard = Card([sitrepHeading, sitrepForm], "sunk", "column", "m")
sitrepHeading = Heading("File situation report", "h3")
sitrepForm = Form("sitrep", sitrepButtons, [sitrepLocationField, sitrepStatusField, sitrepSummaryField])
sitrepLocationField = FormControl("Location", sitrepLocationInput)
sitrepLocationInput = Input("location", "Zone or address")
sitrepStatusField = FormControl("Situation status", sitrepStatusSelect)
sitrepStatusSelect = Select("sitrep_status", [sitrepStable, sitrepEscalating, sitrepUnderControl, sitrepCritical], "Select status")
sitrepStable = SelectItem("stable", "Stable")
sitrepEscalating = SelectItem("escalating", "Escalating")
sitrepUnderControl = SelectItem("under_control", "Under control")
sitrepCritical = SelectItem("critical", "Critical")
sitrepSummaryField = FormControl("Summary", sitrepSummaryTextArea)
sitrepSummaryTextArea = TextArea("summary", "Describe situation...", 4)
sitrepButtons = Buttons([sitrepSubmitBtn])
sitrepSubmitBtn = Button("Submit report", null, "primary")