html,
body {
  height: 100%;
  overflow: hidden;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.full {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  overflow-x: hidden;
  overflow-y: auto;
}

// ── Top Nav ───────────────────────────────────────

.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  background: #ffffff;
  border-bottom: 1px solid #e8e4f8;
  flex-shrink: 0;
}

.logo {
  width: 26px;
  height: 26px;
  background: #834dd0;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.app-name {
  font-size: 11px;
  color: #9c88c8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-r {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.sdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #834dd0;
  display: inline-block;
  margin-right: 5px;
}

.nmeta {
  font-size: 10px;
  color: #b0a8cc;
  letter-spacing: 0.04em;

  &.version {
    color: #d0cce8;
  }
}

// ── Body wrap ─────────────────────────────────────

.wrap {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

// ── Sidebar ───────────────────────────────────────

.sidebar {
  width: 268px;
  min-width: 268px;
  background: #faf9ff;
  border-right: 1px solid #e8e4f8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 9px;
  border-bottom: 1px solid #e8e4f8;
  flex-shrink: 0;
}

.sb-lbl {
  font-size: 9px;
  color: #b0a8cc;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.add-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  background: #834dd0;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, transform 0.1s;

  i {
    font-size: 12px;
  }

  &:hover {
    background: #6d28d9;
  }

  &:active {
    transform: scale(0.97);
  }
}

// ── Scroll area ───────────────────────────────────

.scroll {
  flex: 1;
  padding: 6px 0;

  &::-webkit-scrollbar {
    width: 3px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background: #e0d8f8;
    border-radius: 3px;
  }
}

// ── Project card ──────────────────────────────────

.proj-card {
  margin: 3px 7px;
  border-radius: 7px;
  padding: 9px 9px 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;

  &.active {
    background: #ede9fd;
    border-color: #c4b5fd;
  }

  &:not(.active):hover {
    background: #f5f3ff;
  }
}

.proj-id {
  font-size: 9px;
  color: #834dd0;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.proj-name {
  font-size: 11px;
  color: #2d1f5e;
  line-height: 1.35;
  margin-bottom: 6px;
}

// ── Tags ──────────────────────────────────────────

.tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tag {
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;

  &.t-so {
    background: #f0eeff;
    color: #7c5ccc;
    border: 1px solid #d8d0f8;
  }

  &.t-sets {
    background: #ede9fd;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
  }

  &.t-active {
    background: #ede9fd;
    color: #5b21b6;
    border: 1px solid #a78bfa;
  }

  &.t-mix {
    background: #fdf4ff;
    color: #a21caf;
    border: 1px solid #e879f9;
  }

  &.t-plan {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fbbf24;
  }
}

// ── Matrix sub-list ───────────────────────────────

.mx-sec {
  margin: 7px 7px 2px;
  padding-top: 8px;
  border-top: 1px solid #e8e4f8;
}

.mx-sec-lbl {
  font-size: 8px;
  color: #b0a8cc;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 6px;
  margin-bottom: 5px;
}

.mx-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 1px;
  transition: background 0.12s, border-color 0.12s;

  &.active {
    background: #ede9fd;
    border-color: #c4b5fd;
  }

  &:not(.active):hover {
    background: #f5f3ff;
  }
}

.mx-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;

  &.d-green {
    background: #834dd0;
  }

  &.d-yellow {
    background: #a855f7;
  }

  &.d-purple {
    background: #d946ef;
  }
}

.mx-code {
  font-size: 10px;
  color: #3d2f7a;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mx-bdg {
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;

  &.b-prod {
    background: #ede9fd;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
  }

  &.b-fg {
    background: #fdf4ff;
    color: #9333ea;
    border: 1px solid #d8b4fe;
  }

  &.b-mix {
    background: #fdf4ff;
    color: #a21caf;
    border: 1px solid #e879f9;
  }
}

.mx-range {
  font-size: 9px;
  color: #b0a8cc;
  flex-shrink: 0;
}

// ── Main panel ────────────────────────────────────

.main {
  flex: 1;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

// ── Tab Bar ───────────────────────────────────────

.tab-bar {
  display: flex;
  align-items: center;
  height: 38px;
  border-bottom: 1px solid #e8e4f8;
  padding: 0 16px;
  gap: 2px;
  flex-shrink: 0;
  background: #ffffff;
}

.tab {
  font-size: 11px;
  color: #b0a8cc;
  padding: 0 14px;
  height: 38px;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  letter-spacing: 0.03em;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;

  &.active {
    color: #834dd0;
    border-bottom-color: #834dd0;
  }

  &:not(.active):hover {
    color: #9c88c8;
  }
}

.tab-r {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tbadge {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;

  &.b-serials {
    background: #ede9fd;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
  }

  &.b-mtx {
    background: #fdf4ff;
    color: #9333ea;
    border: 1px solid #d8b4fe;
  }
}

// ── Panel Scroll ──────────────────────────────────

.panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px 20px 32px;

  &::-webkit-scrollbar {
    width: 3px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background: #d8d0f8;
    border-radius: 3px;
  }
}

// ── Panel Header ──────────────────────────────────

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-title {
  font-size: 10px;
  color: #b0a8cc;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hdr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-supersede {
  font-size: 10px;
  color: #9c88c8;
  background: transparent;
  border: 1px solid #d8d0f8;
  border-radius: 5px;
  padding: 5px 14px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: color 0.15s, border-color 0.15s;

  &:hover {
    color: #6d28d9;
    border-color: #a78bfa;
  }
}

.btn-activate {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: #834dd0;
  border: none;
  border-radius: 5px;
  padding: 5px 14px;
  cursor: pointer;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s, transform 0.1s;

  i {
    font-size: 13px;
  }

  &:hover {
    background: #6d28d9;
  }

  &:active {
    transform: scale(0.97);
  }
}

// ── Matrix Card ───────────────────────────────────

.mtx-card {
  background: #faf9ff;
  border: 1px solid #e8e4f8;
  border-radius: 8px;
  padding: 14px 16px 12px;
  margin-bottom: 16px;
}

.mtx-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mtx-code-title {
  font-size: 20px;
  color: #834dd0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-active {
  font-size: 9px;
  padding: 3px 10px;
  border-radius: 4px;
  background: #ede9fd;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;

  &::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #834dd0;
    display: inline-block;
  }
}

