/* ─────────────────────────────────────────────────────────────────────────
   Governance → Utenti — pagina admin. Riusa i token di styles.css e il chrome
   di agent-edit.css (.ae-chrome / .ae-head / .breadcrumbs / .btn). Prefisso `us-`.
   ───────────────────────────────────────────────────────────────────────── */

/* Toolbar: ricerca + filtri + conteggio */
.us-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 18px 0 14px; }
.us-search { flex: 1; min-width: 240px; max-width: 520px; }
.us-count { margin-left: auto; font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }

.us-filter {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--r-md);
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text); font-size: 13px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.us-filter:hover { border-color: var(--border-strong); }
.us-filter.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text-link); }
.us-filter-lbl { color: var(--text-faint); }
.us-filter.on .us-filter-lbl { color: var(--text-link); }

.us-menu { position: fixed; z-index: 80; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; }
.us-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 6px; background: none; border: none; color: var(--text); font-size: 13px; cursor: pointer; text-align: left; }
.us-menu-item:hover { background: var(--bg-card-hover); }
.us-menu-item .nm { flex: 1; }
.us-menu-item.on { color: var(--text-strong); font-weight: 500; }
.us-menu-item > svg:last-child { color: var(--accent); }
.us-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Pannello lista */
.us-panel { background: var(--bg-content); border: 1px solid var(--border-faint); border-radius: var(--r-lg); overflow: hidden; }
.us-list { display: flex; flex-direction: column; }

.us-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1.7fr) minmax(0, 1fr) 130px 150px 40px;
  align-items: center; gap: 12px; padding: 10px 16px;
  border-top: 1px solid var(--border-faint);
}
.us-list .us-row:hover { background: var(--bg-card-hover); }
.us-head-row {
  border-top: 0; padding-top: 13px; padding-bottom: 13px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid var(--border-faint); background: var(--bg-card);
}

.us-ava {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 600; color: #fff; letter-spacing: .02em;
}
.us-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.us-id .nm { font-size: 13.5px; font-weight: 500; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.us-id .mail { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.us-badges { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.us-badge { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }

.us-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text); }
.us-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.us-access { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }

.us-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px; color: var(--text-faint); font-size: 13px; }

/* Desktop-first: su schermi stretti la lista scorre in orizzontale (niente
   nascondi-colonne, per non disallineare header e righe). */
@media (max-width: 900px) {
  .us-panel { overflow-x: auto; }
  .us-row { min-width: 760px; }
}
