
/* Inoviq ERP — Purchase Return / RTV Gate Entry UI Standard
   UI-only stylesheet. No JavaScript or transaction logic changed. */

html body #purchaseReturnV1{
  width:min(1120px,calc(100% - 44px))!important;
  max-width:1120px!important;
  margin:20px auto 70px!important;
  padding:10px!important;
  box-sizing:border-box!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;
}

/* Header */
html body #purchaseReturnV1 .prtv-header{
  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;
  background:#1f5f8b!important;
  border:1px solid #184d70!important;
  border-bottom:2px solid #ef8b22!important;
  border-radius:5px 5px 0 0!important;
  color:#fff!important;
  box-shadow:none!important;
  position:relative!important;
}
html body #purchaseReturnV1 .prtv-header::before{
  content:"↪  Purchase Return";
  display:flex!important;
  align-items:center!important;
  color:#fff!important;
  font:800 18px/20px Arial,sans-serif!important;
}
html body #purchaseReturnV1 .prtv-header::after{
  content:"ADD MODE";
  position:absolute!important;
  left:186px!important;
  top:11px!important;
  height:20px!important;
  padding:0 8px!important;
  display:inline-flex!important;
  align-items:center!important;
  border-radius:10px!important;
  background:#1f4d91!important;
  border:1px solid #9fc4ff!important;
  color:#fff!important;
  font:800 10px Arial,sans-serif!important;
}

/* Existing transaction-form generated header content */
html body #purchaseReturnV1 .transaction-form-header,
html body #purchaseReturnV1 .standard-form-header,
html body #purchaseReturnV1 .form-header-title{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  color:#fff!important;
}
html body #purchaseReturnV1 .prtv-header *{
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}

/* Fields card */
html body #purchaseReturnV1 .prtv-fields{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:8px 14px!important;
  width:100%!important;
  margin:0!important;
  padding:12px 16px 13px!important;
  box-sizing:border-box!important;
  background:#fff!important;
  border:1px solid #b9c9d5!important;
  border-radius:5px!important;
  box-shadow:none!important;
}
html body #purchaseReturnV1 .prtv-fields .field-wrap{
  margin:0!important;
  padding:0!important;
}
html body #purchaseReturnV1 .prtv-fields label{
  display:block!important;
  margin:0 0 3px!important;
  color:#111!important;
  -webkit-text-fill-color:#111!important;
  font:700 11.5px/15px Arial,sans-serif!important;
}
html body #purchaseReturnV1 .prtv-fields input,
html body #purchaseReturnV1 .prtv-fields select{
  width:100%!important;
  height:34px!important;
  min-height:34px!important;
  box-sizing:border-box!important;
  padding:4px 8px!important;
  background:#fff!important;
  color:#111!important;
  -webkit-text-fill-color:#111!important;
  border:1px solid #b7c6d2!important;
  border-radius:4px!important;
  font:600 12.5px Arial,sans-serif!important;
}
html body #purchaseReturnV1 .prtv-fields input[readonly]{
  background:#e9eef2!important;
  color:#111!important;
  -webkit-text-fill-color:#111!important;
}

/* Toolbar */
html body #purchaseReturnV1 .prtv-action-toolbar{
  width:100%!important;
  height:46px!important;
  min-height:46px!important;
  margin:8px 0!important;
  padding:6px 9px!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:6px!important;
  background:#1f5f8b!important;
  border:1px solid #184d70!important;
  border-radius:5px!important;
  box-shadow:none!important;
}
html body #purchaseReturnV1 .prtv-action-toolbar .clean-toolbar-title{
  display:none!important;
}
html body #purchaseReturnV1 .prtv-action-toolbar .clean-toolbar-buttons{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:6px!important;
  margin-left:auto!important;
  flex-wrap:nowrap!important;
}
html body #purchaseReturnV1 .prtv-action-toolbar button{
  height:32px!important;
  min-height:32px!important;
  padding:3px 11px!important;
  margin:0!important;
  background:#f39a22!important;
  color:#111!important;
  -webkit-text-fill-color:#111!important;
  border:1px solid #c97310!important;
  border-radius:4px!important;
  box-shadow:none!important;
  font:700 12px Arial,sans-serif!important;
}
html body #purchaseReturnV1 .prtv-action-toolbar button:disabled{
  background:#6f91a8!important;
  border-color:#5b7c92!important;
  color:#dbe7ef!important;
  -webkit-text-fill-color:#dbe7ef!important;
}

