root = Card([header, topRow, lineSection, qualityHoldSection, qualityDowntimeRow, maintenanceSection, stockSection, supplierSection, shiftSection, safetyEnergyRow, workOrderSection, focusScheduleRow, andonSection, exportSection], "card", "column", "xl")
header = CardHeader("Factory Floor Control", "Shift B · 13:42 · Floor overview")
topRow = Card([oeeSection, unitsSection], "clear", "row", "xl")
oeeSection = Card([oeeHeader, oeeProgress, oeeBreakdown], "sunk")
oeeHeader = CardHeader("Overall equipment effectiveness", "OEE at a glance")
oeeProgress = Progress(84, "OEE 84%")
oeeBreakdown = Table([oeeMetric, oeeValue])
oeeMetric = Col("Component", ["Availability", "Performance", "Quality"])
oeeValue = Col("Score", ["92%", "91%", "98%"])
unitsSection = Card([unitsHeader, unitsProgress, unitsText], "sunk")
unitsHeader = CardHeader("Units produced vs target", "Today")
unitsProgress = Progress(91, "1,820 / 2,000 units")
unitsText = TextContent("Current run rate 182 units/hr · ahead of plan", "small")
lineSection = Card([lineHeader, lineTable], "sunk")
lineHeader = CardHeader("Production lines", "Rate and live status")
lineTable = Table([lineName, lineProduct, lineRate, lineStatus])
lineName = Col("Line", ["Line 1 — Stamping", "Line 2 — Assembly", "Line 3 — Press"])
lineProduct = Col("Product", ["Bracket A2", "Housing B4", "Bracket C1"])
lineRate = Col("Rate (units/hr)", [185, 210, 176])
lineStatus = Col("Status", ["Running", "Running", "Andon"])
qualityHoldSection = Card([qualityHoldHeader, qualityHoldTable], "sunk")
qualityHoldHeader = CardHeader("Batches on quality hold", "Awaiting inspection decision")
qualityHoldTable = Table([batchCol, productCol, qtyCol, holdReasonCol])
batchCol = Col("Batch", ["B-1042", "B-1047", "B-1051"])
productCol = Col("Product", ["Bracket A2", "Housing B4", "Bracket C1"])
qtyCol = Col("Qty", [840, 1500, 320])
holdReasonCol = Col("Reason", ["Thickness out of spec", "Surface scratches", "Dimensional check pending"])
qualityDowntimeRow = Card([defectSection, downtimeSection], "clear", "row", "xl")
defectSection = Card([defectHeader, defectChart], "sunk")
defectHeader = CardHeader("Defect rate — past month", "% of produced units")
defectChart = LineChart(["W1", "W2", "W3", "W4"], [defectSeries], "natural", "Week", "Defect %")
defectSeries = Series("Defect rate", [1.8, 1.6, 2.1, 1.4])
downtimeSection = Card([downtimeHeader, downtimeChart], "sunk")
downtimeHeader = CardHeader("Downtime by cause", "This month")
downtimeChart = PieChart(["Changeover", "Equipment failure", "Material shortage", "Quality checks"], [34, 28, 22, 16], "donut")
maintenanceSection = Card([maintHeader, maintTable], "sunk")
maintHeader = CardHeader("Machines due for maintenance", "Next 7 days")
maintTable = Table([mMachine, mHour, mDue, mStatus])
mMachine = Col("Machine", ["Press 02", "Press 03", "Conveyor 1", "Robot 4"])
mHour = Col("Hours", ["2,340", "1,980", "860", "1,210"])
mDue = Col("Due", ["Today", "Tomorrow", "Fri", "Sat"])
mStatus = Col("Status", ["Overdue", "Due", "Due", "Scheduled"])
stockSection = Card([stockHeader, stockTable], "sunk")
stockHeader = CardHeader("Raw material stock", "Live warehouse levels")
stockTable = Table([materialCol, levelCol, stockStatusCol])
materialCol = Col("Material", ["Steel coil", "Resin pellets", "Packaging cartons"])
levelCol = Col("Stock", ["4.2 tonnes", "310 kg", "1,250 units"])
stockStatusCol = Col("Status", ["Adequate", "Reorder soon", "Low"])
supplierSection = Card([suppHeader, suppTable], "sunk")
suppHeader = CardHeader("Supplier deliveries due this week", "Inbound schedule")
suppTable = Table([suppName, suppMaterial, suppDay, suppQty])
suppName = Col("Supplier", ["Midwest Steel", "PolyChem Co", "PackRight Ltd", "Fastener Express"])
suppMaterial = Col("Material", ["Steel", "Resin", "Cartons", "Fasteners"])
suppDay = Col("Due", ["Mon", "Tue", "Wed", "Thu"])
suppQty = Col("Qty", ["20 t", "500 kg", "2,000", "10k"])
shiftSection = Card([shiftHeader, shiftChart], "