/* ============================================================
   STUDENT INVOICES ACCOUNT DASHBOARD - PREMIUM V2
   Modern Glassmorphism + Neumorphism Design
   ============================================================ */

/* ===== CSS VARIABLES ===== */
:root {
  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --primary-light: #EEF2FF;
  --secondary: #EC4899;
  --secondary-dark: #DB2777;
  --accent: #06B6D4;
  --accent-dark: #0891B2;
  --success: #22C55E;
  --success-dark: #16A34A;
  --warning: #F59E0B;
  --warning-dark: #D97706;
  --danger: #EF4444;
  --danger-dark: #DC2626;
  --info: #3B82F6;
  --purple: #A855F7;
  --pink: #EC4899;
  --orange: #F97316;
  --teal: #14B8A6;

  --bg-body: #0F0F1A;
  --bg-card: #1A1A2E;
  --bg-card-hover: #222240;
  --bg-header: rgba(26, 26, 46, 0.95);
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border-color: rgba(99, 102, 241, 0.15);
  --border-glow: rgba(99, 102, 241, 0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.4);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-family: 'Poppins', sans-serif;
  --header-height: 80px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-bg: rgba(255,255,255,0.03);
  --glass-border: rgba(255,255,255,0.06);
}

/* ===== LIGHT MODE ===== */
[data-bs-theme="light"] {
  --bg-body: #F0F2FF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8F9FF;
  --bg-header: rgba(255,255,255,0.95);
  --text-primary: #1E1B4B;
  --text-secondary: #6366F1;
  --text-muted: #94A3B8;
  --border-color: rgba(99, 102, 241, 0.12);
  --border-glow: rgba(99, 102, 241, 0.2);
  --shadow-sm: 0 2px 8px rgba(99,102,241,0.06);
  --shadow-md: 0 8px 24px rgba(99,102,241,0.08);
  --shadow-lg: 0 16px 48px rgba(99,102,241,0.1);
  --shadow-xl: 0 24px 64px rgba(99,102,241,0.12);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.08);
  --glass-bg: rgba(99,102,241,0.02);
  --glass-border: rgba(99,102,241,0.08);
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 20% 50%, rgba(99,102,241,0.03) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(236,72,153,0.02) 0%, transparent 50%),
              radial-gradient(circle at 50% 80%, rgba(6,182,212,0.02) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

a { text-decoration: none; color: inherit; }

/* ===== LOADING SPINNER ===== */
.loading-spinner {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-spinner.hidden { opacity: 0; visibility: hidden; }

.spinner-content { text-align: center; }

.spinner-logo {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: pulseGlow 1.5s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(99,102,241,0.3);
}

.spinner-logo i { font-size: 36px; color: #fff; }

.spinner-text {
  margin-top: 16px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.5px;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(99,102,241,0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 60px rgba(99,102,241,0.5); }
}

/* ===== DASHBOARD WRAPPER ===== */
.dashboard-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   TOP HEADER - GLASSMORPHISM
   ============================================================ */
.top-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: all var(--transition);
}

.top-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
  opacity: 0.5;
}

.header-left { display: flex; align-items: center; }

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
  transition: transform var(--transition);
}

.header-brand:hover .brand-icon {
  transform: rotate(-5deg) scale(1.05);
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 400;
  opacity: 0.8;
}

.header-right { display: flex; align-items: center; justify-content: flex-end; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  background: var(--glass-bg);
}

.header-action-item:hover {
  background: rgba(99,102,241,0.08);
  border-color: var(--border-color);
  color: var(--primary);
  transform: translateY(-1px);
}

.header-action-btn {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.header-action-btn:hover {
  background: rgba(99,102,241,0.1);
  border-color: var(--border-color);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.notification-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 18px;
  background: linear-gradient(135deg, var(--danger), var(--secondary));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-header);
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ===== PROFILE DROPDOWN ===== */
.profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background: var(--glass-bg);
  cursor: pointer;
  transition: all var(--transition);
}

.profile-btn:hover {
  border-color: var(--primary);
  background: rgba(99,102,241,0.08);
  box-shadow: var(--shadow-glow);
}

.profile-avatar {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--primary);
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.online-status {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 10px; height: 10px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--bg-header);
  animation: pulseOnline 2s infinite;
}

