root = Card([header, alertSummary, kpis, flightTable, crewPanel, weatherPanel, rebookSection, hubSelector])
header = CardHeader("Hub Operations Desk", "Live status across the hub network")
alertSummary = Callout("warning", "3 weather advisories active", "Thunderstorms near KATL may affect arrivals; crews available for reassignment.")
kpis = Card([kpiTitle, kpiGrid], "sunk")
kpiTitle = Heading("Today's Key Metrics", "h3")
kpiGrid = Table([kpiName, kpiValue])
kpiName = Col("Metric", ["On-Time Performance", "Avg Passenger Load", "Avg Turnaround Time", "Cancellations"])
kpiValue = Col("Value", ["82%", "74%", "38 min", "6"])
flightTable = Card([flightHeading, flights])
flightHeading = Heading("Flights", "h3")
flights = Table([flightCol, routeCol, gateCol, statusCol])
flightCol = Col("Flight", ["DL101", "DL202", "DL303", "DL404", "DL505", "DL606", "DL707", "DL808"])
routeCol = Col("Route", ["ATL-LAX", "ATL-JFK", "ATL-ORD", "ATL-MIA", "ATL-DFW", "ATL-SFO", "ATL-BOS", "ATL-SEA"])
gateCol = Col("Gate", ["A12", "B4", "C7", "A3", "B9", "D2", "C11", "A8"])
statusCol = Col("Status", ["Delayed", "On Time", "Delayed", "On Time", "On Time", "Delayed", "On Time", "Cancelled"])
delayedCallout = Callout("error", "Delayed Flights", "DL101, DL303, DL606 are delayed due to weather; monitor gates for updates.")
gateChangeSection = Card([gateChangeHeading, gateChanges])
gateChangeHeading = Heading("Recent Gate Changes", "h3")
gateChanges = ListBlock([gc1, gc2, gc3])
gc1 = ListItem("DL101", "Gate changed from A12 to A14", null, "View")
gc2 = ListItem("DL303", "Gate changed from C7 to C5", null, "View")
gc3 = ListItem("DL606", "Gate changed from D2 to D4", null, "View")
crewPanel = Card([crewHeading, crewList])
crewHeading = Heading("Crews Available for Reassignment", "h3")
crewList = ListBlock([crew1, crew2, crew3])
crew1 = ListItem("Crew 12", "Pilots: 2, Attendants: 4, Ready in 30 min", null, "Assign")
crew2 = ListItem("Crew 18", "Pilots: 2, Attendants: 3, Ready in 45 min", null, "Assign")
crew3 = ListItem("Crew 22", "Pilots: 1, Attendants: 5, Ready in 60 min", null, "Assign")
weatherPanel = Card([weatherHeading, weatherList])
weatherHeading = Heading("Weather Advisories at Hub", "h3")
weatherList = ListBlock([w1, w2, w3])
w1 = ListItem("Thunderstorm", "KATL area, gusts up to 40 mph, until 18:00", null, "Details")
w2 = ListItem("Fog", "Visibility low, until 09:00", null, "Details")
w3 = ListItem("Wind Advisory", "Crosswinds at runways 3L/3R", null, "Details")
rebookSection = Card([rebookHeading, rebookList])
rebookHeading = Heading("Connections at Risk of Being Missed", "h3")
rebookList = ListBlock([conn1, conn2, conn3])
conn1 = ListItem("DL101 → DL404", "Passenger: 12, Connection time: 15 min", null, "Rebook")
conn2 = ListItem("DL303 → DL505", "Passenger: 8, Connection time: 10 min", null, "Rebook")
conn3 = ListItem("DL606 → DL707", "Passenger: 20, Connection time: 20 min", null, "Rebook")
rebookAction = Buttons([rebookBtn])
rebookBtn = Button("Rebook Affected Passengers", null, "primary")
hubSelector = Card([hubHeading, hubForm])
hubHeading = Heading("Select a Different Hub", "h3")
hubForm = Form("hub-select", hubButtons, [hubField])
hubField = FormControl("Hub", hubSelect)
hubSelect = Select("hub", [hubATL, hubJFK, hubLAX], "Choose a hub")
hubATL = SelectItem("ATL", "Atlanta (ATL)")
hubJFK = SelectItem("JFK", "New York (JFK)")
hubLAX = SelectItem("LAX", "Los Angeles (LAX)")
hubButtons = Buttons([hubBtn])
hubBtn = Button("Load Hub", null, "primary")