Repository Public
1/**2 * =============================================================================3 * SP BOUCHER | SOFTWARE & RESEARCH4 * ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project : Vrai-Prix8 * File : src/components/cout/CostPanels.tsx9 * Module : components10 * Repository : https://git.spboucher.ai/vrai-prix11 * Created : 2026-09-0812 * Last Modified : 2026-09-0813 *14 * Author : Simon-Pierre Boucher15 * Position : Professor of Finance16 * Institution : Université du Québec en Outaouais (UQO)17 * Organization : SP Boucher18 * Website : https://spboucher.ai19 * Git : https://git.spboucher.ai20 *21 * Preferred Contact: contact@spboucher.ai22 * Development : dev@spboucher.ai23 * Support : support@spboucher.ai24 * Security/Admin : admin@spboucher.ai25 *26 * Copyright (c) 202627 * Simon-Pierre Boucher28 * All rights reserved where applicable. This file is governed by the29 * applicable project license, copyright notices and relevant law.30 * Existing third-party rights and notices remain unaffected.31 *32 * License : None specified (no license file in this repository)33 *34 * Do not embed credentials, private keys, access tokens,35 * certificates or confidential personal information.36 *37 * =============================================================================38 * END OF SP BOUCHER SOURCE HEADER39 * =============================================================================40 */4142// Vrai-Prix — méthode du coût : 03 Coût à neuf (tableau par catégorie, indirects, FG/profit/contingence, RCN, fourchette),43// 04 Assemblages (lignes + surcharges + détail du calcul), 05 Main-d'œuvre.44"use client";45import { useState } from "react";46import Link from "next/link";47import type { CostEstimate, CostInput, CostParams, EstimateLine, IndirectParams } from "@/lib/cost/types";48import { INDIRECT_LABELS, categoryLabel, tradeLabel } from "@/lib/cost/taxonomy";49import { UNIT_LABELS } from "@/lib/cost/units";50import { money, num, pct } from "@/components/avendre/fmt";51import { AttrBadge, KindIcon, kindLabel, LayerBadge } from "./Provenance";52import { Drawer, PriceSourceCard } from "./SourceDrawer";53import { Block, PctField } from "./fields";54import { RangeDist, StackBar } from "./Charts";5556const unitL = (u: string, fr: boolean) => UNIT_LABELS[u as keyof typeof UNIT_LABELS]?.[fr ? "fr" : "en"] ?? u;5758export function CostTablePanel({ est, params, fr, patchP, hide }: { est: CostEstimate | null; params: CostParams; fr: boolean; patchP: (p: Partial<CostParams>) => void; hide: boolean }) {59 const lang = fr ? "fr" : "en";60 const f = (v: number | null | undefined) => (hide ? "•••" : money(v, lang));61 const base = est?.directCost ?? 0;62 const indirectBase = base + (est?.indirectCost ?? 0);63 return (64 <Block num="03" title={fr ? "Coût de remplacement à neuf" : "Replacement cost new"} id="s03" aside={est && <span className="vp-mono text-[10px] uppercase tracking-[0.06em] text-ink-3">{fr ? "prix au" : "prices as of"} {est.priceDate} · {fr ? est.location.nameFr : est.location.nameEn}</span>}>65 {!est ? <p className="text-[13.5px] text-ink-2">{fr ? "Calcul en cours…" : "Computing…"}</p> : (66 <>67 <div className="src-wrap">68 <table className="src-table">69 <thead><tr><th>{fr ? "Catégorie" : "Category"}</th><th className="text-right">{fr ? "Matériaux" : "Materials"}</th><th className="text-right">{fr ? "Main-d'œuvre" : "Labour"}</th><th className="text-right">{fr ? "Équipement" : "Equipment"}</th><th className="text-right">{fr ? "Direct" : "Direct"}</th><th className="text-right">{fr ? "Ajust. localisation" : "Location adj."}</th><th className="text-right">{fr ? "Ajusté" : "Adjusted"}</th><th className="text-right">%</th></tr></thead>70 <tbody>71 {est.categories.map((c) => (72 <tr key={c.category}>73 <td className="font-semibold">{fr ? c.labelFr : c.labelEn}</td>74 <td className="vp-mono text-right">{f(c.material)}</td>75 <td className="vp-mono text-right">{f(c.labour)}</td>76 <td className="vp-mono text-right">{f(c.equipment)}</td>77 <td className="vp-mono text-right">{f(c.direct)}</td>78 <td className="vp-mono text-right text-ink-3">{hide ? "•••" : `${c.adjusted - c.direct >= 0 ? "+" : "−"}${money(Math.abs(c.adjusted - c.direct), lang)}`}</td>79 <td className="vp-mono text-right font-bold">{f(c.adjusted)}</td>80 <td className="vp-mono text-right text-ink-3">{num(c.sharePct, lang, 1)}</td>81 </tr>82 ))}83 <tr className="bg-surface-2 font-bold">84 <td>{fr ? "Coûts directs" : "Direct costs"}</td>85 <td className="vp-mono text-right">{f(est.directMaterial)}</td>86 <td className="vp-mono text-right">{f(est.directLabour)}</td>87 <td className="vp-mono text-right">{f(est.directEquipment)}</td>88 <td className="vp-mono text-right">{f(est.categories.reduce((s, c) => s + c.direct, 0))}</td>89 <td className="vp-mono text-right text-ink-3">{hide ? "•••" : `${est.directCost - est.categories.reduce((s, c) => s + c.direct, 0) >= 0 ? "+" : "−"}${money(Math.abs(est.directCost - est.categories.reduce((s, c) => s + c.direct, 0)), lang)}`}</td>90 <td className="vp-mono text-right">{f(est.directCost)}</td>91 <td className="vp-mono text-right">100</td>92 </tr>93 </tbody>94 </table>95 </div>96 {!hide && <StackBar lang={lang} parts={[{ label: fr ? "Matériaux" : "Materials", value: est.directMaterial }, { label: fr ? "Main-d'œuvre" : "Labour", value: est.directLabour }, { label: fr ? "Équipement" : "Equipment", value: est.directEquipment }]} />}97 <div className="grid gap-x-12 gap-y-6 lg:grid-cols-2">98 <div>99 <p className="klabel mb-1">{fr ? "Coûts indirects — % du coût direct (hypothèses modifiables)" : "Indirect costs — % of direct cost (editable assumptions)"}</p>100 {(Object.keys(INDIRECT_LABELS) as (keyof IndirectParams)[]).map((k) => (101 <PctField key={k} fr={fr} lang={lang} label={fr ? INDIRECT_LABELS[k].fr : INDIRECT_LABELS[k].en} note={INDIRECT_LABELS[k].noteFr} value={params.indirect[k]} amount={hide ? undefined : (base * params.indirect[k]) / 100} onChange={(v) => patchP({ indirect: { ...params.indirect, [k]: v } })} />102 ))}103 <div className="grid grid-cols-[1fr_84px_110px] gap-3 py-2 text-[13px] font-bold"><span>{fr ? "Total indirects" : "Total indirects"}</span><span className="vp-mono text-right">{num(Object.values(params.indirect).reduce((s, v) => s + v, 0), lang, 1)} %</span><span className="vp-mono text-right">{f(est.indirectCost)}</span></div>104 </div>105 <div>106 <p className="klabel mb-1">{fr ? "Entrepreneur — frais généraux et profit séparés" : "Contractor — overhead and profit kept separate"}</p>107 <PctField fr={fr} lang={lang} label={fr ? "Frais généraux entrepreneur" : "Contractor overhead"} note={fr ? "Bureau, supervision, assurances d'entreprise, véhicules — appliqués sur (direct + indirects). Hypothèse 7 %." : "Office, supervision, business insurance, vehicles — applied to (direct + indirects). Assumption 7 %."} value={params.overheadPct} amount={hide ? undefined : (indirectBase * params.overheadPct) / 100} onChange={(v) => patchP({ overheadPct: v })} />108 <PctField fr={fr} lang={lang} label={fr ? "Profit entrepreneur" : "Contractor profit"} note={fr ? "Marge bénéficiaire appliquée sur (direct + indirects + frais généraux). Hypothèse 8 %." : "Profit margin applied to (direct + indirects + overhead). Assumption 8 %."} value={params.profitPct} amount={hide ? undefined : est.contractorProfit} onChange={(v) => patchP({ profitPct: v })} />109 <PctField fr={fr} lang={lang} label={fr ? "Contingence" : "Contingency"} note={fr ? "Réserve pour imprévus du projet (sol, conditions cachées), sur (direct + indirects). Ce n'est NI le profit (rémunération du risque de l'entrepreneur) NI un frais indirect (coût réel prévisible)." : "Reserve for project unknowns (soil, hidden conditions), on (direct + indirects). It is NEITHER profit (remuneration of contractor risk) NOR an indirect cost (real foreseeable cost)."} value={params.contingencyPct} amount={hide ? undefined : est.contingency} onChange={(v) => patchP({ contingencyPct: v })} />110 <div className="mt-4 border-t-2 border-ink pt-3">111 <p className="klabel">{fr ? "Coût de remplacement à neuf (RCN)" : "Replacement cost new (RCN)"}</p>112 <p className="vp-display mt-1 text-[clamp(28px,4vw,40px)] font-bold tracking-[-0.03em]">{f(est.replacementCostNew)}</p>113 <p className="vp-mono text-[11px] uppercase tracking-[0.05em] text-ink-2">{hide ? "•••" : `${num(est.perSqft, lang, 0)} $/pi² · ${num(est.perM2, lang, 0)} $/m²`} · {fr ? "fourchette" : "range"} {hide ? "•••" : `${money(est.range.p10, lang)} – ${money(est.range.p90, lang)}`}</p>114 <p className="vp-mono mt-1 text-[10px] uppercase tracking-[0.05em] text-ink-3">RCN = {fr ? "Directs + Indirects + Frais généraux + Profit + Contingence" : "Direct + Indirect + Overhead + Profit + Contingency"}</p>115 </div>116 </div>117 </div>118 {!hide && <RangeDist low={est.range.p10} central={est.replacementCostNew} high={est.range.p90} lang={lang} marker={est.otherReadings?.rollBuilding ?? null} markerLabel={fr ? "Bâtiment au rôle" : "Roll building"} />}119 </>120 )}121 </Block>122 );123}124125/* ------------------------------------------------------------ 04 assemblages */126127export function AssemblyLinesPanel({ est, input, fr, setQty, toggleExclude, hide }: { est: CostEstimate | null; input: CostInput; fr: boolean; setQty: (code: string, q: number | null) => void; toggleExclude: (code: string) => void; hide: boolean }) {128 const lang = fr ? "fr" : "en";129 const [open, setOpen] = useState<EstimateLine | null>(null);130 const [src, setSrc] = useState<{ comp: EstimateLine["unitDetail"]["components"][number]; line: EstimateLine } | null>(null);131 const f = (v: number) => (hide ? "•••" : money(v, lang));132 const excluded = input.excludedAssemblies;133 return (134 <Block num="04" title={fr ? "Assemblages" : "Assemblies"} id="s04" aside={est && <span className="vp-mono text-[10px] uppercase tracking-[0.06em] text-ink-3">{est.lines.length} {fr ? "lignes · cliquez pour le détail du calcul" : "lines · click for calculation detail"}</span>}>135 {!est ? null : (136 <div className="src-wrap">137 <table className="src-table">138 <thead><tr><th>{fr ? "Assemblage" : "Assembly"}</th><th className="text-right">{fr ? "Quantité" : "Quantity"}</th><th>{fr ? "Formule" : "Formula"}</th><th className="text-right">{fr ? "Coût unit." : "Unit cost"}</th><th className="text-right">M</th><th className="text-right">MO</th><th className="text-right">É</th><th className="text-right">{fr ? "Ajusté" : "Adjusted"}</th><th /></tr></thead>139 <tbody>140 {est.lines.map((l) => (141 <tr key={l.assemblyCode} className={excluded.includes(l.assemblyCode) ? "opacity-50" : ""}>142 <td>143 <button type="button" onClick={() => setOpen(l)} className="text-left font-semibold hover:text-accent-deep">{fr ? l.nameFr : l.nameEn}</button>144 <br /><span className="vp-mono text-[10px] uppercase text-ink-3">{l.assemblyCode} · {categoryLabel(l.category, fr)} · {fr ? "part observée" : "observed share"} {Math.round(l.observedShare * 100)} %</span>145 </td>146 <td className="vp-mono text-right whitespace-nowrap">147 <span className="inline-flex items-baseline gap-1">148 <input type="number" inputMode="decimal" min={0} value={input.quantityOverrides[l.assemblyCode] ?? l.quantity} onChange={(e) => setQty(l.assemblyCode, e.target.value === "" ? null : Number(e.target.value))} className="vp-input vp-mono !min-h-0 w-[88px] !py-0.5 text-right text-[12.5px]" aria-label={fr ? "Quantité" : "Quantity"} />149 <span className="text-[10px] text-ink-3">{unitL(l.unit, fr)}</span>150 </span>151 <div className="mt-0.5 flex justify-end gap-1"><AttrBadge source={l.quantitySource} fr={fr} />{input.quantityOverrides[l.assemblyCode] != null && <button type="button" onClick={() => setQty(l.assemblyCode, null)} className="vp-mono text-[9px] uppercase text-accent">{fr ? "réinit." : "reset"}</button>}</div>152 </td>153 <td className="max-w-[260px] text-[11.5px] leading-snug text-ink-2">{l.quantityFormula}</td>154 <td className="vp-mono text-right">{hide ? "•••" : `${num(l.unitCost, lang, 2)} $`}<br /><span className="text-[10px] text-ink-3">/ {unitL(l.unit, fr)}</span></td>155 <td className="vp-mono text-right text-[12px]">{f(l.material)}</td>156 <td className="vp-mono text-right text-[12px]">{f(l.labour)}</td>157 <td className="vp-mono text-right text-[12px]">{f(l.equipment)}</td>158 <td className="vp-mono text-right font-bold">{f(l.adjusted)}</td>159 <td><button type="button" onClick={() => toggleExclude(l.assemblyCode)} className="vp-mono text-[9.5px] uppercase text-ink-3 hover:text-[var(--danger)]">{excluded.includes(l.assemblyCode) ? (fr ? "inclure" : "include") : (fr ? "exclure" : "exclude")}</button></td>160 </tr>161 ))}162 {excluded.filter((c) => !est.lines.some((l) => l.assemblyCode === c)).map((c) => (163 <tr key={c} className="opacity-60"><td colSpan={8} className="vp-mono text-[11px] uppercase text-ink-3">{c} — {fr ? "exclu" : "excluded"}</td><td><button type="button" onClick={() => toggleExclude(c)} className="vp-mono text-[9.5px] uppercase text-accent">{fr ? "inclure" : "include"}</button></td></tr>164 ))}165 </tbody>166 </table>167 </div>168 )}169 <Drawer open={!!open} onClose={() => setOpen(null)} title={fr ? "Détails du calcul" : "Calculation details"} fr={fr}>170 {open && (171 <div className="space-y-4">172 <div>173 <p className="vp-mono text-[10px] uppercase tracking-[0.08em] text-ink-3">{open.assemblyCode}</p>174 <p className="vp-display text-[18px] font-bold leading-tight">{fr ? open.nameFr : open.nameEn}</p>175 <Link href={`/cout/assemblage/${encodeURIComponent(open.assemblyCode)}`} className="vp-mono mt-1 inline-block text-[10.5px] font-bold uppercase tracking-[0.08em] text-accent">{fr ? "Fiche complète de l'assemblage" : "Full assembly card"} →</Link>176 </div>177 <div className="grid grid-cols-2 gap-x-6 gap-y-2">178 <div className="kv-cell"><p className="k">{fr ? "Quantité" : "Quantity"}</p><p className="v vp-mono text-[13px] font-medium">{num(open.quantity, lang, 2)} {unitL(open.unit, fr)} <AttrBadge source={open.quantitySource} fr={fr} /></p></div>179 <div className="kv-cell"><p className="k">{fr ? "Formule de quantité" : "Quantity formula"}</p><p className="v text-[12.5px] font-normal">{open.quantityFormula}</p></div>180 <div className="kv-cell"><p className="k">{fr ? "Coût unitaire direct" : "Unit direct cost"}</p><p className="v vp-mono text-[13px] font-medium">{num(open.unitCost, lang, 2)} $ / {unitL(open.unit, fr)}</p></div>181 <div className="kv-cell"><p className="k">{fr ? "Ligne (avant / après localisation)" : "Line (before / after location)"}</p><p className="v vp-mono text-[13px] font-medium">{money(open.direct, lang)} → {money(open.adjusted, lang)}</p></div>182 <div className="kv-cell"><p className="k">{fr ? "Écart-type de la ligne" : "Line standard deviation"}</p><p className="v vp-mono text-[13px] font-medium">± {money(open.sigma, lang)}</p></div>183 <div className="kv-cell"><p className="k">{fr ? "Vie économique · groupe" : "Economic life · group"}</p><p className="v vp-mono text-[13px] font-medium">{open.economicLife ?? "—"} {fr ? "ans" : "yrs"} · {open.conditionGroup ?? "—"}</p></div>184 </div>185 <p className="vp-mono text-[10px] uppercase tracking-[0.05em] text-ink-3">{fr ? "matériau = qté × (1 + pertes) × prix · main-d'œuvre = heures × taux employeur · par unité d'assemblage" : "material = qty × (1 + waste) × price · labour = hours × employer rate · per assembly unit"}</p>186 <div className="src-wrap">187 <table className="src-table">188 <thead><tr><th>{fr ? "Composant" : "Component"}</th><th className="text-right">{fr ? "Qté / unité" : "Qty / unit"}</th><th className="text-right">{fr ? "Pertes" : "Waste"}</th><th className="text-right">{fr ? "Prix unit." : "Unit price"}</th><th>{fr ? "Prov." : "Prov."}</th><th className="text-right">{fr ? "Matériau" : "Material"}</th><th className="text-right">{fr ? "Heures" : "Hours"}</th><th className="text-right">{fr ? "Taux" : "Rate"}</th><th className="text-right">MO</th><th className="text-right">É</th></tr></thead>189 <tbody>190 {open.unitDetail.components.map((c, i) => (191 <tr key={i} className="cursor-pointer" onClick={() => setSrc({ comp: c, line: open })}>192 <td><span className="font-semibold">{fr ? c.nameFr : c.nameEn}</span>{c.itemCode && <><br /><span className="vp-mono text-[10px] text-ink-3">{c.itemCode}</span></>}{c.trade && c.labourHours > 0 && <><br /><span className="vp-mono text-[10px] text-ink-3">{tradeLabel(c.trade, fr)}</span></>}</td>193 <td className="vp-mono text-right text-[12px]">{c.itemCode ? `${num(c.quantity, lang, 4)} ${unitL(c.unit, fr)}` : "—"}</td>194 <td className="vp-mono text-right text-[12px]">{c.itemCode ? `${Math.round(c.wasteFactor * 100)} %` : "—"}</td>195 <td className="vp-mono text-right text-[12px]">{c.itemCode ? `${num(c.unitPrice, lang, 2)} $` : "—"}</td>196 <td>{c.itemCode ? <KindIcon kind={c.provenance.kind} fr={fr} source={c.provenance.source} observedAt={c.provenance.observedAt} note={c.provenance.note} /> : <LayerBadge layer="assumption" fr={fr} />}</td>197 <td className="vp-mono text-right text-[12px]">{c.materialCost ? `${num(c.materialCost, lang, 2)} $` : "—"}</td>198 <td className="vp-mono text-right text-[12px]">{c.labourHours ? num(c.labourHours, lang, 3) : "—"}</td>199 <td className="vp-mono text-right text-[12px]">{c.hourlyRate != null ? <span className="inline-flex items-center gap-1">{num(c.hourlyRate, lang, 2)} $/h <KindIcon kind={c.rateProvenance?.kind ?? "assumption"} fr={fr} source={c.rateProvenance?.source} observedAt={c.rateProvenance?.effectiveDate} note={c.rateProvenance?.note} /></span> : "—"}</td>200 <td className="vp-mono text-right text-[12px]">{c.labourCost ? `${num(c.labourCost, lang, 2)} $` : "—"}</td>201 <td className="vp-mono text-right text-[12px]">{c.equipmentCost ? `${num(c.equipmentCost, lang, 2)} $` : "—"}</td>202 </tr>203 ))}204 <tr className="bg-surface-2 font-bold"><td>{fr ? "Par unité d'assemblage" : "Per assembly unit"}</td><td colSpan={4} /><td className="vp-mono text-right">{num(open.unitDetail.material, lang, 2)} $</td><td colSpan={2} /><td className="vp-mono text-right">{num(open.unitDetail.labour, lang, 2)} $</td><td className="vp-mono text-right">{num(open.unitDetail.equipment, lang, 2)} $</td></tr>205 </tbody>206 </table>207 </div>208 <p className="vp-mono text-[10px] uppercase tracking-[0.05em] text-ink-3">{fr ? "Cliquez un composant pour sa fiche source." : "Click a component for its source card."}</p>209 </div>210 )}211 </Drawer>212 <Drawer open={!!src} onClose={() => setSrc(null)} title={fr ? "Source" : "Source"} fr={fr}>213 {src && (214 <div className="space-y-6">215 {src.comp.itemCode ? <PriceSourceCard fr={fr} itemName={fr ? src.comp.nameFr : src.comp.nameEn} unit={src.comp.unit} price={src.comp.provenance} locationFactor={est?.location.materialFactor} locationName={est ? (fr ? est.location.nameFr : est.location.nameEn) : undefined} /> : null}216 {src.comp.rateProvenance && (217 <div>218 <p className="klabel">{fr ? "Taux de main-d'œuvre" : "Labour rate"}</p>219 <p className="vp-display mt-1 text-[16px] font-bold">{tradeLabel(src.comp.trade, fr)} — {num(src.comp.hourlyRate ?? 0, lang, 2)} $/h</p>220 <p className="mt-1 inline-flex items-center gap-2 text-[12.5px] text-ink-2"><KindIcon kind={src.comp.rateProvenance.kind} fr={fr} /> {kindLabel(src.comp.rateProvenance.kind, fr)} · {src.comp.rateProvenance.source}{src.comp.rateProvenance.effectiveDate ? ` · ${fr ? "en vigueur le" : "effective"} ${src.comp.rateProvenance.effectiveDate}` : ""}</p>221 {src.comp.rateProvenance.note && <p className="mt-1 text-[12.5px] text-ink-2">{src.comp.rateProvenance.note}</p>}222 {src.comp.rateProvenance.sourceUrl && <a href={src.comp.rateProvenance.sourceUrl} target="_blank" rel="noopener noreferrer nofollow" className="vp-mono mt-1 inline-block text-[10.5px] font-bold uppercase tracking-[0.08em] text-accent">{fr ? "Document source" : "Source document"} ↗</a>}223 <p className="vp-mono mt-2 text-[10px] uppercase tracking-[0.05em] text-ink-3">{fr ? "Coût employeur complet : taux horaire + vacances (13 %) + avantages sociaux + cotisations (AE, RQAP, FSS, CCQ, CNESST…) — jamais le seul salaire." : "Full employer cost: hourly wage + vacation (13 %) + benefits + contributions (EI, QPIP, HSF, CCQ, CNESST…) — never the bare wage."}</p>224 </div>225 )}226 </div>227 )}228 </Drawer>229 </Block>230 );231}232233/* ------------------------------------------------------------ 05 main-d'œuvre */234235export function LabourPanel({ est, fr, hide }: { est: CostEstimate | null; fr: boolean; hide: boolean }) {236 const lang = fr ? "fr" : "en";237 if (!est) return null;238 const byTrade = new Map<string, { hours: number; cost: number; rate: number | null; official: boolean; source: string | null; date: string | null }>();239 for (const l of est.lines) for (const c of l.unitDetail.components) {240 if (!(c.labourHours > 0)) continue;241 const k = c.trade ?? "?";242 const cur = byTrade.get(k) ?? { hours: 0, cost: 0, rate: c.hourlyRate, official: c.rateProvenance?.kind === "official", source: c.rateProvenance?.source ?? null, date: c.rateProvenance?.effectiveDate ?? null };243 cur.hours += c.labourHours * l.quantity;244 cur.cost += c.labourCost * l.quantity * est.location.labourFactor;245 byTrade.set(k, cur);246 }247 const rows = [...byTrade.entries()].sort((a, b) => b[1].cost - a[1].cost);248 const totalH = rows.reduce((s, [, r]) => s + r.hours, 0);249 const officialShare = est.directLabour > 0 ? rows.filter(([, r]) => r.official).reduce((s, [, r]) => s + r.cost, 0) / est.directLabour : 0;250 return (251 <Block num="05" title={fr ? "Main-d'œuvre" : "Labour"} id="s05" aside={<span className="vp-mono text-[10px] uppercase tracking-[0.06em] text-ink-3">{fr ? "part des taux officiels" : "official-rate share"} : {Math.round(officialShare * 100)} %</span>}>252 <div className="grid grid-cols-3 gap-x-6">253 <div className="kv-cell"><p className="k">{fr ? "Heures totales" : "Total hours"}</p><p className="v">{hide ? "•••" : num(totalH, lang)} h</p></div>254 <div className="kv-cell"><p className="k">{fr ? "Coût de main-d'œuvre (localisé)" : "Labour cost (localised)"}</p><p className="v">{hide ? "•••" : money(est.directLabour, lang)}</p></div>255 <div className="kv-cell"><p className="k">{fr ? "Facteur régional MO" : "Regional labour factor"}</p><p className="v">× {num(est.location.labourFactor, lang, 2)}</p></div>256 </div>257 <div className="src-wrap">258 <table className="src-table">259 <thead><tr><th>{fr ? "Métier" : "Trade"}</th><th className="text-right">{fr ? "Heures" : "Hours"}</th><th className="text-right">{fr ? "Taux employeur" : "Employer rate"}</th><th>{fr ? "Source · date" : "Source · date"}</th><th className="text-right">{fr ? "Coût" : "Cost"}</th><th className="text-right">%</th></tr></thead>260 <tbody>261 {rows.map(([t, r]) => (262 <tr key={t}>263 <td className="font-semibold">{tradeLabel(t, fr)}</td>264 <td className="vp-mono text-right">{hide ? "•••" : num(r.hours, lang)}</td>265 <td className="vp-mono text-right">{r.rate != null ? `${num(r.rate, lang, 2)} $/h` : "—"} <KindIcon kind={r.official ? "official" : "assumption"} fr={fr} /></td>266 <td className="text-[12px] text-ink-2">{r.official ? `${r.source}${r.date ? ` · ${r.date}` : ""}` : (fr ? "Taux de repli (hypothèse) — aucune grille" : "Fallback rate (assumption) — no grid")}</td>267 <td className="vp-mono text-right font-bold">{hide ? "•••" : money(r.cost, lang)}</td>268 <td className="vp-mono text-right text-ink-3">{est.directLabour ? pct((r.cost / est.directLabour) * 100, lang, 1, false) : "—"}</td>269 </tr>270 ))}271 </tbody>272 </table>273 </div>274 <p className="vp-mono text-[10px] uppercase leading-relaxed tracking-[0.05em] text-ink-3">{fr ? "Heures = Σ (heures par unité d'assemblage × quantité). Taux = coût employeur complet des grilles APCHQ (conventions CCQ, secteur résidentiel léger, compagnon). Les heures de productivité sont des hypothèses Vrai-Prix." : "Hours = Σ (hours per assembly unit × quantity). Rate = full employer cost from APCHQ grids (CCQ agreements, light residential sector, journeyperson). Productivity hours are Vrai-Prix assumptions."}</p>275 </Block>276 );277}278