/* =============================================
   GOLDRICH ADMIN PANEL - Premium Dark Gold Theme
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --gold:        #c9952d;
  --gold-light:  #f0d680;
  --gold-dark:   #a07820;
  --bg:          #0d0c0a;
  --surface:     #161410;
  --surface2:    #1e1b14;
  --border:      rgba(201,149,45,0.18);
  --border2:     rgba(201,149,45,0.08);
  --text:        #f0ebe0;
  --text-muted:  #8a7a60;
  --text-dim:    #5a4f3a;
  --green:       #10b981;
  --green-bg:    rgba(16,185,129,0.1);
  --red:         #ef4444;
  --red-bg:      rgba(239,68,68,0.1);
  --blue:        #3b82f6;
  --blue-bg:     rgba(59,130,246,0.1);
  --amber:       #f59e0b;
  --amber-bg:    rgba(245,158,11,0.1);
  --sidebar-w:   240px;
  --radius:      12px;
  --radius-lg:   20px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --transition:  all 0.22s ease;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ---- LOGIN ---- */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(201,149,45,0.15) 0%, transparent 70%), var(--bg);
}

.login-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #c9952d, #f0d680);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.login-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 36px; }

.login-box input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  margin-bottom: 14px;
  transition: var(--transition);
}
.login-box input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,149,45,0.12); }
.login-box input::placeholder { color: var(--text-dim); }

.btn-gold {
  width: 100%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border: none;
  border-radius: var(--radius);
  color: #1a1200;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.3px;
}
.btn-gold:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-gold:active { transform: translateY(0); }
.login-error { color: var(--red); font-size: 13px; margin-top: 12px; display: none; }

/* ---- LAYOUT ---- */
#admin-app { display: none; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 28px 20px 20px;
  border-bottom: 1px solid var(--border2);
}
.sidebar-logo-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #c9952d, #f0d680);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sidebar-logo-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; letter-spacing: 1px; text-transform: uppercase; }

.sidebar-nav { padding: 16px 12px; flex: 1; }
.nav-section-label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  padding: 4px 8px 8px;
  margin-top: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, rgba(201,149,45,0.2), rgba(240,214,128,0.08)); color: var(--gold-light); border: 1px solid rgba(201,149,45,0.2); }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 50px; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border2);
}
.admin-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: 10px;
}
.admin-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #1a1200; font-size: 13px;
}
.admin-name { font-size: 13px; font-weight: 600; }
.admin-role { font-size: 11px; color: var(--text-muted); }
.logout-btn {
  margin-top: 10px;
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  padding: 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}
.logout-btn:hover { border-color: var(--red); color: var(--red); }

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 28px 28px 60px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--gold-light);
}
.page-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

.section { display: none; }
.section.active { display: block; }

/* ---- STAT CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-icon { font-size: 28px; margin-bottom: 10px; display: block; }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; font-family: 'Playfair Display', serif; color: var(--gold-light); }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.stat-card.green::before { background: linear-gradient(90deg,var(--green),#34d399); }
.stat-card.red::before { background: linear-gradient(90deg,var(--red),#f87171); }
.stat-card.blue::before { background: linear-gradient(90deg,var(--blue),#60a5fa); }
.stat-card.purple::before { background: linear-gradient(90deg,#8b5cf6,#a78bfa); }
.stat-card.gold::before { background: linear-gradient(90deg,#facc15,#fbbf24); }
.stat-card.wifi::before { background: linear-gradient(90deg,#0ea5e9,#38bdf8); }

/* ---- CARD ---- */
.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.card-body { padding: 0; }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: var(--surface2); }
th {
  padding: 12px 16px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border2);
  color: var(--text);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(201,149,45,0.04); }