.mtx-sub {
  font-size: 10px;
  color: #b0a8cc;
  letter-spacing: 0.04em;
  margin-bottom: 14px;

  span {
    margin: 0 4px;
    color: #d0cce8;
  }
}

.mtx-meta-row {
  display: flex;
  border: 1px solid #e8e4f8;
  border-radius: 6px;
  overflow: hidden;
}

.mtx-meta-cell {
  flex: 1;
  padding: 8px 12px;
  border-right: 1px solid #e8e4f8;

  &:last-child {
    border-right: none;
  }

  .cell-lbl {
    font-size: 8px;
    color: #b0a8cc;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .cell-val {
    font-size: 13px;
    color: #2d1f5e;
    font-weight: 500;

    &.v-orange {
      color: #834dd0;
      font-weight: 700;
      font-size: 11px;
    }

    &.v-green {
      color: #6d28d9;
      font-weight: 700;
    }

    &.v-grey {
      color: #9c88c8;
    }
  }
}

// ── Section Label ─────────────────────────────────

.sec-lbl {
  font-size: 8px;
  color: #b0a8cc;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
  margin-top: 18px;
}

// ── Mode Selector ─────────────────────────────────

.mode-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #e8e4f8;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.mode-card {
  padding: 14px 16px;
  cursor: pointer;
  border-right: 1px solid #e8e4f8;
  position: relative;
  transition: background 0.15s;

  &:last-child {
    border-right: none;
  }

  &.active {
    background: #f5f3ff;

    &::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 2px;
      background: #834dd0;
    }
  }

  &:not(.active):hover {
    background: #faf9ff;
  }
}

