/*
 * Filtres Code production des synthèses du Journal de suivi.
 * Styles strictement limités aux quatre synthèses concernées.
 */
#synthese_achat_own,
#synthese_epluchage_own,
#synthese_cuisson,
#synthese_deshydrate{
  width:100%;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
  overflow-x:hidden;
}

#synthese_achat_own .journal-synth-filter-card,
#synthese_epluchage_own .journal-synth-filter-card,
#synthese_cuisson .journal-synth-filter-card,
#synthese_deshydrate .journal-synth-filter-card{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  margin:0 0 14px !important;
  padding:14px !important;
  border:1px solid #d4dee6 !important;
  border-radius:10px !important;
  background:#fff !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
  box-shadow:0 2px 8px rgba(0,0,0,.05) !important;
}

.journal-synth-filter-grid{
  display:grid !important;
  grid-template-columns:minmax(145px,.8fr) minmax(165px,1fr) minmax(165px,1fr) minmax(230px,1.35fr) !important;
  gap:12px !important;
  align-items:end !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}

.journal-synth-filter-grid.is-five-columns{
  grid-template-columns:minmax(135px,.72fr) minmax(155px,.9fr) minmax(155px,.9fr) minmax(230px,1.25fr) minmax(220px,1.15fr) !important;
}

.journal-synth-filter-grid.is-six-columns{
  grid-template-columns:minmax(125px,.68fr) minmax(145px,.82fr) minmax(145px,.82fr) minmax(225px,1.18fr) minmax(250px,1.35fr) minmax(165px,.82fr) !important;
}

.journal-synth-filter-grid.is-seven-columns{
  grid-template-columns:repeat(7,minmax(125px,1fr)) !important;
}

.journal-synth-filter-grid .filter-item{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  margin:0 !important;
  box-sizing:border-box !important;
}

.journal-synth-filter-grid .filter-item label{
  display:block !important;
  min-height:22px !important;
  margin:0 0 6px !important;
  color:#17394a !important;
  font-weight:800 !important;
  line-height:1.15 !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
}

.journal-synth-filter-grid .filter-item input,
.journal-synth-filter-grid .filter-item select{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  height:42px !important;
  margin:0 !important;
  padding:7px 10px !important;
  border:1px solid #b8c8d5 !important;
  border-radius:7px !important;
  background:#fff !important;
  color:#172b36 !important;
  box-sizing:border-box !important;
  font-size:14px !important;
  text-overflow:ellipsis !important;
}

.journal-synth-filter-grid .filter-item input:disabled,
.journal-synth-filter-grid .filter-item input[readonly]{
  background:#f2f5f7 !important;
  color:#374f5e !important;
  opacity:1 !important;
  -webkit-text-fill-color:#374f5e !important;
}

.journal-synth-filter-actions{
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:9px !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  margin:12px 0 0 !important;
  padding:12px 0 0 !important;
  border-top:1px solid #e3e9ee !important;
  box-sizing:border-box !important;
}

.journal-synth-filter-actions button{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:130px !important;
  min-height:40px !important;
  margin:0 !important;
  padding:8px 15px !important;
  border:1px solid #9fb3c1 !important;
  border-radius:7px !important;
  background:#fff !important;
  color:#12384a !important;
  box-sizing:border-box !important;
  font-weight:800 !important;
  line-height:1.15 !important;
  white-space:nowrap !important;
}

.journal-synth-filter-actions button:first-child{
  border-color:#2d7889 !important;
  background:#2d7889 !important;
  color:#fff !important;
}

.journal-synth-filter-actions button:disabled{
  opacity:.55 !important;
  cursor:not-allowed !important;
}

/* Les anciens conteneurs en deux lignes de la cuisson sont neutralisés par la grille commune. */
#synthese_cuisson .cuisson-filter-row,
#synthese_deshydrate .desh-filter-row{
  display:contents !important;
}

#synthese_achat_own .table-scroll-achatown,
#synthese_epluchage_own .table-scroll-epluchageown,
#synthese_cuisson .table-scroll-cuisson,
#synthese_deshydrate .table-scroll-deshydrate{
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}

@media(max-width:1250px){
  .journal-synth-filter-grid,
  .journal-synth-filter-grid.is-five-columns,
  .journal-synth-filter-grid.is-six-columns,
  .journal-synth-filter-grid.is-seven-columns{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  }
}

@media(max-width:860px){
  .journal-synth-filter-grid,
  .journal-synth-filter-grid.is-five-columns,
  .journal-synth-filter-grid.is-six-columns,
  .journal-synth-filter-grid.is-seven-columns{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  .journal-synth-filter-actions{
    justify-content:stretch !important;
  }
  .journal-synth-filter-actions button{
    flex:1 1 145px !important;
  }
}

@media(max-width:560px){
  .journal-synth-filter-grid,
  .journal-synth-filter-grid.is-five-columns,
  .journal-synth-filter-grid.is-six-columns,
  .journal-synth-filter-grid.is-seven-columns{
    grid-template-columns:1fr !important;
  }
}

/* =========================================================
   CUISSON : le code sélectionné doit rester entièrement visible
========================================================= */
#synthese_cuisson .journal-synth-filter-grid.is-six-columns{
  grid-template-columns:
    minmax(135px,.70fr)
    minmax(170px,.90fr)
    minmax(170px,.90fr)
    minmax(245px,1.20fr)
    minmax(360px,1.85fr)
    minmax(180px,.90fr) !important;
}

