/* 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: 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: 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; }