@keyframes pulseOnline {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.profile-info { display: flex; flex-direction: column; text-align: left; }

.profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.profile-role {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.2;
}

/* ===== DROPDOWN MENUS ===== */
.notification-menu, .profile-menu {
  width: 360px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  margin-top: 12px !important;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  overflow: hidden;
}

.profile-menu { width: 280px; }

.dropdown-header-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  background: var(--glass-bg);
}

.dropdown-header-custom h6 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.notification-list { max-height: 300px; overflow-y: auto; }

.notification-item {
  display: flex !important;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 22px !important;
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition);
}

.notification-item:hover {
  background: rgba(99,102,241,0.05);
}

.notification-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.notification-content { flex: 1; }

.notification-text {
  font-size: 13px;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
}

.notification-time {
  font-size: 11px;
  color: var(--text-muted);
}

.dropdown-footer-custom {
  padding: 14px 22px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  background: var(--glass-bg);
}

.dropdown-footer-custom a {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

.profile-header-card {
  padding: 28px 22px;
  text-align: center;
  background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(236,72,153,0.05));
}

.profile-header-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 14px;
  border: 3px solid var(--primary);
  box-shadow: 0 0 20px rgba(99,102,241,0.3);
}

.profile-header-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-header-card h6 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-header-card span {
  font-size: 12px;
  color: var(--text-secondary);
}

.profile-menu .dropdown-item {
  padding: 12px 22px;
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition);
}

.profile-menu .dropdown-item i {
  font-size: 16px;
  width: 20px;
  color: var(--text-secondary);
}

.profile-menu .dropdown-item:hover {
  background: rgba(99,102,241,0.05);
  color: var(--primary);
}

.profile-menu .dropdown-item:hover i { color: var(--primary); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  padding: 32px;
}

/* ============================================================
   SECTION 1: GRADIENT SUMMARY CARDS - MODERN
   ============================================================ */
.summary-cards-section { margin-bottom: 28px; }

.summary-card {
  position: relative;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255,255,255,0.1);
}

.summary-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}

.summary-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.8s ease;
}

.summary-card:hover::after {
  transform: scale(1);
}

.summary-card-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 54px;
  height: 54px;
  background: rgba(255,255,255,0.12);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
}

.summary-card-content { position: relative; z-index: 1; }

.summary-card-label {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.summary-card-value {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.currency-symbol {
  font-size: 22px;
  font-weight: 600;
  margin-right: 2px;
  opacity: 0.8;
}

.summary-card-desc {
  font-size: 12px;
  opacity: 0.7;
  margin: 0;
}

.summary-card-glow {
  position: absolute;
  bottom: -30px;
  right: -30px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  filter: blur(30px);
}

/* New Gradient Backgrounds */
.gradient-purple {
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 50%, #4338CA 100%);
}

.gradient-pink {
  background: linear-gradient(135deg, #EC4899 0%, #DB2777 50%, #BE185D 100%);
}

.gradient-cyan {
  background: linear-gradient(135deg, #06B6D4 0%, #0891B2 50%, #0E7490 100%);
}

.gradient-green {
  background: linear-gradient(135deg, #22C55E 0%, #16A34A 50%, #15803D 100%);
}

.gradient-orange {
  background: linear-gradient(135deg, #F97316 0%, #EA580C 50%, #C2410C 100%);
}

/* ============================================================
   SECTION 2: SMALL STATISTIC CARDS - NEUMORPHISM
   ============================================================ */
.stats-cards-section { margin-bottom: 28px; }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 0 4px 4px 0;
  transition: all var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-glow);
}

.stat-card:hover::before {
  width: 6px;
}

.stat-card-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  transition: all var(--transition);
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(-5deg);
}

.stat-info { display: flex; flex-direction: column; }

.stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 4px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.currency-symbol-sm {
  font-size: 16px;
  font-weight: 600;
  margin-right: 1px;
  color: var(--text-secondary);
}

.stat-card-right { text-align: right; }

.stat-growth {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat-growth.positive {
  background: rgba(34,197,94,0.1);
  color: var(--success);
  border: 1px solid rgba(34,197,94,0.2);
}

.stat-growth.negative {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
}

/* Soft Backgrounds */
.bg-green-soft { background: rgba(34,197,94,0.1); }
.bg-orange-soft { background: rgba(249,115,22,0.1); }
.bg-red-soft { background: rgba(239,68,68,0.1); }
.bg-blue-soft { background: rgba(59,130,246,0.1); }

.text-green { color: var(--success); }
.text-orange { color: var(--orange); }
.text-red { color: var(--danger); }
.text-blue { color: var(--info); }

/* Stat card accent lines */
.stat-card:nth-child(1)::before { background: var(--success); }
.stat-card:nth-child(2)::before { background: var(--warning); }
.stat-card:nth-child(3)::before { background: var(--danger); }
.stat-card:nth-child(4)::before { background: var(--info); }

/* ============================================================
   SECTION 3: ADVANCED FILTERS - GLASS CARD
   ============================================================ */
.filter-section { margin-bottom: 28px; }

.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition);
}

.filter-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-glow);
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--glass-bg);
}