/* Details */
html body #purchaseReturnV1 .prtv-detail{
  width:100%!important;
  margin:0!important;
  padding:0!important;
  box-sizing:border-box!important;
  background:#fff!important;
  border:1px solid #b9c9d5!important;
  border-radius:5px!important;
  overflow:auto!important;
  box-shadow:none!important;
}
html body #purchaseReturnV1 .prtv-detail-title{
  width:100%!important;
  height:34px!important;
  min-height:34px!important;
  margin:0!important;
  padding:0 12px!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  background:#edf6fc!important;
  color:#163750!important;
  -webkit-text-fill-color:#163750!important;
  border:0!important;
  border-bottom:1px solid #b9cfdf!important;
  font:800 13px Arial,sans-serif!important;
}
html body #purchaseReturnV1 .prtv-detail-title::before{
  content:"▣ ";
}

/* Grid */
html body #purchaseReturnV1 .prtv-table{
  width:max-content!important;
  min-width:100%!important;
  border-collapse:collapse!important;
  background:#fff!important;
  font-size:12px!important;
}
html body #purchaseReturnV1 .prtv-table th{
  height:32px!important;
  padding:5px 8px!important;
  background:#dcebf5!important;
  color:#17374e!important;
  -webkit-text-fill-color:#17374e!important;
  border:1px solid #aebfcb!important;
  font:800 11.5px/14px Arial,sans-serif!important;
  white-space:nowrap!important;
  text-align:left!important;
}
html body #purchaseReturnV1 .prtv-table td{
  height:34px!important;
  padding:3px 4px!important;
  background:#fff!important;
  color:#111!important;
  -webkit-text-fill-color:#111!important;
  border:1px solid #c6d2da!important;
  white-space:nowrap!important;
}
html body #purchaseReturnV1 .prtv-table input,
html body #purchaseReturnV1 .prtv-table select{
  height:27px!important;
  min-height:27px!important;
  padding:3px 5px!important;
  box-sizing:border-box!important;
  background:#fff!important;
  color:#111!important;
  -webkit-text-fill-color:#111!important;
  border:1px solid #b7c6d2!important;
}
html body #purchaseReturnV1 .prtv-empty{
  height:44px!important;
  background:#fff!important;
  color:#6b7783!important;
  -webkit-text-fill-color:#6b7783!important;
  text-align:center!important;
}

/* Company/FY generated header right side */
html body #purchaseReturnV1 .company-fy,
html body #purchaseReturnV1 .header-company-fy,
html body #purchaseReturnV1 [class*="company"][class*="fy"]{
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font:700 12px Arial,sans-serif!important;
}

/* Mobile */
@media(max-width:900px){
  html body #purchaseReturnV1{
    width:calc(100% - 20px)!important;
    margin:10px auto 60px!important;
    padding:8px!important;
  }
  html body #purchaseReturnV1 .prtv-fields{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}


/* === V2 final Gate Entry alignment fix === */

/* Single continuous header strip */
html body #purchaseReturnV1 .prtv-header{
  background:#1f5f8b!important;
  background-image:none!important;
  overflow:visible!important;
}

html body #purchaseReturnV1 .prtv-header > *{
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
}

