.action-userstats {
  width: 100%;
  max-width: 1200px;
}
.action-userstats .action-abort {
  width: 100%;
  margin-top: 10px;
}
/* No overflow clipping on the card or the table wrapper: either would turn
   it into a scroll container and stop the sticky header from sticking to the
   window. The whole page scrolls instead, so no row can hide below an inner
   edge whose scrollbar macOS does not show. */
.userstats__card {
  background-color: white;
  border-radius: 16px;
  border: 1px solid #e9edf5;
}

/* --- toolbar --- */
.userstats__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 2px solid #e9edf5;
}
.userstats__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-right: auto;
}
.userstats__chip {
  border: 1px solid #e9edf5;
  border-radius: 999px;
  padding: 4px 12px;
  background-color: white;
  color: inherit;
  cursor: pointer;
}
.userstats__chip:hover {
  background-color: #f6f7f8;
}
.userstats__chip small {
  margin-left: 6px;
  opacity: 0.7;
}
.userstats__chip--active,
.userstats__chip--active:hover {
  background-color: rgb(24, 64, 128);
  border-color: rgb(24, 64, 128);
  color: white;
}
.userstats__chip:focus-visible,
.userstats__sort:focus-visible,
.userstats__row:focus-visible {
  outline: 2px solid rgba(24, 64, 128, 0.6);
  outline-offset: -2px;
}
.userstats__group {
  width: auto;
  max-width: 240px;
}
.userstats__search {
  width: 260px;
  max-width: 100%;
}

/* --- table --- */
/* Narrow screens scroll the table sideways; the header then stops sticking. */
@media (max-width: 991px) {
  .userstats__scroll {
    overflow-x: auto;
  }
}
.userstats__table {
  width: 100%;
  border-collapse: collapse;
}
.userstats__table th,
.userstats__table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e9edf5;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}
.userstats__table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: #fafbfd;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
}
.userstats__table .userstats__num {
  text-align: right;
}
.userstats__sort {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  color: inherit;
  cursor: pointer;
}
.userstats__sort:hover {
  color: rgb(24, 64, 128);
}
.userstats__sort--asc::after {
  content: " ▲";
  color: rgb(24, 64, 128);
}
.userstats__sort--desc::after {
  content: " ▼";
  color: rgb(24, 64, 128);
}
.userstats__row {
  cursor: pointer;
}
.userstats__row:hover {
  background-color: #f6f7f8;
}
.userstats__row--open,
.userstats__row--open:hover {
  background-color: #eef4ff;
}
.userstats__name {
  display: block;
  font-weight: bold;
}
.userstats__username,
.userstats__muted {
  color: #6b7280;
}
.userstats__username {
  font-size: 14px;
}
.userstats__role {
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 13px;
  background-color: #eef2ff;
  color: #3730a3;
}
.userstats__role--demoUser {
  background-color: #fef3c7;
  color: #92400e;
}
.userstats__role--admin {
  background-color: #e0f2fe;
  color: #075985;
}
.userstats__role--superAdmin {
  background-color: #f3e8ff;
  color: #6b21a8;
}
.userstats__last,
.userstats__count,
.userstats__created,
.userstats__logins span {
  font-variant-numeric: tabular-nums;
}
.userstats__stale {
  color: #dc2626;
}
.userstats__bar {
  display: inline-block;
  width: 60px;
  height: 6px;
  margin-right: 8px;
  border-radius: 3px;
  background-color: #e9edf5;
  vertical-align: middle;
  overflow: hidden;
}
.userstats__bar span {
  display: block;
  height: 100%;
  background-color: #b45309;
}

/* the card no longer clips its children, so the last row rounds its own corners */
.userstats__table tbody tr:last-child td {
  border-bottom: 0;
}
.userstats__table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 16px;
}
.userstats__table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 16px;
}

/* --- expanded login list --- */
.userstats__detail td {
  background-color: #f8fafc;
  white-space: normal;
}
.userstats__detail-title {
  font-weight: bold;
}
.userstats__logins {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.userstats__logins:empty {
  display: none;
}
.userstats__logins span {
  padding: 2px 8px;
  border: 1px solid #e9edf5;
  border-radius: 6px;
  background-color: white;
}
.userstats__empty {
  margin: 0;
  padding: 10px;
  color: #6b7280;
}
.userstats__hint {
  margin: 8px 0 0;
  font-size: 14px;
  color: #6b7280;
}
