/* ============================================================
   NGO Management System - Global CSS
   Dark Mode + Light Mode + Design System
   ============================================================ */

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

/* ============================================================
   CSS VARIABLES — LIGHT MODE (default)
   ============================================================ */
:root,
[data-theme="light"] {
  /* Brand */
  --brand-primary:   #2563eb;
  --brand-secondary: #7c3aed;
  --brand-accent:    #0891b2;
  --brand-success:   #059669;
  --brand-warning:   #d97706;
  --brand-danger:    #dc2626;
  --brand-info:      #0284c7;

  /* Gradient */
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-success: linear-gradient(135deg, #059669 0%, #0891b2 100%);
  --gradient-warm:    linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);

  /* Background */
  --bg-body:         #f0f4f8;
  --bg-card:         #ffffff;
  --bg-sidebar:      #ffffff; /* Clean white sidebar */
  --bg-topbar:       #ffffff;
  --bg-input:        #ffffff;
  --bg-hover:        #f1f5f9;
  --bg-table-stripe: #f8fafc;
  --bg-modal:        #ffffff;
  --bg-dropdown:     #ffffff;
  --bg-code:         #f1f5f9;

  /* Text */
  --text-primary:    #0f172a;
  --text-secondary:  #475569;
  --text-muted:      #94a3b8;
  --text-on-dark:    #f8fafc;
  --text-link:       #2563eb;
  --text-sidebar:    #475569; /* Darker text for white sidebar */
  --text-sidebar-active: #2563eb;

  /* Borders */
  --border-color:    #e2e8f0;
  --border-input:    #cbd5e1;
  --border-focus:    #2563eb;
  --border-radius:   10px;
  --border-radius-sm: 6px;
  --border-radius-lg: 16px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:  0 10px 25px rgba(0,0,0,.10), 0 4px 6px rgba(0,0,0,.06);
  --shadow-card:0 2px 12px rgba(37,99,235,.07);

  /* Sidebar */
  --sidebar-width: 260px;
  --topbar-height: 65px;

  /* Transition */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   CSS VARIABLES — DARK MODE
   ============================================================ */
[data-theme="dark"] {
  /* Brand stays same */
  --brand-primary:   #3b82f6;
  --brand-secondary: #8b5cf6;
  --brand-accent:    #06b6d4;
  --brand-success:   #10b981;
  --brand-warning:   #f59e0b;
  --brand-danger:    #ef4444;
  --brand-info:      #38bdf8;

  /* Gradient */
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);

  /* Background */
  --bg-body:         #0f172a;
  --bg-card:         #1e293b;
  --bg-sidebar:      #1e3a8a; /* Soft deep blue for dark mode */
  --bg-topbar:       #1e293b;
  --bg-input:        #1e293b;
  --bg-hover:        #2d3f55;
  --bg-table-stripe: #243447;
  --bg-modal:        #1e293b;
  --bg-dropdown:     #1e293b;
  --bg-code:         #0f172a;

  /* Text */
  --text-primary:    #f1f5f9;
  --text-secondary:  #94a3b8;
  --text-muted:      #64748b;
  --text-on-dark:    #f8fafc;
  --text-link:       #60a5fa;
  --text-sidebar:    #94a3b8;
  --text-sidebar-active: #ffffff;

  /* Borders */
  --border-color:    #334155;
  --border-input:    #475569;
  --border-focus:    #3b82f6;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.25);
  --shadow-md:  0 4px 6px rgba(0,0,0,.30);
  --shadow-lg:  0 10px 25px rgba(0,0,0,.40);
  --shadow-card:0 2px 12px rgba(0,0,0,.25);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-body);
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { opacity: 0.85; }

img { max-width: 100%; height: auto; }

h1,h2,h3,h4,h5,h6 {
  font-family: 'Poppins', sans-serif;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0; left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-brand-icon {
  width: 40px; height: 40px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  flex-shrink: 0;
}
.sidebar-brand-text { line-height: 1.2; }
.sidebar-brand-name {
  font-family: 'Poppins', sans-serif;
  font-size: 13.5px; font-weight: 700;
  color: var(--text-primary); display: block;
}
.sidebar-brand-sub {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
}

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.sidebar-section-title {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-muted);
  padding: 16px 20px 6px;
}

