root = Card([header, stepsSection, caloriesSection, weeklyWorkoutsSection, logWorkoutSection, motivationalNote])
header = CardHeader("Daily Fitness Summary", "Monday, January 15, 2025")
stepsSection = Card([stepsLabel, stepsProgress, stepsDetail], "sunk", "column", "m")
stepsLabel = Heading("Steps Today", "h3")
stepsProgress = Progress(8432, "8,432 / 10,000 steps")
stepsDetail = TextContent("You're 84% to your daily goal. Keep moving!", "small")
caloriesSection = Card([caloriesLabel, caloriesValue, caloriesBreakdown], "sunk", "column", "m")
caloriesLabel = Heading("Calories Burned", "h3")
caloriesValue = TextContent("2,347 kcal", "large-heavy")
caloriesBreakdown = TextContent("Active: 647 kcal • Resting: 1,700 kcal", "small")
weeklyWorkoutsSection = Card([weeklyLabel, weeklyChart], "sunk", "column", "m")
weeklyLabel = Heading("Workouts This Week", "h3")
weeklyChart = BarChart(weekDays, [workoutSeries], "grouped", "Day", "Minutes")
weekDays = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
workoutSeries = Series("Workout Minutes", [45, 0, 60, 30, 50, 40, 0])
logWorkoutSection = Card([logLabel, logForm], "clear", "column", "m")
logLabel = Heading("Log New Workout", "h3")
logForm = Form("log-workout", logButtons, [workoutTypeField, durationField, intensityField, notesField])
workoutTypeField = FormControl("Workout Type", workoutTypeSelect, "Select the type of exercise")
workoutTypeSelect = Select("workout_type", [typeRun, typeWalk, typeCycle, typeSwim, typeStrength, typeYoga, typeOther], "Choose workout type")
typeRun = SelectItem("run", "Running")
typeWalk = SelectItem("walk", "Walking")
typeCycle = SelectItem("cycle", "Cycling")
typeSwim = SelectItem("swim", "Swimming")
typeStrength = SelectItem("strength", "Strength Training")
typeYoga = SelectItem("yoga", "Yoga / Stretching")
typeOther = SelectItem("other", "Other")
durationField = FormControl("Duration (minutes)", durationInput, "How long did you exercise?")
durationInput = Input("duration", "30", "number")
intensityField = FormControl("Intensity", intensityRadio, "How hard did you push?")
intensityRadio = RadioGroup("intensity", [intensityLow, intensityModerate, intensityHigh], "moderate")
intensityLow = RadioItem("Low", "Light effort, can hold conversation", "low")
intensityModerate = RadioItem("Moderate", "Breathing harder, can talk in short sentences", "moderate")
intensityHigh = RadioItem("High", "Vigorous effort, difficult to talk", "high")
notesField = FormControl("Notes (optional)", notesInput, "Any details about the workout")
notesInput = TextArea("notes", "Felt great today!", 3)
logButtons = Buttons([saveBtn, cancelBtn])
saveBtn = Button("Save Workout", null, "primary")
cancelBtn = Button("Cancel", null, "tertiary")
motivationalNote = Callout("success", "Great job today!", "You've been active 5 out of 7 days this week. Consistency builds results.")