root = Card([header, overview, activity, contacts, followups, noteForm, renewal, callLog], "card", "column", "l")

header = CardHeader("Acme Corporation", "Owned by Sarah Chen • Enterprise Account")

overview = Card([valueCard, stageCard], "clear", "row", "m")
valueCard = Card([valueLabel, valueAmount], "sunk", "column", "xs")
valueLabel = TextContent("Total Deal Value", "small-heavy")
valueAmount = TextContent("$2.4M", "large-heavy")
stageCard = Card([stageLabel, stageTag], "sunk", "column", "xs")
stageLabel = TextContent("Current Stage", "small-heavy")
stageTag = Tag("Negotiation", null, "lg", "warning")

activity = Card([activityHeader, activityList], "clear", "column", "m")
activityHeader = Heading("Recent Activity", "h3")
activityList = ListBlock([act1, act2, act3, act4], "number")
act1 = ListItem("Contract sent for review", "Sent to legal team • 2 hours ago", null, null)
act2 = ListItem("Demo completed", "Technical deep-dive with engineering leads • Yesterday", null, null)
act3 = ListItem("Pricing proposal delivered", "Custom enterprise tier with volume discount • 3 days ago", null, null)
act4 = ListItem("Discovery call", "Identified 3 new use cases for expansion • 1 week ago", null, null)

contacts = Card([contactsHeader, contactsTable], "clear", "column", "m")
contactsHeader = Heading("Contacts", "h3")
contactsTable = Table([colName, colRole, colEmail, colPhone])
colName = Col("Name", ["Marcus Webb", "Priya Patel", "James Liu", "Elena Rodriguez"])
colRole = Col("Role", ["CTO - Decision Maker", "VP Engineering - Champion", "Procurement - Influencer", "CFO - Budget Holder"])
colEmail = Col("Email", ["m.webb@acme.com", "p.patel@acme.com", "j.liu@acme.com", "e.rodriguez@acme.com"])
colPhone = Col("Phone", ["+1 415-555-0101", "+1 415-555-0102", "+1 415-555-0103", "+1 415-555-0104"])

followups = Card([followupsHeader, followupsList], "clear", "column", "m")
followupsHeader = Heading("Open Follow-ups", "h3")
followupsList = ListBlock([fu1, fu2, fu3], "number")
fu1 = ListItem("Send security questionnaire", "Due: Today • Assigned to: You", null, null)
fu2 = ListItem("Schedule executive alignment call", "Due: Tomorrow • Assigned to: Sarah Chen", null, null)
fu3 = ListItem("Provide ROI calculator", "Due: In 3 days • Assigned to: You", null, null)

noteForm = Card([noteHeader, noteField, noteButtons], "clear", "column", "m")
noteHeader = Heading("Add a Note", "h3")
noteField = FormControl("Note", noteInput, "Internal note — not visible to customer")
noteInput = TextArea("account_note", "Summarize key discussion points...", 4, null, null)
noteButtons = Buttons([saveNoteBtn], "row")
saveNoteBtn = Button("Save Note", null, "primary")

renewal = Card([renewalContent], "clear", "column", "m")
renewalContent = Callout("warning", "Renewal Approaching", "Contract renews in 14 days (2025-02-15). Start renewal conversation now to avoid auto-renewal at current terms.")

callLog = Card([callHeader, callForm], "clear", "column", "m")
callHeader = Heading("Log a Call", "h3")
callForm = Form("call_log", callButtons, [callDate, callDuration, callType, callOutcome, callNotes])
callDate = FormControl("Date & Time", callDateInput)
callDateInput = DatePicker("call_date", "single", null, null)
callDuration = FormControl("Duration (minutes)", callDurationInput)
callDurationInput = Input("call_duration", "30", "number", null, null)
callType = FormControl("Call Type", callTypeSelect)
callTypeSelect = Select("call_type", [typeDiscovery, typeDemo, typeNegotiation, typeCheckin, typeOther], "Select type")
typeDiscovery = SelectItem("discovery", "Discovery")
typeDemo = SelectItem("demo", "Demo")
typeNegotiation = SelectItem("negotiation", "Negotiation")
typeCheckin = SelectItem("checkin", "Check-in")
typeOther = SelectItem("other", "Other")
callOutcome = FormControl("Outcome", callOutcomeSelect)
callOutcomeSelect = Select("call_outcome", [outcomePositive, outcomeNeutral, outcomeNegative, outcomeAction], "Select outcome")
outcomePositive = SelectItem("positive", "Positive — Moved forward")
outcomeNeutral = SelectItem("neutral", "Neutral — No change")
outcomeNegative = SelectItem("negative", "Negative — Blocked")
outcomeAction = SelectItem("action", "Action Required")
callNotes = FormControl("Notes", callNotesInput, "Key discussion points, decisions, next steps")
callNotesInput = TextArea("call_notes", "Capture details...", 3, null, null)
callButtons = Buttons([logCallBtn, cancelCallBtn], "row")
logCallBtn = Button("Log Call", null, "primary")
cancelCallBtn = Button("Cancel", null, "tertiary")