@layer vendor-overrides {
  .gridjs-container {
    color: var(--app-color);
    width: 100%;
    padding: 0;
  }

  .gridjs-wrapper {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background-color: var(--app-background-color);
    border-top: var(--app-border-width) solid var(--app-table-border-color);
    padding-block-end: 1rem;
    min-height: 515px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .gridjs-footer {
    background-color: var(--app-background-color);
    border: 0;
    border-top: 0;
    box-shadow: none;
    color: var(--app-muted-color);
    padding: 1rem 0 0;
  }

  .gridjs-table {
    color: var(--app-color);
    min-width: 100%;
    width: max-content;
  }

  th.gridjs-th {
    padding: calc(var(--app-spacing) / 2) var(--app-spacing);
    border: none;
    border-bottom: var(--app-border-width) solid var(--app-table-border-color);
    background-color: var(--app-background-color);
    color: var(--app-color);
    font-weight: var(--app-font-weight);
    text-align: left;
    text-align: start;
  }

  button.gridjs-sort {
    height: 15px;
  }

  th.gridjs-th-sort:hover,
  th.gridjs-th-sort:focus {
    background-color: var(--app-table-row-stripped-background-color);
  }

  td.gridjs-td {
    background-color: var(--app-background-color);
    border: none;
    border-color: var(--app-table-border-color);
    padding: calc(var(--app-spacing) / 2) var(--app-spacing);
    border-bottom: var(--app-border-width) solid var(--app-table-border-color);
    background-color: var(--app-background-color);
    color: var(--app-color);
    font-weight: var(--app-font-weight);
    text-align: left;
    text-align: start;
  }

  .gridjs-search {
    float: none;
  }

  .gridjs-search-input {
    width: min(320px, 100%);
  }

  input.gridjs-input {
    background-color: var(--app-background-color);
    border: var(--app-border-width) solid var(--app-form-element-border-color);
    border-radius: var(--app-border-radius);
    color: var(--app-color);
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
  }

  input.gridjs-input:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 var(--app-outline-width) var(--app-primary-focus);
  }

  .gridjs-pagination {
    color: var(--app-muted-color);
  }

  .gridjs-pagination .gridjs-pages button {
    background-color: var(--app-background-color);
    border: var(--app-border-width) solid var(--app-table-border-color);
    color: var(--app-color);
    padding: 1px 10px;
  }

  .gridjs-pagination .gridjs-pages button:hover {
    background-color: var(--app-primary-hover-background);
    border-color: var(--app-primary-hover-border);
    color: var(--app-primary-inverse);
  }

  .gridjs-pagination .gridjs-pages button:focus {
    box-shadow: 0 0 0 var(--app-outline-width) var(--app-primary-focus);
  }

  .gridjs-pagination .gridjs-pages button.gridjs-currentPage {
    background-color: var(--app-primary) !important;
    font-weight: 400;
    padding: 2px 10px;
    color: var(--app-secondary-inverse) !important;
  }

  .gridjs-pagination .gridjs-pages button:disabled,
  .gridjs-pagination .gridjs-pages button[disabled] {
    background-color: var(--app-background-color);
    color: var(--app-muted-color);
    cursor: default;
    padding: 2px 10px;
    border: 0;
  }

  .gridjs-pagination .gridjs-pages {
    display: inline-flex;
    gap: 5px;
  }

  .gridjs-loading-bar {
    background-color: var(--app-background-color);
    opacity: 0.7;
  }

  .gridjs-message.gridjs-error .app-grid-error-actions {
    margin-top: 0.6rem;
  }

  .gridjs-message.gridjs-error .app-grid-retry {
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.2;
  }

  .grid-avatar {
    --grid-avatar-width: 36px;
    --grid-avatar-height: 36px;
    --grid-avatar-radius: 999px;
    --grid-avatar-fit: cover;
    --grid-avatar-padding: 0;
    width: var(--grid-avatar-width);
    height: var(--grid-avatar-height);
    border-radius: var(--grid-avatar-radius);
    border: 1px solid var(--app-muted-border-color);
    background: var(--app-card-background-color);
    object-fit: var(--grid-avatar-fit);
    padding: var(--grid-avatar-padding);
    display: inline-flex;
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .grid-avatar-tenant {
    --grid-avatar-width: 48px;
    --grid-avatar-height: 28px;
    --grid-avatar-radius: var(--app-border-radius);
    --grid-avatar-fit: contain;
    --grid-avatar-padding: 2px;
  }

  .grid-avatar-placeholder {
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--app-muted-color);
    font-size: 11px;
    background: var(--app-background-color);
  }

  .grid-avatar-tenant.grid-avatar-placeholder {
    font-size: 10px;
  }

  .grid-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
  }

  .grid-name-cell > a {
    display: inline-flex;
    flex-shrink: 0;
  }

  .grid-name-cell > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .gridjs-loading-bar:after {
    background-image: linear-gradient(
      90deg,
      transparent,
      var(--app-primary-focus),
      transparent
    );
  }

  /* .gridjs-container:not(.gridjs-has-loaded) .gridjs-message.gridjs-notfound {
    display: none;
  } */

  .gridjs-container.gridjs-is-updating .gridjs-message.gridjs-notfound {
    display: none;
  }

  .gridjs-pages button {
    background: var(--app-form-element-background-color) !important;
    color: var(--app-contrast) !important;
  }

  .gridjs-summary {
    font-size: small;
  }

  .gridjs-container .grid-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }

  .gridjs-container .grid-actions-row-open {
    justify-content: flex-end;
    width: 100%;
  }

  .gridjs-container .grid-actions .app-grid-row-open {
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
  }

  tr.gridjs-tr[data-row-open-url] {
    cursor: pointer;
  }

  tr.gridjs-tr:hover td {
    background: var(--app-table-row-stripped-background-color);
  }

  tr.gridjs-tr[data-row-open-url]:focus td,
  tr.gridjs-tr[data-row-open-url]:focus-within td {
    background: var(--app-table-row-stripped-background-color);
    background: color-mix(
      in srgb,
      var(--app-primary) 4%,
      var(--app-background-color)
    );
  }

  tr.gridjs-tr[data-row-open-url]:focus-visible td {
    background: var(--app-table-row-stripped-background-color);
    background: color-mix(
      in srgb,
      var(--app-primary) 6%,
      var(--app-background-color)
    );
  }

  tr.gridjs-tr[data-row-open-url]:focus-visible {
    outline: none;
  }

  .gridjs-container table td .grid-actions .app-grid-row-open:focus-visible {
    box-shadow: 0 0 0 var(--app-outline-width) var(--app-primary-focus);
  }

  html[data-theme="dark"] button.gridjs-sort,
  html[data-theme="dark"] button.gridjs-sort-neutral {
    filter: invert(1);
  }

  html[data-theme="dark-green"] button.gridjs-sort,
  html[data-theme="dark-green"] button.gridjs-sort-neutral {
    filter: invert(1);
  }

  .gridjs-tbody,
  td.gridjs-td {
    background-color: var(--app-background-color);
  }

  .gridjs-table input[data-grid-select-all] {
    width: 1em;
    height: 1em;
    margin: 0;
    border-radius: 4px;
    border-width: 0.5px;
  }

  .gridjs-th-content:has(input[data-grid-select-all]) {
    text-align: center;
  }

  .gridjs-pagination .gridjs-pages button:last-child {
    border-right: none;
  }
  button.gridjs-sort {
    background-color: transparent;
    background-position-x: center;
    background-repeat: no-repeat;
    background-size: contain;
    border: none;
    cursor: pointer;
    float: right;
    height: 24px;
    margin: 0;
    outline: none;
    padding: 0;
    width: 13px;
  }
}
