.Grid-styled-table {
 .Grid-styled-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  font-family: 'Helvetica';
  min-width: 500px;
  overflow: auto;
}
}
 
.Grid-styled-table thead {
  position: relative;
  z-index: 99;
  height: 48px;
  background: var(--bg-subtle);
  border-bottom: 1.5px solid var(--border-default);
}
 
.Grid-styled-table th {
  padding: 0px 15px;
  font-size: 14px;
  font-weight: 500;
  font-stretch: normal;
  font-style: normal;
  letter-spacing: normal;
  text-align: left;
  position: sticky !important;
}
 
.Grid-styled-table td {
  padding: 0px 15px;
  font-size: 14px;
  font-weight: 500;
  font-stretch: normal;
  font-style: normal;
  letter-spacing: normal;
  font-family: 'Helvetica';
  text-align: left;
}
 
.Grid-sticky-header {
  display: block;
  // This div is both the scroll viewport and the element carrying the outline
  // (border-radius + box-shadow below), so sizing it to the table keeps the outline
  // hugging the real column width instead of the full tab. The [style.max-width.px]
  // binding in the template still caps it, so a grid wider than the tab is clamped and
  // scrolls exactly as before. max-width: 100% is the fallback for when that inline
  // binding is absent or invalid — TabWidth() is 0 until the first window load/resize,
  // which yields an invalid max-width: -35px that the browser drops.
  width: fit-content;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: auto;
  max-height: 350px;
  margin: 5px;
  margin-top: 10px;
  margin-bottom: 10px;
  border-radius: 6px 6px 6px 6px;
  // border: 1px solid #dddddd;
  box-shadow: 0px 2px 4px 0px #00000033;
}
 
.Grid-styled-table thead tr {
  // border: 1px solid var(--action-primary-default);
  text-align: left;
  padding: 5px;
  position: sticky;
  top: 0;
  z-index: 10;
  background-color:var(--bg-subtle);
  height: 48px;
}
 
.Grid-styled-table tbody tr:focus-visible {
  border: 0px solid !important;
}
 
.AddRow {
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0px 2px 2px 0px #0000000F;
  border-radius: 6px;
  color: #FFFFFF;
  width: 120px;
  height: 32px;
  background-color: var(--action-primary-default);
  font-family: Helvetica;
  font-size: 12px;
  font-weight: 500;
  line-height: 19px;
}
 
.DeleteRow {
  cursor: pointer;
  display: flex;
  height: 36px;
  justify-content: right;
  align-items: center;
}
 
.GridInput {
  outline-style: none;
  height: 30px;
  border: none;
  color:var(--text-primary);
  border-radius:8px;
  height: 36px;
  text-align: left !important;
  padding-right: 8px;
  background-color: var(--field-bg-default);
}

.GridInput::placeholder {
  color: var(--field-text-placeholder) !important;
  opacity: 1;
}
 
.GridcheckBox {
  display: inline-flex;
  justify-content: flex-start;
  padding-right: 16px;
}
 
.GridMatSelect {
  font-weight: 500;
  color: var(--mat-sys-inverse-surface);
}
 
::ng-deep .mat-mdc-select-arrow svg {
  fill: var(--mat-sys-inverse-surface) !important;
}
 
::ng-deep .mdc-checkbox__background {
  border-color: var(--mat-sys-inverse-surface) !important;
}
 
::ng-deep.mat-mdc-select-value-text {
  color: var(--mat-sys-inverse-surface) !important;
}
 
::ng-deep .mat-mdc-select-disabled {
  color: var(--mat-sys-inverse-surface) !important;
}
 
::ng-deep .mat-mdc-select-arrow svg {
  fill: var(--mat-sys-inverse-surface) !important;
}
 
::ng-deep .hide-arrow .mat-mdc-select-arrow {
  display: none !important;
  /* Hides the arrow */
}
 
::ng-deep .hide-arrow .mat-mdc-select-trigger {
  pointer-events: none !important;
  /* Prevents user interaction */
}
 
::ng-deep.mdc-checkbox__native-control:enabled:checked~.mdc-checkbox__background,
.mdc-checkbox__native-control:enabled:indeterminate~.mdc-checkbox__background {
  border-color: var(--action-primary-default) !important;
  background-color: var(--action-primary-default) !important;
}
 
::ng-deep.mdc-checkbox:hover .mdc-checkbox__native-control:checked~.mdc-checkbox__ripple {
  background-color: var(--action-primary-default) !important;
}
 
