/* ===== CSS VARIABLES ===== */
:root {
  /* Primary Colors */
  --primary: #4361ee;
  --primary-light: #4895ef;
  --primary-dark: #3a0ca3;
  
  /* Secondary Colors */
  --secondary: #7209b7;
  --secondary-light: #b5179e;
  
  /* Status Colors */
  --success: #4cc9f0;
  --warning: #f72585;
  --danger: #e63946;
  
  /* Neutral Colors */
  --light: #f8f9fa;
  --dark: #212529;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  
  /* Semantic Colors */
  --sidebar-bg: #1e2a45;
  --sidebar-hover: #2d3b5c;
  --card-bg: #ffffff;
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --border-color: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

/* ===== RESET AND BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== LAYOUT ===== */
.app-container {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-content {
  flex: 1;
  padding: 1.5rem;
  overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  color: white;
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.logo {
  padding: 1.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.logo i {
  font-size: 1.5rem;
}

.nav-menu {
  list-style: none;
  padding: 1rem 0;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
  border-left: 4px solid transparent;
  margin: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.nav-link:hover,
.nav-link.active {
  background: var(--sidebar-hover);
  color: white;
  border-left-color: var(--primary);
}

.nav-link i {
  margin-right: 12px;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

/* ===== TOP BAR ===== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 70px;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--primary);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.hamburger:hover {
  background: var(--gray-200);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--primary);
  font-size: 1.1rem;
}

.header-brand i {
  font-size: 1.25rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.date-display {
  background: var(--gray-100);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 500;
  color: var(--gray-700);
  font-size: 0.9rem;
}

.user-avatar {
  font-size: 1.75rem;
  color: var(--primary);
}

/* ===== USER DROPDOWN STYLES ===== */
.logout-container {
  position: relative;
}

/* ===== MEMBERS PAGE STYLES ===== */
.search-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-box {
  position: relative;
  min-width: 300px;
}

.search-box input {
  width: 100%;
  padding: 0.5rem 2.5rem 0.5rem 2.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.1);
}

.search-box i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
}

.search-clear {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.25rem;
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.search-clear:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.mobile-only {
  display: none;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.section-title h3 {
  margin: 0;
}

.search-results-info {
  color: var(--gray-600);
  font-size: 0.9rem;
}

/* Bulk Actions Dropdown */
.bulk-actions-dropdown {
  position: relative;
}

.bulk-actions-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  padding: 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bulk-actions-btn:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.bulk-actions-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.bulk-actions-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.bulk-action-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--gray-100);
}

.bulk-action-item:last-child {
  border-bottom: none;
}

.bulk-action-item:hover {
  background: var(--gray-50);
}

.bulk-action-item i {
  color: var(--primary);
  width: 16px;
  text-align: center;
}

.bulk-action-item span {
  color: var(--gray-700);
  font-size: 0.9rem;
}

/* Member Info in Action Menu */
.member-info-item {
  background: var(--gray-50);
  border-radius: 4px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.member-info {
  font-size: 0.85rem;
  line-height: 1.4;
}

.member-info strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
  font-size: 0.9rem;
}

.member-info div {
  margin-bottom: 0.25rem;
  color: var(--gray-700);
}

.action-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 0.5rem 0;
}

.user-dropdown {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  color: var(--gray-700);
  font-size: 0.9rem;
}

.user-menu-btn:hover {
  background: var(--gray-100);
}

.user-menu-btn i.fa-user-circle {
  font-size: 1.75rem;
  color: var(--primary);
}

.user-menu-btn i.fa-chevron-down {
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.user-dropdown.show .user-menu-btn i.fa-chevron-down {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.user-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-info-display {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  text-align: center;
}

.user-info-display strong {
  display: block;
  color: var(--gray-900);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.user-info-display small {
  color: var(--gray-600);
  font-size: 0.85rem;
  text-transform: capitalize;
}

.logout-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--danger);
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logout-btn:hover {
  background: var(--gray-50);
}

/* ===== WELCOME SECTION ===== */
.welcome-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.welcome-content h2 {
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 1.5rem;
}

.welcome-date {
  opacity: 0.9;
  font-size: 1rem;
}

.welcome-actions {
  display: flex;
  gap: 1rem;
}

/* ===== GRID LAYOUTS ===== */
.dashboard-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

/* ===== CARDS ===== */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border-left: 4px solid var(--primary);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.content-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.content-section h3 {
  margin-bottom: 1rem;
  color: var(--primary);
  font-weight: 600;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-container {
  overflow-x: auto;
  padding-bottom: 1rem;
}

.chart-container::-webkit-scrollbar {
  height: 8px;
}

.chart-container::-webkit-scrollbar-thumb {
  background-color: var(--primary);
  border-radius: 4px;
}

/* ===== EXPANDABLE STATS GRID ===== */
.stats-section {
  margin-bottom: 1.5rem;
}

.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
}

.stats-header:hover {
  background: var(--gray-50);
  border-color: var(--primary);
}

.stats-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stats-toggle {
  font-size: 1.2rem;
  color: var(--gray-600);
  transition: transform 0.3s ease;
}

.stats-section.expanded .stats-toggle {
  transform: rotate(180deg);
}

.stats-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.stats-section.collapsed .stats-content {
  max-height: 0;
  opacity: 0;
}

.stats-section.expanded .stats-content {
  max-height: 500px; /* Adjust based on content */
  opacity: 1;
}

/* Mobile-specific expandable stats */
@media (max-width: 768px) {
  .stats-section {
    margin-bottom: 1rem;
  }
  
  .stats-header {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
  }
  
  .stats-header:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
    border: none;
  }
  
  .stats-header h3 {
    font-size: 0.9rem;
    color: white;
  }
  
  .stats-toggle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
  }
  
  /* Start collapsed on mobile */
  .stats-section:not(.expanded) .stats-content {
    max-height: 0;
    opacity: 0;
  }
  
  /* Smooth animation for mobile */
  .stats-content {
    transition: max-height 0.4s ease, opacity 0.4s ease;
  }
  
  /* Add some spacing after expanded stats */
  .stats-section.expanded {
    margin-bottom: 1.5rem;
  }
}

/* Desktop - always expanded */
@media (min-width: 769px) {
  .stats-header {
    display: none; /* Hide toggle on desktop */
  }
  
  .stats-content {
    max-height: none !important;
    opacity: 1 !important;
  }
}
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  margin-top: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  min-width: 600px;
}

.data-table th {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.data-table tr:hover td {
  background-color: rgba(67, 97, 238, 0.05);
}

/* ===== ACCOUNTING TABLE HORIZONTAL SCROLL ===== */
.accounting-table-container {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: white;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.accounting-table-container .data-table {
  min-width: 1000px; /* Force table to be wider than viewport */
  margin: 0;
  border: none;
  width: auto; /* Let table determine its own width */
  table-layout: auto; /* Allow natural column sizing */
}

/* Mobile accounting table improvements */
@media (max-width: 768px) {
  .accounting-table-container {
    margin: 0 -0.75rem; /* Extend to page edges on mobile */
    border-radius: 0;
    border-left: none;
    border-right: none;
    width: calc(100% + 1.5rem); /* Account for negative margins */
    max-width: none;
  }
  
  .accounting-table-container .data-table {
    min-width: 1200px; /* Even wider on mobile to force scroll */
  }
  
/* Override general mobile table styles for accounting table */
@media (max-width: 768px) {
  /* Make accounting table styles more specific and important */
  .accounting-table-container .data-table {
    table-layout: auto !important; /* Override fixed layout */
    min-width: 1200px !important; /* Force horizontal scroll */
    width: auto !important; /* Let table determine width */
    max-width: none !important; /* Remove max-width constraint */
  }
  
  .accounting-table-container .data-table th,
  .accounting-table-container .data-table td {
    padding: 0.5rem 0.375rem !important; /* Override general padding */
    font-size: 0.875rem !important;
    white-space: nowrap !important;
    word-wrap: normal !important; /* Prevent word wrapping */
  }
  
  /* Ensure the container itself can scroll */
  .accounting-table-container {
    overflow-x: auto !important;
    overflow-y: visible !important;
    width: calc(100% + 1.5rem) !important; /* Account for negative margins */
    max-width: none !important;
  }
}
  
  /* Specific column widths for accounting table */
  .accounting-table-container .data-table th:nth-child(1), /* Date */
  .accounting-table-container .data-table td:nth-child(1) {
    width: 100px;
    min-width: 100px;
  }
  
  .accounting-table-container .data-table th:nth-child(2), /* Description */
  .accounting-table-container .data-table td:nth-child(2) {
    width: 200px;
    min-width: 200px;
    white-space: normal;
    word-wrap: break-word;
  }
  
  .accounting-table-container .data-table th:nth-child(3), /* Payee */
  .accounting-table-container .data-table td:nth-child(3) {
    width: 150px;
    min-width: 150px;
  }
  
  .accounting-table-container .data-table th:nth-child(4), /* Category */
  .accounting-table-container .data-table td:nth-child(4) {
    width: 120px;
    min-width: 120px;
  }
  
  .accounting-table-container .data-table th:nth-child(5), /* Type */
  .accounting-table-container .data-table td:nth-child(5) {
    width: 100px;
    min-width: 100px;
  }
  
  .accounting-table-container .data-table th:nth-child(6), /* Amount */
  .accounting-table-container .data-table td:nth-child(6) {
    width: 120px;
    min-width: 120px;
    text-align: right;
  }
  
  .accounting-table-container .data-table th:nth-child(7), /* Actions */
  .accounting-table-container .data-table td:nth-child(7) {
    width: 100px;
    min-width: 100px;
    text-align: center;
  }
}

/* ===== EXPANDABLE SECTIONS ===== */
.expandable-section {
  margin-bottom: 1.5rem;
}

.expandable-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
}

.expandable-header:hover {
  background: var(--gray-50);
  border-color: var(--primary);
}

.expandable-header h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.expandable-toggle {
  font-size: 1.2rem;
  color: var(--gray-600);
  transition: transform 0.3s ease;
}

.expandable-section.expanded .expandable-toggle {
  transform: rotate(180deg);
}

.expandable-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.expandable-section.collapsed .expandable-content {
  max-height: 0;
  opacity: 0;
}

.expandable-section.expanded .expandable-content {
  max-height: 1000px; /* Adjust based on content */
  opacity: 1;
}

/* Mobile-specific expandable sections */
@media (max-width: 768px) {
  .expandable-section {
    margin-bottom: 1rem;
  }
  
  .expandable-header {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: white;
    border: none;
  }
  
  .expandable-header:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--primary-dark) 100%);
    border: none;
  }
  
  .expandable-header h4 {
    font-size: 0.9rem;
    color: white;
  }
  
  .expandable-toggle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
  }
  
  /* Smooth animation for mobile */
  .expandable-content {
    transition: max-height 0.4s ease, opacity 0.4s ease;
  }
  
  /* Add some spacing after expanded sections */
  .expandable-section.expanded {
    margin-bottom: 1.5rem;
  }
}

