

.po-requirement-screen {
  width: min(100%, 1320px);
  display: none;
  background: #f6f6f6;
  border: 1px solid #aeb7c4;
}

.po-requirement-screen:target {
  display: block;
}

body:has(.po-requirement-screen:target) .dashboard,
body:has(.po-requirement-screen:target) .screen,
body:has(.po-requirement-screen:target) .customer-info-screen,
body:has(.po-requirement-screen:target) .po-delivery-screen {
  display: none;
}

.po-req-top {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 8px 18px 10px;
  background: #f4f4f4;
}

.po-req-header-grid {
  display: grid;
  grid-template-columns: 120px minmax(140px, 1fr) 120px minmax(160px, 1fr) 90px minmax(120px, 1fr);
  gap: 5px;
  align-items: center;
  font-size: 13px;
}

.po-req-header-grid input {
  width: 100%;
  min-height: 28px;
}

.po-req-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  justify-content: flex-end;
  max-width: 620px;
}

.po-req-actions .small-button:not(.exit-button) {
  min-width: 90px;
  width: 104px;
  height: 42px;
  padding: 4px 10px;
  line-height: 1.1;
  text-align: center;
  font-size: 11px;
  flex: 0 0 auto;
}

.po-req-actions .exit-button {
  min-width: 44px;
  width: 44px;
  height: 44px;
  margin-left: 4px;
  flex: 0 0 auto;
}

.po-req-body {
  padding: 10px 18px 18px;
}

.po-req-tabs {
  display: flex;
  gap: 1px;
  align-items: end;
}

.po-req-tab-view {
  display: none;
  min-height: 560px;
  border: 1px solid #9ca9ba;
  background: #ffffff;
  padding: 10px;
}

.po-req-tab-view.active {
  display: block;
}

.po-req-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin-bottom: 8px;
}

.po-req-toolbar #poReqSearch {
  flex: 1 1 220px;
  max-width: 420px;
}

.po-req-toolbar #poReqWarehouseSelect {
  flex: 0 1 220px;
}

.po-req-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.po-req-check input {
  height: auto;
}

.po-req-grid-wrap {
  max-height: 62vh;
  border-top: 6px solid #c7c7cc;
}


.po-req-list-table {
  min-width: 1120px;
}


.po-req-list-table input,
.po-req-matrix-card input {
  width: 100%;
  height: 24px;
  border: 1px solid transparent;
  background: transparent;
  text-align: right;
  font: inherit;
}

.po-req-list-table input:focus,
.po-req-matrix-card input:focus {
  border-color: #8ba9df;
  background: #ffffff;
  outline: 2px solid rgba(23, 67, 108, 0.14);
}

.po-req-list-table tfoot td {
  background: #ecf5f5;
  color: #103f52;
  font-weight: 700;
}

.po-req-matrix-area {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 14px;
  align-items: start;
}

