/* v1.0.690 — Personnalisation visuelle (maquettes) et bon à tirer — charte PRATINIUM */
:root {
  --pd-gold: #d4ab5c; --pd-bronze: #a87a2a; --pd-bronze-dark: #8f6420; --pd-ink: #1d1c1a;
  --pd-text: #2a2723; --pd-muted: #6b6457; --pd-line: #ece3cf; --pd-ivory: #fbf6ea; --pd-ivory-2: #f7edd6;
}
.pmp-pd-settings [hidden], .pmp-dsec [hidden], .pmp-de[hidden], .pmp-de [hidden], .pmp-dz [hidden] { display: none !important; }

/* ---------- Formulaire produit (fournisseur) ---------- */
.pmp-pd-settings { margin: 1.5rem 0; border: 1px solid var(--pd-line); border-radius: 16px; background: #fff; overflow: hidden; }
.pmp-pd-settings__head { padding: 16px 18px; background: var(--pd-ivory); }
.pmp-pd-switch { display: flex !important; align-items: flex-start; gap: 12px; margin: 0; cursor: pointer; }
.pmp-pd-switch input { position: absolute; opacity: 0; pointer-events: none; }
.pmp-pd-switch__ui { flex: 0 0 44px; height: 24px; border-radius: 999px; background: #d6cfbf; position: relative; transition: background .2s; margin-top: 2px; }
.pmp-pd-switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.pmp-pd-switch input:checked + .pmp-pd-switch__ui { background: var(--pd-bronze); }
.pmp-pd-switch input:checked + .pmp-pd-switch__ui::after { transform: translateX(20px); }
.pmp-pd-switch input:focus-visible + .pmp-pd-switch__ui { outline: 2px solid var(--pd-bronze); outline-offset: 2px; }
.pmp-pd-switch strong { display: block; color: var(--pd-ink); }
.pmp-pd-switch small { display: block; color: var(--pd-muted); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.pmp-pd-settings__body { padding: 16px 18px 18px; }
.pmp-pd-grid { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 12px; }
.pmp-pd-grid fieldset { border: 1px solid var(--pd-line); border-radius: 12px; padding: 10px 14px; margin: 0; }
.pmp-pd-grid legend { width: auto; padding: 0 6px; margin: 0; font-size: 13px; font-weight: 700; color: var(--pd-bronze-dark); }
.pmp-pd-grid label { display: flex !important; gap: 8px; align-items: flex-start; font-size: 14px; margin: 6px 0; color: var(--pd-text); }
.pmp-pd-grid input[type=checkbox] { margin-top: 3px; position: static !important; }
.pmp-pd-label { display: block; font-weight: 600; margin: 6px 0 4px; }
.pmp-pd-label small { font-weight: 400; color: var(--pd-muted); }
.pmp-pd-zones h4 { font-size: 15px; margin: 16px 0 4px; color: var(--pd-ink); }
.pmp-pd-hint { font-size: 13px; color: var(--pd-muted); margin: 0 0 10px; }
.pmp-pd-hint--warn { color: #8a5a00; background: #fff7e6; border: 1px solid #f5d48f; padding: 8px 10px; border-radius: 8px; }
.pmp-pd-zone-list { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pmp-pd-zone-card { border: 1px solid var(--pd-line); border-radius: 12px; padding: 10px; background: #fff; }
.pmp-pd-zone-card__head { display: grid; gap: 6px; margin-bottom: 8px; }
.pmp-pd-zone-check { display: flex !important; gap: 8px; align-items: center; margin: 0; font-size: 14px; font-weight: 600; }
.pmp-pd-zone-check input { position: static !important; }
.pmp-pd-stage { position: relative; user-select: none; touch-action: none; border-radius: 8px; overflow: hidden; background: #f4f1ea; }
.pmp-pd-stage img { display: block; width: 100%; height: auto; pointer-events: none; }
.pmp-pd-stage.is-off img { opacity: .55; }
.pmp-pd-box { position: absolute; border: 2px dashed var(--pd-bronze); background: rgba(212,171,92,.14); cursor: move; touch-action: none; }
.pmp-pd-box__label { position: absolute; left: 0; top: -1px; transform: translateY(-100%); background: var(--pd-bronze); color: #fff; font: 600 11px/1.4 Inter, system-ui, sans-serif; padding: 1px 6px; border-radius: 4px 4px 0 0; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pmp-pd-box__handle { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--pd-bronze); border-radius: 50%; }
.pmp-pd-box__handle--nw { left: -8px; top: -8px; cursor: nwse-resize; }
.pmp-pd-box__handle--ne { right: -8px; top: -8px; cursor: nesw-resize; }
.pmp-pd-box__handle--sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.pmp-pd-box__handle--se { right: -8px; bottom: -8px; cursor: nwse-resize; }

/* ---------- Bloc de la fiche offre ---------- */
.pmp-dsec { border: 1px solid var(--pd-line); border-radius: 16px; background: var(--pd-ivory); padding: 14px 16px; margin: 6px 0 16px; }
.pmp-dsec__badge { display: inline-block; font: 700 11px/1 Inter, system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; color: var(--pd-bronze-dark); background: #fff; border: 1px solid #e8d7ae; border-radius: 999px; padding: 5px 9px; }
.pmp-dsec__lead { margin: 8px 0 10px; font-size: 14px; color: var(--pd-text); line-height: 1.45; }
.pmp-dsec__current { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid #e3d3a8; border-radius: 12px; padding: 8px; margin-bottom: 10px; }
.pmp-dsec__current img { width: 84px; height: 84px; object-fit: contain; border-radius: 8px; background: #f4f1ea; flex: 0 0 auto; }
.pmp-dsec__current-info { display: grid; gap: 2px; font-size: 13px; color: var(--pd-muted); }
.pmp-dsec__current-info strong { color: #2e7d32; font-size: 14px; }
.pmp-dsec__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pmp-dsec__btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 18px; border-radius: 10px; font-weight: 700; font-size: 15px; cursor: pointer; border: 1px solid var(--pd-bronze); }
.pmp-dsec__btn--primary { background: linear-gradient(180deg, #b8893a, var(--pd-bronze)); color: #fff; box-shadow: 0 6px 14px rgba(168,122,42,.22); }
.pmp-dsec__btn--primary:hover, .pmp-dsec__btn--primary:focus-visible { background: var(--pd-bronze-dark); }
.pmp-dsec__saved { margin-top: 12px; }
.pmp-dsec__saved-title { font-size: 13px; font-weight: 700; color: var(--pd-ink); margin-bottom: 6px; }
.pmp-dsec__saved-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.pmp-dsec__saved-card { flex: 0 0 96px; display: grid; gap: 4px; padding: 6px; background: #fff; border: 1px solid var(--pd-line); border-radius: 10px; cursor: pointer; text-align: left; font-size: 12px; color: var(--pd-text); }
.pmp-dsec__saved-card:hover, .pmp-dsec__saved-card:focus-visible { border-color: var(--pd-bronze); }
.pmp-dsec__saved-card img { width: 100%; height: 72px; object-fit: contain; background: #f4f1ea; border-radius: 6px; }
.pmp-dsec__saved-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmp-dsec__link { background: none; border: 0; padding: 0; color: var(--pd-bronze-dark); font-weight: 600; font-size: 13px; text-decoration: underline; cursor: pointer; justify-self: start; }
.pmp-dsec__note-label { display: grid; gap: 4px; margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--pd-ink); }
.pmp-dsec__note { width: 100%; border: 1px solid var(--pd-line); border-radius: 10px; padding: 8px 10px; font-size: 14px; font-weight: 400; background: #fff; }
.pmp-dsec__muted { font-size: 13px; color: var(--pd-muted); margin: 0; }
.pmp-dsec__err { color: #b42318; font-size: 13px; font-weight: 600; margin-top: 8px; }
.pmp-dsec__err:empty { display: none; }

/* ---------- Éditeur (plein écran) ---------- */
html.pmp-de-open, html.pmp-de-open body { overflow: hidden !important; }
.pmp-de { position: fixed; inset: 0; z-index: 100000; background: rgba(13,12,11,.66); display: flex; align-items: center; justify-content: center; padding: 16px; font-family: Inter, "Helvetica Neue", Arial, sans-serif; }
.pmp-de__win { width: min(1240px, 100%); height: min(860px, 100%); background: #fff; border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 70px rgba(0,0,0,.35); }
.pmp-de__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: linear-gradient(180deg, #24221f, var(--pd-ink)); border-bottom: 1px solid rgba(212,171,92,.45); }
.pmp-de__title { color: #f3e6c7; font-size: 16px; }
.pmp-de__close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(212,171,92,.5); background: transparent; color: #ecd08c; font-size: 16px; cursor: pointer; }
.pmp-de__close:hover, .pmp-de__close:focus-visible { background: rgba(212,171,92,.16); color: #fff; }
.pmp-de__views { display: flex; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--pd-line); background: var(--pd-ivory); overflow-x: auto; }
.pmp-de__view { border: 1px solid var(--pd-line); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--pd-text); cursor: pointer; white-space: nowrap; }
.pmp-de__view.is-on { background: var(--pd-bronze); border-color: var(--pd-bronze); color: #fff; }
.pmp-de__main { flex: 1; min-height: 0; display: grid; grid-template-columns: 96px 1fr 260px; }
.pmp-de__tools { display: flex; flex-direction: column; gap: 6px; padding: 10px 8px; border-right: 1px solid var(--pd-line); background: #fff; overflow-y: auto; }
.pmp-de__tool { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--pd-text); cursor: pointer; }
.pmp-de__tool:hover, .pmp-de__tool:focus-visible { background: var(--pd-ivory); }
.pmp-de__tool.is-on { background: var(--pd-ivory-2); border-color: #e3cf9e; color: var(--pd-bronze-dark); }
.pmp-de__tool-ico { font-size: 20px; line-height: 1; font-weight: 700; }
.pmp-de__tool-txt { font-size: 11px; font-weight: 600; text-align: center; }
.pmp-de__sep { height: 1px; background: var(--pd-line); margin: 4px 6px; }
.pmp-de__stage { position: relative; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#f3efe6 0 25%, #fbf8f1 0 50%) 0 0 / 22px 22px; min-height: 0; overflow: hidden; padding: 8px 8px 44px; }
.pmp-de__canvas { display: block; box-shadow: 0 6px 24px rgba(0,0,0,.12); border-radius: 6px; touch-action: none; background: #fff; }
.pmp-de__canvas:focus { outline: none; }
.pmp-de__stage.is-over .pmp-de__hint { background: #fff4e5; color: #8a4b00; font-weight: 600; }
.pmp-de__hint { position: absolute; left: 10px; right: 10px; bottom: 8px; font-size: 12px; color: var(--pd-muted); text-align: center; background: rgba(255,255,255,.85); border-radius: 8px; padding: 5px 8px; }
.pmp-de__props { border-left: 1px solid var(--pd-line); padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; background: #fff; }
.pmp-de__props h4 { margin: 0; font-size: 15px; color: var(--pd-ink); }
.pmp-de__props label { margin: 4px 0 0; font-size: 12px; font-weight: 700; color: var(--pd-muted); text-transform: uppercase; letter-spacing: .03em; }
.pmp-de__props textarea, .pmp-de__props select { width: 100%; border: 1px solid var(--pd-line); border-radius: 8px; padding: 8px; font-size: 14px; background: #fff; }
.pmp-de__props input[type=range] { width: 100%; accent-color: var(--pd-bronze); }
.pmp-de__muted { font-size: 13px; color: var(--pd-muted); margin: 0; }
.pmp-de__note { font-size: 13px; background: var(--pd-ivory); border: 1px solid var(--pd-line); border-radius: 8px; padding: 8px; margin: 0; color: var(--pd-text); }
.pmp-de__row { display: flex; gap: 6px; }
.pmp-de__row--wrap { flex-wrap: wrap; margin-top: 8px; }
.pmp-de__toggle { width: 38px; height: 34px; border: 1px solid var(--pd-line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 15px; }
.pmp-de__toggle.is-on { background: var(--pd-ivory-2); border-color: var(--pd-bronze); color: var(--pd-bronze-dark); }
.pmp-de__swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pmp-de__swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #d6cfbf; cursor: pointer; padding: 0; }
.pmp-de__swatch.is-on { box-shadow: 0 0 0 2px var(--pd-bronze); }
.pmp-de__color { width: 32px; height: 28px; border: 1px solid var(--pd-line); border-radius: 6px; padding: 0; background: none; cursor: pointer; }
.pmp-de__mini { border: 1px solid var(--pd-line); background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--pd-text); }
.pmp-de__mini:hover, .pmp-de__mini:focus-visible { border-color: var(--pd-bronze); }
.pmp-de__mini--danger { color: #b42318; }
.pmp-de__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--pd-line); background: var(--pd-ivory); }
.pmp-de__name { flex: 1 1 220px; min-height: 42px; border: 1px solid var(--pd-line); border-radius: 10px; padding: 8px 12px; font-size: 14px; background: #fff; }
.pmp-de__msg { flex: 1 1 100%; order: 3; font-size: 13px; min-height: 1em; }
.pmp-de__msg.is-err { color: #b42318; font-weight: 600; }
.pmp-de__msg.is-ok { color: #2e7d32; font-weight: 600; }
.pmp-de__btn { min-height: 44px; padding: 8px 18px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; border: 1px solid var(--pd-bronze); }
.pmp-de__btn--ghost { background: #fff; color: var(--pd-bronze-dark); }
.pmp-de__btn--ghost:hover, .pmp-de__btn--ghost:focus-visible { background: var(--pd-ivory-2); }
.pmp-de__btn--primary { background: linear-gradient(180deg, #b8893a, var(--pd-bronze)); color: #fff; }
.pmp-de__btn--primary:hover, .pmp-de__btn--primary:focus-visible { background: var(--pd-bronze-dark); }
@media (max-width: 860px) {
  .pmp-de { padding: 0; }
  .pmp-de__win { height: 100%; border-radius: 0; }
  .pmp-de__main { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .pmp-de__tools { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--pd-line); overflow-x: auto; padding: 6px; }
  .pmp-de__tool { min-width: 64px; }
  .pmp-de__sep { width: 1px; height: auto; margin: 4px 2px; }
  .pmp-de__props { border-left: 0; border-top: 1px solid var(--pd-line); max-height: 34vh; }
  .pmp-de__btn { flex: 1 1 100%; }
}

/* ---------- Mes maquettes / BAT (acheteur) et commandes (fournisseur) ---------- */
.pmp-dz { font-family: Inter, "Helvetica Neue", Arial, sans-serif; color: var(--pd-text); }
.pmp-dz h2 { font-size: 20px; margin: 22px 0 10px; color: var(--pd-ink); }
.pmp-dz__flash { padding: 10px 14px; border-radius: 10px; margin: 10px 0; font-weight: 600; }
.pmp-dz__flash--ok { background: #ecfdf3; border: 1px solid #a6e9c2; color: #116936; }
.pmp-dz__flash--err { background: #fef3f2; border: 1px solid #fecdca; color: #b42318; }
.pmp-dz__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.pmp-dz__card { border: 1px solid var(--pd-line); border-radius: 14px; background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.pmp-dz__thumb { aspect-ratio: 1 / 1; background: #f4f1ea; display: flex; align-items: center; justify-content: center; }
.pmp-dz__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pmp-dz__body { padding: 10px 12px 12px; display: grid; gap: 6px; }
.pmp-dz__name { font-weight: 700; color: var(--pd-ink); }
.pmp-dz__meta { font-size: 12px; color: var(--pd-muted); }
.pmp-dz__acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pmp-dz__btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 12px; border-radius: 9px; font-size: 13px; font-weight: 700; border: 1px solid var(--pd-bronze); background: #fff; color: var(--pd-bronze-dark) !important; cursor: pointer; text-decoration: none !important; }
.pmp-dz__btn--primary { background: linear-gradient(180deg, #b8893a, var(--pd-bronze)); color: #fff !important; }
.pmp-dz__btn--danger { border-color: #f1b5ae; color: #b42318 !important; }
.pmp-dz__btn:hover, .pmp-dz__btn:focus-visible { filter: brightness(.96); }
.pmp-dz__empty { padding: 18px; border: 1px dashed #e3d3a8; border-radius: 12px; background: var(--pd-ivory); color: var(--pd-muted); }
.pmp-dz__order { border: 1px solid var(--pd-line); border-radius: 14px; background: #fff; padding: 14px; margin-bottom: 14px; }
.pmp-dz__order-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.pmp-dz__order-head strong { color: var(--pd-ink); }
.pmp-dz__status { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef2f6; color: #344054; }
.pmp-dz__status.is-submitted, .pmp-dz__status.is-changes_requested { background: #fff4e5; color: #8a4b00; }
.pmp-dz__status.is-proof_sent { background: #eaf2ff; color: #1d4ed8; }
.pmp-dz__status.is-approved, .pmp-dz__status.is-no_bat { background: #ecfdf3; color: #116936; }
.pmp-dz__previews { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.pmp-dz__previews a { display: block; width: 120px; height: 120px; border: 1px solid var(--pd-line); border-radius: 10px; background: #f4f1ea; overflow: hidden; }
.pmp-dz__previews img { width: 100%; height: 100%; object-fit: contain; }
.pmp-dz__detail { font-size: 13px; display: grid; gap: 4px; }
.pmp-dz__history { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.pmp-dz__history li { border-left: 3px solid var(--pd-line); padding: 4px 10px; font-size: 13px; }
.pmp-dz__history li.is-proof { border-color: #93c5fd; }
.pmp-dz__history li.is-approve { border-color: #86efac; }
.pmp-dz__history li.is-changes { border-color: #fdba74; }
.pmp-dz__history img { display: block; max-width: 220px; max-height: 220px; margin-top: 6px; border-radius: 8px; border: 1px solid var(--pd-line); }
.pmp-dz__form { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--pd-line); }
.pmp-dz__form textarea { width: 100%; border: 1px solid var(--pd-line); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.pmp-dz__form-row { display: flex; flex-wrap: wrap; gap: 8px; }
