/* ─────────────────────────────────────────────────────
   NexusTopUp — Admin Dashboard Premium UI
───────────────────────────────────────────────────── */

* { box-sizing: border-box; }

.admin-body {
  display: flex; min-height: 100vh;
  background: #070710;
  font-family: 'Space Grotesk', sans-serif;
  color: #fff;
}

/* ── SIDEBAR ─────────────────────────────────────── */
.admin-sidebar {
  width: 240px;
  background: rgba(255,255,255,0.03);
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 28px 16px;
  position: fixed; height: 100vh; left: 0; top: 0; z-index: 100;
  display: flex; flex-direction: column;
  backdrop-filter: blur(20px);
}

.sidebar-logo {
  padding: 12px 16px 32px;
  font-weight: 800; font-size: 20px; letter-spacing: -0.5px;
}
.sidebar-logo .logo-accent { color: #a78bfa; }
.sidebar-logo small {
  display: block; font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.25); text-transform: uppercase;
  letter-spacing: 2px; margin-top: 2px;
}

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

.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; color: rgba(255,255,255,0.45);
  text-decoration: none; border-radius: 12px;
  font-weight: 600; border: none; background: transparent;
  width: 100%; text-align: left; cursor: pointer; font-size: 14px;
  transition: all 0.2s; letter-spacing: -0.2px;
}
.sidebar-link:hover:not(.active) {
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.8);
}
.sidebar-link.active {
  background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(109,40,217,0.2));
  color: #c4b5fd;
  border: 1px solid rgba(124,58,237,0.3);
  box-shadow: 0 4px 20px rgba(124,58,237,0.15);
}

.badge-count {
  margin-left: auto; background: #7c3aed;
  color: #fff; font-size: 10px; font-weight: 800;
  padding: 2px 8px; border-radius: 99px; min-width: 20px; text-align: center;
}

.sidebar-bottom {
  margin-top: auto; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column; gap: 4px;
}

/* ── MAIN CONTENT ────────────────────────────────── */
.admin-main {
  flex: 1; margin-left: 240px; padding: 40px 40px 60px;
  min-width: 0; max-width: 100%;
}

/* ── PAGE HEADER ─────────────────────────────────── */
.admin-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 36px;
}
.admin-header h1, .admin-header h2 {
  font-size: 26px; font-weight: 800; letter-spacing: -0.5px;
}
.admin-header h2 { font-size: 22px; }

/* ── STATS GRID ──────────────────────────────────── */
.admin-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 36px;
}
.admin-stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 24px 22px; border-radius: 18px;
  transition: border-color 0.2s;
  position: relative; overflow: hidden;
}
.admin-stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #7c3aed, transparent);
  opacity: 0; transition: opacity 0.2s;
}
.admin-stat-card:hover { border-color: rgba(124,58,237,0.3); }
.admin-stat-card:hover::before { opacity: 1; }

.stat-icon { font-size: 22px; margin-bottom: 14px; }
.stat-big {
  font-size: 32px; font-weight: 800; color: white;
  letter-spacing: -1.5px; line-height: 1;
}
.stat-sm {
  font-size: 11px; color: rgba(255,255,255,0.35);
  text-transform: uppercase; font-weight: 700;
  letter-spacing: 1.5px; margin-top: 6px;
}

