root = Card([header, kpiRow, trafficSection, salesSection, bestSellersSection, stockSection, shiftSection, promoSection, registerSection, reorderSection, storeSection, weekCompareSection])
header = CardHeader("Store Manager Console", "Daily overview for Store #104 — Downtown")
kpiRow = Card([kpiHeading, kpiTable], "sunk")
kpiHeading = Heading("Key Metrics", "h3")
kpiTable = Table([kpiMetric, kpiValue])
kpiMetric = Col("Metric", ["Sales Today", "Sales Target", "Average Basket Size", "Returns This Week"])
kpiValue = Col("Value", ["$8,420", "$9,000", "$54.20", "12"])
trafficSection = Card([trafficHeading, trafficChart], "sunk")
trafficHeading = Heading("Foot Traffic Through the Day", "h3")
trafficChart = LineChart(["9am", "10am", "11am", "12pm", "1pm", "2pm", "3pm", "4pm", "5pm"], [trafficSeries], "natural", "Time", "Visitors")
trafficSeries = Series("Visitors", [45, 78, 96, 132, 118, 90, 105, 140, 88])
salesSection = Card([salesHeading, salesChart], "sunk")
salesHeading = Heading("Sales vs Target", "h3")
salesChart = BarChart(["Today", "Target"], [salesSeries], "grouped", "Period", "USD")
salesSeries = Series("Revenue", [8420, 9000])
bestSellersSection = Card([bestSellersHeading, bestSellersTable], "sunk")
bestSellersHeading = Heading("Best Sellers", "h3")
bestSellersTable = Table([productName, unitsSold])
productName = Col("Product", ["Wireless Earbuds", "Stainless Bottle", "Yoga Mat", "Desk Lamp", "Notebook Set"])
unitsSold = Col("Units", [42, 38, 31, 27, 24])
stockSection = Card([stockHeading, stockList], "sunk")
stockHeading = Heading("Out of Stock Items", "h3")
stockList = ListBlock([stockItem1, stockItem2, stockItem3])
stockItem1 = ListItem("USB-C Cable 6ft", "SKU 88213 — reorder suggested")
stockItem2 = ListItem("Coffee Mug 12oz", "SKU 44107 — reorder suggested")
stockItem3 = ListItem("Phone Stand", "SKU 77520 — reorder suggested")
shiftSection = Card([shiftHeading, shiftTable], "sunk")
shiftHeading = Heading("On Shift Today", "h3")
shiftTable = Table([shiftName, shiftRole, shiftTime])
shiftName = Col("Name", ["Alex Rivera", "Sam Chen", "Jordan Lee", "Taylor Brooks"])
shiftRole = Col("Role", ["Cashier", "Cashier", "Floor", "Manager"])
shiftTime = Col("Time", ["9am–2pm", "9am–2pm", "12pm–6pm", "9am–5pm"])
promoSection = Card([promoHeading, promoTable], "sunk")
promoHeading = Heading("Running Promotions", "h3")
promoTable = Table([promoName, promoStatus])
promoName = Col("Promotion", ["Buy 1 Get 1 — Snacks", "20% Off Apparel", "Free Tote over $75"])
promoStatus = Col("Performance", ["On track", "Behind target", "Ahead of target"])
registerSection = Card([registerHeading, registerTable], "sunk")
registerHeading = Heading("Registers", "h3")
registerTable = Table([registerId, registerStatus])
registerId = Col("Register", ["Register 1", "Register 2", "Register 3", "Register 4"])
registerStatus = Col("Status", ["Open", "Open", "Closed", "Open"])
reorderSection = Card([reorderHeading, reorderForm], "sunk")
reorderHeading = Heading("Reorder an Item", "h3")
reorderForm = Form("reorder-item", reorderButtons, [itemField, qtyField])
itemField = FormControl("Item", itemInput)
itemInput = Input("item", "Enter SKU or product name", "text")
qtyField = FormControl("Quantity", qtyInput)
qtyInput = Input("quantity", "Enter quantity", "number")
reorderButtons = Buttons([reorderSubmit])
reorderSubmit = Button("Submit Reorder", null, "primary")
storeSection = Card([storeHeading, storeSelect], "sunk")
storeHeading = Heading("View a Different Store", "h3")
storeSelect = Select("store", [store1, store2, store3, store4], "Choose a store")
store1 = SelectItem("104", "Store #104 — Downtown")
store2 = SelectItem("105", "Store #105 — Uptown")
store3 = SelectItem("106", "Store #106 — Mall")
store4 = SelectItem("107", "Store #107 — Airport")
weekCompareSection = Card([weekCompareHeading, weekCompareChart], "sunk")
weekCompareHeading = Heading("This Week vs Last Week", "h3")
weekCompareChart = BarChart(["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], [thisWeekSeries, lastWeekSeries], "grouped", "Day", "Revenue")
thisWeekSeries = Series("This Week", [7200, 8100, 7900, 8400, 9200, 10500, 9800])
lastWeekSeries = Series("Last Week", [6800, 7500, 7700, 8000, 8800, 9900, 9400])