@mixin list-layout {
  display: inline-grid;
  grid-template-columns: 1fr 40px;
  align-items: center;

  @include media-breakpoint-up(lg) {
    grid-template-columns:
      33px minmax(100px, 1fr) repeat(2, minmax(128px, 1fr)) minmax(300px, 1fr)
      50px;
  }
}

#users-overview {
  .users-list {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    row-gap: 10px;

    @include media-breakpoint-up(lg) {
      grid-template-rows: 22px 1fr;
    }

    .headers {
      display: none;
      margin-bottom: 0;

      @include media-breakpoint-up(lg) {
        @include list-layout;

        :last-child {
          justify-content: center;
        }
      }

      span,
      p {
        @include typography(app-wizard-1);
      }
    }

    .scroll-container {
      padding: 0;
      margin-right: 5px;
      grid-row: 1;
      grid-column: 1;
      padding-bottom: 1.5rem;

      @include media-breakpoint-up(lg) {
        grid-row: 2;
        padding-bottom: 40px;
      }
    }

    .users-list-row {
      width: 100%;
      height: 60px;
      box-sizing: border-box;
      @include list-layout;
      padding: 0 15px;
      background-color: var(--surface-default-modal);
      border-radius: 15px;
      border: 1px solid transparent;
      transition-property: border;
      transition-duration: 100ms;
      transition-timing-function: ease-in-out;

      &:hover {
        border-color: var(--border-primary);
      }

      & > * {
        & > p,
        & > span {
          @include typography(app-button-xl);
        }
      }

      &.user-disabled {
        :not(.user-initials-box > *, .user-edit-cell > *) {
          color: var(--text-body-tertiary);
        }
      }

      .name-cell {
        display: flex;
        flex-flow: row;
        align-items: center;
        justify-content: flex-start;
        column-gap: 10px;
        cursor: pointer;

        .user-initials-box {
          span {
            @include typography(app-avatar-L);
          }
        }
      }

      .user-edit-cell {
        display: flex;
        flex-flow: row;
        align-items: center;
        justify-content: center;
      }

      .groups-cell {
        display: flex;
        flex-flow: row nowrap;
        column-gap: 10px;
        justify-content: flex-start;
        align-items: center;
        overflow: hidden;
        max-width: 100%;
        cursor: default;

        .group {
          user-select: none;
          display: flex;
          flex-flow: row;
          align-items: center;
          justify-content: center;
          box-sizing: border-box;
          padding: 0 10px;
          height: 32px;
          border: 1px solid var(--border-primary);
          border-radius: 10px;
          background-color: var(--surface-default-modal);
          width: max-content;
          max-width: 135px;
          overflow: hidden;

          & > * {
            @include typography(app-input);
            display: block;
            cursor: default;
          }
        }

        &.clickable {
          cursor: pointer;

          .group {
            cursor: pointer;

            & > * {
              cursor: pointer;
            }
          }
        }
      }
    }
  }
}
