/* Corrections UI ciblées Journal de suivi / Synthèses */

#synthese_achat_own,
#synthese_epluchage_own,
#synthese_cuisson,
#synthese_deshydrate,
#synthese_emballage_vide,
#synthese_emballage_produit_fini,
#synthese_stock_usine,
#synthese_stock_bureau,
#synthese_vente,
#synthese_stock_bureau_vente,
#synthese_vente_versement {
  box-sizing: border-box;
  overflow-x: hidden;
}

#synthese_achat_own .achatown-filter-card,
#synthese_epluchage_own .epluchageown-filter-card,
#synthese_cuisson .cuisson-filter-card,
#synthese_deshydrate .desh-filter-card,
#synthese_emballage_vide .embv-filter-card,
#synthese_emballage_produit_fini .epf-filter-card,
#synthese_stock_usine .su-filter-card,
#synthese_stock_bureau .sb-filter-card,
#synthese_vente .sv-filter-card,
#synthese_stock_bureau_vente .su-filter-card,
#synthese_vente_versement .su-filter-card {
  width: 100%;
  align-items: flex-end;
  gap: 12px 14px;
}

#synthese_achat_own .filter-item,
#synthese_epluchage_own .filter-item,
#synthese_cuisson .filter-item,
#synthese_deshydrate .filter-item,
#synthese_emballage_vide .filter-item,
#synthese_emballage_produit_fini .filter-item,
#synthese_stock_usine .filter-item,
#synthese_stock_bureau .filter-item,
#synthese_vente .filter-item,
#synthese_stock_bureau_vente .filter-item,
#synthese_vente_versement .filter-item {
  flex: 1 1 180px;
  min-width: 165px;
  max-width: 280px;
}

#synthese_achat_own .filter-item label,
#synthese_epluchage_own .filter-item label,
#synthese_cuisson .filter-item label,
#synthese_deshydrate .filter-item label,
#synthese_emballage_vide .filter-item label,
#synthese_emballage_produit_fini .filter-item label,
#synthese_stock_usine .filter-item label,
#synthese_stock_bureau .filter-item label,
#synthese_vente .filter-item label,
#synthese_stock_bureau_vente .filter-item label,
#synthese_vente_versement .filter-item label {
  white-space: nowrap;
}

#synthese_achat_own .filter-actions,
#synthese_epluchage_own .filter-actions,
#synthese_cuisson .filter-actions,
#synthese_deshydrate .filter-actions,
#synthese_emballage_vide .filter-actions,
#synthese_emballage_produit_fini .filter-actions,
#synthese_stock_usine .filter-actions,
#synthese_stock_bureau .filter-actions,
#synthese_vente .filter-actions,
#synthese_stock_bureau_vente .filter-actions,
#synthese_vente_versement .filter-actions {
  flex: 1 1 100%;
  width: 100%;
  margin-left: 0 !important;
  justify-content: flex-start;
}

#synthese_achat_own .filter-actions button,
#synthese_epluchage_own .filter-actions button,
#synthese_cuisson .filter-actions button,
#synthese_deshydrate .filter-actions button,
#synthese_emballage_vide .filter-actions button,
#synthese_emballage_produit_fini .filter-actions button,
#synthese_stock_usine .filter-actions button,
#synthese_stock_bureau .filter-actions button,
#synthese_vente .filter-actions button,
#synthese_stock_bureau_vente .filter-actions button,
#synthese_vente_versement .filter-actions button {
  min-width: 135px;
}

#synthese_achat_own .table-scroll-achatown,
#synthese_epluchage_own .table-scroll-epluchageown,
#synthese_cuisson .table-scroll-cuisson,
#synthese_deshydrate .table-scroll-deshydrate,
#synthese_emballage_vide .table-scroll-emballagevide,
#synthese_emballage_produit_fini .table-scroll-epf,
#synthese_stock_usine .table-scroll-stockusine,
#synthese_stock_bureau .table-scroll-stockbureau,
#synthese_vente .table-scroll-vente,
#synthese_stock_bureau_vente .main,
#synthese_vente_versement .main {
  width: 100%;
  max-width: 100%;
  overflow: auto !important;
  border: 1px solid #d7dee8;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  scrollbar-gutter: stable;
}

#synthese_achat_own .table-scroll-achatown,
#synthese_epluchage_own .table-scroll-epluchageown,
#synthese_cuisson .table-scroll-cuisson,
#synthese_deshydrate .table-scroll-deshydrate,
#synthese_emballage_vide .table-scroll-emballagevide,
#synthese_emballage_produit_fini .table-scroll-epf,
#synthese_stock_usine .table-scroll-stockusine,
#synthese_stock_bureau .table-scroll-stockbureau,
#synthese_vente .table-scroll-vente {
  padding-bottom: 10px;
}