.mode-radio {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #d0cce8;
  margin-bottom: 8px;
  position: relative;

  &.selected {
    border-color: #834dd0;

    &::after {
      content: '';
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background: #834dd0;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }
  }

  &.sel-purple {
    border-color: #a855f7;

    &::after {
      content: '';
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background: #a855f7;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }
  }
}

.mode-name {
  font-size: 11px;
  font-weight: 600;
  color: #2d1f5e;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;

  &.m-purple {
    color: #a855f7;
  }
}

.mode-desc {
  font-size: 9px;
  color: #b0a8cc;
  letter-spacing: 0.04em;
}

// ── Info Banner ───────────────────────────────────

.info-banner {
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
  border-left: 3px solid #834dd0;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 10px;
  color: #6d4caa;
  line-height: 1.55;
  margin-bottom: 18px;
  letter-spacing: 0.02em;

  strong {
    color: #834dd0;
    font-weight: 600;
  }
}

// ── Form Grid ─────────────────────────────────────

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-lbl {
  font-size: 8px;
  color: #9c88c8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field-input {
  background: #faf9ff;
  border: 1px solid #e0d8f8;
  border-radius: 5px;
  padding: 7px 10px;
  font-size: 11px;
  color: #2d1f5e;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;

  &:focus {
    border-color: #834dd0;
  }

  &::placeholder {
    color: #d0cce8;
  }
}

.field-select {
  background: #faf9ff;
  border: 1px solid #e0d8f8;
  border-radius: 5px;
  padding: 7px 30px 7px 10px;
  font-size: 11px;
  color: #2d1f5e;
  outline: none;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239c88c8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color 0.15s;

  &:focus {
    border-color: #834dd0;
  }
}

.field-input-with-btn {
  display: flex;

  .field-input {
    border-radius: 5px 0 0 5px;
    border-right: none;
    flex: 1;
  }

  .step-btn {
    background: #f0eeff;
    border: 1px solid #e0d8f8;
    color: #9c88c8;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;

    &:last-child {
      border-radius: 0 5px 5px 0;
    }

    &:hover {
      color: #834dd0;
      background: #ede9fd;
    }
  }
}

// ── Validation Banner ─────────────────────────────

.valid-banner {
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 10px;
  color: #6d28d9;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  letter-spacing: 0.03em;

  i {
    font-size: 13px;
  }
}

// ── Modal Overlay ─────────────────────────────────

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 31, 94, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

// ── Modal Box ─────────────────────────────────────

.modal {
  background: #ffffff;
  border: 1px solid #e0d8f8;
  border-radius: 10px;
  width: 520px;
  max-width: 96vw;
  padding: 24px 24px 20px;
  animation: slideUp 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

// ── Modal Title ───────────────────────────────────

.modal-title {
  font-size: 13px;
  font-weight: 700;
  color: #834dd0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

// ── Form Rows ─────────────────────────────────────

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
  align-items: end;

  &.single {
    grid-template-columns: 1fr;
  }
}

.form-row .field {
  flex: 1;
  margin: 0 !important;
  padding: 0 !important;
}

// ── Modal Footer ──────────────────────────────────

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.btn-cancel {
  font-size: 11px;
  color: #9c88c8;
  background: transparent;
  border: 1px solid #d8d0f8;
  border-radius: 5px;
  padding: 7px 18px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.03em;
  transition: color 0.15s, border-color 0.15s;

  &:hover {
    color: #6d28d9;
    border-color: #a78bfa;
  }
}

.btn-create {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #834dd0;
  border: none;
  border-radius: 5px;
  padding: 7px 18px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.04em;
  transition: background 0.15s, transform 0.1s;

  &:hover {
    background: #6d28d9;
  }

  &:active {
    transform: scale(0.97);
  }
}

// ── Valid Banner (modal) ──────────────────────────

.valid-banner {
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 10px;
  color: #6d28d9;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 20px;
  letter-spacing: 0.03em;
}

.valid-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #834dd0;
  flex-shrink: 0;
}

.load-btn {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(26, 26, 26, 0.75);
  background: #fff;
  border: 1px solid #d0d5dd;
  margin-left: 40px;
  margin-top: 30px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  outline: none;

  &:hover {
    border-color: var(--action-primary-default);
    color: var(--action-primary-default);
    background: rgba(232, 240, 254, 0.5);
  }

  &:active {
    background: rgba(232, 240, 254, 1);
  }
}

// ── Component overrides ───────────────────────────

// .modal {
//   ::ng-deep gb-combobox {
//     .formlabel {
//       font-size: 8px;
//       color: #6d28d9;
//       letter-spacing: 0.1em;
//       text-transform: uppercase;
//     }
//     .Mat_Form_Field {
//       // width: 100% !important;
//       .mat-mdc-text-field-wrapper {
//         background: #faf9ff !important;
//         border: 1px solid #e0d8f8 !important;
//         border-radius: 5px !important;
//         padding: 4px 10px !important;
//         height: 34px !important;
//       }
//       .mdc-line-ripple,
//       .mat-mdc-form-field-subscript-wrapper,
//       .mdc-notched-outline { display: none !important; }
//       .mat-mdc-select-value-text,
//       .form_combobox {
//         font-size: 11px !important;
//         color: #2d1f5e !important;
//         font-family: inherit !important;
//       }
//       .mat-mdc-select-value { color: #2d1f5e !important; }
//       .mat-mdc-select-trigger { color: #2d1f5e !important; }
//       * { color: #2d1f5e !important; }
//       .mat-mdc-select-arrow svg { fill: #9c88c8 !important; }
//       &:focus-within .mat-mdc-text-field-wrapper { border-color: #834dd0 !important; }
//     }
//   }
// // }

// ::ng-deep {
//   .cdk-overlay-container {
//     .mat-mdc-select-panel,
//     .mat-select-panel {
//       background: #ffffff !important;
//       border: 1px solid #e0d8f8 !important;
//       border-radius: 6px !important;
//       box-shadow: 0 8px 24px rgba(124,58,237,0.12) !important;
//     }
//     .mdc-menu-surface {
//       background: #ffffff !important;
//       border: 1px solid #e0d8f8 !important;
//       border-radius: 6px !important;
//     }
//     .mat-mdc-option,
//     .mat-option {
//       background: #ffffff !important;
//       color: #2d1f5e !important;
//       font-size: 11px !important;
//       min-height: 36px !important;
//       .mdc-list-item__primary-text, span, * { color: #2d1f5e !important; }
//       &:hover, &:focus, &.mat-mdc-option-active {
//         background: #f5f3ff !important;
//         .mdc-list-item__primary-text, span, * { color: #834dd0 !important; }
//       }
//       &.mdc-list-item--selected {
//         background: #ede9fd !important;
//         .mdc-list-item__primary-text, span, * { color: #834dd0 !important; }
//       }
//     }
//   }
// }

// // .modal {
//   ::ng-deep gb-newpicklist {
//     .input_label {
//       font-size: 8px;
//       color: #6d28d9;
//       letter-spacing: 0.1em;
//       text-transform: uppercase;
//     }
//     .h-\[56px\] { height: 34px !important; }
//     .Mat_Form_Field,
//     .mat-mdc-form-field {
//       // width: 100% !important;
//       height: 34px !important;
//       .mat-mdc-form-field-subscript-wrapper { display: none !important; }
//       .mat-mdc-text-field-wrapper,
//       .mdc-text-field {
//         background: #faf9ff !important;
//         border: 1px solid #e0d8f8 !important;
//         border-radius: 5px !important;
//         padding: 0 10px !important;
//         height: 34px !important;
//         display: flex !important;
//         align-items: center !important;
//         min-height: unset !important;
//       }
//       .mdc-line-ripple,
//       .mdc-notched-outline,
//       .mdc-notched-outline__leading,
//       .mdc-notched-outline__notch,
//       .mdc-notched-outline__trailing { display: none !important; }
//       .form_input, input.form_input, input[matinput] {
//         font-size: 11px !important;
//         color: #2d1f5e !important;
//         font-family: inherit !important;
//         caret-color: #834dd0 !important;
//         padding: 0 !important;
//         height: 34px !important;
//         line-height: 34px !important;
//         border: none !important;
//         background: transparent !important;
//       }
//       input::placeholder { color: #d0cce8 !important; }
//       .mat-icon { color: #9c88c8 !important; font-size: 18px !important; height: 18px !important; width: 18px !important; line-height: 18px !important; }
//       span[style*="inline-flex"] { height: 34px !important; align-items: center !important; display: flex !important; }
//       &:focus-within .mat-mdc-text-field-wrapper,
//       &:focus-within .mdc-text-field { border-color: #834dd0 !important; }
//     }
//   }
// // }

// ::ng-deep {
//   .cdk-overlay-container {
//     .mat-mdc-autocomplete-panel,
//     .mat-mdc-select-panel,
//     .mat-select-panel {
//       background: #ffffff !important;
//       border: 1px solid #e0d8f8 !important;
//       border-radius: 6px !important;
//       box-shadow: 0 8px 24px rgba(124,58,237,0.12) !important;
//     }
//     .mdc-menu-surface {
//       background: #ffffff !important;
//       border: 1px solid #e0d8f8 !important;
//       border-radius: 6px !important;
//     }
//     .mat-mdc-option,
//     .mat-option {
//       background: #ffffff !important;
//       color: #2d1f5e !important;
//       font-size: 11px !important;
//       min-height: 34px !important;
//       .mdc-list-item__primary-text, span, * { color: #2d1f5e !important; }
//       &:hover, &:focus, &.mat-mdc-option-active {
//         background: #f5f3ff !important;
//         .mdc-list-item__primary-text, span, * { color: #834dd0 !important; }
//       }
//       &.mdc-list-item--selected {
//         background: #ede9fd !important;
//         .mdc-list-item__primary-text, span, * { color: #834dd0 !important; }
//       }
//     }
//   }
// }



// ::ng-deep gb-combobox,
// ::ng-deep gb-newpicklist {
//   display: block;
//   margin-top: 0 !important;
//   padding-top: 0 !important;
// }
// ::ng-deep gb-newpicklist .input_label,
// ::ng-deep gb-combobox .formlabel {
//   margin-top: 0 !important;
//   padding-top: 0 !important;
// }

// gb-textarea {
//   border-radius: 6px !important;
//   ::ng-deep .mat-mdc-form-field { border-radius: 6px !important; }
//   ::ng-deep .mat-mdc-form-field-flex { border-radius: 6px !important; }
//   ::ng-deep textarea { border-radius: 6px !important; }
//   ::ng-deep .mdc-text-field--outlined { border-radius: 6px !important; }
//   ::ng-deep .mdc-text-field--filled { border-radius: 6px !important; }
//   ::ng-deep .mdc-notched-outline { border-radius: 6px !important; }
//   ::ng-deep .mdc-notched-outline__leading,
//   ::ng-deep .mdc-notched-outline__trailing { border-radius: 6px !important; }
//   ::ng-deep .mat-mdc-form-field.mat-focused .mdc-notched-outline__leading,
//   ::ng-deep .mat-mdc-form-field.mat-focused .mdc-notched-outline__notch,
//   ::ng-deep .mat-mdc-form-field.mat-focused .mdc-notched-outline__trailing {
//     border-color: #834dd0 !important;
//     border-width: 6px !important;
//   }
// }

// ── RM INPUTS TAB ────────────────────────────────

.rm-inputs-banner {
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
  border-left: 3px solid #834dd0;
  border-radius: 0;
  padding: 9px 14px;
  font-size: 10px;
  color: #6d28d9;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  letter-spacing: 0.03em;

  i {
    font-size: 13px;
    flex-shrink: 0;
  }
}

.btn-load-bom {
  font-size: 10px;
  color: #9c88c8;
  background: transparent;
  border: 1px solid #d8d0f8;
  border-radius: 5px;
  padding: 5px 14px;
  cursor: pointer;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s, border-color 0.15s;

  i {
    font-size: 12px;
  }

  &:hover {
    color: #6d28d9;
    border-color: #a78bfa;
  }
}

.btn-add-row {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: #834dd0;
  border: none;
  border-radius: 5px;
  padding: 5px 14px;
  cursor: pointer;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s;

  i {
    font-size: 12px;
  }

  &:hover {
    background: #6d28d9;
  }
}

.rm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;

  thead tr {
    border-bottom: 1px solid #e8e4f8;
  }

  th {
    font-size: 8px;
    color: #b0a8cc;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0 12px 8px;
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
  }

  tbody tr {
    border-bottom: 1px solid #f0eeff;
    transition: background 0.12s;

    &:hover {
      background: #faf9ff;
    }

    &:last-child {
      border-bottom: none;
    }
  }

  td {
    padding: 10px 12px;
    vertical-align: middle;
    color: #3d2f7a;
  }
}

.rm-item-name {
  font-size: 11px;
  color: #2d1f5e;
  display: block;
  line-height: 1.3;
}

.rm-item-code {
  font-size: 9px;
  color: #b0a8cc;
  letter-spacing: 0.06em;
  display: block;
  margin-top: 1px;
}

.cat-badge {
  font-size: 8px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;

  &.cat-rm {
    background: #ede9fd;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
  }

  &.cat-bo {
    background: #fdf4ff;
    color: #9333ea;
    border: 1px solid #d8b4fe;
  }
}

.batch-link {
  font-size: 10px;
  color: #834dd0;
  text-decoration: none;
  letter-spacing: 0.04em;
  cursor: pointer;

  &:hover {
    color: #6d28d9;
    text-decoration: underline;
  }
}

.batch-assign-btn {
  font-size: 9px;
  font-weight: 600;
  color: #834dd0;
  background: transparent;
  border: 1px dashed #c4b5fd;
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s, border-color 0.15s;

  &:hover {
    background: #f5f3ff;
    border-color: #834dd0;
  }
}

.qty-num {
  font-size: 11px;
  color: #2d1f5e;
  display: block;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.qty-alloc {
  color: #834dd0;
}

.alloc-bar-track {
  height: 4px;
  background: #ede9fd;
  border-radius: 2px;
  overflow: hidden;
}

.alloc-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: #834dd0;

  &.fill-danger {
    background: #ef4444;
  }
}

.remaining-num {
  font-size: 10px;
  color: #6d28d9;
  text-align: right;
  font-variant-numeric: tabular-nums;

  &.r-zero {
    color: #ef4444;
  }
}

.status-badge {
  font-size: 8px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;

  &.s-set {
    background: #ede9fd;
    color: #6d28d9;
    border: 1px solid #c4b5fd;

    &::before {
      content: '✓';
      font-size: 8px;
    }
  }

  &.s-pending {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fbbf24;
  }
}

.rm-del-btn {
  background: transparent;
  border: none;
  color: #d0cce8;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 14px;
  transition: color 0.15s, background 0.15s;

  &:hover {
    color: #ef4444;
    background: #fef2f2;
  }
}

.expand-arrow {
  color: #c4b5fd;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, transform 0.2s;
  display: inline-flex;

  &:hover {
    color: #834dd0;
  }

  &.open {
    transform: rotate(90deg);
  }
}

.rm-sub-row td {
  padding: 0;
  background: #faf9ff;
}

.rm-sub-inner {
  padding: 10px 24px 12px 44px;
  border-bottom: 1px solid #f0eeff;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;

  .sub-lbl {
    font-size: 8px;
    color: #b0a8cc;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 3px;
  }

  .sub-val {
    font-size: 11px;
    color: #6d4caa;
  }
}

// ── SETS & SERIALS TAB ────────────────────────────

.ss-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ss-summary-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ss-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;

  &.b-generated {
    background: #ede9fd;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
  }

  &.b-production {
    background: #f5f3ff;
    color: #834dd0;
    border: 1px solid #a78bfa;
  }

  &.b-planned {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fbbf24;
  }
}

