/* Démo « workflow » : vue formulaire d'une commande de vente Odoo 19 (mode clair), enrichie par un module sur mesure */
.lp-workflow{--wf-prune:#714b67;--wf-prune-dark:#5e3f56;--wf-teal:#017e84;--wf-ink:#111827;--wf-text:#374151;--wf-muted:#6b7280;--wf-line:#dee2e6;--wf-line2:#eceef1;--wf-bg:#f8f9fa;
  position:relative;z-index:1;container-type:inline-size;font-family:Inter,Arial,sans-serif;font-size:12px;color:var(--wf-text)}
.lp-workflow *{box-sizing:border-box}
.lp-workflow p,.lp-workflow dl,.lp-workflow dd,.lp-workflow ul,.lp-workflow ol,.lp-workflow h3{margin:0;padding:0}
.lp-workflow svg{display:block;flex:none}

/* Légende au-dessus de la fenêtre */
.lp-workflow-cap{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 2px 10px;min-width:0}
.lp-workflow-ver{padding:3px 10px;border-radius:999px;background:#fff;border:1px solid #e4def2;font-size:11px;font-weight:600;color:#5b5470;white-space:nowrap}
.lp-workflow-legend{display:inline-flex;align-items:center;gap:7px;min-width:0;font-size:11px;font-weight:600;color:#4b16d0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lp-workflow-legend i{flex:none;width:14px;height:10px;border-radius:3px;border:1.5px dashed #8b6cf0;background:#f4effe}

/* Fenêtre */
.lp-workflow-win{background:var(--wf-bg);border:1px solid #e1dbea;border-radius:14px;overflow:hidden;box-shadow:0 30px 70px -20px rgba(42,20,110,.28),0 10px 24px -12px rgba(42,20,110,.18)}

/* Barre de navigation Odoo */
.lp-workflow-nav{display:flex;align-items:center;gap:12px;height:38px;padding:0 12px;background:#fff;border-bottom:1px solid var(--wf-line);min-width:0}
.lp-workflow-apps{color:var(--wf-text)}.lp-workflow-apps svg{width:15px;height:15px}
.lp-workflow-appname{font-size:13px;font-weight:600;color:var(--wf-ink);white-space:nowrap}
.lp-workflow-menus{flex:1;min-width:0;display:flex;align-items:center;gap:13px;overflow:hidden;white-space:nowrap}
.lp-workflow-menu{font-size:12px;color:var(--wf-text)}
.lp-workflow-more{display:none;font-size:13px;color:var(--wf-text)}
.lp-workflow-sys{display:flex;align-items:center;gap:12px;flex:none;color:var(--wf-text)}
.lp-workflow-sysic{position:relative}.lp-workflow-sysic svg{width:16px;height:16px}
.lp-workflow-sysic b{position:absolute;right:-7px;top:-6px;min-width:13px;height:13px;padding:0 3px;border-radius:7px;background:var(--wf-prune);color:#fff;font-size:8.5px;line-height:13px;text-align:center;font-weight:700}
.lp-workflow-me{display:grid;place-items:center;width:22px;height:22px;border-radius:5px;background:#2563a8;color:#fff;font-size:11px;font-weight:600}

/* Panneau de contrôle */
.lp-workflow-cp{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 14px 7px;background:#fff;min-width:0}
.lp-workflow-crumb{display:flex;align-items:center;gap:6px;min-width:0;white-space:nowrap;font-size:13px}
.lp-workflow-crumb a{color:var(--wf-teal);font-weight:500}
.lp-workflow-crumb-sep{color:#adb5bd}
.lp-workflow-crumb strong{color:var(--wf-ink);font-weight:600}
.lp-workflow-cog{color:var(--wf-muted)}.lp-workflow-cog svg{width:13px;height:13px}
.lp-workflow-pager{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--wf-muted);white-space:nowrap}
.lp-workflow-pager>span{display:grid;place-items:center;width:20px;height:20px;border-radius:4px;background:#eef0f2;color:var(--wf-text)}
.lp-workflow-pager svg{width:11px;height:11px}

/* En-tête du formulaire : boutons et barre de statut */
.lp-workflow-hd{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 14px 8px;background:#fff;border-bottom:1px solid var(--wf-line);min-width:0}
.lp-workflow-btns{display:flex;gap:6px;min-width:0}
.lp-workflow-btn{padding:5px 9px;border-radius:4px;background:#e7e9ed;color:var(--wf-ink);font-size:11.5px;font-weight:500;white-space:nowrap;transition:background .25s,color .25s,transform .15s}
.lp-workflow-btn.is-primary{background:var(--wf-prune);color:#fff}
.lp-workflow-btn.is-press{transform:scale(.94);background:var(--wf-prune-dark);color:#fff}
.lp-workflow-status{list-style:none;display:flex;flex:none}
.lp-workflow-status li{position:relative;margin-left:-6px;padding:5px 13px 5px 15px;background:#fff;color:var(--wf-muted);font-size:11px;font-weight:500;white-space:nowrap;clip-path:polygon(0 0,calc(100% - 7px) 0,100% 50%,calc(100% - 7px) 100%,0 100%,7px 50%);box-shadow:inset 0 0 0 1px var(--wf-line);transition:background .3s,color .3s}
.lp-workflow-status li::before{content:"";position:absolute;inset:0;background:var(--wf-line);clip-path:polygon(calc(100% - 7px) 0,100% 50%,calc(100% - 7px) 100%,calc(100% - 8px) 100%,calc(100% - 1px) 50%,calc(100% - 8px) 0)}
.lp-workflow-status li:first-child{margin-left:0;padding-left:10px;clip-path:polygon(0 0,calc(100% - 7px) 0,100% 50%,calc(100% - 7px) 100%,0 100%)}
.lp-workflow-status li.is-current{background:#f1e9ef;color:var(--wf-prune);font-weight:600}

/* Bandeau ajouté par le module sur mesure */
.lp-workflow-alert{position:relative;display:flex;align-items:flex-start;gap:8px;margin:10px 14px 0;padding:8px 10px;border-radius:6px;font-size:11.5px;line-height:1.4;transition:background .3s,color .3s,border-color .3s;
  background:#e2f2f6;color:#0b5a69;border:1px solid #c3e5ec;outline:1.5px dashed #a68ff5;outline-offset:3px}
.lp-workflow-alert.is-ok{background:#ddf1e4;color:#14532d;border-color:#bfe3cb}
.lp-workflow-alert-ic{position:relative;flex:none;width:15px;height:15px;margin-top:1px}
.lp-workflow-alert-ic>span{position:absolute;inset:0;transition:opacity .2s}
.lp-workflow-alert-ic svg{width:15px;height:15px}
.lp-workflow-ic-ok{opacity:0}
.lp-workflow-alert.is-ok .lp-workflow-ic-ok{opacity:1}.lp-workflow-alert.is-ok .lp-workflow-ic-info{opacity:0}
.lp-workflow-alert.is-run .lp-workflow-ic-info{opacity:0}
.lp-workflow-alert.is-run .lp-workflow-alert-ic::after{content:"";position:absolute;inset:1px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:lpWfSpin .7s linear infinite}
@keyframes lpWfSpin{to{transform:rotate(360deg)}}
.lp-workflow-alert-text{flex:1;min-width:0;display:grid}
.lp-workflow-alert-text>span{grid-area:1/1;opacity:0;visibility:hidden;transition:opacity .25s,visibility .25s}
.lp-workflow-alert-text>span.is-on{opacity:1;visibility:visible}
.lp-workflow-tag{flex:none;align-self:flex-start;padding:1px 7px;border-radius:999px;background:linear-gradient(135deg,#6024f5,#8b5cff);color:#fff;font-size:9.5px;font-weight:700;line-height:15px;white-space:nowrap}

/* Feuille */
.lp-workflow-sheet{margin:10px 14px 0;padding:10px 14px 12px;background:#fff;border:1px solid var(--wf-line);border-radius:6px;min-width:0}
.lp-workflow-smart{display:flex;justify-content:flex-end;gap:0;height:34px;margin:0 -2px 2px;min-width:0}
.lp-workflow-sb{display:flex;align-items:center;gap:7px;padding:0 10px;border-left:1px solid var(--wf-line2);color:var(--wf-text);transition:opacity .35s,transform .35s}
.lp-workflow-sb svg{width:16px;height:16px;color:var(--wf-muted)}
.lp-workflow-sb>span{display:grid;font-size:11px;line-height:1.2;color:var(--wf-muted);white-space:nowrap}
.lp-workflow-sb b{font-size:12px;font-weight:700;color:var(--wf-ink)}
.lp-workflow-sb.is-off{opacity:0;transform:translateY(-4px)}
.lp-workflow-title{font:500 22px/1.15 Inter,Arial,sans-serif;color:var(--wf-ink);letter-spacing:-.01em;margin:0 0 10px}
.lp-workflow-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 18px}
.lp-workflow-fields div{display:grid;grid-template-columns:minmax(0,46%) minmax(0,1fr);gap:8px;padding:3px 0}
.lp-workflow-fields dt{font-size:11.5px;font-weight:600;color:var(--wf-ink);line-height:1.35}
.lp-workflow-fields dd{font-size:11.5px;color:var(--wf-text);line-height:1.35;min-width:0}
.lp-workflow-fields dd small{display:block;font-size:10.5px;color:var(--wf-muted)}
.lp-workflow-tabs{display:flex;gap:2px;margin-top:12px;border-bottom:1px solid var(--wf-line);white-space:nowrap;overflow:hidden}
.lp-workflow-tabs span{padding:6px 10px;font-size:11.5px;color:var(--wf-muted);border:1px solid transparent;border-bottom:0;border-radius:5px 5px 0 0;margin-bottom:-1px}
.lp-workflow-tabs span.is-active{color:var(--wf-ink);font-weight:600;background:#fff;border-color:var(--wf-line)}
.lp-workflow-lines{width:100%;border-collapse:collapse;table-layout:fixed;margin-top:2px}
.lp-workflow-lines th{padding:7px 4px;font-size:10.5px;font-weight:600;color:var(--wf-ink);text-align:right;border-bottom:1px solid var(--wf-line);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lp-workflow-lines td{padding:7px 4px;font-size:11.5px;color:var(--wf-text);text-align:right;border-bottom:1px solid var(--wf-line2);white-space:nowrap;font-variant-numeric:tabular-nums}
.lp-workflow-lines th:first-child,.lp-workflow-lines td:first-child{text-align:left;padding-left:0;white-space:normal;line-height:1.3}
.lp-workflow-lines th:last-child,.lp-workflow-lines td:last-child{padding-right:0}
.lp-workflow-lines col,.lp-workflow-lines th:nth-child(1){width:34%}
.lp-workflow-lines th:nth-child(2){width:15%}.lp-workflow-lines th:nth-child(3){width:17%}.lp-workflow-lines th:nth-child(4){width:12%}.lp-workflow-lines th:nth-child(5){width:22%}
.lp-workflow-badge{display:inline-block;padding:1px 6px;border-radius:999px;background:#e7e9ed;color:var(--wf-text);font-size:10.5px}
.lp-workflow .lp-workflow-totals{width:min(240px,62%);margin:8px 0 0 auto}
.lp-workflow-totals div{display:flex;justify-content:space-between;gap:12px;padding:2px 0;font-size:11.5px;font-variant-numeric:tabular-nums}
.lp-workflow-totals dt{color:var(--wf-muted)}.lp-workflow-totals dd{color:var(--wf-ink);white-space:nowrap}
.lp-workflow-totals .is-total{margin-top:3px;padding-top:5px;border-top:1px solid var(--wf-line);font-size:13px;font-weight:700}
.lp-workflow-totals .is-total dt{color:var(--wf-ink)}

/* Chatter (sous la feuille, comme Odoo sous ~1530 px d'écran) */
.lp-workflow-chatter{margin:10px 14px 14px;padding:10px 12px 0;background:#fff;border:1px solid var(--wf-line);border-radius:6px;min-width:0}
.lp-workflow-chat-top{display:flex;align-items:center;gap:6px;min-width:0}
.lp-workflow-cbtn{padding:4px 8px;border-radius:4px;background:#e7e9ed;color:var(--wf-ink);font-size:11px;font-weight:500;white-space:nowrap}
.lp-workflow-cbtn.is-primary{background:var(--wf-prune);color:#fff}
.lp-workflow-chat-tools{display:flex;align-items:center;gap:9px;margin-left:auto;color:var(--wf-muted);flex:none}
.lp-workflow-chat-tools svg{width:14px;height:14px}
.lp-workflow-follow{font-size:11px;font-weight:600;color:var(--wf-teal)}
.lp-workflow-msgs{position:relative;height:150px;margin-top:8px;overflow:hidden}
.lp-workflow-msgs::after{content:"";position:absolute;left:0;right:0;bottom:0;height:26px;background:linear-gradient(rgba(255,255,255,0),#fff);pointer-events:none}
.lp-workflow-msgs ul{list-style:none;position:absolute;inset:0 0 auto}
.lp-workflow-msg{display:flex;gap:9px;max-height:120px;padding:7px 4px 7px;border-top:1px solid var(--wf-line2);overflow:hidden;transition:max-height .45s ease,opacity .35s ease,padding .45s ease,background .4s}
.lp-workflow-msg:first-child{border-top-color:transparent}
.lp-workflow-msg.is-off{max-height:0;opacity:0;padding-top:0;padding-bottom:0}
.lp-workflow-msg.is-new{background:#fbf8fd}
.lp-workflow-msg.is-custom{margin:2px 0;border-radius:6px;outline:1.5px dashed #a68ff5;outline-offset:-2px;background:#faf8ff}
.lp-workflow-av{flex:none;display:grid;place-items:center;width:26px;height:26px;border-radius:5px;color:#fff;font-size:12px;font-weight:600}
.lp-workflow-msg>div{min-width:0;flex:1}
.lp-workflow-msg-head{display:flex;align-items:center;gap:6px;min-width:0;font-size:11.5px;line-height:1.3}
.lp-workflow-msg-head strong{color:var(--wf-ink);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lp-workflow-msg-head>span:not(.lp-workflow-tag){flex:none;color:var(--wf-muted);font-size:10.5px}
.lp-workflow-msg-head .lp-workflow-tag{margin-left:auto}
.lp-workflow-msg-text,.lp-workflow-track{margin-top:2px;font-size:11.5px;line-height:1.4;color:var(--wf-text)}
.lp-workflow-track span{color:var(--wf-muted)}.lp-workflow-track b{font-weight:600;color:var(--wf-ink)}.lp-workflow-track em{font-style:normal;color:var(--wf-muted)}

/* Largeur moyenne : menus repliés derrière « + » (comme Odoo) */
@container (max-width:540px){
  .lp-workflow-menu-3,.lp-workflow-menu-4{display:none}
  .lp-workflow-more{display:inline}
  .lp-workflow-fields{grid-template-columns:minmax(0,1fr)}
  .lp-workflow-fields div{grid-template-columns:minmax(0,34%) minmax(0,1fr)}
  .lp-workflow-fields dd small{display:inline;margin-left:6px}
}
/* Petite largeur (mobile) : barre du haut simplifiée, champs sur une colonne, statut courant seul */
@container (max-width:440px){
  .lp-workflow-menus{visibility:hidden}
  .lp-workflow-cp,.lp-workflow-hd{padding-left:10px;padding-right:10px}
  .lp-workflow-btn[data-wf-btn="1"]{display:none}
  .lp-workflow-status li:not(.is-current){display:none}
  .lp-workflow-status li.is-current{margin-left:0;padding:5px 10px;clip-path:none;border-radius:4px}
  .lp-workflow-status li.is-current::before{display:none}
  .lp-workflow-alert{margin:8px 10px 0;flex-wrap:wrap}
  .lp-workflow-alert-text{flex-basis:calc(100% - 24px)}
  .lp-workflow-alert .lp-workflow-tag{margin-left:23px}
  .lp-workflow-sheet{margin:8px 10px 0;padding:8px 10px 10px}
  .lp-workflow-smart{justify-content:flex-start;margin-left:-10px}
  .lp-workflow-sb{padding:0 8px}
  .lp-workflow-sb:first-child{border-left:0}
  .lp-workflow-cap{flex-wrap:wrap;row-gap:6px}
  .lp-workflow-fields div{grid-template-columns:minmax(0,40%) minmax(0,1fr)}
  .lp-workflow-fields dd small{display:block;margin:0}
  .lp-workflow-tab-2{display:none}
  /* Lignes en cartes, comme la vue mobile d'Odoo */
  .lp-workflow-lines thead{display:none}
  .lp-workflow-lines,.lp-workflow-lines tbody{display:block}
  .lp-workflow-lines tr{display:grid;grid-template-columns:auto auto auto minmax(0,1fr) auto;align-items:center;column-gap:6px;padding:7px 0;border-bottom:1px solid var(--wf-line2)}
  .lp-workflow-lines td{padding:0;border:0;font-size:11px}
  .lp-workflow-lines td:first-child{grid-column:1/5;grid-row:1;font-weight:600;color:var(--wf-ink)}
  .lp-workflow-lines td:nth-child(5){grid-column:5;grid-row:1;font-weight:600;color:var(--wf-ink)}
  .lp-workflow-lines td:nth-child(2),.lp-workflow-lines td:nth-child(3),.lp-workflow-lines td:nth-child(4){grid-row:2;margin-top:3px;color:var(--wf-muted);text-align:left}
  .lp-workflow-lines td:nth-child(3)::before{content:"× "}
  .lp-workflow .lp-workflow-totals{width:100%}
  .lp-workflow-chatter{margin:8px 10px 10px;padding:8px 10px 0}
  .lp-workflow-chat-tools{display:none}
  .lp-workflow-cbtn{padding:4px 7px;font-size:10.5px}
  .lp-workflow-msgs{height:190px}
}
@media (prefers-reduced-motion:reduce){.lp-workflow *{animation:none!important;transition:none!important}}
