.button-row {
  display: flex;
  gap: 10px;
  padding: 10px;
}

button.mat-raised-button {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  font-weight: bold;
  border-radius: 4px;
}

.process-btn {
  background-color: #b0be91;
  color: white;
}
.remove-btn {
  background-color: #e74c3c;
  color: white;
}
.oupost-btn,
.undooupost-btn {
  background-color: #d76c8d;
  color: white;
}
.clear-btn {
  background-color: #3f88c5;
  color: white;
}

.moalcontainer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1050;
  background: #f9f9fc;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 20px 30px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  min-width: 400px;
  max-width: 90%;
}

.yesbutton {
  border: 1px solid #1a1a1a26;
}
.yesbutton1 {
  border: 1px solid #1a1a1a26;
  margin-left: 6px;
}
.password {
  width: 60%;
  margin-top: 5px;
  border: 1px solid #1a1a1a26;
}

.FormOverView {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  .FormOverView {
    > gb-newpicklist,
    > gb-input {
      display: block;
      width: 100%;
    }

    // ROW 1: From Date + To Date
    > div[style*='display: flex']:nth-of-type(1) {
      display: flex !important;
      flex-direction: row !important;
      align-items: flex-end !important;
      gap: 10px !important;

      > div {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        > gb-date {
          display: block;
          width: 200px !important;
        }
      }
    }

    // ROW 2: Effective From Date + Checkbox
    > div[style*='display: flex']:nth-of-type(2) {
      display: flex !important;
      flex-direction: row !important;
      align-items: center !important;
      gap: 20px !important;

      > div {
        flex: 0 0 auto !important;
        margin-left: 0 !important;
        > gb-date {
          display: block;
          width: 200px !important;
        }
        > gb-checkbox {
          display: block;
          width: auto !important;
        }
      }
    }

    // ROW 3: Employee Code + Name
    > div[style*='display: flex']:nth-of-type(3) {
      display: flex !important;
      flex-direction: row !important;
      align-items: flex-end !important;
      gap: 10px !important;

      > div {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        > gb-newpicklist {
          display: block;
          width: 100% !important;
        }
      }
    }

    .button-row {
      flex-wrap: wrap;
      gap: 10px;
    }
  }
}

@media (max-width: 768px) {
  .FormOverView {
    padding: 10px;
    gap: 6px;

    > gb-newpicklist,
    > gb-input {
      display: block;
      width: 100% !important;
      box-sizing: border-box;
    }

    > div[style*='display: flex'] {
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 6px !important;

      > div {
        flex: unset !important;
        width: 100% !important;
        margin-left: 0 !important;
        box-sizing: border-box;

        > gb-date,
        > gb-newpicklist,
        > gb-checkbox,
        > gb-input {
          display: block;
          width: 100% !important;
          box-sizing: border-box;
        }
      }
    }

    .button-row {
      flex-direction: column !important;
      gap: 8px;
      padding: 8px 0;

      button[mat-raised-button],
      button.mat-raised-button {
        width: 100% !important;
        justify-content: center;
      }
    }
  }

  .moalcontainer {
    min-width: unset !important;
    width: 92vw !important;
    padding: 16px !important;
    box-sizing: border-box;

    span[style*='margin-left'] {
      margin-left: 0 !important;
      display: flex !important;
      justify-content: flex-end !important;
    }

    h3 {
      font-size: 13px;
      line-height: 1.5;
    }

    input[type='password'] {
      width: 90% !important;
      box-sizing: border-box;
    }
  }
}

@media (max-width: 480px) {
  .FormOverView {
    padding: 8px;
    gap: 4px;
  }

  .moalcontainer {
    width: 96vw !important;
    padding: 12px !important;
    h3 {
      font-size: 12px;
    }
  }
}

@media (max-width: 360px) {
  .FormOverView {
    padding: 5px !important;
    margin: 1px !important;
    gap: 4px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;

    // Standalone full-width fields
    > gb-newpicklist,
    > gb-input {
      display: block !important;
      width: 100% !important;
      box-sizing: border-box !important;
    }

    // Stacked rows
    > div[style*='display: flex'] {
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 4px !important;
      box-sizing: border-box !important;

      > div {
        width: 100% !important;
        margin-left: 0 !important;
        box-sizing: border-box !important;

        > gb-date,
        > gb-newpicklist,
        > gb-checkbox,
        > gb-input {
          display: block !important;
          width: 100% !important;
          box-sizing: border-box !important;
        }
      }
    }

    ::ng-deep {
      .mat-mdc-form-field {
        width: 350px !important;
        box-sizing: border-box !important;
      }

      .mat-mdc-text-field-wrapper,
      .mdc-text-field {
        width: 100% !important;
        box-sizing: border-box !important;
        padding-right: 0px !important;
      }

      .mat-mdc-form-field-flex {
        width: 100% !important;
        box-sizing: border-box !important;
        align-items: center !important;
      }

      .mat-mdc-form-field-infix {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow: hidden !important;
      }

      .mat-mdc-select-arrow-wrapper {
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
      }

      .mat-mdc-select-value,
      .mat-mdc-select-placeholder {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        min-width: 0 !important;
      }
    }
  }
}
