/* --- Clients (modules/clients/views/list.php): the Users list (pages/users.css: its box, rows, Search and Sort & filter),
   with the toolbar at the box's foot, the column names at every width, and the next consultation in the table. The
   rows below (.clients__row, .clients__open, .clients__avatar) are also used by the Users and Logins lists. --- */

/* The toolbar at the box's foot (Christopher, 2026-11-26): after the list, its line above it; Sort & filter opens
   upwards. It comes first in the page (the keyboard reaches Search before the rows), so CSS moves it down. */
.users--clients .box__toolbar {
  order: 1;
  border-top: var(--border-1) solid var(--c-line);
  border-bottom: 0;
}

.users--clients .users__panel {
  top: auto;
  bottom: calc(100% + var(--sp-2));
}

@media (max-width: 767.98px) {
  .users--clients .users__panel {
    bottom: calc(100% - var(--sp-1)); /* as Users' panel hangs from its toolbar on phones, mirrored */
  }
}

/* The next consultation: plain words in the table's second column from 1200px; below, only the name and the status. */
.users__next {
  display: none;
}

/* Below 1200px the column names are Name and Status (Users shows none there): the same small capitals as the table's,
   staying at the top while the list scrolls; Status ends where the chips end, beside the arrow's column. */
@media (max-width: 1199.98px) {
  .users--clients .users__cols {
    position: sticky;
    top: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto var(--sp-4); /* as the rows */
    column-gap: var(--sp-3);
    padding-block: var(--sp-4) var(--sp-2);
    font-size: var(--fs-xxs);
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--c-anthracite);
    background-color: var(--c-page);
    border-bottom: var(--border-1) solid var(--c-line);
  }

  .users--clients .users__cols > :nth-child(1),
  .users--clients .users__cols > :nth-child(3),
  .users--clients .users__cols > :nth-child(4) {
    display: none; /* the avatar's, Next and Referred by: table only */
  }

  .users--clients .users__cols > :nth-child(5) {
    justify-self: end;
  }
}

@media (min-width: 1200px) {
  .users__next {
    display: block;
    grid-area: role; /* Users' role column */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

/* A client: initials in a pale blue circle, name over email (or when they joined), and their tag on the right. */
.clients__row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-block: var(--sp-2);
}

.clients__row {
  position: relative; /* holds its open button, which covers the whole row */
}

/* Opening a client: an invisible button over the row (it posts their id), so the whole row is the target. */
.clients__open {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--radius-1);
  cursor: pointer;
}

.clients__row + .clients__row {
  border-top: var(--border-1) solid var(--c-line);
}

.clients__row .dashboard__what {
  flex: 1;
}

.clients__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--sp-8);
  height: var(--sp-8);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-accent-text);
  background-color: var(--c-accent);
  border-radius: var(--radius-pill);
}

.clients__row mark,
.users__who mark {
  color: inherit;
  background-color: var(--c-warning-bg);
}

@media (hover: hover) {
  .clients__row:has(.clients__open:hover) {
    background-color: var(--c-off-white);
  }
}