#tableAchatown,
#tableepluchageown,
#tableCuisson,
#tableDeshydrate,
#tableEmballagevide,
#tableEmballageproduitfini,
#tableStockusine,
#tableStockbureau,
#tableSyntheseVente,
#tableausynthesestockbureauvente,
#tableausyntheseventeversement {
  min-width: 100%;
}

#tableausynthesestockbureauvente,
#tableausyntheseventeversement {
  width: max-content;
}

#tableausynthesestockbureauvente th,
#tableausynthesestockbureauvente td,
#tableausyntheseventeversement th,
#tableausyntheseventeversement td {
  font-size: 12px;
  line-height: 1.15;
}

#tableausynthesestockbureauvente th,
#tableausyntheseventeversement th {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

#tableausynthesestockbureauvente td:first-child,
#tableausyntheseventeversement td:first-child {
  min-width: 165px;
}

#tableausynthesestockbureauvente td:not(:first-child),
#tableausyntheseventeversement td:not(:first-child) {
  white-space: nowrap;
}

#tableAchatown thead th,
#tableepluchageown thead th,
#tableCuisson thead th,
#tableDeshydrate thead th,
#tableEmballagevide thead th,
#tableEmballageproduitfini thead th,
#tableStockusine thead th,
#tableStockbureau thead th,
#tableSyntheseVente thead th,
#tableausynthesestockbureauvente thead th,
#tableausyntheseventeversement thead th {
  background: #DCE6F1 !important;
}


#synthese_vente .table-scroll-vente,
#synthese_stock_bureau_vente .main,
#synthese_vente_versement .main {
  padding: 0;
}

#synthese_vente .title,
#synthese_stock_bureau_vente .title,
#synthese_vente_versement .title {
  word-break: break-word;
}

#synthese_vente_versement .synthese-msg,
#synthese_stock_bureau_vente .synthese-msg {
  padding-left: 2px;
}

@media (min-width: 1200px) {
  #synthese_stock_bureau_vente .filter-actions,
  #synthese_vente_versement .filter-actions,
  #synthese_vente .filter-actions {
    width: auto;
    flex: 0 1 auto;
    margin-left: auto !important;
    justify-content: flex-end;
  }
}

@media (max-width: 1180px) {
  #synthese_achat_own .filter-item,
  #synthese_epluchage_own .filter-item,
  #synthese_cuisson .filter-item,
  #synthese_deshydrate .filter-item,
  #synthese_emballage_vide .filter-item,
  #synthese_emballage_produit_fini .filter-item,
  #synthese_stock_usine .filter-item,
  #synthese_stock_bureau .filter-item,
  #synthese_vente .filter-item,
  #synthese_stock_bureau_vente .filter-item,
  #synthese_vente_versement .filter-item {
    max-width: none;
    flex-basis: calc(50% - 12px);
  }
}

@media (max-width: 800px) {
  #synthese_achat_own .filter-item,
  #synthese_epluchage_own .filter-item,
  #synthese_cuisson .filter-item,
  #synthese_deshydrate .filter-item,
  #synthese_emballage_vide .filter-item,
  #synthese_emballage_produit_fini .filter-item,
  #synthese_stock_usine .filter-item,
  #synthese_stock_bureau .filter-item,
  #synthese_vente .filter-item,
  #synthese_stock_bureau_vente .filter-item,
  #synthese_vente_versement .filter-item {
    flex-basis: 100%;
    min-width: 100%;
  }

  #synthese_achat_own .filter-actions button,
  #synthese_epluchage_own .filter-actions button,
  #synthese_cuisson .filter-actions button,
  #synthese_deshydrate .filter-actions button,
  #synthese_emballage_vide .filter-actions button,
  #synthese_emballage_produit_fini .filter-actions button,
  #synthese_stock_usine .filter-actions button,
  #synthese_stock_bureau .filter-actions button,
  #synthese_vente .filter-actions button,
  #synthese_stock_bureau_vente .filter-actions button,
  #synthese_vente_versement .filter-actions button {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
}


/* ===== Patch continuité UI 2026-04-02 : Journal Vente + Synthèses compactes ===== */

#vente{
  box-sizing:border-box;
  overflow-x:hidden;
}

#venteForm{
  display:flex;
  flex-direction:column;
  gap:12px;
  width:100%;
  max-width:100%;
  padding:14px 16px;
  box-sizing:border-box;
  overflow:hidden;
  background:#fff;
  border:1px solid #cfd4da;
  border-radius:14px;
  box-shadow:0 3px 10px rgba(0,0,0,.05);
}

