/* ── VARIABLES ──────────────────────────────────────────────────────────── */
:root {
  --bg:           #080810;
  --surface:      #10101e;
  --surface-2:    #181830;
  --surface-3:    #1e1e38;
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.15);

  --primary:      #7c3aed;
  --primary-dim:  rgba(124,58,237,0.15);
  --primary-hover:#6d28d9;

  --cyan:    #06b6d4;
  --cyan-dim: rgba(6,182,212,0.15);
  --green:   #10b981;
  --green-dim: rgba(16,185,129,0.15);
  --amber:   #f59e0b;
  --amber-dim: rgba(245,158,11,0.15);
  --red:     #ef4444;
  --red-dim: rgba(239,68,68,0.15);
  --blue:    #3b82f6;
  --blue-dim: rgba(59,130,246,0.15);

  --text:      #e2e8f0;
  --text-muted:#64748b;
  --text-dim:  #94a3b8;

  --sidebar-w: 240px;
  --radius:    12px;
  --radius-sm: 8px;

  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.18s ease;
}

/* ── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
input, button { font-family: inherit; }
h1,h2,h3,h4 { font-family: 'Space Grotesk', sans-serif; }

/* ── SCROLLBAR ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════════════════════════════════════════ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

.login-bg {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 20%, rgba(124,58,237,0.18) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(6,182,212,0.12) 0%, transparent 60%),
              var(--bg);
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.login-orb--1 {
  width: 500px; height: 500px;
  top: -100px; left: -100px;
  background: rgba(124,58,237,0.15);
  animation: orb-drift 12s ease-in-out infinite alternate;
}
.login-orb--2 {
  width: 400px; height: 400px;
  bottom: -80px; right: -80px;
  background: rgba(6,182,212,0.1);
  animation: orb-drift 16s ease-in-out infinite alternate-reverse;
}
@keyframes orb-drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(40px,30px) scale(1.1); }
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(124,58,237,0.1);
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-icon {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px rgba(124,58,237,0.5));
}
.login-logo h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #c084fc, #67e8f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-logo p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── FORM ── */
.input-group {
  margin-bottom: 16px;
}
.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.input-group input,
.modal-body input,
.modal-body select {
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  padding: 11px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.input-group input:focus,
.modal-body input:focus,
.modal-body select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.error-msg {
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 13px;
  padding: 10px 12px;
  margin-bottom: 14px;
  display: none;
}
.error-msg.visible { display: block; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 18px;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--surface-3);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 13px;
}
.btn-ghost:hover { color: var(--text); background: var(--surface-3); }

