/* Sorti de commandes.php le 19/09/2026.
 *
 * Les feuilles etaient ecrites dans les pages, ce qui obligeait la
 * politique de securite a autoriser 'unsafe-inline' sur style-src : toute
 * injection de HTML devenait alors une injection de style. En fichier, le
 * navigateur peut les mettre en cache, et la politique peut se fermer.
 *
 * Deplace sans une modification : ce qui suit est le bloc d'origine. */

html,body{height:100%;overflow:hidden;}
.app{height:100vh;overflow:hidden;}
.main{height:100vh;min-height:0;overflow:hidden;display:flex;flex-direction:column;}
.cmd-shell{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;}

/* ONZE VUES, ET LA BARRE COUPAIT LA DERNIERE.
   Sans defilement, « Cloturees » n'etait atteignable qu'en repliant le menu
   lateral — c'est-a-dire en agrandissant la fenetre. C'est exactement la vue
   dont l'absence avait deja rendu 1 398 commandes invisibles.
   Le trait de la vue active est une ombre interne et non une bordure
   debordante : sans quoi `overflow-x` ferait apparaitre une barre de
   defilement verticale de deux pixels. */
/* ELLE PASSE A LA LIGNE, ELLE NE DEFILE PLUS.
 *
 * C'etait `overflow-x:auto` : a dix onglets la barre debordait, et on faisait
 * defiler une barre d'onglets pour retrouver une vue — un geste qu'on ne devine
 * pas, et qui cache la moitie des vues a celui qui ne pense pas a le faire.
 *
 * `flex-wrap` ne cache RIEN a aucune largeur : au pire la barre prend deux
 * lignes. C'est aussi ce qui fait qu'ajouter une onzieme vue demain ne
 * rouvrira pas le probleme. */
