/* Retter-Portal v1.2.97 – Inventory and PSA categories only. */

/* Long, structured category names stay usable without pushing controls apart. */
html body .content .inventory-toolbar select[name="category"],
html body .content form[action*="/inventory"] select[name="category"],
html body .content .personnel-psa-card select[name="category"]{
  min-width:0!important;
  max-width:100%!important;
  padding-right:46px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

html body .content select[name="category"] optgroup{
  font-weight:800;
}

html body .content select[name="category"] option{
  font-weight:600;
}

/* The wider category catalogue receives enough room in the inventory filter. */
html body .content .inventory-toolbar{
  grid-template-columns:minmax(220px,1.15fr) minmax(190px,.85fr) minmax(260px,1.2fr) minmax(170px,.7fr) auto!important;
  align-items:end!important;
}

@media (min-width:761px) and (max-width:1180px),
       (min-width:1181px) and (max-width:1366px) and (hover:none) and (pointer:coarse){
  /* The former half-width PSA form was too narrow on iPads. Both actions now use the full card width. */
  html body .content .personnel-psa-card .psa-actions-grid{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:18px!important;
    width:100%!important;
    max-width:100%!important;
  }

  html body .content .personnel-psa-card .psa-assign-form,
  html body .content .personnel-psa-card .psa-create-form{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  html body .content .personnel-psa-card .psa-create-form{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:15px!important;
  }

  html body .content .personnel-psa-card .psa-create-form > label{
    min-width:0!important;
    max-width:100%!important;
    width:100%!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }

  html body .content .personnel-psa-card .psa-create-form :is(input,select,textarea){
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  html body .content .personnel-psa-card .psa-create-form input[type="date"]{
    -webkit-appearance:none!important;
    appearance:none!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    height:48px!important;
    min-height:48px!important;
    padding:0 14px!important;
    line-height:48px!important;
    text-align:center!important;
    font-variant-numeric:tabular-nums!important;
  }

  html body .content .inventory-toolbar{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
  }

  html body .content .inventory-toolbar > :is(input,select,button){
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
}

@media (max-width:900px){
  html body .content .personnel-psa-card .psa-create-form{
    grid-template-columns:minmax(0,1fr)!important;
  }
  html body .content .personnel-psa-card .psa-create-form > .full,
  html body .content .personnel-psa-card .psa-create-form > label{
    grid-column:1!important;
  }
}