#venteForm .vente-table-scroll{
  width:100%;
  max-width:100%;
  overflow:auto;
  max-height:calc(100vh - 300px);
  border:1px solid #d7dee8;
  border-radius:14px;
  background:#fff;
  box-sizing:border-box;
  scrollbar-gutter:stable;
}

#venteForm table.vente{
  width:max-content !important;
  min-width:100%;
  margin:0 !important;
  background:#fff;
}

#venteForm table.vente th,
#venteForm table.vente td{
  font-size:12.5px;
  line-height:1.1;
  padding:4px 3px;
  vertical-align:middle;
}

#venteForm table.vente thead th{
  position:sticky;
  top:0;
  z-index:5;
  background:#DCE6F1 !important;
  white-space:normal;
  word-break:break-word;
  overflow-wrap:anywhere;
}

#venteForm table.vente td{
  white-space:nowrap;
}

#venteForm table.vente td.col-gamme,
#venteForm table.vente td.col-client{
  white-space:normal;
}

#venteForm table.vente input,
#venteForm table.vente select{
  font-size:13px;
}

#venteForm .vente-form-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

#venteForm .vente-form-actions button{
  min-width:140px;
  height:38px;
  padding:0 16px;
  border:1px solid #b8c3d1;
  border-radius:10px;
  background:#f7f9fc;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
}

#venteForm .vente-form-actions #saveBtnvente{
  background:#eef6ff;
  border-color:#8fb4df;
}

#venteForm .vente-form-actions #saveBtnsynthesevente{
  background:#fff7f2;
  border-color:#d8b08a;
  color:#6b3d13;
}

#message_vente{
  padding:0 2px;
}

#tableAchatown,
#tableepluchageown,
#tableCuisson,
#tableDeshydrate,
#tableEmballagevide,
#tableEmballageproduitfini,
#tableStockusine,
#tableStockbureau,
#tableSyntheseVente,
#tableausynthesestockbureauvente,
#tableausyntheseventeversement{
  width:100%;
}

#tableAchatown{ min-width:1120px !important; }
#tableepluchageown{ min-width:1140px !important; }
#tableCuisson{ min-width:1080px !important; }
#tableDeshydrate{ min-width:900px !important; }
#tableEmballagevide{ min-width:900px !important; }
#tableEmballageproduitfini{ min-width:1080px !important; }
#tableStockusine{ min-width:1160px !important; }
#tableStockbureau{ min-width:1040px !important; }
#tableSyntheseVente{ min-width:1480px !important; }
#tableausynthesestockbureauvente{ min-width:1200px !important; }
#tableausyntheseventeversement{ min-width:1420px !important; }

#tableAchatown th,
#tableAchatown td,
#tableepluchageown th,
#tableepluchageown td,
#tableCuisson th,
#tableCuisson td,
#tableDeshydrate th,
#tableDeshydrate td,
#tableEmballagevide th,
#tableEmballagevide td,
#tableEmballageproduitfini th,
#tableEmballageproduitfini td,
#tableStockusine th,
#tableStockusine td,
#tableStockbureau th,
#tableStockbureau td,
#tableSyntheseVente th,
#tableSyntheseVente td,
#tableausynthesestockbureauvente th,
#tableausynthesestockbureauvente td,
#tableausyntheseventeversement th,
#tableausyntheseventeversement td{
  padding:4px 5px !important;
  font-size:12px !important;
  line-height:1.08 !important;
}

#tableAchatown thead th,
#tableepluchageown thead th,
#tableCuisson thead th,
#tableDeshydrate thead th,
#tableEmballagevide thead th,
#tableEmballageproduitfini thead th,
#tableStockusine thead th,
#tableStockbureau thead th,
#tableSyntheseVente thead th,
#tableausynthesestockbureauvente thead th,
#tableausyntheseventeversement thead th{
  white-space:normal !important;
  word-break:break-word !important;
  overflow-wrap:anywhere !important;
}

#tableAchatown td.left,
#tableepluchageown td.left,
#tableCuisson td.left,
#tableDeshydrate td.left,
#tableEmballagevide td.left,
#tableEmballageproduitfini td.left,
#tableStockusine td.left,
#tableStockbureau td.left,
#tableSyntheseVente td.left,
#tableausynthesestockbureauvente td.left,
#tableausyntheseventeversement td.left{
  white-space:normal !important;
  word-break:break-word;
  overflow-wrap:anywhere;
}

