@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 70px;
  --primary: #667eea;
  --primary-dark: #5568d3;
  --secondary: #764ba2;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --header-height: 70px;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --white: #fff;
  --gray-50: #f8fafc;
  --gray-900: #0f172a;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glass: 0 8px 32px 0 rgb(31 38 135 / 0.37);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 20px;
  --border-radius-sm: 12px;
  --border-radius-xs: 8px;
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --text-dark: #e2e8f0;
  --text-light: #94a3b8;
  --white: #1e293b;
  --gray-50: #0f172a;
  --glass-bg: rgba(30, 41, 59, 0.8);
  --glass-border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Dark Mode */
[data-theme="dark"] {
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --surface: #1e293b;
  --surface-2: #334155;
  --border: #475569;
  --glass-bg: rgba(30, 41, 59, 0.75);
  --glass-bg-hover: rgba(30, 41, 59, 0.9);
  --glass-border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --text-dark: #e2e8f0;
  --text-light: #94a3b8;
  --white: #1e293b;
  --gray-50: #0f172a;
  --glass-bg: rgba(30, 41, 59, 0.8);
  --glass-border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  transition: var(--transition);
}

a {
  text-decoration: none;
  color: inherit;
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
  z-index: 1000;
  transition: transform 0.3s ease, width 0.3s ease;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  min-height: var(--header-height);
}

