/* v10.287 - authoritative desktop sizing for Work Items and Work Materials. */
@media (min-width:801px){
  body.hl2027 #work-items-dialog.transaction-lines-dialog{
    box-sizing:border-box!important;width:min(1050px,calc(100vw - 80px))!important;max-width:1050px!important;
    height:fit-content!important;min-height:0!important;max-height:80vh!important;margin:auto!important;padding:0!important;
    border:0!important;border-radius:16px!important;background:#f7fafc!important;overflow-x:hidden!important;overflow-y:auto!important;
    scrollbar-width:none!important;-ms-overflow-style:none!important
  }
  body.hl2027 #materials-dialog.transaction-lines-dialog{
    box-sizing:border-box!important;width:min(1100px,calc(100vw - 80px))!important;max-width:1100px!important;
    height:fit-content!important;min-height:0!important;max-height:80vh!important;margin:auto!important;padding:0!important;
    border:0!important;border-radius:16px!important;background:#f7fafc!important;overflow-x:hidden!important;overflow-y:auto!important;
    scrollbar-width:none!important;-ms-overflow-style:none!important
  }
  body.hl2027 #work-items-dialog.transaction-lines-dialog::-webkit-scrollbar,
  body.hl2027 #materials-dialog.transaction-lines-dialog::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}
  body.hl2027 #work-items-dialog>.legacy-transaction-section,
  body.hl2027 #materials-dialog>.legacy-transaction-section{
    box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-height:0!important;height:auto!important;
    margin:0!important;padding:0 12px 12px!important;border:0!important;background:#f7fafc!important;overflow:visible!important
  }
  body.hl2027 #work-items-dialog .dialog-title,
  body.hl2027 #materials-dialog .dialog-title{
    position:sticky!important;z-index:30!important;top:0!important;display:flex!important;align-items:center!important;justify-content:space-between!important;
    height:50px!important;min-height:50px!important;margin:0 -12px 10px!important;padding:7px 12px!important;
    border-bottom:1px solid #d5e2ec!important;background:#fff!important
  }
  body.hl2027 #work-items-dialog .dialog-title h2,
  body.hl2027 #materials-dialog .dialog-title h2{margin:0!important;font-size:18px!important}
  body.hl2027 #work-items-dialog .dialog-title button,
  body.hl2027 #materials-dialog .dialog-title button{height:34px!important;min-height:34px!important;padding:5px 11px!important;font-size:12px!important}
  body.hl2027 #materials-dialog #materials-add-form{
    display:grid!important;grid-template-columns:minmax(280px,1.6fr) 100px minmax(160px,.8fr) 85px!important;
    align-items:center!important;gap:7px!important;width:100%!important;height:auto!important;min-height:0!important;
    margin:0 0 10px!important;padding:8px!important;border:1px solid #d5e2ec!important;border-radius:10px!important;background:#fff!important
  }
  body.hl2027 #materials-dialog #materials-add-form>*{width:100%!important;min-width:0!important;margin:0!important}
  body.hl2027 #materials-dialog #materials-add-form input,
  body.hl2027 #materials-dialog #materials-add-form>button{height:34px!important;min-height:34px!important;max-height:34px!important;font-size:12px!important}
  body.hl2027 #work-items-dialog .table-wrap,
  body.hl2027 #materials-dialog .table-wrap{
    box-sizing:border-box!important;width:100%!important;max-width:100%!important;height:auto!important;min-height:0!important;
    overflow-x:hidden!important;overflow-y:visible!important;border-radius:10px!important
  }
  body.hl2027 #work-items-dialog table,
  body.hl2027 #materials-dialog table{width:100%!important;min-width:0!important;max-width:100%!important;height:auto!important;table-layout:fixed!important}
  body.hl2027 #work-items-dialog thead th,
  body.hl2027 #materials-dialog thead th{height:32px!important;min-height:32px!important;padding:5px 6px!important;font-size:11px!important}
  body.hl2027 #work-items-dialog tbody tr,
  body.hl2027 #materials-dialog tbody tr{height:46px!important;min-height:46px!important;max-height:46px!important}
  body.hl2027 #work-items-dialog tbody td,
  body.hl2027 #materials-dialog tbody td{
    height:46px!important;min-height:46px!important;max-height:46px!important;padding:4px 6px!important;
    vertical-align:middle!important;font-size:11px!important;line-height:1.2!important
  }
  body.hl2027 #work-items-dialog .line-row-actions,
  body.hl2027 #materials-dialog .line-row-actions{
    display:grid!important;grid-template-columns:minmax(0,1fr) 58px!important;align-items:center!important;
    gap:5px!important;width:100%!important;height:34px!important;min-height:34px!important;margin:0!important
  }
  body.hl2027 #work-items-dialog .line-row-actions>form:first-child,
  body.hl2027 #materials-dialog .line-row-actions>form:first-child{
    display:grid!important;grid-template-columns:70px minmax(110px,1fr) 58px!important;align-items:center!important;
    gap:5px!important;width:100%!important;height:32px!important;min-height:32px!important;margin:0!important
  }
  body.hl2027 #work-items-dialog .line-row-actions>form:last-child,
  body.hl2027 #materials-dialog .line-row-actions>form:last-child{
    display:block!important;width:58px!important;min-width:58px!important;height:32px!important;min-height:32px!important;margin:0!important
  }
  body.hl2027 #work-items-dialog .line-row-actions input,
  body.hl2027 #materials-dialog .line-row-actions input{
    box-sizing:border-box!important;width:100%!important;min-width:0!important;height:32px!important;min-height:32px!important;max-height:32px!important;
    margin:0!important;padding:4px 6px!important;font-size:11px!important
  }
  body.hl2027 #work-items-dialog .line-row-actions button,
  body.hl2027 #materials-dialog .line-row-actions button{
    box-sizing:border-box!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
    width:58px!important;min-width:58px!important;max-width:58px!important;height:32px!important;min-height:32px!important;max-height:32px!important;
    margin:0!important;padding:4px 6px!important;border-radius:7px!important;font-size:10.5px!important;line-height:1!important;white-space:nowrap!important
  }
  body.hl2027:has(#work-items-dialog[open]) .floating-table-scrollbar,
  body.hl2027:has(#materials-dialog[open]) .floating-table-scrollbar{display:none!important}
}

/* v10.288 - Return Materials uses the same content-sized layout. */
@media (min-width:801px){
  body.hl2027 #return-materials-dialog.transaction-lines-dialog{
    box-sizing:border-box!important;width:min(1050px,calc(100vw - 80px))!important;max-width:1050px!important;
    height:fit-content!important;min-height:0!important;max-height:80vh!important;margin:auto!important;padding:0!important;
    border:0!important;border-radius:16px!important;background:#f7fafc!important;overflow-x:hidden!important;overflow-y:auto!important;
    scrollbar-width:none!important;-ms-overflow-style:none!important
  }
  body.hl2027 #return-materials-dialog.transaction-lines-dialog::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}
  body.hl2027 #return-materials-dialog>.legacy-transaction-section{
    box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-height:0!important;height:auto!important;
    margin:0!important;padding:0 12px 12px!important;border:0!important;background:#f7fafc!important;overflow:visible!important
  }
  body.hl2027 #return-materials-dialog .dialog-title{
    position:sticky!important;z-index:30!important;top:0!important;display:flex!important;align-items:center!important;justify-content:space-between!important;
    height:50px!important;min-height:50px!important;margin:0 -12px 10px!important;padding:7px 12px!important;
    border-bottom:1px solid #d5e2ec!important;background:#fff!important
  }
  body.hl2027 #return-materials-dialog .dialog-title h2{margin:0!important;font-size:18px!important}
  body.hl2027 #return-materials-dialog .dialog-title button{height:34px!important;min-height:34px!important;padding:5px 11px!important;font-size:12px!important}
  body.hl2027 #return-materials-dialog .return-line-form{
    display:grid!important;grid-template-columns:minmax(260px,1.5fr) 90px 160px 85px!important;
    align-items:center!important;gap:7px!important;width:100%!important;height:auto!important;min-height:0!important;
    margin:0 0 10px!important;padding:8px!important;border:1px solid #d5e2ec!important;border-radius:10px!important;background:#fff!important
  }
  body.hl2027 #return-materials-dialog .return-line-form>*{width:100%!important;min-width:0!important;margin:0!important}
  body.hl2027 #return-materials-dialog .return-line-form input,
  body.hl2027 #return-materials-dialog .return-line-form select,
  body.hl2027 #return-materials-dialog .return-line-form button{height:34px!important;min-height:34px!important;max-height:34px!important;font-size:12px!important}
  body.hl2027 #return-materials-dialog .table-wrap{box-sizing:border-box!important;width:100%!important;max-width:100%!important;height:auto!important;min-height:0!important;overflow-x:hidden!important;overflow-y:visible!important}
  body.hl2027 #return-materials-dialog table{width:100%!important;min-width:0!important;max-width:100%!important;height:auto!important;table-layout:fixed!important}
  body.hl2027 #return-materials-dialog thead th{height:32px!important;min-height:32px!important;padding:5px 6px!important;font-size:11px!important}
  body.hl2027 #return-materials-dialog tbody tr{height:46px!important;min-height:46px!important;max-height:46px!important}
  body.hl2027 #return-materials-dialog tbody td{height:46px!important;min-height:46px!important;max-height:46px!important;padding:4px 6px!important;vertical-align:middle!important;font-size:11px!important;line-height:1.2!important}
  body.hl2027 #return-materials-dialog tbody td form{display:block!important;width:58px!important;margin:0 auto!important}
  body.hl2027 #return-materials-dialog tbody td button{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:58px!important;min-width:58px!important;height:32px!important;min-height:32px!important;padding:4px 6px!important;font-size:10.5px!important}
  body.hl2027:has(#return-materials-dialog[open]) .floating-table-scrollbar{display:none!important}
}

