/* ════════════════════════════════════════════════════════════════════════════
   ADMIN PAGE — Sci-Fi HUD Theme
   ════════════════════════════════════════════════════════════════════════════ */

#adminPage {
  --adm-bg: #060810;
  --adm-bg2: #0a1020;
  --adm-glass: rgba(8, 14, 28, 0.78);
  --adm-border: rgba(0, 229, 255, 0.28);
  --adm-border-strong: rgba(0, 229, 255, 0.45);
  --adm-cyan: #00e5ff;
  --adm-blue: #4fc3f7;
  --adm-violet: #b388ff;
  --adm-purple: #7c4dff;
  --adm-text: #e8fbff;
  --adm-muted: rgba(126, 234, 255, 0.62);
  --adm-gold: #ffd978;
  --adm-success: #00e676;
  --adm-danger: #ff6b6b;
  --adm-glow: 0 0 18px rgba(0, 229, 255, 0.22);
  min-height: 100vh;
  padding: 20px 20px 40px;
  box-sizing: border-box;
  color: var(--adm-text);
  background:
    linear-gradient(180deg, rgba(6, 8, 16, 0.92) 0%, rgba(0, 80, 160, 0.08) 40%, rgba(6, 8, 16, 0.96) 100%),
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0, 229, 255, 0.08), transparent 60%),
    var(--adm-bg);
}

#adminPage .admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--adm-border-strong);
  box-shadow: 0 1px 0 rgba(124, 77, 255, 0.12);
}

#adminPage .admin-header h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, var(--adm-cyan), var(--adm-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.35));
}

#adminPage .admin-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#adminPage #adminEmailDisplay {
  color: var(--adm-muted) !important;
  font-size: 14px;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.15);
}

#adminPage .logout-btn {
  padding: 10px 16px;
  border: 1px solid rgba(255, 77, 77, 0.55);
  border-radius: 10px;
  background: rgba(255, 77, 77, 0.12);
  color: #ffb3b3;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.25s ease;
  box-shadow: 0 0 12px rgba(255, 77, 77, 0.12);
}

#adminPage .logout-btn:hover {
  background: rgba(255, 77, 77, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(255, 77, 77, 0.25);
}

#adminPage .admin-btn-god {
  border-color: rgba(124, 77, 255, 0.65) !important;
  background: rgba(124, 77, 255, 0.18) !important;
  color: #dcc8ff !important;
  box-shadow: 0 0 14px rgba(124, 77, 255, 0.2) !important;
}

#adminPage .admin-btn-publish {
  border-color: rgba(0, 230, 118, 0.6) !important;
  background: rgba(0, 230, 118, 0.14) !important;
  color: #9dffc8 !important;
  box-shadow: 0 0 14px rgba(0, 230, 118, 0.18) !important;
}

#adminPage .admin-btn-system-gate {
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

#adminPage .admin-btn-system-gate.is-open {
  border-color: rgba(0, 230, 118, 0.7) !important;
  background: rgba(0, 230, 118, 0.18) !important;
  color: #9dffc8 !important;
  box-shadow: 0 0 14px rgba(0, 230, 118, 0.22) !important;
}

#adminPage .admin-btn-system-gate.is-closed {
  border-color: rgba(255, 77, 77, 0.75) !important;
  background: rgba(255, 60, 60, 0.2) !important;
  color: #ffb3b3 !important;
  box-shadow: 0 0 14px rgba(255, 70, 70, 0.28) !important;
}

#adminPage .stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

#adminPage .stat-card {
  background: var(--adm-glass);
  border: 1px solid var(--adm-border);
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--adm-glow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#adminPage .stat-value {
  color: #f4ffff;
  font-size: clamp(28px, 4.2vw, 36px);
  font-weight: 900;
  margin-bottom: 8px;
  min-height: 36px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

#adminPage .stat-spinner {
  width: 28px;
  height: 28px;
  box-sizing: border-box;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex: 0 0 auto;
}

#adminPage .stat-label {
  color: var(--adm-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

#adminPage .admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.18);
  padding-bottom: 10px;
  flex-wrap: wrap;
}

