:root {
  --font-heading: 'Plus Jakarta Sans', 'Outfit', sans-serif;
  --font-body: 'Inter', 'IBM Plex Sans', sans-serif;
  --sidebar-width: 260px;
  --navbar-height: 64px;

  /* Premium Color Palette - Dark Navy + Purple + Blue */
  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --primary-light: #818CF8;
  --secondary: #0EA5E9;
  --accent: #8B5CF6;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #06B6D4;

  /* Light Theme */
  --bg-light: #F1F5F9;
  --surface-light: #FFFFFF;
  --surface-2-light: #F8FAFC;
  --border-light: #E2E8F0;
  --text-primary-light: #0F172A;
  --text-secondary-light: #64748B;
  --text-muted-light: #94A3B8;

  /* Dark Theme */
  --bg-dark: #0B0F1A;
  --surface-dark: #111827;
  --surface-2-dark: #1E2535;
  --border-dark: #1F2937;
  --text-primary-dark: #F1F5F9;
  --text-secondary-dark: #94A3B8;
  --text-muted-dark: #64748B;

  /* Glass */
  --glass-bg: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.12);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.25);

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  --grad-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
  --grad-warning: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  --grad-danger: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  --grad-info: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
  --grad-sidebar: linear-gradient(180deg, #0B0F1A 0%, #111827 100%);
}

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

/* Prevent horizontal scroll on all devices */
html { overflow-x: hidden; max-width: 100vw; }
* { font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
canvas { max-width: 100% !important; height: auto !important; }
h1, h2, h3, h4, h5, h6, .card-title, .stat-value, .sidebar-brand, .brand-name {
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
}

body {
  margin: 0;
  background: var(--bg-light);
  color: var(--text-primary-light);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

[data-bs-theme="dark"] {
  background: var(--bg-dark);
  color: var(--text-primary-dark);
}
[data-bs-theme="dark"] body { background: var(--bg-dark); color: var(--text-primary-dark); }

.tabular-nums { font-variant-numeric: tabular-nums; }

/* =========================================
   Layout
   ========================================= */
.app-wrapper { display: flex; min-height: 100vh; overflow-x: hidden; }
.main-content { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-height: 100vh; transition: margin-left 0.3s ease; overflow-x: hidden; }
.content-area { padding: 28px; flex: 1; max-width: 100%; overflow-x: hidden; }

/* =========================================
   Sidebar — Premium Dark
   ========================================= */
.sidebar {
  width: var(--sidebar-width);
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 1040;
  background: var(--grad-sidebar);
  display: flex; flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 20px 24px;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-heading);
  font-weight: 800; font-size: 1.35rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  flex-shrink: 0;
  text-decoration: none;
}
.sidebar-brand .brand-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
.sidebar-brand .brand-name { color: #fff; }
.sidebar-brand .brand-sub { font-size: 0.65rem; color: rgba(255,255,255,0.45); font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; display: block; }

.sidebar-section { padding: 8px 16px 4px; margin-top: 8px; }
.sidebar-section-label { font-size: 0.65rem; font-weight: 700; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.12em; }

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

.nav-link-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-radius: 10px;
  color: rgba(255,255,255,0.55); text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
  transition: all 0.2s ease;
  position: relative; overflow: hidden;
}
.nav-link-item .nav-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  transition: all 0.2s ease;
}
.nav-link-item:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-link-item:hover .nav-icon { background: rgba(99,102,241,0.25); color: var(--primary-light); }
.nav-link-item.active { color: #fff; background: rgba(99,102,241,0.2); }
.nav-link-item.active .nav-icon { background: var(--grad-primary); color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,0.35); }
.nav-link-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; background: var(--primary-light); border-radius: 0 4px 4px 0; }
.nav-link-item.text-danger { color: rgba(239,68,68,0.7) !important; }
.nav-link-item.text-danger:hover { color: #EF4444 !important; background: rgba(239,68,68,0.12); }
.nav-link-item.text-danger .nav-icon { background: rgba(239,68,68,0.1); }

.sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,0.05); }
.sidebar-user-avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--grad-primary); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }
.sidebar-user-info .name { font-size: 0.8rem; font-weight: 600; color: #fff; display: block; }
.sidebar-user-info .role { font-size: 0.65rem; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.08em; }

/* =========================================
   Top Navbar
   ========================================= */
.top-navbar {
  height: var(--navbar-height);
  display: flex; align-items: center;
  padding: 0 28px; gap: 16px;
  background: var(--surface-light);
  border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}
[data-bs-theme="dark"] .top-navbar { background: rgba(17,24,39,0.95); border-color: var(--border-dark); }

.navbar-title { flex: 1; }
.page-title { font-size: 1.15rem; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.navbar-breadcrumb { font-size: 0.75rem; color: var(--text-secondary-light); margin-top: 1px; }
[data-bs-theme="dark"] .navbar-breadcrumb { color: var(--text-secondary-dark); }

.navbar-actions { display: flex; align-items: center; gap: 10px; }
.navbar-icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-light); background: transparent;
  color: var(--text-secondary-light); cursor: pointer;
  transition: all 0.2s ease;
}
[data-bs-theme="dark"] .navbar-icon-btn { border-color: var(--border-dark); color: var(--text-secondary-dark); }
.navbar-icon-btn:hover { background: var(--bg-light); color: var(--primary); border-color: var(--primary); }
[data-bs-theme="dark"] .navbar-icon-btn:hover { background: var(--surface-2-dark); }

