
.goods-received-items-table {
  min-width: 0;
}


.goods-received-items-table .supplier-po-col-sap-no .ts-control {
  background: #fff;
  border-color: #cccccc;
}

.goods-received-items-table td input.goods-received-qty-input {
  background: #fff;
  border: 1px solid #cccccc;
  border-radius: 4px;
  text-align: center;
}

.goods-received-form-layout {
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 1fr);
}

.goods-received-po-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 4px;
}

.goods-received-po-control .small-button {
  min-height: 24px;
  padding: 2px 8px;
}

.goods-received-po-panel {
  width: min(760px, 96vw);
}

.goods-received-po-list-wrap {
  max-height: 430px;
  margin-top: 8px;
}

.goods-received-po-list-wrap table {
  min-width: 660px;
}

.goods-received-label-panel {
  width: min(1120px, 96vw);
}

.goods-received-label-wrap {
  max-height: 62vh;
  margin-top: 8px;
}

.goods-received-label-table {
  min-width: 980px;
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.goods-received-label-table th,
.goods-received-label-table td {
  border-bottom: 1px solid #d6dde3;
  padding: 4px 6px;
  text-align: left;
  vertical-align: middle;
}

.goods-received-label-table th {
  background: #eef3f7;
  color: #001b2e;
  font-weight: 700;
}

.goods-received-label-table th:nth-child(1),
.goods-received-label-table td:nth-child(1) {
  width: 54px;
  text-align: center;
}

.goods-received-label-table th:nth-child(2),
.goods-received-label-table td:nth-child(2) {
  width: 150px;
}

.goods-received-label-table th:nth-child(4),
.goods-received-label-table td:nth-child(4),
.goods-received-label-table th:nth-child(5),
.goods-received-label-table td:nth-child(5),
.goods-received-label-table th:nth-child(6),
.goods-received-label-table td:nth-child(6),
.goods-received-label-table th:nth-child(7),
.goods-received-label-table td:nth-child(7) {
  width: 92px;
}

.goods-received-label-table th:nth-child(8),
.goods-received-label-table td:nth-child(8) {
  width: 170px;
}

.goods-received-label-qty {
  width: 72px;
}

.goods-received-label-preview {
  width: 150px;
  height: 75px;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid #c5cdd4;
  background: #fff;
  color: #000;
  overflow: hidden;
}

.goods-received-label-preview img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.goods-received-label-preview strong,
.goods-received-label-preview span {
  display: block;
  overflow: hidden;
}

.goods-received-label-preview strong {
  font-family: "Arial Narrow", Arial, Helvetica, sans-serif;
  font-size: 9px;
  line-height: 1;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-height: 28px;
}

.goods-received-label-preview span {
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.goods-received-items-table th:nth-child(1),
.goods-received-items-table td:nth-child(1) {
    width: 34px;
}


.goods-received-items-table th:nth-child(2),
.goods-received-items-table td:nth-child(2) {
    width: 42px;
}


.goods-received-items-table th:nth-child(3),
.goods-received-items-table td:nth-child(3) {
    width: 120px;
}


.goods-received-items-table th:nth-child(4),
.goods-received-items-table td:nth-child(4) {
    width: 240px;
    max-width: 240px;
    white-space: normal;
    word-break: break-word;
}


.goods-received-items-table th:nth-child(5),
.goods-received-items-table td:nth-child(5) {
    width: 30px;
    text-align: center;
}


.goods-received-items-table th:nth-child(6),
.goods-received-items-table td:nth-child(6) {
    width: 30px;
    text-align: center;
}


.goods-received-items-table th:nth-child(7),
.goods-received-items-table td:nth-child(7) {
    width: 30px;
    text-align: center;
}


.goods-received-items-table th:nth-child(8),
.goods-received-items-table td:nth-child(8) {
    width: 30px;
    text-align: center;
}


.goods-received-items-table th:nth-child(9),
.goods-received-items-table td:nth-child(9) {
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    text-align: center;
}

.goods-received-items-table tr {
    height: 24px !important;
}

.goods-received-items-table td {
    padding: 0 4px !important;
    vertical-align: middle;
}


.goods-received-items-table th {
    font-size: 11px;
    padding: 0 3px !important;
    line-height: 1.1;
}

.goods-received-items-table th:nth-child(5),
.goods-received-items-table td:nth-child(5),
.goods-received-items-table th:nth-child(6),
.goods-received-items-table td:nth-child(6),
.goods-received-items-table th:nth-child(7),
.goods-received-items-table td:nth-child(7),
.goods-received-items-table th:nth-child(8),
.goods-received-items-table td:nth-child(8) {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    font-size: 11px;
    text-align: center;
}


.goods-received-items-table td:nth-child(5) input,
.goods-received-items-table td:nth-child(6) input,
.goods-received-items-table td:nth-child(7) input,
.goods-received-items-table td:nth-child(8) input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 2px;
    text-align: center;
}



/* ==========================================================================
   goods-received — compact mobile TABLE (module-scoped, <=640px).
   Shows only the most useful columns on phones; other desktop columns are hidden
   VISUALLY (kept in the DOM, still populated, reachable after Open). Desktop
   table unchanged above 640px. Shared compact-table styling for consistency.
   ========================================================================== */
@media (max-width: 640px) {
  #goods-received .item-master-panel .grid-wrap {
    border-top: 0;
    max-height: 70vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
  }
  #goods-received .item-master-panel .grid-wrap > table {
    min-width: 0;
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
  }
  #goods-received .item-master-panel .grid-wrap > table > thead {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
    clip: auto;
  }
  #goods-received .item-master-panel .grid-wrap > table > thead > tr > th {
    background: #eef2f7;
    color: #213247;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 5px;
    white-space: normal;
    text-align: left;
    vertical-align: middle;
  }
  #goods-received .item-master-panel .grid-wrap > table > tbody > tr > td {
    display: table-cell;
    padding: 8px 5px;
    font-size: 13px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: break-word;
    text-align: left;
    vertical-align: middle;
    border: 0;
    border-bottom: 1px solid #e3e8ee;
    max-width: none;
    min-width: 0;
    width: auto;
  }
  #goods-received .item-master-panel .grid-wrap > table > tbody > tr > td::before { content: none; }
  #goods-received .item-master-panel .grid-wrap > table > thead > tr > th:nth-child(4),
  #goods-received .item-master-panel .grid-wrap > table > tbody > tr > td:nth-child(4):not([colspan]) { display: none; }
  #goods-received .item-master-panel .grid-wrap > table > thead > tr > th:nth-child(5),
  #goods-received .item-master-panel .grid-wrap > table > tbody > tr > td:nth-child(5):not([colspan]) { display: none; }
  /* Keep the short primary identifier on one line */
  #goods-received .item-master-panel .grid-wrap > table > thead > tr > th:nth-child(2),
  #goods-received .item-master-panel .grid-wrap > table > tbody > tr > td:nth-child(2) { white-space: nowrap; }
  /* Action / Open control: compact, centered, touch-friendly */
  #goods-received .item-master-panel .grid-wrap > table .open-cell,
  #goods-received .item-master-panel .grid-wrap > table .edit-cell,
  #goods-received .item-master-panel .grid-wrap > table .pd-open-cell,
  #goods-received .item-master-panel .grid-wrap > table .po-icon-cell {
    width: 1%;
    white-space: nowrap;
    text-align: center;
    padding: 6px 5px;
  }
  #goods-received .item-master-panel .grid-wrap > table .open-cell a,
  #goods-received .item-master-panel .grid-wrap > table .edit-cell button,
  #goods-received .item-master-panel .grid-wrap > table .pd-open-cell button,
  #goods-received .item-master-panel .grid-wrap > table .po-icon-cell a {
    display: inline-block;
    min-width: 36px;
    min-height: 32px;
    line-height: 1.5;
    padding: 3px 6px;
  }
  #goods-received .item-master-panel .grid-wrap > table > tbody > tr > td[colspan] {
    text-align: center;
    color: #6a7785;
    white-space: normal;
  }
}