.filter-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-header-left i {
  font-size: 20px;
  color: var(--primary);
  background: rgba(99,102,241,0.1);
  padding: 8px;
  border-radius: 10px;
}

.filter-header-left h5 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.filter-body {
  padding: 24px;
  transition: all 0.3s ease;
}

.filter-body.collapsed {
  max-height: 0;
  padding: 0 24px;
  overflow: hidden;
}

.filter-body .form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-body .form-control,
.filter-body .form-select {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-body);
  color: var(--text-primary);
  transition: all var(--transition);
}

.filter-body .form-control:focus,
.filter-body .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
  background: var(--bg-card);
}

.filter-btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  transition: all var(--transition);
  white-space: nowrap;
}

.filter-btn.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: #fff;
}

.filter-btn.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}

.filter-btn.btn-outline-secondary {
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.filter-btn.btn-outline-secondary:hover {
  background: rgba(99,102,241,0.05);
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.btn-outline-success {
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--success);
}

.filter-btn.btn-outline-success:hover {
  background: rgba(34,197,94,0.1);
  border-color: var(--success);
}

/* ============================================================
   SECTION 4: CHARTS - MODERN CARDS
   ============================================================ */
.charts-section { margin-bottom: 28px; }

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition);
}

.chart-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-glow);
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
  background: var(--glass-bg);
}

.chart-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-card-title i {
  font-size: 20px;
  color: var(--primary);
  background: rgba(99,102,241,0.1);
  padding: 8px;
  border-radius: 10px;
}

.chart-card-title h5 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-card-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chart-legend-inline {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.chart-card-body {
  padding: 24px;
  min-height: 350px;
  position: relative;
}

/* Doughnut Chart */
.doughnut-wrapper {
  position: relative;
  width: 240px;
  height: 240px;
}

.doughnut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.doughnut-total {
  display: block;
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.doughnut-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.chart-legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 24px 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  font-size: 12px;
  transition: all var(--transition);
}

.legend-item:hover {
  background: rgba(99,102,241,0.05);
  border-color: var(--border-glow);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

.legend-name {
  color: var(--text-secondary);
  font-weight: 500;
}

.legend-value {
  color: var(--text-primary);
  font-weight: 700;
  margin-left: auto;
}

/* ============================================================
   SECTION 5: DATATABLE - MODERN
   ============================================================ */
.table-section { margin-bottom: 28px; }

.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition);
}

.table-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-glow);
}

.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
  background: var(--glass-bg);
}

.table-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-card-title i {
  font-size: 20px;
  color: var(--primary);
  background: rgba(99,102,241,0.1);
  padding: 8px;
  border-radius: 10px;
}

.table-card-title h5 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.table-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 4px 12px;
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: 50px;
}

.table-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-card-actions .btn {
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  transition: all var(--transition);
}

.table-card-actions .btn-outline-primary {
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--primary);
}

.table-card-actions .btn-outline-primary:hover {
  background: rgba(99,102,241,0.1);
  border-color: var(--primary);
}

.table-card-actions .btn-outline-success {
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--success);
}

.table-card-actions .btn-outline-success:hover {
  background: rgba(34,197,94,0.1);
  border-color: var(--success);
}

.table-card-actions .btn-outline-danger {
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger);
}