.po-req-matrix-card {
  border: 1px solid rgba(31, 111, 139, 0.14);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.po-req-matrix-card.small {
  max-width: 420px;
}

.po-req-matrix-card h2 {
  margin: 0;
  padding: 10px 12px;
  background: #ecf5f5;
  color: #103f52;
  font-size: 15px;
}

.po-req-matrix-wrap {
  margin-top: 0;
  border-top: 0;
  max-height: none;
}

.po-req-matrix-wrap table {
  min-width: 360px;
}

.po-req-matrix-card td,
.po-req-matrix-card th {
  text-align: center;
}

@media (max-width: 900px) {
  .po-req-top,
  .po-req-header-grid,
  .po-req-actions,
  .po-req-toolbar,
  .po-req-matrix-area {
    display: block;
  }

  .po-req-actions {
    display: flex;
    margin-top: 10px;
    max-width: none;
  }

  .po-req-actions .small-button {
    margin: 3px 0;
  }
}
.po-requirement-screen {
    max-width: 1600px;
    margin: 0 auto;
}




.po-req-list-table {
    table-layout: fixed;
    width: 100%;
    min-width: 1240px;
}

/* Column 1 is the beneficiary drill-down action. Keep it narrow so adding
   the >> button does not steal width from Item No / Item Description. */
.po-req-list-table th:nth-child(1),
.po-req-list-table td:nth-child(1) {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    padding-left: 4px;
    padding-right: 4px;
    text-align: center;
}

.po-req-list-table th:nth-child(2),
.po-req-list-table td:nth-child(2) {
    width: 150px;
}

.po-req-list-table th:nth-child(3),
.po-req-list-table td:nth-child(3) {
    width: 100px;
}

.po-req-list-table th:nth-child(4),
.po-req-list-table td:nth-child(4),
.po-req-list-table th:nth-child(5),
.po-req-list-table td:nth-child(5),
.po-req-list-table th:nth-child(6),
.po-req-list-table td:nth-child(6),
.po-req-list-table th:nth-child(7),
.po-req-list-table td:nth-child(7) {
    width: 70px;
}

.po-req-list-table th:nth-child(8),
.po-req-list-table td:nth-child(8) {
    width: 110px;
}

.po-req-list-table th:nth-child(9),
.po-req-list-table td:nth-child(9) {
    width: 250px;
}

.po-req-list-table th:nth-child(10),
.po-req-list-table td:nth-child(10) {
    width: 302px;
}


.po-req-list-table td:nth-child(7) input,
.po-req-list-table td:nth-child(8) input {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    text-align: center;
}


.po-req-list-table th:nth-child(4),
.po-req-list-table th:nth-child(5),
.po-req-list-table th:nth-child(6),
.po-req-list-table th:nth-child(7),
.po-req-list-table th:nth-child(8),
.po-req-list-table td:nth-child(4),
.po-req-list-table td:nth-child(5),
.po-req-list-table td:nth-child(6),
.po-req-list-table td:nth-child(7),
.po-req-list-table td:nth-child(8) {
    text-align: center;
    white-space: normal;
    line-height: 1.2;
}


.po-req-list-table th {
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
}


.po-req-list-table th:nth-child(4),
.po-req-list-table th:nth-child(5),
.po-req-list-table th:nth-child(6),
.po-req-list-table th:nth-child(7),
.po-req-list-table th:nth-child(8) {
    font-size: 0.78rem;
    padding-left: 4px;
    padding-right: 4px;
}


.po-req-matrix-card table {
    table-layout: fixed !important;
    width: 100% !important;
    min-width: 0 !important;
}

.po-req-matrix-card th,
.po-req-matrix-card td {
    text-align: center !important;
    font-size: 13px !important;
    padding: 4px 6px !important;
    white-space: normal !important;
}


.po-req-matrix-card th:first-child,
.po-req-matrix-card td:first-child {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
}


.po-req-matrix-card th:not(:first-child):not(:last-child),
.po-req-matrix-card td:not(:first-child):not(:last-child) {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
}


.po-req-matrix-card th:first-child,
.po-req-matrix-card td:first-child {
    width: 30px;
    min-width: 30px;
}


.po-req-matrix-card th:last-child,
.po-req-matrix-card td:last-child {
    width: 30px;
    min-width: 30px;
    
}


.po-req-matrix-card input {
    margin: 0 auto;
    display: block;
    text-align: center;
}

#poReqNoSizeView table {
    table-layout: fixed !important;
    width: 100% !important;
    min-width: 720px;
}

#poReqNoSizeView th:nth-child(1),
#poReqNoSizeView td:nth-child(1) {
    width: auto !important;
}

#poReqNoSizeView th:nth-child(2),
#poReqNoSizeView td:nth-child(2),
#poReqNoSizeView th:nth-child(3),
#poReqNoSizeView td:nth-child(3),
#poReqNoSizeView th:nth-child(4),
#poReqNoSizeView td:nth-child(4) {
    width: 160px !important;
    text-align: center !important;
}

#poReqNoSizeView th:nth-child(5),
#poReqNoSizeView td:nth-child(5) {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    padding-left: 4px;
    padding-right: 4px;
    text-align: center !important;
}


.po-req-item-select,
.po-req-desc-select,
.po-req-list-table .ts-wrapper {
  width: 100%;
  min-width: 0;
}

.po-req-list-table .ts-control {
  min-height: 30px;
  font-size: 12px;
}

/* Tom Select search/typing must read left-to-right. The generic table input
   rule above right-aligns numeric inputs and would otherwise affect Tom Select. */
.po-req-list-table .ts-control input,
.po-req-review-overlay .ts-control input {
  text-align: left !important;
  direction: ltr;
}

.po-req-list-table .ts-control,
.po-req-review-overlay .ts-control {
  text-align: left;
}