/* Ensure parent containers don't constrain the accounting table */
.content-section:has(.accounting-table-container) {
  overflow: visible;
  padding: 1rem 0; /* Remove horizontal padding */
}

@media (max-width: 768px) {
  .content-section:has(.accounting-table-container) {
    padding: 1rem 0;
    margin: 0;
  }
  
  /* Ensure page content doesn't constrain the table */
  .page-content:has(.accounting-table-container) {
    overflow-x: visible;
  }
}

/* Desktop - show toggle but start expanded */
@media (min-width: 769px) {
  .expandable-header {
    background: var(--gray-50);
    border-color: var(--gray-300);
  }
  
  .expandable-header:hover {
    background: var(--gray-100);
    border-color: var(--primary);
  }
}

/* ===== CLICKABLE STATS GRID ===== */
.clickable-stats-section {
  margin-bottom: 1.5rem;
}

.stats-clickable-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-clickable-header:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stats-clickable-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
}

.stats-toggle-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

.stats-count {
  font-size: 0.9rem;
  font-weight: 500;
}

.stats-toggle-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.clickable-stats-section.stats-visible .stats-toggle-icon {
  transform: rotate(180deg);
}

.stats-clickable-content {
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
}

.clickable-stats-section.stats-hidden .stats-clickable-content {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

.clickable-stats-section.stats-visible .stats-clickable-content {
  max-height: 500px;
  opacity: 1;
  margin-bottom: 1rem;
}

/* Mobile-specific clickable stats */
@media (max-width: 768px) {
  .stats-clickable-header {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
  }
  
  .stats-clickable-header h3 {
    font-size: 1rem;
    gap: 0.5rem;
  }
  
  .stats-count {
    font-size: 0.8rem;
  }
  
  .stats-toggle-icon {
    font-size: 1rem;
  }
  
  /* Start hidden on mobile */
  .clickable-stats-section:not(.stats-visible) .stats-clickable-content {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
  }
  
  /* Smooth animation for mobile */
  .stats-clickable-content {
    transition: max-height 0.5s ease, opacity 0.5s ease, margin 0.5s ease;
  }
}

/* Desktop behavior */
@media (min-width: 769px) {
  .stats-clickable-header {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
  }
  
  .stats-clickable-header:hover {
    background: linear-gradient(135deg, var(--gray-200) 0%, var(--gray-300) 100%);
    border-color: var(--primary);
  }
  
  .stats-clickable-header h3 {
    color: var(--primary);
  }
  
  .stats-toggle-info {
    color: var(--text-secondary);
  }
}

/* ===== SIMPLE CLICKABLE STATS ===== */
.stats-section {
  margin-bottom: 1.5rem;
}

.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.stats-header:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stats-header h3 {
  margin: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stats-header i {
  transition: transform 0.3s ease;
}

@media (max-width: 768px) {
  .stats-header {
    padding: 0.75rem;
  }
  
  .stats-header h3 {
    font-size: 1rem;
  }
}

/* ===== STATUS BADGES ===== */
.status-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

.status-active {
  background-color: #d1fae5;
  color: #065f46;
}

.status-inactive {
  background-color: #fee2e2;
  color: #991b1b;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(67, 97, 238, 0.3);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--gray-300);
}

/* ===== MODALS ===== */
/* Modal styles moved to bottom of file to avoid conflicts */

.modal h3 {
  margin-bottom: 1.5rem;
  color: var(--primary);
  font-size: 1.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* ===== FORM STYLES ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1.125rem;
  font-family: inherit;
  transition: var(--transition);
  background: #fff;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

textarea {
  resize: vertical;
  min-height: 120px;
  font-size: 1.125rem;
}

/* ===== FORM ACTIONS ===== */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: nowrap;
}

.form-actions .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.icon-button.danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.icon-button.danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h2 {
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 600;
}

/* ===== REPORT CONTROLS ===== */
.report-controls {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.report-controls .form-group {
  margin-bottom: 0;
  min-width: 200px;
}

/* ===== MOBILE RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -280px;
    height: 100%;
    width: 280px;
    transition: left 0.3s ease;
  }
  
  .sidebar.active {
    left: 0;
  }
  
  .hamburger {
    display: block;
  }
  
  .header-brand span {
    display: none; /* Hide brand text on mobile to save space */
  }
  
  .header-brand i {
    font-size: 1.5rem; /* Larger icon on mobile */
  }
  
  .top-bar {
    padding: 1rem;
    min-height: 60px;
  }
  
  .date-display {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
  }
  
  /* Mobile User Avatar Styles */
  .user-info {
    gap: 0.5rem;
  }
  
  .date-display {
    display: none; /* Hide date on mobile to save space */
  }
  
  .user-menu-btn span {
    display: none; /* Hide username text on mobile */
  }
  
  .user-menu-btn {
    padding: 0.25rem;
    gap: 0.25rem;
  }
  
  .user-menu-btn i.fa-user-circle {
    font-size: 2rem; /* Slightly larger avatar on mobile for easier tapping */
  }
  
  .user-menu-btn i.fa-chevron-down {
    display: none; /* Hide chevron on mobile for cleaner look */
  }
  
  .user-dropdown-menu {
    right: -0.5rem; /* Adjust position for mobile */
    min-width: 180px;
  }
  
  /* Improve touch targets on mobile */
  .user-menu-btn {
    min-width: 44px; /* Minimum touch target size */
    min-height: 44px;
    justify-content: center;
  }
  
  .logout-btn {
    padding: 1rem; /* Larger touch target */
    font-size: 1rem;
  }
  
  /* Add backdrop for mobile dropdown */
  .user-dropdown-menu.show::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: -1;
  }
  
  /* Members Page Mobile Styles */
  .search-container {
    width: 100%;
    margin-bottom: 1rem;
  }
  
  .search-box {
    position: relative;
    width: 100%;
  }
  
  .search-box input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
  }
  
  .search-box i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
  }
  
  .search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem;
    min-width: auto;
    height: auto;
    border-radius: 4px;
  }
  
  .action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .action-buttons .btn {
    flex: 1;
    min-width: 120px;
  }
  
  .btn-text {
    display: none; /* Hide button text on mobile */
  }
  
  /* Stats Grid - 2x2 layout on mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .stat-card h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }
  
  .stat-card .value {
    font-size: 1.25rem;
  }
  
  /* Table Mobile Styles */
  .mobile-hide {
    display: none !important;
  }
  
  .mobile-only {
    display: block !important;
  }
  
  /* Fix table column widths for mobile */
  .data-table {
    table-layout: fixed;
    width: 100%;
    max-width: 100%;
  }
  
  /* Override base table styles for mobile */
  .data-table {
    min-width: auto !important; /* Remove the 600px min-width on mobile */
    width: 100%;
    max-width: 100%;
  }
  
  .data-table th,
  .data-table td {
    padding: 0.75rem 0.25rem; /* Reduced horizontal padding for mobile */
    word-wrap: break-word;
  }
  
  /* Specific column widths for mobile members table */
  /* After hiding ID column, Name becomes 1st, Status 2nd, Actions 3rd */
  #members-table th:nth-child(2), /* Name column (2nd in DOM, 1st visible) */
  #members-table td:nth-child(2) {
    width: 50%;
  }
  
  #members-table th:nth-child(3), /* Status column (3rd in DOM, 2nd visible) */
  #members-table td:nth-child(3) {
    width: 25%;
    text-align: center;
    padding-left: 0.125rem; /* Minimal left padding */
    padding-right: 0.125rem; /* Minimal right padding */
  }
  
  #members-table th:nth-child(6), /* Actions column (6th in DOM, 3rd visible) */
  #members-table td:nth-child(6) {
    width: 25%;
    text-align: center;
    padding-left: 0.125rem; /* Minimal left padding */
    padding-right: 0.925rem; /* Minimal right padding */
  }
  
  /* Compact status badges on mobile */
  .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
  
  /* Compact action buttons */
  .action-menu-btn {
    padding: 0.375rem; /* Slightly smaller padding */
    min-width: 32px;   /* Smaller minimum width */
    height: 32px;      /* Smaller height */
    font-size: 0.875rem; /* Smaller icon size */
  }
  
  /* Make member name more compact */
  .member-name strong {
    font-size: 0.95rem;
    line-height: 1.3;
    display: block;
  }
  
  .member-details {
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
  }
  
  .member-details small {
    font-size: 0.8rem;
    line-height: 1.2;
    color: #666;
  }
  
  /* Ensure table fits in viewport */
  .table-container {
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal scroll */
    margin: 0;
    padding: 0; /* Remove any container padding */
  }
  
  /* Reduce page content padding on mobile */
  .page-content {
    padding: 1rem 0.75rem; /* Reduce horizontal padding */
  }
  
  /* Ensure content sections don't add extra width */
  .content-section {
    margin: 0;
    box-sizing: border-box;
  }
  
  /* Ensure table itself doesn't overflow */
  #members-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    min-width: auto; /* Override the base min-width on mobile */
  }
  
  /* Mobile bulk actions styles */
  .section-header {
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .section-title {
    flex: 1;
  }
  
  .section-title h3 {
    font-size: 1rem;
    margin: 0;
  }
  
  .search-results-info {
    font-size: 0.85rem;
    margin-top: 0.25rem;
    color: var(--gray-600);
  }
  
  .bulk-actions-dropdown {
    flex-shrink: 0;
  }
  
  .bulk-actions-menu {
    right: 0;
    min-width: 180px;
  }
  
  .bulk-action-item {
    padding: 1rem;
    font-size: 0.9rem;
  }
  
  .member-name {
    display: flex;
    flex-direction: column;
  }
  
  .member-details {
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
  }
  
  .member-details small {
    color: #666;
    font-size: 0.8rem;
  }
  
  .member-id {
    font-weight: 500;
  }
  
  /* Action Menu Mobile Styles */
  .member-info-item {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 0.75rem !important;
  }
  
  .member-info {
    font-size: 0.85rem;
    line-height: 1.4;
  }
  
  .member-info strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
  }
  
  .member-info div {
    margin-bottom: 0.25rem;
  }
  
  .action-divider {
    height: 1px;
    background: #eee;
    margin: 0.5rem 0;
  }
  
  .welcome-section {
    padding: 1.25rem;
    text-align: center;
  }
  
  .welcome-content h2 {
    font-size: 1.25rem;
  }
  
  .welcome-actions {
    justify-content: center;
    width: 100%;
  }
  
  .dashboard-grid,
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .page-content {
    padding: 1rem;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .stat-card,
  .content-section {
    padding: 1rem;
  }
  
  .stat-card .value {
    font-size: 1.5rem;
  }
  
  .table-container {
    margin: 0;
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll */
    box-sizing: border-box;
  }
  
  .data-table th,
  .data-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
  
  .report-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .report-controls .form-group {
    min-width: auto;
  }
  
  .modal {
    padding: 0.5rem;
    align-items: flex-start;
  }
  
  .modal-content {
    max-height: 95vh;
    margin-top: 2rem;
  }
}

