root = Card([header, headcountKpis, openRolesSection, pipelineSection, timeToHire, deptSplit, interviewsSection, attritionSection, newRoleBtn], "card", "column", "l")
header = CardHeader("Hiring Overview", "Live headcount, pipeline, and recruitment metrics")
headcountKpis = Table([kpiMetric, kpiValue])
kpiMetric = Col("Metric", ["Current headcount", "Open roles", "Avg time to hire"])
kpiValue = Col("Value", ["342", "17", "24 days"])
openRolesSection = Card([openRolesHeading, openRolesTable], "sunk")
openRolesHeading = Heading("Open Roles by Department", "h3")
openRolesTable = Table([roleCol, deptCol, reqCol])
roleCol = Col("Role", ["Senior Frontend Engineer", "Product Designer", "Data Analyst", "Backend Engineer", "QA Lead"])
deptCol = Col("Department", ["Engineering", "Design", "Data", "Engineering", "Quality"])
reqCol = Col("Openings", ["3", "2", "1", "4", "2"])
pipelineSection = Card([pipelineHeading, pipelineChart], "sunk")
pipelineHeading = Heading("Candidates by Pipeline Stage", "h3")
pipelineChart = PieChart(["Applied", "Screened", "Interview", "Offer", "Hired"], [320, 210, 98, 24, 18], "donut")
timeToHire = Card([timeHeading, timeTrend], "sunk")
timeHeading = Heading("Average Time to Hire (days)", "h3")
timeTrend = LineChart(["Jan", "Feb", "Mar", "Apr", "May", "Jun"], [timeSeries], "natural", "Month", "Days")
timeSeries = Series("Time to hire", [32, 29, 27, 26, 25, 24])
deptSplit = Card([deptHeading, deptChart], "sunk")
deptHeading = Heading("Headcount by Department", "h3")
deptChart = HorizontalBarChart(["Engineering", "Sales", "Product", "Design", "Data", "Operations"], [deptSeries], "grouped", "Headcount", "Department")
deptSeries = Series("Headcount", [128, 76, 45, 38, 31, 24])
interviewsSection = Card([interviewsHeading, interviewsList], "sunk")
interviewsHeading = Heading("Interviews Scheduled This Week", "h3")
interviewsList = ListBlock([iv1, iv2, iv3, iv4], "number")
iv1 = ListItem("Sarah Chen", "Senior Frontend Engineer · Mon 10:00 AM")
iv2 = ListItem("Marcus Rivera", "Data Analyst · Tue 2:30 PM")
iv3 = ListItem("Priya Patel", "Product Designer · Wed 11:00 AM")
iv4 = ListItem("Tom Okafor", "Backend Engineer · Thu 3:00 PM")
attritionSection = Card([attritionHeading, attritionChart], "sunk")
attritionHeading = Heading("Attrition Over Past 6 Months", "h3")
attritionChart = AreaChart(["Jan", "Feb", "Mar", "Apr", "May", "Jun"], [attritionSeries], "natural", "Month", "Employees left")
attritionSeries = Series("Attrition", [6, 4, 8, 5, 7, 3])
newRoleBtn = Buttons([openRoleButton])
openRoleButton = Button("Open New Role", null, "primary")