.td-muted { color: var(--text-muted); font-size: 12px; }
.td-mono { font-family: 'Courier New', monospace; font-size: 12px; color: var(--gold-light); }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-pending  { background: var(--amber-bg);  color: var(--amber);  border: 1px solid rgba(245,158,11,0.25); }
.badge-completed{ background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(16,185,129,0.25); }
.badge-failed   { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(239,68,68,0.25); }
.badge-rejected { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(239,68,68,0.25); }
.badge-active   { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(16,185,129,0.25); }
.badge-admin    { background: rgba(201,149,45,0.15); color: var(--gold-light); border: 1px solid var(--border); }
.badge-user     { background: var(--surface2);  color: var(--text-muted); border: 1px solid var(--border2); }
.badge-deposit  { background: var(--green-bg);  color: var(--green); }
.badge-withdraw { background: var(--red-bg);    color: var(--red); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}
.btn-sm { padding: 5px 10px; font-size: 11px; border-radius: 6px; }
.btn-approve { background: var(--green-bg); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.btn-approve:hover { background: var(--green); color: #fff; }
.btn-reject  { background: var(--red-bg);   color: var(--red);   border: 1px solid rgba(239,68,68,0.3); }
.btn-reject:hover  { background: var(--red); color: #fff; }
.btn-edit    { background: var(--blue-bg);  color: var(--blue);  border: 1px solid rgba(59,130,246,0.3); }
.btn-edit:hover    { background: var(--blue); color: #fff; }
.btn-gold-solid { background: linear-gradient(135deg,var(--gold),var(--gold-light)); color: #1a1200; }
.btn-gold-solid:hover { opacity: 0.88; }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold-light); }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: var(--red); color: #fff; }

/* ---- SEARCH & FILTER BAR ---- */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border2);
  align-items: center;
}
.search-input {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  min-width: 220px;
  transition: var(--transition);
}
.search-input:focus { border-color: var(--gold); }
.search-input::placeholder { color: var(--text-dim); }
.filter-select {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.multi-filter {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: 8px;
}
.filter-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: var(--transition);
}
.filter-check:hover { border-color: var(--gold-dark); color: var(--text); }
.filter-check input { cursor: pointer; accent-color: var(--gold); }

/* ---- MODAL ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: var(--gold-light); }
.modal-field { margin-bottom: 16px; }
.modal-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: 0.6px; }
.modal-input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}
.modal-input:focus { border-color: var(--gold); }
.modal-input::placeholder { color: var(--text-dim); }
.modal-input[readonly] { opacity: 0.5; cursor: not-allowed; }
select.modal-input { cursor: pointer; -webkit-appearance: none; }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.modal-actions .btn { flex: 1; justify-content: center; padding: 11px; font-size: 13px; }

/* ---- NOTIFICATION COMPOSER ---- */
.notif-composer .modal-input[type="text"],
.notif-composer textarea.modal-input {
  width: 100%;
}
textarea.modal-input { resize: vertical; min-height: 100px; }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 40px; display: block; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 14px; }

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow);
  max-width: 360px;
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red);   color: var(--red); }
.toast.info    { border-color: var(--gold);  color: var(--gold-light); }

/* ---- CHARTS / MINI BARS ---- */
.mini-bar-wrap { display: flex; align-items: center; gap: 8px; }
.mini-bar { height: 6px; border-radius: 3px; background: rgba(201,149,45,0.2); flex: 1; overflow: hidden; }
.mini-bar-fill { height: 100%; background: linear-gradient(90deg,var(--gold),var(--gold-light)); border-radius: 3px; }

/* ---- QUICK ACTIONS ROW ---- */
.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 20px 16px 60px; }
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ---- LOADING SPINNER ---- */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row td { text-align: center; padding: 40px; color: var(--text-muted); }

/* ---- PAGINATION ---- */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 16px; }
.page-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}
.page-btn.active { background: var(--gold); color: #1a1200; border-color: var(--gold); font-weight: 700; }
.page-btn:hover:not(.active) { border-color: var(--gold); color: var(--gold-light); }

/* ---- USER DETAIL ROW ---- */
.user-avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #1a1200;
  margin-right: 8px;
  flex-shrink: 0;
}
.user-cell { display: flex; align-items: center; }

/* ---- INFO BOX ---- */
.info-box {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: 13px;
}
.info-row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.info-row:last-child { margin-bottom: 0; }
.info-key { color: var(--text-muted); }
.info-val { color: var(--text); font-weight: 600; }
