root = Card([header, metricsRow, openRolesSection, pipelineSection, deptSplitSection, interviewsSection, attritionSection, newRoleAction])
header = CardHeader("Hiring Overview", "Live snapshot of recruiting health — updated daily")
metricsRow = Card([headcountMetric, timeToHireMetric, openRolesMetric, interviewsMetric], "clear", "row", "l", "stretch", "between")
headcountMetric = Card([headcountLabel, headcountValue], "sunk", "column", "m", "center")
headcountLabel = TextContent("Current Headcount", "small")
headcountValue = TextContent("247", "large-heavy")
timeToHireMetric = Card([ttfLabel, ttfValue], "sunk", "column", "m", "center")
ttfLabel = TextContent("Avg Time to Hire", "small")
ttfValue = TextContent("42 days", "large-heavy")
openRolesMetric = Card([openLabel, openValue], "sunk", "column", "m", "center")
openLabel = TextContent("Open Roles", "small")
openValue = TextContent("8", "large-heavy")
interviewsMetric = Card([intLabel, intValue], "sunk", "column", "m", "center")
intLabel = TextContent("Interviews This Week", "small")
intValue = TextContent("12", "large-heavy")
openRolesSection = Card([openRolesHeader, openRolesTable], "card", "column", "m")
openRolesHeader = Heading("Open Roles by Department", "h3")
openRolesTable = Table([roleDeptCol, roleTitleCol, roleStatusCol, rolePriorityCol])
roleDeptCol = Col("Department", ["Engineering", "Engineering", "Sales", "Product", "Marketing", "Design", "HR", "Finance"])
roleTitleCol = Col("Role", ["Senior Backend Engineer", "Frontend Engineer", "Account Executive", "Product Manager", "Growth Marketer", "Product Designer", "People Operations Lead", "Financial Analyst"])
roleStatusCol = Col("Status", ["Approved", "Approved", "Recruiting", "Approved", "Sourcing", "Approved", "Approved", "Sourcing"])
rolePriorityCol = Col("Priority", ["High", "High", "Medium", "High", "Medium", "Medium", "Low", "Low"])
pipelineSection = Card([pipelineHeader, pipelineChart], "card", "column", "m")
pipelineHeader = Heading("Candidate Pipeline", "h3")
pipelineChart = HorizontalBarChart(pipelineLabels, [pipelineSeries], "grouped", "Candidates", "Stage")
pipelineLabels = ["Applied", "Screening", "Interview", "Offer", "Hired"]
pipelineSeries = Series("Candidates", [142, 38, 24, 8, 3])
deptSplitSection = Card([deptHeader, deptChart], "card", "column", "m")
deptHeader = Heading("Headcount by Department", "h3")
deptChart = PieChart(deptLabels, deptValues, "donut", "circular")
deptLabels = ["Engineering", "Sales", "Marketing", "Product", "Design", "HR", "Finance", "Operations"]
deptValues = [85, 45, 28, 22, 18, 12, 15, 22]
interviewsSection = Card([interviewsHeader, interviewsList], "card", "column", "m")
interviewsHeader = Heading("Interviews Scheduled This Week", "h3")
interviewsList = ListBlock(interviewItems, "number")
interviewItems = [int1, int2, int3, int4, int5, int6]
int1 = ListItem("Sarah Chen — Senior Backend Engineer", "Technical interview • Mon 10:00 AM • Panel: J. Park, M. Rodriguez", null, "View details")
int2 = ListItem("Marcus Johnson — Account Executive", "Role-play simulation • Tue 2:00 PM • Hiring manager: L. Thompson", null, "View details")
int3 = ListItem("Priya Patel — Product Manager", "Case study review • Wed 11:00 AM • Panel: R. Kim, S. Williams", null, "View details")
int4 = ListItem("David Park — Frontend Engineer", "Code review session • Thu 9:00 AM • Interviewer: A. Gupta", null, "View details")
int5 = ListItem("Emma Wilson — Growth Marketer", "Portfolio walkthrough • Fri 1:00 PM • Hiring manager: C. Davis", null, "View details")
int6 = ListItem("Alex Rivera — Product Designer", "Design challenge • Fri 3:00 PM • Panel: M. Lee, K. Brown", null, "View details")
attritionSection = Card([attritionHeader, attritionChart], "card", "column", "m")
attritionHeader = Heading("Attrition (Last 6 Months)", "h3")
attritionChart = LineChart(attritionLabels, [attritionSeries], "natural", "Month", "Departures")
attritionLabels = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
attritionSeries = Series("Departures", [4, 3, 5, 2, 6, 3])
newRoleAction = Card([newRoleBtn], "clear", "row", "none", "center")
newRoleBtn = Button("Open New Role", null, "primary", "normal", "medium")
newRoleDialog = DialogBlock("Open New Role", "Create a New Role", "Define the role details and submit for approval", [newRoleForm], "default")
newRoleForm = Form("new-role", formButtons, [roleTitleField, roleDeptField, roleTypeField, rolePriorityField, roleDescField, hiringManagerField, budgetField])
roleTitleField = FormControl("Role Title", roleTitleInput, "e.g., Senior Backend Engineer")
roleTitleInput = Input("role_title", "Enter role title", "text")
roleDeptField = FormControl("Department", roleDeptSelect)
roleDeptSelect = Select("department", deptOptions, "Select department")
deptOptions = [deptEng, deptSales, deptMktg, deptProd, deptDesign, deptHR, deptFin, deptOps]
deptEng = SelectItem("engineering", "Engineering")
deptSales = SelectItem("sales", "Sales")
deptMktg = SelectItem("marketing", "Marketing")
deptProd = SelectItem("product", "Product")
deptDesign = SelectItem("design", "Design")
deptHR = SelectItem("hr", "Human Resources")
deptFin = SelectItem("finance", "Finance")
deptOps = SelectItem("operations", "Operations")
roleTypeField = FormControl("Employment Type", roleTypeRadio)
roleTypeRadio = RadioGroup("employment_type", [typeFull, typePart, typeContract, typeIntern], "full_time")
typeFull = RadioItem("Full-time", "Full-time permanent position", "full_time")
typePart = RadioItem("Part-time", "Part-time permanent position", "part_time")
typeContract = RadioItem("Contractor", "Fixed-term contract", "contractor")
typeIntern = RadioItem("Intern", "Internship position", "intern")
rolePriorityField = FormControl("Priority", rolePrioritySelect)
rolePrioritySelect = Select("priority", priorityOptions, "Select priority")
priorityOptions = [priHigh, priMed, priLow]
priHigh = SelectItem("high", "High — Critical business need")
priMed = SelectItem("medium", "Medium — Planned growth")
priLow = SelectItem("low", "Low — Backfill or exploratory")
roleDescField = FormControl("Description", roleDescArea, "Key responsibilities, requirements, and nice-to-haves")
roleDescArea = TextArea("description", "Describe the role...", 5)
hiringManagerField = FormControl("Hiring Manager", hiringManagerInput, "Name of the hiring manager")
hiringManagerInput = Input("hiring_manager", "Enter hiring manager name", "text")
budgetField = FormControl("Budget Range (Annual)", budgetInput, "e.g., $120,000 - $160,000")
budgetInput = Input("budget_range", "Enter salary range", "text")
formButtons = Buttons([submitBtn, cancelBtn], "row")
submitBtn = Button("Submit for Approval", null, "primary")
cancelBtn = Button("Cancel", null, "tertiary")