.sidebar-toggle { display: none; }

.user-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; background: var(--bg-light); border: 1px solid var(--border-light); transition: all 0.2s ease; cursor: default; }
[data-bs-theme="dark"] .user-chip { background: var(--surface-2-dark); border-color: var(--border-dark); }
.user-chip-avatar { width: 28px; height: 28px; border-radius: 8px; background: var(--grad-primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.75rem; font-weight: 700; }
.user-chip-name { font-size: 0.8rem; font-weight: 600; }
.user-chip-role { font-size: 0.65rem; background: var(--primary); color: #fff; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

/* Force Bootstrap Icons font — prevents override by global font-family */
.bi::before, [class^="bi-"]::before, [class*=" bi-"]::before {
  font-family: "bootstrap-icons" !important;
}

/* Light mode nav icon color fix */
[data-bs-theme="light"] .nav-icon i,
[data-bs-theme="light"] .nav-icon .bi {
  color: inherit !important;
}
[data-bs-theme="light"] .sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-right: 1px solid #e2e8f0;
}
[data-bs-theme="light"] .sidebar-brand {
  color: #0f172a;
  border-bottom-color: #e2e8f0;
}
[data-bs-theme="light"] .sidebar-brand .brand-name { color: #0f172a; }
[data-bs-theme="light"] .sidebar-brand .brand-sub { color: #64748b; }
[data-bs-theme="light"] .sidebar-section-label { color: #94a3b8; }
[data-bs-theme="light"] .nav-link-item { color: #475569; }
[data-bs-theme="light"] .nav-link-item .nav-icon { background: #f1f5f9; }
[data-bs-theme="light"] .nav-link-item:hover { color: #0f172a; background: #f1f5f9; }
[data-bs-theme="light"] .nav-link-item:hover .nav-icon { background: rgba(99,102,241,0.1); }
[data-bs-theme="light"] .nav-link-item.active { color: var(--primary); background: rgba(99,102,241,0.08); }
[data-bs-theme="light"] .nav-link-item.active .nav-icon { background: var(--grad-primary); color: #fff; }
[data-bs-theme="light"] .nav-link-item.text-danger { color: #ef4444 !important; }
[data-bs-theme="light"] .sidebar-footer { border-top-color: #e2e8f0; }
[data-bs-theme="light"] .sidebar-user { background: #f1f5f9; }
[data-bs-theme="light"] .sidebar-user-info .name { color: #0f172a; }
[data-bs-theme="light"] .sidebar-user-info .role { color: #64748b; }

/* =========================================
   Notification Bell
   ========================================= */
.notif-bell { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #ef4444; color: #fff;
  font-size: 0.6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface-light);
  animation: pulse-badge 2s infinite;
}
[data-bs-theme="dark"] .notif-badge { border-color: var(--surface-dark); }
@keyframes pulse-badge { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }

.notif-dropdown {
  position: absolute; right: 0; top: 48px;
  width: 320px; border-radius: 14px;
  background: var(--surface-light); border: 1px solid var(--border-light);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  z-index: 9999; display: none;
  overflow: hidden;
}
[data-bs-theme="dark"] .notif-dropdown { background: var(--surface-dark); border-color: var(--border-dark); box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.notif-dropdown.show { display: block; animation: slideDown 0.2s ease; }
@keyframes slideDown { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }
.notif-header { padding: 14px 16px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
[data-bs-theme="dark"] .notif-header { border-color: var(--border-dark); }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border-light); display: flex; gap: 12px; align-items: flex-start; cursor: pointer; transition: background 0.15s; }
[data-bs-theme="dark"] .notif-item { border-color: var(--border-dark); }
.notif-item:hover { background: var(--bg-light); }
[data-bs-theme="dark"] .notif-item:hover { background: var(--surface-2-dark); }
.notif-item.unread { background: rgba(99,102,241,0.05); }
.notif-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1rem; }
.notif-text .notif-title { font-size: 0.8rem; font-weight: 600; margin: 0; }
.notif-text .notif-time { font-size: 0.7rem; color: var(--text-muted-light); margin-top: 2px; }
[data-bs-theme="dark"] .notif-text .notif-time { color: var(--text-muted); }
.notif-empty { padding: 32px 16px; text-align: center; color: var(--text-muted-light); font-size: 0.85rem; }

/* =========================================
   Live Wallet Balance pulse
   ========================================= */
@keyframes balance-update { 0%{background:rgba(16,185,129,0.2)} 100%{background:transparent} }
.balance-updated { animation: balance-update 1.5s ease; border-radius: 8px; }

/* =========================================
   PWA Install Banner
   ========================================= */
.pwa-banner {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--grad-primary); color: #fff; border-radius: 14px;
  padding: 12px 20px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 32px rgba(99,102,241,0.4); z-index: 9998;
  min-width: 280px; max-width: 90vw;
  animation: slideUp 0.4s ease;
}
@keyframes slideUp { from{opacity:0;transform:translateX(-50%) translateY(20px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }
.pwa-banner-btn { background: rgba(255,255,255,0.2); border: none; color: #fff; border-radius: 8px; padding: 6px 14px; font-weight: 600; font-size: 0.8rem; cursor: pointer; white-space:nowrap; }
.pwa-banner-close { background: none; border: none; color: rgba(255,255,255,0.6); cursor: pointer; padding: 0; font-size: 1rem; margin-left: auto; }

.card {
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  background: var(--surface-light);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}
[data-bs-theme="dark"] .card { background: var(--surface-dark); border-color: var(--border-dark); box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
[data-bs-theme="dark"] .card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.3); }

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-light);
  padding: 18px 24px; font-weight: 700;
  display: flex; align-items: center;
}
[data-bs-theme="dark"] .card-header { border-color: var(--border-dark); }
.card-body { padding: 24px; }

/* Glassmorphism Card */
.card-glass {
  background: rgba(255,255,255,0.7) !important;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.3) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1) !important;
}
[data-bs-theme="dark"] .card-glass {
  background: rgba(17,24,39,0.6) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
}

/* =========================================
   Stat Cards — Premium
   ========================================= */
.stat-card {
  padding: 24px;
  background: var(--surface-light);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  display: flex; align-items: flex-start; gap: 16px;
  transition: all 0.25s ease;
  position: relative; overflow: hidden;
}
[data-bs-theme="dark"] .stat-card { background: var(--surface-dark); border-color: var(--border-dark); }
.stat-card::after {
  content: ''; position: absolute; top: 0; right: 0;
  width: 80px; height: 80px; border-radius: 50%;
  opacity: 0.07; transform: translate(30%, -30%);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.1); }
[data-bs-theme="dark"] .stat-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,0.35); }

.stat-card.stat-primary::after { background: var(--primary); }
.stat-card.stat-success::after { background: var(--success); }
.stat-card.stat-warning::after { background: var(--warning); }
.stat-card.stat-danger::after { background: var(--danger); }
.stat-card.stat-info::after { background: var(--info); }
.stat-card.stat-purple::after { background: var(--accent); }

.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; flex-shrink: 0;
}
.stat-icon.icon-primary { background: rgba(99,102,241,0.12); color: var(--primary); }
.stat-icon.icon-success { background: rgba(16,185,129,0.12); color: var(--success); }
.stat-icon.icon-warning { background: rgba(245,158,11,0.12); color: var(--warning); }
.stat-icon.icon-danger { background: rgba(239,68,68,0.12); color: var(--danger); }
.stat-icon.icon-info { background: rgba(6,182,212,0.12); color: var(--info); }
.stat-icon.icon-purple { background: rgba(139,92,246,0.12); color: var(--accent); }

[data-bs-theme="dark"] .stat-icon.icon-primary { background: rgba(99,102,241,0.2); }
[data-bs-theme="dark"] .stat-icon.icon-success { background: rgba(16,185,129,0.2); }
[data-bs-theme="dark"] .stat-icon.icon-warning { background: rgba(245,158,11,0.2); }
[data-bs-theme="dark"] .stat-icon.icon-danger { background: rgba(239,68,68,0.2); }
[data-bs-theme="dark"] .stat-icon.icon-info { background: rgba(6,182,212,0.2); }
[data-bs-theme="dark"] .stat-icon.icon-purple { background: rgba(139,92,246,0.2); }

.stat-info { flex: 1; min-width: 0; }
.stat-value { font-family: var(--font-heading); font-size: 1.65rem; font-weight: 800; line-height: 1.1; display: block; }
.stat-label { font-size: 0.72rem; color: var(--text-secondary-light); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; display: block; }
[data-bs-theme="dark"] .stat-label { color: var(--text-secondary-dark); }
.stat-change { font-size: 0.72rem; margin-top: 6px; display: block; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* =========================================
   Gradient Hero Cards
   ========================================= */
.wallet-hero-card {
  border-radius: 20px !important;
  background: var(--grad-primary) !important;
  border: none !important;
  color: #fff;
  position: relative; overflow: hidden;
}
.wallet-hero-card::before {
  content: ''; position: absolute; top: -40%; right: -20%;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.wallet-hero-card::after {
  content: ''; position: absolute; bottom: -40%; left: -10%;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.wallet-balance-amount { font-family: var(--font-heading); font-size: 2.5rem; font-weight: 800; color: #fff; }
.wallet-balance-label { font-size: 0.8rem; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.1em; }

/* =========================================
   Quick Action Cards
   ========================================= */
.quick-action-card {
  border-radius: 16px !important;
  text-decoration: none !important;
  transition: all 0.25s ease !important;
  display: block;
  border: 2px solid transparent !important;
}
.quick-action-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.12) !important; }
.quick-action-card.action-primary { background: rgba(99,102,241,0.06) !important; border-color: rgba(99,102,241,0.2) !important; }
.quick-action-card.action-success { background: rgba(16,185,129,0.06) !important; border-color: rgba(16,185,129,0.2) !important; }
.quick-action-card.action-warning { background: rgba(245,158,11,0.06) !important; border-color: rgba(245,158,11,0.2) !important; }
.quick-action-card.action-info { background: rgba(6,182,212,0.06) !important; border-color: rgba(6,182,212,0.2) !important; }
[data-bs-theme="dark"] .quick-action-card.action-primary { background: rgba(99,102,241,0.1) !important; }
[data-bs-theme="dark"] .quick-action-card.action-success { background: rgba(16,185,129,0.1) !important; }
[data-bs-theme="dark"] .quick-action-card.action-warning { background: rgba(245,158,11,0.1) !important; }
[data-bs-theme="dark"] .quick-action-card.action-info { background: rgba(6,182,212,0.1) !important; }
.quick-action-icon { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin: 0 auto 12px; }

/* =========================================
   Tables
   ========================================= */
.table { font-size: 0.875rem; margin-bottom: 0; }
.table thead th {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-secondary-light); font-weight: 700; border-bottom-width: 1px;
  padding: 14px 16px; white-space: nowrap; background: transparent;
}
[data-bs-theme="dark"] .table thead th { color: var(--text-secondary-dark); border-color: var(--border-dark); }
.table tbody td { padding: 12px 16px; vertical-align: middle; border-color: var(--border-light); }
[data-bs-theme="dark"] .table tbody td { border-color: var(--border-dark); }
.table-hover tbody tr:hover { background: rgba(99,102,241,0.04); }
[data-bs-theme="dark"] .table-hover tbody tr:hover { background: rgba(99,102,241,0.08); }
[data-bs-theme="dark"] .table { color: var(--text-primary-dark); }

/* =========================================
   Badges
   ========================================= */
.badge { font-weight: 600; font-size: 0.68rem; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 6px; }
.badge-success-soft { background: rgba(16,185,129,0.12); color: #059669; }
.badge-danger-soft { background: rgba(239,68,68,0.12); color: #DC2626; }
.badge-warning-soft { background: rgba(245,158,11,0.12); color: #D97706; }
.badge-info-soft { background: rgba(6,182,212,0.12); color: #0891B2; }
.badge-secondary-soft { background: rgba(100,116,139,0.12); color: #475569; }
[data-bs-theme="dark"] .badge-success-soft { background: rgba(16,185,129,0.2); color: #34D399; }
[data-bs-theme="dark"] .badge-danger-soft { background: rgba(239,68,68,0.2); color: #F87171; }
[data-bs-theme="dark"] .badge-warning-soft { background: rgba(245,158,11,0.2); color: #FCD34D; }
[data-bs-theme="dark"] .badge-info-soft { background: rgba(6,182,212,0.2); color: #22D3EE; }
[data-bs-theme="dark"] .badge-secondary-soft { background: rgba(100,116,139,0.2); color: #94A3B8; }

/* =========================================
   Forms
   ========================================= */
.form-control, .form-select {
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  font-size: 0.9rem;
  padding: 10px 14px;
  background: var(--surface-light);
  color: var(--text-primary-light);
  transition: all 0.2s ease;
  min-height: 44px;
}
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select {
  background: var(--surface-2-dark);
  border-color: var(--border-dark);
  color: var(--text-primary-dark);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  outline: none;
}
.form-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; color: var(--text-secondary-light); }
[data-bs-theme="dark"] .form-label { color: var(--text-secondary-dark); }
.input-group-text {
  border: 1.5px solid var(--border-light);
  background: var(--bg-light);
  font-size: 0.875rem;
  min-height: 44px;
  border-radius: 10px;
}
[data-bs-theme="dark"] .input-group-text { background: var(--surface-2-dark); border-color: var(--border-dark); color: var(--text-secondary-dark); }
.input-group .form-control { border-radius: 0 10px 10px 0; }
.input-group .input-group-text { border-radius: 10px 0 0 10px; }
.input-group .form-control:first-child { border-radius: 10px; }

/* =========================================
   Buttons
   ========================================= */
.btn {
  font-size: 0.875rem; font-weight: 600; border-radius: 10px;
  padding: 10px 20px; min-height: 44px;
  transition: all 0.2s ease;
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--grad-primary); border: none; color: #fff; box-shadow: 0 4px 16px rgba(99,102,241,0.3); }
.btn-primary:hover { background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%); box-shadow: 0 6px 20px rgba(99,102,241,0.4); color: #fff; }
.btn-success { background: var(--grad-success); border: none; color: #fff; box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.btn-success:hover { background: linear-gradient(135deg, #059669 0%, #047857 100%); color: #fff; }
.btn-danger { background: var(--grad-danger); border: none; color: #fff; box-shadow: 0 4px 12px rgba(239,68,68,0.3); }
.btn-danger:hover { background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%); color: #fff; }
.btn-warning { background: var(--grad-warning); border: none; color: #fff; }
.btn-warning:hover { background: linear-gradient(135deg, #D97706 0%, #B45309 100%); color: #fff; }
.btn-outline-primary { border: 1.5px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-outline-secondary { border: 1.5px solid var(--border-light); color: var(--text-secondary-light); background: transparent; }
[data-bs-theme="dark"] .btn-outline-secondary { border-color: var(--border-dark); color: var(--text-secondary-dark); }
.btn-outline-secondary:hover { background: var(--bg-light); }
[data-bs-theme="dark"] .btn-outline-secondary:hover { background: var(--surface-2-dark); color: var(--text-primary-dark); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; min-height: 36px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; min-height: 52px; border-radius: 12px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 10px; min-height: unset; }

/* =========================================
   Alerts
   ========================================= */
.alert { border-radius: 12px; font-size: 0.875rem; border: none; padding: 14px 18px; }
.alert-success { background: rgba(16,185,129,0.1); color: #065F46; border-left: 4px solid var(--success); }
.alert-danger { background: rgba(239,68,68,0.1); color: #991B1B; border-left: 4px solid var(--danger); }
.alert-warning { background: rgba(245,158,11,0.1); color: #92400E; border-left: 4px solid var(--warning); }
.alert-info { background: rgba(6,182,212,0.1); color: #164E63; border-left: 4px solid var(--info); }
[data-bs-theme="dark"] .alert-success { background: rgba(16,185,129,0.12); color: #34D399; }
[data-bs-theme="dark"] .alert-danger { background: rgba(239,68,68,0.12); color: #F87171; }
[data-bs-theme="dark"] .alert-warning { background: rgba(245,158,11,0.12); color: #FCD34D; }
[data-bs-theme="dark"] .alert-info { background: rgba(6,182,212,0.12); color: #22D3EE; }

/* =========================================
   Login Page
   ========================================= */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrapper {
  position: relative; width: 100%; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0B0F1A 0%, #1a1240 50%, #0f1929 100%);
}
.login-particles {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(99,102,241,0.15) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(139,92,246,0.1) 0%, transparent 40%),
              radial-gradient(circle at 50% 80%, rgba(14,165,233,0.08) 0%, transparent 40%);
  pointer-events: none;
}
.login-card {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  background: rgba(17,24,39,0.85);
  backdrop-filter: blur(24px);
  border-radius: 24px; padding: 44px 40px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  animation: slideUp 0.5s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-brand { text-align: center; margin-bottom: 36px; }
.login-brand .brand-icon {
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--grad-primary); display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 1.8rem; color: #fff; margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}
.login-brand h2 { color: #fff; font-size: 1.8rem; font-weight: 800; margin-bottom: 4px; }
.login-brand p { color: rgba(255,255,255,0.45); font-size: 0.875rem; margin: 0; }
.login-card .form-control {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.1) !important;
  color: #fff !important;
}
.login-card .form-control:focus { border-color: var(--primary) !important; background: rgba(255,255,255,0.08) !important; }
.login-card .form-control::placeholder { color: rgba(255,255,255,0.3); }
.login-card .form-label { color: rgba(255,255,255,0.7); }
.login-card .input-group-text { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.4); }
.login-btn { width: 100%; padding: 12px; font-size: 1rem; font-weight: 700; }
.login-card .alert { background: rgba(239,68,68,0.15); border-left-color: var(--danger); color: #FCA5A5; }
.login-card .alert-success { background: rgba(16,185,129,0.15); color: #6EE7B7; }

/* =========================================
   Recharge Page
   ========================================= */
.recharge-card { border-radius: 20px !important; }
.operator-badge-pill { font-size: 0.7rem; padding: 3px 8px; border-radius: 20px; }
.plan-item:hover { background: rgba(99,102,241,0.06); }
.plan-item { transition: background 0.15s ease; cursor: pointer; }

/* Type selector */
.type-selector { display: flex; gap: 8px; }
.type-btn {
  flex: 1; padding: 12px 8px; border-radius: 12px;
  border: 2px solid var(--border-light);
  background: transparent; text-align: center;
  cursor: pointer; transition: all 0.2s ease;
  font-size: 0.875rem; font-weight: 600; color: var(--text-secondary-light);
}
[data-bs-theme="dark"] .type-btn { border-color: var(--border-dark); color: var(--text-secondary-dark); }
.type-btn.active { border-color: var(--primary); background: rgba(99,102,241,0.08); color: var(--primary); }
.type-btn .type-icon { font-size: 1.4rem; display: block; margin-bottom: 4px; }

/* =========================================
   History / Transaction Page
   ========================================= */
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-pill {
  padding: 7px 16px; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
  border: 1.5px solid var(--border-light); color: var(--text-secondary-light);
  text-decoration: none; transition: all 0.15s ease; min-height: 36px;
  display: inline-flex; align-items: center;
}
[data-bs-theme="dark"] .filter-pill { border-color: var(--border-dark); color: var(--text-secondary-dark); }
.filter-pill.active, .filter-pill:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-pill.active-success { background: var(--success); border-color: var(--success); color: #fff; }
.filter-pill.active-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.filter-pill.active-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.filter-pill.active-info { background: var(--info); border-color: var(--info); color: #fff; }

/* Mobile transaction card */
.txn-card { border-radius: 14px; padding: 16px; margin-bottom: 10px; }
.txn-card .txn-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }

/* =========================================
   Pagination
   ========================================= */
.pagination .page-link {
  border-radius: 8px; margin: 0 2px;
  border: 1.5px solid var(--border-light);
  color: var(--text-secondary-light);
  font-size: 0.8rem; font-weight: 600;
  min-width: 36px; text-align: center; min-height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
}
[data-bs-theme="dark"] .pagination .page-link { border-color: var(--border-dark); color: var(--text-secondary-dark); background: var(--surface-dark); }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }

/* =========================================
   Modal
   ========================================= */
.modal-content { border-radius: 20px; border: none; overflow: hidden; }
[data-bs-theme="dark"] .modal-content { background: var(--surface-dark); border: 1px solid var(--border-dark); }
.modal-header { border-bottom: 1px solid var(--border-light); padding: 20px 24px; }
[data-bs-theme="dark"] .modal-header { border-color: var(--border-dark); }
.modal-footer { border-top: 1px solid var(--border-light); padding: 16px 24px; }
[data-bs-theme="dark"] .modal-footer { border-color: var(--border-dark); }
.modal-title { font-family: var(--font-heading); font-weight: 700; }
[data-bs-theme="dark"] .modal-body, [data-bs-theme="dark"] .modal-title { color: var(--text-primary-dark); }

/* =========================================
   SweetAlert2 overrides
   ========================================= */
.swal2-popup { border-radius: 20px !important; font-family: var(--font-body) !important; }
.swal2-title { font-family: var(--font-heading) !important; font-weight: 800 !important; }
.swal2-confirm, .swal2-cancel, .swal2-deny { border-radius: 10px !important; font-weight: 600 !important; min-height: 44px !important; padding: 10px 24px !important; }
.swal2-loading-overlay { background: rgba(11,15,26,0.85) !important; backdrop-filter: blur(8px) !important; }

/* =========================================
   Progress / Loader
   ========================================= */
.processing-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(11,15,26,0.85);
  backdrop-filter: blur(10px);
  z-index: 99999; align-items: center; justify-content: center;
  flex-direction: column;
}
.processing-overlay.show { display: flex; }
.processing-spinner {
  width: 72px; height: 72px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  margin-bottom: 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================
   Empty State
   ========================================= */
.empty-state { text-align: center; padding: 60px 24px; }
.empty-state-icon { font-size: 3rem; color: var(--text-muted-light); margin-bottom: 16px; display: block; }
[data-bs-theme="dark"] .empty-state-icon { color: var(--text-muted-dark); }
.empty-state-title { font-size: 1rem; font-weight: 700; color: var(--text-secondary-light); margin-bottom: 8px; }
[data-bs-theme="dark"] .empty-state-title { color: var(--text-secondary-dark); }

/* =========================================
   Error Page
   ========================================= */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-light); }
[data-bs-theme="dark"] .error-page { background: var(--bg-dark); }
.error-code { font-size: 7rem; font-weight: 900; line-height: 1; background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* =========================================
   Wallet Ledger
   ========================================= */
.wallet-hero { border-radius: 20px; background: var(--grad-primary); padding: 28px; color: #fff; position: relative; overflow: hidden; }
.wallet-hero::before { content: ''; position: absolute; top: -30%; right: -10%; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.08); pointer-events: none; }

/* =========================================
   Misc Utilities
   ========================================= */
.text-gradient { background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.rounded-xl { border-radius: 16px !important; }
.rounded-2xl { border-radius: 20px !important; }
.shadow-primary { box-shadow: 0 8px 24px rgba(99,102,241,0.3) !important; }
.divider { height: 1px; background: var(--border-light); margin: 16px 0; }
[data-bs-theme="dark"] .divider { background: var(--border-dark); }

/* =========================================
   MOBILE RESPONSIVE — Full Coverage
   ========================================= */

/* 768px - Tablet */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.show {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0,0,0,0.3);
  }
  .main-content { margin-left: 0 !important; }
  .sidebar-toggle { display: flex !important; align-items: center; justify-content: center; }
  .sidebar-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 1035;
    backdrop-filter: blur(4px);
  }
  .sidebar-overlay.show { display: block; }
  .user-chip .user-chip-name { display: none; }
}

@media (max-width: 767.98px) {
  :root { --navbar-height: 56px; }
  .content-area { padding: 16px 14px; }
  .stat-value { font-size: 1.3rem; }
  .stat-icon { width: 44px; height: 44px; font-size: 1.1rem; }
  .stat-card { padding: 16px; gap: 12px; }
  .card-body { padding: 16px; }
  .card-header { padding: 14px 16px; font-size: 0.9rem; }
  .wallet-balance-amount { font-size: 2rem; }
  .table-responsive { font-size: 0.8rem; }
  .table tbody td { padding: 10px 12px; }
  .table thead th { padding: 10px 12px; }
  .btn { min-height: 44px; }
  .login-card { margin: 16px; padding: 28px 24px; }
  .login-brand h2 { font-size: 1.5rem; }
  .filter-pills { gap: 6px; }
  .filter-pill { padding: 6px 12px; font-size: 0.75rem; }
  .top-navbar { padding: 0 16px; }
  .page-title { font-size: 1rem; }
  .pagination .page-link { min-width: 32px; min-height: 32px; font-size: 0.75rem; }
}

@media (max-width: 575.98px) {
  .content-area { padding: 12px; }
  .stat-card { flex-direction: row; align-items: center; }
  .btn-group-mobile { flex-direction: column !important; gap: 8px; }
  .hide-mobile { display: none !important; }
  .table-mobile-card { display: none; }
  .mobile-card-list { display: block !important; }
  .stat-value { font-size: 1.2rem; }
  .wallet-hero { padding: 20px; }
  .wallet-balance-amount { font-size: 1.75rem; }
}

@media (max-width: 425.98px) {
  .content-area { padding: 10px; }
  .card { border-radius: 14px; }
  .card-body { padding: 14px; }
  .login-card { padding: 24px 18px; border-radius: 18px; }
  .stat-card { padding: 14px 12px; }
}

@media (max-width: 375.98px) {
  .sidebar { width: 100%; }
  .top-navbar { padding: 0 12px; }
  .navbar-actions { gap: 6px; }
  .user-chip { display: none; }
}

/* Desktop enhancements */
@media (min-width: 1280px) {
  .content-area { padding: 32px; }
}
@media (min-width: 1440px) {
  :root { --sidebar-width: 268px; }
}