::ng-deep.mdc-checkbox .mdc-checkbox__native-control:focus:checked~.mdc-checkbox__ripple {
  background-color: var(--action-primary-default) !important;
}
 
::ng-deep.mdc-checkbox:active .mdc-checkbox__native-control:checked~.mdc-checkbox__ripple {
  background-color: var(--action-primary-default) !important;
}
 
::ng-deep .mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,
.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background {
  border-color: var(--action-primary-default) !important;
  background-color: var(--action-primary-default) !important;
}
 
::ng-deep .mdc-checkbox__background {
  border-color: var(--mat-sys-inverse-surface) !important;
}
 
::ng-deep .mdc-checkbox__checkmark {
  color: #FFFFFF !important;
}
 
.disabled {
  opacity: 0.4;
  pointer-events: none;
  // cursor: default;
  cursor: not-allowed;
}
 
::ng-deep .today-btn-wrapper {
  position: absolute;
  bottom: 15px;
  right: 15px;
  z-index: 10;
}
.segmented-toggle {
  display: inline-flex;
  border-radius: 9999px;
  background-color: #EBD4FF;
  border: 1px solid #1A1A1A26;
  overflow: hidden;
  width: 119px;
  height: 24px;
}
 
.half-button {
  flex: 1;
  border: none;
  outline: none;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  background-color: transparent;
  color: #1A1A1ADE;
  font-family: Helvetica Neue !important;
  font-weight: 400;
  font-size: 12px;
  line-height: 150%;
  letter-spacing: 0%;
  text-align: center;
  vertical-align: middle;
  transition: background-color 0.3s, color 0.3s;
}
 
/* Active Half Styles */
.active-left {
  background-color: #e0c4ff;
  color: #1A1A1ADE;
  font-family: Helvetica Neue !important;
  font-weight: 400;
  font-size: 12px;
  line-height: 150%;
  letter-spacing: 0%;
  text-align: center;
  vertical-align: middle;
  border-top-left-radius: 9999px;
  border-bottom-left-radius: 9999px;
}
 
.active-right {
  background-color: #e0c4ff;
  color: #1A1A1ADE;
  font-family: Helvetica Neue !important;
  font-weight: 400;
  font-size: 12px;
  line-height: 150%;
  letter-spacing: 0%;
  text-align: center;
  vertical-align: middle;
  border-top-right-radius: 9999px;
  border-bottom-right-radius: 9999px;
}
 
/* Inactive side */
.inactive {
  background-color: white;
  color: #aaa;
  font-family: Helvetica !important;
  font-weight: 400;
  font-size: 12px;
  line-height: 150%;
  letter-spacing: 0%;
  text-align: center;
  vertical-align: middle;
 
}
 
/* Default Both Sides Active */
.both-active .half-button {
  background-color: #e0c4ff;
  color: #1A1A1ADE;
  font-family: Helvetica !important;
  font-weight: 400;
  font-size: 12px;
  line-height: 150%;
  letter-spacing: 0%;
  text-align: center;
  vertical-align: middle;
 
}
::ng-deep .half-toggle-group {
  width: 200px !important;
  height: 34px !important;
}
 
::ng-deep .half-toggle-group .mat-button-toggle {
  flex: 1;
  font-weight: 400;
  font-size: 12px;
  border: none;
  color: #1A1A1ADE;
  background-color: white;
  height: 34px !important;
  width: 100px !important;
  transition: all 0.3s ease;
}
 
