/* ── Auth pages (login + admin) ─────────────────────────────── */

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  overflow: auto;
  background:
    radial-gradient(ellipse at 18% 65%, rgba(124,108,248,0.09) 0%, transparent 52%),
    radial-gradient(ellipse at 82% 18%, rgba(232,100,122,0.07) 0%, transparent 46%),
    var(--bg-base);
  background-attachment: fixed;
  position: relative;
}

.auth-body--wide {
  align-items: flex-start;
  justify-content: flex-start;
}

/* Animated background rings */
.auth-bg {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ring-pulse 4s ease-in-out infinite;
}

.bg-ring-1 { width: 400px; height: 400px; opacity: 0.06; animation-delay: 0s; }
.bg-ring-2 { width: 650px; height: 650px; opacity: 0.04; animation-delay: 1s; }
.bg-ring-3 { width: 900px; height: 900px; opacity: 0.02; animation-delay: 2s; }

.auth-bg-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
}

/* ── Auth card ───────────────────────────────────────────────── */
.auth-card {
  position: relative;
  z-index: 1;
  width: calc(100% - 32px);
  max-width: 380px;
  /* Liquid glass card */
  background:
    linear-gradient(160deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.02) 100%),
    rgba(11,11,14,0.72);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.10) inset,
    0 24px 64px rgba(0,0,0,0.50),
    0 0 0 1px rgba(255,255,255,0.04);
}

[data-theme="light"] .auth-card {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.90) 0%, rgba(255,255,255,0.72) 100%);
  border-color: rgba(255,255,255,0.75);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.95) inset,
    0 24px 64px rgba(0,0,0,0.10);
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  text-align: center;
}

/* ── Big animated hex ── */
.auth-hex-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-hex-icon {
  font-size: 72px;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: auth-hex-glow 4s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes auth-hex-glow {
  0%, 100% { filter: drop-shadow(0 0 8px  rgba(124,108,248,0.55)) drop-shadow(0 0 24px rgba(124,108,248,0.20)); }
  50%       { filter: drop-shadow(0 0 14px rgba(232,100,122,0.65)) drop-shadow(0 0 32px rgba(232,100,122,0.22)); }
}

/* Two orbiting dots — opposite directions, different speeds */
.auth-orbit-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  margin: -3.5px 0 0 -3.5px;
}

.auth-orbit-dot--1 {
  background: var(--accent);
  box-shadow: 0 0 8px 3px rgba(124,108,248,0.7), 0 0 20px 6px rgba(124,108,248,0.2);
  animation: auth-orbit-cw 3.8s linear infinite;
}

.auth-orbit-dot--2 {
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  background: var(--accent-2);
  box-shadow: 0 0 8px 3px rgba(232,100,122,0.7), 0 0 18px 5px rgba(232,100,122,0.2);
  animation: auth-orbit-ccw 5.2s linear infinite;
}

@keyframes auth-orbit-cw {
  from { transform: rotate(0deg)   translateX(44px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(44px) rotate(-360deg); }
}

@keyframes auth-orbit-ccw {
  from { transform: rotate(0deg)    translateX(38px) rotate(0deg); }
  to   { transform: rotate(-360deg) translateX(38px) rotate(360deg); }
}

/* Logo wordmark below hex */
.auth-logo-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.8px;
}

.logo-accent { color: var(--accent); }

.auth-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Alerts ─────────────────────────────────────────────────── */
.auth-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 18px;
}

.auth-alert svg { width: 15px; height: 15px; flex-shrink: 0; }

.auth-alert--error {
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.25);
  color: #ff6b6b;
}

.auth-alert--success {
  background: rgba(52, 199, 89, 0.1);
  border: 1px solid rgba(52, 199, 89, 0.25);
  color: #4cd97b;
}

