.user-list-empty-col {
  display: flex;
  height: 100%;
  flex-flow: column nowrap;

  .row:first-child {
    flex-grow: 1; /* fill vertical space so notifications are pushed to bottom */
  }

  .card-body {
    // h2 + .card-thin top padding
    padding-bottom: calc(var(--line-height-03) + var(--line-height-03) / 2);
  }
}

.action-btn {
  padding: 0 var(--spacing-02);
}

#manage-users-root .user-notifications ul {
  margin-bottom: 0;
}

.user-list-sidebar-wrapper-react {
  button {
    white-space: normal;
    word-wrap: anywhere;

    // prevents buttons from expanding sidebar width
  }

  .create-account-button-wrapper {
    width: 100%;
    .create-account-button {
      width: 100%;
    }
  }
}

.create-account-button.dropdown-toggle::after {
  display: none;
}

.user-list-header-row {
  display: flex;
  align-items: center;
  margin-bottom: var(--spacing-05);
  min-height: 36px;

  .user-list-title {
    @include heading-sm;

    color: var(--content-secondary-themed);
    font-weight: bold;
    min-width: 0;
  }
}

.user-tools {
  flex-shrink: 0;
  margin-left: auto;
  min-height: 38px;
  display: flex;
  align-items: center;
}

@include media-breakpoint-down(md) {
  .user-tools {
    float: left;
    margin-left: initial;
  }
}

.users-toolbar {
  display: flex;
  align-items: center;

  .dropdown,
  .dropdown-toggle {
    max-width: 100%;
  }

  .dropdown {
    min-width: 0;
  }
}

.users-sort-dropdown {
  flex-shrink: 0;
  margin-left: auto;
}

.user-menu-item-edit-btn {
  position: absolute;
  top: 0;
  right: var(--spacing-09);
  width: initial;
  background-color: transparent;
}

.user-menu-item-tag-name {
  padding-right: var(--spacing-13);
}

ul.user-list-filters {
  .subdued {
    color: var(--content-disabled);
  }

  > li {
    cursor: pointer;
    position: relative;

    > button {
      &:hover,
      &:focus {
        text-decoration: none;
      }
    }

    &.separator {
      padding: var(--spacing-03) var(--spacing-06);
      cursor: auto;
    }
  }

  .dropdown-header {
    @include body-sm;

    padding: var(--spacing-05) var(--spacing-06);
    text-transform: uppercase;
  }

  > li.active {
    border-radius: 0;

    > button {
      font-weight: 700;
    }
  }

  h2 {
    font-size: var(--font-size-02);
    margin-bottom: var(--spacing-00);
    color: var(--content-disabled);
    text-transform: uppercase;
    padding: var(--spacing-03) var(--spacing-00);
  }

  > li.tag {
    &.active,
    &:focus-within {
      .tag-menu {
        display: block;
      }
    }

    &.untagged {
      button.tag-name {
        span.name {
          font-style: italic;
          padding-left: 0;
        }
      }
    }

    &:hover {
      .tag-menu {
        display: block;
      }
    }

    button.tag-name {
      position: relative;
      padding: var(--spacing-03) var(--spacing-09) var(--spacing-03)
        var(--spacing-06);
      display: flex;
      align-items: center;
      word-wrap: anywhere;

      .tag-list-icon {
        vertical-align: sub;
        font-weight: bold;
      }

      span.name {
        padding-left: 0.5em;
        line-height: 1.4;
      }
    }
  }

  .tag-menu {
    button.dropdown-toggle {
      background-color: transparent;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;

      &::after {
        margin: 0;
      }
    }

    display: none;
    width: auto;
    position: absolute;
    top: 50%;
    margin-top: -8px; // Half the element height.
    right: 4px;

    &.open {
      display: block;
    }

    button.tag-action {
      border-radius: unset;
      width: 100%;
      background-color: transparent;
      border-color: transparent;
      color: var(--neutral-70);
      text-align: left;
      font-weight: normal;

      &:hover {
        color: var(--content-primary-dark);
        background-color: var(--bg-accent-01);
      }

      &:active {
        outline: none;
      }
    }
  }
}