.btn-full { width: 100%; }

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-danger  { background: var(--red-dim); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.btn-success { background: var(--green-dim); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.btn-warn    { background: var(--amber-dim); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }

.btn-danger:hover  { background: rgba(239,68,68,0.25); }
.btn-success:hover { background: rgba(16,185,129,0.25); }
.btn-warn:hover    { background: rgba(245,158,11,0.25); }

.btn-outline {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--border-hover); color: var(--text); background: var(--surface-3); }

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN LAYOUT
═══════════════════════════════════════════════════════════════════════════ */
.admin-page {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-icon { font-size: 26px; }
.sidebar-logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #c084fc, #67e8f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}
.nav-item:hover {
  background: var(--surface-3);
  color: var(--text);
}
.nav-item.active {
  background: var(--primary-dim);
  color: #c084fc;
}
.nav-icon { font-size: 18px; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-logout:hover {
  background: var(--red-dim);
  border-color: rgba(239,68,68,0.3);
  color: #fca5a5;
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  background: rgba(8,8,16,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  display: none;
}
.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ── SECTIONS ── */
.content-section {
  display: none;
  padding: 28px;
  flex: 1;
}
.content-section.active { display: block; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.mt-6 { margin-top: 24px; }

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color var(--transition), transform var(--transition);
}
.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.stat-icon--blue   { background: var(--blue-dim); }
.stat-icon--green  { background: var(--green-dim); }
.stat-icon--purple { background: var(--primary-dim); }
.stat-icon--red    { background: var(--red-dim); }
.stat-icon--amber  { background: var(--amber-dim); }
.stat-icon--cyan   { background: var(--cyan-dim); }

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text);
  white-space: nowrap;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── TABLE ── */
.table-wrapper {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
}
.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table td {
  padding: 12px 16px;
  color: var(--text-dim);
  white-space: nowrap;
}
.data-table td:first-child { color: var(--text); }

.loading-row {
  text-align: center;
  color: var(--text-muted) !important;
  padding: 40px 0 !important;
  font-style: italic;
}

/* ── RANK BADGE ── */
.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.rank-bronze   { background: rgba(180,100,50,0.2);  color: #cd7f32; border: 1px solid rgba(205,127,50,0.3); }
.rank-silver   { background: rgba(160,160,160,0.15); color: #a0a0a0; border: 1px solid rgba(160,160,160,0.3); }
.rank-gold     { background: rgba(255,200,0,0.15);  color: #ffd700; border: 1px solid rgba(255,215,0,0.3); }
.rank-elite    { background: rgba(6,182,212,0.15);  color: #67e8f9; border: 1px solid rgba(6,182,212,0.3); }
.rank-legendary{ background: rgba(245,158,11,0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }

/* ── STATUS BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-vip    { background: var(--cyan-dim);    color: #67e8f9; border: 1px solid rgba(6,182,212,0.3); }
.badge-admin  { background: var(--primary-dim); color: #c084fc; border: 1px solid rgba(124,58,237,0.3); }
.badge-banned { background: var(--red-dim);     color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.badge-normal { background: var(--surface-3);   color: var(--text-muted); border: 1px solid var(--border); }

/* ── POSITION MEDALS ── */
.pos-medal-1 { color: #ffd700; font-weight: 700; }
.pos-medal-2 { color: #c0c0c0; font-weight: 700; }
.pos-medal-3 { color: #cd7f32; font-weight: 700; }

/* ── SEARCH ── */
.search-box input {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 8px 14px;
  width: 260px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

/* ── PAGINATION ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pagination .page-info {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}
.page-btn {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover { background: var(--surface-2); color: var(--text); }
.page-btn.active { background: var(--primary-dim); color: #c084fc; border-color: rgba(124,58,237,0.3); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── ACTIONS ── */
.action-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  transform: scale(0.95);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.modal-field label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.modal-user-info {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.modal-user-info .user-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.modal-user-info .user-id {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
  user-select: none;
}
.toggle-row:has(.toggle:checked) {
  border-color: rgba(99,179,237,0.45);
  background: rgba(99,179,237,0.07);
}
.toggle-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
}
.toggle-row label::before {
  content: attr(data-icon);
  font-size: 15px;
}

/* pill switch */
.toggle {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 24px;
  background: var(--surface-3);
  border-radius: 99px;
  border: 2px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: background .2s, border-color .2s;
  flex: 0 0 44px;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #6b7a99;
  transition: transform .2s, background .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.toggle:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.toggle:checked::after {
  transform: translateX(20px);
  background: #fff;
}
.toggle--danger:checked {
  background: #e05252;
  border-color: #e05252;
}
.toggle-row--danger:has(.toggle:checked) {
  border-color: rgba(224,82,82,0.45);
  background: rgba(224,82,82,0.07);
}
.toggle--admin:checked {
  background: #f59e0b;
  border-color: #f59e0b;
}
.toggle-row--admin:has(.toggle:checked) {
  border-color: rgba(245,158,11,0.45);
  background: rgba(245,158,11,0.07);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* ── CARD HEADER ACTIONS ── */
.card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── LOGOUT TOP (mobile) ── */
.btn-logout-top {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background var(--transition);
}
.btn-logout-top:hover { background: var(--surface-3); }

/* ── BOTTOM NAV ── */
.bottom-nav {
  display: none;
}

/* ── USER CARDS (mobile) ── */
.user-cards { display: none; }

.user-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.user-card:last-child { border-bottom: none; }

.user-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.user-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.user-card-id {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
  margin-top: 2px;
}
.user-card-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.user-card-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.user-card-stat-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
}
.user-card-stat-lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.user-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.user-card-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.user-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── SIDEBAR BACKDROP ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-backdrop.visible { display: block; }

/* ── DESKTOP ONLY / MOBILE ONLY ── */
.mobile-only { display: none; }
.desktop-only { display: block; }

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET
══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 48px rgba(0,0,0,0.7);
  }
  .sidebar-toggle { display: block; }
  .main-content {
    margin-left: 0;
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }
  .content-section { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .card-header-actions { width: 100%; }
  .search-box { flex: 1; }
  .search-box input { width: 100%; }

  /* modal — bottom sheet */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
  }
  .modal-body { flex: 1; overflow-y: auto; }
  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .modal-footer .btn { width: 100%; justify-content: center; padding: 14px; font-size: 15px; }

  /* bottom nav */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(16,16,30,0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 0;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav-item.active { color: #c084fc; }
  .bottom-nav-item.active .bottom-nav-icon { filter: drop-shadow(0 0 6px rgba(192,132,252,0.7)); }
  .bottom-nav-icon { font-size: 22px; line-height: 1; }
  .bottom-nav-label { font-size: 10px; font-weight: 600; letter-spacing: .3px; }

  /* user list: cards on mobile */
  .mobile-only { display: block; }
  .desktop-only { display: none; }

  /* top bar logout icon */
  .btn-logout-top { display: flex; align-items: center; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
══════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; font-size: 18px; }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 11px; }

  .login-card { padding: 32px 20px 28px; margin: 16px; }
  .toggle-row label { font-size: 12px; }

  .top-bar { padding: 12px 16px; }
  .page-title { font-size: 16px; }
  .content-section { padding: 12px; }

  .card-header { padding: 14px 14px; }
  .card-header h3 { font-size: 14px; }
}