/* Remove old/dark title container visuals if present */
html body #purchaseReturnV1 .transaction-form-header,
html body #purchaseReturnV1 .standard-form-header,
html body #purchaseReturnV1 .form-header-title,
html body #purchaseReturnV1 [class*="header-title"],
html body #purchaseReturnV1 [class*="title-box"]{
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  margin:0!important;
  padding:0!important;
}

/* Keep generated title area from covering the continuous strip */
html body #purchaseReturnV1 .prtv-header::before{
  position:static!important;
  inset:auto!important;
  margin:0!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}

/* Mode badge next to title, not inside a dark box */
html body #purchaseReturnV1 .prtv-header::after{
  left:186px!important;
  top:11px!important;
  z-index:2!important;
}

/* Details title exactly like Gate Entry Items */
html body #purchaseReturnV1 .prtv-detail-title{
  position:relative!important;
  left:auto!important;
  right:auto!important;
  top:auto!important;
  transform:none!important;
  justify-content:flex-start!important;
  text-align:left!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

/* Any nested title text forced to left */
html body #purchaseReturnV1 .prtv-detail-title > *,
html body #purchaseReturnV1 .prtv-detail-title span,
html body #purchaseReturnV1 .prtv-detail-title div{
  position:static!important;
  float:none!important;
  margin:0!important;
  padding:0!important;
  text-align:left!important;
  color:#163750!important;
  -webkit-text-fill-color:#163750!important;
}

/* Neutralize right-positioned legacy details captions */
html body #purchaseReturnV1 .prtv-detail [class*="title"],
html body #purchaseReturnV1 .prtv-detail [class*="caption"]{
  left:auto!important;
  right:auto!important;
  transform:none!important;
  text-align:left!important;
}


/* === V3: Gate Entry exact badge + Company/FY typography === */

/* ADD MODE badge */
html body #purchaseReturnV1 .prtv-header::after{
  content:"ADD MODE"!important;
  left:186px!important;
  top:11px!important;
  height:20px!important;
  min-height:20px!important;
  padding:0 8px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:#1f4d91!important;
  border:1px solid #9fc4ff!important;
  border-radius:10px!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font:800 10px/18px Arial,sans-serif!important;
  letter-spacing:0!important;
  box-shadow:none!important;
}

/* Company / FY on right side — Gate Entry style */
html body #purchaseReturnV1 .prtv-header .company-fy,
html body #purchaseReturnV1 .prtv-header .header-company-fy,
html body #purchaseReturnV1 .prtv-header [class*="company"][class*="fy"],
html body #purchaseReturnV1 .prtv-header > *:last-child{
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font:700 12px/16px Arial,sans-serif!important;
  letter-spacing:0!important;
  text-shadow:none!important;
}

/* Ensure inner Company/FY labels/values inherit exact same look */
html body #purchaseReturnV1 .prtv-header > *:last-child *,
html body #purchaseReturnV1 .prtv-header .company-fy *,
html body #purchaseReturnV1 .prtv-header .header-company-fy *{
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font:700 12px/16px Arial,sans-serif!important;
}

/* Right align exactly like Gate Entry */
html body #purchaseReturnV1 .prtv-header > *:last-child{
  margin-left:auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  white-space:nowrap!important;
}


/* V4 FINAL — only ADD MODE badge position correction */
html body #purchaseReturnV1 .prtv-header::after{
  left:270px!important;
  top:11px!important;
}


/* V5 FINAL — Gate Entry style title/badge spacing */
html body #purchaseReturnV1 .prtv-header::after{
  left:258px!important;
  top:11px!important;
}

/* V6 FINAL — Purchase Return title / ADD MODE clear Gate Entry-style gap */
html body #purchaseReturnV1 .prtv-header::after{
  left:285px!important;
  top:11px!important;
}

/* V7 FINAL — match Gate Entry title-to-mode-badge gap */
html body #purchaseReturnV1 .prtv-header::after{
  left:274px!important;
  top:11px!important;
}