/* ── TABLE ───────────────────────────────────────── */
.table-wrap {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px; overflow: hidden;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  padding: 14px 20px; text-align: left; font-size: 10.5px;
  color: rgba(255,255,255,0.3); font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-table td {
  padding: 16px 20px; font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.7); vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td {
  background: rgba(255,255,255,0.02); color: #fff;
}
.table-empty { text-align: center; color: rgba(255,255,255,0.2); padding: 60px !important; }

/* ── STATUS BADGES ───────────────────────────────── */
.status-badge {
  padding: 5px 14px; border-radius: 99px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
  display: inline-block;
}
.status-badge.pending { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.status-badge.process { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.status-badge.done    { background: rgba(34,197,94,0.15);  color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.status-badge.cancelled { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }

/* ── ACTION CONTROLS ─────────────────────────────── */
.action-select {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: white; padding: 6px 10px; border-radius: 8px;
  font-size: 11px; outline: none; cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  transition: border-color 0.2s;
}
.action-select:focus { border-color: #7c3aed; }

.btn-ghost {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7); padding: 6px 12px; border-radius: 8px;
  font-size: 11px; cursor: pointer; font-family: 'Space Grotesk', sans-serif;
  transition: all 0.2s; font-weight: 600;
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: #fff; }

.del-btn {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2);
  color: #f87171; padding: 6px 10px; border-radius: 8px;
  font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.del-btn:hover { background: rgba(239,68,68,0.2); }

/* ── FORM INPUTS IN ADMIN ────────────────────────── */
.form-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.08); border-radius: 12px;
  padding: 13px 16px; color: #fff; font-size: 14px;
  font-family: 'Space Grotesk', sans-serif;
  outline: none; transition: border-color 0.2s; margin-bottom: 12px;
}
.form-input:focus { border-color: rgba(124,58,237,0.6); }
.form-input::placeholder { color: rgba(255,255,255,0.2); }

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border: none; border-radius: 12px; padding: 14px 20px;
  color: #fff; font-weight: 700; font-size: 14px;
  font-family: 'Space Grotesk', sans-serif; cursor: pointer;
  transition: all 0.2s; box-shadow: 0 4px 15px rgba(124,58,237,0.3);
  width: 100%;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(124,58,237,0.45); }

/* ── PRODUCT CARDS SECTION ───────────────────────── */
.game-group {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 18px; margin-bottom: 16px; overflow: hidden;
}
.game-group-header {
  padding: 18px 24px;
  background: rgba(124,58,237,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.game-group-fields { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; }
.game-group-fields input {
  flex: 1; min-width: 140px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 9px 14px; color: #fff; font-size: 13px;
  font-family: 'Space Grotesk', sans-serif; outline: none; transition: border-color 0.2s;
}
.game-group-fields input:focus { border-color: rgba(124,58,237,0.5); }
.game-group-actions { display: flex; gap: 8px; }

.products-list { padding: 12px 20px 16px; }
.product-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 8px; background: rgba(255,255,255,0.02);
  transition: border-color 0.2s;
}
.product-row:hover { border-color: rgba(255,255,255,0.1); }
.product-row input {
  background: transparent; border: none; color: #fff;
  font-size: 13px; font-family: 'Space Grotesk', sans-serif;
  outline: none; flex: 1;
}
.product-price { color: #fbbf24; font-weight: 700; font-size: 13px; min-width: 100px; }

/* ── SETTINGS CARDS ──────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.settings-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px; padding: 28px;
}
.settings-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.settings-card p { font-size: 13px; color: rgba(255,255,255,0.4); margin-bottom: 20px; line-height: 1.5; }

.qris-preview-wrap {
  width: 160px; height: 160px; margin: 0 0 20px; border-radius: 14px;
  overflow: hidden; border: 2px dashed rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center;
}
.qris-preview-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.qris-placeholder { color: rgba(255,255,255,0.2); font-size: 13px; text-align: center; }

.btn-row { display: flex; gap: 10px; }
.btn-row button { flex: 1; }

/* ── MODAL ───────────────────────────────────────── */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(12px);
  display: flex !important; align-items: center; justify-content: center; z-index: 9999;
}
.modal[style*="display: none"] { display: none !important; }
.modal-content {
  background: #0f0f1a; border: 1px solid rgba(255,255,255,0.1);
  padding: 40px; border-radius: 24px; width: 420px;
  animation: modalIn 0.3s ease; position: relative;
}
@keyframes modalIn { from { opacity:0; transform:translateY(16px) scale(0.97); } to { opacity:1; transform:translateY(0) scale(1); } }

/* ── LOGIN PAGE ──────────────────────────────────── */
.login-page {
  position: fixed; inset: 0;
  background: #070710;
  display: flex; align-items: center; justify-content: center; z-index: 10000;
}
.login-page::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(124,58,237,0.2), transparent 65%);
  pointer-events: none;
}
.login-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09);
  padding: 48px 40px; border-radius: 28px; width: 380px;
  text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,0.8);
  backdrop-filter: blur(20px); position: relative; z-index: 1;
}
.login-logo { margin-bottom: 8px; font-weight: 800; font-size: 26px; }
.login-logo .logo-accent { color: #a78bfa; }
.login-card > p { font-size: 14px; color: rgba(255,255,255,0.4); margin-bottom: 36px; }
.form-group { text-align: left; margin-bottom: 16px; }
.form-group label { font-size: 12px; color: rgba(255,255,255,0.4); font-weight: 600; display: block; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.btn-full { width: 100%; }

/* ── TOAST ───────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 28px; right: 28px;
  display: flex; flex-direction: column; gap: 10px; z-index: 99999;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: rgba(15,15,26,0.95); border: 1px solid rgba(255,255,255,0.1);
  color: white; padding: 14px 20px; border-radius: 14px; font-size: 14px; font-weight: 600;
  backdrop-filter: blur(20px); box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  animation: toastIn 0.3s ease; min-width: 260px;
}
.toast.success { border-color: rgba(74,222,128,0.3); }
.toast.error   { border-color: rgba(248,113,113,0.3); }
.toast.info    { border-color: rgba(124,58,237,0.3); }
@keyframes toastIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }

/* ── FILTER ROW ──────────────────────────────────── */
.filter-row { display: flex; gap: 12px; align-items: center; }
.filter-row select {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: white; padding: 9px 14px; border-radius: 10px; font-size: 13px;
  outline: none; cursor: pointer; font-family: 'Space Grotesk', sans-serif;
}
.btn-refresh {
  background: rgba(124,58,237,0.15); border: 1px solid rgba(124,58,237,0.3);
  color: #c4b5fd; padding: 9px 18px; border-radius: 10px; font-size: 13px;
  font-weight: 600; cursor: pointer; font-family: 'Space Grotesk', sans-serif;
  transition: all 0.2s;
}
.btn-refresh:hover { background: rgba(124,58,237,0.25); color: #fff; }

/* ── GOLD ────────────────────────────────────────── */
.gold { color: #fbbf24; font-weight: 700; }
