/* ========================================================
   LEGEND TRICKS — BLACK GOLD V4 ADMIN CONTROL THEME
   ======================================================== */

:root {
  --bg-primary: #0b0c10;
  --bg-secondary: #13151c;
  --bg-card: #181b24;
  --bg-input: #101218;
  --border-gold: rgba(212, 175, 55, 0.28);
  --border-gold-hover: rgba(255, 215, 0, 0.6);
  --border-subtle: rgba(255, 255, 255, 0.08);

  --gold-300: #fff0a6;
  --gold-400: #ffd700;
  --gold-500: #d4af37;
  --gold-600: #b8860b;
  --gold-700: #7a5805;

  --text-primary: #f5f6fa;
  --text-muted: #8e95a5;
  --text-gold: #e8c85a;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-brand: 'Cinzel', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Background subtle gold ambient glow */
body::before {
  content: "";
  position: fixed;
  top: -150px;
  left: 20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ================= AUTH VIEW ================= */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  z-index: 10;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 38px 34px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 35px rgba(212, 175, 55, 0.12);
  text-align: center;
  animation: fadeIn 0.4s ease-out;
}

.auth-brand {
  margin-bottom: 28px;
}

.gold-crown {
  font-size: 38px;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.5));
}

.brand-title {
  font-family: var(--font-brand);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2.5px;
  background: linear-gradient(135deg, #fff0a6 0%, #ffd700 45%, #b8860b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-top: 4px;
}

.auth-form {
  text-align: left;
}

.auth-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-muted);
}

.auth-footer code {
  color: var(--gold-400);
  background: rgba(255, 215, 0, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ================= ADMIN LAYOUT ================= */
.admin-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
}

/* Top Nav */
.top-nav {
  height: 68px;
  background: rgba(19, 21, 28, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge .crown {
  font-size: 24px;
}

.brand-badge .brand-name {
  font-family: var(--font-brand);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 1.2px;
  background: linear-gradient(120deg, #fff, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  line-height: 1.1;
}

.brand-badge .brand-tag {
  font-size: 9.5px;
  letter-spacing: 1px;
  color: var(--gold-500);
  font-weight: 700;
}

.server-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--success);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  color: var(--gold-400);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.tab-badge {
  background: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 28px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(212, 175, 55, 0.15);
}

.stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon-wrap.gold { background: rgba(212, 175, 55, 0.15); border: 1px solid rgba(212, 175, 55, 0.4); }
.stat-icon-wrap.green { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.4); }
.stat-icon-wrap.blue { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.4); }
.stat-icon-wrap.amber { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.4); }
.stat-icon-wrap.orange { background: rgba(249, 115, 22, 0.15); border: 1px solid rgba(249, 115, 22, 0.4); }
.stat-icon-wrap.red { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.4); }

.stat-meta {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.stat-number {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.2;
  margin-top: 2px;
}

/* ================= CARDS & FORMS ================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

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

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.quick-gen-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}

.gen-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 140px;
}

.gen-field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0.7;
}

.input-wrap input {
  padding-left: 36px;
}

.btn-toggle-eye {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-gold {
  background: linear-gradient(135deg, #ffd700 0%, #d4af37 60%, #b8860b 100%);
  color: #120e03;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #fff0a6 0%, #ffd700 60%, #d4af37 100%);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--gold-400);
  color: var(--gold-300);
}

.btn-outline-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--danger);
  color: #fff;
}

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

.btn-block {
  width: 100%;
}

/* ================= TABLES ================= */
.table-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-muted);
}

.search-wrap input {
  padding-left: 36px;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 12px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(212, 175, 55, 0.03);
}

/* Key formatting */
.key-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold-300);
  background: rgba(212, 175, 55, 0.12);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 175, 55, 0.25);
  letter-spacing: 0.5px;
}

.btn-icon-copy {
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  font-size: 13px;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.btn-icon-copy:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-unused {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.badge-expired {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.badge-banned {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Action Dropdown / Buttons */
.action-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-500);
}

.btn-action.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  color: #f87171;
}

/* HWID cell */
.hwid-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hwid-bound {
  color: #60a5fa;
}

.hwid-unbound {
  color: #94a3b8;
  font-style: italic;
}

/* ================= MODALS ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(212, 175, 55, 0.2);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-sm {
  max-width: 440px;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--gold-300);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

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

.form-row {
  display: flex;
  gap: 14px;
}

.col-half {
  flex: 1;
}

.code-textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  background: #090a0e;
  border: 1px solid var(--border-gold);
  color: var(--gold-300);
  padding: 12px;
  border-radius: var(--radius-md);
  resize: vertical;
}

/* ================= GRID & UTILITIES ================= */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

.text-gold { color: var(--gold-400); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.divider { border: 0; border-top: 1px solid var(--border-subtle); margin: 18px 0; }

.copy-input-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.copy-input-row input {
  font-family: var(--font-mono);
  background: #0d0f15;
}

.tip-box {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.info { border-color: var(--info); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