.sidebar-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 20px;
  color: var(--text-sidebar);
  font-size: 13.5px; font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}
.sidebar-link:hover {
  color: var(--text-sidebar-active);
  background: rgba(0,0,0,.04);
}
.sidebar-link.active {
  color: var(--text-sidebar-active);
  background: rgba(37,99,235,.08);
  font-weight: 600;
}
.sidebar-link.active::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand-primary);
  border-radius: 0 3px 3px 0;
}
.sidebar-link i { width: 18px; text-align: center; font-size: 14px; opacity: .9; }
.sidebar-link .badge { margin-left: auto; font-size: 10px; }

/* Sub-menu */
.sidebar-submenu { padding-left: 48px; }
.sidebar-submenu .sidebar-link {
  font-size: 13px; padding: 8px 16px;
  color: rgba(203,213,225,.7);
}
.sidebar-submenu .sidebar-link:hover,
.sidebar-submenu .sidebar-link.active { color: #fff; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary); display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px; color: var(--text-muted);
  text-transform: capitalize;
}

/* MAIN CONTENT AREA */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  transition: margin-left 0.3s ease;
}

/* TOPBAR */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 1030;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.topbar-toggle {
  background: none; border: none;
  color: var(--text-secondary); font-size: 20px;
  cursor: pointer; padding: 6px;
  border-radius: 6px; transition: var(--transition);
  display: none;
}
.topbar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.topbar-title {
  font-family: 'Poppins', sans-serif;
  font-size: 17px; font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}
