/* ===================================================== Users feature styles */

/* ---------------------------------------------------------------- Table cells */
/* User identity cell: username (with a "You" tag on the self row) over email. */
.userrow__id {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.userrow__you {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  vertical-align: middle;
}
.userrow__email {
  font-size: 12px;
  color: var(--text-muted);
}
.userrow__perms {
  display: inline-block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-muted);
}

/* Toolbar inset: pads the filter/count row off the panel edge (the table below
   is flush, so only the toolbar needs the inset). */
.userstoolbar {
  padding: 14px 16px 0;
}

/* ----------------------------------------------------------------- User form */
.userform {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.userform__err {
  margin: 0;
  font-size: 12px;
  color: var(--bad);
}
.userform__note {
  margin: 0;
  font-size: 12px;
  color: var(--warn);
}
.userform__hint {
  color: var(--text-muted);
  font-style: normal;
}

/* Native select styled to match the Input primitive. */
.select {
  height: 36px;
  padding: 0 36px 0 12px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  appearance: none;
  cursor: pointer;
  /* Brand-tinted chevron, drawn as an inline SVG so it follows the token hue. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237b8a8e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition:
    border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* --------------------------------------------------------- Permissions group */
.permset {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.permset > .field__label {
  padding: 0;
}
.permset__locked {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.permset__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}
.permset__opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease);
}
.permset__opt:hover {
  border-color: var(--border-strong);
}
.permset__opt input[type="checkbox"] {
  margin-top: 2px;
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}
.permset__opt input[type="checkbox"]:disabled {
  cursor: not-allowed;
}
.permset__opttext {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.permset__optname {
  font-size: 13px;
  color: var(--text);
}
.permset__optcode {
  font-size: 11px;
  color: var(--text-faint);
}

/* ---------------------------------------------------------- Password control */
.pwfield {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pwfield__input {
  flex: 1;
  min-width: 0;
}
.pwfield__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.pwfield__msg {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}
.pwfield__msg--error {
  color: var(--bad);
}
.pwfield__strength {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pwfield__bar {
  position: relative;
  flex: 0 0 64px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.pwfield__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-origin: left;
}
.pwfield__bar--weak::after {
  width: 33%;
  background: var(--bad);
}
.pwfield__bar--fair::after {
  width: 66%;
  background: var(--warn);
}
.pwfield__bar--strong::after {
  width: 100%;
  background: var(--ok);
}
.pwfield__strengthtext {
  font-size: 12px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------ Access denied */
.denied {
  display: grid;
  place-items: center;
  padding: 48px 0;
}
.denied__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  max-width: 440px;
  padding: 16px 8px;
}
.denied__badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  color: var(--warn);
  background: var(--warn-soft);
}
.denied__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.denied__msg {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}
.denied__link {
  margin-top: 4px;
  text-decoration: none;
}
