/*
 * Custom Dark Premium Theme
 * ระบบหลังบ้าน PG Agent
 * ===================================
 */

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

:root {
  --bg-dark:        #0d1117;
  --bg-card:        #161b22;
  --bg-card-hover:  #1c2130;
  --bg-sidebar:     #0d1117;
  --border-color:   rgba(255,255,255,0.07);
  --accent:         #4f8ef7;
  --accent-glow:    rgba(79,142,247,0.25);
  --accent-2:       #7c3aed;
  --success:        #22c55e;
  --danger:         #ef4444;
  --warning:        #f59e0b;
  --info:           #06b6d4;
  --text-primary:   #e6edf3;
  --text-muted:     #8b949e;
  --text-dim:       #6e7681;
  --sidebar-width:  260px;
  --radius:         12px;
  --radius-sm:      8px;
  --shadow:         0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:    0 0 20px rgba(79,142,247,0.15);
  --transition:     all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ===== GLOBAL RESET ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Sarabun', sans-serif !important;
  background: var(--bg-dark) !important;
  color: var(--text-primary) !important;
  font-size: 14.5px;
  line-height: 1.6;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ===== LAYOUT ===== */
#app {
  display: flex;
  min-height: 100vh;
  background: var(--bg-dark);
}

#main {
  flex: 1;
  min-width: 0;
  padding: 28px 32px 40px;
  margin-left: var(--sidebar-width);
  transition: var(--transition);
}

/* ===== SIDEBAR ===== */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  z-index: 1000;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow: hidden;
}

#sidebar .sidebar-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 20px;
}

/* Sidebar Header */
.sidebar-header {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar-header .logo a {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  overflow: hidden;
  min-width: 0;
}

.sidebar-header .logo img {
  height: 30px;
  width: auto;
  max-width: 100%;
  filter: brightness(1.1);
  flex-shrink: 0;
}

.sidebar-header .logo-text {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-header .toggler a {
  color: var(--text-muted);
  font-size: 18px;
  transition: var(--transition);
}
.sidebar-header .toggler a:hover { color: var(--text-primary); }

/* ===== User Info Card in Sidebar ===== */
.sidebar-user-card {
  margin: 18px 14px 10px;
  background: linear-gradient(160deg, rgba(79,142,247,0.10) 0%, rgba(124,58,237,0.06) 100%);
  border: 1px solid rgba(79,142,247,0.16);
  border-radius: var(--radius);
  padding: 16px;
}

/* Top row: avatar + name/role — isolated flex context so it never
   stretches to align against the balance/expire rows below it */
.user-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-card-top .user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(79,142,247,0.3);
}

.user-card-top .user-card-info {
  min-width: 0;
  flex: 1;
}

.user-card-top .user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-top .user-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}

/* Balance — its own full-width row, clearly separated */
.user-balance-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(34,197,94,0.07);
  border: 1px solid rgba(34,197,94,0.16);
  border-radius: var(--radius-sm);
}

.user-balance-box .balance-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(34,197,94,0.15);
  color: #4ade80;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.user-balance-box .balance-label {
  font-size: 10.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

.user-balance-box .balance-value {
  font-size: 16px;
  font-weight: 700;
  color: #4ade80;
  line-height: 1.3;
}

/* Expiry — full-width pill, centered, own row */
.user-expire-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 10px;
  background: rgba(79,142,247,0.08);
  border: 1px solid rgba(79,142,247,0.18);
  border-radius: 20px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.user-expire-box i { color: var(--accent); font-size: 10px; }
.user-expire-box b { color: var(--text-primary); font-weight: 600; }

/* Simple pill for admin-only (no balance card) */
.user-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(79,142,247,0.12);
  color: #60a5fa;
  border: 1px solid rgba(79,142,247,0.25);
}

/* Sidebar Menu */
.sidebar-menu {
  padding: 8px 0;
  flex: 1;
}

.sidebar-menu .menu {
  list-style: none;
  padding: 0 10px;
  margin: 0;
}

.sidebar-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  padding: 14px 12px 6px;
  margin: 0;
}

.sidebar-item {
  margin: 2px 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted) !important;
  text-decoration: none !important;
  transition: var(--transition);
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  position: relative;
  overflow: hidden;
}

.sidebar-link i, .sidebar-link svg {
  width: 18px;
  font-size: 15px;
  color: var(--text-dim);
  transition: var(--transition);
  flex-shrink: 0;
  text-align: center;
}

.sidebar-link span {
  font-weight: 400;
  color: var(--text-muted);
  transition: var(--transition);
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary) !important;
}
.sidebar-link:hover i,
.sidebar-link:hover svg,
.sidebar-link:hover span {
  color: var(--text-primary) !important;
}

