root = Card([header, controls, kpiRow, trendRow, budgetRow, riskRow, boardCard], "card", "column", "xl")
header = CardHeader("Quarterly command view", "Q3 2025 · All regions")
controls = Card([quarterField, regionField, exportButton], "sunk", "row", "l", "end")
quarterField = FormControl("Quarter", quarterSelect)
quarterSelect = Select("quarter", [q1, q2, q3, q4], "Select quarter", null, "Q3 2025")
q1 = SelectItem("Q1 2025", "Q1 2025")
q2 = SelectItem("Q2 2025", "Q2 2025")
q3 = SelectItem("Q3 2025", "Q3 2025")
q4 = SelectItem("Q4 2025", "Q4 2025")
regionField = FormControl("Region", regionSelect)
regionSelect = Select("region", [allRegions, regionNA, regionEU, regionAPAC], "All regions", null, "all")
allRegions = SelectItem("all", "All regions")
regionNA = SelectItem("na", "North America")
regionEU = SelectItem("eu", "Europe")
regionAPAC = SelectItem("apac", "APAC")
exportButton = Button("Export pack", null, "primary")
kpiRow = Card([revenueKpi, costsKpi, profitKpi, runwayKpi, pipelineKpi, winRateKpi, customersKpi, churnKpi, npsKpi], "clear", "row", "m", "stretch", "start", true)
revenueKpi = Card([revenueKpiLabel, revenueKpiValue, revenueKpiTag], "sunk", "column", "xs")
revenueKpiLabel = TextContent("Revenue", "small")
revenueKpiValue = TextContent("$48.2M", "large-heavy")
revenueKpiTag = Tag("+12% YoY", null, "sm", "success")
costsKpi = Card([costsKpiLabel, costsKpiValue, costsKpiTag], "sunk", "column", "xs")
costsKpiLabel = TextContent("Costs", "small")
costsKpiValue = TextContent("$38.8M", "large-heavy")
costsKpiTag = Tag("+7% YoY", null, "sm", "neutral")
profitKpi = Card([profitKpiLabel, profitKpiValue, profitKpiTag], "sunk", "column", "xs")
profitKpiLabel = TextContent("Profit", "small")
profitKpiValue = TextContent("$9.4M", "large-heavy")
profitKpiTag = Tag("19.5% margin", null, "sm", "success")
runwayKpi = Card([runwayKpiLabel, runwayKpiValue, runwayKpiTag], "sunk", "column", "xs")
runwayKpiLabel = TextContent("Runway", "small")
runwayKpiValue = TextContent("18 months", "large-heavy")
runwayKpiTag = Tag("stable", null, "sm", "info")
pipelineKpi = Card([pipelineKpiLabel, pipelineKpiValue, pipelineKpiTag], "sunk", "column", "xs")
pipelineKpiLabel = TextContent("Pipeline", "small")
pipelineKpiValue = TextContent("$32.5M", "large-heavy")
pipelineKpiTag = Tag("+6% QoQ", null, "sm", "success")
winRateKpi = Card([winRateKpiLabel, winRateKpiValue, winRateKpiTag], "sunk", "column", "xs")
winRateKpiLabel = TextContent("Win rate", "small")
winRateKpiValue = TextContent("34%", "large-heavy")
winRateKpiTag = Tag("+2 pts", null, "sm", "success")
customersKpi = Card([customersKpiLabel, customersKpiValue, customersKpiTag], "sunk", "column", "xs")
customersKpiLabel = TextContent("Customers", "small")
customersKpiValue = TextContent("1,284", "large-heavy")
customersKpiTag = Tag("41 new", null, "sm", "success")
churnKpi = Card([churnKpiLabel, churnKpiValue, churnKpiTag], "sunk", "column", "xs")
churnKpiLabel = TextContent("Churn", "small")
churnKpiValue = TextContent("1.8%", "large-heavy")
churnKpiTag = Tag("+0.3 pts", null, "sm", "warning")
npsKpi = Card([npsKpiLabel, npsKpiValue, npsKpiTag], "sunk", "column", "xs")
npsKpiLabel = TextContent("NPS", "small")
npsKpiValue = TextContent("52", "large-heavy")
npsKpiTag = Tag("+4 YoY", null, "sm", "success")
trendRow = Card([revenueCard, costsCard], "clear", "row", "l", "stretch")
revenueCard = Card([revenueTitle, revenueChart], "sunk", "column", "s")
revenueTitle = Heading("Revenue by quarter", "h3")
revenueChart = LineChart(["Q4 '24", "Q1 '25", "Q2 '25", "Q3 '25"], [revenueSeries], "natural", null, "$M")
revenueSeries = Series("Revenue", [42.1, 43.8, 45.6, 48.2])
costsCard = Card([costsTitle, costsChart], "sunk", "column", "s")
costsTitle = Heading("Costs by quarter", "h3")
costsChart = LineChart(["Q4 '24", "Q1 '25", "Q2 '25", "Q3 '25"], [costsSeries], "natural", null, "$M")
costsSeries = Series("Costs", [36.2, 37.1, 37.9, 38.8])
budgetRow = Card([budgetDeptCard, headcountCard], "clear", "row", "l", "stretch")
budgetDeptCard = Card([budgetTitle, budgetChart], "sunk", "column", "s")
budgetTitle = Heading("Budget vs plan by department", "h3")
budgetChart = BarChart(["Engineering", "Sales", "Marketing", "Ops", "R&D"], [planSeries, actualSeries], "grouped", null, "$M")
planSeries = Series("Plan", [12.0, 8.5, 6.0, 5.5, 4.0])
actualSeries = Series("Actual", [11.4, 8.9, 6.3, 5.2, 4.1])
headcountCard = Card([headcountTitle, headcountChart], "sunk", "column", "s")
headcountTitle = Heading("Headcount by department", "h3")
headcountChart = HorizontalBarChart(["Engineering", "Sales", "Marketing", "Ops", "R&D"], [headcountSeries])
headcountSeries = Series("Headcount", [142, 86, 54, 48, 38])
riskRow = Card([risksCard, initiativesCard], "clear", "row", "l", "stretch")
risksCard = Card([risksTitle, risksTable], "sunk", "column", "s")
risksTitle = Heading("Top risks & owners", "h3")
risksTable = Table([riskNameCol, riskOwnerCol, riskLikeCol, riskImpactCol])
riskNameCol = Col("Risk", ["Key customer concentration", "Supply chain disruption", "Talent retention", "FX exposure", "Data center outage"])
riskOwnerCol = Col("Owner", ["A. Chen", "M. Okafor", "S. Patel", "D. Kim", "J. Rossi"])
riskLikeCol = Col("Likelihood", ["High", "Medium", "High", "Medium", "Low"])
riskImpactCol = Col("Impact", ["High", "High", "Medium", "Medium", "High"])
initiativesCard = Card([initiativesTitle, initiativesTable], "sunk", "column", "s")
initiativesTitle = Heading("Strategic initiatives", "h3")
initiativesTable = Table([initNameCol, initOwnerCol, initStatusCol])
initNameCol = Col("Initiative", ["North America expansion", "Platform modernization", "AI copilot launch", "Cost reduction program", "Net-zero roadmap"])
initOwnerCol = Col("Owner", ["S. Patel", "J. Rossi", "J. Rossi", "A. Chen", "M. Okafor"])
initStatusCol = Col("Status", ["On track", "At risk", "On track", "Complete", "On track"])
boardCard = Card([boardTitle, boardList], "sunk", "column", "s")
boardTitle = Heading("Next board meeting", "h3")
boardList = ListBlock([boardItem1, boardItem2, boardItem3, boardItem4, boardItem5], "number")
boardItem1 = ListItem("Approve FY26 operating budget", "Finance · pre-read attached")
boardItem2 = ListItem("Pricing pilot results and rollout decision", "Sales · decision required")
boardItem3 = ListItem("APAC expansion: entity structure and investment", "Strategy · board vote")
boardItem4 = ListItem("CEO succession planning update", "Nomination committee")
boardItem5 = ListItem("Cyber insurance renewal and risk posture", "Risk · approval")