root = Card([header, monthSelector, kpis, expensesSection, transactionsSection, actions], "card", "column", "l")
header = CardHeader("Month-End Financial Review", "February 2025")
monthSelector = Form("month-selector", monthButtons, [monthField])
monthField = FormControl("Reporting month", monthSelect, "Choose a month to view its statement")
monthSelect = Select("month", [monthJan, monthFeb, monthMar], "February 2025")
monthJan = SelectItem("2025-01", "January 2025")
monthFeb = SelectItem("2025-02", "February 2025")
monthMar = SelectItem("2025-03", "March 2025")
monthButtons = Buttons([applyMonthBtn])
applyMonthBtn = Button("View month", null, "primary")
kpis = Table([kpiMetric, kpiValue])
kpiMetric = Col("Metric", ["Cash on hand", "Monthly burn", "Runway"])
kpiValue = Col("Value", ["$248,500", "$64,200", "3.9 months"])
expensesSection = Card([expensesHeading, expenseChart], "sunk", "column", "m")
expensesHeading = Heading("Expenses by category", "h3")
expenseChart = PieChart(expenseLabels, expenseValues, "donut")
expenseLabels = ["Salaries", "Cloud Infrastructure", "Marketing", "Office & Admin", "Software & Tools"]
expenseValues = [28500, 12400, 9800, 7600, 5900]
transactionsSection = Card([transactionsHeading, transactionsTable], "sunk", "column", "m")
transactionsHeading = Heading("Transactions over $10,000", "h3")
transactionsTable = Table([txnDate, txnMerchant, txnCategory, txnAmount])
txnDate = Col("Date", ["Feb 03", "Feb 07", "Feb 12", "Feb 18", "Feb 25"])
txnMerchant = Col("Merchant", ["Atlas Cloud", "Nova Marketing", "Brightpay Payroll", "Stripe Fees", "Apex Logistics"])
txnCategory = Col("Category", ["Infrastructure", "Marketing", "Payroll", "Software & Tools", "Operations"])
txnAmount = Col("Amount", ["$12,400", "$10,800", "$28,500", "$11,200", "$10,050"])
actions = Buttons([downloadBtn, exportBtn])
downloadBtn = Button("Download Statement", null, "primary")
exportBtn = Button("Export CSV", null, "secondary")