:root {
  --bg-dark: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-hover: #1b2640;
  --border-gold: rgba(217, 119, 6, 0.25);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --gold-gradient: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  --gold-hover: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  --gold-glow: 0 0 25px rgba(245, 158, 11, 0.25);
  --green: #10b981;
  --yellow: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* UTILITIES */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* 1. LOGIN OVERLAY */
.login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #1a2238 0%, #0b0f19 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), var(--gold-glow);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.admin-badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: 30px;
  color: #fbbf24;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.login-header h2 {
  font-size: 28px;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 14px;
}

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

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

.form-group input, .form-group select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.form-group input:focus, .form-group select:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
  background: rgba(255, 255, 255, 0.07);
}

.login-error {
  padding: 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 13px;
  margin-bottom: 20px;
}

.btn-primary-gold {
  width: 100%;
  padding: 14px;
  background: var(--gold-gradient);
  color: #000;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
}

.btn-primary-gold:hover {
  background: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.45);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  color: #64748b;
  font-size: 12px;
}

/* 2. ADMIN CONTAINER LAYOUT */
.admin-container {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
  width: 270px;
  background: #0f172a;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 24px 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--gold-glow);
}

.sidebar-brand h3 {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}

.sidebar-brand span {
  font-size: 11px;
  color: #fbbf24;
  font-weight: 600;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  transition: all 0.2s;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: var(--border-gold);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.btn-outline-gold {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  color: #fbbf24;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-outline-gold:hover {
  background: rgba(245, 158, 11, 0.1);
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* MAIN CONTENT */
.admin-main {
  margin-left: 270px;
  flex: 1;
  padding: 32px 40px;
}

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

.admin-topbar h2 {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.admin-topbar p {
  color: var(--text-muted);
  font-size: 14px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 30px;
  color: #34d399;
  font-size: 12px;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
}

/* TABS */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.25s ease-in; }

@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(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.gold { background: rgba(245, 158, 11, 0.15); border: 1px solid var(--border-gold); }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); }
.stat-icon.yellow { background: rgba(234, 179, 8, 0.15); border: 1px solid rgba(234, 179, 8, 0.3); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); }

.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.stat-value { font-size: 22px; font-weight: 800; color: #fff; margin-top: 4px; }
.stat-card small { display: block; color: #64748b; font-size: 11px; margin-top: 2px; }

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

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

.card-header h3 { font-size: 18px; font-weight: 700; color: #fff; }
.badge-gold {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--border-gold);
  color: #fbbf24;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.btn-text-gold {
  background: none;
  border: none;
  color: #fbbf24;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  white-space: nowrap;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* BADGES */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.status-badge.unpaid, .status-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

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

/* PRICING WIZARD */
.pricing-header-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(19, 27, 46, 0.8) 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.wizard-header h3 { font-size: 18px; font-weight: 800; color: #fbbf24; }
.wizard-header p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.bulk-markup-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bulk-markup-tools select, .bulk-markup-tools input {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.admin-select-lg {
  padding: 10px 16px;
  background: #111827;
  border: 1px solid #f59e0b;
  border-radius: 10px;
  color: #fbbf24;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  min-width: 280px;
  max-width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s;
}

.admin-select-lg:focus {
  border-color: #fbbf24;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.admin-select-lg optgroup {
  background: #1f2937;
  color: #fbbf24;
  font-weight: 800;
}

.admin-select-lg option {
  background: #0f172a;
  color: #f8fafc;
  font-weight: 600;
  padding: 8px 12px;
}

.chip-scroll {
  display: flex;
  flex-wrap: wrap; /* Membungkus rapi multi-baris, bukan sebaris kepanjangan */
  gap: 8px;
  max-height: 180px; /* Scroll vertikal yang nyaman */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 6px;
  margin-bottom: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

.chip-scroll::-webkit-scrollbar {
  width: 6px;
}

.chip-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.chip-scroll::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.4);
  border-radius: 4px;
}

.chip-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.7);
}

.game-chip {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.game-chip:hover {
  color: #fff;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.game-chip.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

/* INLINE PRICE INPUT */
.inline-price-input {
  width: 110px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  outline: none;
}

.inline-price-input:focus {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.btn-sm-gold {
  padding: 6px 12px;
  background: var(--gold-gradient);
  border: none;
  border-radius: 6px;
  color: #000;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sm-gold:hover { transform: scale(1.04); }

.btn-sm-action {
  padding: 6px 10px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 4px;
}

.btn-sm-action:hover { background: rgba(59, 130, 246, 0.3); }

/* FILTER BAR */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 260px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.status-filters {
  display: flex;
  gap: 6px;
}

.filter-btn {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.filter-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #fbbf24;
}

.btn-refresh {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

/* 2 COLS */
.grid-2-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .grid-2-cols { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; padding: 20px; }
}

.max-w-lg { max-width: 520px; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 14px 20px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), var(--gold-glow);
  z-index: 10000;
  transition: all 0.3s;
}

/* ADMIN PRICING FILTER & SEARCH BAR */
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-box-sm input {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  width: 280px;
  outline: none;
  transition: all 0.2s;
}

.search-box-sm input:focus {
  border-color: #f59e0b;
  background: rgba(255, 255, 255, 0.08);
}

.admin-category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.adm-cat-btn {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.adm-cat-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.adm-cat-btn.active {
  background: var(--gold-gradient);
  color: #000;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }

