root = Card([header, otpCard, flightsCard, delaysCard, gateChangesCard, crewsCard, weatherCard, loadCard, connectionsCard, rebookCard, hubCard, cancellationsCard, turnaroundCard])
header = CardHeader("Hub Operations Desk", "KATL — Atlanta Hub | Live")
otpCard = Card([otpTitle, otpChart, otpTag], "sunk")
otpTitle = Heading("On-Time Performance Today", "h3")
otpChart = RadialChart(["On Time", "Delayed"], [78, 22])
otpTag = Tag("78% on time", null, null, "success")
flightsCard = Card([flightsTitle, flightsTable], "sunk")
flightsTitle = Heading("Flights", "h3")
flightsTable = Table([fltCol, routeCol, gateCol, statusCol])
fltCol = Col("Flight", ["DL101", "DL202", "DL303", "DL404", "DL505"])
routeCol = Col("Route", ["ATL–JFK", "ATL–LAX", "ATL–ORD", "ATL–MIA", "ATL–DFW"])
gateCol = Col("Gate", ["B12", "C4", "A9", "D7", "B3"])
statusCol = Col("Status", ["On time", "Delayed 45m", "Boarding", "On time", "Delayed 30m"])
delaysCard = Card([delaysTitle, delaysList], "sunk")
delaysTitle = Heading("Delayed Flights", "h3")
delaysList = ListBlock([delay1, delay2, delay3])
delay1 = ListItem("DL202 — ATL to LAX", "Delayed 45m | Gate C4 | Weather hold")
delay2 = ListItem("DL505 — ATL to DFW", "Delayed 30m | Gate B3 | Late inbound")
delay3 = ListItem("DL606 — ATL to SFO", "Delayed 20m | Gate E2 | Crew rotation")
gateChangesCard = Card([gateTitle, gateList], "sunk")
gateTitle = Heading("Recent Gate Changes", "h3")
gateList = ListBlock([gate1, gate2, gate3])
gate1 = ListItem("DL101", "Moved B12 → B14 at 14:05")
gate2 = ListItem("DL303", "Moved A9 → A11 at 13:48")
gate3 = ListItem("DL707", "Moved C2 → C6 at 13:30")
crewsCard = Card([crewsTitle, crewsTable], "sunk")
crewsTitle = Heading("Crews Available for Reassignment", "h3")
crewsTable = Table([crewName, crewRole, crewReady])
crewName = Col("Crew", ["Crew 12", "Crew 7", "Crew 21", "Crew 3"])
crewRole = Col("Role", ["Pilots", "Cabin", "Cabin", "Pilots"])
crewReady = Col("Ready", ["14:30", "15:00", "15:15", "16:00"])
weatherCard = Card([weatherTitle, weatherAlert, weatherText], "sunk")
weatherTitle = Heading("Weather Advisories", "h3")
weatherAlert = Alert("Thunderstorm watch", "Scattered storms near ATL until 16:00. Expect ground stops.", "warning")
weatherText = TextContent("Winds gusting to 35 kt. De-icing active on ramp B.", "small")
loadCard = Card([loadTitle, loadChart], "sunk")
loadTitle = Heading("Average Passenger Load Today", "h3")
loadChart = BarChart(["06:00", "10:00", "14:00", "18:00"], [loadSeries], "grouped", "Time", "Passengers")
loadSeries = Series("Load", [142, 188, 165, 201])
connectionsCard = Card([connTitle, connList], "sunk")
connTitle = Heading("Connections at Risk", "h3")
connList = ListBlock([conn1, conn2])
conn1 = ListItem("DL202 → DL88 to SEA", "45 min connection — tight, DL202 delayed 45m")
conn2 = ListItem("DL505 → DL12 to BOS", "30 min connection — at risk, DL505 delayed 30m")
rebookCard = Card([rebookTitle, rebookForm], "sunk")
rebookTitle = Heading("Rebook Affected Passengers", "h3")
rebookForm = Form("rebook", rebookButtons, [paxField, flightField, altField])
paxField = FormControl("Passenger ID", paxInput)
paxInput = Input("pax_id", "e.g. 884512")
flightField = FormControl("Original flight", flightInput)
flightInput = Input("flight", "DL202")
altField = FormControl("Alternate flight", altSelect)
altSelect = Select("alt_flight", [alt1, alt2, alt3], "Choose replacement")
alt1 = SelectItem("DL204", "DL204 — ATL–LAX 18:30")
alt2 = SelectItem("DL210", "DL210 — ATL–LAX 20:15")
alt3 = SelectItem("DL214", "DL214 — ATL–LAX 22:00")
rebookButtons = Buttons([rebookBtn, cancelRebookBtn])
rebookBtn = Button("Rebook passenger", null, "primary")
cancelRebookBtn = Button("Cancel", null, "tertiary")
hubCard = Card([hubTitle, hubForm], "sunk")
hubTitle = Heading("Look at a Different Hub", "h3")
hubForm = Form("hub_select", hubButtons, [hubField])
hubField = FormControl("Hub", hubSelect)
hubSelect = Select("hub", [hub1, hub2, hub3], "Choose hub")
hub1 = SelectItem("KATL", "Atlanta (KATL)")
hub2 = SelectItem("KORD", "Chicago (KORD)")
hub3 = SelectItem("KDFW", "Dallas (KDFW)")
hubButtons = Buttons([hubBtn])
hubBtn = Button("Switch hub", null, "primary")
cancellationsCard = Card([cancellationsTitle, cancellationsList], "sunk")
cancellationsTitle = Heading("Cancellations Today", "h3")
cancellationsList = ListBlock([cancel1, cancel2])
cancel1 = ListItem("DL808 — ATL to BOS", "Cancelled — crew timeout")
cancel2 = ListItem("DL909 — ATL to DEN", "Cancelled — weather")
turnaroundCard = Card([turnaroundTitle, turnaroundChart], "sunk")
turnaroundTitle = Heading("Average Turnaround Time", "h3")
turnaroundChart = BarChart(["Narrow-body", "Wide-body"], [turnaroundSeries], "grouped", "Aircraft", "Minutes")
turnaroundSeries = Series("Turnaround", [42, 68])
followup = FollowUpBlock([fu1, fu2, fu3])
fu1 = FollowUpItem("Show me flights delayed over 30 minutes")
fu2 = FollowUpItem("List crews available right now")
fu3 = FollowUpItem("What weather advisories are active?")