.ss-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.ss-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: #b0a8cc;
  letter-spacing: 0.04em;
}

.legend-sn {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;

  &.l-planned {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fbbf24;
  }

  &.l-prod {
    background: #ede9fd;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
  }

  &.l-complete {
    background: #f5f3ff;
    color: #834dd0;
    border: 1px solid #a78bfa;
  }

  &.l-scrapped {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fca5a5;
  }
}

.set-block {
  background: #faf9ff;
  border: 1px solid #e8e4f8;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.set-block-head {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #ede9fd;
  gap: 10px;
}

.set-num {
  font-size: 16px;
  font-weight: 700;
  color: #834dd0;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.set-id-code {
  font-size: 9px;
  color: #b0a8cc;
  letter-spacing: 0.08em;
  font-style: italic;
}

.set-status-pill {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;

  &::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
  }

  &.sp-production {
    background: #ede9fd;
    color: #6d28d9;
    border: 1px solid #c4b5fd;

    &::before {
      background: #834dd0;
    }
  }

  &.sp-planned {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fbbf24;

    &::before {
      background: #f59e0b;
    }
  }

  &.sp-complete {
    background: #f5f3ff;
    color: #834dd0;
    border: 1px solid #a78bfa;

    &::before {
      background: #834dd0;
    }
  }
}