/* ── Form fields ─────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 16px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-group { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.field-input {
  height: 40px;
  padding: 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field-input::placeholder { color: var(--text-muted); }

.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.auth-btn {
  height: 44px;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 14px var(--accent-glow);
  cursor: pointer;
  width: 100%;
}

.auth-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--accent-glow);
}

.auth-btn:active { transform: translateY(0); }

.auth-btn--sm { height: 36px; font-size: 13px; }

.auth-footer {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

@media (max-width: 600px) {
  .admin-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card   { padding: 12px; gap: 10px; }
  .stat-value  { font-size: 20px; }
  .stat-label  { font-size: 10px; }
  .stat-icon   { width: 30px; height: 30px; }
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
  .auth-hex-icon { font-size: 60px; }
  .auth-hex-wrap { width: 66px; height: 66px; }
  .auth-orbit-dot--1 { animation-name: auth-orbit-cw-sm; }
  .auth-orbit-dot--2 { animation-name: auth-orbit-ccw-sm; }

  @keyframes auth-orbit-cw-sm {
    from { transform: rotate(0deg)   translateX(36px) rotate(0deg); }
    to   { transform: rotate(360deg) translateX(36px) rotate(-360deg); }
  }
  @keyframes auth-orbit-ccw-sm {
    from { transform: rotate(0deg)    translateX(30px) rotate(0deg); }
    to   { transform: rotate(-360deg) translateX(30px) rotate(360deg); }
  }
}

/* ── Admin: animated logo (small) ───────────────────────────── */
.logo-icon-wrap-sm {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon-sm {
  font-size: 20px;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logo-glow-pulse 4s ease-in-out infinite;
}

@keyframes logo-glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(124,108,248,0.5)); }
  50%       { filter: drop-shadow(0 0 8px rgba(232,100,122,0.6)); }
}

.logo-orbit-dot-sm {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 5px 2px rgba(232,100,122,0.75);
  top: 50%; left: 50%;
  margin: -2px 0 0 -2px;
  animation: logo-orbit-sm 3.6s linear infinite;
}

@keyframes logo-orbit-sm {
  0%   { transform: rotate(0deg)   translateX(13px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(13px) rotate(-360deg); }
}

.logo-text-sm {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* ── Admin shell ─────────────────────────────────────────────── */
.admin-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(124,108,248,0.10);
  border: 1px solid rgba(124,108,248,0.30);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  box-shadow: 0 0 10px rgba(124,108,248,0.12);
}

.admin-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.admin-link:hover { color: var(--text-primary); }

/* ── Stat cards ──────────────────────────────────────────────── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 100%),
    rgba(11,11,14,0.68);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, var(--shadow-md);
  overflow: hidden;
}

[data-theme="light"] .stat-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.88) 0%, rgba(255,255,255,0.70) 100%);
  border-color: rgba(255,255,255,0.72);
}

.stat-card--online {
  border-color: rgba(48,209,88,0.20);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 0 20px rgba(48,209,88,0.06), var(--shadow-md);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(124,108,248,0.10);
  border: 1px solid rgba(124,108,248,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.stat-icon svg { width: 16px; height: 16px; }

.stat-card--online .stat-icon {
  background: rgba(48,209,88,0.10);
  border-color: rgba(48,209,88,0.20);
  color: var(--beta-green);
}

.stat-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text-primary);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

.stat-live-dot {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--beta-green);
  box-shadow: 0 0 6px var(--beta-green);
  animation: pulse-badge 1.8s ease-in-out infinite;
}

.admin-body { display: flex; flex-direction: column; gap: 16px; }

.admin-card {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 100%),
    rgba(11,11,14,0.68);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, var(--shadow-md);
}

[data-theme="light"] .admin-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.88) 0%, rgba(255,255,255,0.70) 100%);
  border-color: rgba(255,255,255,0.72);
  box-shadow: 0 1px 0 rgba(255,255,255,0.95) inset, var(--shadow-md);
}

.admin-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 1px 7px;
  font-weight: 500;
}

/* ── User table ──────────────────────────────────────────────── */
.user-table { display: flex; flex-direction: column; gap: 2px; }

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.user-row:hover { background: var(--bg-hover); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }

.user-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.user-name { font-size: 14px; font-weight: 500; }

.user-online-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--beta-green);
  background: rgba(48,209,88,0.10);
  border: 1px solid rgba(48,209,88,0.25);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
}

.user-online-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--beta-green);
  box-shadow: 0 0 4px var(--beta-green);
  animation: pulse-badge 1.8s ease-in-out infinite;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.user-meta-ip { gap: 5px; }

.user-ip-chip {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.3px;
}

.delete-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}

.delete-btn:hover {
  background: rgba(255, 59, 48, 0.12);
  color: var(--live-red);
}

.delete-btn svg { width: 14px; height: 14px; }