#adminPage .admin-tab {
  padding: 10px 16px;
  background: rgba(8, 14, 28, 0.65);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 10px;
  color: var(--adm-muted);
  cursor: pointer;
  transition: 0.25s ease;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#adminPage .admin-tab:hover {
  border-color: var(--adm-border-strong);
  color: var(--adm-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.15);
}

#adminPage .admin-tab.active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.22), rgba(124, 77, 255, 0.28));
  color: #fff;
  border-color: var(--adm-cyan);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.28);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.35);
}

.display-sandbox-exit {
  display: none;
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 200000;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  background: rgba(8, 14, 28, 0.92);
  color: #e8fbff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  pointer-events: auto;
}

html.display-sandbox .display-sandbox-exit {
  display: block;
}

html.display-sandbox .display-sandbox-exit[hidden] {
  display: none;
}

#adminPage .tab-content {
  display: none;
}

#adminPage .tab-content.active {
  display: block;
  animation: adminFadeIn 0.35s ease;
}

@keyframes adminFadeIn {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}

#adminPage .panel {
  background: var(--adm-glass);
  border: 1px solid var(--adm-border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--adm-glow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#adminPage .panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--adm-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

#adminPage .panel p,
#adminPage .indigenous-hint {
  color: var(--adm-muted) !important;
}

#adminPage .formula-box {
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  color: var(--adm-blue);
  font-size: 14px;
  box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.05);
}

#adminPage .search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

#adminPage .search-bar input {
  flex: 1;
  min-width: 180px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 10px;
  color: var(--adm-text);
  font-size: 15px;
  box-sizing: border-box;
}

#adminPage .search-bar input:focus {
  border-color: var(--adm-cyan);
  outline: none;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.22);
}

#adminPage .btn {
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.25s ease;
  letter-spacing: 0.02em;
}

#adminPage .btn:hover {
  transform: translateY(-1px);
}

#adminPage .btn-gold {
  background: linear-gradient(135deg, var(--adm-cyan), var(--adm-purple));
  color: #fff;
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.22);
}

#adminPage .btn-success {
  background: rgba(0, 230, 118, 0.16);
  color: #9dffc8;
  border-color: rgba(0, 230, 118, 0.45);
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.15);
}

#adminPage .btn-blue {
  background: rgba(79, 195, 247, 0.14);
  color: var(--adm-blue);
  border-color: rgba(79, 195, 247, 0.45);
}

#adminPage .btn-danger {
  background: rgba(255, 77, 77, 0.14);
  color: #ffb3b3;
  border-color: rgba(255, 77, 77, 0.45);
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.12);
}

#adminPage .btn-orange {
  background: rgba(255, 152, 0, 0.14);
  color: #ffd59a;
  border-color: rgba(255, 152, 0, 0.45);
}

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

#adminPage .btn-add {
  margin-top: 14px;
  width: 100%;
}

#adminPage .form-group {
  margin-bottom: 14px;
}

#adminPage .form-group label {
  display: block;
  color: var(--adm-blue) !important;
  font-size: 13px;
  margin-bottom: 6px;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.18);
}

#adminPage .form-group input,
#adminPage .form-group select,
#adminPage .panel input[type="text"],
#adminPage .panel input[type="number"],
#adminPage .panel input[type="email"],
#adminPage .panel input[type="password"],
#adminPage .panel select {
  width: 100%;
  padding: 11px 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 10px;
  color: var(--adm-text);
  font-size: 15px;
  box-sizing: border-box;
}

#adminPage .form-group input:focus,
#adminPage .form-group select:focus,
#adminPage .panel input:focus,
#adminPage .panel select:focus {
  border-color: var(--adm-cyan);
  outline: none;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.22);
}

#adminPage .form-group input::placeholder,
#adminPage .panel input::placeholder {
  color: rgba(126, 234, 255, 0.35);
}

#adminPage .admin-inline-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

#adminPage .admin-inline-row label {
  color: var(--adm-blue) !important;
  font-weight: 600;
  white-space: nowrap;
}

#adminPage .admin-inline-row input[type="number"] {
  width: 120px;
  max-width: 100%;
}

#adminPage .admin-inline-row span {
  color: var(--adm-muted) !important;
}

