/* Magasin : centre de contrôle, fiche article, plan, inventaire, scan */
.b-yellow { background: #fff9d6; color: #9a7400; border-color: #f2e08a; }
.btn-purple { color: #fff; background: linear-gradient(180deg, #8b52d6, #6a33b5); box-shadow: 0 3px 8px rgba(106, 51, 181, .3); }
.mg-ok { color: #1a8a3a; font-weight: 600; } .mg-bad { color: #d7141b; font-weight: 700; } .mg-warn { color: #d06a00; font-weight: 600; }
.mg-blue { color: #1f63c9; font-weight: 600; } .mg-purple { color: #7a3fc4; font-weight: 700; }
.mg-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(0, 0, 0, .04); vertical-align: middle; }
.mg-q.in { color: #1a8a3a; } .mg-q.out { color: #d7141b; }
.mg-loc { display: inline-block; padding: 2px 7px; border-radius: 5px; background: #14223b; color: #fff; font: 700 11.5px/1.4 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .02em; white-space: nowrap; }
.mg-crit { display: block; margin-top: 3px; color: #b3121a; font-size: 11.5px; font-weight: 700; }
.mg-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.mg-top .utabs { flex: 1; min-width: 0; border-bottom: 0; }
/* 8 onglets : sous 1500 px, les onglets passent sur leur propre ligne, pleine largeur, sous les actions */
@media (max-width: 1500px) { .mg-top .utabs { flex: 1 1 100%; order: 2; } .mg-top > .row { margin-left: auto; } .mg-top .utab { padding: 0 12px; } }
.mg-table td { vertical-align: middle; }
.mg-table tr.mg-gap td { background: #fff6f0; }

/* niveaux de stock */
.mg-levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.mg-lv { padding: 10px 12px; border-radius: 10px; background: #f4f6f9; border: 1px solid #e3e7ee; display: flex; flex-direction: column; }
.mg-lv span { font-size: 12px; font-weight: 700; color: #4d5667; text-transform: uppercase; letter-spacing: .03em; }
.mg-lv b { font: 700 28px/1.1 var(--cond, 'Barlow Semi Condensed'), sans-serif; color: #14223b; }
.mg-lv em { font-style: normal; font-size: 11px; color: #8a94a4; }
.mg-lv.res { background: #f6f0fe; border-color: #e3d4f8; } .mg-lv.res b { color: #7a3fc4; }
.mg-lv.av { background: #e9f7ee; border-color: #c4e8cf; } .mg-lv.av b { color: #1a8a3a; }
.mg-lv.av.warn { background: #fff4e8; border-color: #fbd2b0; } .mg-lv.av.warn b { color: #e0620e; }
.mg-lv.av.bad { background: #fdeaea; border-color: #f7c6c8; } .mg-lv.av.bad b { color: #d7141b; }
.mg-lv.ord { background: #eef4fd; border-color: #cfe0f8; } .mg-lv.ord b { color: #1f63c9; }
.mg-lv.min b { color: #6b7688; }
.mg-mini .mg-lv b { font-size: 21px; } .mg-mini .mg-lv em { display: none; }
.mg-note { font-size: 12.5px; color: #6b7688; display: flex; gap: 6px; align-items: center; min-height: 40px; }
p.mg-warn, .mg-warnbox { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 9px 11px; border-radius: 8px; background: #fff4e8; color: #8a4300; font-weight: 500; font-size: 13px; }
.mg-avail { font-size: 11.5px; margin-top: 3px; font-weight: 600; } .mg-avail.ok { color: #1a8a3a; } .mg-avail.low { color: #d06a00; } .mg-avail.bad { color: #d7141b; }

/* centre de contrôle */
.mg-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.mg-kpi { text-align: left; border: 0; cursor: pointer; font: inherit; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.mg-kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #14223b; }
.mg-kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(20, 30, 50, .12); }
.mg-kpi span { font-size: 12px; font-weight: 700; color: #6b7688; text-transform: uppercase; letter-spacing: .03em; }
.mg-kpi b { font: 700 32px/1.1 var(--cond, 'Barlow Semi Condensed'), sans-serif; color: #14223b; }
.mg-kpi em { font-style: normal; font-size: 12px; color: #8a94a4; }
.mg-kpi.red::before { background: #e11d24; } .mg-kpi.red b { color: #d7141b; }
.mg-kpi.orange::before { background: #f47a20; } .mg-kpi.orange b { color: #e0620e; }
.mg-kpi.blue::before { background: #1f63c9; } .mg-kpi.blue b { color: #1f63c9; }
.mg-kpi.purple::before { background: #7a3fc4; } .mg-kpi.purple b { color: #7a3fc4; }
.mg-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 14px 0; padding: 10px 14px; border-radius: 10px; background: linear-gradient(90deg, #14223b, #22375e); color: #cfd6e2; font-size: 12.5px; font-weight: 600; }
.mg-chain span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.mg-chain span.hot { background: #e11d24; color: #fff; }
.mg-chain i { font-style: normal; color: #6b7a93; }
.mg-inv-banner { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 14px; text-decoration: none; color: inherit; border-left: 4px solid #1f63c9; }
.mg-inv-banner > div { flex: 1; }
.mg-bar { height: 8px; border-radius: 4px; background: #e6eaf0; overflow: hidden; margin: 6px 0; }
.mg-bar.big { height: 14px; border-radius: 7px; }
.mg-bar i { display: block; height: 100%; background: linear-gradient(90deg, #1f9a3e, #36c25e); border-radius: inherit; transition: width .4s; }
.mg-grid2 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.mg-actions { display: flex; flex-direction: column; }
.mg-action { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid #eef1f5; text-decoration: none; color: inherit; }
.mg-action:hover { background: #f7f9fb; }
.mg-action .t { display: flex; flex-direction: column; min-width: 0; } .mg-action .t .muted { font-size: 12px; }
.mg-action .n { display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; color: #4d5667; }
.mg-recent td { padding-top: 8px; padding-bottom: 8px; }

/* plan du magasin */
.mg-plan { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.mg-zone { border: 1px solid #d9dde4; background: #fff; border-radius: 8px; padding: 7px 14px; font: 800 13px Barlow, sans-serif; letter-spacing: .06em; color: #4d5667; cursor: pointer; }
.mg-zone.on { background: #14223b; color: #fff; border-color: #14223b; }
.mg-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: #6b7688; }
.mg-legend span { display: inline-flex; align-items: center; gap: 4px; } .mg-legend i { width: 10px; height: 10px; border-radius: 50%; }
.mg-racks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.mg-rack { width: 92px; padding: 10px 8px; border-radius: 10px; border: 2px solid #e3e7ee; background: linear-gradient(180deg, #fff, #f4f6f9); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 5px; font: inherit; }
.mg-rack b { font: 800 16px/1 ui-monospace, Consolas, monospace; color: #14223b; }
.mg-rack i { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 3px #fff, 0 0 0 4px #e3e7ee; }
.mg-rack span { font-size: 11px; color: #8a94a4; }
.mg-rack.on { border-color: #e11d24; box-shadow: 0 6px 16px rgba(225, 29, 36, .15); }
.mg-rack-grid { margin-top: 16px; } .mg-rack-grid h3 { margin: 0 0 8px; font-size: 15px; }
.mg-cells { border-collapse: separate; border-spacing: 5px; }
.mg-cells th { font: 700 11.5px ui-monospace, Consolas, monospace; color: #8a94a4; padding: 0 4px; }
.mg-cell { width: 46px; height: 38px; border-radius: 7px; border: 1px solid #dfe4eb; background: #fff; cursor: pointer; position: relative; font: 700 12px Barlow, sans-serif; color: #fff; box-shadow: inset 0 -5px 0 var(--c); }
.mg-cell b { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; background: var(--c); }
.mg-cell.on { outline: 3px solid #14223b; outline-offset: 1px; }
.mg-cell-panel h3 { display: flex; align-items: center; gap: 6px; font-family: ui-monospace, Consolas, monospace; }
.mg-cell-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; border: 1px solid #eef1f5; text-decoration: none; color: inherit; }
.mg-cell-item:hover { background: #f7f9fb; } .mg-cell-item i { width: 10px; height: 10px; border-radius: 50%; }
.mg-cell-item span { text-align: right; font-size: 12.5px; font-weight: 700; } .mg-cell-item em { display: block; font-style: normal; font-weight: 400; color: #8a94a4; font-size: 11px; }
.mg-cell-item .muted { font-size: 11.5px; }

/* fiche article */
.mg-sheet { overflow: hidden; }
.mg-sheet-id { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: linear-gradient(120deg, #14223b, #22375e); color: #fff; }
.mg-sheet-ico { width: 60px; height: 60px; border-radius: 14px; background: rgba(255, 255, 255, .1); display: flex; align-items: center; justify-content: center; color: #ff6b6f; flex: 0 0 60px; }
.mg-sheet-t { flex: 1; min-width: 0; } .mg-sheet-t h2 { margin: 0 0 6px; font: 700 24px/1.15 var(--cond, 'Barlow Semi Condensed'), sans-serif; }
.mg-critbox { margin-top: 8px; display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 8px; background: #e11d24; color: #fff; font-size: 13px; }
.mg-loc-big { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; background: #fff; color: #14223b; text-decoration: none; font: 800 20px/1 ui-monospace, Consolas, monospace; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.mg-loc-big span { display: flex; flex-direction: column; gap: 3px; } .mg-loc-big em { font: 600 10.5px Barlow, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: #8a94a4; font-style: normal; }
.mg-loc-big svg { color: #e11d24; }
.mg-sheet-body { display: grid; grid-template-columns: minmax(240px, 330px) minmax(0, 1fr); gap: 20px; padding: 18px 20px; }
.mg-ident { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; align-content: start; }
.mg-ident dt { font-size: 11.5px; color: #8a94a4; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; } .mg-ident dd { margin: 2px 0 0; font-weight: 700; color: #14223b; word-break: break-word; }
.mg-sheet-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mg-sup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mg-sup-card.pref { box-shadow: inset 0 0 0 2px #1f9a3e; }
.mg-supdl { margin: 10px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; } .mg-supdl dt { font-size: 11px; color: #8a94a4; } .mg-supdl dd { margin: 0; font-weight: 700; font-size: 13.5px; }
.mg-sup-add { border: 2px dashed #cfd5de; background: #fafbfd; color: #6b7688; font: 600 14px Barlow, sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 140px; cursor: pointer; }
.mg-supcmp { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mg-sup { text-align: left; border: 2px solid #e3e7ee; border-radius: 10px; background: #fff; padding: 9px 11px; cursor: pointer; font: inherit; display: flex; flex-direction: column; }
.mg-sup span { font: 700 18px var(--cond, 'Barlow Semi Condensed'), sans-serif; color: #14223b; } .mg-sup em { font-style: normal; font-size: 11.5px; color: #8a94a4; }
.mg-sup.on { border-color: #e11d24; background: #fff7f7; }
.mg-po-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.mg-po-head > div { display: flex; flex-direction: column; gap: 2px; } .mg-po-head b { font-size: 16px; color: #14223b; }

/* inventaires */
.mg-inv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.mg-inv { text-decoration: none; color: inherit; } .mg-inv:hover { box-shadow: 0 10px 22px rgba(20, 30, 50, .12); }
.mg-inv-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: center; }
.mg-inv-stats { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }

/* scan */
.mg-scan-in { display: flex; gap: 8px; } .mg-scan-in .field-box { flex: 1; height: 46px; }
.mg-scan-in input { font-size: 17px; font-weight: 600; letter-spacing: .02em; }
.mg-scan-video { position: relative; margin-top: 10px; border-radius: 12px; overflow: hidden; background: #000; max-height: 280px; }
.mg-scan-video video { width: 100%; display: block; max-height: 280px; object-fit: cover; }
.mg-scan-video i { position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; background: #e11d24; box-shadow: 0 0 12px #e11d24; animation: mg-scanline 1.6s ease-in-out infinite alternate; }
@keyframes mg-scanline { from { transform: translateY(-60px); } to { transform: translateY(60px); } }
.mg-scan-card { margin-top: 14px; padding: 14px; border-radius: 12px; border: 1px solid #e3e7ee; background: #fafbfd; }
.mg-scan-card h3 { margin: 0; font-size: 19px; }
.mg-scan-card .mg-loc-big { box-shadow: none; background: #14223b; color: #fff; font-size: 18px; }
.mg-scan-miss, .mg-scan-ok { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #fdeaea; color: #8a0f14; }
.mg-scan-ok { background: #e9f7ee; color: #145c2c; } .mg-scan-ok > div { flex: 1; } .mg-scan-ok span b { font-size: 20px; }

@media (max-width: 1200px) { .mg-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mg-grid2, .mg-plan { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .mg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mg-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mg-sheet-body, .mg-po-head, .mg-inv-head { grid-template-columns: minmax(0, 1fr); } .mg-sheet-id { flex-wrap: wrap; } }
.table-wrap { overflow-x: auto; }
.mg-table { min-width: 980px; }

/* Véhicules séparés de la désignation (Articles + onglet Compatibilités) */
.mg-veh { display: flex; align-items: flex-start; gap: 5px; margin-top: 3px; font-size: 11.5px; color: #5b6b80; line-height: 1.3; white-space: normal; max-width: 420px; }
.mg-veh svg { flex: none; margin-top: 1px; opacity: .7; }
.mg-veh.on { color: #1f63c9; }
.mg-cp-intro { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px 4px; color: #44526a; font-size: 13px; }
.mg-cp-intro p { margin: 0; }
.mg-cp-intro svg { flex: none; color: #e11d24; margin-top: 2px; }
.mg-cp-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 10px 16px; }
.mg-cp-kpis > div { border: 1px solid #e3e8f0; border-radius: 10px; padding: 9px 12px; background: #fff; }
.mg-cp-kpis > div.on { border-color: #e11d24; box-shadow: inset 3px 0 0 #e11d24; }
.mg-cp-kpis b { display: block; font-size: 20px; color: #0f1b2f; }
.mg-cp-kpis span { font-size: 11.5px; color: #6b7688; }
.mg-cp-src { font-size: 11px; color: #7a8699; margin-top: 2px; }
.mg-cp-mod { font-size: 12.5px; }
.mg-cp-mod em { color: #e0620e; font-style: normal; font-size: 11px; }
.mg-cp-table td { vertical-align: top; }
@media (max-width: 760px) { .mg-cp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { /* Compatibilités : une carte par article sur téléphone */
  .mg-cp-table { min-width: 0; }
  .mg-cp-table thead { display: none; }
  .mg-cp-table, .mg-cp-table tbody, .mg-cp-table tr, .mg-cp-table td { display: block; width: 100%; }
  .mg-cp-table tr { padding: 10px 14px; border-bottom: 1px solid #e3e8f0; }
  .mg-cp-table td { padding: 2px 0; border: 0; }
  .mg-cp-table td[data-l] { display: grid; grid-template-columns: 92px minmax(0, 1fr); column-gap: 6px; white-space: normal; }
  .mg-cp-table td[data-l]::before { content: attr(data-l); color: #6b7688; font-size: 11.5px; grid-row: 1 / span 20; }
  .mg-cp-table td[data-l] > * { grid-column: 2; }
  .table.mg-cp-table td { white-space: normal; }
}
@media (max-width: 760px) { .mg-cp-table td { padding: 3px 0 !important; height: auto !important; min-height: 0 !important; line-height: 1.35; } .mg-cp-table td:first-child { margin-bottom: 2px; } }
.mg-cp-veng { color: #1f4f9a; font-size: 11px; font-weight: 600; }
/* scan universel (components/scan-anything.js) */
.sa-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.sa-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: #f6f8fb; color: var(--text); text-decoration: none; }
.sa-list a:hover { background: #eef2f7; }
.sa-list a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-list a em { font-style: normal; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }

/* ================= v1.98.5 : Plan du magasin réaliste (vue du dessus + façade du rayonnage + fiche de la case) ================= */
.mgp { --mgp-tile: #e3e7ee; --mgp-wall: #9aa4b2; --mgp-floor: #f6f7f9; --mgp-rack: #ffffff; --mgp-rack-line: #8c97a8; }
html[data-theme="dark"] .mgp { --mgp-tile: #1d2638; --mgp-wall: #3a4660; --mgp-floor: #101827; --mgp-rack: #1a2335; --mgp-rack-line: #4a5874; }
.mgp-head { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.mgp-find { display: flex; align-items: center; gap: 8px; flex: 1 1 340px; max-width: 520px; height: 42px; padding: 0 5px 0 12px; border-radius: 11px; background: var(--card); border: 1.5px solid var(--line); color: var(--muted); }
.mgp-find:focus-within { border-color: var(--text); } .mgp-find input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--text); font: inherit; }
.mgp-tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.mgp-results { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.mgp-res { display: grid; grid-template-columns: auto auto; gap: 0 10px; align-items: center; text-align: left; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; cursor: pointer; }
.mgp-res b { font-size: 13.5px; } .mgp-res small { grid-row: 2; color: var(--muted); } .mgp-res span { grid-row: 1 / 3; grid-column: 2; font: 700 13px var(--cond); background: var(--navy); color: #fff; border-radius: 7px; padding: 3px 8px; } .mgp-res.lost span { background: #fdeaea; color: #c62828; }
.mgp-res:hover { border-color: var(--text); }
.mgp-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 14px; align-items: start; }
.mgp-card { overflow: hidden; padding: 0; }
.mgp-ch { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.mgp-ch h3 { margin: 0; font: 700 18px var(--cond); color: var(--text); } .mgp-ch small { font-size: 12.5px; }
.mgp-chips { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.mgp-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); font: 700 12.5px var(--font); cursor: pointer; }
.mgp-chip i { width: 8px; height: 8px; border-radius: 50%; } .mgp-chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.mgp-floor { background: var(--mgp-floor); }
.mgp-svg { display: block; width: 100%; height: auto; touch-action: manipulation; }
.mgp-svg.editing { touch-action: none; }
.mgp-svg .k-t1 { font: 800 22px var(--cond); fill: var(--text); } .mgp-svg .k-t3 { font: 600 16px var(--font); fill: var(--muted); }
.mgp-svg .mgp-desk .k-t1 { fill: #fff; }
.mgp-rk { cursor: pointer; outline: none; } .mgp-rk .k-body { fill: var(--mgp-rack); stroke: var(--mgp-rack-line); stroke-width: 1.5; transition: stroke .2s; }
.mgp-rk:hover .k-body, .mgp-rk:focus-visible .k-body { stroke: var(--text); stroke-width: 2.5; } .mgp-rk.sel .k-body { stroke: var(--red); stroke-width: 3.5; }
.editing .mgp-rk, .editing .mgp-desk { cursor: grab; } .editing .mgp-rk.pick .k-body { stroke: #1f63c9; stroke-width: 3.5; stroke-dasharray: 7 5; }
.mgp-route { fill: none; stroke: var(--red); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 11 8; animation: mgpDash 1s linear infinite; }
@keyframes mgpDash { to { stroke-dashoffset: -19; } }
.mgp-pin { animation: mgpPin 1.2s ease-in-out infinite; } @keyframes mgpPin { 50% { transform: translateY(-6px); } }
.mgp-hint { display: flex; gap: 8px; align-items: center; padding: 9px 16px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); } .mgp-hint b { color: var(--text); }
.mgp-edit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: #eef4ff; color: #1d3f7a; font-size: 13px; border-bottom: 1px solid var(--line); } .mgp-edit span { flex: 1; min-width: 200px; }
html[data-theme="dark"] .mgp-edit { background: #14243f; color: #b9cdf3; }
.mgp-props { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.mgp-props > b { font: 800 18px var(--cond); align-self: center; } .mgp-props label { display: grid; gap: 3px; color: var(--muted); font-weight: 600; } .mgp-props .input { height: 34px; min-width: 120px; }
/* façade : montants bleus perforés, traverses orange, niveau A en bas */
.mgp-facade { padding: 26px 18px 0 54px; background: linear-gradient(180deg, #e9edf2, #dfe4eb 85%, #c9d0da); overflow-x: auto; }
html[data-theme="dark"] .mgp-facade { background: linear-gradient(180deg, #1b2434, #161e2c 85%, #111826); }
.mgp-rack { position: relative; padding: 18px 16px 0; min-width: calc(var(--n) * 52px + 40px); }
.mgp-rack::before, .mgp-rack::after { content: ''; position: absolute; top: -6px; bottom: -4px; width: 16px; border-radius: 2px;
  background: repeating-linear-gradient(180deg, transparent 0 9px, rgba(5, 10, 25, .55) 9px 13px, transparent 13px 18px) center / 5px 100% no-repeat, linear-gradient(90deg, #12357a, #1f4fb0 45%, #0f2c66); box-shadow: 2px 0 6px rgba(0, 0, 0, .18); }
.mgp-rack::before { left: 0; } .mgp-rack::after { right: 0; }
.mgp-rack .k-cap { position: absolute; left: 0; right: 0; top: -4px; height: 10px; background: linear-gradient(180deg, #ff7a1a, #b8430a); border-radius: 2px; }
.mgp-lvl { position: relative; display: flex; align-items: flex-end; gap: 6px; padding: 10px 6px 0; min-height: 92px; }
.mgp-lvl + .mgp-lvl { margin-top: 12px; }
.mgp-lvl::after { content: ''; position: absolute; left: -16px; right: -16px; bottom: -12px; height: 12px; background: linear-gradient(180deg, #ff7a1a, #e2560a 60%, #b8430a); border-radius: 2px; box-shadow: 0 4px 6px rgba(0, 0, 0, .18); }
.mgp-lvl .k-ln { position: absolute; left: -50px; bottom: -12px; width: 26px; text-align: center; font: 800 14px var(--cond); color: #fff; background: var(--navy); border-radius: 6px; padding: 2px 0; }
.mgp-gap { flex: 1; min-width: 46px; }
.mgp-bin, .mgp-box, .mgp-tire { position: relative; flex: 1; min-width: 46px; border: 0; padding: 0; background: none; cursor: pointer; transition: transform .2s; }
.mgp-bin:hover, .mgp-box:hover, .mgp-tire:hover { transform: translateY(-3px); } .mgp-bin.sel, .mgp-box.sel, .mgp-tire.sel { transform: translateY(-5px); }
.mgp-bin { height: 74px; }
.mgp-bin .k-shell { position: absolute; inset: 0; border-radius: 5px 5px 3px 3px; background: linear-gradient(180deg, color-mix(in srgb, var(--b2) 70%, #000), var(--b2) 38%); box-shadow: 0 3px 4px rgba(0, 0, 0, .22); }
.mgp-bin .k-shell::after { content: ''; position: absolute; left: 6%; right: 6%; top: 5px; height: 24px; border-radius: 3px; background: color-mix(in srgb, var(--b1) 35%, #fff); }
.mgp-bin .k-part { position: absolute; left: 50%; top: 4px; width: 70%; height: 30px; transform: translateX(-50%); background: center bottom / contain no-repeat; mix-blend-mode: multiply; }
.mgp-bin .k-lip { position: absolute; left: 0; right: 0; bottom: 0; height: 64%; border-radius: 0 0 3px 3px; background: linear-gradient(180deg, var(--b1), var(--b2)); clip-path: polygon(0 18%, 14% 0, 86% 0, 100% 18%, 100% 100%, 0 100%); }
.mgp-bin .k-lip::before { content: ''; position: absolute; left: 14%; right: 14%; top: 0; height: 3px; background: rgba(255, 255, 255, .45); }
.mgp-bin.k-vide .k-shell { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(18, 26, 43, .06) 6px 12px); box-shadow: inset 0 0 0 2px #b8c1ce; border-radius: 6px; }
.mgp-bin.k-vide .k-shell::after, .mgp-bin.k-vide .k-lip { display: none; }
.mgp-box { flex: 1.4; height: 80px; }
.mgp-box .k-shell { position: absolute; inset: 0; border-radius: 3px; background: linear-gradient(180deg, #d6a96b, #c08d4f); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .1), 0 3px 4px rgba(0, 0, 0, .2); }
.mgp-box .k-shell::before { content: ''; position: absolute; left: 0; right: 0; top: 10px; height: 8px; background: rgba(255, 240, 200, .55); }
.mgp-box.k-vide .k-shell { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(18, 26, 43, .06) 6px 12px); box-shadow: inset 0 0 0 2px #b8c1ce; } .mgp-box.k-vide .k-shell::before { display: none; }
.mgp-tire { height: 92px; display: flex; justify-content: center; gap: 2px; }
.mgp-tire .k-t { width: 30%; height: 100%; border-radius: 10px; background: repeating-linear-gradient(180deg, #2a2d33 0 5px, #1b1d21 5px 9px); box-shadow: inset 3px 0 4px rgba(255, 255, 255, .12), inset -3px 0 6px rgba(0, 0, 0, .6), 0 3px 4px rgba(0, 0, 0, .25); }
.mgp-tire.k-vide .k-t { background: none; box-shadow: inset 0 0 0 2px #b8c1ce; }
.mgp-bin .k-tag, .mgp-box .k-tag, .mgp-tire .k-tag { position: absolute; left: 8%; right: 8%; bottom: 7px; height: 27px; z-index: 2; background: #fff; border-radius: 3px; display: grid; place-items: center; align-content: center; box-shadow: 0 1px 0 rgba(0, 0, 0, .15); }

.mgp-bin .k-tag b, .mgp-box .k-tag b, .mgp-tire .k-tag b { font: 700 clamp(8px, .7vw, 10px) 'DejaVu Sans Mono', Consolas, monospace; color: #111; line-height: 1; white-space: nowrap; }
.mgp-bin .k-tag i, .mgp-box .k-tag i, .mgp-tire .k-tag i { display: block; width: 78%; height: 6px; margin-top: 3px; background: repeating-linear-gradient(90deg, #111 0 1px, transparent 1px 2px, #111 2px 4px, transparent 4px 5px, #111 5px 6px, transparent 6px 8px); }
.mgp-bin.k-vide .k-tag, .mgp-box.k-vide .k-tag, .mgp-tire.k-vide .k-tag { background: rgba(255, 255, 255, .75); }
.mgp-bin .k-dot, .mgp-box .k-dot, .mgp-tire .k-dot { position: absolute; top: -5px; right: -5px; z-index: 3; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.mgp-bin .k-nb, .mgp-box .k-nb, .mgp-tire .k-nb { position: absolute; top: -6px; left: -5px; z-index: 3; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--navy); color: #fff; font: 700 11px/18px var(--font); }
.mgp-bin.sel .k-shell, .mgp-box.sel .k-shell, .mgp-tire.sel::before { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 6px; }
.mgp-tire.sel::before { content: ''; position: absolute; inset: 0; border-radius: 10px; }
.mgp-bin.hit .k-shell, .mgp-box.hit .k-shell { animation: mgpHit 1s ease-in-out 3; } @keyframes mgpHit { 50% { outline: 4px solid var(--red); outline-offset: 5px; } }
.mgp-ground { height: 14px; margin: 18px -18px 0 -54px; background: linear-gradient(180deg, #9aa4b2, #b7bfca); }
html[data-theme="dark"] .mgp-ground { background: linear-gradient(180deg, #2a3446, #222b3b); }
.mgp-rmeta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 16px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.mgp-cell { padding: 14px 16px 16px; }
.mgp-ctop { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.mgp-code { font: 800 26px/1.1 var(--cond); letter-spacing: .5px; color: var(--text); }
.mgp-bc { height: 46px; padding: 5px 10px; background: #fff; border: 1.5px solid var(--line); border-radius: 8px; display: grid; place-items: center; }
.mgp-acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.mgp-twrap { overflow-x: auto; margin-top: 10px; }
.mgp-items { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mgp-items th { text-align: left; font: 700 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 7px 6px; border-bottom: 2px solid var(--line); }
.mgp-items td { padding: 8px 6px; border-bottom: 1px solid var(--line-2); color: var(--text); vertical-align: middle; } .mgp-items .k-n { text-align: right; font-variant-numeric: tabular-nums; } .mgp-items td.k-n { font-weight: 700; } .mgp-items .k-r { text-align: right; }
.mgp-art { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; } .mgp-art:hover b { color: var(--red-text); }
.mgp-art .k-ph { flex: none; width: 36px; height: 36px; border-radius: 8px; background: #f1f3f7 center / 82% no-repeat; } .mgp-art small { display: block; color: var(--muted); }
.mgp-alert { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 9px 12px; border-radius: 10px; background: #fdeaea; color: #a3121a; font-size: 13px; font-weight: 600; }
@media (max-width: 1100px) { .mgp-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .mgp-tools { margin-left: 0; } .mgp-chips { margin-left: 0; } .mgp-acts { margin-left: 0; width: 100%; } .mgp-acts .btn { flex: 1; justify-content: center; } .mgp-items .k-hm { display: none; } .mgp-code { font-size: 22px; } .mgp-facade { padding-left: 46px; } .mgp-lvl .k-ln { left: -44px; } }
@media (prefers-reduced-motion: reduce) { .mgp-route, .mgp-pin, .mgp-bin.hit .k-shell, .mgp-box.hit .k-shell { animation: none; } }

/* v1.98.5 : recherche en direct d'une pièce du magasin (ajout sur une intervention) */
.pp-wrap { position: relative; }
.pp-list { position: fixed; z-index: 9000; max-height: 340px; overflow: auto; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(15, 23, 42, .18); padding: 4px; }
.pp-list[hidden] { display: none; }
.pp-it { display: grid; grid-template-columns: minmax(110px, auto) 1fr auto; gap: 4px 12px; align-items: center; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--text); cursor: pointer; font: inherit; }
.pp-it:hover, .pp-it.on { background: var(--line-2); }
.pp-ref { font: 700 13px 'DejaVu Sans Mono', Consolas, monospace; } .pp-ref small { display: block; font: 500 11px var(--font); color: var(--muted); }
.pp-lbl { font-size: 13.5px; min-width: 0; } .pp-lbl small { color: var(--muted); margin-left: 4px; }
.pp-av { font-size: 12.5px; white-space: nowrap; text-align: right; }
.pp-ok { color: #1f9a3e; font-weight: 600; } .pp-bad { color: #c62828; font-weight: 600; } .pp-muted { color: var(--muted); }
.pp-loc { display: inline-block; font: 700 11px var(--cond); background: var(--navy); color: #fff; border-radius: 5px; padding: 1px 6px; margin-left: 4px; }
.pp-head { padding: 8px 10px 4px; font-size: 12.5px; font-weight: 600; color: #a86a00; }
@media (max-width: 600px) { .pp-it { grid-template-columns: 1fr auto; } .pp-lbl { grid-column: 1 / -1; grid-row: 2; } }