#synthese_achat_own .table-scroll-achatown,
#synthese_epluchage_own .table-scroll-epluchageown,
#synthese_cuisson .table-scroll-cuisson,
#synthese_deshydrate .table-scroll-deshydrate,
#synthese_emballage_vide .table-scroll-emballagevide,
#synthese_emballage_produit_fini .table-scroll-epf,
#synthese_stock_usine .table-scroll-stockusine,
#synthese_stock_bureau .table-scroll-stockbureau,
#synthese_vente .table-scroll-vente,
#synthese_stock_bureau_vente .main,
#synthese_vente_versement .main{
  max-height:calc(100vh - 255px) !important;
  padding:0 !important;
}

@media (max-width: 980px){
  #venteForm{
    padding:12px;
  }

  #venteForm .vente-table-scroll{
    max-height:calc(100vh - 335px);
  }

  #venteForm .vente-form-actions{
    width:100%;
  }

  #venteForm .vente-form-actions button{
    flex:1 1 calc(50% - 8px);
    min-width:0;
  }

  #tableAchatown,
  #tableepluchageown,
  #tableCuisson,
  #tableDeshydrate,
  #tableEmballagevide,
  #tableEmballageproduitfini,
  #tableStockusine,
  #tableStockbureau,
  #tableSyntheseVente,
  #tableausynthesestockbureauvente,
  #tableausyntheseventeversement{
    font-size:11.5px;
  }
}


/* ===== Ajustement ciblé 2026-04-09 : Carte filtre Achat manioc plus serrée ===== */
#synthese_achat_own .achatown-filter-card{
  display:grid !important;
  grid-template-columns:max-content max-content max-content 1fr;
  align-items:center !important;
  column-gap:10px !important;
  row-gap:8px !important;
  padding:14px 18px !important;
}

#synthese_achat_own .achatown-filter-card .filter-item{
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  flex:0 1 auto !important;
  min-width:0 !important;
  max-width:none !important;
}

#synthese_achat_own .achatown-filter-card .filter-item label{
  margin:0 !important;
  white-space:nowrap !important;
}

#synthese_achat_own .achatown-filter-card select,
#synthese_achat_own .achatown-filter-card input[type="date"]{
  height:34px !important;
  min-width:170px !important;
  width:170px !important;
  max-width:170px !important;
  padding:4px 10px !important;
  color:#222 !important;
}

#synthese_achat_own .achatown-filter-card input[type="date"]:disabled,
#synthese_achat_own .achatown-filter-card input[type="date"][readonly]{
  opacity:1 !important;
  -webkit-text-fill-color:#222 !important;
  color:#222 !important;
  background:#f1f3f5 !important;
}

#synthese_achat_own .achatown-filter-card .filter-actions{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:8px !important;
  flex:0 0 auto !important;
  width:auto !important;
  min-width:0 !important;
  margin-left:0 !important;
  flex-wrap:nowrap !important;
}

#synthese_achat_own .achatown-filter-card .filter-actions button{
  min-width:0 !important;
  width:auto !important;
  height:34px !important;
  padding:0 16px !important;
  white-space:nowrap !important;
  background:#f4f6f8 !important;
  border-color:#a7b3c2 !important;
  color:#111 !important;
  box-shadow:none !important;
}

#synthese_achat_own .achatown-filter-card .filter-actions button:disabled{
  opacity:.75 !important;
  color:#8b8b8b !important;
  background:#f1f3f5 !important;
}

@media (max-width: 1280px){
  #synthese_achat_own .achatown-filter-card{
    display:flex !important;
    align-items:flex-end !important;
    flex-wrap:wrap !important;
  }

  #synthese_achat_own .achatown-filter-card .filter-actions{
    width:100% !important;
    justify-content:flex-start !important;
    flex-wrap:wrap !important;
  }
}


/* ===== Ajustement ciblé 2026-04-09 : Tableau Achat manioc compact centré ===== */
#synthese_achat_own .achatown-table-card{
  padding:0 10px 10px !important;
}

#synthese_achat_own .table-scroll-achatown{
  overflow-x:hidden !important;
  margin:0 auto !important;
  border-radius:12px 12px 0 0 !important;
}

#tableAchatown{
  width:100% !important;
  min-width:0 !important;
  margin:0 auto !important;
  table-layout:fixed !important;
}

#tableAchatown col:nth-child(1){ width:9% !important; }
#tableAchatown col:nth-child(2){ width:22% !important; }
#tableAchatown col:nth-child(3){ width:27% !important; }
#tableAchatown col:nth-child(4){ width:16% !important; }
#tableAchatown col:nth-child(5){ width:14% !important; }
#tableAchatown col:nth-child(6){ width:12% !important; }

