/* pandabu RC16.276 – Vorrat bearbeiten: Ablaufdatum-Zeile final ausrichten
   Ziel: Menge + Ablaufdatum gleich hoch, unterschiedliche Breite; Löschen-X in eigener Spalte ohne Überlagerung. */

/* Robust gegen ältere RC-Regeln: die Chargenzeile ist immer ein echtes 3-Spalten-Grid. */
#inventory-form .expiry-batch-row{
  display:grid!important;
  grid-template-columns:minmax(86px,.62fr) minmax(0,1.46fr) 44px!important;
  column-gap:10px!important;
  row-gap:0!important;
  align-items:end!important;
  padding:10px!important;
  box-sizing:border-box!important;
}

#inventory-form .expiry-batch-row .field{
  min-width:0!important;
  width:100%!important;
  margin:0!important;
  display:grid!important;
  grid-template-rows:auto 50px!important;
  align-content:end!important;
}

#inventory-form .expiry-batch-row .field label{
  min-height:18px!important;
  margin:0 0 5px!important;
  line-height:18px!important;
}

/* Beide Eingabefelder exakt gleich hoch; Safari-Date-Input darf die Grid-Spalte nicht sprengen. */
#inventory-form .expiry-batch-row .field input,
#inventory-form .expiry-batch-row input[data-expiry-quantity],
#inventory-form .expiry-batch-row input[data-expiry-date]{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:50px!important;
  min-height:50px!important;
  max-height:50px!important;
  margin:0!important;
  padding:0 14px!important;
  box-sizing:border-box!important;
  line-height:50px!important;
}

/* Das X lebt in einer eigenen Grid-Zelle und kann das Datumsfeld nicht mehr überdecken. */
#inventory-form .expiry-remove-wrap{
  width:44px!important;
  min-width:44px!important;
  height:50px!important;
  min-height:50px!important;
  margin:0!important;
  padding:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  align-self:end!important;
}

#inventory-form .expiry-batch-row .expiry-remove{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  float:none!important;
  flex:0 0 auto!important;
  width:40px!important;
  min-width:40px!important;
  max-width:40px!important;
  height:40px!important;
  min-height:40px!important;
  max-height:40px!important;
  margin:0!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  line-height:1!important;
  font-size:22px!important;
  border-radius:11px!important;
  box-sizing:border-box!important;
}

@media (max-width:600px){
  #inventory-form .expiry-batch-row{
    grid-template-columns:minmax(82px,.62fr) minmax(0,1.48fr) 42px!important;
    column-gap:7px!important;
    padding:9px!important;
  }
  #inventory-form .expiry-batch-row .field{
    grid-template-rows:auto 48px!important;
  }
  #inventory-form .expiry-batch-row .field label{
    min-height:17px!important;
    margin-bottom:4px!important;
    line-height:17px!important;
  }
  #inventory-form .expiry-batch-row .field input,
  #inventory-form .expiry-batch-row input[data-expiry-quantity],
  #inventory-form .expiry-batch-row input[data-expiry-date]{
    height:48px!important;
    min-height:48px!important;
    max-height:48px!important;
    padding:0 11px!important;
    font-size:16px!important;
    line-height:48px!important;
  }
  #inventory-form .expiry-remove-wrap{
    width:42px!important;
    min-width:42px!important;
    height:48px!important;
    min-height:48px!important;
  }
  #inventory-form .expiry-batch-row .expiry-remove{
    width:38px!important;
    min-width:38px!important;
    max-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    max-height:38px!important;
  }
}

@media (max-width:390px){
  #inventory-form .expiry-batch-row{
    grid-template-columns:minmax(76px,.58fr) minmax(0,1.42fr) 40px!important;
    column-gap:6px!important;
    padding:8px!important;
  }
  #inventory-form .expiry-remove-wrap{
    width:40px!important;
    min-width:40px!important;
  }
  #inventory-form .expiry-batch-row .expiry-remove{
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    max-height:36px!important;
  }
}