@media (max-width: 480px) {
  .page-content {
    padding: 0.75rem;
  }
  
  .welcome-section {
    padding: 1rem;
  }
  
  .welcome-content h2 {
    font-size: 1.1rem;
  }
  
  .stat-card,
  .content-section {
    padding: 0.875rem;
  }
  
  .btn {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
  }
  
  .data-table {
    font-size: 0.85rem;
    min-width: 500px;
  }
  
  .modal-content {
    padding: 1.25rem;
  }
  
  .stats-grid,
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

.d-flex { display: flex; }
.d-none { display: none; }
.d-block { display: block; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--gray-200);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ===== PRINT STYLES ===== */
@media print {
  .sidebar,
  .top-bar,
  .welcome-section,
  .btn {
    display: none !important;
  }
  
  .main-content {
    margin: 0;
  }
  
  .page-content {
    padding: 0;
  }
  
  .content-section {
    box-shadow: none;
    break-inside: avoid;
  }
  
  /* FIXED: Allow promises section to break across pages */
  .content-section:has(#promises-table),
  .content-section.promises-section {
    break-inside: auto !important;
    page-break-inside: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  
  /* Specific styles for promises table printing */
  #promises-table {
    width: 100% !important;
    font-size: 11px !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
  }
  
  #promises-table thead {
    display: table-header-group !important;
  }
  
  #promises-table tbody {
    display: table-row-group !important;
  }
  
  #promises-table tr {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    height: auto !important;
  }
  
  #promises-table th,
  #promises-table td {
    padding: 4px 6px !important;
    font-size: 10px !important;
    border: 1px solid #ddd !important;
    word-wrap: break-word !important;
    overflow: visible !important;
  }
  
  #promises-table th {
    background: #f8f9fa !important;
    font-weight: bold !important;
    color: #000 !important;
  }
  
  /* Column widths for better printing */
  #promises-table th:nth-child(1),
  #promises-table td:nth-child(1) { width: 25% !important; } /* Member */
  #promises-table th:nth-child(2),
  #promises-table td:nth-child(2) { width: 12% !important; } /* Amount */
  #promises-table th:nth-child(3),
  #promises-table td:nth-child(3) { width: 15% !important; } /* Category */
  #promises-table th:nth-child(4),
  #promises-table td:nth-child(4) { width: 12% !important; } /* Promise Date */
  #promises-table th:nth-child(5),
  #promises-table td:nth-child(5) { width: 12% !important; } /* Due Date */
  #promises-table th:nth-child(6),
  #promises-table td:nth-child(6) { width: 12% !important; } /* Status */
  #promises-table th:nth-child(7),
  #promises-table td:nth-child(7) { width: 12% !important; } /* Actions */
  
  /* Hide action buttons in print */
  #promises-table .promise-actions {
    display: none !important;
  }
  
  /* Additional print fixes for promises table */
  #promises-table .icon-button {
    display: none !important;
  }
  
  /* Ensure all table rows are visible */
  #promises-table tbody tr {
    display: table-row !important;
    visibility: visible !important;
  }
  
  /* Force table to expand to full content */
  #promises-table {
    height: auto !important;
    min-height: auto !important;
  }
  
  /* Remove any height restrictions on table body */
  #promises-table tbody {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  
  /* Ensure promise status badges print correctly */
  .promise-status {
    background: #f8f9fa !important;
    color: #000 !important;
    border: 1px solid #ddd !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-size: 9px !important;
  }
  
  /* Hide filters and export button when printing */
  .filters-container,
  .section-header .btn {
    display: none !important;
  }
  
  /* Ensure table container doesn't limit height */
  .table-container {
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
  }
  
  /* Force table to use full available space */
  .table-container:has(#promises-table),
  .table-container.promises-table-container {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  
  /* Ensure section header prints */
  .section-header h3 {
    display: block !important;
    margin-bottom: 10px !important;
    font-size: 16px !important;
    font-weight: bold !important;
  }
  
  /* Add page break before promises section if it's long */
  .content-section:has(#promises-table),
  .content-section.promises-section {
    page-break-before: auto;
  }
}

/* ===== REPORTS PAGE SPECIFIC STYLES ===== */
.reports-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Glass Card Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Screen Headers */
.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.screen-header h3 {
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.screen-actions {
    display: flex;
    gap: 0.5rem;
}

/* Reports Table */
.reports-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.reports-table th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reports-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.reports-table tr:last-child td {
    border-bottom: none;
}

.reports-table tr:hover td {
    background: rgba(67, 97, 238, 0.05);
    transform: translateX(4px);
}

/* Status Badges */
.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.status-submitted {
    background: #d1fae5;
    color: #065f46;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-not-submitted {
    background: #fee2e2;
    color: #991b1b;
}

.status-not-required {
    background: #e5e7eb;
    color: #374151;
}

/* Badge */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #10b981;
    color: white;
}

/* Action Buttons */
.action-btn {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: var(--transition);
}

.action-btn:hover {
    color: var(--primary-dark);
    transform: translateY(-1px);
}

/* Action Dropdown Menu */
.action-dropdown {
    position: relative;
    display: inline-block;
}

.action-menu-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-menu-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.action-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.action-menu.show {
    display: block;
}

.action-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
    font-size: 14px;
    color: #495057;
}

.action-item:last-child {
    border-bottom: none;
}

.action-item:hover {
    background: #f8f9fa;
}

.action-item.delete-action {
    color: #dc3545;
}

.action-item.delete-action:hover {
    background: #fff5f5;
    color: #c82333;
}

.action-item i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
    font-size: 13px;
}