#synthese_cuisson .journal-synth-filter-grid.is-seven-columns{
  grid-template-columns:
    minmax(125px,.65fr)
    minmax(160px,.80fr)
    minmax(160px,.80fr)
    minmax(235px,1.12fr)
    minmax(320px,1.55fr)
    minmax(170px,.85fr)
    minmax(170px,.85fr) !important;
}

#synthese_cuisson .filter-item-code{
  min-width:360px !important;
}

#synthese_cuisson #codeFilterCuisson{
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  padding-right:34px !important;
  font-family:Consolas, "Courier New", monospace !important;
  font-size:13px !important;
  text-overflow:clip !important;
}

/* Traits renforcés des cellules de titres de la synthèse Cuisson. */
#synthese_cuisson #tableCuisson thead th{
  border-top:2px solid #000 !important;
  border-right:2px solid #000 !important;
  border-bottom:2px solid #000 !important;
  border-left:2px solid #000 !important;
  background-clip:border-box !important;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.18), 0 2px 0 #000 !important;
}

#synthese_cuisson #tableCuisson thead th:first-child{
  border-left-width:2px !important;
}

#synthese_cuisson #tableCuisson thead th:last-child{
  border-right-width:2px !important;
}

/* Traits renforcés des cellules de titres de la synthèse Attiéké déshydraté. */
#synthese_deshydrate #tableDeshydrate thead th{
  border-top:2px solid #000 !important;
  border-right:2px solid #000 !important;
  border-bottom:2px solid #000 !important;
  border-left:2px solid #000 !important;
  background-clip:border-box !important;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.18), 0 2px 0 #000 !important;
}

#synthese_deshydrate #tableDeshydrate thead th:first-child{
  border-left-width:2px !important;
}

#synthese_deshydrate #tableDeshydrate thead th:last-child{
  border-right-width:2px !important;
}

/* Traits renforcés des titres de la synthèse Emballage produits finis. */
#synthese_emballage_produit_fini #tableEmballageproduitfini thead th{
  border-top:2px solid #000 !important;
  border-right:2px solid #000 !important;
  border-bottom:2px solid #000 !important;
  border-left:2px solid #000 !important;
  background-clip:border-box !important;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.18), 0 2px 0 #000 !important;
}

#synthese_emballage_produit_fini #tableEmballageproduitfini col.variete-col{
  width:150px !important;
}

#synthese_emballage_produit_fini .epf-filter-grid{
  grid-template-columns:repeat(8,minmax(125px,1fr)) !important;
}

#synthese_emballage_produit_fini #tableEmballageproduitfini{
  min-width:1270px !important;
}

@media(max-width:1400px){
  #synthese_emballage_produit_fini .epf-filter-grid{
    grid-template-columns:repeat(3,minmax(180px,1fr)) !important;
  }
}

@media(max-width:768px){
  #synthese_emballage_produit_fini .epf-filter-grid{
    grid-template-columns:1fr !important;
  }
}

@media (max-width:1250px){
  #synthese_cuisson .filter-item-code{
    grid-column:span 2 !important;
    min-width:0 !important;
  }
}

@media (max-width:860px){
  #synthese_cuisson .filter-item-code{
    grid-column:1 / -1 !important;
  }
}

@media (max-width:560px){
  #synthese_cuisson .filter-item-code{
    grid-column:auto !important;
  }
  #synthese_cuisson #codeFilterCuisson{
    font-size:12px !important;
  }
}

/* Le filtre hebdomadaire reste lisible sans déformer les autres champs. */
.journal-synth-filter-grid .filter-item-week select{
  min-width:0 !important;
  font-weight:700 !important;
}

/* Stock usine : traits nets sur chaque cellule de titre et largeur adaptée à VARIÉTÉ. */
#synthese_stock_usine #tableStockusine thead th{
  border:2px solid #000 !important;
  background-clip:border-box !important;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.18), 0 2px 0 #000 !important;
}

#synthese_stock_usine .su-filter-grid{
  grid-template-columns:repeat(8,minmax(125px,1fr)) !important;
}

#synthese_stock_usine #tableStockusine{
  min-width:1280px !important;
}

/* Stock usine — afficher intégralement les choix VARIÉTÉ et GAMME du journal. */
#stockUsine form#stockUsineForm{
  overflow-x:auto;
  padding-bottom:4px;
}

#stockUsine table.stockUsine{
  width:100%;
  min-width:1630px;
  table-layout:auto;
}

#stockUsine #variete_stock_usine{
  width:100% !important;
  min-width:175px !important;
  box-sizing:border-box !important;
  border:none !important;
  background:transparent !important;
  outline:none !important;
  box-shadow:none !important;
  text-align:center !important;
  text-align-last:center !important;
  white-space:nowrap !important;
  font-size:14px !important;
}

#stockUsine #produit_stock_usine{
  width:100% !important;
  min-width:315px !important;
  box-sizing:border-box !important;
  border:none !important;
  background:transparent !important;
  outline:none !important;
  box-shadow:none !important;
  text-align:center !important;
  text-align-last:center !important;
  white-space:nowrap !important;
  font-size:14px !important;
}

#stockUsine #variete_stock_usine option,
#stockUsine #produit_stock_usine option{
  text-align:center;
}

@media(max-width:1400px){
  #synthese_stock_usine .su-filter-grid{
    grid-template-columns:repeat(3,minmax(180px,1fr)) !important;
  }
}

@media(max-width:768px){
  #synthese_stock_usine .su-filter-grid{
    grid-template-columns:1fr !important;
  }
}