.sidebar-item.active > .sidebar-link {
  background: linear-gradient(135deg, rgba(79,142,247,0.2), rgba(124,58,237,0.12));
  color: #fff !important;
  border: 1px solid rgba(79,142,247,0.25);
  box-shadow: 0 2px 12px rgba(79,142,247,0.15);
}
.sidebar-item.active > .sidebar-link i,
.sidebar-item.active > .sidebar-link svg,
.sidebar-item.active > .sidebar-link span {
  color: var(--accent) !important;
}
.sidebar-item.active > .sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

/* Non-link sidebar items (display-only) */
.sidebar-item .sidebar-link:not(a) {
  padding: 7px 14px;
  cursor: default;
  font-size: 13px;
}
.sidebar-item .sidebar-link:not(a):hover {
  background: transparent;
}

/* ===== PAGE HEADING ===== */
.page-heading {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.page-heading h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-heading h3 i {
  color: var(--accent);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  transition: var(--transition) !important;
  margin-bottom: 20px !important;
}

.card:hover {
  border-color: rgba(79,142,247,0.2) !important;
  box-shadow: var(--shadow), var(--shadow-glow) !important;
  transform: translateY(-1px);
}

.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 16px 20px !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  font-size: 15px;
}

.card-body {
  padding: 20px !important;
  color: var(--text-primary) !important;
}

.card-title {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  font-size: 15px;
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card) !important;
  border-radius: var(--radius) !important;
  padding: 22px !important;
  border: 1px solid var(--border-color) !important;
  transition: var(--transition) !important;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.08;
  transform: translate(20px, -20px);
}

