root = Card([header, kpiSection, trendsSection, resourceSection, riskSection, initSection, boardSection], "clear", "column", "2xl")
header = Card([headerTitle, controlsForm], "clear", "row", "l", "center", "between")
headerTitle = CardHeader("Quarterly Command View", "Q3 2025 · All regions · Executive summary")
controlsForm = Form("command-controls", controlButtons, [quarterField, regionField])
controlButtons = Buttons([exportBtn], "row")
exportBtn = Button("Export full pack", null, "primary", null, "small")
quarterField = FormControl("Quarter", quarterSelect, "Switch reporting period")
quarterSelect = Select("quarter", [q1Sel, q2Sel, q3Sel], "Q3 2025", null, "q3", "small")
q1Sel = SelectItem("q1", "Q1 2025")
q2Sel = SelectItem("q2", "Q2 2025")
q3Sel = SelectItem("q3", "Q3 2025")
regionField = FormControl("Region", regionSelect, "Focus one region")
regionSelect = Select("region", [allRegionOpt, naOpt, emeaOpt, apacOpt, latamOpt], "All regions", null, "all", "small")
allRegionOpt = SelectItem("all", "All regions")
naOpt = SelectItem("na", "North America")
emeaOpt = SelectItem("emea", "EMEA")
apacOpt = SelectItem("apac", "APAC")
latamOpt = SelectItem("latam", "LATAM")
kpiSection = Card([kpisHeading, kpiRow], "card", "column", "m")
kpisHeading = Heading("Quarterly KPIs", "h2")
kpiRow = Card([kpiRowTop, kpiRowBottom], "clear", "column", "m")
kpiRowTop = Card([revenueKpi, costKpi, profitKpi, runwayKpi], "clear", "row", "m", "stretch")
kpiRowBottom = Card([pipelineKpi, winRateKpi, customersKpi, npsKpi], "clear", "row", "m", "stretch")
revenueKpi = Card([revLabel, revValue, revTag], "sunk", "column", "none", "start")
revLabel = TextContent("Revenue", "small")
revValue = TextContent("$128.4M", "large-heavy")
revTag = Tag("+12% YoY", null, "sm", "success")
costKpi = Card([costLabel, costValue, costTag], "sunk", "column", "none", "start")
costLabel = TextContent("Costs", "small")
costValue = TextContent("$97.2M", "large-heavy")
costTag = Tag("+6% YoY", null, "sm", "warning")
profitKpi = Card([profitLabel, profitValue, profitTag], "sunk", "column", "none", "start")
profitLabel = TextContent("Profit", "small")
profitValue = TextContent("$31.2M", "large-heavy")
profitTag = Tag("+22% YoY", null, "sm", "success")
runwayKpi = Card([runwayLabel, runwayValue, runwayTag], "sunk", "column", "none", "start")
runwayLabel = TextContent("Runway", "small")
runwayValue = TextContent("14 mo", "large-heavy")
runwayTag = Tag("Net cash positive", null, "sm", "success")
pipelineKpi = Card([pipelineLabel, pipelineValue, pipelineTag], "sunk", "column", "none", "start")
pipelineLabel = TextContent("Sales pipeline", "small")
pipelineValue = TextContent("$86.5M", "large-heavy")
pipelineTag = Tag("2.3x coverage", null, "sm", "info")
winRateKpi = Card([winLabel, winValue, winTag], "sunk", "column", "none", "start")
winLabel = TextContent("Win rate", "small")
winValue = TextContent("31%", "large-heavy")
winTag = Tag("+3 pts", null, "sm", "success")
customersKpi = Card([customersLabel, customersValue, churnTag], "sunk", "column", "none", "start")
customersLabel = TextContent("Customers", "small")
customersValue = TextContent("4,812", "large-heavy")
churnTag = Tag("2.1% churn", null, "sm", "warning")
npsKpi = Card([npsLabel, npsValue, npsTag], "sunk", "column", "none", "start")
npsLabel = TextContent("NPS", "small")
npsValue = TextContent("54", "large-heavy")
npsTag = Tag("+6 YoY", null, "sm", "success")
trendsSection = Card([trendsHeading, trendsRow], "card", "column", "m")
trendsHeading = Heading("Revenue and costs — trailing 4 quarters", "h2")
trendsRow = Card([revenueTrendCard, costTrendCard], "clear", "row", "l")
revenueTrendCard = Card([revTrendTitle, revenueTrendChart], "sunk")
revTrendTitle = Heading("Revenue trend", "h3")
revenueTrendChart = AreaChart(["Q4 24", "Q1 25", "Q2 25", "Q3 25"], [revenueSeries], "linear", "Quarter", "$M")
revenueSeries = Series("Revenue", [112.0, 118.0, 123.0, 128.4])
costTrendCard = Card([costTrendTitle, costTrendChart], "sunk")
costTrendTitle = Heading("Costs trend", "h3")
costTrendChart = AreaChart(["Q4 24", "Q1 25", "Q2 25", "Q3 25"], [costSeries], "linear", "Quarter", "$M")
costSeries = Series("Costs", [92.0, 94.0, 95.0, 97.2])
resourceSection = Card([resourceHeading, resourceRow], "card", "column", "m")
resourceHeading = Heading("Budget vs plan and headcount", "h2")
resourceRow = Card([budgetCard, headcountCard], "clear", "row", "l")
budgetCard = Card([budgetTitle, budgetChart], "sunk")
budgetTitle = Heading("Budget by department", "h3")
budgetChart = HorizontalBarChart(["Engineering", "Sales", "Marketing", "Operations", "R&D"], [budgetPlanSeries, budgetActualSeries], "grouped", "Department", "$M")
budgetPlanSeries = Series("Plan", [30, 24, 18, 14, 12])
budgetActualSeries = Series("Actual", [28.5, 26.2, 17.1, 13.4, 12.8])
headcountCard = Card([headcountTitle, headcountChart], "sunk")
headcountTitle = Heading("Headcount by department", "h3")
headcountChart = BarChart(["Engineering", "Sales", "Marketing", "Operations", "R&D"], [headcountSeries], "grouped", "Department", "Employees")
headcountSeries = Series("Headcount", [320, 145, 62, 88, 54])
riskSection = Card([riskHeading, riskTable], "card", "column", "m")
riskHeading = Heading("Top risks", "h2")
riskTable = Table([riskNameCol, riskOwnerCol])
riskNameCol = Col("Top risk", ["Cloud cost overrun", "Key account concentration", "Talent attrition in engineering", "Supply chain delay", "Regulatory change in EU"])
riskOwnerCol = Col("Owner", ["Priya Sharma", "Marcus Chen", "Elena Rodriguez", "Tom Okafor", "David Kim"])
initSection = Card([initHeading, initTable], "card", "column", "m")
initHeading = Heading("Strategic initiatives", "h2")
initTable = Table([initNameCol, initStatusCol])
initNameCol = Col("Initiative", ["North America expansion", "AI copilot launch", "Zero-trust security rollout", "Partner ecosystem build", "Carbon-neutral operations"])
initStatusCol = Col("Status", ["On track", "At risk", "On track", "On track", "At risk"])
boardSection = Card([boardHeading, boardList], "card", "column", "m")
boardHeading = Heading("Next board meeting", "h2")
boardList = ListBlock([boardItem1, boardItem2, boardItem3, boardItem4], "number")
boardItem1 = ListItem("Approve FY26 operating plan", "Vote on the annual plan, capital budget, and hiring envelope")
boardItem2 = ListItem("Review AI copilot launch metrics", "Adoption, revenue uplift, and customer feedback after GA")
boardItem3 = ListItem("Approve North America HQ lease", "Sign 10-year lease for the New York office expansion")
boardItem4 = ListItem("Discuss succession planning", "Update on executive bench strength and development plans")