/* Admin → Users: table (cards at phone width), pager, and the credit-history side panel. UI1, 21 Oct 2026. */
.adm-users-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem 1rem; margin-bottom: 0.9rem; }
.adm-search { flex: 1 1 280px; max-width: 460px; }
.adm-search input { padding: 0.6rem 0.9rem; }
.adm-sort-phone { display: none; }
.adm-count { margin-left: auto; color: var(--text-secondary); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.adm-users { min-width: 0; }

.adm-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.adm-table th { text-align: left; padding: 0 0.6rem 0.5rem; border-bottom: 1px solid var(--border-strong); font-weight: 600; }
.adm-table td { padding: 0.65rem 0.6rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.adm-table tbody tr:hover { background: var(--sec-soft); }
.adm-table .adm-num { text-align: right; font-variant-numeric: tabular-nums; }
.adm-sort { background: none; border: 0; padding: 0.2rem 0; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; display: inline-flex; gap: 0.3rem; align-items: center; }
.adm-sort:hover { color: var(--text-primary); }
.adm-sort.is-on { color: var(--sec); }
.adm-sort:focus-visible { outline: 2px solid var(--sec); outline-offset: 2px; border-radius: 4px; }
.adm-sort-mark { font-size: 0.6rem; min-width: 0.6rem; }
th.adm-num .adm-sort { flex-direction: row-reverse; }
.adm-person { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; }
.adm-person-name { font-weight: 600; overflow-wrap: anywhere; }
.adm-mono { flex: 0 0 auto; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; background: var(--sec-soft); color: var(--sec); font-weight: 700; font-size: 0.85rem; }
.adm-email { color: var(--text-secondary); overflow-wrap: anywhere; }
.adm-actions { white-space: nowrap; text-align: right; }
.adm-actions .btn + .btn { margin-left: 0.35rem; }
/* 25 bright gradient buttons in a column shout; in the table the row actions stay quiet, in the room's colour. */
.adm-table .btn-grant-credits { background: var(--sec-soft); color: var(--sec); box-shadow: inset 0 0 0 1px var(--sec-line); }
.adm-table .btn-grant-credits:hover { background: var(--sec); color: var(--bg-base); box-shadow: none; transform: none; animation: none; }
.adm-table .btn:focus-visible, .adm-drawer .btn:focus-visible { outline: 2px solid var(--sec); outline-offset: 2px; }
.adm-pager { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin-top: 1rem; }
.adm-pager:empty { display: none; }
.adm-pager-where { color: var(--text-secondary); font-size: 0.86rem; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .adm-sort-phone { display: block; flex: 0 0 auto; }
  .adm-sort-phone select { padding: 0.55rem 0.7rem; }
  .adm-search { flex-basis: 100%; max-width: none; }
  .adm-count { margin-left: 0; flex-basis: 100%; }
  .adm-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .adm-table, .adm-table tbody { display: block; }
  .adm-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 0.75rem; padding: 0.9rem 1rem; margin-bottom: 0.65rem;
    border: 1px solid var(--border-color); border-left: 3px solid var(--sec); border-radius: var(--radius-sm); background: var(--adm-panel-bg); }
  .adm-table tbody tr:hover { background: var(--adm-panel-bg); }
  .adm-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .adm-table td[data-label="Name"], .adm-table td[data-label="Email"], .adm-table td.adm-actions { grid-column: 1 / -1; }
  .adm-table td[data-label="Email"] { margin: -0.2rem 0 0.25rem 2.5rem; font-size: 0.84rem; }
  .adm-table td[data-label="Role"]::before, .adm-table td[data-label="Plan"]::before,
  .adm-table td[data-label="Credits"]::before, .adm-table td[data-label="Joined"]::before {
    content: attr(data-label); display: block; font-size: 0.74rem; color: var(--text-tertiary); }
  .adm-table .adm-num { text-align: left; font-weight: 700; }
  .adm-table td.adm-actions { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
  .adm-actions .btn { flex: 1; justify-content: center; }
  .adm-actions .btn + .btn { margin-left: 0; }
}

/* Side panel with one user's credit history (full screen on a phone). Under dialogs (z 200), over the header (z 100). */
.adm-drawer-wrap { position: fixed; inset: 0; z-index: 150; }
.adm-drawer-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.adm-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(500px, 100%); overflow-y: auto; padding: 1.25rem 1.35rem 2rem;
  background: var(--adm-drawer-bg); border-left: 4px solid var(--sec); box-shadow: var(--shadow-lg); animation: admDrawerIn 0.22s var(--ease) both; }
@keyframes admDrawerIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.adm-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.adm-drawer-head h3 { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.25; overflow-wrap: anywhere; }
.adm-drawer-sub { color: var(--text-secondary); font-size: 0.86rem; overflow-wrap: anywhere; }
.adm-drawer-balance { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.6rem; margin: 1.1rem 0 1.4rem; padding: 0.9rem 1rem;
  border-radius: var(--radius-sm); background: var(--sec-soft); color: var(--text-secondary); font-size: 0.9rem; }
.adm-drawer-balance .btn { margin-left: auto; }
.adm-drawer-num { font-size: 1.7rem; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.adm-drawer-label { font-size: 1rem; font-weight: 650; margin-bottom: 0.4rem; }
.adm-drawer .lg-day-head { position: sticky; top: -1.25rem; background: var(--adm-drawer-bg); z-index: 1; }
@media (prefers-reduced-motion: reduce) { .adm-drawer { animation: none; } }