.stat-card.purple::before { background: #7c3aed; }
.stat-card.green::before  { background: #22c55e; }
.stat-card.red::before    { background: #ef4444; }
.stat-card.blue::before   { background: #4f8ef7; }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.stat-card .stat-icon.purple { background: rgba(124,58,237,0.15); color: #a78bfa; }
.stat-card .stat-icon.green  { background: rgba(34,197,94,0.12);  color: #4ade80; }
.stat-card .stat-icon.red    { background: rgba(239,68,68,0.12);  color: #f87171; }
.stat-card .stat-icon.blue   { background: rgba(79,142,247,0.12); color: #60a5fa; }
.stat-card .stat-icon.black  { background: rgba(255,255,255,0.06); color: #94a3b8; }

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .stat-unit {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 4px;
  font-weight: 400;
}

/* Old stats-icon compatibility */
.stats-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.stats-icon.purple { background: rgba(124,58,237,0.15); color: #a78bfa; }
.stats-icon.green  { background: rgba(34,197,94,0.12);  color: #4ade80; }
.stats-icon.red    { background: rgba(239,68,68,0.12);  color: #f87171; }
.stats-icon.blue   { background: rgba(79,142,247,0.12); color: #60a5fa; }
.stats-icon.black  { background: rgba(255,255,255,0.06); color: #94a3b8; }

/* ===== BUTTONS ===== */
.btn {
  border-radius: var(--radius-sm) !important;
  font-family: 'Sarabun', sans-serif !important;
  font-weight: 500 !important;
  font-size: 13.5px !important;
  transition: var(--transition) !important;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #3b6fd4) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(79,142,247,0.35) !important;
}
.btn-primary:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(79,142,247,0.45) !important;
}

.btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(34,197,94,0.3) !important;
}
.btn-success:hover { transform: translateY(-1px) !important; }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(239,68,68,0.3) !important;
}
.btn-danger:hover { transform: translateY(-1px) !important; }

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  border-color: transparent !important;
  color: #000 !important;
}

.btn-secondary {
  background: rgba(255,255,255,0.07) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}
.btn-secondary:hover { background: rgba(255,255,255,0.12) !important; }

.btn-outline-success {
  border-color: var(--success) !important;
  color: var(--success) !important;
}
.btn-outline-success:hover {
  background: var(--success) !important;
  color: #fff !important;
}

.btn-sm { padding: 5px 12px !important; font-size: 12.5px !important; }
.btn-lg { padding: 12px 24px !important; font-size: 15.5px !important; }

/* ===== FORMS ===== */
.form-control, .form-select {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-primary) !important;
  font-family: 'Sarabun', sans-serif !important;
  font-size: 14px !important;
  transition: var(--transition) !important;
}

.form-control::placeholder { color: var(--text-dim) !important; }
.form-control:focus, .form-select:focus {
  background: rgba(255,255,255,0.06) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(79,142,247,0.12) !important;
  color: var(--text-primary) !important;
  outline: none;
}

label, .form-label {
  color: var(--text-muted) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  margin-bottom: 6px !important;
}

.form-control-xl {
  height: 52px !important;
  padding: 0 16px 0 48px !important;
  font-size: 14.5px !important;
}

.input-group-text {
  background: rgba(255,255,255,0.06) !important;
  border-color: var(--border-color) !important;
  color: var(--text-muted) !important;
}

/* Custom file input */
.custom-file-label {
  background: rgba(255,255,255,0.04) !important;
  border-color: var(--border-color) !important;
  color: var(--text-muted) !important;
}
.custom-file-label::after {
  background: rgba(79,142,247,0.15) !important;
  color: var(--accent) !important;
  border-left-color: var(--border-color) !important;
}

/* ===== TABLES ===== */
.table {
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.table thead th {
  background: rgba(255,255,255,0.04) !important;
  color: var(--text-muted) !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 12px 16px !important;
}

.table tbody td {
  padding: 12px 16px !important;
  border-color: var(--border-color) !important;
  vertical-align: middle !important;
  font-size: 13.5px !important;
}

.table tbody tr {
  transition: var(--transition);
}
.table tbody tr:hover {
  background: rgba(255,255,255,0.03) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255,255,255,0.02) !important;
  color: var(--text-primary) !important;
}

/* DataTables */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 5px 10px !important;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  color: var(--text-muted) !important;
  font-size: 13px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-muted) !important;
  border-radius: var(--radius-sm) !important;
  margin: 0 2px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

/* ===== BADGES ===== */
.badge {
  border-radius: 6px !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  padding: 4px 9px !important;
}

.bg-light-success { background: rgba(34,197,94,0.12) !important; color: #4ade80 !important; }
.bg-light-danger  { background: rgba(239,68,68,0.12)  !important; color: #f87171 !important; }
.bg-light-warning { background: rgba(245,158,11,0.12) !important; color: #fbbf24 !important; }
.bg-light-info    { background: rgba(6,182,212,0.12)  !important; color: #22d3ee !important; }
.bg-light-primary { background: rgba(79,142,247,0.12) !important; color: #60a5fa !important; }
.bg-success { background: rgba(34,197,94,0.85) !important;  }
.bg-danger  { background: rgba(239,68,68,0.85) !important;  }
.bg-warning { background: rgba(245,158,11,0.85) !important; color: #000 !important; }
.bg-info    { background: rgba(6,182,212,0.85) !important;  }
.bg-primary { background: var(--accent) !important; }

/* Bootstrap 4 badge color classes (removed in BS5).
   Pages use `badge badge-warning text-dark` for prices — without these
   the badge has no background and dark text vanishes on the dark theme. */
.badge-primary   { background: var(--accent) !important;  color: #fff !important; }
.badge-secondary { background: #6b7280 !important;         color: #fff !important; }
.badge-success   { background: #22c55e !important;         color: #fff !important; }
.badge-danger    { background: #ef4444 !important;         color: #fff !important; }
.badge-warning   { background: #f6ab2f !important;         color: #1a1200 !important; }
.badge-info      { background: #06b6d4 !important;         color: #052e33 !important; }
.badge-light     { background: #e6edf3 !important;         color: #1a1f26 !important; }
.badge-dark      { background: #30363d !important;         color: #e6edf3 !important; }

/* Make sure text-utility colours stay readable INSIDE coloured badges
   (badge background is solid, so the intended dark/white text is fine) */
.badge.text-dark  { color: #1a1200 !important; }
.badge.text-white { color: #ffffff !important; }

/* Standalone `.text-dark` (not on a badge) would be black-on-dark and
   invisible — lift it to the primary readable colour */
.text-dark:not(.badge):not([class*="badge-"]) { color: var(--text-primary) !important; }

/* ===== ALERTS ===== */
.alert {
  border: none !important;
  border-radius: var(--radius-sm) !important;
  font-size: 13.5px !important;
  padding: 12px 16px !important;
}
.alert-primary {
  background: rgba(79,142,247,0.12) !important;
  color: #60a5fa !important;
  border-left: 3px solid var(--accent) !important;
}
.alert-success {
  background: rgba(34,197,94,0.12) !important;
  color: #4ade80 !important;
  border-left: 3px solid var(--success) !important;
}
.alert-danger {
  background: rgba(239,68,68,0.12) !important;
  color: #f87171 !important;
  border-left: 3px solid var(--danger) !important;
}
.alert-warning {
  background: rgba(245,158,11,0.12) !important;
  color: #fbbf24 !important;
  border-left: 3px solid var(--warning) !important;
}
.alert-info {
  background: rgba(6,182,212,0.12) !important;
  color: #22d3ee !important;
  border-left: 3px solid var(--info) !important;
}

/* ===== MODALS ===== */
.modal-content {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6) !important;
}
.modal-header {
  border-bottom: 1px solid var(--border-color) !important;
  padding: 18px 22px !important;
}
.modal-title { color: var(--text-primary) !important; font-weight: 600 !important; }
.modal-body { padding: 22px !important; color: var(--text-muted) !important; }
.modal-footer { border-top: 1px solid var(--border-color) !important; padding: 16px 22px !important; }
.btn-close { filter: invert(1) !important; opacity: 0.5 !important; }
.btn-close:hover { opacity: 1 !important; }
.modal-backdrop { background: #000 !important; }

/* ===== HEADER (burger) ===== */
header .burger-btn {
  color: var(--text-muted);
  font-size: 20px;
  padding: 8px;
  transition: var(--transition);
}
header .burger-btn:hover { color: var(--text-primary); }

/* ===== SELECT2 / CHOICES ===== */
.choices__inner {
  background: rgba(255,255,255,0.04) !important;
  border-color: var(--border-color) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-primary) !important;
  min-height: 42px !important;
}
.choices__list--dropdown {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow) !important;
}
.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background: rgba(79,142,247,0.15) !important;
  color: var(--text-primary) !important;
}

/* ===== SCB / BANK CARD ===== */
.scb-box {
  border-radius: var(--radius) !important;
  padding: 16px 20px !important;
  overflow: hidden;
  position: relative;
}

/* ===== PAGE CONTENT SPACING ===== */
.page-content { margin-top: 0; }
.page-content .container { padding: 0; max-width: 100%; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 { color: var(--text-primary) !important; font-family: 'Sarabun', sans-serif !important; }
p, span, div { font-family: 'Sarabun', sans-serif; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-muted) !important; }
.font-semibold { font-weight: 600 !important; }
.font-extrabold { font-weight: 700 !important; }

hr {
  border-color: var(--border-color) !important;
  opacity: 1 !important;
}

/* ===== GAME IMAGE GRID ===== */
.imgContainer img {
  border-radius: var(--radius-sm) !important;
  opacity: 0.8;
  transition: var(--transition) !important;
  border: 2px solid transparent;
}
.imgContainer img:hover {
  opacity: 1 !important;
  border-color: var(--accent) !important;
  transform: scale(1.04) !important;
  box-shadow: 0 8px 24px rgba(79,142,247,0.3) !important;
}

/* ===== TOPUP HISTORY TABLE ===== */
.topup-amount-positive { color: var(--success); font-weight: 700; }
.topup-amount-negative { color: var(--danger); font-weight: 700; }

/* ===== PAGINATION ===== */
.page-link {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-muted) !important;
  transition: var(--transition) !important;
}
.page-link:hover {
  background: rgba(79,142,247,0.12) !important;
  color: var(--accent) !important;
  border-color: rgba(79,142,247,0.3) !important;
}
.page-item.active .page-link {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

/* ===== SWEETALERT DARK ===== */
.swal2-popup {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius) !important;
}
.swal2-title { color: var(--text-primary) !important; }
.swal2-html-container { color: var(--text-muted) !important; }

/* ===== LOGIN PAGE ===== */
#auth {
  min-height: 100vh;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#auth::before {
  content: '';
  position: absolute;
  top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(79,142,247,0.1) 0%, transparent 70%);
  pointer-events: none;
}

#auth::after {
  content: '';
  position: absolute;
  bottom: -200px; right: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(124,58,237,0.08) 0%, transparent 70%);
  pointer-events: none;
}

#auth-left {
  background: rgba(22,27,34,0.9);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 36px 32px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 80px rgba(79,142,247,0.05);
  position: relative;
  z-index: 1;
}

.auth-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary) !important;
  margin-bottom: 24px;
  letter-spacing: 1px;
}

.auth-title span {
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.form-control-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 15px;
  z-index: 5;
}

.has-icon-left .form-control {
  padding-left: 46px !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1199px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.active {
    transform: translateX(0);
  }
  #main {
    margin-left: 0;
    padding: 20px 16px 32px;
  }
}

@media (max-width: 768px) {
  .stat-card .stat-value { font-size: 22px; }
  .page-heading h3 { font-size: 17px; }
  #auth-left { padding: 28px 20px; }
  .auth-title { font-size: 22px; }
}

/* ===== FADE IN ANIMATION ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-content,
.stat-card,
.card {
  animation: fadeInUp 0.35s ease forwards;
}

/* Stagger animation for multiple cards */
.col-lg-3:nth-child(1) .stat-card { animation-delay: 0.05s; }
.col-lg-3:nth-child(2) .stat-card { animation-delay: 0.10s; }
.col-lg-3:nth-child(3) .stat-card { animation-delay: 0.15s; }
.col-lg-3:nth-child(4) .stat-card { animation-delay: 0.20s; }

/* ===== UTILITY ===== */
.text-accent  { color: var(--accent) !important; }
.text-success-custom { color: var(--success) !important; }
.text-danger-custom  { color: var(--danger)  !important; }
.bg-dark-card { background: var(--bg-card) !important; }
.border-custom { border-color: var(--border-color) !important; }
.rounded-custom { border-radius: var(--radius) !important; }