.sidebar-logo {
  /* width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2); */
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.logo-text {
  color: white;
  font-weight: 600;
  font-size: 18px;
  transition: opacity 0.3s ease, width 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .logo-text {
  opacity: 0;
  width: 0;
}

.sidebar-menu {
  list-style: none;
  padding: 15px 0;
}

.sidebar-menu > li {
  margin-bottom: 5px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-left-color: #fff;
}

.sidebar-menu a i {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-menu a span {
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-menu a span {
  opacity: 0;
  width: 0;
}

/* Submenu */
.submenu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.submenu.active {
  max-height: 500px;
}

.submenu li a {
  padding-left: 52px;
  font-size: 14px;
}

.submenu-arrow {
  margin-left: auto;
  transition: transform 0.3s ease;
  font-size: 12px;
}

.submenu.active .submenu-arrow {
  transform: rotate(180deg);
}

.sidebar.collapsed .submenu {
  display: none !important;
}

/* ============================================
   HEADER STYLES
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  z-index: 998;
  padding: 0 30px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: left 0.3s ease;
}

.sidebar.collapsed ~ .main-wrapper .header {
  left: var(--sidebar-collapsed-width);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-light);
  padding: 10px;
  border-radius: var(--border-radius-xs);
  cursor: pointer;
  transition: var(--transition);
  display: none;
}

.menu-toggle:hover {
  background: #f0f2f5;
  color: var(--primary);
}

.header-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 20px;
}

.header-nav .nav-link {
  color: var(--text-light) !important;
  padding: 10px 16px !important;
  border-radius: var(--border-radius-sm) !important;
  font-weight: 500 !important;
  transition: var(--transition) !important;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.header-nav .nav-link:hover,
.header-nav .nav-link.active {
  background: rgba(102, 126, 234, 0.1) !important;
  color: var(--primary) !important;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.balance {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  font-weight: 500;
  font-size: 14px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
}

.user-dropdown {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--border-radius-xs);
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-dark);
}

.user-dropdown:hover {
  background: rgba(102, 126, 234, 0.08);
}

/* ============================================
   MAIN CONTENT WRAPPER
   ============================================ */
.main-wrapper {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
}

.page-content {
  padding: 2rem;
  max-width: 1440px;
  margin: 0 auto;
  animation: fadeIn 0.6s ease-out;
}

/* ============================================
   CARD STYLES
   ============================================ */
.card {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: white;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-body {
  padding: 2rem;
}

/* Charts Enhancement */
.chart-container {
  position: relative;
  height: 400px;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  margin-top: 1rem;
}

.chart-wrapper {
  padding: 2rem;
  height: 100%;
}

@media (max-width: 768px) {
  .chart-container {
    height: 300px;
  }
  
  .chart-wrapper {
    padding: 1rem;
  }
}

/* Dark mode chart bg */
[data-theme="dark"] .chart-container {
  background: var(--gray-900);
}

.card-title {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 15px;
}

/* Next Level Glassmorphism Stat Cards */
.glass-card, .stat-hero {
  backdrop-filter: blur(20px);
  background: var(--glass-bg);
  border: var(--glass-border);
  position: relative;
  overflow: hidden;
}

/* Advanced Filters & Header */
.analytics-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  color: white;
  position: relative;
  overflow: hidden;
}

.analytics-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.header-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .analytics-header {
    padding: 1.5rem;
  }
  
  .header-kpi {
    grid-template-columns: 1fr;
  }
}

.date-range-picker {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: white;
  backdrop-filter: blur(10px);
}

.date-range-picker:focus {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.5);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.2);
}

/* Data Tables */
.data-table-container {
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-top: 2rem;
}

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.analytics-table {
  margin: 0;
  width: 100%;
  min-width: 800px;
}

.analytics-table th {
  background: linear-gradient(135deg, var(--gray-50), white);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  padding: 1.25rem 1rem;
  border-bottom: 2px solid rgba(0,0,0,0.05);
}

.analytics-table td {
  padding: 1.25rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.analytics-table tbody tr:hover {
  background: rgba(102,126,234,0.05);
}

.status-badge {
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-approved { background: rgba(16,185,129,0.15); color: var(--success); }
.status-rejected { background: rgba(239,68,68,0.15); color: var(--danger); }

[data-theme="dark"] .analytics-table th {
  background: linear-gradient(135deg, var(--gray-900), var(--gray-800));
  border-bottom-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .analytics-table tbody tr:hover {
  background: rgba(102,126,234,0.15);
}

/* Quick Actions Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.quick-action-btn {
  height: 80px;
  border: 2px solid transparent;
  background: var(--glass-bg);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  border: var(--glass-border);
}

.quick-action-btn:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  background: rgba(102,126,234,0.1);
}

.quick-action-icon {
  font-size: 1.75rem;
  color: var(--primary);
}

.quick-action-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-dark);
}

@media (max-width: 768px) {
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .quick-action-btn {
    height: 70px;
  }
}

/* Dark mode toggle */
.theme-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--glass-bg);
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--primary);
  color: white;
  transform: rotate(180deg);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}

[data-theme="dark"] .glass-card::before {
  background: linear-gradient(90deg, transparent, rgba(148,163,184,0.3), transparent);
}

.stat-hero {
  display: flex;
  flex-direction: column;
  height: 140px;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.stat-hero:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: var(--shadow-xl), var(--shadow-glass);
}

.stat-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.stat-hero-primary .stat-hero-icon { background: rgba(102, 126, 234, 0.2); color: var(--primary); }
.stat-hero-success .stat-hero-icon { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.stat-hero-warning .stat-hero-icon { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.stat-hero-danger .stat-hero-icon { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.stat-hero-info .stat-hero-icon { background: rgba(59, 130, 246, 0.2); color: var(--info); }

[data-theme="dark"] .stat-hero-primary .stat-hero-icon { background: rgba(102, 126, 234, 0.3); }
[data-theme="dark"] .stat-hero-success .stat-hero-icon { background: rgba(16, 185, 129, 0.3); }
[data-theme="dark"] .stat-hero-warning .stat-hero-icon { background: rgba(245, 158, 11, 0.3); }
[data-theme="dark"] .stat-hero-danger .stat-hero-icon { background: rgba(239, 68, 68, 0.3); }
[data-theme="dark"] .stat-hero-info .stat-hero-icon { background: rgba(59, 130, 246, 0.3); }

.stat-hero-value {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, var(--text-dark), var(--text-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .stat-hero-value {
  background: linear-gradient(135deg, var(--text-light), var(--white));
}

.stat-hero-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-hero-change {
  margin-top: auto;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-hero-change.positive { color: var(--success); }
.stat-hero-change.negative { color: var(--danger); }

.stat-hero-change i { font-size: 0.75rem; }

/* Legacy stat-card compatibility */
.stat-card {
  border-radius: var(--border-radius);
  padding: 25px;
  color: white;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   TABLE STYLES
   ============================================ */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  background: white;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin: 0;
}

.table thead th {
  background: var(--primary);
  color: white;
  font-weight: 600;
  border: none;
  padding: 15px;
  white-space: nowrap;
}

.table tbody tr {
  transition: background 0.2s ease;
}

.table tbody tr:hover {
  background: #f8f9fa;
}

.table tbody td {
  padding: 15px;
  vertical-align: middle;
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.btn {
  border-radius: var(--border-radius-sm);
  padding: 10px 20px;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  background: linear-gradient(45deg, var(--primary-dark), var(--secondary));
}

.btn-secondary {
  background: #6c757d;
  border: none;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-group {
  margin-bottom: 20px;
}

.form-control {
  width: 100%;
  border-radius: var(--border-radius-xs);
  border: 1px solid #ddd;
  padding: 12px 15px;
  font-size: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: #f9f9f9;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: white;
  outline: none;
}

.form-label {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
  display: block;
}

/* ============================================
   BADGE STYLES
   ============================================ */
.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 12px;
}

.badge-primary {
  background: rgba(102, 126, 234, 0.15);
  color: var(--primary);
}

.badge-success {
  background: rgba(40, 167, 69, 0.15);
  color: #28a745;
}

.badge-warning {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}

.badge-danger {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
}

.badge-secondary {
  background: rgba(108, 117, 125, 0.15);
  color: #6c757d;
}

/* ============================================
   ALERT STYLES
   ============================================ */
.alert {
  border-radius: var(--border-radius-sm);
  padding: 15px 20px;
  border: none;
}

.alert-danger {
  background: #ffebee;
  color: #c62828;
  border-left: 4px solid #ef5350;
}

.alert-success {
  background: #e8f5e9;
  color: #2e7d32;
  border-left: 4px solid #66bb6a;
}

.alert-info {
  background: #e3f2fd;
  color: #1565c0;
  border-left: 4px solid #42a5f5;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-primary {
  color: var(--primary) !important;
}

.text-muted {
  color: var(--text-light) !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.p-4 {
  padding: 1.5rem !important;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Large Desktop */
@media (max-width: 1400px) {
  .page-content {
    padding: 25px;
  }
}

/* Desktop / Tablet Landscape */
@media (max-width: 1199px) {
  .header-nav {
    display: none !important;
  }
  
  .header-right {
    gap: 12px;
  }
  
  .balance {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* Tablet */
@media (max-width: 992px) {
  /* Sidebar becomes overlay */
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .sidebar.collapsed {
    width: var(--sidebar-width);
  }
  
  .sidebar.collapsed .logo-text,
  .sidebar.collapsed .sidebar-menu a span {
    opacity: 1;
    width: auto;
  }
  
  /* Header adjusts */
  .header {
    left: 0;
    padding: 0 20px;
  }
  
  .sidebar.collapsed ~ .main-wrapper .header {
    left: 0;
  }
  
  .header-left {
    gap: 10px;
  }
  
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Header right - keep balance and dropdown on right */
  .header-right {
    margin-left: auto;
    gap: 10px;
  }
  
  .balance {
    display: inline-flex;
    padding: 6px 12px;
    font-size: 13px;
  }
  
  /* Main wrapper */
  .main-wrapper {
    margin-left: 0;
  }
  
  .sidebar.collapsed ~ .main-wrapper {
    margin-left: 0;
  }
  
  /* Page content */
  .page-content {
    padding: 20px;
  }
  
  /* Cards in tablet */
  .card-body {
    padding: 20px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .page-content {
    padding: 15px;
  }
  
  /* Header */
  .header {
    padding: 0 15px;
    height: 60px;
  }
  
  .header-right {
    gap: 8px;
    margin-left: auto;
  }
  
  .balance {
    display: inline-flex;
    padding: 5px 10px;
    font-size: 12px;
  }
  
  .user-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  /* Cards */
  .card-body {
    padding: 15px;
  }
  
  /* Stat cards - stack on mobile */
  .stat-card {
    margin-bottom: 15px;
  }
  
  .stat-card .stat-value {
    font-size: 24px;
  }
  
  .stat-card .stat-icon {
    font-size: 30px;
  }
  
  /* Tables */
  .table {
    font-size: 13px;
  }
  
  .table thead th,
  .table tbody td {
    padding: 10px 8px;
  }
  
  /* Buttons */
  .btn {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  .btn-sm {
    padding: 5px 10px;
    font-size: 12px;
  }
  
  /* Forms */
  .form-control {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  /* Headings */
  h1, .h1 {
    font-size: 1.5rem;
  }
  
  h2, .h2 {
    font-size: 1.25rem;
  }
  
  h3, .h3 {
    font-size: 1.1rem;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .page-content {
    padding: 12px;
  }
  
  /* Hide more elements on small screens */
  .user-dropdown .user-name {
    display: none;
  }
  
  /* Form groups */
  .form-group {
    margin-bottom: 15px;
  }
  
  /* Table action buttons */
  .table .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    margin-bottom: 3px;
  }
  
  /* Dropdown menu on mobile */
  .dropdown-menu {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* ============================================
   LOGIN PAGE SPECIFIC
   ============================================ */
.login-page {
  min-height: 100vh;
  width: 100%;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.login-wrapper {
  background: white;
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  text-align: center;
  width: 100%;
  max-width: 450px;
  border-top: 5px solid var(--primary);
}

.login-wrapper .logo img {
  filter: drop-shadow(0 4px 8px rgba(0, 123, 255, 0.3));
  width: 80px;
  margin-bottom: 10px;
}

.login-wrapper h1 {
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 5px;
  font-size: 1.5rem;
}

.login-wrapper .subtitle {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 25px;
}

@media (min-width: 576px) {
  .login-wrapper {
    padding: 50px 40px;
  }
  
  .login-wrapper .logo img {
    width: 100px;
  }
  
  .login-wrapper h1 {
    font-size: 1.75rem;
  }
}

/* ============================================
   DROPDOWN MENU
   ============================================ */
.dropdown-menu {
  border: none;
  box-shadow: var(--shadow-md);
  border-radius: var(--border-radius-xs);
  padding: 8px;
  min-width: 180px;
}

.dropdown-item {
  border-radius: var(--border-radius-xs);
  padding: 10px 15px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-item:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary);
}

.dropdown-item i {
  width: 18px;
  text-align: center;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* ============================================
   TABLE RESPONSIVE - HORIZONTAL SCROLL
   ============================================ */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  min-width: 600px;
}

.table th,
.table td {
  white-space: nowrap;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  margin-bottom: 12px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  background: white;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.hide {
  opacity: 0;
  transform: translateX(100%);
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: #333;
}

.toast-message {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
}

/* Toast Types */
.toast-success {
  border-left: 4px solid #10b981;
}

.toast-success .toast-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.toast-warning {
  border-left: 4px solid #f59e0b;
}

.toast-warning .toast-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.toast-info {
  border-left: 4px solid #3b82f6;
}

.toast-info .toast-icon {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

/* Progress Bar for Auto-dismiss */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 12px 12px;
  transition: width linear;
}

.toast-success .toast-progress {
  background: #10b981;
}

.toast-error .toast-progress {
  background: #ef4444;
}

.toast-warning .toast-progress {
  background: #f59e0b;
}

.toast-info .toast-progress {
  background: #3b82f6;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .toast {
    padding: 12px 16px;
  }
}

/* ============================================
   PAGE LOADING SPINNER
   ============================================ */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loader.active {
  opacity: 1;
  visibility: visible;
}

.page-loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e0e0e0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.page-loader-text {
  margin-top: 15px;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 500;
}

/* Page Loader with Background Blur */
.page-loader.blur .main-wrapper {
  filter: blur(5px);
  pointer-events: none;
}

/* ============================================
   BUTTON LOADING STATE
   ============================================ */
.btn {
  position: relative;
}

.btn-loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading .btn-text {
  opacity: 0;
}

.btn-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.btn-loading .btn-spinner {
  display: block;
}

/* Secondary button spinner */
.btn-secondary.btn-loading .btn-spinner {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: white;
}

/* Outline button spinner */
.btn-outline-primary.btn-loading .btn-spinner {
  border-color: var(--primary);
  border-top-color: var(--primary);
}

/* ============================================
   SKELETON LOADERS
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius-xs);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-text.medium {
  width: 80%;
}

.skeleton-title {
  height: 24px;
  width: 70%;
  margin-bottom: 12px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-box {
  height: 100px;
  width: 100%;
}

.skeleton-card {
  padding: 20px;
  border-radius: var(--border-radius);
  background: white;
  box-shadow: var(--shadow-sm);
}

.skeleton-table-row {
  height: 50px;
  margin-bottom: 8px;
}

.skeleton-table {
  width: 100%;
}

.skeleton-table td {
  padding: 12px;
}

/* Skeleton List */
.skeleton-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.skeleton-list-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
}

.skeleton-list-item:last-child {
  border-bottom: none;
}

/* Skeleton Grid */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.skeleton-grid-item {
  height: 200px;
  border-radius: var(--border-radius);
}

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress {
  height: 8px;
  border-radius: 10px;
  background: #e9ecef;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
}

.progress-bar-striped {
  background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
  background-size: 1rem 1rem;
}

.progress-bar-animated {
  animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
  from {
    background-position: 1rem 0;
  }
  to {
    background-position: 0 0;
  }
}

/* Progress Bar Sizes */
.progress-sm {
  height: 4px;
}

.progress-lg {
  height: 12px;
}

.progress-xl {
  height: 20px;
}

/* Progress Bar Colors */
.progress-bar-success {
  background: linear-gradient(45deg, #10b981, #059669);
}

.progress-bar-warning {
  background: linear-gradient(45deg, #f59e0b, #d97706);
}

.progress-bar-danger {
  background: linear-gradient(45deg, #ef4444, #dc2626);
}

.progress-bar-info {
  background: linear-gradient(45deg, #3b82f6, #2563eb);
}

/* Progress Card */
.progress-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.progress-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-card-title {
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}

.progress-card-value {
  font-weight: 700;
  color: var(--primary);
}

/* File Upload Progress */
.file-upload-progress {
  margin-top: 15px;
}

.file-upload-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-light);
}

.file-upload-name {
  font-weight: 500;
  color: var(--text-dark);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Circular Progress */
.circular-progress {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 auto;
}

.circular-progress svg {
  transform: rotate(-90deg);
}

.circular-progress-bg {
  fill: none;
  stroke: #e9ecef;
  stroke-width: 6;
}

.circular-progress-bar {
  fill: none;
  stroke: var(--primary);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s ease;
}

.circular-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dark);
}

/* ============================================
   LOADING OVERLAY FOR CONTENT
   ============================================ */
.content-loader {
  position: relative;
  min-height: 200px;
}

.content-loader::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.content-loader .loader-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
}

/* ============================================
   ADAPTIVE LOADING STATES
   ============================================ */
@media (max-width: 768px) {
  .page-loader-spinner {
    width: 40px;
    height: 40px;
  }
  
  .page-loader-text {
    font-size: 13px;
  }
  
  .skeleton-grid {
    grid-template-columns: 1fr;
  }
  
  .skeleton-card {
    padding: 15px;
  }
}

@@ -1765,3 +1844,77 @@

/* reCAPTCHA UI FIX - Login Form Enhancement */
.g-recaptcha {
  margin-bottom: 0 !important;
}

/* Target the dynamic reCAPTCHA anchor container */
.grecaptcha-badge,
div[title="reCAPTCHA"] > div {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 340px !important;
  margin: 12px auto 0 !important;
  backdrop-filter: blur(20px) !important;
  background: var(--glass-bg) !important;
  border-radius: var(--border-radius-sm) !important;
  border: var(--glass-border) !important;
  box-shadow: var(--shadow-md) !important;
  overflow: hidden !important;
  transition: var(--transition) !important;
}

.grecaptcha-badge:hover,
div[title="reCAPTCHA"] > div:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* reCAPTCHA iframe styling */
.grecaptcha-badge iframe,
div[title="reCAPTCHA"] iframe {
  width: 100% !important;
  max-width: 304px !important;
  height: 78px !important;
  border-radius: var(--border-radius-xs) !important;
  border: none !important;
  background: transparent !important;
}

/* Internal reCAPTCHA elements - font, colors to match theme */
iframe ~ div.rc-anchor,
.rc-anchor-normal,
.rc-anchor-light,
.rc-anchor-dark {
  font-family: 'Poppins', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

.rc-anchor-primary {
  color: var(--text-dark) !important;
}

.rc-anchor-light .rc-anchor-primary {
  color: rgba(30, 41, 59, 0.9) !important;
}

/* Dark mode reCAPTCHA adaptation */
[data-theme="dark"] .grecaptcha-badge,
[data-theme="dark"] div[title="reCAPTCHA"] > div {
  background: var(--glass-bg) !important;
  border-color: var(--glass-border) !important;
}

.rc-anchor-dark .rc-anchor-primary {
  color: var(--text-light) !important;
}

/* Checkbox styling inside reCAPTCHA */
.rc-anchor-checkbox-label,
.rc-anchor-checkbox {
  border-radius: var(--border-radius-xs) !important;
}

/* Responsive mobile */
@media (max-width: 480px) {
  .grecaptcha-badge iframe,
  div[title="reCAPTCHA"] iframe {
    max-width: 280px !important;
    height: 70px !important;
  }
}

/* Ensure form integration */
.login-form .g-recaptcha {
  margin-top: 8px !important;
}

