// Forge — Mittelstand-pilot Werkzeugbau tenant fixture
// MTL-220 · 5-axis bridge mill · MAHLE 24-unit frame contract · Rev D
// Babel-standalone in-browser pattern. NO ES imports / exports.
// Single global: const MITTELSTAND_TENANT = { ... };
// Spec: forge-web/demo/tenant-spec/mittelstand.md (sections 1-9, 11)

const MITTELSTAND_TENANT = {
  // ── Tenant identity ────────────────────────────────────────────────
  tenant: {
    id: "mittelstand",
    name: "Mittelstand-pilot Werkzeugbau",
    site: "Stuttgart, DE",
    erp: "SAP B1 + proALPHA",
    founded: 1978,
    employees: 184,
    revenue_meur: 62,
    accreditations: ["ISO 9001:2015", "IATF 16949:2016", "EN ISO 230-1/2/4", "CE Machinery Directive 2006/42/EC"],
  },

  // ── Hero program: 24-mill MAHLE frame contract ────────────────────
  program: {
    id: "PGM-MTL-220-RD-MAHLE",
    code: "MTL-220",
    name: "MTL-220 · 5-axis bridge mill · Rev D",
    customer: "MAHLE Industriebeteiligungen GmbH",
    customer_role: "Tier-1 automotive · powertrain machining cells",
    qty: 24,
    batches: [
      { id: "B1", qty: 12, ship_window: "2026-08 → 2026-12" },
      { id: "B2", qty: 12, ship_window: "2027-01 → 2027-06" },
    ],
    due_date: "2026-12-15",
    revision: "D",
    lead: "R. Vogt",
    progress: 0.18,
    nextMilestone: "FAI · S/N 0095 (first article Rev D)",
    nextDate: "2026-08-14",
    phase: "Industrialize · Rev D freeze",
    contract_value_meur: 9.22,
    incoterm: "DAP Stuttgart-Kornwestheim",
  },

  // ── KPI strip · per spec §4 ───────────────────────────────────────
  kpis: [
    { k: "Open RFQs (€)",    v: "€2.4M",  d: "+1 (MAHLE batch-2)", trend: "up"   },
    { k: "WOs scheduled",    v: "8",      d: "24 mills",            trend: "up"   },
    { k: "Open ECOs",        v: "4",      d: "1 critical (MS-0017)",trend: "up"   },
    { k: "Line readiness",   v: "91%",    d: "−3 pt (granite cell)",trend: "down" },
    { k: "Alerts (24h)",     v: "5",      d: "2 supplier · 3 quality", trend: "up" },
    { k: "FAI pass rate",    v: "94%",    d: "+2 pt YTD",           trend: "up"   },
  ],

  // ── Secondary KPI shelf (carried over from stub) ──────────────────
  kpis_secondary: [
    { k: "On-time %",       v: "88%", d: "−2 pt", trend: "down" },
    { k: "Audits due 30d",  v: "2",   d: "none overdue", trend: "down" },
  ],

  // ── Navigation (Mittelstand labels, mirrors pump nav structure) ───
  nav: [
    { g: "Program", items: [
      { id: "dashboard",    label: "Cockpit",                          icon: "Home"      },
      { id: "onboarding",   label: "Customer Onboarding",              icon: "Sparkle"   },
    ]},
    { g: "Plan", items: [
      { id: "plc",          label: "Program Lifecycle",                icon: "Satellite" },
      { id: "gantt",        label: "Schedule · plan://",               icon: "Calendar"  },
      { id: "lifecycle",    label: "Production Gates (FSM)",           icon: "Flow"      },
    ]},
    { g: "Build", items: [
      { id: "ebom",         label: "E-BOM · Mill",                     icon: "Tree"      },
      { id: "ebomtombom",   label: "E-BOM → M-BOM",                    icon: "Diff"      },
      { id: "mbom",         label: "M-BOM · Routing",                  icon: "Factory"   },
      { id: "workflows",    label: "Workflow Hub · build://",          icon: "Flow"      },
      { id: "eco",          label: "ECO · Change Orders",              icon: "Git"       },
      { id: "approvals",    label: "Approvals",                        icon: "Check"     },
      { id: "erp",          label: "SAP B1 + proALPHA",                icon: "Plug"      },
    ]},
    { g: "Line", items: [
      { id: "line",         label: "Line · line://",                   icon: "Factory"   },
      { id: "analytics",    label: "Analytics",                        icon: "BarChart"  },
      { id: "connectors",   label: "Connectors",                       icon: "Link"      },
    ]},
    { g: "Traveler", items: [
      { id: "traveler",     label: "Station Console · traveler://",    icon: "Wrench"    },
    ]},
    { g: "Governance", items: [
      { id: "auditor",      label: "Auditor · ledger",                 icon: "Check"     },
    ]},
    { g: "Organization", items: [
      { id: "people",       label: "People & HR",                      icon: "Person"    },
      { id: "docs",         label: "Documents",                        icon: "File"      },
      { id: "maintenance",  label: "Maintenance",                      icon: "Wrench"    },
      { id: "integrations", label: "Integrations",                     icon: "DB"        },
    ]},
  ],

  // ── Parts catalog (~92 parts, expanded from MITTELSTAND_BOM_FLAT) ─
  // Promoted + expanded from fixtures.jsx:4-86. Adds 2nd-tier subassy
  // detail (granite, control cabinet, ATC) per spec §3 anchor list.
  parts: [
    // ── Top assembly ────────────────────────────────────────────────
    { num: "00.00", p: null,    name: "MTL-220 · 5-axis bridge mill",         qty: 1,  cost_eur: 384000, tolerance: "—",          lead_time_days: 0,   supplier: "in-house",      cert: "CE / IATF 16949 PPAP-3" },

    // ── Level-2 subassemblies (anchor 9 + spindle promoted) ─────────
    { num: "10.00", p: "00.00", name: "Granite-bed substructure",             qty: 1,  cost_eur: 48000,  tolerance: "±0.01 mm",    lead_time_days: 75,  supplier: "in-house",      cert: "ISO 230-1" },
    { num: "20.00", p: "00.00", name: "X-axis carriage assy",                 qty: 1,  cost_eur: 36500,  tolerance: "—",           lead_time_days: 60,  supplier: "in-house",      cert: "ISO 230-2" },
    { num: "30.00", p: "00.00", name: "Y-axis bridge assy",                   qty: 1,  cost_eur: 42000,  tolerance: "—",           lead_time_days: 65,  supplier: "in-house",      cert: "ISO 230-2" },
    { num: "40.00", p: "00.00", name: "Z-axis ram assy",                      qty: 1,  cost_eur: 38500,  tolerance: "—",           lead_time_days: 60,  supplier: "in-house",      cert: "ISO 230-2" },
    { num: "50.00", p: "00.00", name: "A/C tilting head (spindle module)",    qty: 1,  cost_eur: 86000,  tolerance: "—",           lead_time_days: 90,  supplier: "Kessler",       cert: "IATF 16949" },
    { num: "60.00", p: "00.00", name: "ATC carousel (24-pocket)",             qty: 1,  cost_eur: 24500,  tolerance: "—",           lead_time_days: 55,  supplier: "DMG Mori",      cert: "ISO 9001" },
    { num: "70.00", p: "00.00", name: "Control cabinet · Heidenhain TNC 640", qty: 1,  cost_eur: 52000,  tolerance: "—",           lead_time_days: 45,  supplier: "Heidenhain",    cert: "CE / EN 60204-1" },
    { num: "80.00", p: "00.00", name: "Coolant & chip mgmt unit",             qty: 1,  cost_eur: 18000,  tolerance: "—",           lead_time_days: 35,  supplier: "in-house",      cert: "CE" },
    { num: "90.00", p: "00.00", name: "Machine enclosure",                    qty: 1,  cost_eur: 22000,  tolerance: "—",           lead_time_days: 40,  supplier: "in-house",      cert: "CE Machinery Directive" },

    // ── 10.xx · Granite-bed substructure (HERO PATH · ECO-MS-0017) ──
    { num: "10.01", p: "10.00", name: "Granite base block · Diabas",          qty: 1,  cost_eur: 18000,  tolerance: "±3 µm flatness (Rev D)", lead_time_days: 120, supplier: "in-house",  cert: "ISO 230-1 §5.4", note: "Rev C was ±5 µm — tightened by ECO-MS-0017" },
    { num: "10.02", p: "10.00", name: "Granite cross-beam · Diabas",          qty: 1,  cost_eur: 14500,  tolerance: "±3 µm flatness (Rev D)", lead_time_days: 110, supplier: "in-house",  cert: "ISO 230-1 §5.4", note: "Rev C was ±5 µm — tightened by ECO-MS-0017" },
    { num: "10.03", p: "10.00", name: "Levelling foot · vibration-isolated",  qty: 6,  cost_eur: 380,    tolerance: "±0.02 mm",    lead_time_days: 25,  supplier: "Schaeffler",    cert: "DIN 8675" },
    { num: "10.04", p: "10.00", name: "Floor anchor bolt set M30×400",        qty: 12, cost_eur: 42,     tolerance: "DIN 976",     lead_time_days: 14,  supplier: "in-house",      cert: "DIN 976-1" },
    { num: "10.05", p: "10.00", name: "Granite-foundation grout",             qty: 1,  cost_eur: 280,    tolerance: "—",           lead_time_days: 7,   supplier: "in-house",      cert: "—" },
    { num: "10.06", p: "10.00", name: "Vibration sensor · 3-axis IEPE",       qty: 4,  cost_eur: 720,    tolerance: "±2% sensitivity", lead_time_days: 21, supplier: "Bosch Rexroth", cert: "ISO 10816-1" },

    // ── 20.xx · X-axis carriage ─────────────────────────────────────
    { num: "20.01", p: "20.00", name: "Linear guide rail · X-axis",           qty: 2,  cost_eur: 2400,   tolerance: "H7",          lead_time_days: 42,  supplier: "Bosch Rexroth", cert: "DIN 645" },
    { num: "20.02", p: "20.00", name: "Ball-screw assy · X-axis Ø50",         qty: 1,  cost_eur: 5800,   tolerance: "IT5",         lead_time_days: 90,  supplier: "NSK",           cert: "DIN 69051" },
    { num: "20.03", p: "20.00", name: "Linear encoder · LC 415 X",            qty: 1,  cost_eur: 3200,   tolerance: "±0.5 µm",     lead_time_days: 60,  supplier: "Heidenhain",    cert: "ISO 230-6" },
    { num: "20.04", p: "20.00", name: "Servo motor · X-axis (Sinamics 1FK7)", qty: 1,  cost_eur: 4100,   tolerance: "—",           lead_time_days: 50,  supplier: "Siemens",       cert: "EN 60034" },
    { num: "20.05", p: "20.00", name: "X-carriage casting · Meehanite GE-300",qty: 1,  cost_eur: 6800,   tolerance: "±0.05 mm",    lead_time_days: 65,  supplier: "in-house",      cert: "EN-GJL-300" },
    { num: "20.06", p: "20.00", name: "Way-cover · stainless bellows",        qty: 2,  cost_eur: 480,    tolerance: "—",           lead_time_days: 25,  supplier: "in-house",      cert: "—" },
    { num: "20.07", p: "20.00", name: "Lubrication block · centralized oil",  qty: 1,  cost_eur: 620,    tolerance: "—",           lead_time_days: 20,  supplier: "Bosch Rexroth", cert: "DIN 51517" },

    // ── 30.xx · Y-axis bridge ───────────────────────────────────────
    { num: "30.01", p: "30.00", name: "Linear guide rail · Y-axis",           qty: 2,  cost_eur: 2200,   tolerance: "H7",          lead_time_days: 42,  supplier: "Schaeffler",    cert: "DIN 645" },
    { num: "30.02", p: "30.00", name: "Ball-screw assy · Y-axis Ø50",         qty: 1,  cost_eur: 5400,   tolerance: "IT5",         lead_time_days: 90,  supplier: "Hiwin",         cert: "DIN 69051" },
    { num: "30.03", p: "30.00", name: "Linear encoder · LC 415 Y",            qty: 1,  cost_eur: 3200,   tolerance: "±0.5 µm",     lead_time_days: 60,  supplier: "Heidenhain",    cert: "ISO 230-6" },
    { num: "30.04", p: "30.00", name: "Servo motor · Y-axis (Sinamics 1FK7)", qty: 1,  cost_eur: 4100,   tolerance: "—",           lead_time_days: 50,  supplier: "Siemens",       cert: "EN 60034" },
    { num: "30.05", p: "30.00", name: "Bridge weldment · S355J2",             qty: 1,  cost_eur: 7400,   tolerance: "±0.10 mm",    lead_time_days: 70,  supplier: "in-house",      cert: "EN 10025-2" },
    { num: "30.06", p: "30.00", name: "Bridge column casting (×2)",           qty: 2,  cost_eur: 4900,   tolerance: "±0.05 mm",    lead_time_days: 65,  supplier: "in-house",      cert: "EN-GJL-300" },

    // ── 40.xx · Z-axis ram ──────────────────────────────────────────
    { num: "40.01", p: "40.00", name: "Ball-screw assy · Z-axis Ø40",         qty: 1,  cost_eur: 4900,   tolerance: "IT5",         lead_time_days: 90,  supplier: "NSK",           cert: "DIN 69051" },
    { num: "40.02", p: "40.00", name: "Counterbalance hydraulic cyl.",        qty: 1,  cost_eur: 2600,   tolerance: "H8",          lead_time_days: 45,  supplier: "Bosch Rexroth", cert: "ISO 6020-2" },
    { num: "40.03", p: "40.00", name: "Z-ram casting · Meehanite GE-300",     qty: 1,  cost_eur: 5800,   tolerance: "±0.05 mm",    lead_time_days: 60,  supplier: "in-house",      cert: "EN-GJL-300" },
    { num: "40.04", p: "40.00", name: "Servo motor · Z-axis (Sinamics 1FK7)", qty: 1,  cost_eur: 4400,   tolerance: "—",           lead_time_days: 50,  supplier: "Siemens",       cert: "EN 60034" },
    { num: "40.05", p: "40.00", name: "Linear encoder · LC 415 Z",            qty: 1,  cost_eur: 3200,   tolerance: "±0.5 µm",     lead_time_days: 60,  supplier: "Heidenhain",    cert: "ISO 230-6" },
    { num: "40.06", p: "40.00", name: "Way-cover Z · telescopic steel",       qty: 1,  cost_eur: 580,    tolerance: "—",           lead_time_days: 25,  supplier: "in-house",      cert: "—" },

    // ── 50.xx · A/C tilting head + spindle (HERO SUBASSY) ───────────
    { num: "50.01", p: "50.00", name: "Main spindle · HSK-A63 24k rpm",       qty: 1,  cost_eur: 32000,  tolerance: "Ra 0.4 µm",   lead_time_days: 180, supplier: "GMN",           cert: "ISO 1940-1 G1.0" },
    { num: "50.02", p: "50.00", name: "A-axis torque motor (DDR)",            qty: 1,  cost_eur: 9800,   tolerance: "—",           lead_time_days: 75,  supplier: "Siemens",       cert: "EN 60034-1" },
    { num: "50.03", p: "50.00", name: "C-axis rotary table",                  qty: 1,  cost_eur: 11500,  tolerance: "±0.005°",     lead_time_days: 80,  supplier: "Kessler",       cert: "ISO 230-7" },
    { num: "50.04", p: "50.00", name: "HSK-A63 toolholder set",               qty: 24, cost_eur: 240,    tolerance: "AT3",         lead_time_days: 30,  supplier: "DMG Mori",      cert: "DIN 69893-1" },
    { num: "50.05", p: "50.00", name: "Spindle housing · forged 42CrMo4",     qty: 1,  cost_eur: 4200,   tolerance: "±0.01 mm",    lead_time_days: 60,  supplier: "Kessler",       cert: "EN 10083-3" },
    { num: "50.06", p: "50.00", name: "A-axis bearing pair · cross-roller",   qty: 1,  cost_eur: 3800,   tolerance: "P4",          lead_time_days: 70,  supplier: "Schaeffler",    cert: "ISO 492" },
    { num: "50.07", p: "50.00", name: "C-axis bearing · YRT 460 turntable",   qty: 1,  cost_eur: 4600,   tolerance: "P4",          lead_time_days: 70,  supplier: "Schaeffler",    cert: "ISO 492" },
    { num: "50.08", p: "50.00", name: "Spindle cooling · oil chiller 4 kW",   qty: 1,  cost_eur: 2400,   tolerance: "±0.5 K",      lead_time_days: 35,  supplier: "in-house",      cert: "CE" },
    { num: "50.09", p: "50.00", name: "Tool-clamp drawbar · 18 kN",           qty: 1,  cost_eur: 1800,   tolerance: "±5% load",    lead_time_days: 45,  supplier: "GMN",           cert: "VDI 3447" },
    { num: "50.10", p: "50.00", name: "Spindle nose seal · labyrinth",        qty: 1,  cost_eur: 280,    tolerance: "—",           lead_time_days: 21,  supplier: "GMN",           cert: "—" },

    // ── 60.xx · ATC carousel ────────────────────────────────────────
    { num: "60.01", p: "60.00", name: "ATC pickup arm",                       qty: 1,  cost_eur: 3400,   tolerance: "±0.01 mm",    lead_time_days: 50,  supplier: "in-house",      cert: "—" },
    { num: "60.02", p: "60.00", name: "Pneumatic clamp cylinder",             qty: 1,  cost_eur: 520,    tolerance: "—",           lead_time_days: 20,  supplier: "Bosch Rexroth", cert: "ISO 15552" },
    { num: "60.03", p: "60.00", name: "Carousel wheel · 24-pocket",           qty: 1,  cost_eur: 2800,   tolerance: "±0.02 mm",    lead_time_days: 45,  supplier: "DMG Mori",      cert: "—" },
    { num: "60.04", p: "60.00", name: "ATC indexer motor",                    qty: 1,  cost_eur: 1200,   tolerance: "—",           lead_time_days: 35,  supplier: "Siemens",       cert: "EN 60034" },
    { num: "60.05", p: "60.00", name: "Tool ID chip reader · RFID",           qty: 1,  cost_eur: 380,    tolerance: "—",           lead_time_days: 28,  supplier: "Omron",         cert: "ISO 15693" },

    // ── 70.xx · Control cabinet (Heidenhain) ────────────────────────
    { num: "70.01", p: "70.00", name: "TNC 640 control unit",                 qty: 1,  cost_eur: 18500,  tolerance: "—",           lead_time_days: 60,  supplier: "Heidenhain",    cert: "EN 60204-1" },
    { num: "70.02", p: "70.00", name: "Sinamics S120 drive · 5-axis pack",    qty: 1,  cost_eur: 14200,  tolerance: "—",           lead_time_days: 55,  supplier: "Siemens",       cert: "EN 61800-3" },
    { num: "70.03", p: "70.00", name: "Safety relay & E-stop loop",           qty: 1,  cost_eur: 1200,   tolerance: "—",           lead_time_days: 14,  supplier: "Omron",         cert: "EN ISO 13849-1 PL-d" },
    { num: "70.04", p: "70.00", name: "PROFIBUS / PROFINET I/O rack",         qty: 1,  cost_eur: 2400,   tolerance: "—",           lead_time_days: 30,  supplier: "Siemens",       cert: "IEC 61784" },
    { num: "70.05", p: "70.00", name: "24V DC PSU · 40A redundant pair",      qty: 2,  cost_eur: 480,    tolerance: "±2% V",       lead_time_days: 18,  supplier: "Siemens",       cert: "EN 61558" },
    { num: "70.06", p: "70.00", name: "Cabinet enclosure · IP54 1800×800",    qty: 1,  cost_eur: 1850,   tolerance: "—",           lead_time_days: 28,  supplier: "in-house",      cert: "IEC 60529" },
    { num: "70.07", p: "70.00", name: "Operator panel · 19\" multi-touch",    qty: 1,  cost_eur: 2800,   tolerance: "—",           lead_time_days: 35,  supplier: "Heidenhain",    cert: "EN 60204-1" },
    { num: "70.08", p: "70.00", name: "Cabinet cooling · vortex 600W",        qty: 1,  cost_eur: 620,    tolerance: "—",           lead_time_days: 21,  supplier: "in-house",      cert: "—" },
    { num: "70.09", p: "70.00", name: "Cable harness · pre-form 80-loom",     qty: 1,  cost_eur: 1450,   tolerance: "—",           lead_time_days: 32,  supplier: "in-house",      cert: "EN 60204-1" },

    // ── 80.xx · Coolant & chip management ───────────────────────────
    { num: "80.01", p: "80.00", name: "Coolant tank · 600 L stainless",       qty: 1,  cost_eur: 2800,   tolerance: "—",           lead_time_days: 30,  supplier: "in-house",      cert: "EN 10088-2" },
    { num: "80.02", p: "80.00", name: "Coolant pump · 80 L/min 8 bar",        qty: 1,  cost_eur: 1400,   tolerance: "±5% flow",    lead_time_days: 25,  supplier: "in-house",      cert: "—" },
    { num: "80.03", p: "80.00", name: "Chip conveyor · scraper 2.4 m",        qty: 1,  cost_eur: 4200,   tolerance: "—",           lead_time_days: 40,  supplier: "in-house",      cert: "—" },
    { num: "80.04", p: "80.00", name: "Mist extractor · ISO H13 filter",      qty: 1,  cost_eur: 2600,   tolerance: "—",           lead_time_days: 28,  supplier: "in-house",      cert: "EN 1822-1 H13" },
    { num: "80.05", p: "80.00", name: "Coolant pressure sensor · 0-25 bar",   qty: 1,  cost_eur: 280,    tolerance: "±0.5% FS",    lead_time_days: 14,  supplier: "Bosch Rexroth", cert: "—" },

    // ── 90.xx · Enclosure ───────────────────────────────────────────
    { num: "90.01", p: "90.00", name: "Sliding door · safety-glass laminate", qty: 1,  cost_eur: 3600,   tolerance: "±0.5 mm",     lead_time_days: 35,  supplier: "in-house",      cert: "EN 12150-1" },
    { num: "90.02", p: "90.00", name: "Enclosure frame · welded steel",       qty: 1,  cost_eur: 4800,   tolerance: "±1 mm",       lead_time_days: 40,  supplier: "in-house",      cert: "EN 1090-2 EXC2" },
    { num: "90.03", p: "90.00", name: "Door interlock · safety-rated",        qty: 2,  cost_eur: 320,    tolerance: "—",           lead_time_days: 18,  supplier: "Omron",         cert: "EN ISO 14119" },
    { num: "90.04", p: "90.00", name: "LED interior lighting · IP67 36W",     qty: 4,  cost_eur: 140,    tolerance: "—",           lead_time_days: 14,  supplier: "in-house",      cert: "IEC 60598" },
    { num: "90.05", p: "90.00", name: "Window wiper · powered",               qty: 1,  cost_eur: 480,    tolerance: "—",           lead_time_days: 21,  supplier: "in-house",      cert: "—" },
    { num: "90.06", p: "90.00", name: "Stack light · 3-tier signal tower",    qty: 1,  cost_eur: 220,    tolerance: "—",           lead_time_days: 14,  supplier: "Omron",         cert: "—" },

    // ── Rev D variant parts (post ECO-MS-0017) ──────────────────────
    { num: "10.01D", p: "10.00", name: "Granite base block · Rev D (re-ground)", qty: 1, cost_eur: 18820, tolerance: "±3 µm flatness", lead_time_days: 131, supplier: "in-house", cert: "ISO 230-1 §5.4 + Rev D dossier", note: "supersedes 10.01 from S/N 0095" },
    { num: "10.02D", p: "10.00", name: "Granite cross-beam · Rev D (re-ground)", qty: 1, cost_eur: 14820, tolerance: "±3 µm flatness", lead_time_days: 121, supplier: "in-house", cert: "ISO 230-1 §5.4 + Rev D dossier", note: "supersedes 10.02 from S/N 0095" },
  ],

  // ── BOMs · 3 hierarchies (top assy + spindle + cabinet) ───────────
  // Spec §3 anchor + spec calls for 3+ hierarchies.
  boms: [
    {
      sku: "MTL-220.RD",
      name: "MTL-220 · 5-axis bridge mill · Rev D",
      level: "top-assy",
      lines: [
        { part_num: "10.00",  qty: 1, position: "Granite-bed substructure" },
        { part_num: "20.00",  qty: 1, position: "X-axis carriage assy" },
        { part_num: "30.00",  qty: 1, position: "Y-axis bridge assy" },
        { part_num: "40.00",  qty: 1, position: "Z-axis ram assy" },
        { part_num: "50.00",  qty: 1, position: "A/C tilting head" },
        { part_num: "60.00",  qty: 1, position: "ATC carousel 24-pocket" },
        { part_num: "70.00",  qty: 1, position: "Control cabinet · TNC 640" },
        { part_num: "80.00",  qty: 1, position: "Coolant & chip mgmt" },
        { part_num: "90.00",  qty: 1, position: "Machine enclosure" },
        { part_num: "10.01D", qty: 1, position: "Granite base · Rev D" },
        { part_num: "10.02D", qty: 1, position: "Granite cross-beam · Rev D" },
      ],
    },
    {
      sku: "MTL-220.50.00",
      name: "A/C tilting head · spindle subassembly",
      level: "subassy",
      parent: "MTL-220.RD",
      lines: [
        { part_num: "50.01", qty: 1,  position: "Main spindle HSK-A63 24k rpm" },
        { part_num: "50.02", qty: 1,  position: "A-axis torque motor (DDR)" },
        { part_num: "50.03", qty: 1,  position: "C-axis rotary table" },
        { part_num: "50.04", qty: 24, position: "HSK-A63 toolholder set" },
        { part_num: "50.05", qty: 1,  position: "Spindle housing 42CrMo4" },
        { part_num: "50.06", qty: 1,  position: "A-axis cross-roller bearing" },
        { part_num: "50.07", qty: 1,  position: "C-axis YRT 460 bearing" },
        { part_num: "50.08", qty: 1,  position: "Spindle oil chiller" },
        { part_num: "50.09", qty: 1,  position: "Drawbar 18 kN" },
        { part_num: "50.10", qty: 1,  position: "Labyrinth seal" },
      ],
    },
    {
      sku: "MTL-220.70.00",
      name: "Control cabinet · Heidenhain TNC 640 subassembly",
      level: "subassy",
      parent: "MTL-220.RD",
      lines: [
        { part_num: "70.01", qty: 1, position: "TNC 640 control unit" },
        { part_num: "70.02", qty: 1, position: "Sinamics S120 5-axis drive" },
        { part_num: "70.03", qty: 1, position: "Safety relay & E-stop loop" },
        { part_num: "70.04", qty: 1, position: "PROFIBUS / PROFINET I/O rack" },
        { part_num: "70.05", qty: 2, position: "24V DC PSU 40A pair" },
        { part_num: "70.06", qty: 1, position: "Cabinet enclosure IP54" },
        { part_num: "70.07", qty: 1, position: "Operator panel 19\"" },
        { part_num: "70.08", qty: 1, position: "Cabinet cooling 600W" },
        { part_num: "70.09", qty: 1, position: "Cable harness 80-loom" },
      ],
    },
    {
      sku: "MTL-220.10.00",
      name: "Granite-bed substructure · ECO-MS-0017 Rev D",
      level: "subassy",
      parent: "MTL-220.RD",
      lines: [
        { part_num: "10.01D", qty: 1,  position: "Granite base · re-ground ±3 µm" },
        { part_num: "10.02D", qty: 1,  position: "Granite cross-beam · re-ground ±3 µm" },
        { part_num: "10.03",  qty: 6,  position: "Vibration-isolated levelling foot" },
        { part_num: "10.04",  qty: 12, position: "Floor anchor M30×400" },
        { part_num: "10.05",  qty: 1,  position: "Foundation grout" },
        { part_num: "10.06",  qty: 4,  position: "3-axis IEPE vibration sensor" },
      ],
    },
  ],

  // ── Cost cascade · per SKU rolled-up cost & history ───────────────
  cost_cascade: [
    {
      sku: "MTL-220.RC",
      label: "Rev C (legacy, 91 units shipped)",
      mech_eur: 218000, electrical_eur: 76000, conversion_pct: 22, freight_pct: 4,
      total_eur: 380400,
      history: [
        { q: "2024Q1", total_eur: 374200 },
        { q: "2024Q2", total_eur: 376800 },
        { q: "2024Q3", total_eur: 378500 },
        { q: "2024Q4", total_eur: 379600 },
        { q: "2025Q1", total_eur: 380100 },
        { q: "2025Q2", total_eur: 380400 },
        { q: "2025Q3", total_eur: 380400 },
      ],
    },
    {
      sku: "MTL-220.RD",
      label: "Rev D (post-ECO, frozen 2025-11)",
      mech_eur: 219640, electrical_eur: 76000, conversion_pct: 22, freight_pct: 4,
      total_eur: 384000,
      cost_delta_vs_rc: 3600,
      history: [
        { q: "2025Q4", total_eur: 384000 },
        { q: "2026Q1", total_eur: 384000 },
      ],
    },
  ],

  // ── Routing · 6 stations (granite cell · machine shop · subassy · final) ─
  routing: [
    { id: "r1", seq: 1, name: "Receiving · Granite blank QC",   owner: "M. Schubert", cycle_min: 45,  station_type: "inbound"     },
    { id: "r2", seq: 2, name: "Granite lapping cell",           owner: "T. Brand",    cycle_min: 1320, station_type: "machining"   }, // 22h, includes new re-grind op
    { id: "r3", seq: 3, name: "Machine shop · CNC + CMM",       owner: "L. Kraus",    cycle_min: 720,  station_type: "machining"   }, // 12h
    { id: "r4", seq: 4, name: "Subassy · Spindle alignment",    owner: "F. Engel",    cycle_min: 480,  station_type: "assembly"    }, // 8h
    { id: "r5", seq: 5, name: "Cabinet wiring + drive commission", owner: "K. Hofer", cycle_min: 360,  station_type: "assembly"    }, // 6h
    { id: "r6", seq: 6, name: "Final FAI · ISO 230-2 + acceptance", owner: "S. Klein",cycle_min: 600,  station_type: "final"       }, // 10h
  ],

  // ── Quality gates · 5-gate sequence per spec §7 + per-station CTQs ─
  // Five-gate sequence matches onboarding.jsx:447 (do not renumber):
  // Design Review → Prototype Approval → Validation Test → FAI → Production Release
  quality_gates_program: [
    { id: "G1", name: "Design Review",        owner: "R. Vogt",  status: "complete", date: "2025-11-04", artifacts: ["Rev D drawing pack", "PFMEA-MTL220-D"] },
    { id: "G2", name: "Prototype Approval",   owner: "D. Becker",status: "complete", date: "2026-01-22", artifacts: ["Granite re-grind capability run", "MSA Cmk ≥ 1.67"] },
    { id: "G3", name: "Validation Test",      owner: "S. Klein", status: "in-progress", date: "2026-06-30", artifacts: ["ISO 230-2 geometric test", "Ballbar circularity"] },
    { id: "G4", name: "FAI",                  owner: "S. Klein", status: "scheduled",   date: "2026-08-14", artifacts: ["AS9102/IATF FAI", "Customer witness MAHLE"] },
    { id: "G5", name: "Production Release",   owner: "D. Becker",status: "scheduled",   date: "2026-08-21", artifacts: ["PPAP Level 3 dossier", "Control plan release"] },
  ],

  // ── Quality gates · CTQ checks per station (mono-spec µm everywhere) ─
  quality_gates: [
    { gate_id: "QG-MS-01", station: "r1", ctq_param: "Granite blank flatness incoming",  instrument: "Surface plate · Class 0",      ref_doc: "QC-DIM-MS-04 rev D", spec: "≤ 5 µm reject; ≤ 3 µm target", effect_if_failed: "NCR · return to foundry",    severity: "critical" },
    { gate_id: "QG-MS-02", station: "r1", ctq_param: "Granite COC flatness cert hash",   instrument: "Cert COC + SHA256",            ref_doc: "QC-DOC-MS-02 rev B", spec: "Hash match · cert ≤ 30 d",     effect_if_failed: "Receiving hold",             severity: "high"     },
    { gate_id: "QG-MS-03", station: "r2", ctq_param: "Granite base flatness post-lap",   instrument: "Zeiss UPMC 850 CMM",           ref_doc: "QC-DIM-MS-06 rev D", spec: "±3 µm (Rev D · ECO-MS-0017)",  effect_if_failed: "Auto-NCR · re-grind cycle",  severity: "critical" },
    { gate_id: "QG-MS-04", station: "r2", ctq_param: "Cross-beam flatness post-lap",     instrument: "Zeiss UPMC 850 CMM",           ref_doc: "QC-DIM-MS-07 rev D", spec: "±3 µm (Rev D · ECO-MS-0017)",  effect_if_failed: "Auto-NCR · re-grind cycle",  severity: "critical" },
    { gate_id: "QG-MS-05", station: "r3", ctq_param: "X-carriage way Ø bore",            instrument: "Zeiss UPMC 850 CMM",           ref_doc: "QC-DIM-MS-12 rev C", spec: "H7 ±10 µm",                    effect_if_failed: "Bearing fit reject",         severity: "high"     },
    { gate_id: "QG-MS-06", station: "r3", ctq_param: "Y-bridge column squareness",       instrument: "Faro Vantage laser tracker",   ref_doc: "QC-GEO-MS-02 rev B", spec: "≤ 8 µm/m",                     effect_if_failed: "Geometry NCR",               severity: "high"     },
    { gate_id: "QG-MS-07", station: "r3", ctq_param: "Z-ram parallelism",                instrument: "Faro Vantage laser tracker",   ref_doc: "QC-GEO-MS-03 rev B", spec: "≤ 6 µm/m",                     effect_if_failed: "Geometry NCR",               severity: "high"     },
    { gate_id: "QG-MS-08", station: "r3", ctq_param: "Ball-screw axial play (X/Y/Z)",    instrument: "DTI + load fixture 500 N",     ref_doc: "QC-MEC-MS-04 rev A", spec: "≤ 2 µm",                       effect_if_failed: "Backlash NCR",               severity: "med"      },
    { gate_id: "QG-MS-09", station: "r4", ctq_param: "Spindle nose run-out @ 24k rpm",   instrument: "Faro Vantage + IEPE sensor",   ref_doc: "QC-MEC-MS-08 rev C", spec: "≤ 4 µm TIR",                   effect_if_failed: "Auto-NCR · spindle re-seat", severity: "critical" },
    { gate_id: "QG-MS-10", station: "r4", ctq_param: "C-axis to spindle nose alignment", instrument: "Faro Vantage laser tracker",   ref_doc: "QC-GEO-MS-05 rev B", spec: "≤ 0.005°",                     effect_if_failed: "Geometry NCR",               severity: "critical" },
    { gate_id: "QG-MS-11", station: "r4", ctq_param: "A-axis tilt repeatability",        instrument: "Heidenhain LC 415 + tracker",  ref_doc: "QC-GEO-MS-06 rev A", spec: "≤ 0.003°",                     effect_if_failed: "Repeatability NCR",          severity: "high"     },
    { gate_id: "QG-MS-12", station: "r5", ctq_param: "IR test 500V DC (drives)",         instrument: "Megger MIT420 / 1 kV",         ref_doc: "QC-ELE-MS-02 rev B", spec: "≥ 100 MΩ",                     effect_if_failed: "Insulation NCR",             severity: "critical" },
    { gate_id: "QG-MS-13", station: "r5", ctq_param: "HV test 1500V AC 60s",             instrument: "Hipot tester 5 kV",            ref_doc: "QC-ELE-MS-03 rev B", spec: "No breakdown",                 effect_if_failed: "Field shock risk",           severity: "critical" },
    { gate_id: "QG-MS-14", station: "r5", ctq_param: "Earth bond continuity",            instrument: "Bond tester 25A",              ref_doc: "QC-ELE-MS-05 rev A", spec: "< 0.1 Ω",                      effect_if_failed: "Shock hazard",               severity: "critical" },
    { gate_id: "QG-MS-15", station: "r5", ctq_param: "Drive parameter dump match",       instrument: "Sinamics Starter file diff",   ref_doc: "QC-ELE-MS-08 rev A", spec: "Hash match Rev D pack",        effect_if_failed: "Configuration NCR",          severity: "high"     },
    { gate_id: "QG-MS-16", station: "r6", ctq_param: "ISO 230-2 positional accuracy A",  instrument: "Renishaw XL-80 laser",         ref_doc: "QC-GEO-MS-10 rev C", spec: "A ≤ 8 µm full stroke",         effect_if_failed: "Acceptance fail",            severity: "critical" },
    { gate_id: "QG-MS-17", station: "r6", ctq_param: "ISO 230-2 repeatability R",        instrument: "Renishaw XL-80 laser",         ref_doc: "QC-GEO-MS-11 rev C", spec: "R ≤ 4 µm",                     effect_if_failed: "Acceptance fail",            severity: "critical" },
    { gate_id: "QG-MS-18", station: "r6", ctq_param: "Ballbar circularity (XY/YZ/ZX)",   instrument: "Renishaw QC20-W ballbar",      ref_doc: "QC-GEO-MS-13 rev B", spec: "≤ 6 µm circular dev",          effect_if_failed: "Acceptance fail",            severity: "critical" },
    { gate_id: "QG-MS-19", station: "r6", ctq_param: "Vibration RMS @ 12k rpm contour",  instrument: "IEPE accel · 0-10 kHz",        ref_doc: "QC-MEC-MS-12 rev D", spec: "≤ 0.8 mm/s RMS · ship-hold > 1.0", effect_if_failed: "Ship-hold + CAPA",        severity: "critical" },
    { gate_id: "QG-MS-20", station: "r6", ctq_param: "Acoustic dB(A) @ 1m",              instrument: "Class-1 sound level meter",    ref_doc: "QC-EHS-MS-02 rev A", spec: "≤ 78 dB(A)",                   effect_if_failed: "EHS NCR",                    severity: "med"      },
    { gate_id: "QG-MS-21", station: "r6", ctq_param: "Customer witness signature",       instrument: "Traveler PDF + signed PDF",    ref_doc: "QC-DOC-MS-05 rev A", spec: "MAHLE rep e-sig present",      effect_if_failed: "Acceptance hold",            severity: "high"     },
    { gate_id: "QG-MS-22", station: "r6", ctq_param: "FAI dossier hash on chain",        instrument: "Forge ledger envelope",        ref_doc: "QC-DOC-MS-06 rev A", spec: "Hash chain valid",             effect_if_failed: "Audit hold",                 severity: "high"     },
  ],

  // ── PFMEA · 8 dominant modes for MTL-220 ──────────────────────────
  pfmea: [
    { mode: "Granite flatness drift on lap",           effect: "Vibration > 0.8 mm/s RMS in field",       cause: "Single-pass lap insufficient on 1.8 m beam", S: 9, O: 4, D: 4, RPN: 144, current_control: "QG-MS-03/04 + QG-MS-19", recommended_action: "ECO-MS-0017 · two-pass with re-grind (open)" },
    { mode: "Spindle nose run-out > 4 µm",             effect: "Surface finish reject in customer parts", cause: "Bearing pre-load loss / dirt in seat",        S: 8, O: 2, D: 3, RPN: 48,  current_control: "QG-MS-09 + run-out chart",         recommended_action: "Cleanroom seat assembly + signed pre-load curve" },
    { mode: "Ball-screw backlash > 2 µm",              effect: "Position error in finishing pass",        cause: "Pre-load slack on Ø50 nut",                   S: 7, O: 2, D: 4, RPN: 56,  current_control: "QG-MS-08",                          recommended_action: "Move to double-nut pre-loaded screws on Z" },
    { mode: "Encoder reference shift after transport", effect: "First-piece geometry NCR",                cause: "Mechanical shock on shipping pallet",          S: 6, O: 3, D: 3, RPN: 54,  current_control: "On-site re-reference SOP",          recommended_action: "Add shipping shock-watch labels" },
    { mode: "Cabinet harness mis-pin (PROFINET)",      effect: "Drive fault on commission",               cause: "Manual harness build error",                  S: 5, O: 2, D: 2, RPN: 20,  current_control: "QG-MS-15 + first-piece check",      recommended_action: "Pull pre-form harnesses with QR labels" },
    { mode: "Tool-clamp drawbar load drift",           effect: "Tool pull-out at high feed",              cause: "Belleville stack relaxation",                 S: 8, O: 2, D: 3, RPN: 48,  current_control: "Drawbar load logged at FAI",        recommended_action: "Add 6-month re-cal interval to maintenance" },
    { mode: "Coolant pump cavitation",                 effect: "Tool wear, surface finish reject",        cause: "Filter clog / wrong coolant level",           S: 4, O: 4, D: 2, RPN: 32,  current_control: "Pressure sensor 80.05 + SCADA",     recommended_action: "Tie level switch into TNC alarm" },
    { mode: "Door interlock false-positive",           effect: "Production stop, no safety",              cause: "Sensor alignment drift",                       S: 3, O: 3, D: 2, RPN: 18,  current_control: "EN ISO 14119 self-test on power-up", recommended_action: "Replace mechanical interlock with magnetic safety" },
  ],

  // ── Suppliers · master with on-time-% history ─────────────────────
  suppliers: [
    { id: "SUP-MS-01", name: "Heidenhain",      category: "CNC controls + linear encoders",     location: "Traunreut, DE",      lead_time_days: 45,  audit_score_pct: 96, last_audit: "2026-01-22", on_time_pct: 98, status: "approved",   parts_supplied: ["20.03","30.03","40.05","70.01","70.07"], iso: "IATF 16949" },
    { id: "SUP-MS-02", name: "Kessler",         category: "Tilting heads + rotary tables",      location: "Bad Buchau, DE",     lead_time_days: 90,  audit_score_pct: 92, last_audit: "2025-11-08", on_time_pct: 91, status: "approved",   parts_supplied: ["50.00","50.03","50.05"],                 iso: "ISO 9001" },
    { id: "SUP-MS-03", name: "GMN",             category: "Precision spindles · HSK-A63",       location: "Nürnberg, DE",       lead_time_days: 180, audit_score_pct: 94, last_audit: "2026-02-14", on_time_pct: 86, status: "approved · sole-source", parts_supplied: ["50.01","50.09","50.10"],     iso: "ISO 9001" },
    { id: "SUP-MS-04", name: "Bosch Rexroth",   category: "Linear guides + hydraulics",         location: "Lohr am Main, DE",   lead_time_days: 42,  audit_score_pct: 89, last_audit: "2026-03-04", on_time_pct: 93, status: "approved",   parts_supplied: ["10.06","20.01","20.07","40.02","60.02","80.05"], iso: "IATF 16949" },
    { id: "SUP-MS-05", name: "Siemens",         category: "Sinamics drives + servo motors",     location: "Erlangen, DE",       lead_time_days: 50,  audit_score_pct: 95, last_audit: "2026-01-30", on_time_pct: 96, status: "approved",   parts_supplied: ["20.04","30.04","40.04","50.02","60.04","70.02","70.04","70.05"], iso: "IATF 16949" },
    { id: "SUP-MS-06", name: "NSK",             category: "Ball-screws · IT5",                  location: "Ratingen, DE",       lead_time_days: 90,  audit_score_pct: 88, last_audit: "2025-12-12", on_time_pct: 84, status: "approved",   parts_supplied: ["20.02","40.01"],                         iso: "IATF 16949" },
    { id: "SUP-MS-07", name: "Hiwin",           category: "Ball-screws · alt-source",           location: "Offenburg, DE",      lead_time_days: 90,  audit_score_pct: 85, last_audit: "2026-02-20", on_time_pct: 81, status: "conditional", parts_supplied: ["30.02"],                                iso: "ISO 9001" },
    { id: "SUP-MS-08", name: "Schaeffler",      category: "Bearings · cross-roller / YRT",      location: "Herzogenaurach, DE", lead_time_days: 70,  audit_score_pct: 93, last_audit: "2026-02-04", on_time_pct: 95, status: "approved",   parts_supplied: ["10.03","30.01","50.06","50.07"],         iso: "IATF 16949" },
    { id: "SUP-MS-09", name: "Omron",           category: "Safety relays + RFID + interlocks",  location: "Hoofddorp, NL",      lead_time_days: 18,  audit_score_pct: 90, last_audit: "2025-10-18", on_time_pct: 97, status: "approved",   parts_supplied: ["60.05","70.03","90.03","90.06"],         iso: "ISO 9001" },
    { id: "SUP-MS-10", name: "DMG Mori",        category: "ATC carousels + HSK toolholders",    location: "Bielefeld, DE",      lead_time_days: 55,  audit_score_pct: 87, last_audit: "2026-03-18", on_time_pct: 89, status: "approved",   parts_supplied: ["50.04","60.00","60.03"],                 iso: "ISO 9001" },
  ],

  // ── Vendor Audit Template (German precision-engineering flavor) ──
  vendor_audit_template: {
    name: "VQP-MS 2.0 — Vendor Qualification Protocol (IATF-aligned)",
    rev: "2.0",
    tabs: [
      { tab: "Legal / Statutory", criteria: [
        { id: "L01", text: "Handelsregister entry valid · current Auszug" },
        { id: "L02", text: "ISO 9001:2015 certificate · in date" },
        { id: "L03", text: "IATF 16949:2016 certificate (if automotive supply)" },
        { id: "L04", text: "Sicherheitsdatenblatt (SDS) per REACH for all chemicals" },
        { id: "L05", text: "Maschinenrichtlinie 2006/42/EC compliance" },
        { id: "L06", text: "Conflict-minerals (3TG) declaration · current" },
      ]},
      { tab: "QMS", criteria: [
        { id: "Q01", text: "ISO 9001 §8.3 design control records" },
        { id: "Q02", text: "Calibration records · DIN EN ISO/IEC 17025 lab traceable" },
        { id: "Q03", text: "PPAP Level 3 capability for new-part submissions" },
        { id: "Q04", text: "MSA Cmk ≥ 1.67 evidence on critical CTQs" },
        { id: "Q05", text: "Cp / Cpk ≥ 1.33 on form/fit/function dimensions" },
        { id: "Q06", text: "8D problem-solving discipline · CAPA closure ≤ 30 d" },
        { id: "Q07", text: "Layered process audits (LPA) cadence" },
        { id: "Q08", text: "Internal audit programme · annual" },
        { id: "Q09", text: "Document control & revision history" },
        { id: "Q10", text: "Customer complaint log + trend analysis" },
        { id: "Q11", text: "Lot traceability · forward + backward · ≥ 10 y retention" },
        { id: "Q12", text: "FAI per AS9102 / IATF FAI form set" },
      ]},
      { tab: "EHS", criteria: [
        { id: "E01", text: "Gefährdungsbeurteilung (risk assessment) per ArbSchG" },
        { id: "E02", text: "PSA (PPE) issuance logs" },
        { id: "E03", text: "Brandschutzordnung + drills (semi-annual)" },
        { id: "E04", text: "REACH / RoHS material declarations on file" },
        { id: "E05", text: "Hazardous waste manifest log" },
        { id: "E06", text: "Noise / dust exposure monitoring · annual" },
        { id: "E07", text: "Maschinenschutz + LOTO compliance" },
      ]},
      { tab: "Process", criteria: [
        { id: "P01", text: "Process flow diagram up to date" },
        { id: "P02", text: "Control plan · per CTQ with reaction plan" },
        { id: "P03", text: "Tooling change protocol & first-piece approval" },
        { id: "P04", text: "Setup approval before production run" },
        { id: "P05", text: "In-process inspection cadence defined" },
        { id: "P06", text: "Final inspection per AQL plan" },
        { id: "P07", text: "Quarantine area for non-conforming material" },
        { id: "P08", text: "Heat treatment / surface finish records" },
        { id: "P09", text: "Material certificates (Werkzeugnis 3.1) per EN 10204" },
        { id: "P10", text: "Tool life monitoring & replacement triggers" },
      ]},
    ],
  },

  // ── Audit case · GMN spindle audit (sole-source narrative) ────────
  audit_case: {
    supplier: "GMN Paul Müller Industrie GmbH",
    auditor: "S. Klein",
    score_pct: 94,
    status: "approved · sole-source",
    date: "2026-02-14",
    notes: "Strong on capability (Cmk 2.1 on HSK-A63 nose run-out). Sole-source risk surfaces as calculated capacity panel; alternative sourcing not pursued due to 18-month qualification cycle and IATF re-PPAP cost.",
    tabs: [
      { tab: "Legal / Statutory", score_pct: 100, findings: [
        { id: "L01", result: "pass", note: "HRB 1842 Nürnberg current" },
        { id: "L02", result: "pass", note: "ISO 9001 valid till 2027-09" },
        { id: "L04", result: "pass" },
        { id: "L05", result: "pass" },
        { id: "L06", result: "pass" },
      ]},
      { tab: "QMS", score_pct: 92, findings: [
        { id: "Q01", result: "pass" },
        { id: "Q02", result: "pass" },
        { id: "Q03", result: "pass", note: "PPAP Level 3 on file" },
        { id: "Q04", result: "pass", note: "Cmk 2.1 on nose run-out" },
        { id: "Q05", result: "pass", note: "Cpk 1.78 on bearing seat" },
        { id: "Q06", result: "partial", note: "CAPA average 34 d vs 30 d target" },
        { id: "Q07", result: "pass" },
        { id: "Q11", result: "pass" },
        { id: "Q12", result: "pass" },
      ]},
      { tab: "Process", score_pct: 96, findings: [
        { id: "P01", result: "pass" },
        { id: "P02", result: "pass" },
        { id: "P09", result: "pass", note: "EN 10204 3.1 certs on every shipment" },
        { id: "P10", result: "pass" },
      ]},
      { tab: "EHS", score_pct: 90, findings: [
        { id: "E01", result: "pass" },
        { id: "E04", result: "pass" },
        { id: "E07", result: "partial", note: "LOTO drill log Q3-25 missing" },
      ]},
    ],
  },

  // ── Work orders · 24 mills (WO-MTL-2401..2424) ────────────────────
  work_orders: [
    // ─ Batch 1 (12 units · ship 2026-08 → 2026-12) ─
    { id: "WO-MTL-2401", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B1", status: "in-progress", scheduled_start: "2025-12-08", scheduled_end: "2026-08-14", station_progress: { r1: 1.0, r2: 1.0, r3: 1.0, r4: 0.85, r5: 0.40, r6: 0.10 }, serial: "MTL-220-0095", note: "FAI unit · target 2026-08-14" },
    { id: "WO-MTL-2402", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B1", status: "in-progress", scheduled_start: "2025-12-15", scheduled_end: "2026-08-28", station_progress: { r1: 1.0, r2: 1.0, r3: 0.92, r4: 0.45, r5: 0.10, r6: 0 },   serial: "MTL-220-0096" },
    { id: "WO-MTL-2403", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B1", status: "in-progress", scheduled_start: "2026-01-05", scheduled_end: "2026-09-11", station_progress: { r1: 1.0, r2: 1.0, r3: 0.78, r4: 0.20, r5: 0,    r6: 0 },   serial: "MTL-220-0097" },
    { id: "WO-MTL-2404", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B1", status: "in-progress", scheduled_start: "2026-01-19", scheduled_end: "2026-09-25", station_progress: { r1: 1.0, r2: 0.85, r3: 0.45, r4: 0,    r5: 0,    r6: 0 },   serial: "MTL-220-0098" },
    { id: "WO-MTL-2405", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B1", status: "in-progress", scheduled_start: "2026-02-02", scheduled_end: "2026-10-09", station_progress: { r1: 1.0, r2: 0.70, r3: 0.20, r4: 0,    r5: 0,    r6: 0 },   serial: "MTL-220-0099" },
    { id: "WO-MTL-2406", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B1", status: "in-progress", scheduled_start: "2026-02-16", scheduled_end: "2026-10-23", station_progress: { r1: 1.0, r2: 0.55, r3: 0,    r4: 0,    r5: 0,    r6: 0 },   serial: "MTL-220-0100" },
    { id: "WO-MTL-2407", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B1", status: "scheduled",   scheduled_start: "2026-03-02", scheduled_end: "2026-11-06", station_progress: { r1: 0.30, r2: 0,   r3: 0,   r4: 0, r5: 0, r6: 0 },                  serial: "MTL-220-0101" },
    { id: "WO-MTL-2408", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B1", status: "scheduled",   scheduled_start: "2026-03-16", scheduled_end: "2026-11-20", station_progress: { r1: 0,    r2: 0,   r3: 0,   r4: 0, r5: 0, r6: 0 },                  serial: "MTL-220-0102" },
    { id: "WO-MTL-2409", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B1", status: "scheduled",   scheduled_start: "2026-03-30", scheduled_end: "2026-12-04", station_progress: { r1: 0,    r2: 0,   r3: 0,   r4: 0, r5: 0, r6: 0 },                  serial: "MTL-220-0103" },
    { id: "WO-MTL-2410", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B1", status: "scheduled",   scheduled_start: "2026-04-13", scheduled_end: "2026-12-11", station_progress: { r1: 0,    r2: 0,   r3: 0,   r4: 0, r5: 0, r6: 0 },                  serial: "MTL-220-0104" },
    { id: "WO-MTL-2411", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B1", status: "scheduled",   scheduled_start: "2026-04-27", scheduled_end: "2026-12-18", station_progress: { r1: 0,    r2: 0,   r3: 0,   r4: 0, r5: 0, r6: 0 },                  serial: "MTL-220-0105" },
    { id: "WO-MTL-2412", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B1", status: "planned",     scheduled_start: "2026-05-11", scheduled_end: "2026-12-22", station_progress: { r1: 0,    r2: 0,   r3: 0,   r4: 0, r5: 0, r6: 0 },                  serial: "MTL-220-0106" },

    // ─ Batch 2 (12 units · ship 2027-01 → 2027-06; long-lead released 2026-01) ─
    { id: "WO-MTL-2413", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B2", status: "planned",     scheduled_start: "2026-06-08", scheduled_end: "2027-01-15", station_progress: { r1: 0, r2: 0, r3: 0, r4: 0, r5: 0, r6: 0 }, serial: "MTL-220-0107" },
    { id: "WO-MTL-2414", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B2", status: "planned",     scheduled_start: "2026-06-22", scheduled_end: "2027-01-29", station_progress: { r1: 0, r2: 0, r3: 0, r4: 0, r5: 0, r6: 0 }, serial: "MTL-220-0108" },
    { id: "WO-MTL-2415", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B2", status: "planned",     scheduled_start: "2026-07-06", scheduled_end: "2027-02-12", station_progress: { r1: 0, r2: 0, r3: 0, r4: 0, r5: 0, r6: 0 }, serial: "MTL-220-0109" },
    { id: "WO-MTL-2416", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B2", status: "planned",     scheduled_start: "2026-07-20", scheduled_end: "2027-02-26", station_progress: { r1: 0, r2: 0, r3: 0, r4: 0, r5: 0, r6: 0 }, serial: "MTL-220-0110" },
    { id: "WO-MTL-2417", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B2", status: "planned",     scheduled_start: "2026-08-03", scheduled_end: "2027-03-12", station_progress: { r1: 0, r2: 0, r3: 0, r4: 0, r5: 0, r6: 0 }, serial: "MTL-220-0111" },
    { id: "WO-MTL-2418", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B2", status: "planned",     scheduled_start: "2026-08-17", scheduled_end: "2027-03-26", station_progress: { r1: 0, r2: 0, r3: 0, r4: 0, r5: 0, r6: 0 }, serial: "MTL-220-0112" },
    { id: "WO-MTL-2419", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B2", status: "planned",     scheduled_start: "2026-08-31", scheduled_end: "2027-04-09", station_progress: { r1: 0, r2: 0, r3: 0, r4: 0, r5: 0, r6: 0 }, serial: "MTL-220-0113" },
    { id: "WO-MTL-2420", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B2", status: "planned",     scheduled_start: "2026-09-14", scheduled_end: "2027-04-23", station_progress: { r1: 0, r2: 0, r3: 0, r4: 0, r5: 0, r6: 0 }, serial: "MTL-220-0114" },
    { id: "WO-MTL-2421", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B2", status: "planned",     scheduled_start: "2026-09-28", scheduled_end: "2027-05-07", station_progress: { r1: 0, r2: 0, r3: 0, r4: 0, r5: 0, r6: 0 }, serial: "MTL-220-0115" },
    { id: "WO-MTL-2422", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B2", status: "planned",     scheduled_start: "2026-10-12", scheduled_end: "2027-05-21", station_progress: { r1: 0, r2: 0, r3: 0, r4: 0, r5: 0, r6: 0 }, serial: "MTL-220-0116" },
    { id: "WO-MTL-2423", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B2", status: "planned",     scheduled_start: "2026-10-26", scheduled_end: "2027-06-04", station_progress: { r1: 0, r2: 0, r3: 0, r4: 0, r5: 0, r6: 0 }, serial: "MTL-220-0117" },
    { id: "WO-MTL-2424", sku: "MTL-220.RD", customer: "MAHLE Industriebeteiligungen GmbH", qty: 1, batch: "B2", status: "planned",     scheduled_start: "2026-11-09", scheduled_end: "2027-06-18", station_progress: { r1: 0, r2: 0, r3: 0, r4: 0, r5: 0, r6: 0 }, serial: "MTL-220-0118" },
  ],

  // ── Travelers · in-flight units (S/N 0095..0102 Rev D) ────────────
  travelers: [
    { serial: "MTL-220-0095", wo: "WO-MTL-2401", current_station: "r6", completed_stations: ["r1","r2","r3","r4","r5"], dimensions: { granite_base_flatness_um: 2.4, granite_beam_flatness_um: 2.6, spindle_runout_um: 3.1, c_to_spindle_deg: 0.003, iso230_2_A_um: 6.8, iso230_2_R_um: 3.2, ballbar_circ_um: 4.4, vib_rms_mmps_12k: 0.41 }, photos: ["/photos/MTL-220-0095-granite.jpg","/photos/MTL-220-0095-spindle.jpg","/photos/MTL-220-0095-ballbar.png"], status: "fai-pending", traveler_pdf: "TRV-MS-0244" },
    { serial: "MTL-220-0096", wo: "WO-MTL-2402", current_station: "r4", completed_stations: ["r1","r2","r3"], dimensions: { granite_base_flatness_um: 2.7, granite_beam_flatness_um: 2.8, spindle_runout_um: null, c_to_spindle_deg: null, iso230_2_A_um: null, iso230_2_R_um: null, ballbar_circ_um: null, vib_rms_mmps_12k: null }, photos: ["/photos/MTL-220-0096-cmm.jpg"], status: "ok" },
    { serial: "MTL-220-0097", wo: "WO-MTL-2403", current_station: "r3", completed_stations: ["r1","r2"], dimensions: { granite_base_flatness_um: 2.5, granite_beam_flatness_um: 2.9, spindle_runout_um: null, c_to_spindle_deg: null, iso230_2_A_um: null, iso230_2_R_um: null, ballbar_circ_um: null, vib_rms_mmps_12k: null }, photos: ["/photos/MTL-220-0097-lap.jpg"], status: "ok" },
    { serial: "MTL-220-0098", wo: "WO-MTL-2404", current_station: "r2", completed_stations: ["r1"], dimensions: { granite_base_flatness_um: 4.1, granite_beam_flatness_um: null }, photos: [], status: "hold", hold_reason: "Granite base post-rough lap measured 4.1 µm — pending re-grind cycle (ECO-MS-0017 path)" },
    { serial: "MTL-220-0099", wo: "WO-MTL-2405", current_station: "r2", completed_stations: ["r1"], dimensions: { granite_base_flatness_um: null, granite_beam_flatness_um: null }, photos: ["/photos/MTL-220-0099-blank.jpg"], status: "ok" },
    { serial: "MTL-220-0100", wo: "WO-MTL-2406", current_station: "r1", completed_stations: [],     dimensions: { granite_blank_coc_hash: "0x9af4...c218" }, photos: [], status: "ok" },
  ],

  // ── ECO list · ECO-MS-0017 (hero) + 3 background ──────────────────
  eco: [
    {
      id: "ECO-MS-0017",
      title: "Granite-bed flatness tightening · Rev C → Rev D",
      originator: "R. Vogt",
      status: "in-review",
      date_raised: "2025-11-04",
      date_target_close: "2026-05-30",
      justification: "Three field returns (S/N 0089, 0091, 0094) reported vibration > 0.8 mm/s RMS at 12k rpm contouring. Root-cause analysis traced to granite cross-beam flatness drift across the 1.8 m beam under thermal cycling. Single-pass lap insufficient — Rev D adds re-grind operation between rough and finish lapping.",
      parts_affected: [
        { old: "10.01 (±5 µm flatness)",  new: "10.01D (±3 µm flatness · re-ground)" },
        { old: "10.02 (±5 µm flatness)",  new: "10.02D (±3 µm flatness · re-ground)" },
      ],
      spec_before: "Flatness ±5 µm · single-pass lap",
      spec_after:  "Flatness ±3 µm · two-pass lap with re-grind between rough and finish",
      cost_delta_eur_per_unit: 820,
      cost_delta_eur_total: 19680, // 24 × 820
      lead_time_delta_days: 11,
      net_program_slip_days: 0, // spindle remains critical at 180 d
      compliance: ["IATF 16949 §8.5.6 (Change Control)", "ISO 9001 §8.3.6 (Design Changes)", "PPAP Level 3 re-submission required"],
      approval_chain: [
        { role: "Engineering Lead",     name: "R. Vogt",   at: "2025-11-04", status: "approved" },
        { role: "Manufacturing Lead",   name: "D. Becker", at: "2025-11-18", status: "approved" },
        { role: "Quality Lead",         name: "S. Klein",  at: null,         status: "pending · awaiting CMM gauge R&R" },
        { role: "Plant Director",       name: "K. Hofer",  at: null,         status: "pending" },
      ],
      conversation: [
        { ts: "2025-11-04T09:12Z", from: "R. Vogt",   to: "D. Becker", text: "Rev C field-return data conclusive. Tightening 10.01/10.02 to ±3 µm. Need granite cell re-routing." },
        { ts: "2025-11-06T14:30Z", from: "D. Becker", to: "R. Vogt",   text: "Routing rework feasible. Re-grind op adds ~11 d. We can absorb against the 180 d spindle critical path." },
        { ts: "2025-11-12T11:05Z", from: "S. Klein",  to: "R. Vogt",   text: "Need MSA Cmk ≥ 1.67 on the Zeiss UPMC for ±3 µm. Running gauge R&R this week." },
        { ts: "2025-11-18T08:45Z", from: "D. Becker", to: "ALL",       text: "Manufacturing signs off. PPAP-3 dossier in motion." },
        { ts: "2025-11-25T16:20Z", from: "S. Klein",  to: "R. Vogt",   text: "Cmk run pending — measurement uncertainty calc still open. Holding sign-off until 2026-01." },
      ],
      linked_returns: ["RMA-MS-2024-031", "RMA-MS-2024-038", "RMA-MS-2024-042"],
      linked_ncrs:    ["NCR-MS-0241",      "NCR-MS-0252",      "NCR-MS-0259"],
    },
    {
      id: "ECO-MS-0014",
      title: "Heidenhain encoder firmware bump · LC 415 v3.4 → v3.6",
      originator: "K. Hofer",
      status: "approved",
      date_raised: "2025-09-22",
      date_approved: "2025-10-08",
      justification: "Heidenhain field bulletin · v3.4 has known reference-pulse drift after thermal cycling. v3.6 fixes; firmware-only change, no hardware delta.",
      parts_affected: [
        { old: "20.03 / 30.03 / 40.05 firmware v3.4", new: "v3.6 (rolling update)" },
      ],
      cost_delta_eur_per_unit: 0,
      lead_time_delta_days: 0,
      compliance: ["ISO 9001 §8.5.6"],
      approval_chain: [
        { role: "Engineering Lead",  name: "R. Vogt",   at: "2025-09-22", status: "approved" },
        { role: "Quality Lead",      name: "S. Klein",  at: "2025-10-08", status: "approved" },
      ],
    },
    {
      id: "ECO-MS-0015",
      title: "ATC carousel pickup arm bushing material upgrade",
      originator: "D. Becker",
      status: "approved",
      date_raised: "2025-10-14",
      date_approved: "2025-12-02",
      justification: "Bronze bushing wear at >18k cycles caused 0.04 mm position drift. Upgrade to PTFE-lined steel bushing extends life to >50k cycles.",
      parts_affected: [
        { old: "60.01 bronze bushing", new: "60.01 PTFE-lined steel bushing" },
      ],
      cost_delta_eur_per_unit: 38,
      lead_time_delta_days: 0,
      compliance: ["IATF 16949 §8.5.6"],
      approval_chain: [
        { role: "Manufacturing Lead", name: "D. Becker", at: "2025-10-14", status: "approved" },
        { role: "Engineering Lead",   name: "R. Vogt",   at: "2025-11-08", status: "approved" },
        { role: "Quality Lead",       name: "S. Klein",  at: "2025-12-02", status: "approved" },
      ],
    },
    {
      id: "ECO-MS-0016",
      title: "Operator panel software TNC 640 · 2026 cycle pack",
      originator: "K. Hofer",
      status: "approved",
      date_raised: "2025-12-10",
      date_approved: "2026-02-04",
      justification: "Heidenhain 2026 cycle pack — adds adaptive-feed contouring for granite roughing. Forward-compatible.",
      parts_affected: [
        { old: "70.01 cycle pack 2024", new: "70.01 cycle pack 2026" },
      ],
      cost_delta_eur_per_unit: 0,
      lead_time_delta_days: 0,
      compliance: ["ISO 9001 §8.5.6"],
      approval_chain: [
        { role: "Engineering Lead",  name: "R. Vogt",   at: "2025-12-10", status: "approved" },
        { role: "Quality Lead",      name: "S. Klein",  at: "2026-02-04", status: "approved" },
      ],
    },
  ],

  // ── NCR table · seeded from 3 Rev C field returns ─────────────────
  ncrs: [
    {
      id: "NCR-MS-0241",
      raised_at: "2024-09-12",
      source: "field-return",
      reference: "RMA-MS-2024-031",
      part_num: "10.02",
      description: "Cross-beam flatness drift measured 6.4 µm at customer site after 4-month service · vibration 1.18 mm/s RMS at 12k rpm contouring",
      severity: "critical",
      status: "closed-with-CAPA",
      capa_id: "CAPA-MS-0241",
      capa_summary: "Root-cause: single-pass lap insufficient. CAPA: feeds into ECO-MS-0017.",
      closed_at: "2025-11-04",
    },
    {
      id: "NCR-MS-0252",
      raised_at: "2024-10-04",
      source: "field-return",
      reference: "RMA-MS-2024-038",
      part_num: "10.01",
      description: "Granite base flatness drift measured 5.9 µm at customer site after 6-month service · vibration 1.04 mm/s RMS at 12k rpm",
      severity: "critical",
      status: "closed-with-CAPA",
      capa_id: "CAPA-MS-0252",
      capa_summary: "Same family as NCR-MS-0241 · linked to ECO-MS-0017.",
      closed_at: "2025-11-04",
    },
    {
      id: "NCR-MS-0259",
      raised_at: "2024-11-18",
      source: "field-return",
      reference: "RMA-MS-2024-042",
      part_num: "10.02",
      description: "Cross-beam flatness 7.1 µm at customer site after 8-month service · vibration 1.31 mm/s RMS · ship-hold threshold breached",
      severity: "critical",
      status: "closed-with-CAPA",
      capa_id: "CAPA-MS-0259",
      capa_summary: "Confirmed pattern across 3 returns · ECO-MS-0017 raised.",
      closed_at: "2025-11-04",
    },
    {
      id: "NCR-MS-0301",
      raised_at: "2026-04-22",
      source: "incoming-inspection",
      reference: "WO-MTL-2404",
      part_num: "10.01",
      description: "Granite base post-rough-lap measured 4.1 µm — exceeds rough-lap intermediate target of 3.5 µm",
      severity: "med",
      status: "open",
      capa_id: "CAPA-MS-0301",
      capa_summary: "Disposition: re-grind cycle per ECO-MS-0017 routing. Expected to recover.",
    },
  ],

  // ── Field returns (3 Rev C returns that drove ECO-MS-0017) ────────
  field_returns: [
    { rma: "RMA-MS-2024-031", serial: "MTL-220-0089", date_returned: "2024-09-12", customer: "MAHLE Industriebeteiligungen GmbH · Stuttgart-Bad Cannstatt plant", failure: "Vibration 1.18 mm/s RMS at 12k rpm contour · cross-beam flatness 6.4 µm", root_cause: "Granite flatness drift under thermal cycling · single-pass lap", linked_eco: "ECO-MS-0017", linked_ncr: "NCR-MS-0241" },
    { rma: "RMA-MS-2024-038", serial: "MTL-220-0091", date_returned: "2024-10-04", customer: "MAHLE Industriebeteiligungen GmbH · Wernigerode plant",            failure: "Vibration 1.04 mm/s RMS at 12k rpm contour · base flatness 5.9 µm",       root_cause: "Granite flatness drift under thermal cycling · single-pass lap", linked_eco: "ECO-MS-0017", linked_ncr: "NCR-MS-0252" },
    { rma: "RMA-MS-2024-042", serial: "MTL-220-0094", date_returned: "2024-11-18", customer: "MAHLE Industriebeteiligungen GmbH · Mühlacker plant",               failure: "Vibration 1.31 mm/s RMS at 12k rpm · ship-hold threshold breached",       root_cause: "Granite flatness drift under thermal cycling · single-pass lap", linked_eco: "ECO-MS-0017", linked_ncr: "NCR-MS-0259" },
  ],

  // ── Compliance (per spec §7) ──────────────────────────────────────
  compliance: {
    standards: [
      { name: "ISO 9001:2015",                          applicable: true, clauses: ["8.3 design control", "8.5.6 change control", "9.1 monitoring"], status: "compliant" },
      { name: "IATF 16949:2016",                        applicable: true, clauses: ["8.3.4 design verification", "8.5.6 change control"],            status: "compliant", note: "PPAP Level 3 mandatory for spec changes affecting form/fit/function" },
      { name: "EN ISO 230-1",                           applicable: true, clauses: ["§5.4 geometric accuracy"],                                        status: "compliant" },
      { name: "EN ISO 230-2",                           applicable: true, clauses: ["positional accuracy A · repeatability R"],                       status: "compliant" },
      { name: "EN ISO 230-4",                           applicable: true, clauses: ["circular tests · ballbar"],                                       status: "compliant" },
      { name: "CE / Machinery Directive 2006/42/EC",    applicable: true, clauses: ["Annex I EHSR"],                                                   status: "compliant" },
      { name: "EN 60204-1",                             applicable: true, clauses: ["electrical safety"],                                              status: "compliant" },
      { name: "EN ISO 13849-1",                         applicable: true, clauses: ["safety functions PL-d on E-stop"],                                status: "compliant" },
    ],
    fai_template: {
      name: "FAI per AS9102 form set adapted to IATF 16949",
      forms: ["Form 1 · part accountability", "Form 2 · product accountability", "Form 3 · characteristic accountability"],
      attachments: ["Zeiss UPMC dimensional report", "ISO 230-2 geometric report (Renishaw XL-80)", "QC20-W ballbar circularity", "Vibration RMS log (IEPE)", "Control-system FAT log", "Customer-witnessed traveler PDF"],
    },
    ncr_thresholds: {
      auto_ncr_dim_bust_pct: 50, // > 50% of tolerance band
      vibration_accept_mmps_rms_12k: 0.8,
      vibration_ship_hold_mmps_rms_12k: 1.0,
    },
  },

  // ── Aftermarket / spares catalog ──────────────────────────────────
  aftermarket: [
    { sku: "SP-MS-HSK63",   name: "HSK-A63 toolholder · single",                mrp_eur: 320  },
    { sku: "SP-MS-DRAWBAR", name: "Drawbar Belleville stack · 18 kN",           mrp_eur: 480  },
    { sku: "SP-MS-LCENC",   name: "Heidenhain LC 415 encoder · field-replace",  mrp_eur: 3850 },
    { sku: "SP-MS-WAYCOV-X",name: "Way-cover stainless bellows · X-axis",       mrp_eur: 540  },
    { sku: "SP-MS-WAYCOV-Z",name: "Way-cover telescopic steel · Z-axis",        mrp_eur: 680  },
    { sku: "SP-MS-COOLPMP", name: "Coolant pump 80 L/min 8 bar",                mrp_eur: 1620 },
    { sku: "SP-MS-FILT",    name: "Mist extractor H13 filter cassette",         mrp_eur: 220  },
    { sku: "SP-MS-DOOR-IL", name: "Safety door interlock · magnetic",           mrp_eur: 380  },
    { sku: "SP-MS-VIB",     name: "IEPE vibration sensor · 3-axis spare",       mrp_eur: 820  },
    { sku: "SP-MS-LAPSTONE",name: "Granite lap-stone consumable set",           mrp_eur: 1240 },
  ],

  // ── 22-event signed ledger · MAHLE arc 2025-09 → 2026-12 (per §9) ─
  // Hash-chained envelope per pump pattern. Closes with ACCEPTANCE_SIGNED.
  ledger: [
    { event_id: "L-0001", ts: "2025-09-04T09:12Z", type: "RFQ_RECEIVED",            mode: "forge", actor: "R. Vogt",   summary: "MAHLE call-off entered intake · 24-mill annual frame against MTL-220 platform", ref: "RFQ-MAHLE-2025-024",  hash_prev: null,                       hash: "0xa1f4e2c918d7b5604f3a91c0d8e2f7b3" },
    { event_id: "L-0002", ts: "2025-09-09T11:40Z", type: "DESIGN_MATCH",            mode: "forge", actor: "R. Vogt",   summary: "MTL-220 Rev D platform matched to MAHLE spec · 24k rpm / HSK-A63 / 5-axis",       ref: "MTL-220.RD",          hash_prev: "0xa1f4e2c918d7b5604f3a91c0d8e2f7b3", hash: "0xb27c8fe0294a16d537e9c24b178a3c95" },
    { event_id: "L-0003", ts: "2025-09-15T14:22Z", type: "CARRYOVER_DIFF",          mode: "forge", actor: "R. Vogt",   summary: "Rev C → Rev D delta computed · 4 ECOs in-flight · ECO-MS-0017 critical",         ref: "DIFF-MTL220-RC-RD",   hash_prev: "0xb27c8fe0294a16d537e9c24b178a3c95", hash: "0xc3a8920468f5b7d12ea645f9b384c1d2" },
    { event_id: "L-0004", ts: "2025-09-22T16:08Z", type: "QUOTE_SENT",              mode: "forge", actor: "R. Vogt",   summary: "Quote returned · €384k/unit · €9.22M frame · ECO-MS-0017 cost line +€820/unit",  ref: "QT-MAHLE-2025-024",   hash_prev: "0xc3a8920468f5b7d12ea645f9b384c1d2", hash: "0xd4e07b153a82fc6e914875b2a93c08fa" },
    { event_id: "L-0005", ts: "2025-09-30T10:30Z", type: "FRAME_CONTRACT_SIGNED",   mode: "forge", actor: "R. Vogt",   summary: "Annual frame booked · two-batch schedule locked · DAP Stuttgart-Kornwestheim",   ref: "CTR-MAHLE-2025-MTL220",hash_prev:"0xd4e07b153a82fc6e914875b2a93c08fa", hash: "0xe512a83b497d1c0852f7b4690e8ad732" },
    { event_id: "L-0006", ts: "2025-11-04T09:12Z", type: "ECO_RAISED",              mode: "forge", actor: "R. Vogt",   summary: "ECO-MS-0017 opened against 10.01 / 10.02 · granite flatness ±5 µm → ±3 µm",     ref: "ECO-MS-0017",         hash_prev: "0xe512a83b497d1c0852f7b4690e8ad732", hash: "0xf6c195d028aebf4197d0e832f7ab48c1" },
    { event_id: "L-0007", ts: "2025-11-18T08:45Z", type: "ECO_APPROVED",            mode: "forge", actor: "D. Becker", summary: "ECO-MS-0017 · Engineering + Manufacturing approvals captured · Quality pending", ref: "ECO-MS-0017",         hash_prev: "0xf6c195d028aebf4197d0e832f7ab48c1", hash: "0x07d2a64e391fb50286ce91a5f4b80d1e" },
    { event_id: "L-0008", ts: "2025-11-22T13:20Z", type: "ROUTING_REVISED",         mode: "forge", actor: "D. Becker", summary: "Granite cell routing re-published · re-grind operation between rough and finish lap", ref: "ROUT-MTL220-RD",   hash_prev: "0x07d2a64e391fb50286ce91a5f4b80d1e", hash: "0x18f3b84d502c7e6390b8a23feca5e90a" },
    { event_id: "L-0009", ts: "2025-11-26T15:00Z", type: "GATES_PUBLISHED",         mode: "forge", actor: "S. Klein",  summary: "Quality gates G1-G5 frozen for Rev D batch · 22 CTQ gates published",            ref: "QG-PKG-MTL220-RD",     hash_prev: "0x18f3b84d502c7e6390b8a23feca5e90a", hash: "0x29a4c95f608d3b75a103f2e6fdb09c8b" },
    { event_id: "L-0010", ts: "2026-01-08T08:15Z", type: "LONG_LEAD_PO_RELEASED",   mode: "forge", actor: "K. Hofer",  summary: "Spindle PO to GMN (180 d · €32,000) + TNC 640 PO to Heidenhain (45 d · €18,500) released — 24× each", ref: "PO-LL-2026-MTL220-B1", hash_prev: "0x29a4c95f608d3b75a103f2e6fdb09c8b", hash: "0x3ab5e0617198f24c14a23bd75ec8af9c" },
    { event_id: "L-0011", ts: "2026-01-15T09:30Z", type: "WO_RELEASED",             mode: "forge", actor: "D. Becker", summary: "WO-MTL-2401..2412 pushed to SAP B1 · Batch 1 (12 units) released",              ref: "WO-MTL-2401..2412",    hash_prev: "0x3ab5e0617198f24c14a23bd75ec8af9c", hash: "0x4bc6f17282a90345b25f3d486fdb0a8e" },
    { event_id: "L-0012", ts: "2026-03-04T07:42Z", type: "RECEIVING_LOGGED",        mode: "forge", actor: "M. Schubert", summary: "Granite blanks for S/N 0095..0100 booked · COC hash chained · foundry cert verified", ref: "RCV-2026-Q1-GRANITE", hash_prev: "0x4bc6f17282a90345b25f3d486fdb0a8e", hash: "0x5cd7028393ba0156c360e459a0ec1b9f" },
    { event_id: "L-0013", ts: "2026-03-12T11:20Z", type: "INCOMING_INSPECTION_PASS",mode: "forge", actor: "M. Schubert", summary: "Granite blank QC · 6 units cleared at 5 µm reject / 3 µm target · QG-MS-01/02 pass", ref: "QG-MS-01",           hash_prev: "0x5cd7028393ba0156c360e459a0ec1b9f", hash: "0x6de8139404cb1267d471f560b1fd2ca0" },
    { event_id: "L-0014", ts: "2026-04-22T14:05Z", type: "NCR_OPENED",              mode: "forge", actor: "T. Brand",   summary: "NCR-MS-0301 raised on S/N 0098 · post-rough-lap flatness 4.1 µm · disposition re-grind", ref: "NCR-MS-0301",       hash_prev: "0x6de8139404cb1267d471f560b1fd2ca0", hash: "0x7ef924a515dc2378e582066c2c0e3db1" },
    { event_id: "L-0015", ts: "2026-04-22T14:50Z", type: "CAPA_LINKED",             mode: "forge", actor: "S. Klein",   summary: "CAPA-MS-0301 linked to NCR-MS-0301 · re-grind cycle initiated per ECO-MS-0017 routing", ref: "CAPA-MS-0301",      hash_prev: "0x7ef924a515dc2378e582066c2c0e3db1", hash: "0x801a35b626ed3489f693177d3d1f4ec2" },
    { event_id: "L-0016", ts: "2026-05-02T10:18Z", type: "ROUTING_PASS",            mode: "forge", actor: "L. Kraus",   summary: "S/N 0095 · X/Y/Z bores cleared at machine shop · QG-MS-05/06/07/08 pass",         ref: "WO-MTL-2401·r3",     hash_prev: "0x801a35b626ed3489f693177d3d1f4ec2", hash: "0x912b46c737fe4590a7042e8e4e2f5fd3" },
    { event_id: "L-0017", ts: "2026-05-02T16:45Z", type: "DIM_INSPECTED",           mode: "forge", actor: "L. Kraus",   summary: "S/N 0095 · CMM dimensional report logged · base 2.4 µm · beam 2.6 µm · all under ±3 µm", ref: "DIM-MTL-220-0095", hash_prev: "0x912b46c737fe4590a7042e8e4e2f5fd3", hash: "0xa23c57d8480f56a1b815f9f5f3306de4" },
    { event_id: "L-0018", ts: "2026-07-18T09:30Z", type: "SUBASSY_COMPLETED",       mode: "forge", actor: "F. Engel",   summary: "S/N 0095 · spindle module aligned · run-out 3.1 µm TIR @ 24k rpm · QG-MS-09/10/11 pass", ref: "WO-MTL-2401·r4", hash_prev: "0xa23c57d8480f56a1b815f9f5f3306de4", hash: "0xb34d68e9591a6702c92608060a417ef5" },
    { event_id: "L-0019", ts: "2026-08-12T08:00Z", type: "FAI_PACKAGE_GENERATED",   mode: "forge", actor: "S. Klein",   summary: "FAI dossier compiled for S/N 0095 · AS9102 forms 1/2/3 + IATF supplemental",       ref: "FAI-MTL-220-0095",    hash_prev: "0xb34d68e9591a6702c92608060a417ef5", hash: "0xc45e7901602b7813da37191717528006" },
    { event_id: "L-0020", ts: "2026-08-14T11:42Z", type: "FAI_PASSED",              mode: "forge", actor: "S. Klein",   summary: "S/N 0095 · all 5 gates passed · A=6.8 µm · R=3.2 µm · ballbar 4.4 µm · vib 0.41 mm/s RMS", ref: "FAI-MTL-220-0095·G4", hash_prev: "0xc45e7901602b7813da37191717528006", hash: "0xd56f8a12713c89240e482a282863a117" },
    { event_id: "L-0021", ts: "2026-08-14T15:08Z", type: "CUSTOMER_WITNESSED",      mode: "forge", actor: "S. Klein",   summary: "MAHLE rep witnessed FAI · e-signature captured on traveler TRV-MS-0244",          ref: "TRV-MS-0244",          hash_prev: "0xd56f8a12713c89240e482a282863a117", hash: "0xe6709b23824d9a350f593b3939749228" },
    { event_id: "L-0022", ts: "2026-08-14T16:30Z", type: "ACCEPTANCE_SIGNED",       mode: "forge", actor: "R. Vogt",    summary: "Traveler closed · S/N 0095 released · ledger arc closes · 23 remaining units release into Rev D spec frozen", ref: "TRV-MS-0244·CLOSE", hash_prev: "0xe6709b23824d9a350f593b3939749228", hash: "0xf781ac34935eab461063c4a4a4853339" },
  ],

  // ── Customer entity (MAHLE) ───────────────────────────────────────
  customer: {
    id: "CUST-MAHLE",
    name: "MAHLE Industriebeteiligungen GmbH",
    segment: "Tier-1 automotive · powertrain machining",
    location: "Stuttgart, DE",
    relationship: "Frame contract · annual call-off",
    sla: {
      otd_target_pct: 95,
      ar_terms_days: 60,
      warranty_months: 24,
      defect_ppm_target: 1500,
      vibration_accept_mmps_rms_12k: 0.8,
    },
    contacts: [
      { role: "Director — Powertrain Mfg",  name: "MAHLE — Powertrain Mfg Director",   email: "powertrain.mfg@mahle.example" },
      { role: "Head — Supplier Quality",    name: "MAHLE — Supplier Quality Lead",      email: "supplier.quality@mahle.example" },
      { role: "Project Lead — MTL Program", name: "MAHLE — MTL Program Lead",           email: "mtl.program@mahle.example" },
    ],
    relationship_started: "2018-04",
    cumulative_units_shipped: 94, // 91 Rev C + 3 returns + first Rev D in flight
    cumulative_value_meur: 36.1,
  },

  // ── People · team referenced across this fixture ──────────────────
  people: [
    { id: "P-MS-01", name: "R. Vogt",     role: "Engineering Lead",                 station: "—" },
    { id: "P-MS-02", name: "D. Becker",   role: "Manufacturing Lead",               station: "—" },
    { id: "P-MS-03", name: "S. Klein",    role: "Quality Lead",                     station: "r6" },
    { id: "P-MS-04", name: "K. Hofer",    role: "Plant Director / Controls Lead",   station: "r5" },
    { id: "P-MS-05", name: "M. Schubert", role: "Receiving / Granite QC Operator",  station: "r1" },
    { id: "P-MS-06", name: "T. Brand",    role: "Granite Lapping Cell Operator",    station: "r2" },
    { id: "P-MS-07", name: "L. Kraus",    role: "Machine Shop / CMM Operator",      station: "r3" },
    { id: "P-MS-08", name: "F. Engel",    role: "Subassy / Spindle Alignment",      station: "r4" },
  ],

  // ── Lifecycle phases (per spec §5) · 12-month MTL-220 Rev D window ─
  lifecycle: [
    { phase: "P1 · Frame contract signed",            month: "2025-09", status: "complete",    note: "MAHLE frame · 24 mills · 2 batches" },
    { phase: "P2 · Engineering Rev D freeze + ECO",   month: "2025-11", status: "complete",    note: "ECO-MS-0017 raised" },
    { phase: "P3 · Long-lead release",                month: "2026-01", status: "complete",    note: "Spindle 180 d · TNC 640 45 d" },
    { phase: "P4 · Granite-cell rework qualified",    month: "2026-03", status: "in-progress", note: "Re-grind op qualified · Cmk pending" },
    { phase: "P5 · First article assembly start",     month: "2026-06", status: "scheduled",   note: "Unit 1 of 24 (S/N 0095)" },
    { phase: "P6 · FAI pass + PPAP-3 sign-off",       month: "2026-08", status: "scheduled",   note: "Target 2026-08-14" },
    { phase: "P7 · Batch-1 ship-acceptance · B2 release", month: "2026-12", status: "scheduled", note: "12 units shipped · batch 2 release" },
  ],
};

// expose to global scope (Babel-standalone pattern)
if (typeof window !== "undefined") { window.MITTELSTAND_TENANT = MITTELSTAND_TENANT; }
