root = Card([header, kpiSection, stageSection, activitySection, contactsSection, followUpsSection, noteSection, renewalSection, callSection])

header = CardHeader("Acme Corp", "Owner: Sarah Chen")

kpiSection = Card([kpiHeading, kpiTable], "sunk")
kpiHeading = Heading("Deal Overview", "h3")
kpiTable = Table([kpiMetric, kpiValue])
kpiMetric = Col("Metric", ["Total Deal Value", "Current Stage"])
kpiValue = Col("Value", ["$128,400", "Negotiation"])

stageSection = Card([stageHeading, stageBadge, stageProgress], "sunk")
stageHeading = Heading("Deal Stage", "h4")
stageBadge = Tag("Negotiation", null, "md", "info")
stageProgress = Progress(75, "75% through pipeline")

activitySection = Card([activityHeading, activityList], "sunk")
activityHeading = Heading("Recent Activity", "h3")
activityList = ListBlock([act1, act2, act3])
act1 = ListItem("Call logged", "Mar 12 — Discussed pricing with Jordan Lee")
act2 = ListItem("Email sent", "Mar 10 — Sent revised proposal v2")
act3 = ListItem("Meeting held", "Mar 8 — Demo with procurement team")

contactsSection = Card([contactsHeading, contactsTable], "sunk")
contactsHeading = Heading("Contacts", "h3")
contactsTable = Table([contactName, contactRole])
contactName = Col("Name", ["Jordan Lee", "Morgan Patel", "Riley Kim"])
contactRole = Col("Role", ["Procurement Lead", "IT Decision Maker", "Finance Approver"])

followUpsSection = Card([followUpsHeading, followUpsList], "sunk")
followUpsHeading = Heading("Open Follow-ups", "h3")
followUpsList = ListBlock([fu1, fu2])
fu1 = ListItem("Send final pricing", "Due Mar 18")
fu2 = ListItem("Schedule contract review", "Due Mar 22")

noteSection = Card([noteHeading, noteForm], "sunk")
noteHeading = Heading("Jot a Note", "h4")
noteForm = Form("note", noteButtons, [noteField])
noteField = FormControl("Note", noteInput, "Quick notes about this account")
noteInput = TextArea("note", "Type a note...", 3)
noteButtons = Buttons([saveNoteBtn])
saveNoteBtn = Button("Save Note", null, "primary")

renewalSection = Card([renewalHeading, renewalAlert, renewalBadge], "sunk")
renewalHeading = Heading("Renewal", "h3")
renewalAlert = Callout("warning", "Renewal approaching", "Contract renews Apr 2 — only 21 days away")
renewalBadge = Badge("Renews Apr 2, 2025", "outline")

callSection = Card([callHeading, callForm], "sunk")
callHeading = Heading("Log a Call", "h4")
callForm = Form("call-log", callButtons, [callDateField, callNotesField])
callDateField = FormControl("Date", callDate)
callDate = DatePicker("call_date", "single")
callNotesField = FormControl("Notes", callNotes)
callNotes = TextArea("call_notes", "What was discussed?", 2)
callButtons = Buttons([logCallBtn])
logCallBtn = Button("Log Call", null, "primary")