.set-serial-count {
  font-size: 9px;
  color: #b0a8cc;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.set-fg-rows {
  padding: 6px 0;
}

.set-fg-row {
  display: flex;
  align-items: center;
  padding: 7px 14px;
  border-bottom: 1px solid #f0eeff;
  gap: 10px;

  &:last-child {
    border-bottom: none;
  }
}

.set-fg-name {
  font-size: 11px;
  color: #6d4caa;
  width: 160px;
  flex-shrink: 0;
}

.set-serials-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
}

.sn-chip {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  cursor: default;

  &.sn-planned {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fbbf24;
  }

  &.sn-prod {
    background: #ede9fd;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
  }

  &.sn-complete {
    background: #f5f3ff;
    color: #834dd0;
    border: 1px solid #a78bfa;
  }

  &.sn-scrapped {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fca5a5;
    text-decoration: line-through;
    opacity: 0.7;
  }
}

.set-fg-qty-label {
  font-size: 9px;
  color: #c4b5fd;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

// ── BATCH STOCK TAB ──────────────────────────────

.batch-filter-select {
  background: #faf9ff;
  border: 1px solid #e0d8f8;
  border-radius: 5px;
  padding: 6px 32px 6px 12px;
  font-size: 11px;
  color: #2d1f5e;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239c88c8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  min-width: 180px;
  transition: border-color 0.15s;

  &:focus {
    border-color: #834dd0;
  }
}

.batch-card {
  background: #faf9ff;
  border: 1px solid #e8e4f8;
  border-radius: 8px;
  padding: 16px 18px 14px;
  margin-bottom: 14px;
  transition: border-color 0.15s;

  &:hover {
    border-color: #c4b5fd;
  }
}

.batch-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.batch-id {
  font-size: 13px;
  font-weight: 700;
  color: #834dd0;
  letter-spacing: 0.04em;
}

.batch-tag {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;

  &.bt-item {
    background: #ede9fd;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
  }

  &.bt-grn {
    background: #f5f3ff;
    color: #834dd0;
    border: 1px solid #a78bfa;
  }

  &.bt-date {
    background: #f0eeff;
    color: #9c88c8;
    border: 1px solid #d8d0f8;
  }
}

.batch-supplier {
  font-size: 10px;
  color: #b0a8cc;
  margin-bottom: 12px;
  letter-spacing: 0.04em;

  span {
    color: #d0cce8;
    margin: 0 4px;
  }
}

.batch-alloc-bar-track {
  height: 5px;
  background: #ede9fd;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.batch-alloc-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: #834dd0;
  transition: width 0.4s ease;

  &.fill-high {
    background: #ef4444;
  }
}

.batch-alloc-pct {
  font-size: 9px;
  color: #b0a8cc;
  text-align: right;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.batch-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid #e8e4f8;
  border-radius: 6px;
  overflow: hidden;
}

.batch-stat-cell {
  padding: 9px 14px;
  border-right: 1px solid #e8e4f8;

  &:last-child {
    border-right: none;
  }

  .bs-lbl {
    font-size: 8px;
    color: #b0a8cc;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .bs-val {
    font-size: 16px;
    font-weight: 600;
    color: #2d1f5e;
    font-variant-numeric: tabular-nums;

    &.bv-alloc {
      color: #834dd0;
    }

    &.bv-free {
      color: #834dd0;
    }

    &.bv-cons {
      color: #9c88c8;
    }
  }
}

// ── TRACE VIEW TAB ───────────────────────────────

.trace-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
}

