.newrulebtn {
  display: inline-flex;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 1rem;
  color: #ffffff;
  background-color: #2563eb;
  /* blue-600 */
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.newrulebtn:hover {
  background-color: #1d4ed8;
}

.newrulebtn:active {
  background-color: #1e40af;
  transform: scale(0.96);
}

.newrulebtn:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.newrulebtn:disabled {
  background-color: #93c5fd;
  cursor: not-allowed;
  opacity: 0.6;
}

// lightbox

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 1rem;
  z-index: 1000;
}

.modal-overlay.open {
  display: flex;
}


.modal {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem;
  width: 90%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-close {
  position: absolute;
  right:110px;
  margin-top: -20px;
  font-size: 1.5rem;
  background: transparent;
  border: none;
  color: black;
  cursor: pointer;
  font-weight: bold;
  padding: 0.25rem;
  transition: color 0.2s ease;
  z-index: 10;
}

.cancelbtn {
  display: inline-flex;
  margin-left: 0 !important;
  padding: 0.35rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 500;
  background-color: #ffffff;
  color: #222222;
  border: 1.5px solid #d0d0d0;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.lightboxsavebtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 1rem;
  color: #ffffff;
  background-color: #2563eb;
  /* blue-600 */
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

@media screen and (max-width: 1024px) {

  ::ng-deep .FormOverView {
    padding: 0 0.75rem !important;
  }

  ::ng-deep .FormOverView > div[style*="align-items: center"] {
    width: 100% !important;
    flex-wrap: wrap !important;
    gap: 0.5rem;
  }

  ::ng-deep .modal {
    box-sizing: border-box !important;
    width: 94% !important;
    max-width: 94vw !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 1.25rem !important;
  }

  ::ng-deep .modal > div[style*="display: flex"] {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  ::ng-deep .adjacentField {
    box-sizing: border-box !important;
    flex: 1 1 calc(50% - 16px) !important;
    max-width: calc(50% - 16px) !important;
    min-width: 0 !important;
  }

  ::ng-deep .adjacentField input,
  ::ng-deep .adjacentField .mat-mdc-form-field,
  ::ng-deep .adjacentField .mat-mdc-text-field-wrapper {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  ::ng-deep .modal gb-input {
    box-sizing: border-box !important;
    flex: 1 1 calc(50% - 16px) !important;
    max-width: calc(50% - 16px) !important;
    min-width: 0 !important;
  }

  ::ng-deep .modal gb-input input {
    box-sizing: border-box !important;
    width: 100% !important;
  }

  ::ng-deep .modal-close {
    right: 16px !important;
    top: 12px !important;
    position: absolute !important;
  }
}

@media screen and (max-width: 768px) {

  ::ng-deep .FormOverView {
    padding: 0 0.5rem !important;
  }

  ::ng-deep .FormOverView h3 {
    font-size: 14px !important;
  }

  ::ng-deep .newrulebtn {
    font-size: 0.7rem;
    padding: 0.3rem 0.8rem;
  }

  ::ng-deep .modal {
    box-sizing: border-box !important;
    width: 92% !important;
    max-width: 92vw !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 1rem !important;
    border-radius: 0.6rem;
  }

  ::ng-deep .modal > div[style*="display: flex"] {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }

  ::ng-deep .adjacentField,
  ::ng-deep .modal gb-input {
    box-sizing: border-box !important;
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  ::ng-deep .adjacentField input,
  ::ng-deep .adjacentField .mat-mdc-form-field,
  ::ng-deep .adjacentField .mat-mdc-text-field-wrapper,
  ::ng-deep .modal gb-input input {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  ::ng-deep .modal-close {
    right: 12px !important;
    top: 10px !important;
    margin-top: 0 !important;
    font-size: 1.25rem;
    position: absolute !important;
  }

  ::ng-deep .modal > div[style*="justify-content: flex-end"] {
  display: flex !important;
  flex-direction: column !important;    
  justify-content: center !important;
  align-items: stretch !important;
  gap: 0.5rem !important;
  width: 100% !important;
}

::ng-deep .cancelbtn,
::ng-deep .lightboxsavebtn {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 9px !important;
  display: flex !important;            
  align-items: center !important;      
  justify-content: center !important;  
  text-align: center !important;
}

  ::ng-deep gb-formgrid {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;          
    -webkit-overflow-scrolling: touch;
  }

  ::ng-deep gb-formgrid > * {
    overflow: visible !important;
  }

  ::ng-deep gb-formgrid table,
  ::ng-deep gb-formgrid .mat-mdc-table,
  ::ng-deep gb-formgrid .ag-root-wrapper {
    min-width: 600px !important;
    overflow: visible !important;
  }

  ::ng-deep gb-radiobutton {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 20px !important;
    overflow: visible !important;
    height: auto !important;
  }

  ::ng-deep gb-radiobutton .mat-mdc-form-field,
  ::ng-deep gb-radiobutton .mat-mdc-text-field-wrapper,
  ::ng-deep gb-radiobutton .mat-mdc-form-field-flex,
  ::ng-deep gb-radiobutton .mat-mdc-form-field-infix {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: unset !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  ::ng-deep gb-radiobutton mat-radio-group,
  ::ng-deep gb-radiobutton .mat-radio-group,
  ::ng-deep gb-radiobutton .mat-mdc-radio-group {
    display: flex !important;
    flex-wrap: wrap !important;
    row-gap: 10px !important;
    column-gap: 16px !important;
    align-items: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: unset !important;
    max-height: none !important;
    overflow: visible !important;
  }

  ::ng-deep gb-radiobutton mat-radio-button,
  ::ng-deep gb-radiobutton .mat-radio-button,
  ::ng-deep gb-radiobutton .mat-mdc-radio-button {
    flex: 0 1 auto !important;
    white-space: nowrap !important;
    margin: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  ::ng-deep gb-radiobutton .mdc-form-field {
    display: flex !important;
    align-items: center !important;
  }

  ::ng-deep gb-radiobutton .mdc-radio {
    flex-shrink: 0 !important;
    margin-right: 10px !important;
  }

  ::ng-deep gb-radiobutton .mdc-label {
    white-space: normal !important;
    margin-left: 0 !important;
  }

  ::ng-deep .modal gb-newpicklist[formcontrolname="EmployeeName"],
  ::ng-deep .modal gb-newpicklist[formcontrolname="AllotedToEmployeeName"],
  ::ng-deep .modal gb-newpicklist[formcontrolname="PartyName"],
  ::ng-deep .modal gb-newpicklist[formcontrolname="UserGroupName"] {
    box-sizing: border-box !important;
    width: 85% !important;
    max-width: 85% !important;
    flex: 0 1 85% !important;
  }

  ::ng-deep .modal gb-newpicklist[formcontrolname="EmployeeName"] input,
  ::ng-deep .modal gb-newpicklist[formcontrolname="AllotedToEmployeeName"] input,
  ::ng-deep .modal gb-newpicklist[formcontrolname="PartyName"] input,
  ::ng-deep .modal gb-newpicklist[formcontrolname="UserGroupName"] input,
  ::ng-deep .modal gb-newpicklist[formcontrolname="EmployeeName"] .mat-mdc-form-field,
  ::ng-deep .modal gb-newpicklist[formcontrolname="AllotedToEmployeeName"] .mat-mdc-form-field,
  ::ng-deep .modal gb-newpicklist[formcontrolname="PartyName"] .mat-mdc-form-field,
  ::ng-deep .modal gb-newpicklist[formcontrolname="UserGroupName"] .mat-mdc-form-field {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  ::ng-deep .mat-mdc-form-field {
    width: 100% !important;
  }
}

@media screen and (max-width: 480px) {

  ::ng-deep .modal {
    width: 95% !important;
    max-width: 95vw !important;
    padding: 0.85rem !important;
  }

  ::ng-deep .modal gb-newpicklist[formcontrolname="EmployeeName"],
  ::ng-deep .modal gb-newpicklist[formcontrolname="AllotedToEmployeeName"],
  ::ng-deep .modal gb-newpicklist[formcontrolname="PartyName"],
  ::ng-deep .modal gb-newpicklist[formcontrolname="UserGroupName"] {
    width: 80% !important;
    max-width: 80% !important;
    flex: 0 1 80% !important;
  }

  ::ng-deep gb-radiobutton mat-radio-group,
  ::ng-deep gb-radiobutton .mat-radio-group,
  ::ng-deep gb-radiobutton .mat-mdc-radio-group {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}