root = Card([header, controls, kpiRow, chartsSection, budgetSection, peopleSection, riskSection, initiativeSection, salesSection, boardSection, exportBtn])
header = CardHeader("CEO Quarterly Command View", "Q2 2026 · Consolidated View · All Regions")
controls = Form("view-controls", controlButtons, [fcQuarter, fcRegion])
controlButtons = Buttons([], "row")
fcQuarter = FormControl("Quarter", quarterSelect, "Select reporting quarter")
quarterSelect = Select("quarter", [q1, q2, q3, q4, q1next], "Q2 2026", { required: true })
q1 = SelectItem("2026-q1", "Q1 2026")
q2 = SelectItem("2026-q2", "Q2 2026")
q3 = SelectItem("2026-q3", "Q3 2026")
q4 = SelectItem("2026-q4", "Q4 2026")
q1next = SelectItem("2027-q1", "Q1 2027")
fcRegion = FormControl("Region Focus", regionSelect, "Filter all metrics by region")
regionSelect = Select("region", [rAll, rNA, rEMEA, rAPAC, rLATAM], "All Regions", { required: true })
rAll = SelectItem("all", "All Regions")
rNA = SelectItem("na", "North America")
rEMEA = SelectItem("emea", "EMEA")
rAPAC = SelectItem("apac", "APAC")
rLATAM = SelectItem("latam", "LATAM")
kpiRow = SnippetCardBlock([kpiRev, kpiCost, kpiProfit, kpiRunway, kpiPipeline, kpiWinRate, kpiCustomers, kpiChurn, kpiNPS], "grid", true)
kpiRev = SnippetCardItem("revenue", kpiRevLhs, kpiRevRhs)
kpiRevLhs = IconText(kpiRevIcon, "success", "m", "Revenue (QTD)", "Quarter to date", false, "horizontal")
kpiRevIcon = Icon("circle-dollar-sign", "finance")
kpiRevRhs = BoldText("number", "$42.8M", "+14.2%", "metric")
kpiCost = SnippetCardItem("costs", kpiCostLhs, kpiCostRhs)
kpiCostLhs = IconText(kpiCostIcon, "warning", "m", "Costs (QTD)", "Quarter to date", false, "horizontal")
kpiCostIcon = Icon("credit-card", "finance")
kpiCostRhs = BoldText("number", "$28.4M", "+8.7%", "metric")
kpiProfit = SnippetCardItem("profit", kpiProfitLhs, kpiProfitRhs)
kpiProfitLhs = IconText(kpiProfitIcon, "success", "m", "Net Profit (QTD)", "Quarter to date", false, "horizontal")
kpiProfitIcon = Icon("trending-up", "charts")
kpiProfitRhs = BoldText("number", "$14.4M", "+26.5%", "metric")
kpiRunway = SnippetCardItem("runway", kpiRunwayLhs, kpiRunwayRhs)
kpiRunwayLhs = IconText(kpiRunwayIcon, "info", "m", "Runway", "At current burn", false, "horizontal")
kpiRunwayIcon = Icon("timer", "time")
kpiRunwayRhs = BoldText("number", "34 months", "+3 vs last Q", "metric")
kpiPipeline = SnippetCardItem("pipeline", kpiPipelineLhs, kpiPipelineRhs)
kpiPipelineLhs = IconText(kpiPipelineIcon, "info", "m", "Sales Pipeline", "Weighted value", false, "horizontal")
kpiPipelineIcon = Icon("funnel", "sales")
kpiPipelineRhs = BoldText("number", "$187M", "+22% QoQ", "metric")
kpiWinRate = SnippetCardItem("winrate", kpiWinRateLhs, kpiWinRateRhs)
kpiWinRateLhs = IconText(kpiWinRateIcon, "success", "m", "Win Rate", "Closed-won / opportunities", false, "horizontal")
kpiWinRateIcon = Icon("target", "sales")
kpiWinRateRhs = BoldText("number", "28.4%", "+2.1pp", "metric")
kpiCustomers = SnippetCardItem("customers", kpiCustomersLhs, kpiCustomersRhs)
kpiCustomersLhs = IconText(kpiCustomersIcon, "neutral", "m", "Active Customers", "End of quarter", false, "horizontal")
kpiCustomersIcon = Icon("users", "people")
kpiCustomersRhs = BoldText("number", "2,847", "+312 QoQ", "metric")
kpiChurn = SnippetCardItem("churn", kpiChurnLhs, kpiChurnRhs)
kpiChurnLhs = IconText(kpiChurnIcon, "danger", "m", "Logo Churn (LTM)", "Last 12 months", false, "horizontal")
kpiChurnIcon = Icon("user-minus", "people")
kpiChurnRhs = BoldText("number", "4.2%", "-0.8pp", "metric")
kpiNPS = SnippetCardItem("nps", kpiNPSLhs, kpiNPSRhs)
kpiNPSLhs = IconText(kpiNPSIcon, "success", "m", "NPS", "Latest survey", false, "horizontal")
kpiNPSIcon = Icon("smile", "communication")
kpiNPSRhs = BoldText("number", "67", "+4 vs last Q", "metric")
chartsSection = SectionBlock([secRevenue, secCosts], false)
secRevenue = SectionItem("revenue-trend", "Revenue Trend — Last 4 Quarters", [revChart])
revChart = BarChart(quarters, [revSeries, revPlanSeries], "grouped", "Quarter", "Revenue ($M)")
quarters = ["Q3'25", "Q4'25", "Q1'26", "Q2'26"]
revSeries = Series("Actual", [34.2, 37.8, 39.5, 42.8])
revPlanSeries = Series("Plan", [33.0, 36.0, 38.0, 40.0])
secCosts = SectionItem("costs-trend", "Costs Trend — Last 4 Quarters", [costChart])
costChart = BarChart(quarters, [costSeries, costPlanSeries], "grouped", "Quarter", "Costs ($M)")
costSeries = Series("Actual", [24.1, 25.6, 26.8, 28.4])
costPlanSeries = Series("Plan", [24.5, 26.0, 27.5, 29.0])
budgetSection = SectionBlock([secBudget], false)
secBudget = SectionItem("budget-vs-plan", "Budget vs Plan by Department (Q2 2026)", [budgetChart, budgetTable])
budgetChart = HorizontalBarChart(depts, [budgetActualSeries, budgetPlanSeries], "grouped", "Budget ($M)", "Department")
depts = ["Engineering", "Sales & Marketing", "Product & Design", "G&A", "Customer Success", "Operations"]
budgetActualSeries = Series("Actual", [8.2, 6.8, 3.4, 2.9, 2.1, 1.7])
budgetPlanSeries = Series("Plan", [8.5, 7.0, 3.5, 3.0, 2.2, 1.8])
budgetTable = Table([colDept, colActual, colPlan, colVariance, colVariancePct])
colDept = Col("Department", depts, "string")
colActual = Col("Actual ($M)", [8.2, 6.8, 3.4, 2.9, 2.1, 1.7], "number")
colPlan = Col("Plan ($M)", [8.5, 7.0, 3.5, 3.0, 2.2, 1.8], "number")
colVariance = Col("Variance ($M)", [-0.3, -0.2, -0.1, -0.1, -0.1, -0.1], "number")
colVariancePct = Col("Variance (%)", ["-3.5%", "-2.9%", "-2.9%", "-3.3%", "-4.5%", "-5.6%"], "string")
peopleSection = SectionBlock([secHeadcount], false)
secHeadcount = SectionItem("headcount", "Headcount by Department", [hcChart, hcTable])
hcChart = HorizontalBarChart(depts, [hcSeries], "grouped", "Headcount", "Department")
hcSeries = Series("FTEs", [287, 156, 89, 42, 67, 34])
hcTable = Table([colDept2, colFTE, colOpen, colAttrition])
colDept2 = Col("Department", depts, "string")
colFTE = Col("Current FTEs", [287, 156, 89, 42, 67, 34], "number")
colOpen = Col("Open Roles", [18, 12, 6, 3, 8, 2], "number")
colAttrition = Col("Attrition (LTM %)", ["8.2%", "12.4%", "6.7%", "4.8%", "9.1%", "5.9%"], "string")
riskSection = SectionBlock([secRisks], false)
secRisks = SectionItem("top-risks", "Top 8 Risks — Owner & Mitigation Status", [riskTable])
riskTable = Table([colRiskId, colRisk, colOwner, colLikelihood, colImpact, colStatus, colMitigation])
colRiskId = Col("ID", ["R1", "R2", "R3", "R4", "R5", "R6", "R7", "R8"], "string")
colRisk = Col("Risk", [
  "Enterprise deal concentration (>40% revenue from top 5 accounts)",
  "Key engineering talent retention in AI/ML teams",
  "Cloud infrastructure cost overrun vs budget",
  "Competitive displacement in mid-market segment",
  "Regulatory compliance (EU AI Act, SOC2 Type II renewal)",
  "Sales hiring ramp missing quota attainment targets",
  "Technical debt in legacy billing platform",
  "Single-region data center dependency (US-East)"
], "string")
colOwner = Col("Owner", ["CRO", "CTO", "CFO", "CRO", "General Counsel", "VP Sales", "VP Engineering", "CTO"], "string")
colLikelihood = Col("Likelihood", ["High", "Medium", "Medium", "High", "Low", "Medium", "High", "Low"], "string")
colImpact = Col("Impact", ["Critical", "High", "High", "High", "Critical", "Medium", "High", "Critical"], "string")
colStatus = Col("Mitigation Status", ["On Track", "At Risk", "On Track", "At Risk", "On Track", "Behind", "On Track", "Not Started"], "string")
colMitigation = Col("Key Mitigation", [
  "Diversify pipeline; expand SMB/mid-market motion",
  "Retention bonuses; career pathing; hiring pipeline",
  "FinOps automation; reserved instances; rightsizing",
  "Product differentiation; pricing packs; win-back plays",
  "Compliance roadmap; external audit engaged",
  "Revised hiring plan; sales enablement investment",
  "Refactor initiative funded; Q3 target completion",
  "Multi-region DR; Q4 failover test scheduled"
], "string")
initiativeSection = SectionBlock([secInitiatives], false)
secInitiatives = SectionItem("strategic-initiatives", "Strategic Initiatives — Status & Milestones", [initTable])
initTable = Table([colInitId, colInit, colOwner2, colStatus2, colProgress, colTarget, colHealth])
colInitId = Col("ID", ["I1", "I2", "I3", "I4", "I5", "I6"], "string")
colInit = Col("Initiative", [
  "AI-Native Product Platform (Gen2)",
  "International Expansion — EMEA Entity Setup",
  "PLG Motion & Self-Serve Onboarding",
  "Enterprise Security Certification Suite",
  "Next-Gen Billing & Pricing Engine",
  "Customer Health & Expansion Playbooks"
], "string")
colOwner2 = Col("Executive Owner", ["CTO", "CRO", "CPO", "CISO", "VP Eng", "CRO"], "string")
colStatus2 = Col("Status", ["In Progress", "Planning", "In Progress", "In Progress", "Design", "Not Started"], "string")
colProgress = Col("Progress (%)", [45, 15, 60, 35, 10, 0], "number")
colTarget = Col("Target Date", ["Q4'26", "Q1'27", "Q3'26", "Q4'26", "Q2'27", "Q1'27"], "string")
colHealth = Col("Health", ["Green", "Yellow", "Green", "Green", "Yellow", "Gray"], "string")
salesSection = SectionBlock([secSales], false)
secSales = SectionItem("sales-metrics", "Sales & Customer Health Deep Dive", [salesKpis, pipelineChart, cohortChart])
salesKpis = OverviewCardBlock([ov1, ov2, ov3, ov4], "grid", true)
ov1 = OverviewCardItem("arr", ov1top, ov1metric)
ov1top = IconText(ov1icon, "neutral", "m", "ARR", "Annual Recurring Revenue", false, "vertical")
ov1icon = Icon("repeat", "finance")
ov1metric = MetricIndicatorInline("$162M", "Annualized", { direction: "up", value: 18.4 })
ov2 = OverviewCardItem("nrr", ov2top, ov2metric)
ov2top = IconText(ov2icon, "neutral", "m", "NRR", "Net Revenue Retention", false, "vertical")
ov2icon = Icon("refresh-cw", "charts")
ov2metric = MetricIndicatorInline("118%", "LTM", { direction: "up", value: 3 })
ov3 = OverviewCardItem("cac", ov3top, ov3metric)
ov3top = IconText(ov3icon, "neutral", "m", "CAC Payback", "Months to recover CAC", false, "vertical")
ov3icon = Icon("clock", "time")
ov3metric = MetricIndicatorInline("11.2 mo", "Blended", { direction: "down", value: 0.8 })
ov4 = OverviewCardItem("ltv", ov4top, ov4metric)
ov4top = IconText(ov4icon, "neutral", "m", "LTV:CAC", "Lifetime value ratio", false, "vertical")
ov4icon = Icon("ratio", "finance")
ov4metric = MetricIndicatorInline("5.4x", "Enterprise: 7.1x", { direction: "up", value: 0.3 })
pipelineChart = BarChart(pipelineStages, [pipelineValueSeries], "grouped", "Stage", "Pipeline Value ($M)")
pipelineStages = ["Qualified", "Discovery", "Proposal", "Negotiation", "Commit"]
pipelineValueSeries = Series("Weighted Value ($M)", [42.3, 68.7, 34.2, 28.9, 12.8])
cohortChart = LineChart(cohortMonths, [cohort2024, cohort2025, cohort2026], "natural", "Months Since First Purchase", "Revenue Retention (%)")
cohortMonths = ["M0", "M3", "M6", "M9", "M12", "M15", "M18", "M21", "M24"]
cohort2024 = Series("2024 Cohorts", [100, 96, 93, 91, 89, 87, 86, 85, 84])
cohort2025 = Series("2025 Cohorts", [100, 97, 94, 92, 90, 89, 88, 0, 0])
cohort2026 = Series("2026 Cohorts", [100, 98, 95, 93, 0, 0, 0, 0, 0])
boardSection = SectionBlock([secBoard], false)
secBoard = SectionItem("board-items", "Items for Next Board Meeting (July 15, 2026)", [boardList])
boardList = ListBlock([b1, b2, b3, b4, b5, b6, b7], "number")
b1 = ListItem("Approve Q3'26 Operating Plan & Budget Reforecast", "Finance to present updated scenarios", null, null, { type: "continue_conversation", context: "Show me the Q3'26 operating plan scenarios" })
b2 = ListItem("EMEA Expansion: Entity Setup & Go-to-Market Investment", "CRO to present $4.2M investment case", null, null, { type: "continue_conversation", context: "Show me the EMEA expansion investment memo" })
b3 = ListItem("AI Platform Gen2: Technical Review & Launch Timeline", "CTO to demo alpha; board input on pricing", null, null, { type: "continue_conversation", context: "Show me the AI Platform Gen2 technical review" })
b4 = ListItem("Executive Compensation & Equity Refresh Program", "CHRO + Comp Committee recommendation", null, null, { type: "continue_conversation", context: "Show me the executive compensation proposal" })
b5 = ListItem("Risk Register Review: Top 3 Critical Risks Deep Dive", "CRO, CTO, GC to present mitigation progress", null, null, { type: "continue_conversation", context: "Show me the risk register deep dive materials" })
b6 = ListItem("Capital Allocation: Share Buyback vs. M&A Fund", "CFO to present options & board preference", null, null, { type: "continue_conversation", context: "Show me the capital allocation analysis" })
b7 = ListItem("Governance: Board Committee Charters & Calendar FY27", "Corporate Secretary to propose updates", null, null, { type: "continue_conversation", context: "Show me the FY27 board calendar proposal" })
exportBtn = Buttons([btnExport], "row")
btnExport = Button("Export Board Pack (PDF)", Action([@OpenUrl("https://example.com/export/board-pack-q2-2026.pdf")]), "primary", "normal", "large")