.table-card-actions .btn-outline-danger:hover {
  background: rgba(239,68,68,0.1);
  border-color: var(--danger);
}

.table-card-body { padding: 0; }

/* ===== DataTables Customization ===== */
#invoicesTable { margin: 0 !important; border: none !important; }

#invoicesTable thead th {
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 14px 16px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

#invoicesTable tbody td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

#invoicesTable tbody tr:hover {
  background: rgba(99,102,241,0.03);
}

#invoicesTable tbody tr:last-child td {
  border-bottom: none;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.status-badge.paid {
  background: rgba(34,197,94,0.12);
  color: var(--success);
  border: 1px solid rgba(34,197,94,0.2);
}

.status-badge.partial {
  background: rgba(249,115,22,0.12);
  color: var(--orange);
  border: 1px solid rgba(249,115,22,0.2);
}

.status-badge.pending {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
}

.status-badge.cancelled {
  background: rgba(100,116,139,0.12);
  color: var(--text-muted);
  border: 1px solid rgba(100,116,139,0.2);
}

/* Student Photo in Table */
.student-photo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  transition: all var(--transition);
}

.student-photo:hover {
  border-color: var(--primary);
  transform: scale(1.1);
}

/* DOB Badge */
.dob-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(59,130,246,0.1);
  color: var(--info);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

/* Action Dropdown */
.action-dropdown .dropdown-toggle {
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  border-radius: 8px;
  transition: all var(--transition);
}

.action-dropdown .dropdown-toggle:hover {
  background: rgba(99,102,241,0.1);
  color: var(--primary);
}

.action-dropdown .dropdown-menu {
  min-width: 200px;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card);
}

.action-dropdown .dropdown-item {
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  transition: all var(--transition);
}

.action-dropdown .dropdown-item i {
  font-size: 14px;
  width: 18px;
  color: var(--text-secondary);
}

.action-dropdown .dropdown-item:hover {
  background: rgba(99,102,241,0.05);
  color: var(--primary);
}

.action-dropdown .dropdown-item:hover i {
  color: var(--primary);
}

.action-dropdown .dropdown-item.text-danger:hover {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
}

.action-dropdown .dropdown-item.text-danger:hover i {
  color: var(--danger);
}

/* DataTables Search & Info */
.dataTables_wrapper .dataTables_filter {
  padding: 16px 24px 8px;
}

.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  background: var(--bg-body);
  color: var(--text-primary);
  margin-left: 8px;
  outline: none;
  transition: all var(--transition);
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

.dataTables_wrapper .dataTables_length {
  padding: 16px 24px 8px;
}

.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  background: var(--bg-body);
  color: var(--text-primary);
  margin: 0 4px;
}

.dataTables_wrapper .dataTables_info {
  padding: 14px 24px;
  font-size: 13px;
  color: var(--text-secondary);
}

.dataTables_wrapper .dataTables_paginate {
  padding: 14px 24px;
}

.dataTables_wrapper .paginate_button {
  padding: 8px 16px !important;
  margin: 0 3px;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  font-size: 13px;
  color: var(--text-secondary) !important;
  background: transparent !important;
  transition: all var(--transition);
}

.dataTables_wrapper .paginate_button:hover {
  background: rgba(99,102,241,0.08) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.dataTables_wrapper .paginate_button.current {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3) !important;
}

.dataTables_wrapper .paginate_button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* FixedHeader */
.fixedHeader-floating {
  background: var(--bg-card) !important;
  box-shadow: var(--shadow-md) !important;
  border-bottom: 2px solid var(--border-color) !important;
}

/* ============================================================
   FOOTER
   ============================================================ */