.trace-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.trace-field-lbl {
  font-size: 8px;
  color: #834dd0;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.trace-select {
  background: #faf9ff;
  border: 1px solid #e0d8f8;
  border-radius: 5px;
  padding: 7px 30px 7px 10px;
  font-size: 11px;
  color: #834dd0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239c88c8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color 0.15s;

  &:focus {
    border-color: #834dd0;
  }
}

.btn-run-trace {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #834dd0;
  border: none;
  border-radius: 5px;
  padding: 0 18px;
  cursor: pointer;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  transition: background 0.15s, transform 0.1s;

  i {
    font-size: 13px;
  }

  &:hover {
    background: #834dd0;
  }

  &:active {
    transform: scale(0.97);
  }
}

.trace-result-lbl {
  font-size: 9px;
  color: #b0a8cc;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;

  strong {
    color: #834dd0;
    font-weight: 600;
    font-size: 10px;
  }
}

.trace-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;

  thead tr {
    border-bottom: 1px solid #e8e4f8;
  }

  th {
    font-size: 8px;
    color: #b0a8cc;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0 14px 8px;
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
  }

  tbody tr {
    border-bottom: 1px solid #f0eeff;
    transition: background 0.12s;

    &:hover {
      background: #faf9ff;
    }

    &:last-child {
      border-bottom: none;
    }
  }

  td {
    padding: 11px 14px;
    vertical-align: middle;
    color: #834dd0;
  }
}

.trace-batch-id {
  font-size: 11px;
  color: #834dd0;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.trace-item-link {
  font-size: 11px;
  color: #834dd0;
  cursor: pointer;
  text-decoration: none;

  &:hover {
    color: #834dd0;
    text-decoration: underline;
  }
}

.trace-stage-pill {
  font-size: 9px;
  background: #f5f3ff;
  color: #834dd0;
  border: 1px solid #e0d8f8;
  border-radius: 4px;
  padding: 2px 9px;
  letter-spacing: 0.04em;
  display: inline-block;

  .stage-num {
    color: #834dd0;
    font-weight: 600;
    margin-right: 3px;
  }
}

.trace-qty-val {
  font-size: 11px;
  color: #2d1f5e;
  text-align: right;
  display: block;
  font-variant-numeric: tabular-nums;
}

.trace-date-val {
  font-size: 10px;
  color: #b0a8cc;
  letter-spacing: 0.04em;
}

.trace-wo-link {
  font-size: 10px;
  color: #c4b5fd;
  letter-spacing: 0.06em;
  cursor: pointer;

  &:hover {
    color: #834dd0;
  }
}

.trace-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 10px;

  i {
    font-size: 28px;
    color: #e0d8f8;
  }

  .te-msg {
    font-size: 11px;
    letter-spacing: 0.06em;
    color: #d0cce8;
  }
}

.fieldItemCode{
  color:var(--button-primary-bg-default);
  margin-left: 25px;
  margin-top: 25px;
  font-size: 17px
  ;font-weight: 700;
}