#tableAchatown th,
#tableAchatown td{
  padding:5px 7px !important;
}

#tableAchatown th:first-child,
#tableAchatown td:first-child{
  padding-left:10px !important;
  padding-right:8px !important;
}

#tableAchatown th:last-child,
#tableAchatown td:last-child{
  padding-right:10px !important;
}

#tableAchatown tbody td,
#tableAchatown tfoot td{
  white-space:nowrap !important;
}

#tableAchatown thead th{
  text-align:center !important;
}


/* ===== Ajustement ciblé 2026-04-09 : Carte filtre Épluchage comme Achat ===== */
#synthese_epluchage_own .epluchageown-filter-card{
  display:grid !important;
  grid-template-columns:max-content max-content max-content 1fr;
  align-items:center !important;
  column-gap:10px !important;
  row-gap:8px !important;
  padding:14px 18px !important;
}

#synthese_epluchage_own .epluchageown-filter-card .filter-item{
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  flex:0 1 auto !important;
  min-width:0 !important;
  max-width:none !important;
}

#synthese_epluchage_own .epluchageown-filter-card .filter-item label{
  margin:0 !important;
  white-space:nowrap !important;
}

#synthese_epluchage_own .epluchageown-filter-card select,
#synthese_epluchage_own .epluchageown-filter-card input[type="date"]{
  height:34px !important;
  min-width:170px !important;
  width:170px !important;
  max-width:170px !important;
  padding:4px 10px !important;
  color:#222 !important;
}

#synthese_epluchage_own .epluchageown-filter-card input[type="date"]:disabled,
#synthese_epluchage_own .epluchageown-filter-card input[type="date"][readonly]{
  opacity:1 !important;
  -webkit-text-fill-color:#222 !important;
  color:#222 !important;
  background:#f1f3f5 !important;
}

#synthese_epluchage_own .epluchageown-filter-card .filter-actions{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:8px !important;
  flex:0 0 auto !important;
  width:auto !important;
  min-width:0 !important;
  margin-left:0 !important;
  flex-wrap:nowrap !important;
}

#synthese_epluchage_own .epluchageown-filter-card .filter-actions button{
  min-width:0 !important;
  width:auto !important;
  height:34px !important;
  padding:0 16px !important;
  white-space:nowrap !important;
  background:#f4f6f8 !important;
  border-color:#a7b3c2 !important;
  color:#111 !important;
  box-shadow:none !important;
}

#synthese_epluchage_own .epluchageown-filter-card .filter-actions button:disabled{
  opacity:.75 !important;
  color:#8b8b8b !important;
  background:#f1f3f5 !important;
}

@media (max-width: 1280px){
  #synthese_epluchage_own .epluchageown-filter-card{
    display:flex !important;
    align-items:flex-end !important;
    flex-wrap:wrap !important;
  }

  #synthese_epluchage_own .epluchageown-filter-card .filter-actions{
    width:100% !important;
    justify-content:flex-start !important;
    flex-wrap:wrap !important;
  }
}

/* ===== Ajustement ciblé 2026-04-09 : Tableau Synthèse Épluchage compact centré ===== */
#synthese_epluchage_own #tableContainerepluchageown{
  display:none;
}

#synthese_epluchage_own .table-scroll-epluchageown{
  overflow-x:hidden !important;
  margin:0 auto !important;
  border-radius:12px 12px 0 0 !important;
}

#tableepluchageown{
  width:100% !important;
  min-width:0 !important;
  margin:0 auto !important;
  table-layout:fixed !important;
}

#tableepluchageown col:nth-child(1){ width:10% !important; }
#tableepluchageown col:nth-child(2){ width:22% !important; }
#tableepluchageown col:nth-child(3){ width:23% !important; }
#tableepluchageown col:nth-child(4){ width:14% !important; }
#tableepluchageown col:nth-child(5){ width:12% !important; }
#tableepluchageown col:nth-child(6){ width:10% !important; }
#tableepluchageown col:nth-child(7){ width:9% !important; }

#tableepluchageown th,
#tableepluchageown td{
  padding:5px 7px !important;
}

#tableepluchageown th:first-child,
#tableepluchageown td:first-child{
  padding-left:10px !important;
  padding-right:8px !important;
}

#tableepluchageown th:last-child,
#tableepluchageown td:last-child{
  padding-right:10px !important;
}

#tableepluchageown tbody td,
#tableepluchageown tfoot td{
  white-space:nowrap !important;
}

#tableepluchageown thead th,
#tableepluchageown tfoot td{
  text-align:center !important;
}