.topbar-search {
  position: relative;
}
.topbar-search input {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px 8px 38px;
  border-radius: 20px;
  font-size: 13.5px;
  width: 220px;
  transition: var(--transition);
}
.topbar-search input:focus {
  outline: none; border-color: var(--border-focus);
  width: 280px; box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  background: var(--bg-card);
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-btn {
  background: none; border: none;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 16px;
  cursor: pointer; transition: var(--transition); position: relative;
}
.topbar-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.topbar-btn .notif-badge {
  position: absolute; top: 5px; right: 5px;
  background: var(--brand-danger); color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 5px 10px;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  transition: var(--transition);
}
.theme-toggle:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.theme-toggle i { font-size: 14px; }

/* User dropdown in topbar */
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 6px 10px;
  border-radius: 10px; transition: var(--transition);
}
.topbar-user:hover { background: var(--bg-hover); }
.topbar-user-name {
  font-size: 13.5px; font-weight: 600;
  color: var(--text-primary); max-width: 120px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-user-role {
  font-size: 11px; color: var(--text-muted);
  text-transform: capitalize; line-height: 1;
}

/* PAGE CONTENT */
.page-content, .content-container {
  padding: 28px;
  flex: 1;
}
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.page-header-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.breadcrumb { font-size: 13px; }
.breadcrumb-item a { color: var(--text-link); }
.breadcrumb-item.active { color: var(--text-muted); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.25s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.card-title {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary); margin: 0;
}
.card-body { padding: 20px; }
.card-footer {
  background: transparent;
  border-top: 1px solid var(--border-color);
  padding: 14px 20px;
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  min-height: 135px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat-card > div:last-child {
  margin-top: auto;
  position: relative;
  z-index: 2;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 100%; height: 4px; z-index: 1;
}
.stat-card.primary::before   { background: var(--brand-primary); }
.stat-card.success::before   { background: var(--brand-success); }
.stat-card.warning::before   { background: var(--brand-warning); }
.stat-card.danger::before    { background: var(--brand-danger); }
.stat-card.info::before      { background: var(--brand-info); }
.stat-card.secondary::before { background: var(--brand-secondary); }

.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-icon {
  position: absolute;
  top: 20px; right: 20px;
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 2;
}
.stat-icon.primary   { background: var(--gradient-primary); }
.stat-icon.success   { background: var(--gradient-success); }
.stat-icon.warning   { background: var(--gradient-warm); }
.stat-icon.danger    { background: linear-gradient(135deg,#dc2626,#f97316); }
.stat-icon.info      { background: linear-gradient(135deg,#0284c7,#06b6d4); }
.stat-icon.secondary { background: linear-gradient(135deg,#7c3aed,#a855f7); }

.stat-value {
  font-family: 'Poppins', sans-serif;
  font-size: 28px; font-weight: 700;
  color: var(--text-primary); line-height: 1;
  margin-bottom: 8px;
}
.stat-label {
  font-size: 13.5px; color: var(--text-secondary); font-weight: 500;
  line-height: 1.3;
}
.stat-change {
  font-size: 12px; margin-top: 6px; font-weight: 500;
}
.stat-change.up   { color: var(--brand-success); }
.stat-change.down { color: var(--brand-danger); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--border-radius);
}
.table {
  width: 100%; border-collapse: collapse;
  color: var(--text-primary);
  background: transparent !important;
  --bs-table-bg: transparent;
  --bs-table-accent-bg: transparent;
  --bs-table-color: var(--text-primary);
}
.table > :not(caption) > * > * {
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text-primary) !important;
}
.table th {
  background: var(--bg-body) !important;
  color: var(--text-secondary);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 13.5px; vertical-align: middle;
  background: transparent !important;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-hover) !important; }
.table-striped tbody tr:nth-child(even) td { background: var(--bg-table-stripe) !important; }
.table-striped tbody tr:nth-child(even):hover td { background: var(--bg-hover) !important; }

/* ============================================================
   FORMS
   ============================================================ */
.form-label {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary); margin-bottom: 6px;
  display: block;
}
.form-control, .form-select {
  background: var(--bg-input);
  border: 1.5px solid var(--border-input);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 14px; font-family: 'Inter', sans-serif;
  padding: 9px 14px;
  width: 100%;
  transition: var(--transition);
  appearance: auto;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  background: var(--bg-card);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled, .form-select:disabled {
  background: var(--bg-body); opacity: .7; cursor: not-allowed;
}
textarea.form-control { min-height: 100px; resize: vertical; }
.form-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.invalid-feedback { font-size: 12px; color: var(--brand-danger); }
.form-check-input {
  border-color: var(--border-input);
  background-color: var(--bg-input);
}
.form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.form-check-label { font-size: 13.5px; color: var(--text-primary); }
.input-group-text {
  background: var(--bg-body);
  border-color: var(--border-input);
  color: var(--text-secondary);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px; font-weight: 600;
  padding: 9px 20px;
  border-radius: var(--border-radius-sm);
  border: none; cursor: pointer;
  transition: var(--transition);
  display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 8px; }
.btn-icon.btn-sm { width: 30px; height: 30px; border-radius: 6px; }

.btn-primary { background: var(--gradient-primary); color: #fff; box-shadow: 0 4px 15px rgba(37,99,235,.3); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(37,99,235,.4); color: #fff; }
.btn-success { background: var(--gradient-success); color: #fff; box-shadow: 0 4px 12px rgba(5,150,105,.25); }
.btn-success:hover { color: #fff; box-shadow: 0 6px 16px rgba(5,150,105,.35); }
.btn-danger  { background: linear-gradient(135deg,#dc2626,#f97316); color: #fff; box-shadow: 0 4px 12px rgba(220,38,38,.25); }
.btn-danger:hover  { color: #fff; }
.btn-warning { background: linear-gradient(135deg,#d97706,#f59e0b); color: #fff; }
.btn-warning:hover { color: #fff; }
.btn-info    { background: linear-gradient(135deg,#0284c7,#06b6d4); color: #fff; }
.btn-info:hover    { color: #fff; }
.btn-secondary { background: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--border-color); box-shadow: none; }
.btn-secondary:hover { background: var(--border-color); }
.btn-outline-primary { background: transparent; color: var(--brand-primary); border: 1.5px solid var(--brand-primary); }
.btn-outline-primary:hover { background: var(--brand-primary); color: #fff; }
.btn-outline-danger { background: transparent; color: var(--brand-danger); border: 1.5px solid var(--brand-danger); }
.btn-outline-danger:hover { background: var(--brand-danger); color: #fff; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  display: inline-block; letter-spacing: .2px;
}
.badge-sm { font-size: 10px; padding: 3px 8px; }
.bg-primary   { background: var(--brand-primary) !important; color: #fff !important; }
.bg-success   { background: var(--brand-success) !important; color: #fff !important; }
.bg-danger    { background: var(--brand-danger)  !important; color: #fff !important; }
.bg-warning   { background: var(--brand-warning) !important; color: #fff !important; }
.bg-info      { background: var(--brand-info)    !important; color: #fff !important; }
.bg-secondary { background: var(--text-muted)    !important; color: #fff !important; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 14px 18px; border-radius: var(--border-radius-sm);
  font-size: 13.5px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid transparent;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-success { background: rgba(5,150,105,.1); border-color: rgba(5,150,105,.3); color: #047857; }
.alert-danger  { background: rgba(220,38,38,.1);  border-color: rgba(220,38,38,.3);  color: #b91c1c; }
.alert-warning { background: rgba(217,119,6,.1);  border-color: rgba(217,119,6,.3);  color: #b45309; }
.alert-info    { background: rgba(2,132,199,.1);  border-color: rgba(2,132,199,.3);  color: #0369a1; }

[data-theme="dark"] .alert-success { color: #34d399; }
[data-theme="dark"] .alert-danger  { color: #f87171; }
[data-theme="dark"] .alert-warning { color: #fbbf24; }
[data-theme="dark"] .alert-info    { color: #38bdf8; }

.alert-dismissible .btn-close {
  margin-left: auto; background-color: transparent;
  padding: 4px; opacity: .6;
  filter: var(--btn-close-filter, none);
}
[data-theme="dark"] .btn-close { filter: invert(1); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-content {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
}
.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 18px 22px;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-body { padding: 22px; color: var(--text-primary); }
.modal-footer { border-top: 1px solid var(--border-color); padding: 14px 22px; }
[data-theme="dark"] .modal-backdrop { --bs-backdrop-bg: #000; }

/* ============================================================
   DROPDOWNS
   ============================================================ */
.dropdown-menu {
  background: var(--bg-dropdown);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 180px;
}
.dropdown-item {
  color: var(--text-primary);
  font-size: 13.5px; border-radius: 6px;
  padding: 9px 14px;
  transition: var(--transition);
  display: flex; align-items: center; gap: 9px;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-divider { border-color: var(--border-color); margin: 4px 0; }
.dropdown-header { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); padding: 8px 14px 4px; }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress {
  background: var(--bg-body);
  border-radius: 20px; height: 8px;
  overflow: hidden; border: 1px solid var(--border-color);
}
.progress-bar {
  background: var(--gradient-primary);
  border-radius: 20px;
  transition: width 1s ease;
}
.progress-bar.success { background: var(--gradient-success); }
.progress-bar.warning { background: var(--gradient-warm); }

/* ============================================================
   AVATAR / PROFILE PHOTO
   ============================================================ */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 80px; height: 80px; }
.avatar-initials {
  font-weight: 600; color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   NOTIFICATION PANEL
   ============================================================ */
.notif-dropdown { width: 340px; padding: 0; }
.notif-header { padding: 14px 16px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--border-color); color: var(--text-primary); }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border-color);
  transition: var(--transition); cursor: pointer;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: rgba(37,99,235,.05); }
[data-theme="dark"] .notif-item.unread { background: rgba(59,130,246,.1); }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.notif-msg { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-footer { padding: 10px 16px; text-align: center; font-size: 13px; border-top: 1px solid var(--border-color); }

/* ============================================================
   SEARCH & FILTER BAR
   ============================================================ */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
}
.filter-bar .form-control,
.filter-bar .form-select { min-width: 160px; flex: 1; max-width: 220px; }
.filter-bar .btn { flex-shrink: 0; }

/* ============================================================
   CHART CONTAINERS
   ============================================================ */
.chart-container { position: relative; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-primary-c { color: var(--brand-primary) !important; }
.text-success-c { color: var(--brand-success) !important; }
.text-danger-c  { color: var(--brand-danger)  !important; }
.text-warning-c { color: var(--brand-warning) !important; }
.text-muted-c   { color: var(--text-muted)    !important; }

.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.divider { height: 1px; background: var(--border-color); margin: 16px 0; }

.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state i { font-size: 52px; opacity: .4; margin-bottom: 16px; display: block; color: var(--text-secondary); }
.empty-state p { font-size: 15px; font-weight: 500; }

/* Loading spinner */
.spinner-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.spinner-border { color: var(--brand-primary) !important; }

/* Scrollbar global */
* { scrollbar-width: thin; scrollbar-color: var(--border-color) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0,0,0,.3);
  }
  .main-content { margin-left: 0; }
  .topbar-toggle { display: flex; }
  .topbar-search input { width: 160px; }
  .topbar-search input:focus { width: 200px; }
  .page-content, .content-container { padding: 16px; }
  .sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1039;
    display: none;
  }
  .sidebar-overlay.show { display: block; }
}

@media (max-width: 575.98px) {
  .topbar-search { display: none; }
  .topbar-user-name { display: none; }
  .stat-value { font-size: 22px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-content, .content-container { padding: 12px; }
  .row.g-4 > * { padding-left: 8px; padding-right: 8px; }
  .stat-card { padding: 16px; }
  .stat-card-value { font-size: 26px; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideIn { from { transform:translateX(-20px); opacity:0; } to { transform:translateX(0); opacity:1; } }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.5;} }

.fade-in   { animation: fadeIn .35s ease forwards; }
.slide-in  { animation: slideIn .3s ease forwards; }
.pulse-anim { animation: pulse 2s infinite; }

/* Staggered card animation */
.stat-card:nth-child(1) { animation: fadeIn .3s ease .0s both; }
.stat-card:nth-child(2) { animation: fadeIn .3s ease .08s both; }
.stat-card:nth-child(3) { animation: fadeIn .3s ease .16s both; }
.stat-card:nth-child(4) { animation: fadeIn .3s ease .24s both; }
.stat-card:nth-child(5) { animation: fadeIn .3s ease .32s both; }
.stat-card:nth-child(6) { animation: fadeIn .3s ease .40s both; }

/* ============================================================
   FONT WEIGHT UTILITIES
   ============================================================ */
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.flex-1 { flex: 1; }
.text-info-c { color: var(--brand-info) !important; }
.text-warning-c { color: var(--brand-warning) !important; }

/* ============================================================
   AMOUNT SELECTOR (Donation page)
   ============================================================ */
.amount-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.amount-btn {
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  border-radius: var(--border-radius-sm);
  padding: 12px 8px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}
.amount-btn:hover, .amount-btn.active {
  border-color: var(--brand-primary);
  background: rgba(37,99,235,.06);
  color: var(--brand-primary);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast-msg {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 12px;
  animation: slideToast .3s ease;
  max-width: 320px;
}
@keyframes slideToast { from { transform: translateX(120%); opacity:0; } to { transform: translateX(0); opacity:1; } }

/* ============================================================
   BORDER UTILITIES
   ============================================================ */
.border-0 { border: none !important; }
.rounded-circle { border-radius: 50% !important; }
.ms-1 { margin-left: 4px !important; }
.ms-2 { margin-left: 8px !important; }
.w-100 { width: 100% !important; }
.position-relative { position: relative !important; }
.z-1 { z-index: 1; }

/* Settings Sidebar Link overrides (when placed inside cards) */
.card .sidebar-link {
  color: var(--text-secondary) !important;
  transition: var(--transition);
}
.card .sidebar-link:hover {
  color: var(--text-primary) !important;
  background-color: var(--bg-hover) !important;
}
.card .sidebar-link.active {
  color: var(--brand-primary) !important;
  background-color: rgba(37, 99, 235, 0.1) !important;
}
[data-theme="dark"] .card .sidebar-link.active {
  background-color: rgba(59, 130, 246, 0.2) !important;
}

/* ============================================================
   MEMBER PORTAL OVERRIDES
   ============================================================ */
.member-sidebar {
  background: linear-gradient(180deg, #059669 0%, #0284c7 100%) !important;
  border-right: none !important;
}
.member-sidebar .sidebar-brand-name,
.member-sidebar .sidebar-brand-sub,
.member-sidebar .sidebar-brand-icon i,
.member-sidebar .sidebar-section-title {
  color: rgba(255, 255, 255, 0.9) !important;
}
.member-sidebar .sidebar-link {
  color: rgba(255, 255, 255, 0.7) !important;
}
.member-sidebar .sidebar-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}
.member-sidebar .sidebar-link.active {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.2) !important;
  border-right-color: #fff !important;
}
.member-sidebar .sidebar-user-name,
.member-sidebar .sidebar-user-role {
  color: #fff !important;
}
