root = Card([header, metricsRow, enrollmentTrend, alumniGiving, deptFocus, applicationsWaitlist, courseCapacity, teachingLoad, academicRisk, scholarshipHousing, campusEvents, semesterComparison, approveCourseForm, messageForm], "card", "column", "l")
header = CardHeader("University Administrator Dashboard", "Real-time overview of enrollment, academics, finance, and operations")
metricsRow = Card([enrollmentMetric, acceptanceMetric, tuitionMetric, housingMetric], "clear", "row", "m", "stretch", "between")
enrollmentMetric = Callout("info", "Total Enrollment", "12,847 students  \u2191 3.2% vs last year")
acceptanceMetric = Callout("success", "Acceptance Rate", "28.4%  \u2193 1.1pp vs last cycle")
tuitionMetric = Callout("neutral", "Tuition Revenue (FY)", "$142.3M  \u2191 5.7% YoY")
housingMetric = Callout("warning", "Housing Occupancy", "94.2%  (2,826 / 3,000 beds)")
enrollmentTrend = Card([enrollmentHeading, enrollmentChart], "sunk", "column", "m")
enrollmentHeading = Heading("Enrollment Trend (5 Years)", "h3")
enrollmentChart = LineChart(enrollmentYears, [enrollmentSeries], "natural", "Year", "Students")
enrollmentYears = ["2020", "2021", "2022", "2023", "2024"]
enrollmentSeries = Series("Total Enrollment", [11200, 11580, 11950, 12440, 12847])
alumniGiving = Card([alumniHeading, alumniChart], "sunk", "column", "m")
alumniHeading = Heading("Alumni Giving (4 Years)", "h3")
alumniChart = BarChart(alumniYears, [alumniSeries], "grouped", "Year", "USD (Millions)")
alumniYears = ["2021", "2022", "2023", "2024"]
alumniSeries = Series("Donations", [8.2, 9.5, 10.8, 12.1])
deptFocus = Card([deptHeading, deptSelect], "clear", "column", "s")
deptHeading = Heading("Focus Department", "h4")
deptSelect = Select("department_focus", deptOptions, "Select a department to filter views")
deptOptions = [deptCS, deptEng, deptBus, deptSci, deptArts, deptMed, deptLaw, deptEdu]
deptCS = SelectItem("cs", "Computer Science")
deptEng = SelectItem("eng", "Engineering")
deptBus = SelectItem("bus", "Business")
deptSci = SelectItem("sci", "Sciences")
deptArts = SelectItem("arts", "Arts & Humanities")
deptMed = SelectItem("med", "Medicine")
deptLaw = SelectItem("law", "Law")
deptEdu = SelectItem("edu", "Education")
applicationsWaitlist = Card([appsHeading, appsChart, waitlistChart], "sunk", "column", "m")
appsHeading = Heading("Applications & Waitlist by Program", "h3")
appsChart = HorizontalBarChart(programLabels, [appsSeries], "grouped", "Applications", "Program")
waitlistChart = HorizontalBarChart(programLabels, [waitlistSeries], "grouped", "Waitlisted", "Program")
programLabels = ["Computer Science", "Engineering", "Business", "Biology", "Psychology", "Economics", "English", "History"]
appsSeries = Series("Applications", [3420, 2890, 2150, 1980, 1760, 1640, 1320, 980])
waitlistSeries = Series("Waitlisted", [280, 190, 120, 95, 85, 70, 45, 30])
courseCapacity = Card([capacityHeading, capacityChart], "sunk", "column", "m")
capacityHeading = Heading("Course Offering Utilization", "h3")
capacityChart = HorizontalBarChart(courseLabels, [capacitySeries], "grouped", "Utilization %", "Course")
courseLabels = ["CS101 Intro Programming", "ENG200 Thermodynamics", "BUS301 Finance", "BIO101 Cell Biology", "PSY200 Statistics", "ECON101 Microeconomics", "ENG101 Composition", "HIST200 World History"]
capacitySeries = Series("Fill Rate", [98, 87, 92, 76, 89, 94, 82, 71])
teachingLoad = Card([loadHeading, loadChart], "sunk", "column", "m")
loadHeading = Heading("Teaching Load by Faculty Member", "h3")
loadChart = BarChart(facultyLabels, [loadSeries], "grouped", "Faculty", "Course Units")
facultyLabels = ["Dr. Chen", "Prof. Rivera", "Dr. Patel", "Prof. Kim", "Dr. Johnson", "Prof. Garcia", "Dr. Williams", "Prof. Davis", "Dr. Lee", "Prof. Martinez"]
loadSeries = Series("Units", [4, 3, 5, 3, 4, 2, 4, 3, 5, 2])
academicRisk = Card([riskHeading, riskTable], "sunk", "column", "m")
riskHeading = Heading("Students at Academic Risk", "h3")
riskTable = Table([riskNameCol, riskProgramCol, riskGPACol, riskCreditsCol, riskStatusCol])
riskNameCol = Col("Student", ["A. Rodriguez", "J. Thompson", "M. Nguyen", "K. Brown", "S. Davis", "R. Wilson", "L. Anderson", "T. Moore"])
riskProgramCol = Col("Program", ["Engineering", "Computer Science", "Biology", "Business", "Psychology", "Economics", "English", "History"])
riskGPACol = Col("GPA", [1.82, 1.95, 1.78, 1.89, 1.92, 1.85, 1.76, 1.91])
riskCreditsCol = Col("Credits Earned", [24, 31, 18, 27, 33, 22, 15, 29])
riskStatusCol = Col("Status", ["Probation", "Probation", "Probation", "Warning", "Warning", "Probation", "Probation", "Warning"])
scholarshipHousing = Card([scholarHeading, scholarProgress, housingProgress], "sunk", "column", "m")
scholarHeading = Heading("Scholarship Budget & Housing", "h3")
scholarProgress = Progress(78, "Scholarship Budget Used: $4.7M / $6.0M (78%)")
housingProgress = Progress(94, "Housing Occupancy: 2,826 / 3,000 beds (94%)")
campusEvents = Card([eventsHeading, eventsList], "sunk", "column", "m")
eventsHeading = Heading("Campus Events This Month", "h3")
eventsList = ListBlock(eventItems, "number")
eventItems = [event1, event2, event3, event4, event5, event6]
event1 = ListItem("Career Fair 2024", "Oct 15-16 \u2022 Main Quad \u2022 120+ employers", null, "View Details")
event2 = ListItem("Homecoming Weekend", "Oct 18-20 \u2022 Campus-wide \u2022 Alumni events", null, "View Details")
event3 = ListItem("Research Symposium", "Oct 22 \u2022 Science Center \u2022 Student presentations", null, "View Details")
event4 = ListItem("Mental Health Awareness Week", "Oct 28 - Nov 1 \u2022 Various locations", null, "View Details")
event5 = ListItem("International Food Festival", "Nov 2 \u2022 Student Union \u2022 Cultural organizations", null, "View Details")
event6 = ListItem("Finals Stress Relief", "Dec 9-13 \u2022 Library & Wellness Center", null, "View Details")
semesterComparison = Card([semesterHeading, semesterTable], "sunk", "column", "m")
semesterHeading = Heading("This Semester vs Last Semester", "h3")
semesterTable = Table([semMetricCol, semCurrentCol, semLastCol, semChangeCol])
semMetricCol = Col("Metric", ["Enrollment", "Avg Class Size", "Credit Hours", "Faculty FTE", "Student-Faculty Ratio", "Retention Rate", "Graduation Rate", "Diversity Index"])
semCurrentCol = Col("Fall 2024", [12847, 28.4, 189450, 642, "18:1", "91.2%", "76.8%", "0.72"])
semLastCol = Col("Spring 2024", [12440, 27.1, 182300, 628, "18:1", "90.5%", "75.9%", "0.70"])
semChangeCol = Col("Change", ["+3.3%", "+4.8%", "+3.9%", "+2.2%", "0%", "+0.7pp", "+0.9pp", "+0.02"])
approveCourseForm = Card([approveHeading, approveForm], "sunk", "column", "m")
approveHeading = Heading("Approve New Course", "h3")
approveForm = Form("approve-course", approveButtons, [courseCodeField, courseTitleField, courseDeptField, courseCreditsField, courseDescField, coursePrereqField, courseInstructorField])
courseCodeField = FormControl("Course Code", courseCodeInput, "e.g., CS450")
courseCodeInput = Input("course_code", "CS450", "text")
courseTitleField = FormControl("Course Title", courseTitleInput, "Full official title")
courseTitleInput = Input("course_title", "Advanced Machine Learning", "text")
courseDeptField = FormControl("Department", courseDeptSelect)
courseDeptSelect = Select("department", approveDeptOptions, "Select department")
approveDeptOptions = [adeptCS, adeptEng, adeptBus, adeptSci, adeptArts, adeptMed, adeptLaw, adeptEdu]
adeptCS = SelectItem("cs", "Computer Science")
adeptEng = SelectItem("eng", "Engineering")
adeptBus = SelectItem("bus", "Business")
adeptSci = SelectItem("sci", "Sciences")
adeptArts = SelectItem("arts", "Arts & Humanities")
adeptMed = SelectItem("med", "Medicine")
adeptLaw = SelectItem("law", "Law")
adeptEdu = SelectItem("edu", "Education")
courseCreditsField = FormControl("Credit Hours", courseCreditsInput)
courseCreditsInput = Input("credits", "3", "number")
courseDescField = FormControl("Description", courseDescArea, "Catalog description")
courseDescArea = TextArea("description", "Course description...", 4)
coursePrereqField = FormControl("Prerequisites", coursePrereqInput, "Comma-separated course codes")
coursePrereqInput = Input("prerequisites", "CS350, MATH210", "text")
courseInstructorField = FormControl("Assigned Instructor", courseInstructorSelect)
courseInstructorSelect = Select("instructor", instructorOptions, "Select instructor")
instructorOptions = [inst1, inst2, inst3, inst4, inst5]
inst1 = SelectItem("chen", "Dr. Chen")
inst2 = SelectItem("rivera", "Prof. Rivera")
inst3 = SelectItem("patel", "Dr. Patel")
inst4 = SelectItem("kim", "Prof. Kim")
inst5 = SelectItem("johnson", "Dr. Johnson")
approveButtons = Buttons([approveSubmitBtn, approveCancelBtn])
approveSubmitBtn = Button("Submit for Approval", null, "primary")
approveCancelBtn = Button("Cancel", null, "tertiary")
messageForm = Card([messageHeading, messageFormInner], "sunk", "column", "m")
messageHeading = Heading("Send Message to Student Group", "h3")
messageFormInner = Form("send-message", messageButtons, [groupField, subjectField, bodyField, channelField])
groupField = FormControl("Recipient Group", groupSelect)
groupSelect = Select("group", groupOptions, "Select student group")
groupOptions = [grp1, grp2, grp3, grp4, grp5, grp6, grp7, grp8]
grp1 = SelectItem("all", "All Students")
grp2 = SelectItem("ug", "Undergraduates")
grp3 = SelectItem("grad", "Graduate Students")
grp4 = SelectItem("probation", "Academic Probation")
grp5 = SelectItem("seniors", "Graduating Seniors")
grp6 = SelectItem("freshmen", "First-Year Students")
grp7 = SelectItem("intl", "International Students")
grp8 = SelectItem("housing", "On-Campus Residents")
subjectField = FormControl("Subject", subjectInput)
subjectInput = Input("subject", "Important: Registration Deadline Approaching", "text")
bodyField = FormControl("Message", bodyArea, "Supports basic formatting")
bodyArea = TextArea("body", "Dear students,\n\nThis is a reminder that the registration deadline for Spring 2025 is approaching...\n\nBest regards,\nOffice of the Registrar", 6)
channelField = FormControl("Delivery Channel", channelRadio)
channelRadio = RadioGroup("channel", channelOptions, "email")
channelOptions = [chEmail, chSMS, chPush, chPortal]
chEmail = RadioItem("Email", "Sent to university email address", "email")
chSMS = RadioItem("SMS", "Text message to mobile number", "sms")
chPush = RadioItem("Push Notification", "Mobile app notification", "push")
chPortal = RadioItem("Student Portal", "In-portal announcement banner", "portal")
messageButtons = Buttons([messageSendBtn, messagePreviewBtn, messageCancelBtn])
messageSendBtn = Button("Send Now", null, "primary")
messagePreviewBtn = Button("Preview", null, "secondary")
messageCancelBtn = Button("Cancel", null, "tertiary")