.action-item span {
    flex: 1;
}

/* Report Detail Styles */
.report-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.report-header h3 {
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.report-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    opacity: 0.9;
}

.report-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Report Sections */
.report-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.report-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.report-section.full-width {
    grid-column: 1 / -1;
}

.report-section h4 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Chart Containers */
.chart-container {
    height: 300px;
    margin-top: 1rem;
    position: relative;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Report Breakdown Styles */
.breakdown-separator td {
    border-top: 2px solid #ddd !important;
    padding-top: 15px !important;
    font-weight: bold;
    color: #666;
    background: #f8f9fa !important;
}

.breakdown-row td {
    padding-left: 20px !important;
    font-style: italic;
    border-bottom: 1px solid #eee !important;
}

.breakdown-row:hover td {
    background: rgba(52, 152, 219, 0.1) !important;
}

/* Report Actions */
.report-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Total Row in Tables */
.total-row {
    background: rgba(67, 97, 238, 0.05) !important;
    font-weight: 600;
}

.total-row td {
    border-top: 2px solid var(--border-color);
}

/* Responsive Design for Reports */
@media (max-width: 1024px) {
    .report-sections {
        grid-template-columns: 1fr;
    }
    
    .report-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .report-controls .form-group {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .reports-container {
        padding: 1rem;
    }
    
    .screen-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .screen-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .report-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .reports-table {
        font-size: 0.85rem;
    }
    
    .reports-table th,
    .reports-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .report-actions {
        flex-direction: column;
    }
    
    .report-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .glass-card {
        padding: 1rem;
    }
    
    .report-section {
        padding: 1rem;
    }
    
    .chart-container {
        height: 250px;
    }
}




/* ===== MEMBER PROFILE PAGE ===== */
.member-profile {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  animation: fadeIn 0.4s ease-in-out;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.profile-header img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary);
  box-shadow: var(--shadow);
}

.profile-info h2 {
  font-size: 1.75rem;
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
}

.profile-info p {
  color: var(--text-secondary);
  margin: 0.25rem 0;
  font-size: 0.95rem;
}

.profile-section {
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.profile-section h3 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table th {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.table tr:hover td {
  background: rgba(67, 97, 238, 0.05);
}

.back-button {
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--gray-200);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.back-button:hover {
  background: var(--gray-300);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Search Section Styles */
.search-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.search-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-box input {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #4a6fa5;
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.1);
}

.search-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-filters select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.search-results-info {
    font-size: 14px;
    color: #6c757d;
    font-style: italic;
}

.search-highlight {
    margin-top: 2px;
}

.search-highlight mark {
    background: #fff3cd;
    padding: 1px 4px;
    border-radius: 2px;
}

/* Responsive design */
@media (max-width: 768px) {
    .search-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .search-filters {
        justify-content: space-between;
    }
}

/* ===== USER MANAGEMENT STYLES ===== */
.user-management-container {
  padding: 2rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h2 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-secondary);
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.controls-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
}

.search-filters {
  display: flex;
  gap: 1rem;
  flex: 1;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.user-details {
  flex: 1;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.user-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.role-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.role-super-admin {
  background: #dc3545;
  color: white;
}

.role-admin {
  background: #fd7e14;
  color: white;
}

.role-chairperson {
  background: #6f42c1;
  color: white;
}

.role-secretary {
  background: #20c997;
  color: white;
}

.role-accountant {
  background: #0dcaf0;
  color: white;
}

.role-holder-of-goods {
  background: #198754;
  color: white;
}

.role-community-coordinator {
  background: #ffc107;
  color: #000;
}

.role-member {
  background: #6c757d;
  color: white;
}

.role-visitor {
  background: #17a2b8;
  color: white;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-active {
  background: #d1f2eb;
  color: #0f5132;
}

.status-pending {
  background: #fff3cd;
  color: #664d03;
}

.status-inactive {
  background: #f8d7da;
  color: #58151c;
}

.status-suspended {
  background: #f1f3f4;
  color: #495057;
}

.status-badge i {
  font-size: 0.5rem;
}

.date-info {
  font-size: 0.85rem;
}

.date-info small {
  color: var(--text-secondary);
  display: block;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--primary-color);
  color: white;
}

.btn-icon.btn-danger:hover {
  background: #dc3545;
  color: white;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.pagination {
  display: flex;
  gap: 0.5rem;
}

.page-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-primary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover {
  background: var(--bg-secondary);
}

.page-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Loading and Empty States */
.loading-spinner {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
  .controls-section {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-filters {
    flex-direction: column;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .user-management-container {
    padding: 1rem;
  }
}

/* ===== MEMBER ID SEARCH STYLES ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.member-id-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.member-id-search .search-input {
    border: none;
    outline: none;
    padding: 0.5rem;
    font-size: 0.9rem;
    width: 250px;
    background: transparent;
}

.member-id-search .search-input::placeholder {
    color: var(--gray-500);
}

.member-id-search .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* Member ID Display Styles */
.member-id-cell {
    text-align: center;
}

.member-id {
    font-weight: bold;
    color: var(--primary);
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

.member-number {
    color: var(--gray-500);
    font-size: 0.75rem;
    display: block;
    margin-top: 2px;
}

/* Quick Lookup Button */
.icon-button.success {
    background-color: var(--success);
    color: white;
}

.icon-button.success:hover {
    background-color: #3ba3cc;
    transform: translateY(-1px);
}

/* Search Results Info */
.search-results-info {
    background: var(--gray-100);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    font-size: 0.9rem;
    color: var(--gray-700);
    border-left: 4px solid var(--primary);
}

/* Member Card Styles for Search Results */
.member-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin: 0.5rem 0;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.member-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.member-card .member-id {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* Responsive Design for Member ID Search */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .member-id-search {
        flex-direction: column;
        align-items: stretch;
    }
    
    .member-id-search .search-input {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .member-id-search .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }
}

/* Enhanced Table Styles for Member IDs */
.data-table th:first-child,
.data-table td:first-child {
    text-align: center;
    font-weight: bold;
    min-width: 100px;
}

.data-table .member-id {
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Digital Member ID Card Buttons */
.icon-button.info {
    background-color: #17a2b8;
    color: white;
}

.icon-button.info:hover {
    background-color: #138496;
    transform: translateY(-1px);
}

.icon-button.warning {
    background-color: #ffc107;
    color: #212529;
}

.icon-button.warning:hover {
    background-color: #e0a800;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
    transform: translateY(-1px);
}

/* Digital Member Card Styles */
.digital-card-preview {
    max-width: 400px;
    margin: 20px auto;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    overflow: hidden;
}