.po-req-item-trigger {
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid #cfd6df;
  border-radius: 4px;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.po-req-item-trigger:hover,
.po-req-item-trigger:focus {
  border-color: #8ba9df;
  outline: 2px solid rgba(23, 67, 108, 0.10);
}

.po-req-item-trigger-code {
  white-space: nowrap;
  overflow: visible;
}

.po-req-item-trigger-description {
  white-space: normal;
  line-height: 1.2;
}

.po-req-list-table td:nth-child(9) .ts-control {
  white-space: nowrap;
}

.po-req-selected-item-code {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.po-req-selected-item-description {
  white-space: normal;
  line-height: 1.2;
}

.po-req-list-table .ts-dropdown {
  min-width: 420px;
  max-width: min(620px, 80vw);
}

.po-req-item-option {
  padding: 2px 0;
  white-space: normal;
}

.po-req-item-option-code {
  font-weight: 600;
  white-space: nowrap;
}

.po-req-item-option-desc {
  margin-top: 2px;
  color: #586575;
  white-space: normal;
}

.po-req-beneficiary-button-cell,
.po-req-beneficiary-open-cell {
  width: 42px;
  padding: 3px 4px;
  text-align: center;
  white-space: nowrap;
}

.po-req-beneficiary-button,
.po-req-beneficiary-open {
  min-width: 34px;
  width: auto;
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #04719a;
  border-radius: 8px;
  background: #057da8;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(0, 63, 87, 0.18);
  cursor: pointer;
}

.po-req-beneficiary-button:hover,
.po-req-beneficiary-button:focus,
.po-req-beneficiary-open:hover,
.po-req-beneficiary-open:focus {
  background: #04719a;
  outline: 1px solid rgba(5, 125, 168, 0.22);
}

.po-req-beneficiary-dialog {
  width: min(720px, 94vw);
}

.po-req-beneficiary-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 16px;
}

.po-req-beneficiary-table {
  width: 100%;
  min-width: 560px;
}

.po-req-beneficiary-table th:last-child,
.po-req-beneficiary-table td:last-child {
  width: 52px;
  text-align: center;
}

.po-req-no-size-beneficiary-table th:last-child,
.po-req-no-size-beneficiary-table td:last-child {
  width: auto;
  text-align: left;
}

.po-req-no-size-beneficiary-table {
  min-width: 520px;
}

.po-req-review-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.42);
}

.po-req-review-dialog {
  width: min(1120px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.po-req-review-header,
.po-req-review-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.po-req-review-header {
  border-bottom: 1px solid #d5dbe3;
}

.po-req-review-header h2,
.po-req-review-header p {
  margin: 0;
}

.po-req-review-header p {
  margin-top: 4px;
  color: #586575;
  font-size: 13px;
}

.po-req-review-groups {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 16px;
}

.po-req-review-group {
  margin-bottom: 12px;
  border: 1px solid #cbd4df;
  border-radius: 8px;
  overflow: hidden;
}

.po-req-review-group-head {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(260px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  background: #f4f7f9;
}

.po-req-review-group-check,
.po-req-review-supplier-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.po-req-review-supplier-wrap .ts-wrapper {
  flex: 1 1 auto;
  min-width: 180px;
}

.po-req-review-items {
  max-height: 260px;
}

.po-req-review-items table {
  min-width: 980px;
  width: 100%;
}

.po-req-review-history-cell {
  min-width: 250px;
  vertical-align: top;
}

.po-req-review-history-line {
  line-height: 1.25;
}

.po-req-review-history-meta {
  margin-top: 2px;
  color: #586575;
  font-size: 11px;
}

.po-req-review-history-more {
  margin-top: 4px;
}

.po-req-review-history-more summary {
  color: #17436c;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}

.po-req-review-history-list {
  margin-top: 5px;
  padding-left: 8px;
  border-left: 2px solid #d8e1ea;
}

.po-req-review-history-list .po-req-review-history-line + .po-req-review-history-line {
  margin-top: 6px;
}

.po-req-review-no-history {
  color: #8a949f;
}

.po-req-review-warning {
  color: #a33a23;
  font-size: 11px;
  white-space: nowrap;
}

.po-req-review-footer {
  justify-content: flex-end;
  border-top: 1px solid #d5dbe3;
}

.po-req-created-dialog {
  width: min(780px, 94vw);
}

.po-req-created-list {
  flex: 1 1 auto;
  overflow: auto;
  padding: 14px 16px 6px;
}

.po-req-created-card {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #cbd4df;
  border-radius: 8px;
  background: #fff;
}

.po-req-created-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.po-req-created-supplier {
  color: #586575;
  font-size: 12px;
  font-weight: 600;
}

.po-req-created-po-no {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 700;
}

.po-req-created-line-count {
  margin-top: 3px;
  color: #586575;
  font-size: 12px;
}

.po-req-created-open {
  min-width: 44px;
  font-weight: 700;
}

.po-req-created-merged {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #e0e5eb;
}

.po-req-created-merged-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
}

.po-req-created-merge-item {
  padding: 7px 0;
}

.po-req-created-merge-item + .po-req-created-merge-item {
  border-top: 1px dashed #d8e1ea;
}

.po-req-created-merge-desc {
  color: #586575;
  font-size: 11px;
}

.po-req-created-merge-sources {
  margin-top: 3px;
  color: #586575;
  font-size: 12px;
}

.po-req-created-merge-total {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
}

.po-req-created-no-merge {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #e0e5eb;
  color: #7a8591;
  font-size: 12px;
}

.po-req-created-summary {
  padding: 8px 16px 12px;
  color: #33404d;
  font-size: 13px;
}

@media (max-width: 760px) {
  .po-req-review-overlay {
    padding: 8px;
  }

  .po-req-review-dialog {
    width: 100%;
    max-height: 96vh;
  }

  .po-req-review-group-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .po-req-review-supplier-wrap {
    align-items: stretch;
    flex-direction: column;
  }
}
