.summary-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #f1eef8;
  border: 1px solid #d7d2ea;
  border-radius: 12px;
  padding: 15px;
  width: 100%;
}

.company-name {
  flex: 0 0 auto;
  margin-bottom: 0;
  font-weight: 600;
  white-space: nowrap;
  padding-right: 10px;
}

.metric-box {
  display: flex;
  align-items: center;
  width: 240px;
  min-height: 42px;
  border-radius: 8px;
  background: #ffffff;
  // margin-bottom: 10px;
  margin-bottom: 0;
  flex: 1;
  border: 2px solid;
}

.metric-box .count {
  min-width: 45px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  padding: 6px;
}

.metric-box .label {
  border-left: 2px solid;
  padding-left: 12px;
  font-size: 12px;
  font-weight: 600;
}

.ordered {
  border-color: var(--button-primary-border-default);
}

.ordered .count,
.ordered .label {
  color: var(--button-primary-bg-default);
  border-color: var(--button-primary-border-default);
}

.generated {
  border-color: #22c55e;
}

.generated .count,
.generated .label {
  color: #22c55e;
  border-color: #22c55e;
}

.remaining {
  border-color: #f59e0b;
}

.remaining .count,
.remaining .label {
  color: #f59e0b;
  border-color: #f59e0b;
}


//Matrix Preview

.serial-panel {
  background: #f1eef8;
  border: 1px solid #d7d2ea;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  color: #2d3748;
}

/* Header */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #e8e3f3;
  border-bottom: 1px solid #d7d2ea;
}

.title-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--button-primary-bg-default);
  color: var(--button-primary-text-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.title-section h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #2d3748;
}

.panel-btn {

  background: #fff;
  color: var(--button-primary-bg-default);
  border: 1px solid var(--button-primary-border-default);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

/* Table Header */
// .table-header,
// .table-row {
//     display: grid;
//     grid-template-columns: 50px 3fr 1fr 1fr 2fr 3fr;
//     align-items: center;
// }
.table-header,
.table-row {
  display: grid;
  grid-template-columns:
    50px
    /* # */
    3fr
    /* FG Item */
    1fr
    /* Total Qty */
    1fr
    /* Reserved Qty */
    1fr
    /* Available Qty */
    1fr
    /* Qty/Set */
    1fr
    /* This Run */
    1fr
    /* Last Run */
    1.5fr;
  /* Next Serial */
  align-items: center;
}

.table-header {
  background: #ebe7f4;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 12px 15px;
  border-bottom: 1px solid #d7d2ea;
}

/* Rows */
.table-row {
  padding: 12px 15px;
  background: #ffffff;
  border-bottom: 1px solid #ece8f5;
}

.table-row:hover {
  background: #f8f6fc;
}

.item-name {
  font-size: 13px;
  font-weight: 600;
  color: #2d3748;
}

.item-code {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 11px;
}

/* Qty */
.table-row>div:nth-child(3) {
  color: #2d3748;
  font-weight: 600;
}

/* This Run */
.run-count {
  color: #f59e0b;
  font-size: 18px;
  font-weight: 700;
}

/* Next Serial */
.serial-from {
  // color: #3b82f6;
  font-size: 12px;
  font-weight: 600;
}

/* Serial Range */
.serial-range {
  color: #22c55e;
  font-size: 12px;
  font-weight: 600;
}

/* Footer */
.table-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 15px;
  background: #e8e3f3;
  border-top: 1px solid #d7d2ea;
}

.table-footer div:first-child {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.total-count {
  color: #f59e0b;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.table-footer div:last-child {
  text-align: right;
  color: #22c55e;
  font-size: 13px;
  font-weight: 600;
}

.item-info {
  min-width: 0;
}

.item-name {
  white-space: normal;
  line-height: 1.4;
}

// generation card

.generation-card {
  background: #f1eef8;
  border: 1px solid #d7d2ea;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.generation-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  font-weight: 600;
  color: #2d3748;
  font-size: 16px;
}

.generation-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.gen-box {
  display: flex;
  flex-direction: column;
}

.gen-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 6px;
  letter-spacing: .5px;
}

