/*
Inoviq ERP – Manufacturing Edition
PURCHASE MENU FINAL TOUCH – Batch 1
UI-only scoped polish for:
  Purchase Order
  Vendor Delivery Schedule
  Gate Entry
  Purchase Return / RTV

STRICT:
- No API / SQL / transaction logic changes.
- No global form selectors.
- Gate Entry remains the visual master.
*/

/* ===== common purchase-shell geometry ===== */
html body #purchaseOrder,
html body #vendorSchedule,
html body #gateEntry,
html body #purchaseReturnV1{
  box-sizing:border-box!important;
}

/* Purchase Order shell aligned to approved Gate Entry family */
html body #purchaseOrder{
  width:min(1120px,calc(100% - 44px))!important;
  max-width:1120px!important;
  margin:20px auto 70px!important;
  padding:10px!important;
  background:#fff!important;
  border:1px solid #b9c9d5!important;
  border-radius:9px!important;
  box-shadow:0 5px 18px rgba(31,95,139,.16)!important;
  overflow:visible!important;
  color:#111!important;
}
html body #purchaseOrder .po6-wrap{
  width:100%!important;
  margin:0!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  color:#111!important;
  font-family:Arial,sans-serif!important;
}

/* ===== Purchase Order header ===== */
html body #purchaseOrder .po6-head{
  width:100%!important;
  height:44px!important;
  min-height:44px!important;
  margin:0 0 10px!important;
  padding:0 14px!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  background:#1f5f8b!important;
  background-image:none!important;
  border:1px solid #184d70!important;
  border-bottom:3px solid #ef8b22!important;
  border-radius:5px 5px 0 0!important;
  box-shadow:none!important;
}
html body #purchaseOrder .po6-head-title{
  display:inline-flex!important;
  align-items:center!important;
  gap:7px!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font:800 18px/20px Arial,sans-serif!important;
  white-space:nowrap!important;
}
html body #purchaseOrder .po6-mode{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:62px!important;
  height:20px!important;
  margin-left:2px!important;
  padding:0 8px!important;
  box-sizing:border-box!important;
  border:1px solid #9fc4ff!important;
  border-radius:10px!important;
  background:#1f4d91!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font:800 10px/18px Arial,sans-serif!important;
  letter-spacing:.15px!important;
}
html body #purchaseOrder .po6-head-info{
  display:inline-flex!important;
  align-items:center!important;
  gap:3px!important;
  margin-left:auto!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font:700 12px/16px Arial,sans-serif!important;
  white-space:nowrap!important;
}
html body #purchaseOrder .po6-head-info b{
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
html body #purchaseOrder .po6-config{
  width:26px!important;
  min-width:26px!important;
  height:26px!important;
  margin-left:5px!important;
  padding:0!important;
  border:1px solid #d87812!important;
  border-radius:4px!important;
  background:#ef8b22!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font-size:14px!important;
  line-height:24px!important;
}

/* ===== Purchase Order header fields ===== */
html body #purchaseOrder .po6-box{
  width:100%!important;
  margin:0 0 8px!important;
  padding:9px 10px!important;
  box-sizing:border-box!important;
  background:#fff!important;
  border:1px solid #b9c9d5!important;
  border-radius:5px!important;
  box-shadow:none!important;
}
html body #purchaseOrder .po6-form{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:7px 10px!important;
  margin:0!important;
  padding:0!important;
}
html body #purchaseOrder .po6-form label{
  display:flex!important;
  flex-direction:column!important;
  gap:3px!important;
  min-width:0!important;
  margin:0!important;
  color:#17374e!important;
  -webkit-text-fill-color:#17374e!important;
  font:700 11.5px/14px Arial,sans-serif!important;
}
html body #purchaseOrder .po6-form label>span{
  color:#17374e!important;
  -webkit-text-fill-color:#17374e!important;
}
html body #purchaseOrder .po6-form input,
html body #purchaseOrder .po6-form select{
  width:100%!important;
  height:29px!important;
  min-height:29px!important;
  padding:3px 7px!important;
  box-sizing:border-box!important;
  border:1px solid #aebfcb!important;
  border-radius:3px!important;
  background:#fff!important;
  color:#111!important;
  -webkit-text-fill-color:#111!important;
  font:400 12px/20px Arial,sans-serif!important;
  box-shadow:none!important;
}
html body #purchaseOrder .po6-form input[readonly]{
  background:#f3f6f8!important;
  color:#404b53!important;
  -webkit-text-fill-color:#404b53!important;
}
html body #purchaseOrder .po6-form .wide{
  grid-column:span 2!important;
}

/* ===== Purchase Order toolbar ===== */
html body #purchaseOrder .po6-bar{
  width:100%!important;
  min-height:39px!important;
  margin:0 0 8px!important;
  padding:5px 7px!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  background:#1f5f8b!important;
  border:1px solid #184d70!important;
  border-radius:4px!important;
  box-shadow:none!important;
}
html body #purchaseOrder .po6-bar-title{
  display:none!important;
}
html body #purchaseOrder .po6-buttons{
  display:flex!important;
  align-items:center!important;
  gap:5px!important;
  flex-wrap:nowrap!important;
  width:100%!important;
}
html body #purchaseOrder .po6-buttons button{
  min-width:70px!important;
  height:28px!important;
  padding:0 10px!important;
  border:1px solid #d87812!important;
  border-radius:3px!important;
  background:#ef8b22!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font:800 11px/26px Arial,sans-serif!important;
  box-shadow:none!important;
  cursor:pointer!important;
}
html body #purchaseOrder .po6-buttons button:disabled{
  border-color:#9099a0!important;
  background:#aeb5ba!important;
  color:#f5f5f5!important;
  -webkit-text-fill-color:#f5f5f5!important;
  opacity:1!important;
  cursor:not-allowed!important;
}