.cmd-stats{display:flex;flex-wrap:wrap;gap:2px;padding:0 var(--space-5);background:#fff;flex-shrink:0;margin:var(--space-5) var(--space-8) 0;border-radius:10px;border:1px solid #d9d9d9;}
/* Onze vues, et elles doivent tenir. Resserrees a 11 px et le libelle a
   .7rem, la barre ne deborde plus a la largeur de travail habituelle : le
   defilement horizontal reste en place comme filet pour les ecrans plus
   etroits, mais il ne se declenche plus tous les jours. */
.cmd-stat{display:inline-flex;align-items:center;gap:6px;padding:11px 11px;cursor:pointer;box-shadow:inset 0 -2px 0 transparent;transition:color .15s,box-shadow .15s;flex-shrink:0;white-space:nowrap;color:var(--grey-400);}
.cmd-stat:hover{color:var(--grey-700);}
.cmd-stat.active{color:var(--psg-navy);box-shadow:inset 0 -2px 0 var(--psg-navy);}
.cmd-stat svg{width:14px;height:14px;flex-shrink:0;}
.cmd-stat-label{font-size:.7rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;}
.cmd-stat-count{font-size:.65rem;font-weight:800;background:var(--grey-100);border-radius:999px;padding:1px 7px;color:var(--grey-500);}
.cmd-stat.active .cmd-stat-count{background:var(--psg-navy);color:#fff;}
.cmd-stat.urgence{color:#dc2626;}
.cmd-stat.urgence .cmd-stat-count{background:#fee2e2;color:#dc2626;}
.cmd-stat.urgence.active{border-bottom-color:#dc2626;}
.cmd-stat.urgence.active .cmd-stat-count{background:#dc2626;color:#fff;}

.cmd-content{flex:1;min-height:0;overflow-y:auto;padding:var(--space-5) var(--space-8);background:var(--grey-100);}
.cmd-card{display:flex;flex-direction:column;overflow:hidden;}
.cmd-toolbar{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-5) var(--space-5);border-bottom:1px solid var(--grey-100);}
.cmd-table-wrap{overflow-x:auto;}
.cmd-table{width:100%;border-collapse:collapse;font-size:.875rem;table-layout:fixed;}
.cmd-table th{padding:9px 14px;font-weight:800;font-size:.65rem;text-transform:uppercase;letter-spacing:.05em;color:var(--grey-500);border-bottom:2px solid var(--grey-100);text-align:left;white-space:nowrap;position:sticky;top:0;background:#fff;z-index:1;}
.cmd-table td{padding:10px 14px;border-bottom:1px solid var(--grey-50);vertical-align:middle;color:var(--grey-700);font-weight:600;}
.cmd-table tbody tr{cursor:pointer;transition:background .1s;}
.cmd-table tbody tr:hover{background:var(--grey-50);}
.cmd-table tbody tr:last-child td{border-bottom:0;}
.cmd-table tbody tr.go-selected{background:#eff6ff;}
.status-pill{display:inline-flex;align-items:center;border-radius:999px;padding:3px 9px;font-size:.68rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;background:var(--grey-100);color:var(--grey-700);white-space:nowrap;}
.status-pill.prioritaire,.status-pill.litige,.status-pill.sav{background:#fee2e2;color:#991b1b;}
.status-pill.processing{background:#dbeafe;color:#1e40af;}
.status-pill.terminee,.status-pill.traitee{background:#dcfce7;color:#166534;}
.orders-products{width:100%;overflow:hidden;color:var(--grey-600);}
.orders-products-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;}
.order-link{color:var(--psg-navy);font-weight:800;text-decoration:none;}
.order-link:hover{color:var(--psg-red);}
.cmd-empty{padding:60px;text-align:center;color:var(--grey-400);font-weight:700;}
.cmd-page-header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-5) var(--space-8) 0;flex-shrink:0;gap:var(--space-3);}
.cmd-page-kicker{font-size:.68rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:var(--psg-gold-dark, #b8860b);margin-bottom:2px;}
.cmd-page-title{font-size:1.5rem;font-weight:900;color:var(--psg-navy);margin:0;line-height:1.1;}
.cmd-page-sub{font-size:.8rem;color:var(--grey-400);font-weight:600;margin-top:3px;}
.cmd-pagination{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-3) var(--space-5);border-top:1px solid var(--grey-100);flex-shrink:0;}
.cmd-pagination-right{display:flex;align-items:center;gap:var(--space-2);margin-left:auto;}

/* ── Modal overlay (not in main.css — defined per-page) ── */
.modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:900;align-items:center;justify-content:center;}
.modal-overlay.open{display:flex;}

/* ── Checkbox column ── */
.cmd-cb-col{width:36px;text-align:center;}
.cmd-cb-col input[type=checkbox]{width:15px;height:15px;cursor:pointer;accent-color:var(--psg-navy);}

/* ── Commande Groupée button + badge ── */
#btnGroupedOrder{position:relative;}
#goSelCount{display:none;position:absolute;top:-4px;right:-6px;background:#dc2626;color:#fff;border-radius:999px;font-size:.55rem;font-weight:900;padding:2px 5px;min-width:14px;text-align:center;line-height:1;}
#goSelCount.visible{display:block;}

/* ── Grouped order modal ── */
.go-modal-box{max-width:920px!important;width:96%!important;max-height:92vh;overflow-y:auto;}
.go-section-label{font-size:.68rem;font-weight:900;text-transform:uppercase;letter-spacing:.06em;color:var(--grey-400);margin:0 0 6px;}
.go-add-bar{display:flex;gap:6px;margin-bottom:4px;}
.go-add-bar input{flex:1;}
.go-search-results{background:#fff;border:1px solid var(--grey-200);border-radius:8px;box-shadow:0 6px 20px rgba(0,0,0,.1);max-height:240px;overflow-y:auto;display:none;margin-top:2px;}
.go-result-item{display:flex;align-items:center;gap:10px;padding:9px 14px;cursor:pointer;border-bottom:1px solid var(--grey-50);font-size:.82rem;}
.go-result-item:last-child{border-bottom:0;}
.go-result-item:hover{background:var(--grey-50);}
.go-result-num{font-weight:900;color:var(--psg-navy);white-space:nowrap;}
.go-result-name{flex:1;font-weight:700;color:var(--grey-700);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.go-result-already{font-size:.68rem;color:var(--grey-400);}

/* per-order block */
.go-order-block{border:1px solid var(--grey-200);border-radius:10px;overflow:hidden;margin-bottom:10px;}
.go-order-hdr{display:flex;align-items:center;gap:8px;padding:10px 14px;background:var(--grey-50);border-bottom:1px solid var(--grey-100);}
.go-order-num{font-weight:900;color:var(--psg-navy);font-size:.85rem;}
.go-order-customer{flex:1;font-size:.78rem;color:var(--grey-500);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.go-order-remove{background:none;border:none;cursor:pointer;color:var(--grey-400);font-size:.75rem;font-weight:700;padding:3px 7px;border-radius:5px;transition:background .15s,color .15s;}
.go-order-remove:hover{background:#fee2e2;color:#dc2626;}
.go-order-body{padding:12px 14px;display:flex;flex-direction:column;gap:10px;}
.go-order-text{border:1px solid var(--grey-200);border-radius:8px;padding:8px 10px;font-size:.78rem;line-height:1.55;min-height:60px;max-height:160px;overflow-y:auto;color:var(--grey-700);outline:none;transition:border-color .15s;word-break:break-word;}
.go-order-text:focus{border-color:var(--psg-navy);}

/* attachments */
.go-att-section-label{font-size:.65rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:var(--grey-400);margin-bottom:5px;}
.go-att-list{display:flex;flex-direction:column;gap:5px;}
.go-att-row{display:flex;align-items:center;gap:8px;padding:5px 8px;border:1px solid var(--grey-100);border-radius:7px;background:#fff;font-size:.75rem;}
.go-att-thumb{width:32px;height:32px;object-fit:cover;border-radius:4px;flex-shrink:0;border:1px solid var(--grey-100);}
.go-att-icon{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:var(--grey-100);border-radius:4px;flex-shrink:0;color:var(--grey-500);}
.go-att-name{flex:1;font-weight:700;color:var(--grey-700);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.go-att-size{font-size:.68rem;color:var(--grey-400);white-space:nowrap;}
.go-att-badge{font-size:.6rem;font-weight:800;border-radius:4px;padding:2px 5px;white-space:nowrap;}
.go-att-badge.ok{background:#dcfce7;color:#166534;}
.go-att-badge.missing{background:#fee2e2;color:#991b1b;}
.go-att-badge.manual{background:#dbeafe;color:#1e40af;}
.go-att-badge.compressing{background:#fef9c3;color:#854d0e;}
.go-att-remove{background:none;border:none;cursor:pointer;color:var(--grey-400);padding:2px 5px;border-radius:4px;font-size:.8rem;flex-shrink:0;}
.go-att-remove:hover{background:#fee2e2;color:#dc2626;}
.go-att-replace-label{display:inline-flex;align-items:center;gap:3px;font-size:.68rem;font-weight:700;color:var(--grey-500);cursor:pointer;padding:2px 6px;border:1px solid var(--grey-200);border-radius:4px;flex-shrink:0;transition:background .15s;}
.go-att-replace-label:hover{background:var(--grey-50);}
.go-add-att-label{display:inline-flex;align-items:center;gap:4px;font-size:.72rem;font-weight:700;color:var(--psg-navy);cursor:pointer;padding:4px 8px;border:1px dashed var(--psg-navy);border-radius:6px;opacity:.8;transition:opacity .15s;}
.go-add-att-label:hover{opacity:1;}

/* email body */
.go-email-body{border:1px solid var(--grey-200);border-radius:8px;padding:10px 12px;font-size:.78rem;line-height:1.6;min-height:100px;max-height:200px;overflow-y:auto;color:var(--grey-700);outline:none;transition:border-color .15s;word-break:break-word;}
.go-email-body:focus{border-color:var(--psg-navy);}

/* size bar */
.go-size-bar-wrap{display:flex;align-items:center;gap:10px;}
.go-size-bar-bg{flex:1;background:var(--grey-100);border-radius:4px;height:6px;overflow:hidden;}
.go-size-bar-fill{height:100%;background:var(--psg-navy);border-radius:4px;transition:width .3s,background .3s;}
.go-size-bar-fill.warn{background:#f59e0b;}
.go-size-bar-fill.danger{background:#dc2626;}
.go-size-text{font-size:.72rem;font-weight:700;color:var(--grey-500);white-space:nowrap;min-width:130px;text-align:right;}

/* Les articles concernes par un envoi groupe. Meme geste que sur la fiche
   commande : on coche ce qui part chez CE fournisseur, et le serveur refuse
   un envoi vide quand il y avait un choix. */
.go-lignes{border:1px solid var(--grey-200);border-radius:8px;max-height:150px;overflow-y:auto;background:#fff;}
.go-ligne{display:flex;align-items:center;gap:8px;padding:6px 10px;border-bottom:1px solid var(--grey-50);font-size:.78rem;cursor:pointer;}
.go-ligne:last-child{border-bottom:0;}
.go-ligne:hover{background:var(--grey-50);}
.go-ligne-case{width:15px;height:15px;flex-shrink:0;cursor:pointer;}
.go-ligne-nom{flex:1;min-width:0;font-weight:600;color:var(--grey-800);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* Le badge « 2/3 » : combien de lignes sont deja approvisionnees.
   Il ne sort que s il reste du travail — sinon il ne se lirait plus. */
.appro-badge{display:inline-block;margin-top:4px;background:#fef2f2;color:#dc2626;border-radius:999px;padding:1px 8px;font-size:.64rem;font-weight:900;}

/* Le texte a ete modifie a la main : il ne suit plus les cases. Le dire
   plutot que de le reecrire --- une phrase ecrite pour un fournisseur ne
   s efface pas parce qu une case a bouge. */
.go-fige{margin-top:5px;padding:5px 9px;background:#fffbeb;border:1px solid #fef3c7;border-radius:6px;font-size:.68rem;font-weight:700;color:#92400e;}

/* « Oui » dans la colonne Relance. Discret : c est un renseignement, pas une
   alerte — une commande relancee n est pas en faute, elle attend. */
.cmd-relance{background:#fef3c7;color:#92400e;}
