

#poBulkDeliverySection { margin-top: 6px; }
#poBulkDeliverySection .bulk-delivery-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
#poBulkDeliverySection .bulk-delivery-status { min-height: 18px; font-size: 12.5px; margin: 2px 0 6px; }
#poBulkDeliverySection { min-width: 0; max-width: 100%; }
#poBulkDeliverySection table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 12.5px; }
#poBulkDeliverySection th, #poBulkDeliverySection td { border: 1px solid #c6ccd4; padding: 3px 6px; text-align: left; }
#poBulkDeliverySection th { background: #eef1f5; font-weight: 600; }
#poBulkDeliverySection .bulk-delivery-draft { max-height: 260px; overflow: auto; }
#poBulkDeliverySection .bulk-delivery-notes { max-height: 180px; overflow: auto; }
#poBulkDeliverySection input, #poBulkDeliverySection select { font: inherit; }
#po-delivery.bulk-fulfillment .delivery-left { display: contents; }
#po-delivery.bulk-fulfillment .delivery-left-top { grid-column: 1; }
#po-delivery.bulk-fulfillment #poBulkDeliverySection { grid-column: 1 / -1; }
#po-delivery.bulk-fulfillment .delivery-right { grid-column: 2; grid-row: 1; }
#po-delivery.bulk-fulfillment .uniform-panel { display: none; }
.delivery-popup-panel {
  width: min(760px, 96vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.delivery-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.delivery-popup-head h2 {
  margin: 0;
}
.delivery-popup-head .exit-button {
  align-self: flex-start;
  margin-top: -8px;
}
.delivery-popup-panel .bulk-delivery-notes {
  overflow: auto;
}
.delivery-popup-panel .bulk-delivery-notes table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.delivery-popup-panel .bulk-delivery-notes th,
.delivery-popup-panel .bulk-delivery-notes td {
  border: 1px solid #c6ccd4;
  padding: 4px 6px;
  text-align: left;
}
.delivery-popup-panel .bulk-delivery-notes th {
  background: #eef1f5;
  font-weight: 600;
}
.remaining-po-popup-panel {
  width: min(560px, 94vw);
}
.remaining-po-popup-panel .remaining-po-grid {
  max-height: 62vh;
  overflow: auto;
}
.bulk-print-mode-panel {
  width: min(360px, 92vw);
}
.bulk-print-mode-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 14px;
}
.bulk-print-mode-actions .small-button {
  min-height: 42px;
  font-weight: 700;
}


.delivery-left { grid-template-columns: minmax(0, 1fr); }
.delivery-left-top { max-width: 100%; }


.po-delivery-screen {
  position: relative;
}

.po-delivery-screen {
  width: min(100%, 1300px);
  display: none;
  background: #f6f6f6;
  border: 1px solid #aeb7c4;
}

.delivery-data-top {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 6px 28px 8px;
  border-top: 2px solid #c80020;
  background: #f4f4f4;
}

.delivery-actions {
  display: grid;
  grid-template-columns: repeat(2, 92px);
  gap: 4px;
  max-width: 80px;
  margin-left: auto;
}

.delivery-data-body {
  padding: 6px 28px 24px;
}

.delivery-data-layout {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(360px, 420px);
  gap: 16px;
  align-items: start;
}

.delivery-data-layout > *,
.delivery-left-top > * {
  min-width: 0;
}

.delivery-left {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.delivery-left-top {
  display: grid;
  grid-template-columns: minmax(330px, 1fr) 210px;
  gap: 10px;
  align-items: start;
}

.delivery-side-actions {
  display: grid;
  gap: 8px;
  width: 70px;
  margin-top: 12px;
}

.beneficiary-list-title {
  margin: 8px 0;
  text-align: center;
  font-size: 18px;
  font-weight: 400;
}

.beneficiary-delivery-grid {
  overflow: auto;
  max-height: 430px;
  background: #fff;
  border: 1px solid rgba(31, 111, 139, 0.14);
  border-radius: 12px;
}

.beneficiary-delivery-grid table {
  min-width: 720px;
}

.yellow-cell {
  width: 34px;
  padding: 0;
  text-align: center;
  background: transparent;
  color: #5a4900;
  font-weight: 700;
}

.yellow-cell a {
  min-width: 34px;
  width: auto;
  padding: 0 8px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #d99d00;
  border-radius: 8px;
  background: #f4b400;
  color: #1d1600;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(96, 70, 0, 0.2);
}

.delivery-right {
  display: grid;
  gap: 8px;
  align-items: start;
}

.delivery-right-top {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.remarks-box {
  display: grid;
  gap: 4px;
}

.remarks-box textarea {
  min-height: 160px;
  border: 1px solid #8792a0;
  font: inherit;
}

@media (max-width: 430px) {
.delivery-data-top,
.delivery-data-layout,
.delivery-right-top {
    display: block;
  }
}

.po-delivery-screen {
  border: 1px solid rgba(31, 111, 139, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(22, 34, 42, 0.12);
  overflow: hidden;
}

.po-delivery-screen {
  width: min(100%, 1180px);
}

.delivery-data-top {
  background: linear-gradient(135deg, #ffffff 0%, #eef7f7 100%);
  border-top: 0;
  border-bottom: 1px solid rgba(31, 111, 139, 0.12);
  padding: 18px;
}

.beneficiary-delivery-grid {
  border: 1px solid rgba(31, 111, 139, 0.14);
  border-radius: 12px;
  border-top: 1px solid rgba(31, 111, 139, 0.14);
  background: #ffffff;
}

.yellow-cell {
  border-radius: 3px;
}

.delivery-data-body {
  padding: 20px;
}

.yellow-cell {
  background: transparent;
}

@media (max-width: 1000px) {
.delivery-data-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1000px) {
.delivery-data-layout,
.delivery-left-top,
.delivery-right-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1000px) {
.delivery-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 1000px) {
.beneficiary-delivery-grid {
    max-width: 100%;
    overflow-x: auto;
  }
}

.delivery-data-top {
  position: relative;
}

.delivery-data-top {
  padding-right: 72px;
}

.delivery-data-top .exit-button {
  position: absolute;
  top: 16px;
  right: 16px;
  margin: 0;
}

@media (max-width: 1000px) {
.delivery-actions {
    padding-top: 48px;
  }
}

@media (max-width: 640px) {
.delivery-data-top {
    padding: 16px;
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
}

@media (max-width: 640px) {
.delivery-data-top .exit-button {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    margin-left: auto;
  }

  .po-delivery-screen,
  .delivery-data-top,
  .delivery-data-body,
  .delivery-data-layout,
  .delivery-left,
  .delivery-left-top,
  .delivery-right,
  .delivery-right-top,
  .delivery-form,
  .delivery-field-grid,
  .delivery-update-grid,
  .delivery-actions,
  .beneficiary-delivery-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .delivery-data-top > *,
  .delivery-data-layout,
  .delivery-left,
  .delivery-left-top,
  .delivery-right,
  .delivery-right-top,
  .delivery-form,
  .delivery-field-grid,
  .delivery-update-grid {
    grid-template-columns: 1fr !important;
  }

  .delivery-actions {
    padding-top: 0;
    justify-content: flex-start;
  }

  .delivery-data-body {
    padding: 10px;
    overflow-x: hidden;
  }

  .delivery-left,
  .delivery-left-top,
  .delivery-left-top > *,
  #poBeneficiarySection,
  #poBulkDeliverySection {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .delivery-left-top > * {
    grid-template-columns: 1fr !important;
  }

  .delivery-data-body input,
  .delivery-data-body select,
  .delivery-data-body textarea,
  .delivery-data-body .ts-wrapper,
  .delivery-data-body .ts-control {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .beneficiary-delivery-grid {
    overflow-x: auto;
  }
}

.delivery-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    max-width: none;
    flex-wrap: nowrap;
}

.delivery-actions .small-button {
    width: 92px;
    min-width: 92px;
    height: 40px;
    font-size: 12px;
    line-height: 1.1;
}


.uniform-tabs {
  display: flex;
  gap: 1px;
  margin-top: 2px;
}

.uniform-tab {
  border: 1px solid #9aa7b5;
  border-bottom: 0;
  background: #e8edf2;
  color: #17242d;
  padding: 5px 10px;
  font: inherit;
  cursor: pointer;
}

.uniform-tab.active {
  background: #ffffff;
  font-weight: 700;
}

.uniform-tab-panel[hidden] {
  display: none;
}

.uniform-panel {
  min-height: 160px;
  border-top: 1px solid #aeb7c4;
  background: #ffffff;
  padding: 8px;
  overflow-x: auto;
}

.uniform-set-grid {
  display: grid;
  grid-template-columns: minmax(124px, 1fr) repeat(5, 42px) minmax(150px, 1.2fr);
  gap: 4px;
  align-items: end;
  font-size: 13px;
  min-width: 560px;
}

.uniform-set-grid label {
  text-align: center;
  color: #000;
}

.uniform-set-grid select,
.uniform-set-grid input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.uniform-qty-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(124px, 1fr) repeat(5, 42px) minmax(150px, 1.2fr);
  gap: 4px;
  align-items: center;
}

.uniform-item-name {
  background: #f3f7f8;
  color: #17242d;
  }

.remaining-po-grid {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) repeat(5, 70px);
  gap: 4px;
  align-items: center;
  font-size: 13px;
  min-width: 520px;
}

.remaining-po-grid label {
  text-align: center;
  color: #000;
  font-weight: 700;
}

.remaining-po-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(130px, 1fr) repeat(5, 70px);
  gap: 4px;
  align-items: center;
}

.remaining-po-cell {
  min-height: 28px;
  border: 1px solid #8792a0;
  background: #f8fafc;
  padding: 4px 6px;
  box-sizing: border-box;
}

.remaining-po-number {
  text-align: right;
}

.remaining-po-empty {
  grid-column: 1 / -1;
  padding: 12px;
  text-align: center;
  color: #64748b;
}

.uniform-qty-row .po-qty-control {
  border: 1px solid rgba(31, 111, 139, 0.2);
  background: #ffffff;
  border-radius: 9px;
}

.uniform-qty-row .po-qty-control:disabled {
  background: #eef3f8;
  color: #435268;
}

.uniform-empty-message {
  grid-column: 1 / -1;
  min-height: 28px;
  display: grid;
  align-items: center;
  color: #5f6f82;
  font-size: 13px;
}

@media (max-width: 430px) {
.uniform-set-grid {
    display: block;
  }
}

.uniform-panel {
  border-color: rgba(31, 111, 139, 0.14);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(22, 34, 42, 0.05);
}

@media (max-width: 640px) {
.uniform-set-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
.uniform-tabs {
    overflow-x: auto;
    align-items: stretch;
  }
}

/* Bulk Receiving Form preparation modal (print/preparation only). */
#bulkReceivingFormModal .bulk-receiving-panel {
  width: min(980px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#bulkReceivingFormModal .bulk-receiving-note {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  color: #3d4d5c;
  background: #f1f6f9;
  border: 1px solid #d4e1ea;
  border-radius: 6px;
}
#bulkReceivingFormModal .bulk-receiving-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  gap: 6px 8px;
  align-items: end;
}
#bulkReceivingFormModal .bulk-receiving-filters label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  min-width: 0;
}
#bulkReceivingFormModal .bulk-receiving-filters select,
#bulkReceivingFormModal .bulk-receiving-filters input {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-weight: 400;
}
#bulkReceivingFormModal .bulk-receiving-filters select[multiple]:not(.tomselected) {
  min-height: 30px;
  max-height: 74px;
}
#bulkReceivingFormModal .bulk-receiving-filters .ts-wrapper {
  font-weight: 400;
}
#bulkReceivingFormModal .bulk-receiving-filters .ts-control {
  min-height: 30px;
  max-height: 74px;
  overflow-y: auto;
  padding: 3px 6px;
  font-size: 12px;
}
#bulkReceivingFormModal .bulk-receiving-filters .ts-wrapper.multi.has-items .ts-control {
  padding: 3px 6px 0;
}
#bulkReceivingFormModal .bulk-receiving-filters .ts-wrapper.multi .ts-control > .item {
  margin: 0 3px 3px 0;
  padding: 0 0 0 5px;
  font-size: 11.5px;
  background: #e8eef4;
  color: #1f3a5f;
  border-radius: 3px;
}
/* Dropdowns are attached to <body>; keep them above the modal (z-index 999). */
.bulk-receiving-ts-dropdown {
  z-index: 10000;
  font-size: 12.5px;
}
#bulkReceivingFormModal .bulk-receiving-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 12.5px;
}
#bulkReceivingFormModal .bulk-receiving-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
#bulkReceivingFormModal .bulk-receiving-summary {
  color: #4b5b6a;
  margin-left: auto;
}
#bulkReceivingFormModal .bulk-receiving-table-wrap {
  flex: 1 1 auto;
  min-height: 160px;
  max-height: 56vh;
  overflow: auto;
  border: 1px solid #c6ccd4;
  border-radius: 6px;
  background: #fff;
}
#bulkReceivingFormModal table {
  width: 100%;
  min-width: 0; /* a shared modal-table rule sets 980px; this table fits its panel */
  border-collapse: collapse;
  font-size: 12.5px;
}
#bulkReceivingFormModal th,
#bulkReceivingFormModal td {
  border-bottom: 1px solid #e1e5ea;
  padding: 4px 6px;
  text-align: left;
  vertical-align: middle;
}
#bulkReceivingFormModal thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef1f5;
  font-weight: 600;
}
#bulkReceivingFormModal .bulk-receiving-check-col {
  width: 34px;
  text-align: center;
}
#bulkReceivingFormModal .bulk-receiving-qty-col {
  text-align: right;
  white-space: nowrap;
}
#bulkReceivingFormModal .bulk-receiving-item-count {
  color: #6b7785;
  font-size: 11.5px;
}
#bulkReceivingFormModal .bulk-receiving-status-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  background: #e8eef4;
  color: #1f3a5f;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