.gen-value,
.generate-now-input {
  height: 42px;
  border: 1px solid #d7d2ea;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: #2d3748;
}

.generate-now-input {
  width: 100%;
  outline: none;
}

.remaining-val {
  color: #22c55e;
}

.generation-info {
  margin-top: 15px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #d7d2ea;
  border-radius: 8px;
  color: #3b82f6;
  font-size: 13px;
  font-weight: 600;
}

.generate-summary-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  margin-bottom: 18px;

  background: #f1eef8;
  border: 1px solid #d7d2ea;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.summary-left {
  display: flex;
  flex-direction: column;
}

.summary-title {
  //  background: var(--button-primary-bg-default);
  color: var(--button-primary-bg-default);
  font-size: 20px;
  font-weight: 700;
}

.summary-subtitle {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.summary-right {
  display: flex;
  gap: 30px;
}

.summary-stat {
  min-width: 70px;
  text-align: center;
}

.summary-stat .value {
  // color: #3b82f6;
  font-size: 28px;
  font-weight: 700;
}

.summary-stat .label {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
}


.view-toggle {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  gap: 4px;
  background: #f4f1ff; // Light lavender
  border: 1px solid #ddd6fe;
  border-radius: 8px;
}

.toggle-btn {
  min-width: 80px;
  height: 34px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #6b7280; // Grey text
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.toggle-btn:hover {
  background: #ede9fe;
  color: #6d28d9;
}

.toggle-btn.active {
  background: #8b5cf6; // Purple
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}


.view-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}


.view-buttons button {
  padding: 6px 12px;
  border: 1px solid #c7b8ff;
  border-radius: 8px;
  background: #ffffff;
  color: #6b7280;
  cursor: pointer;
  font-weight: 600;
  transition: all .2s ease;
}

.view-buttons button.active {
  background: #7c3aed; // Purple
  color: #ffffff;
  border-color: #7c3aed;
}

.view-buttons button:not(.active):hover {
  border-color: #7c3aed;
  color: #7c3aed;
}

.tick {
  // color: #22c55e;
  margin-right: 8px;
  font-size: 18px;
  font-weight: bold;
}

.serial-from,
.summary-stat .value,
.set-title,
.lot,
.tick {
  color: var(--button-primary-bg-default);
}

.set-container {
  background: #ffffff;
  border: 1px solid #d7d2ea;
  border-radius: 12px;
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.set-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: #ebe7f4;
  border-bottom: 1px solid #d7d2ea;
}

.set-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.set-title {
  font-size: 18px;
  font-weight: 700;
  // color: #3b82f6;
}

.set-code {
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid #d7d2ea;
  border-radius: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.set-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.serial-count {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.status-badge {
  padding: 4px 10px;
  background: #22c55e;
  color: #fff;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.fg-row {
  // display: flex;
  // align-items: flex-start;
  // padding: 16px 18px;
  // border-bottom: 1px solid #ece8f5;
  grid-template-columns: minmax(220px, 360px) 60px 1fr;
  display: grid;
  // grid-template-columns: 360px 60px 1fr;
  gap: 16px;
  align-items: start;
  padding: 10px;
}

.fg-row:last-child {
  border-bottom: none;
}

.fg-details {
  width: auto;
  margin-left: 12px;
}

.fg-name {
  color: #2d3748;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.fg-code {
  color: #94a3b8;
  font-size: 11px;
  margin-top: 3px;
}

.fg-qty {
  // width: 50px;
  width: auto;
  color: #2d3748;
  font-size: 13px;
  font-weight: 600;
}

.serial-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.serial-chip {
  display: flex;
  align-items: center;
  border: 1px solid #d7d2ea;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  margin: 6px 10px;
}

.slot {
  width: 32px;
  height: 30px;
  background: #ebe7f4;
  border-right: 1px solid #d7d2ea;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
}

.lot {
  padding: 12px;
  margin-left: 8px;
  height: 30px;
  display: flex;
  align-items: center;
  color: #3b82f6;
  font-size: 12px;
  font-weight: 700;
  background: #ffffff;
}

// btns
.generate-btn-container {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}


.btn-generate-numbers {
  height: 32px;
  padding: 0 16px;
  background: var(--button-primary-bg-default);
  color: var(--button-primary-text-default);
  border: 1px solid var(--button-primary-border-default);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;

  &:hover {
    background: var(--button-primary-bg-default);
    border-color: #4C1D95;
  }

  &:active {
    background: var(--button-primary-bg-default);
    border-color: #3B0F7A;
  }
}

.btn-generate-save {
  height: 32px;
  padding: 0 16px;
  background: var(--button-primary-bg-default);
  color: var(--button-primary-text-default);
  border: 1px solid var(--button-primary-border-default);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;

  &:hover {
    background: var(--button-primary-bg-default);
    border-color: #4C1D95;
  }

  &:active {
    background: var(--button-primary-bg-default);
    border-color: #3B0F7A;
  }
}

gb-input {
  position: relative;
  top: -21px;
}

// save lightbox
.save-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 25, 55, 0.22);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.save-modal {
  position: relative;
  width: 540px;
  background: #f7f5fc;
  border: 1px solid #d7cdef;
  border-radius: 12px;
  padding: 22px 24px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(143, 105, 224, 0.08),
    0 10px 24px rgba(39, 27, 70, 0.1);
  border: 1.5pxpx solid #c5b6e9;
}


.save-modal h2 {
  margin: 0 0 20px;
  padding-bottom: 14px;
  font-size: 24px;
  font-weight: 700;
  color: var(--button-primary-bg-default);
  border-bottom: 1px solid #ddd5ef;
}

.save-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid #e5def2;
  font-size: 13px;
}

.save-row span {
  color: #6b7280;
  font-weight: 500;
}

.save-row strong {
  color: #2f2a42;
  font-weight: 700;
}

.warning-box {
  margin-top: 18px;
  padding: 14px 16px;
  background: #fff8e8;
  border: 1px solid #f2d277;
  border-radius: 8px;
  color: #8b6508;
  font-size: 13px;
  line-height: 1.6;
}

.popup-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.cancel-btn {
  min-width: 80px;
  height: 22px;
  border: 1px solid #cfc4ea;
  background: #ffffff;
  color: #555;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  font-size: 11px;
}

.cancel-btn:hover {
  background: #f2eefb;
  border-color: var(--button-primary-bg-default);
}

.save-btn {
  min-width: 110px;
  height: 22px;
  border: none;
  border-radius: 7px;
  background: var(--button-primary-bg-default);
  color: var(--button-primary-text-default);
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
  font-size: 11px;
}

.save-btn:hover {
  filter: brightness(0.95);
}

.fieldItemCode {
  color: var(--button-primary-bg-default);
  margin-left: 25px;
  margin-top: 25px;
  font-size: 17px;
  font-weight: 700;
}

@media (max-width: 1024px) {

  .FormOverView {
    padding: 10px;
  }

  .adjacentField {
    display: block;
    width: 100% !important;
    max-width: 420px !important;
    margin-bottom: 10px;
    box-sizing: border-box;
  }

  ::ng-deep gb-newpicklist.adjacentField {
    display: block;
    width: 100% !important;
    max-width: 420px !important;
    box-sizing: border-box;
  }

  ::ng-deep gb-newpicklist.adjacentField>* {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  ::ng-deep gb-newpicklist.adjacentField input,
  ::ng-deep gb-newpicklist.adjacentField select,
  ::ng-deep gb-newpicklist.adjacentField .mat-mdc-form-field,
  ::ng-deep gb-newpicklist.adjacentField .mat-mdc-text-field-wrapper,
  ::ng-deep gb-newpicklist.adjacentField .mat-mdc-form-field-flex,
  ::ng-deep gb-newpicklist.adjacentField .mat-mdc-form-field-infix,
  ::ng-deep gb-newpicklist.adjacentField .mat-mdc-select,
  ::ng-deep gb-newpicklist.adjacentField .p-dropdown,
  ::ng-deep gb-newpicklist.adjacentField .ng-select,
  ::ng-deep gb-newpicklist.adjacentField .form-control {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"],
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] {
    width: 100% !important;
    max-width: 420px !important;
  }

  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"]>*,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"]>*,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] input,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] input,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] select,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] select,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .mat-mdc-form-field,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .mat-mdc-form-field,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .mat-mdc-text-field-wrapper,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .mat-mdc-text-field-wrapper,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .mat-mdc-form-field-flex,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .mat-mdc-form-field-flex,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .mat-mdc-form-field-infix,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .mat-mdc-form-field-infix,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .mat-mdc-select,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .mat-mdc-select,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .p-dropdown,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .p-dropdown,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .ng-select,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .ng-select,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .form-control,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .form-control {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .fieldItemCode {
    display: inline-block;
    margin-left: 0;
    margin-top: 10px;
  }

  .summary-card {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .metric-box {
    width: calc(50% - 5px);
    min-width: 160px;
  }

  .table-header,
  .table-row {
    grid-template-columns: 32px 2fr 1fr 1fr 1.4fr 1.6fr;
    font-size: 12px;
  }

  .table-header {
    padding: 10px 8px;
  }

  .table-row {
    padding: 10px 8px;
  }

  .table-footer {
    grid-template-columns: 1fr auto;
    row-gap: 6px;
  }

  .table-footer div:last-child {
    grid-column: 1 / -1;
    text-align: left;
  }

  .generation-row {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 15px;
  }

  ::ng-deep gb-input {
    top: -18px;
  }

  .generate-summary-card {
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 18px;
  }

  .summary-right {
    gap: 18px;
    flex-wrap: wrap;
  }

  .fg-row {
    grid-template-columns: minmax(0, 1fr) 50px;
    row-gap: 8px;
  }

  .serial-wrapper {
    grid-column: 1 / -1;
  }

  .save-modal {
    width: 90%;
    max-width: 480px;
  }
}



@media (max-width: 600px) {

  .FormOverView {
    padding: 8px;
  }

  .adjacentField {
    display: block;
    width: 100% !important;
    max-width: 340px !important;
    margin-bottom: 10px;
    box-sizing: border-box;
  }

  ::ng-deep gb-newpicklist.adjacentField {
    display: block;
    width: 100% !important;
    max-width: 340px !important;
    box-sizing: border-box;
  }

  ::ng-deep gb-newpicklist.adjacentField>* {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  ::ng-deep gb-newpicklist.adjacentField input,
  ::ng-deep gb-newpicklist.adjacentField select,
  ::ng-deep gb-newpicklist.adjacentField .mat-mdc-form-field,
  ::ng-deep gb-newpicklist.adjacentField .mat-mdc-text-field-wrapper,
  ::ng-deep gb-newpicklist.adjacentField .mat-mdc-form-field-flex,
  ::ng-deep gb-newpicklist.adjacentField .mat-mdc-form-field-infix,
  ::ng-deep gb-newpicklist.adjacentField .mat-mdc-select,
  ::ng-deep gb-newpicklist.adjacentField .p-dropdown,
  ::ng-deep gb-newpicklist.adjacentField .ng-select,
  ::ng-deep gb-newpicklist.adjacentField .form-control {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"],
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] {
    width: 100% !important;
    max-width: 340px !important;
  }

  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"]>*,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"]>*,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] input,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] input,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] select,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] select,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .mat-mdc-form-field,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .mat-mdc-form-field,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .mat-mdc-text-field-wrapper,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .mat-mdc-text-field-wrapper,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .mat-mdc-form-field-flex,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .mat-mdc-form-field-flex,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .mat-mdc-form-field-infix,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .mat-mdc-form-field-infix,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .mat-mdc-select,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .mat-mdc-select,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .p-dropdown,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .p-dropdown,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .ng-select,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .ng-select,
  ::ng-deep gb-newpicklist[formcontrolname="FgItemName"] .form-control,
  ::ng-deep gb-newpicklist[formControlName="FgItemName"] .form-control {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .metric-box {
    width: 100%;
  }

  .company-name {
    font-size: 15px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }

  .panel-btn {
    align-self: stretch;
    text-align: center;
  }

  .table-header {
    display: none;
  }

  .table-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #ece8f5;
  }

  .table-row>div:nth-child(1) {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
  }

  .table-row>div:nth-child(1)::before {
    content: "Row ";
  }

  .table-row>div:nth-child(3)::before {
    content: "Qty/Set: ";
    color: #64748b;
    font-weight: 600;
    font-size: 11px;
  }

  .table-row>div:nth-child(4)::before {
    content: "This Run: ";
    color: #64748b;
    font-weight: 600;
    font-size: 11px;
  }

  .table-row>div:nth-child(5)::before {
    content: "Next Serial From: ";
    color: #64748b;
    font-weight: 600;
    font-size: 11px;
  }

  .table-row>div:nth-child(6)::before {
    content: "Serials This Run: ";
    color: #64748b;
    font-weight: 600;
    font-size: 11px;
  }

  .table-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px;
  }

  .table-footer div:last-child {
    text-align: left;
  }

  .total-count {
    font-size: 20px;
  }

  .generation-card {
    padding: 12px;
  }

  .generation-row {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }

  ::ng-deep gb-input {
    top: 0;
    display: block;
    width: 100%;
  }

  .generate-btn-container,
  .btn-generate-numbers {
    width: 100%;
  }

  .btn-generate-numbers {
    text-align: center;
  }

  .generate-summary-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
  }

  .summary-right {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .summary-stat {
    min-width: auto;
  }

  .summary-stat .value {
    font-size: 22px;
  }

  .set-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .set-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .set-title {
    font-size: 12px;
  }

  .fg-row {
    grid-template-columns: 1fr;
    padding: 10px;
    row-gap: 8px;
  }

  .fg-details {
    margin-left: 0;
  }

  .serial-wrapper {
    grid-column: 1;
  }

  .slot {
    width: 28px;
    height: 26px;
  }

  .lot {
    height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }

  div[style*="display: flex"][style*="gap: 15px"] {
    flex-direction: column;
    align-items: stretch !important;
  }

  .save-modal {
    width: 92%;
    padding: 18px 16px;
    max-height: 85vh;
    overflow-y: auto;
  }

  .save-modal h2 {
    font-size: 19px;
  }

  .save-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 0;
  }

  .popup-buttons {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .cancel-btn,
  .save-btn {
    width: 100%;
    height: 36px;
    font-size: 13px;
  }
}