/* ===== Purchase Order details ===== */
html body #purchaseOrder .po6-panel,
html body #purchaseOrder .po6-total,
html body #purchaseOrder .po6-find{
  width:100%!important;
  box-sizing:border-box!important;
  background:#fff!important;
  border:1px solid #b9c9d5!important;
  border-radius:5px!important;
  box-shadow:none!important;
}
html body #purchaseOrder .po6-panel{
  margin:0 0 8px!important;
}
html body #purchaseOrder .po6-title{
  min-height:32px!important;
  padding:5px 8px!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  background:#dcebf5!important;
  border-bottom:1px solid #b9c9d5!important;
  color:#17374e!important;
  -webkit-text-fill-color:#17374e!important;
  font:800 12px/20px Arial,sans-serif!important;
}
html body #purchaseOrder .po6-row-symbol{
  width:25px!important;
  min-width:25px!important;
  height:24px!important;
  margin-left:4px!important;
  padding:0!important;
  border:1px solid #1b75a6!important;
  border-radius:3px!important;
  background:#2a79a9!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font:800 16px/22px Arial,sans-serif!important;
}
html body #purchaseOrder .po6-scroll{
  overflow:auto!important;
  max-height:300px!important;
}
html body #purchaseOrder .po6-table{
  width:100%!important;
  border-collapse:collapse!important;
  background:#fff!important;
}
html body #purchaseOrder .po6-table th{
  height:31px!important;
  padding:5px 7px!important;
  background:#dcebf5!important;
  color:#17374e!important;
  -webkit-text-fill-color:#17374e!important;
  border:1px solid #aebfcb!important;
  font:800 11px/14px Arial,sans-serif!important;
  white-space:nowrap!important;
}
html body #purchaseOrder .po6-table td{
  height:33px!important;
  padding:3px 4px!important;
  background:#fff!important;
  color:#111!important;
  -webkit-text-fill-color:#111!important;
  border:1px solid #c6d2da!important;
}
html body #purchaseOrder .po6-table input,
html body #purchaseOrder .po6-table select{
  height:26px!important;
  min-height:26px!important;
  border:1px solid #b7c6d2!important;
  border-radius:2px!important;
  background:#fff!important;
  color:#111!important;
  -webkit-text-fill-color:#111!important;
  font-size:11px!important;
  box-sizing:border-box!important;
}
html body #purchaseOrder .po6-total{
  margin:0 0 8px!important;
  padding:7px 8px!important;
}

/* ===== VDS final spacing normalization ===== */
html body #vendorSchedule.ae50-vds29-page{
  margin-top:20px!important;
}
html body #vendorSchedule .vds29-head{
  border-bottom-width:3px!important;
}
html body #vendorSchedule .vds29-bar{
  min-height:39px!important;
  padding:5px 7px!important;
  border-radius:4px!important;
}
html body #vendorSchedule .vds29-bar button{
  min-width:70px!important;
  height:28px!important;
  padding:0 10px!important;
  border-radius:3px!important;
  font:800 11px/26px Arial,sans-serif!important;
}
html body #vendorSchedule .vds29-bar button:disabled{
  opacity:1!important;
  background:#aeb5ba!important;
  border-color:#9099a0!important;
  color:#f5f5f5!important;
  -webkit-text-fill-color:#f5f5f5!important;
}
html body #vendorSchedule input,
html body #vendorSchedule select{
  border-radius:3px!important;
}

/* ===== Purchase Return final spacing normalization ===== */
html body #purchaseReturnV1{
  margin-top:20px!important;
}
html body #purchaseReturnV1>.prtv-header.ai-tf-header{
  margin-bottom:10px!important;
  border-bottom-width:3px!important;
}
html body #purchaseReturnV1 .ai-tf-toolbar,
html body #purchaseReturnV1 .prtv-toolbar{
  min-height:39px!important;
}
html body #purchaseReturnV1 .ai-tf-toolbar button,
html body #purchaseReturnV1 .prtv-toolbar button{
  min-width:70px!important;
  height:28px!important;
  border-radius:3px!important;
}
html body #purchaseReturnV1 input,
html body #purchaseReturnV1 select,
html body #purchaseReturnV1 textarea{
  border-radius:3px!important;
}

/* ===== Gate Entry visual master: only harmless finishing normalization ===== */
html body #gateEntry{
  font-family:Arial,sans-serif!important;
}
html body #gateEntry input,
html body #gateEntry select,
html body #gateEntry textarea{
  box-sizing:border-box!important;
}

/* Responsive: only within this purchase batch */
@media(max-width:900px){
  html body #purchaseOrder,
  html body #vendorSchedule,
  html body #purchaseReturnV1{
    width:calc(100% - 20px)!important;
    margin:10px auto 60px!important;
    padding:8px!important;
  }
  html body #purchaseOrder .po6-form{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  html body #purchaseOrder .po6-buttons{
    flex-wrap:wrap!important;
  }
}