.view-report-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  height: 38px;
  min-width: 90px;

  margin-top: 22px; /* Adjust between 20px-24px if needed */

  padding: 0 16px;

  border: 1px solid #d1d5db;
  border-radius: 6px;

  background: #f8fafc;
  color: #374151;

  font-size: 12px;
  font-weight: 600;

  cursor: pointer;
  transition: all 0.2s ease;
}

.view-report-btn:hover {
  background: #f1f5f9;
  border-color: #9ca3af;
}

.view-report-btn mat-icon {
  width: 18px;
  height: 18px;
  font-size: 18px;
  line-height: 18px;
}

.matrix-report-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.62);
}

.matrix-report-lightbox__panel {
  position: relative;
  width: min(98vw, 1440px);
  max-height: 94vh;
  padding: 18px;
  overflow: hidden;
  border-radius: 8px;
  background: #eef2f6;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.35);
}

.matrix-report-lightbox__close {
  position: absolute;
  // top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
}

.matrix-report-lightbox__close mat-icon {
  width: 18px;
  height: 18px;
  font-size: 18px;
}

/* =====================================================================
   TABLET — max-width: 1024px
   ===================================================================== */
@media (max-width: 1024px) {

  .FormOverView {
    overflow-x: hidden;
    max-width: 100%;
  }

  /* Picklist row + Remarks/Set row: wrap instead of overflowing */
  div[style*="display: flex"][style*="margin-left: 15px"] {
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .adjacentField,
  ::ng-deep gb-newpicklist {
    flex: 1 1 45%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  ::ng-deep gb-newpicklist .mat-mdc-form-field,
  ::ng-deep gb-newpicklist .mat-mdc-text-field-wrapper,
  ::ng-deep gb-newpicklist .mat-mdc-form-field-flex,
  ::ng-deep gb-newpicklist .mat-mdc-form-field-infix,
  ::ng-deep gb-newpicklist .mat-mdc-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .fieldItemCode {
    flex-basis: 100%;
    margin-left: 0;
    margin-top: 8px;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
  }

  .view-report-btn {
    margin-top: 10px;
  }

  ::ng-deep gb-textarea {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
  }

  ::ng-deep gb-input {
    flex: 1 1 30%;
    min-width: 0;
    max-width: 100%;
  }

  ::ng-deep gb-textarea .mat-mdc-form-field,
  ::ng-deep gb-textarea .mat-mdc-text-field-wrapper,
  ::ng-deep gb-textarea .mat-mdc-form-field-flex,
  ::ng-deep gb-textarea .mat-mdc-form-field-infix,
  ::ng-deep gb-input .mat-mdc-form-field,
  ::ng-deep gb-input .mat-mdc-text-field-wrapper,
  ::ng-deep gb-input .mat-mdc-form-field-flex,
  ::ng-deep gb-input .mat-mdc-form-field-infix {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .load-btn {
    flex: 0 0 auto !important;
    width: 220px !important;
    min-width: 220px;
    max-width: 220px;

    height: 42px;
    margin: 12px auto 0 !important;

    display: flex;
    align-items: center;
    justify-content: center;
  }

  ::ng-deep .FormsTabGroup .mat-mdc-tab-header {
    overflow-x: auto;
  }

  ::ng-deep .FormsTabGroup .mat-mdc-tab-label-container {
    overflow: visible;
  }

  ::ng-deep gb-formgrid {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .matrix-report-lightbox {
    padding: 14px;
    box-sizing: border-box;
  }

  .matrix-report-lightbox__panel {
    width: 96vw;
    max-height: 92vh;
    padding: 14px;
    box-sizing: border-box;
  }
}


/* =====================================================================
   MOBILE — max-width: 767px (also covers 600 / 480 / 390 / 360 / 320)
   ===================================================================== */
@media (max-width: 767px) {

  .FormOverView {
    overflow-x: hidden;
    max-width: 100%;
    padding-right: 0;
  }

  /* Every horizontal flex row collapses to vertical */
  div[style*="display: flex"][style*="margin-left: 15px"] {
    flex-direction: column;
    align-items: stretch;
    margin-left: 10px !important;
    width: 100%;
    max-width: 100%;
    gap: 10px !important;
    box-sizing: border-box;
  }

  .adjacentField,
  ::ng-deep gb-newpicklist {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  ::ng-deep gb-newpicklist .mat-mdc-form-field,
  ::ng-deep gb-newpicklist .mat-mdc-text-field-wrapper,
  ::ng-deep gb-newpicklist .mat-mdc-form-field-flex,
  ::ng-deep gb-newpicklist .mat-mdc-form-field-infix,
  ::ng-deep gb-newpicklist .mat-mdc-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .fieldItemCode {
    margin-left: 0;
    margin-top: 6px;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
  }

  .view-report-btn {
    width: 100%;
    margin-top: 8px;
    box-sizing: border-box;
  }

  ::ng-deep gb-textarea,
  ::ng-deep gb-input {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  ::ng-deep gb-textarea .mat-mdc-form-field,
  ::ng-deep gb-textarea .mat-mdc-text-field-wrapper,
  ::ng-deep gb-textarea .mat-mdc-form-field-flex,
  ::ng-deep gb-textarea .mat-mdc-form-field-infix,
  ::ng-deep gb-input .mat-mdc-form-field,
  ::ng-deep gb-input .mat-mdc-text-field-wrapper,
  ::ng-deep gb-input .mat-mdc-form-field-flex,
  ::ng-deep gb-input .mat-mdc-form-field-infix {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .load-btn {
  flex: 0 0 auto !important;

  width: 180px !important;
  min-width: 180px;
  max-width: 180px;

  height: 42px;
  padding: 0 16px;

  margin: 12px auto 0 !important;

  display: flex;
  align-items: center;
  justify-content: center;

  white-space: nowrap;
}

  ::ng-deep .FormsTabGroup .mat-mdc-tab-header {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  ::ng-deep .FormsTabGroup .mat-mdc-tab-label-container {
    overflow: visible;
  }

  ::ng-deep .FormsTabGroup .mat-mdc-tab {
    min-width: auto;
    padding: 0 10px;
  }

  ::ng-deep gb-formgrid {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .matrix-report-lightbox {
    padding: 6px;
    box-sizing: border-box;
  }

  .matrix-report-lightbox__panel {
    width: 98vw;
    max-height: 94vh;
    padding: 10px;
    box-sizing: border-box;
  }

  button {
    white-space: normal;
    word-break: break-word;
  }

  // ── Force identical widths: picklist / textarea / input ──
::ng-deep gb-newpicklist,
::ng-deep gb-textarea,
::ng-deep gb-input {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

::ng-deep gb-newpicklist .mat-mdc-form-field,
::ng-deep gb-textarea .mat-mdc-form-field,
::ng-deep gb-input .mat-mdc-form-field,
::ng-deep gb-newpicklist .mat-mdc-text-field-wrapper,
::ng-deep gb-textarea .mat-mdc-text-field-wrapper,
::ng-deep gb-input .mat-mdc-text-field-wrapper,
::ng-deep gb-newpicklist .mat-mdc-form-field-flex,
::ng-deep gb-textarea .mat-mdc-form-field-flex,
::ng-deep gb-input .mat-mdc-form-field-flex {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

::ng-deep gb-newpicklist .mat-mdc-form-field-infix,
::ng-deep gb-textarea .mat-mdc-form-field-infix,
::ng-deep gb-input .mat-mdc-form-field-infix {
  width: 100% !important;
  box-sizing: border-box !important;
}

::ng-deep .mat-mdc-input-element
{
  width: 260px !important;
}

::ng-deep gb-textarea .mat-mdc-form-field
{
  width: 100% !important;
  min-width: 260px !important;
}
}

/* Select Set & Sl No button */
.set-slno-btn {
    height: 33px;
    padding: 0 14px;

    border: 1px solid #6366f1;
    border-radius: 5px;

    background: #ffffff;
    color: #6366f1;

    font-size: 14px;
    cursor: pointer;

    &:hover {
        background: #6366f1;
        color: #ffffff;
    }
}


.picklist-lightboxfrom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.45);
}


/* Lightbox box */
.picklist-boxfrom {
    position: relative;

    width: 700px;
    max-width: 90%;
    max-height: 80vh;

    padding: 25px;

    background: #ffffff;
    border-radius: 10px;

    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25);

    overflow-y: auto;
}


/* Title */
.lightbox-title {
    margin: 0 0 20px 0;

    font-size: 18px;
    font-weight: 600;
}

/* Set & Sl No Lightbox */
.picklist-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.45);
}


/* Lightbox box */
.picklist-box {
    position: relative;

    width: 700px;
    max-width: 90%;
    max-height: 80vh;

    padding: 25px;

    background: #ffffff;
    border-radius: 10px;

    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25);

    overflow-y: auto;
}


/* Title */
.lightbox-title {
    margin: 0 0 20px 0;

    font-size: 18px;
    font-weight: 600;
}


/* Close button */
.close-btn {
    position: absolute;

    top: 8px;
    right: 12px;

    width: 32px;
    height: 32px;

    border: none;
    background: transparent;

    font-size: 28px;
    line-height: 28px;

    cursor: pointer;

    &:hover {
        color: #6366f1;
    }
}


/* Table */
.pending-allocation-grid {
    width: 100%;

    border-collapse: collapse;

    th,
    td {
        padding: 10px 12px;

        border: 1px solid #dddddd;

        text-align: left;
    }

    th {
        background: #f5f5f5;

        font-weight: 600;
    }

    tbody tr {
        cursor: pointer;

        &:hover {
            background: #f5f7ff;
        }

        &.selected-row {
            background: #e8eaff;
        }
    }
}


/* Checkbox column */
.checkbox-column {
    width: 45px;

    text-align: center !important;
}


/* Select button area */
.picklist-actions {
    display: flex;

    justify-content: flex-end;

    margin-top: 20px;
}


/* Select button */
.select-btn {
    padding: 8px 22px;

    border: none;
    border-radius: 5px;

    background: #6366f1;
    color: #ffffff;

    font-size: 14px;

    cursor: pointer;

    &:hover {
        background: #4f46e5;
    }
}


.set-from-heading {
  color: #6a0dad;
  border: 2px solid #8a2be2;
  padding: 2px 6px;
  margin-bottom: 25px;
  border-radius: 6px;
  display: inline-block;
  background-color: #f5f0fa;
  font-weight: 600;
}