.user-dash-table {
  width: 100%;
  table-layout: fixed;

  @include media-breakpoint-down(md) {
    tr:not(:last-child) {
      border-bottom: 1px solid var(--border-divider-themed);
    }

    td {
      border-bottom-width: 0;
    }
  }

  tbody {
    tr.no-users:hover {
      td {
        box-shadow: none;
      }
    }
  }

  .table-header-sort-btn {
    border: 0;
    text-align: left;
    color: var(--content-secondary-themed);
    background-color: transparent;
    padding: 0;
    font-weight: bold;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;

    &:hover,
    &:focus {
      color: var(--content-secondary-themed);
      text-decoration: none;
    }

    .material-symbols {
      vertical-align: bottom;
      font-size: var(--font-size-06);
    }
  }

  .dash-row-admin {
    font-weight: bold;
    a {
      color: var(--content-danger) !important;
    }
  }

  .dash-cell-name {
    hyphens: auto;
    width: 30%;
    word-break: break-word;
  }

  .dash-cell-email {
    width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dash-cell-date-signup {
    width: 25%;
  }
  .dash-cell-date-active {
    width: 25%;
  }

  .dash-cell-actions {
    display: none;
    text-align: right;

    .btn {
      text-decoration: none;
    }
  }

  .dash-cell-email-date {
    font-size: $font-size-sm;

    @include text-truncate;
  }

  .dash-cell-tag,
  .clone-user-tag {
    .badge-tag {
      margin-top: var(--spacing-06);
      margin-bottom: var(--spacing-06);

      &:first-child {
        margin-left: initial !important;
      }
    }
  }

  @include media-breakpoint-up(sm) {
    .dash-cell-checkbox {
      width: 4%;
    }

    .dash-cell-name {
      width: 36%;
    }

    .dash-cell-email {
      width: 36%;
    }

    .dash-cell-date-signup {
      width: 12%;
    }

    .dash-cell-date-active {
      width: 12%;
    }

    .dash-cell-actions {
      width: 0%;
    }
  }

  @include media-breakpoint-up(md) {
    .dash-cell-checkbox {
      width: 3%;
    }

    .dash-cell-name {
      width: 23%;
    }

    .dash-cell-email {
      width: 28%;
    }

    .dash-cell-date-signup {
      width: 17%;
    }

    .dash-cell-date-active {
      width: 17%;
    }

    .dash-cell-actions {
      display: table-cell;
      width: 12%;
    }

    .user-tools {
      float: none;
    }
  }

  @include media-breakpoint-up(lg) {
    .dash-cell-checkbox {
      width: 3%;
    }

    .dash-cell-name {
      width: 24%;
    }

    .dash-cell-email {
      width: 29%;
    }

    .dash-cell-date-signup {
      width: 17%;
    }

    .dash-cell-date-active {
      width: 17%;
    }

    .dash-cell-actions {
      width: 12%;
    }

    tbody {
      .dash-cell-actions {
        white-space: nowrap;
      }
    }
  }

  @include media-breakpoint-up(xl) {
    .dash-cell-checkbox {
      width: 3%;
    }

    .dash-cell-name {
      width: 24%;
    }

    .dash-cell-email {
      width: 29%;
    }

    .dash-cell-date-signup {
      width: 17%;
    }

    .dash-cell-date-active {
      width: 17%;
    }

    .dash-cell-actions {
      width: 12%;
    }
  }

  @include media-breakpoint-up(xxl) {
    .dash-cell-checkbox {
      width: 3%;
    }

    .dash-cell-name {
      width: 24%;
    }

    .dash-cell-email {
      width: 29%;
    }

    .dash-cell-date-signup {
      width: 17%;
    }

    .dash-cell-date-active {
      width: 17%;
    }

    .dash-cell-actions {
      width: 12%;
    }
  }

  @include media-breakpoint-down(md) {
    tr {
      position: relative;
      display: flex;
      flex-direction: column;

      td {
        padding-top: var(--spacing-02);
        padding-bottom: var(--spacing-02);
      }

      td:not(.dash-cell-actions) {
        padding-right: 55px;
      }
    }

    .dash-cell-name,
    .dash-cell-email,
    .dash-cell-date-signed,
    .dash-cell-date-active,
    .dash-cell-actions {
      display: block;
      width: auto;
    }

    .dash-cell-actions {
      position: absolute;
      top: var(--spacing-04);
      right: var(--spacing-04);
      padding: 0 !important;
    }
  }
}

/* stylelint-disable selector-class-pattern */
.user-list-upload-user-modal-uppy-dashboard .uppy-Root {
  .uppy-Dashboard-AddFiles-title {
    display: flex;
    flex-direction: column;
    color: var(--neutral-60);
    white-space: pre-line;

    @include body-base;

    button.uppy-Dashboard-browse {
      @extend .btn;
      @extend .btn-lg;
      @extend .btn-primary;

      margin-bottom: var(--spacing-07);
    }
  }
}

form.user-search {
  .form-group {
    margin-bottom: 0;
  }
}

@include theme('default') {
  .dash-cell-email a,
  .dash-cell-email-date a {
    color: var(--green-40);
  }
  .dash-row-admin a {
    color: var(--content-danger-dark) !important;
  }
}
