﻿/* Full-screen "software users" management for the main administrator. */
.admin-users-sheet {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  flex-direction: column;
  background: radial-gradient(900px 520px at 18% -12%, #17171d 0%, transparent 62%), var(--bg);
}
.admin-users-sheet.is-active { display: flex !important; }

/* The page wrapper owns its own stacking context (z-index: 1), so lift it above
   the fixed site header while the sheet is open. */
body.au-sheet-open .page.app { z-index: 200; }
body.au-sheet-open { overflow: hidden; }

/* ---------- top bar ---------- */
.au-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px clamp(16px, 2.6vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(16px);
}
.au-head__left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.au-head__title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.au-eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.au-head__title h2 {
  margin: 0;
  font-size: clamp(17px, 1.5vw, 21px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.au-head__tools { display: flex; align-items: center; gap: 10px; flex: 1 1 320px; justify-content: flex-end; }
.au-search { flex: 1 1 240px; max-width: 420px; }
.au-head__tools .btn, .au-search .input { min-height: 40px; }
.au-search .input { width: 100%; }

/* ---------- body ---------- */
.au-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: clamp(14px, 1.8vw, 24px) clamp(16px, 2.6vw, 36px) 40px;
}
.au-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.au-stat {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--grad-soft);
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.au-stat b { font-size: 20px; font-weight: 600; color: var(--text); line-height: 1.2; }
.au-stat span { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.au-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.au-filters label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.au-filters .input { min-height: 36px; padding: 6px 10px; min-width: 150px; }

/* ---------- table ---------- */
.au-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: auto;
  background: rgba(17, 17, 20, 0.55);
}
.au-table { width: 100%; border-collapse: collapse; min-width: 820px; font-size: 13px; }
.au-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: #0f0f13;
  border-bottom: 1px solid var(--line);
}
.au-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.au-table tbody tr:last-child td { border-bottom: 0; }
.au-table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.au-table .au-col-actions { text-align: right; }

.au-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.au-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.au-user__meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.au-user__meta strong { font-weight: 500; color: var(--text); }
.au-user__meta small { font-size: 11px; color: var(--muted); }

.au-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.au-chip {
  font-size: 11px;
  line-height: 1.5;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.au-chip--on { color: var(--text); border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.06); }

.au-hwid {
  display: inline-block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
}
.au-activity { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.au-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); opacity: 0.45; flex: 0 0 auto; }
.au-dot--on { background: #7ee39a; opacity: 1; box-shadow: 0 0 0 3px rgba(126, 227, 154, 0.14); }

.au-row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.au-row-actions .btn { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.au-empty { padding: 44px 16px; text-align: center; color: var(--muted); }

/* ---------- full-screen user card ---------- */
.au-detail {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  flex-direction: column;
  background: radial-gradient(900px 520px at 18% -12%, #17171d 0%, transparent 62%), var(--bg);
}
.au-detail.is-active { display: flex; }
.au-detail__head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px clamp(16px, 2.6vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(16px);
}
.au-detail__head h3 { margin: 0; font-size: 18px; font-weight: 600; color: var(--text); }
.au-detail__sub { margin: 0; font-size: 12px; color: var(--muted); }
.au-detail__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.au-detail__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: clamp(14px, 1.8vw, 24px) clamp(16px, 2.6vw, 36px) 48px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
}
.au-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--grad-soft);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.au-card { grid-column: span 4; }
.au-card--half { grid-column: span 6; }
.au-card--wide { grid-column: 1 / -1; }
.au-card > h4 {
  margin: 0;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.au-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.au-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 16px; margin: 0; font-size: 13px; }
.au-kv dt { color: var(--muted); font-size: 12px; }
.au-kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.au-kv dd code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }

.au-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 10px; }
.au-metric { border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 12px; background: rgba(255, 255, 255, 0.02); }
.au-metric b { display: block; font-size: 17px; font-weight: 600; color: var(--text); }
.au-metric span { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.au-game-row { display: grid; grid-template-columns: 108px minmax(0, 1fr) minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.au-game-row:last-child { border-bottom: 0; }
.au-game-row strong { min-width: 108px; font-weight: 500; }
.au-game-row .btn { min-height: 32px; padding: 5px 11px; font-size: 12px; }
.au-game-row code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.au-game-row code.au-game-key { color: var(--muted); }

/* Per-game device binds inside the admin user card. */
.au-devices { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.au-device-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.au-device-row:last-child { border-bottom: 0; }
.au-device-row--head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); }
.au-device-row strong { font-weight: 500; }
.au-device-row code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.au-device-key { color: var(--muted); }

.au-card .admin-sessions { max-height: 430px; overflow: auto; padding-right: 4px; }
.au-apps { max-height: 260px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 2px 16px; }
.au-apps div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.au-apps span { color: var(--muted); }
.au-hint { margin: 0; font-size: 12px; color: var(--muted); }

@media (max-width: 1180px) {
  .au-card { grid-column: span 6; }
}
@media (max-width: 860px) {
  .au-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .au-detail__body { grid-template-columns: minmax(0, 1fr); }
  .au-card, .au-card--half { grid-column: 1 / -1; }
  .au-head__tools { flex: 1 1 100%; justify-content: flex-start; }
  .au-detail__actions { margin-left: 0; width: 100%; }
}

.au-game-actions { display: flex; justify-content: flex-end; gap: 8px; }
.au-game-actions .btn { white-space: nowrap; }
@media (max-width: 1100px) {
  .au-game-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .au-game-row > strong, .au-game-row > code, .au-game-row > .badge { grid-column: 1; min-width: 0; }
  .au-game-row > .badge { justify-self: start; max-width: 100%; white-space: normal; }
  .au-game-actions { grid-column: 2; grid-row: 1 / span 4; flex-direction: column; align-self: center; }
  .au-game-actions .btn { max-width: 140px; white-space: normal; }
}