/* Right align numeric columns */
.table-header>div:nth-child(3),
.table-header>div:nth-child(4),
.table-header>div:nth-child(5),
.table-header>div:nth-child(6),
.table-header>div:nth-child(7),
.table-header>div:nth-child(8),
.table-header>div:nth-child(9),

.table-row>div:nth-child(3),
.table-row>div:nth-child(4),
.table-row>div:nth-child(5),
.table-row>div:nth-child(6),
.table-row>div:nth-child(7),
.table-row>div:nth-child(8),
.table-row>div:nth-child(9) {
  text-align: right;
  justify-self: end;
  width: 100%;
}

.picklist-lightbox {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;

  display: flex !important;
  justify-content: center !important;
  align-items: center !important;

  background: rgba(0, 0, 0, 0.3);

  z-index: 999999 !important;
}

.picklist-box {
  position: relative !important;

  width: 600px;
  min-height: 200px;
  max-height: 80vh;
  overflow-y: auto;

  background: white;
  padding: 35px;
  border-radius: 12px;

  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.25);
}

.close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}

.pending-allocation-grid {
  width: 100%;
  border-collapse: collapse;
}

.pending-allocation-grid th,
.pending-allocation-grid td {
  padding: 8px 12px;
  border: 1px solid #ddd;
  text-align: left;
}

.pending-allocation-grid tbody tr {
  cursor: pointer;
}

.pending-allocation-grid tbody tr:hover {
  background: #f3f4f6;
}

.pending-allocation-grid .selected-row {
  background: #e0e7ff;
}


.select-serial-btn {
    background: #6366f1;
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s ease;
}

.select-serial-btn:hover {
    background: #4f46e5;
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.25);
}

.select-btn {
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 14px;
    font-size: 12px;
    cursor: pointer;
}

.select-btn:hover {
    background: #4f46e5;
}
.checkbox-column {
    width: 40px;
    text-align: center;
}