root = Card([header, kpiRow, chartsRow1, chartsRow2, risksTable, initiativesTable, boardItems, followUps], "card", "column", "l")
header = Card([titleBlock, controlsRow], "clear", "row", "m", "center", "between")
titleBlock = Card([title, subtitle], "clear", "column", "xs")
title = Heading("CEO Quarterly Command View", "h2")
subtitle = TextContent("Q3 2024 • Global • Last updated 2 hours ago", "small")
controlsRow = Card([quarterSelect, regionSelect, exportBtn], "clear", "row", "m", "center")
quarterSelect = Select("quarter", quarterOptions, "Select quarter", [], "medium")
quarterOptions = [q1Opt, q2Opt, q3Opt, q4Opt]
q1Opt = SelectItem("q1-2024", "Q1 2024")
q2Opt = SelectItem("q2-2024", "Q2 2024")
q3Opt = SelectItem("q3-2024", "Q3 2024 (current)")
q4Opt = SelectItem("q4-2024", "Q4 2024")
regionSelect = Select("region", regionOptions, "Select region", [], "medium")
regionOptions = [globalOpt, americasOpt, emeaOpt, apacOpt]
globalOpt = SelectItem("global", "Global (all)")
americasOpt = SelectItem("americas", "Americas")
emeaOpt = SelectItem("emea", "EMEA")
apacOpt = SelectItem("apac", "APAC")
exportBtn = Button("Export Pack", ["export-pack"], "secondary")
kpiRow = Card([revCard, costCard, profitCard, runwayCard, pipelineCard, winRateCard, custCard, churnCard, npsCard], "clear", "row", "m", "stretch", "start", true)
revCard = Card([revLabel, revValue, revDelta], "card", "column", "xs")
revLabel = TextContent("Revenue (QTD)", "small")
revValue = TextContent("$42.8M", "large-heavy")
revDelta = TextContent("+12% vs plan", "small-heavy")
costCard = Card([costLabel, costValue, costDelta], "card", "column", "xs")
costLabel = TextContent("Costs (QTD)", "small")
costValue = TextContent("$28.4M", "large-heavy")
costDelta = TextContent("-3% vs plan", "small-heavy")
profitCard = Card([profitLabel, profitValue, profitDelta], "card", "column", "xs")
profitLabel = TextContent("Profit (QTD)", "small")
profitValue = TextContent("$14.4M", "large-heavy")
profitDelta = TextContent("+28% vs plan", "small-heavy")
runwayCard = Card([runwayLabel, runwayValue, runwayDelta], "card", "column", "xs")
runwayLabel = TextContent("Runway", "small")
runwayValue = TextContent("18 months", "large-heavy")
runwayDelta = TextContent("+2 mo vs last Q", "small-heavy")
pipelineCard = Card([pipeLabel, pipeValue, pipeDelta], "card", "column", "xs")
pipeLabel = TextContent("Sales Pipeline", "small")
pipeValue = TextContent("$89.2M", "large-heavy")
pipeDelta = TextContent("+15% QoQ", "small-heavy")
winRateCard = Card([winLabel, winValue, winDelta], "card", "column", "xs")
winLabel = TextContent("Win Rate", "small")
winValue = TextContent("24%", "large-heavy")
winDelta = TextContent("+2pp YoY", "small-heavy")
custCard = Card([custLabel, custValue, custDelta], "card", "column", "xs")
custLabel = TextContent("Customers", "small")
custValue = TextContent("2,847", "large-heavy")
custDelta = TextContent("+312 net new", "small-heavy")
churnCard = Card([churnLabel, churnValue, churnDelta], "card", "column", "xs")
churnLabel = TextContent("Churn Rate", "small")
churnValue = TextContent("4.2%", "large-heavy")
churnDelta = TextContent("-0.8pp vs plan", "small-heavy")
npsCard = Card([npsLabel, npsValue, npsDelta], "card", "column", "xs")
npsLabel = TextContent("NPS", "small")
npsValue = TextContent("62", "large-heavy")
npsDelta = TextContent("+5 vs last Q", "small-heavy")
chartsRow1 = Card([revTrendCard, costTrendCard], "clear", "row", "l", "stretch", "start", true)
revTrendCard = Card([revTrendHeader, revTrendChart], "card", "column", "m")
revTrendHeader = CardHeader("Revenue Trend", "Last 4 quarters, $M")
revTrendChart = LineChart(revQuarters, [revSeries], "natural", "Quarter", "Revenue ($M)")
revQuarters = ["Q4'23", "Q1'24", "Q2'24", "Q3'24"]
revSeries = Series("Revenue", [34.2, 36.8, 39.5, 42.8])
costTrendCard = Card([costTrendHeader, costTrendChart], "card", "column", "m")
costTrendHeader = CardHeader("Costs Trend", "Last 4 quarters, $M")
costTrendChart = LineChart(costQuarters, [costSeries], "natural", "Quarter", "Costs ($M)")
costQuarters = ["Q4'23", "Q1'24", "Q2'24", "Q3'24"]
costSeries = Series("Costs", [24.1, 25.3, 27.1, 28.4])
chartsRow2 = Card([budgetCard, headcountCard], "clear", "row", "l", "stretch", "start", true)
budgetCard = Card([budgetHeader, budgetChart], "card", "column", "m")
budgetHeader = CardHeader("Budget vs Plan by Department", "Q3 2024, $M")
budgetChart = HorizontalBarChart(deptLabels, [budgetActualSeries, budgetPlanSeries], "grouped", "Amount ($M)", "Department")
deptLabels = ["Engineering", "Sales & Marketing", "G&A", "R&D", "Operations"]
budgetActualSeries = Series("Actual", [8.2, 9.5, 3.1, 4.8, 2.8])
budgetPlanSeries = Series("Plan", [8.5, 9.0, 3.0, 5.0, 2.5])
headcountCard = Card([headcountHeader, headcountChart], "card", "column", "m")
headcountHeader = CardHeader("Headcount by Department", "End of Q3 2024")
headcountChart = BarChart(hcLabels, [hcSeries], "grouped", "Department", "Headcount")
hcLabels = ["Engineering", "Sales & Marketing", "G&A", "R&D", "Operations"]
hcSeries = Series("Headcount", [185, 142, 68, 94, 52])
risksTable = Card([risksHeader, risksTableComp], "card", "column", "m")
risksHeader = CardHeader("Top Risks", "Ranked by impact × likelihood")
risksTableComp = Table([riskCol, ownerCol, impactCol, likelihoodCol, statusCol])
riskCol = Col("Risk", ["Revenue concentration (top 3 customers = 38%)", "Talent attrition in engineering", "Cloud cost overrun", "Competitive displacement in EMEA", "Regulatory changes in data privacy"])
ownerCol = Col("Owner", ["CRO", "CTO", "CFO", "VP Sales EMEA", "General Counsel"])
impactCol = Col("Impact", ["High", "High", "Medium", "Medium", "Low"])
likelihoodCol = Col("Likelihood", ["Medium", "High", "Medium", "Low", "Medium"])
statusCol = Col("Status", ["Mitigating", "Active hiring", "Optimizing", "Monitoring", "Compliance review"])
initiativesTable = Card([initHeader, initTableComp], "card", "column", "m")
initHeader = CardHeader("Strategic Initiatives", "Q3 2024 priorities")
initTableComp = Table([initCol, initOwnerCol, initStatusCol, initProgressCol, initTargetCol])
initCol = Col("Initiative", ["AI Product Launch", "PLG Motion Rollout", "EMEA Expansion", "Platform Scalability", "Customer Success Transformation"])
initOwnerCol = Col("Owner", ["CPO", "CMO", "VP Sales EMEA", "CTO", "CRO"])
initStatusCol = Col("Status", ["On Track", "At Risk", "On Track", "Ahead", "On Track"])
initProgressCol = Col("Progress", ["65%", "35%", "50%", "80%", "45%"])
initTargetCol = Col("Target Date", ["Q4'24", "Q1'25", "Q2'25", "Q4'24", "Q1'25"])
boardItems = Card([boardHeader, boardList], "card", "column", "m")
boardHeader = CardHeader("Next Board Meeting — Key Items", "Scheduled for Oct 15, 2024")
boardList = ListBlock(boardItemsList, "number")
boardItemsList = [boardItem1, boardItem2, boardItem3, boardItem4, boardItem5]
boardItem1 = ListItem("Approve Q4 budget & FY25 planning assumptions", "Finance to present 3 scenarios", null, null)
boardItem2 = ListItem("AI product launch go/no-go decision", "CPO demo + market validation data", null, null)
boardItem3 = ListItem("EMEA expansion investment approval", "$4.2M ask for H1'25 hiring & marketing", null, null)
boardItem4 = ListItem("Executive compensation & equity refresh", "Comp committee recommendation", null, null)
boardItem5 = ListItem("Risk committee: cybersecurity posture review", "CISO annual assessment results", null, null)
followUps = FollowUpBlock([fu1, fu2, fu3, fu4])
fu1 = FollowUpItem("Drill into EMEA pipeline by stage")
fu2 = FollowUpItem("Show engineering headcount vs. roadmap capacity")
fu3 = FollowUpItem("Compare Q3 actuals vs. board plan variance")
fu4 = FollowUpItem("Export full board pack as PDF")