.main-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 20px 32px;
  margin-top: auto;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-copyright {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-copyright strong {
  color: var(--primary);
}

.footer-version {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-accent { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }
.text-purple { color: var(--purple) !important; }
.text-pink { color: var(--pink) !important; }
.text-orange { color: var(--orange) !important; }

.bg-primary-soft { background: rgba(99,102,241,0.08); }
.bg-secondary-soft { background: rgba(236,72,153,0.08); }
.bg-success-soft { background: rgba(34,197,94,0.08); }
.bg-warning-soft { background: rgba(245,158,11,0.08); }
.bg-danger-soft { background: rgba(239,68,68,0.08); }
.bg-info-soft { background: rgba(59,130,246,0.08); }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.summary-card,
.stat-card,
.filter-card,
.chart-card,
.table-card {
  animation: fadeInUp 0.6s ease forwards;
}

.summary-card:nth-child(1) { animation-delay: 0.05s; }
.summary-card:nth-child(2) { animation-delay: 0.10s; }
.summary-card:nth-child(3) { animation-delay: 0.15s; }
.summary-card:nth-child(4) { animation-delay: 0.20s; }
.summary-card:nth-child(5) { animation-delay: 0.25s; }

/* ===== SELECT2 OVERRIDES ===== */
.select2-container--default .select2-selection--single {
  height: 42px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-body);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 42px;
  font-size: 13px;
  color: var(--text-primary);
  padding-left: 14px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.select2-dropdown {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  background: var(--bg-card);
}

/* ===== DATERANGEPICKER OVERRIDES ===== */
.daterangepicker {
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-xl) !important;
  font-family: var(--font-family) !important;
  background: var(--bg-card) !important;
}

.daterangepicker .ranges li.active {
  background: var(--primary) !important;
}

.daterangepicker td.active, .daterangepicker td.active:hover {
  background: var(--primary) !important;
}

.daterangepicker td.in-range {
  background: rgba(99,102,241,0.1) !important;
}

.daterangepicker .drp-buttons .btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}

/* ===== PRINT STYLES ===== */
@media print {
  .top-header,
  .filter-section,
  .charts-section,
  .main-footer,
  .table-card-header .table-card-actions,
  .dataTables_filter,
  .dataTables_length,
  .dataTables_paginate,
  .action-dropdown {
    display: none !important;
  }

  .main-content {
    padding: 0 !important;
  }

  .table-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  #invoicesTable thead th {
    background: #f5f5f5 !important;
    color: #000 !important;
  }

  #invoicesTable tbody td {
    color: #000 !important;
  }

  .status-badge.paid { background: #d4edda !important; color: #155724 !important; }
  .status-badge.partial { background: #fff3cd !important; color: #856404 !important; }
  .status-badge.pending { background: #f8d7da !important; color: #721c24 !important; }
  .status-badge.cancelled { background: #e2e3e5 !important; color: #383d41 !important; }
}

/* ===== CURRENCY BADGE ROW ===== */
.currency-badge-row {
  display: flex;
  align-items: center;
}
.currency-badge-row .badge {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ===== FOOTER TOTALS BADGES (matching reference page) ===== */
.all-amnt-bdge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin: 4px 6px;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.all-amnt-bdge strong {
  font-weight: 600;
}
.all-amnt-bdge span {
  color: #fff;
  font-weight: 700;
}

[data-bs-theme="light"] .all-amnt-bdge {
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #fff;
}
[data-bs-theme="light"] .all-amnt-bdge span {
  color: #fff;
}

/* ===== DATA TABLE BUTTONS ===== */
.data-tbl-bttn {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  color: #fff !important;
  border: none !important;
  padding: 8px 18px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all var(--transition) !important;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3) !important;
  margin: 4px !important;
}
.data-tbl-bttn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4) !important;
}
.data-tbl-bttn i {
  margin-right: 6px;
}

/* ===== BADGE STYLES FOR REFERENCE PAGE ===== */
.badge-inverse-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: inline-block;
  margin: 2px;
  transition: all 0.2s;
}
.badge-inverse-warning:hover {
  background: rgba(245, 158, 11, 0.2);
}
.badge-inverse-info {
  background: rgba(6, 182, 212, 0.12);
  color: #0891b2;
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: inline-block;
  margin: 2px;
  transition: all 0.2s;
}
.badge-inverse-info:hover {
  background: rgba(6, 182, 212, 0.2);
}
.badge-inverse-success {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  display: inline-block;
  margin: 2px;
}
.badge-inverse-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: inline-block;
  margin: 2px;
  transition: all 0.2s;
}
.badge-inverse-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}
.rcpt-pymnt-btn {
  font-size: 11px !important;
  white-space: nowrap;
}
.tbl-smll-btn {
  padding: 2px 8px !important;
  font-size: 11px !important;
  border-radius: 4px !important;
  margin: 1px !important;
}