#adminPage .admin-label-gold {
  color: var(--adm-gold) !important;
  text-shadow: 0 0 8px rgba(255, 217, 120, 0.25);
}

#adminPage .admin-label-danger {
  color: #ff9a9a !important;
}

#adminPage .admin-label-rtp {
  color: var(--adm-violet) !important;
  font-weight: 700;
}

#adminPage input[type="range"] {
  width: 100%;
  accent-color: var(--adm-cyan);
}

#adminPage .admin-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}

#adminPage .admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

#adminPage .admin-save-row {
  text-align: center;
  margin-top: 8px;
}

#adminPage .gift-form,
#adminPage .ban-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  align-items: end;
}

#adminPage table {
  border-collapse: separate;
  border-spacing: 0;
}

#adminPage th {
  background: rgba(0, 229, 255, 0.08) !important;
  color: var(--adm-cyan) !important;
  border-bottom: 1px solid rgba(0, 229, 255, 0.28) !important;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

#adminPage td {
  color: var(--adm-text);
  border-bottom: 1px solid rgba(0, 229, 255, 0.1) !important;
  font-size: 14px;
}

#adminPage tr:hover td {
  background: rgba(0, 229, 255, 0.04);
}

#adminPage .player-lock-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  background: rgba(8, 14, 28, 0.8);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--adm-muted);
}

#adminPage .player-lock-btn.is-unlocked {
  border-color: rgba(0, 230, 118, 0.55);
  background: rgba(0, 230, 118, 0.12);
  color: #9dffc8;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.2);
}

#adminPage input.asset-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

#adminPage .player-row-locked td {
  opacity: 0.88;
}

#adminPage .presence-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

#adminPage .presence-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

#adminPage .presence-status.is-online {
  color: #9dffc8;
}

#adminPage .presence-status.is-online .presence-dot {
  background: var(--adm-success);
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.75);
}

#adminPage .presence-status.is-offline {
  color: #ffb3b3;
}

#adminPage .presence-status.is-offline .presence-dot {
  background: var(--adm-danger);
  box-shadow: 0 0 8px rgba(255, 77, 77, 0.65);
}

#adminPage .history-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 3fr 1fr;
  gap: 10px;
  padding: 12px;
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 10px;
  margin-bottom: 10px;
  font-weight: 700;
  color: var(--adm-cyan);
}

#adminPage #historyList {
  max-height: 500px;
  overflow-y: auto;
}

#adminPage #historyList > div[style*="text-align: center"] {
  color: var(--adm-muted) !important;
}

#adminPage .admin-indigenous-cell {
  min-width: 220px;
  max-width: 300px;
  vertical-align: top;
}

#adminPage .admin-indigenous-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  margin: 0 0 8px;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
}

#adminPage .admin-indigenous-dot.state-on {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.65);
  border-color: #86efac;
}

#adminPage .admin-indigenous-dot.state-off {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.55);
  border-color: #fca5a5;
}

#adminPage .admin-indigenous-dot:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#adminPage .admin-indigenous-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

#adminPage .admin-indigenous-name-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

#adminPage .admin-indigenous-name-input {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.45) !important;
  color: var(--adm-text) !important;
  border: 1px solid rgba(0, 229, 255, 0.22) !important;
  border-radius: 8px;
  padding: 8px;
  box-sizing: border-box;
  font-size: 12px;
}

#adminPage .admin-indigenous-off {
  color: var(--adm-muted) !important;
  font-size: 12px;
}

#adminPage .admin-table-spaced {
  margin-top: 12px;
}

@media (max-width: 768px) {
  #adminPage {
    padding: 14px 12px 32px;
  }

  #adminPage .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  #adminPage .admin-tabs {
    gap: 6px;
  }

  #adminPage .admin-tab {
    padding: 8px 12px;
    font-size: 12px;
  }

  #adminPage .search-bar {
    flex-direction: column;
  }

  #adminPage .gift-form,
  #adminPage .ban-form,
  #adminPage .admin-grid-4,
  #adminPage .admin-grid-2 {
    grid-template-columns: 1fr;
  }

  #adminPage .history-header {
    grid-template-columns: 1fr;
    font-size: 12px;
  }
}