::ng-deep .half-toggle-group .mat-button-toggle .mat-button-toggle-button {
  height: 34px !important;
  width: 100px !important;
  line-height: 34px !important;
  padding: 0 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
 
::ng-deep .half-toggle-group .mat-button-toggle:first-child {
  border-top-left-radius: 23px;
  border-bottom-left-radius: 23px;
}
 
::ng-deep .half-toggle-group .mat-button-toggle:last-child {
  border-top-right-radius: 23px;
  border-bottom-right-radius: 23px;
}
 
::ng-deep .half-toggle-group .mat-button-toggle.mat-button-toggle-checked {
  background-color: var(--button-primary-bg-default) !important;
  color: var(--button-primary-text-default) !important;
  font-weight: 400;
}
 
::ng-deep .mat-button-toggle-checked .mat-button-toggle-label-content::before {
 
  margin-right: 8px !important;
  font-size: 12px !important;
  color: #1a1a1a !important;
  display: inline-block !important;
 
}
 
::ng-deep .half-toggle-group .mat-button-toggle-label-content {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
    padding-left: 30px !important;
 
}
// .Grid-styled-table tbody tr {
//   border-bottom: 0.5px solid #ADADAD5C !important;
// }
.Grid-styled-table {
  gb-newpicklist:not(.readonly-picklist) {
    ::ng-deep .picklist-wrapper,
    ::ng-deep div[style*="display: flex; align-items: end"] {
      background-color: var(--field-bg-default) !important;
      border: 1px solid var(--field-border-default) !important;
      border-radius: 8px;
      height:36px !important;
    }
    
    ::ng-deep .form_input {
      background-color: transparent !important;
      padding-left: 8px !important;
      padding-right: 4px !important;
      padding-bottom:4px !important;
      font-weight: bold !important;
      width: 100% !important;
      text-align: left !important;
      
      &::placeholder {
        font-weight: normal !important;
        color: var(--field-text-placeholder) !important;
        opacity: 1 !important;
      }
    }
   
    ::ng-deep div[style*="display: inline-flex"] {
      display: flex !important;
      width: 100%;
      align-items: center !important;
      position: relative;
      
      span {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: left;
      }
      
      mat-icon {
        position: absolute !important;
        right: 4px !important;
        background-color: transparent !important;
        flex-shrink: 0;
        pointer-events: pointer;
      }
      mat-icon ::hover{
        cursor:pointer !important;
      }
    }
  }
  

  .readonly-select {
  pointer-events: none;
}
 
  gb-newpicklist.readonly-picklist {
    ::ng-deep .picklist-wrapper,
    ::ng-deep div[style*="display: flex; align-items: end"] {
      background-color: transparent !important;
    }
    
    ::ng-deep .form_input {
      background-color: transparent !important;
      padding-right: 32px !important; // Space for icon
      width: calc(100% - 36px) !important; // Reduce input width
    }
   
    ::ng-deep div[style*="display: inline-flex"] {
      display: flex !important;
      width: 100%;
      align-items: center !important;
      position: relative;
      
      span {
        order: 1;
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      
      mat-icon {
        order: 2;
        background-color: transparent !important;
        flex-shrink: 0;
        margin-left: 4px;
        padding-right: 4px !important;
      }
    }
  }
  
}
// ::ng-deep .mat-mdc-icon-button svg{
//   width: 0px !important;
// }
::ng-deep .mat-mdc-icon-button .mat-mdc-button-touch-target {
  position: absolute !important;
  top: 50% !important;
  height: 36px !important;
  display: var(--mat-icon-button-touch-target-display, block) !important;
  left: 74% !important;
  width: 135px !important;
  transform: translate(-68%, -11%) !important;
}

// ::ng-deep .mat-mdc-icon-button.mat-mdc-button-base{
//   width: 0px !important;
//   height: 0px !important;
//   padding: 1px !important;
// }
.GridMatSelect {
  font-weight: 500;
  color: var(--mat-sys-inverse-surface);
  padding: 7px 8px;
  font-weight: bold;
  background-color: #e7e7e7;
  border-radius: 8px;
  height: 36px;
  font-size: 14px;
}

.readonly-select {
  pointer-events: none;
  cursor: default !important;
  background-color: transparent !important;
  font-weight: 500;
}
// ::ng-deep .mat-datepicker-toggle{
//   cursor: pointer !important;
//   width: 102px !important;
//   margin-top: 11px !important;
//   margin-right: 65px !important;
// }
.Grid-styled-table textarea:focus {
  outline: none;
  border: none;
}
::ng-deep .mat-mdc-icon-button{
margin-left: -20px;
}

.grid-multi-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}

.grid-multi-btn:hover:not(.grid-btn-disabled) {
  opacity: 0.85;
  transform: scale(1.02);
}

.grid-btn-primary  { background: var(--action-primary-default); color: white; }
.grid-btn-success  { background: #28a745; color: white; }
.grid-btn-danger   { background: #dc3545; color: white; }
.grid-btn-warning  { background: #ffc107; color: #1a1a1a; }

.grid-btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.modal {
  display: block;
  position: fixed;
  z-index: 999;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 20px;
  border: 1px solid #888;
  width: 50vw;
  height: auto;
  border-radius: 10px;
}

.title {
  font-family: 'Helvetica';
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
}

.closeicon {
  float: right;
  cursor: pointer;
  color: var(--text-secondary);
}

:host ::ng-deep input.grid-right-align {
  text-align: right !important;
}