@media (max-width:800px){
  body.wp-mobile-ready #return-materials-dialog.transaction-lines-dialog{box-sizing:border-box!important;width:calc(100vw - 12px)!important;max-width:calc(100vw - 12px)!important;max-height:calc(100dvh - 16px)!important;margin:auto!important;padding:0!important;border:0!important;border-radius:15px!important;background:#f5f8fb!important;overflow-x:hidden!important;overflow-y:auto!important}
  body.wp-mobile-ready #return-materials-dialog>.legacy-transaction-section{width:100%!important;max-width:100%!important;margin:0!important;padding:0 10px 14px!important;border:0!important;background:#f5f8fb!important}
  body.wp-mobile-ready #return-materials-dialog .dialog-title{position:sticky!important;z-index:20!important;top:0!important;display:flex!important;align-items:center!important;justify-content:space-between!important;margin:0 -10px 12px!important;padding:12px 13px!important;background:#fff!important;border-bottom:1px solid #d7e3ec!important}
  body.wp-mobile-ready #return-materials-dialog .return-line-form{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;width:100%!important;margin:0 0 12px!important;padding:10px!important;border:1px solid #d7e3ec!important;border-radius:12px!important;background:#fff!important}
  body.wp-mobile-ready #return-materials-dialog .return-line-form>*{grid-column:1!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important}
  body.wp-mobile-ready #return-materials-dialog .table-wrap{width:100%!important;max-width:100%!important;overflow:visible!important;border:0!important;background:transparent!important}
  body.wp-mobile-ready #return-materials-dialog table,body.wp-mobile-ready #return-materials-dialog tbody{display:block!important;width:100%!important;max-width:100%!important;background:transparent!important}
  body.wp-mobile-ready #return-materials-dialog thead{display:none!important}
  body.wp-mobile-ready #return-materials-dialog tbody tr{display:block!important;width:100%!important;margin:0 0 10px!important;padding:10px!important;border:1px solid #d7e3ec!important;border-radius:12px!important;background:#fff!important}
  body.wp-mobile-ready #return-materials-dialog tbody td{display:grid!important;grid-template-columns:88px minmax(0,1fr)!important;gap:8px!important;width:100%!important;min-height:36px!important;padding:7px 3px!important;border:0!important;border-bottom:1px solid #edf2f6!important;white-space:normal!important;overflow-wrap:anywhere!important}
  body.wp-mobile-ready #return-materials-dialog tbody td:nth-child(1)::before{content:'#';font-weight:800;color:#61788d}
  body.wp-mobile-ready #return-materials-dialog tbody td:nth-child(2)::before{content:'رقم المادة';font-weight:800;color:#61788d}
  body.wp-mobile-ready #return-materials-dialog tbody td:nth-child(3)::before{content:'اسم المادة';font-weight:800;color:#61788d}
  body.wp-mobile-ready #return-materials-dialog tbody td:nth-child(4)::before{content:'الكمية';font-weight:800;color:#61788d}
  body.wp-mobile-ready #return-materials-dialog tbody td:nth-child(5)::before{content:'الحالة';font-weight:800;color:#61788d}
  body.wp-mobile-ready #return-materials-dialog tbody td:last-child{display:block!important;border-bottom:0!important;padding-top:9px!important}
  body.wp-mobile-ready #return-materials-dialog tbody td:last-child form,
  body.wp-mobile-ready #return-materials-dialog tbody td:last-child button{width:100%!important;margin:0!important}
}