#bulkReceivingFormModal tr.is-not-printable td {
  color: #8a949e;
  background: #fafafa;
}
#bulkReceivingFormModal tr.is-not-printable .bulk-receiving-status-badge {
  background: #eceff2;
  color: #6b7785;
}
#bulkReceivingFormModal .bulk-receiving-empty {
  padding: 18px;
  text-align: center;
  color: #6b7785;
}
#bulkReceivingFormModal .bulk-receiving-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
#bulkReceivingFormModal .bulk-receiving-status {
  margin-right: auto;
  font-size: 12.5px;
  color: #2f5f3a;
}
#bulkReceivingFormModal .bulk-receiving-status.is-error {
  color: #b00020;
}
#bulkReceivingFormModal #bulkReceivingPrintButton {
  min-height: 34px;
  font-weight: 700;
}
@media (max-width: 760px) {
  #bulkReceivingFormModal .bulk-receiving-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #bulkReceivingFormModal .bulk-receiving-filters select[multiple]:not(.tomselected) {
    max-height: 96px;
  }
  #bulkReceivingFormModal .bulk-receiving-summary {
    margin-left: 0;
    width: 100%;
  }
  #bulkReceivingFormModal .bulk-receiving-actions {
    flex-direction: column;
    align-items: stretch;
  }
  #bulkReceivingFormModal table {
    min-width: 700px;
  }
}
