/* Font loaded via link tag in head for better performance */

    * { margin: 0; padding: 0; box-sizing: border-box; }
    
    :root {
      --bg-primary: #f8fafc;
      --bg-secondary: #ffffff;
      --bg-card: #ffffff;
      --bg-card-hover: #f1f5f9;
      --bg-sidebar: #1e293b;
      --border-color: #e2e8f0;
      --border-light: #f1f5f9;
      --text-primary: #0f172a;
      --text-secondary: #475569;
      --text-muted: #94a3b8;
      --text-sidebar: #cbd5e1;
      --accent-primary: #0ea5e9;
      --accent-secondary: #8b5cf6;
      --accent-success: #10b981;
      --accent-warning: #f59e0b;
      --accent-danger: #ef4444;
      --accent-teal: #14b8a6;
      --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
      --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
      --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    }

    body {
      font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
      background: var(--bg-primary);
      color: var(--text-primary);
      min-height: 100vh;
    }

    /* Layout */
    .app-container { 
      display: flex; 
      min-height: 100vh;
      width: 100%;
      overflow-x: hidden;
    }
    
    /* Sidebar - base styles */
    .sidebar {
      width: 220px;
      background: linear-gradient(180deg, #1a1f2e 0%, #0f1219 100%);
      padding: 0;
      display: flex;
      flex-direction: column;
      position: fixed;
      top: 0;
      left: 0;
      height: 100vh;
      z-index: 100;
      overflow: hidden;
    }
    
    .sidebar::-webkit-scrollbar {
      width: 6px;
    }
    .sidebar::-webkit-scrollbar-track {
      background: rgba(255,255,255,0.05);
    }
    .sidebar::-webkit-scrollbar-thumb {
      background: rgba(255,255,255,0.2);
      border-radius: 3px;
    }
    .sidebar::-webkit-scrollbar-thumb:hover {
      background: rgba(255,255,255,0.3);
    }

    .logo {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 1rem 1.25rem;
      border-bottom: 1px solid rgba(255,255,255,0.08);
      flex-shrink: 0;
    }
    
    .logo-text-wrap {
      display: flex;
      flex-direction: column;
    }

    .logo-icon {
      width: 38px;
      height: 38px;
      background: linear-gradient(135deg, var(--accent-teal), var(--accent-primary));
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-weight: 700;
      font-size: 1.1rem;
      overflow: hidden;
      flex-shrink: 0;
    }
    
    .logo-icon.has-image {
      background: transparent;
      padding: 0;
    }
    
    .logo-icon.has-image img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .logo-text {
      font-size: 1rem;
      font-weight: 700;
      color: #fff;
      line-height: 1.2;
    }
    
    .logo-subtitle {
      font-size: 0.7rem;
      color: #64748b;
      font-weight: 400;
    }
    
    /* Sidebar Search */
    .sidebar-search {
      padding: 0.75rem 1rem;
    }
    
    .sidebar-search-input {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 8px;
      padding: 0.5rem 0.75rem;
      transition: all 0.2s;
    }
    
    .sidebar-search-input:focus-within {
      background: rgba(255,255,255,0.1);
      border-color: rgba(6, 182, 212, 0.4);
    }
    
    .sidebar-search-input .search-icon {
      color: #64748b;
      font-size: 0.85rem;
    }
    
    .sidebar-search-input input {
      background: transparent;
      border: none;
      outline: none;
      color: #e2e8f0;
      font-size: 0.8rem;
      width: 100%;
    }
    
    .sidebar-search-input input::placeholder {
      color: #64748b;
    }
    
    .sidebar-search-input .search-shortcut {
      color: #64748b;
      font-size: 0.65rem;
      background: rgba(255,255,255,0.1);
      padding: 0.15rem 0.4rem;
      border-radius: 4px;
      white-space: nowrap;
    }
    
    /* Quick Actions */
    .quick-actions {
      display: flex;
      gap: 0.5rem;
      padding: 0 1rem 0.75rem;
      border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    
    .quick-action-btn {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0.6rem;
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 8px;
      color: #94a3b8;
      cursor: pointer;
      font-size: 1rem;
      position: relative;
      transition: all 0.2s;
    }
    
    .quick-action-btn:hover {
      background: rgba(255,255,255,0.1);
      color: #fff;
    }
    
    .quick-action-badge {
      position: absolute;
      top: -4px;
      right: -4px;
      background: #06b6d4;
      color: #0f1219;
      font-size: 0.6rem;
      font-weight: 700;
      padding: 0.1rem 0.35rem;
      border-radius: 10px;
      min-width: 16px;
      text-align: center;
    }
    
    .quick-action-badge.danger {
      background: #ef4444;
      color: white;
    }
    
    .quick-action-btn.has-alert {
      background: rgba(239, 68, 68, 0.15);
      border-color: rgba(239, 68, 68, 0.3);
    }
    
    .quick-action-btn.has-alert:hover {
      background: rgba(239, 68, 68, 0.25);
    }
    
    /* Sidebar Navigation */
    .sidebar-nav {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 0.75rem 0;
    }
    
    .sidebar-nav::-webkit-scrollbar {
      width: 4px;
    }
    .sidebar-nav::-webkit-scrollbar-track {
      background: transparent;
    }
    .sidebar-nav::-webkit-scrollbar-thumb {
      background: rgba(255,255,255,0.15);
      border-radius: 2px;
    }

    .nav-section { 
      margin-bottom: 0.25rem; 
    }
    
    .nav-label {
      padding: 0.5rem 1.25rem;
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #64748b;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      user-select: none;
      transition: color 0.2s;
    }
    
    .nav-label:hover {
      color: #94a3b8;
    }
    
    .nav-label .collapse-icon {
      font-size: 0.55rem;
      transition: transform 0.2s;
    }
    
    .nav-section.collapsed .collapse-icon {
      transform: rotate(-90deg);
    }
    
    .nav-section.collapsed .nav-items {
      display: none;
    }
    
    .nav-items {
      overflow: hidden;
      padding: 0 0.75rem;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      padding: 0.55rem 0.75rem;
      color: #94a3b8;
      cursor: pointer;
      transition: all 0.15s;
      border-radius: 8px;
      font-size: 0.85rem;
      font-weight: 500;
      margin-bottom: 2px;
    }

    .nav-item:hover {
      background: rgba(255,255,255,0.06);
      color: #e2e8f0;
    }

    .nav-item.active {
      background: linear-gradient(90deg, rgba(6, 182, 212, 0.2), transparent);
      color: #06b6d4;
      border-left: 3px solid #06b6d4;
      margin-left: -3px;
      padding-left: calc(0.75rem + 3px);
    }

    .nav-item .icon { 
      font-size: 1rem; 
      width: 20px; 
      text-align: center;
      opacity: 0.9;
    }
    
    .nav-item.active .icon {
      opacity: 1;
    }

    .nav-badge {
      margin-left: auto;
      background: rgba(255,255,255,0.12);
      padding: 0.1rem 0.5rem;
      border-radius: 999px;
      font-size: 0.65rem;
      font-weight: 600;
      color: #94a3b8;
    }
    
    .nav-item.active .nav-badge {
      background: #06b6d4;
      color: #0f1219;
    }

    .nav-badge.danger { background: rgba(239,68,68,0.25); color: #fecaca; }
    .nav-badge.warning { background: rgba(245,158,11,0.25); color: #fde68a; }

    .task-badge {
      margin-left: auto;
      background: #ef4444;
      color: white;
      padding: 0.1rem 0.45rem;
      border-radius: 999px;
      font-size: 0.65rem;
      font-weight: 600;
    }
    
    /* Sidebar Bottom */
    .sidebar-bottom {
      border-top: 1px solid rgba(255,255,255,0.08);
      padding: 0.75rem;
      flex-shrink: 0;
      margin-top: auto;
    }
    
    .sidebar-bottom .nav-item {
      margin-bottom: 0.5rem;
      padding: 0.55rem 0.75rem;
      border-radius: 8px;
    }
    
    /* User Profile */
    .user-profile {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.75rem;
      background: rgba(255,255,255,0.05);
      border-radius: 10px;
      cursor: pointer;
      transition: background 0.2s;
    }
    
    .user-profile:hover {
      background: rgba(255,255,255,0.08);
    }
    
    .user-avatar {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      background: linear-gradient(135deg, #8b5cf6, #6366f1);
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: 600;
      font-size: 0.85rem;
      flex-shrink: 0;
    }
    
    .user-info {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
    }
    
    .user-name {
      font-size: 0.85rem;
      font-weight: 600;
      color: #e2e8f0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    
    .user-role {
      font-size: 0.7rem;
      color: #64748b;
      text-transform: capitalize;
    }
    
    .user-menu-icon {
      color: #64748b;
      font-size: 1rem;
    }
    
    /* Hidden nav items when searching */
    .nav-item.hidden,
    .nav-section.hidden {
      display: none !important;
    }


    /* Account Tabs */
    .account-tab {
      padding: 0.75rem 1.25rem;
      border: none;
      background: transparent;
      color: var(--text-muted);
      font-size: 0.9rem;
      font-weight: 500;
      cursor: pointer;
      border-bottom: 2px solid transparent;
      transition: all 0.2s;
    }
    .account-tab:hover {
      color: var(--text-primary);
      background: var(--bg-secondary);
    }
    .account-tab.active {
      color: var(--accent-primary);
      border-bottom-color: var(--accent-primary);
    }
    .account-tab-content {
      animation: fadeIn 0.2s ease;
    }
    .tab-badge {
      background: var(--bg-secondary);
      padding: 0.1rem 0.4rem;
      border-radius: 999px;
      font-size: 0.75rem;
      margin-left: 0.25rem;
    }
    .account-tab.active .tab-badge {
      background: rgba(14, 165, 233, 0.15);
      color: var(--accent-primary);
    }
    
    /* Account Cards */
    .child-card {
      background: var(--bg-secondary);
      border-radius: 8px;
      padding: 1rem;
      margin-bottom: 0.75rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .child-card:hover {
      background: var(--bg-card);
      box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    .child-info {
      display: flex;
      align-items: center;
      gap: 1rem;
    }
    .child-avatar {
      width: 45px;
      height: 45px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent-teal), var(--accent-primary));
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: 600;
      font-size: 1.1rem;
    }
    .child-details h4 {
      margin: 0 0 0.25rem 0;
      font-size: 1rem;
    }
    .child-meta {
      font-size: 0.85rem;
      color: var(--text-muted);
    }
    
    /* Account Status Badges */
    .status-current { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); }
    .status-overdue { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger); }
    .status-partial { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }

    /* Main Content */
    .main-content {
      flex: 1;
      margin-left: 220px;
      padding: 1.5rem 2rem;
      min-height: 100vh;
      box-sizing: border-box;
      width: calc(100% - 220px);
      max-width: calc(100% - 220px);
    }

    /* Page Header */
    .page-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 1.5rem;
    }

    #reportSummary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

#reportSummary .stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

#reportSummary .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
}

#reportSummary .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 0.25rem;
}

/* Badge variants */
.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-active {
  background: #dcfce7;
  color: #166534;
}

.badge-purple {
  background: #ede9fe;
  color: #5b21b6;
}

.badge-info {
  background: #e0f2fe;
  color: #0369a1;
}

/* Voided amount styling */
.voided-amount {
  text-decoration: line-through;
}


/* Attention Section Styles */
.attention-section {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 1rem;
  border: 1px solid var(--border-light);
}

.attention-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}

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

.attention-item .donor-name {
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

.attention-item .donor-name:hover {
  color: var(--accent-primary);
}

.attention-item .amount {
  font-weight: 600;
  color: var(--accent-primary);
}

.attention-item .days-overdue {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
}

/* Email Log Styles */
.email-log-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--bg-card);
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-light);
}

.email-status-sent {
  color: #059669;
}

.email-status-failed {
  color: #dc2626;
}

.email-status-pending {
  color: #f59e0b;
}

/* Import Modal Styles */
.import-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.import-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1rem;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.import-step.active {
  opacity: 1;
}

.import-step.completed {
  opacity: 1;
}

.import-step .step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  transition: all 0.3s ease;
}

.import-step.active .step-number {
  background: var(--accent-primary);
  color: white;
}

.import-step.completed .step-number {
  background: #10b981;
  color: white;
}

.import-step .step-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.import-step.active .step-label {
  color: var(--accent-primary);
  font-weight: 500;
}

.import-step-connector {
  width: 40px;
  height: 2px;
  background: var(--border-color);
  margin: 0 0.25rem;
}

.import-upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-secondary);
}

.import-upload-area:hover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.05);
}

.import-upload-area.dragover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.01);
}

.import-row-valid {
  background: rgba(16, 185, 129, 0.05);
}

.import-row-duplicate {
  background: rgba(245, 158, 11, 0.1);
}

.import-row-error {
  background: rgba(239, 68, 68, 0.1);
}

.import-cell-error {
  color: #dc2626;
  font-weight: 500;
}

.import-cell-warning {
  color: #d97706;
}

.field-mapping-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.field-mapping-item .source-field {
  flex: 1;
  font-weight: 500;
  font-size: 0.85rem;
}

.field-mapping-item .arrow {
  color: var(--text-muted);
}

.field-mapping-item select {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Row selection styling */
.row-selected {
  background: rgba(59, 130, 246, 0.1) !important;
}

.row-selected:hover {
  background: rgba(59, 130, 246, 0.15) !important;
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

/* Payment Method Stats */
.method-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.method-stat .method-icon {
  font-size: 1.25rem;
}

.method-stat .method-info {
  display: flex;
  flex-direction: column;
}

.method-stat .method-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.method-stat .method-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Report Category Cards */
.report-category-card {
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.report-category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.report-list {
  display: flex;
  flex-direction: column;
}

.report-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-light);
}

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

.report-item:hover {
  background: var(--bg-hover);
}

.report-item .report-icon {
  font-size: 1.25rem;
  width: 32px;
  text-align: center;
}

.report-item .report-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.report-item .report-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.report-item .report-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.report-item .report-arrow {
  color: var(--text-muted);
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.report-item:hover .report-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* Reminder view specific */
#view-reminders h4 {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

#view-reminders .form-group label {
  font-weight: 500;
}

/* Print styles */
@media print {
  .sidebar, .page-header-actions, .btn, .nav-section {
    display: none !important;
  }
  
  .main-content {
    margin: 0 !important;
    padding: 20px !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}


    .page-header-left h1 {
      font-size: 1.5rem;
      font-weight: 700;
      margin-bottom: 0.25rem;
    }

    .page-header-left p {
      color: var(--text-secondary);
      font-size: 0.875rem;
    }

    .page-header-actions { display: flex; gap: 0.75rem; }

    /* Buttons */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      padding: 0.5rem 1rem;
      border-radius: 8px;
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s;
      border: none;
      font-family: inherit;
    }

    .btn-primary {
      background: linear-gradient(135deg, var(--accent-teal), var(--accent-primary));
      color: white;
      box-shadow: 0 2px 4px rgba(14,165,233,0.2);
    }

    .btn-primary:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(14,165,233,0.3);
    }

    .btn-secondary {
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      color: var(--text-primary);
    }

    .btn-secondary:hover {
      background: var(--bg-card-hover);
      border-color: var(--text-muted);
    }

    .btn-danger {
      background: var(--accent-danger);
      color: white;
    }

    .btn-sm {
      padding: 0.35rem 0.65rem;
      font-size: 0.8rem;
    }

    .btn-icon {
      padding: 0.4rem;
      background: transparent;
      border: 1px solid var(--border-color);
      color: var(--text-muted);
      border-radius: 6px;
    }

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

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

    .stat-card {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 1rem 1.25rem;
      transition: all 0.15s;
    }

    .stat-card:hover {
      box-shadow: var(--shadow-md);
      border-color: var(--accent-primary);
    }

    .stat-card.clickable { cursor: pointer; }

    .stat-label {
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-muted);
      font-weight: 600;
      margin-bottom: 0.25rem;
    }

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

    .stat-sub {
      font-size: 0.8rem;
      color: var(--text-secondary);
      margin-top: 0.15rem;
    }

    /* Card */
    .card {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      overflow: hidden;
      margin-bottom: 1.5rem;
    }

    .card-header {
      padding: 0.9rem 1.25rem;
      border-bottom: 1px solid var(--border-light);
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: var(--bg-secondary);
    }

    .card-title {
      font-size: 0.95rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .card-body { padding: 1.25rem; }
    .card-body.no-padding { padding: 0; }

    /* Filters Bar */
    .filters-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 0.75rem;
      padding: 0.75rem 1.25rem;
      border-bottom: 1px solid var(--border-light);
      background: var(--bg-primary);
    }

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

    .search-box input {
      width: 100%;
      padding: 0.5rem 0.75rem 0.5rem 2.25rem;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      background: var(--bg-secondary);
      font-size: 0.85rem;
      color: var(--text-primary);
    }

    .search-box input:focus {
      outline: none;
      border-color: var(--accent-primary);
      box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
    }

    .search-box .icon {
      position: absolute;
      left: 0.75rem;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted);
    }

    .filter-select {
      padding: 0.5rem 2rem 0.5rem 0.75rem;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      background: var(--bg-secondary);
      font-size: 0.85rem;
      color: var(--text-primary);
      cursor: pointer;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 0.5rem center;
    }

    /* Table */
    .data-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.85rem;
    }

    .data-table th {
      text-align: left;
      padding: 0.75rem 1rem;
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-muted);
      border-bottom: 1px solid var(--border-color);
      background: var(--bg-primary);
      font-weight: 600;
      white-space: nowrap;
    }

    .data-table td {
      padding: 0.75rem 1rem;
      border-bottom: 1px solid var(--border-light);
      vertical-align: middle;
      max-width: 200px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .data-table tbody tr {
      cursor: pointer;
      transition: background 0.1s;
    }

    .data-table tbody tr:hover td {
      background: var(--bg-card-hover);
    }

    /* Dedications Table - Fixed Layout */
    #dedicationsTable {
      table-layout: fixed;
    }
    
    #dedicationsTable td {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* Cell Types */
    .cell-donor {
      display: flex;
      align-items: center;
      gap: 0.65rem;
    }

    .avatar {
      width: 34px;
      height: 34px;
      border-radius: 8px;
      background: linear-gradient(135deg, var(--accent-teal), var(--accent-primary));
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-weight: 600;
      font-size: 0.85rem;
      flex-shrink: 0;
    }

    .avatar.sm { width: 28px; height: 28px; font-size: 0.75rem; border-radius: 6px; }

    .donor-info { display: flex; flex-direction: column; gap: 0.1rem; }
    .donor-name { font-weight: 600; }
    .donor-email { font-size: 0.75rem; color: var(--text-muted); }

    .cell-amount { font-weight: 600; }
    .cell-amount.success { color: var(--accent-success); }
    .cell-amount.warning { color: var(--accent-warning); }
    .cell-amount.danger { color: var(--accent-danger); }

    .cell-date { color: var(--text-secondary); }

    .badge {
      display: inline-block;
      padding: 0.2rem 0.5rem;
      border-radius: 999px;
      font-size: 0.7rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }

    .badge-active { background: rgba(16,185,129,0.12); color: var(--accent-success); }
    .badge-behind { background: rgba(239,68,68,0.12); color: var(--accent-danger); }
    .badge-completed { background: rgba(14,165,233,0.12); color: var(--accent-primary); }
    .badge-pending { background: rgba(245,158,11,0.12); color: var(--accent-warning); }
    .badge-failed { background: rgba(239,68,68,0.12); color: var(--accent-danger); }
    .badge-campaign { background: rgba(139,92,246,0.12); color: var(--accent-secondary); }

    .cell-actions {
      display: flex;
      gap: 0.35rem;
    }

    /* Progress Bar */
    .progress-bar {
      width: 80px;
      height: 6px;
      background: var(--border-color);
      border-radius: 3px;
      overflow: hidden;
    }

    .progress-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--accent-teal), var(--accent-primary));
      border-radius: 3px;
      transition: width 0.3s;
    }

    .progress-text {
      font-size: 0.7rem;
      color: var(--text-muted);
      margin-top: 0.2rem;
    }

    /* Empty State */
    .empty-state {
      text-align: center;
      padding: 3rem 1.5rem;
      color: var(--text-muted);
    }

    .empty-state .icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
    .empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
    .empty-state p { font-size: 0.85rem; }

    /* Modal */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15,23,42,0.6);
      backdrop-filter: blur(4px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      padding: 1.5rem;
    }

    .modal-overlay.open { display: flex; }
    
    /* Ensure receipt designer modal is always hidden until explicitly opened */
    #modal-receipt-designer:not(.open) {
      display: none !important;
      visibility: hidden;
      pointer-events: none;
    }

    /* Ensure Receipt Designer modal opens above Settings panel */
    #modal-receipt-designer.open { z-index: 1650 !important; }
    
    /* Stacked modals - edit modal always on top of details */
    #modal-donor.open { z-index: 1500 !important; }
    #modal-pledge.open { z-index: 1500 !important; }
    #modal-quick-location { z-index: 2000 !important; }
    
    /* Donor detail modal should be below edit modal */
    #donorDetailModal.open,
    .donor-detail-modal.open { z-index: 1400 !important; }
    
    /* Fix: Ensure all modals appear above settings panels and other overlays */
    #modal-location.open,
    #modal-pickup.open,
    #modal-settings-panel.open { z-index: 1300 !important; }

    /* Ensure Add Campaign modal opens above Settings panel */
    #modal-campaign.open { z-index: 1650 !important; }

    /* Ensure Add/Edit User modal opens above Settings panel */
    #modal-user.open { z-index: 1650 !important; }
    
    /* Dedication modals - opened from settings, need higher z-index */
    #modal-dedication-item.open,
    #modal-dedication-category.open { z-index: 1650 !important; }
    
    /* Settings modal should be highest */
    #modal-settings-panel.open .modal { position: relative; z-index: 1301; }
    
    /* Modals opened from settings panel need even higher z-index */
    .modal-overlay.open[id^="modal-"] { z-index: 1300 !important; }
    
    /* Edit modals should always be on top when opened from detail views */
    #modal-donor.open,
    #modal-pledge.open,
    #modal-payment.open { z-index: 1600 !important; }
    
    /* Task and Relationship modals - opened from detail views, higher than detail modals */
    #modal-task.open { z-index: 1650 !important; }
    #modal-relationship.open { z-index: 1650 !important; }
    
    /* Global search modal - highest priority modal */
    #modal-global-search.open { z-index: 2500 !important; }
    
    /* Google Places autocomplete dropdown */
    .pac-container {
      z-index: 3000 !important;
    }

    .modal {
      background: var(--bg-secondary);
      border-radius: 16px;
      border: 1px solid var(--border-color);
      max-height: 90vh;
      overflow-y: auto;
      width: 100%;
      max-width: 600px;
      box-shadow: var(--shadow-lg);
      animation: modalSlide 0.2s ease;
    }

    .modal.lg { max-width: 800px; }
    .modal.sm { max-width: 480px; }

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

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

    .modal-header h2 { font-size: 1.1rem; font-weight: 700; }

    .modal-close {
      background: transparent;
      border: none;
      font-size: 1.25rem;
      cursor: pointer;
      color: var(--text-muted);
      padding: 0.25rem;
      border-radius: 6px;
      line-height: 1;
    }

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

    .modal-body { padding: 1.5rem; }

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

    /* Forms */
    .form-section {
      margin-bottom: 1.25rem;
    }

    .form-section-title {
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      padding-bottom: 0.5rem;
      border-bottom: 1px solid var(--border-light);
      margin-bottom: 0.75rem;
    }

    .form-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 0.75rem;
    }

    .form-group {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
    }

    .form-group.full { grid-column: 1 / -1; }

    .form-group label {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--text-secondary);
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
      padding: 0.5rem 0.75rem;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      background: var(--bg-primary);
      font-size: 0.85rem;
      color: var(--text-primary);
      font-family: inherit;
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
      outline: none;
      border-color: var(--accent-primary);
      box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
    }

    .tabs-container {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* Badge variants */
.badge-danger {
  background: #fee2e2 !important;
  color: #991b1b !important;
}

.badge-warning {
  background: #fef3c7 !important;
  color: #92400e !important;
}

.badge-info {
  background: #dbeafe !important;
  color: #1e40af !important;
}

/* Reminder specific */
.reminder-tab-content {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
    .form-group textarea {
      min-height: 80px;
      resize: vertical;
    }

    .input-with-prefix {
      display: flex;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      overflow: hidden;
      background: var(--bg-primary);
    }

    .input-with-prefix:focus-within {
      border-color: var(--accent-primary);
      box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
    }

    .input-prefix {
      padding: 0.5rem 0.65rem;
      background: var(--bg-card-hover);
      color: var(--text-muted);
      font-size: 0.85rem;
      border-right: 1px solid var(--border-color);
    }

    .input-with-prefix input {
      border: none;
      flex: 1;
      background: transparent;
    }

    .input-with-prefix input:focus {
      box-shadow: none;
    }

    /* Payment Method Pills */
    .payment-methods {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
    }

    .payment-method {
      padding: 0.5rem 1rem;
      border-radius: 8px;
      border: 2px solid var(--border-color);
      background: var(--bg-primary);
      font-size: 0.8rem;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.15s;
      color: var(--text-secondary);
    }

    .payment-method:hover { border-color: var(--accent-primary); }

    .payment-method.selected {
      border-color: var(--accent-primary);
      background: rgba(14,165,233,0.08);
      color: var(--accent-primary);
    }

    /* Quick Amount Buttons */
    .quick-amounts {
      display: flex;
      flex-wrap: wrap;
      gap: 0.4rem;
      margin-top: 0.4rem;
    }

    .quick-amount {
      padding: 0.3rem 0.6rem;
      border-radius: 6px;
      border: 1px solid var(--border-color);
      background: var(--bg-secondary);
      font-size: 0.75rem;
      cursor: pointer;
      color: var(--text-secondary);
      font-weight: 500;
    }

    .quick-amount:hover {
      border-color: var(--accent-primary);
      color: var(--accent-primary);
    }

    /* Summary Box */
    .summary-box {
      background: var(--bg-primary);
      border-radius: 10px;
      padding: 1rem;
      margin-bottom: 1rem;
    }

    .summary-row {
      display: flex;
      justify-content: space-between;
      padding: 0.4rem 0;
      font-size: 0.85rem;
    }

    .summary-row:not(:last-child) {
      border-bottom: 1px solid var(--border-light);
    }

    .summary-row.highlight {
      background: rgba(14,165,233,0.06);
      margin: 0.5rem -1rem -1rem;
      padding: 0.75rem 1rem;
      border-radius: 0 0 10px 10px;
      font-weight: 600;
    }

    /* Detail View */
    .detail-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 1rem;
    }

    .detail-donor {
      display: flex;
      align-items: center;
      gap: 0.85rem;
    }

    .detail-donor .avatar {
      width: 50px;
      height: 50px;
      font-size: 1.25rem;
    }

    .detail-donor h3 {
      font-size: 1.15rem;
      font-weight: 700;
      margin-bottom: 0.1rem;
    }

    .detail-donor p {
      font-size: 0.85rem;
      color: var(--text-muted);
    }

    .detail-stats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 0.75rem;
      margin-bottom: 1.25rem;
    }

    .detail-stat {
      background: var(--bg-primary);
      padding: 0.75rem;
      border-radius: 8px;
    }

    .detail-stat-label {
      font-size: 0.65rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-muted);
      font-weight: 600;
      margin-bottom: 0.15rem;
    }

    .detail-stat-value {
      font-size: 1.1rem;
      font-weight: 700;
    }

    /* Tabs */
    .tabs {
      display: flex;
      border-bottom: 1px solid var(--border-color);
      margin-bottom: 1rem;
      gap: 0.25rem;
    }

    .tab {
      padding: 0.65rem 1rem;
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--text-muted);
      cursor: pointer;
      border-bottom: 2px solid transparent;
      transition: all 0.15s;
      margin-bottom: -1px;
    }

    .tab:hover { color: var(--text-primary); }

    .tab.active {
      color: var(--accent-primary);
      border-bottom-color: var(--accent-primary);
    }

    .tab-content { display: none; }
    .tab-content.active { display: block; }

    /* Detail Tabs (for modals) */
    .detail-tabs {
      display: flex;
      border-bottom: 1px solid var(--border-color);
      margin-bottom: 1rem;
      gap: 0.25rem;
      flex-wrap: wrap;
    }

    .detail-tab {
      padding: 0.65rem 1rem;
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--text-muted);
      cursor: pointer;
      border: none;
      background: transparent;
      border-bottom: 2px solid transparent;
      transition: all 0.15s;
      margin-bottom: -1px;
    }

    .detail-tab:hover { 
      color: var(--text-primary); 
      background: var(--bg-card-hover);
    }

    .detail-tab.active {
      color: var(--accent-primary);
      border-bottom-color: var(--accent-primary);
    }

    /* Settings Page */
    .settings-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: 1.5rem;
    }

    .settings-section {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      overflow: hidden;
    }

    .settings-section-header {
      padding: 1rem 1.25rem;
      background: var(--bg-primary);
      border-bottom: 1px solid var(--border-color);
      font-weight: 600;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .settings-section-body {
      padding: 1rem 1.25rem;
    }

    .settings-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.65rem 0;
      border-bottom: 1px solid var(--border-light);
    }

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

    .settings-item-info h4 {
      font-size: 0.9rem;
      font-weight: 600;
      margin-bottom: 0.1rem;
    }

    .settings-item-info p {
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    /* List within settings */
    .mini-list {
      max-height: 250px;
      overflow-y: auto;
    }

    .mini-list-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.6rem 0;
      border-bottom: 1px solid var(--border-light);
      font-size: 0.85rem;
    }

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

    /* New Settings Layout with Vertical Tabs */
    .settings-layout {
      display: flex;
      gap: 1.5rem;
      min-height: calc(100vh - 200px);
    }

    .settings-nav {
      width: 220px;
      flex-shrink: 0;
      position: sticky;
      top: 1.5rem;
      height: fit-content;
      background: var(--bg-secondary);
      border-radius: 12px;
      border: 1px solid var(--border-color);
      overflow: hidden;
    }

    .settings-nav-header {
      padding: 1rem;
      border-bottom: 1px solid var(--border-light);
      font-weight: 600;
      font-size: 0.75rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .settings-nav-item {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      padding: 0.75rem 1rem;
      font-size: 0.85rem;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.15s;
      border-left: 3px solid transparent;
    }

    .settings-nav-item:hover {
      background: var(--bg-card-hover);
      color: var(--text-primary);
    }

    .settings-nav-item.active {
      background: rgba(14, 165, 233, 0.08);
      color: var(--accent-primary);
      border-left-color: var(--accent-primary);
      font-weight: 500;
    }

    .settings-nav-item .icon {
      font-size: 1rem;
      width: 20px;
      text-align: center;
    }

    .settings-content {
      flex: 1;
      min-width: 0;
    }

    .settings-panel {
      background: var(--bg-secondary);
      border-radius: 12px;
      border: 1px solid var(--border-color);
      margin-bottom: 1.5rem;
      scroll-margin-top: 1.5rem;
    }
    
    /* Hidden panel class for conditional panels like Receipt Designer */
    .settings-panel.hidden-panel {
      display: none;
    }
    
    .settings-nav-item.hidden-panel {
      display: none;
    }

    .settings-panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 1rem 1.25rem;
      border-bottom: 1px solid var(--border-light);
    }

    .settings-panel-header h3 {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 1rem;
      font-weight: 600;
    }

    .settings-panel-body {
      padding: 1.25rem;
    }

    .settings-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.85rem 0;
      border-bottom: 1px solid var(--border-light);
    }

    .settings-row:last-child {
      border-bottom: none;
      padding-bottom: 0;
    }

    .settings-row:first-child {
      padding-top: 0;
    }

    .settings-row-info h4 {
      font-size: 0.9rem;
      font-weight: 500;
      margin-bottom: 0.2rem;
    }

    .settings-row-info p {
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    /* Permissions Grid */
    .permissions-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
      gap: 1rem;
    }

    .permission-card {
      background: var(--bg-primary);
      border: 1px solid var(--border-light);
      border-radius: 10px;
      padding: 1rem;
    }

    .permission-card-header {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-bottom: 0.75rem;
      padding-bottom: 0.75rem;
      border-bottom: 1px solid var(--border-light);
    }

    .permission-card-header h4 {
      font-size: 0.85rem;
      font-weight: 600;
    }

    .permission-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.4rem 0;
    }

    .permission-item label {
      font-size: 0.8rem;
      color: var(--text-secondary);
      cursor: pointer;
    }

    .permission-item input[type="checkbox"] {
      width: 16px;
      height: 16px;
      cursor: pointer;
      accent-color: var(--accent-primary);
    }

    /* Permission presets */
    .permission-presets {
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
      margin-bottom: 1rem;
      padding-bottom: 1rem;
      border-bottom: 1px solid var(--border-light);
    }

    .preset-btn {
      padding: 0.4rem 0.75rem;
      font-size: 0.75rem;
      font-weight: 500;
      border-radius: 6px;
      border: 1px solid var(--border-color);
      background: var(--bg-secondary);
      cursor: pointer;
      transition: all 0.15s;
    }

    .preset-btn:hover {
      border-color: var(--accent-primary);
      color: var(--accent-primary);
    }

    .preset-btn.active {
      background: var(--accent-primary);
      border-color: var(--accent-primary);
      color: #fff;
    }

    /* Responsive - Mobile breakpoint */
    @media (max-width: 768px) {
      /* Prevent horizontal scroll */
      html, body {
        overflow-x: hidden;
        width: 100%;
      }

      .app-container {
        flex-direction: column;
        overflow-x: hidden;
      }

      /* Show Mobile Header */
      .app-header-mobile {
        display: flex !important;
      }

      /* Sidebar - hidden by default on mobile */
      .sidebar {
        position: fixed;
        left: -260px !important;
        width: 260px;
        transition: left 0.3s ease;
        z-index: 1000;
        top: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
        background: #1a1f2e;
      }
      
      .sidebar.mobile-open { 
        left: 0 !important;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
      }
      
      /* Main content - full width on mobile */
      .main-content { 
        margin-left: 0; 
        padding: 1rem;
        padding-top: 72px; /* Account for fixed mobile header */
        width: 100%;
        min-width: 0;
      }

      /* Page header */
      .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
      }

      .page-header-actions {
        width: 100%;
        flex-wrap: wrap;
      }

      .page-header-actions .btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
      }

      /* Dashboard Charts */
      #view-dashboard > div[style*="grid-template-columns: 2fr 1fr"],
      #view-dashboard > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
      }

      /* Stats Grid */
      .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
      }

      .stat-card {
        padding: 1rem;
      }

      .stat-value {
        font-size: 1.25rem;
      }

      /* Tables - make scrollable */
      .card-body.no-padding {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }

      .data-table,
      .table {
        min-width: 600px;
      }

      .data-table th, 
      .data-table td,
      .table th, 
      .table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
        white-space: nowrap;
      }

      /* Filter bar */
      .filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
      }

      .filters-bar .search-box {
        width: 100%;
      }

      .filters-bar .filter-select {
        width: 100%;
      }

      /* Settings Grid */
      .settings-grid {
        grid-template-columns: 1fr;
      }

      .settings-section[style*="grid-column"] {
        grid-column: 1 !important;
      }

      /* New Settings Layout Mobile */
      .settings-layout {
        flex-direction: column;
      }

      .settings-nav {
        width: 100%;
        position: relative;
        top: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.5rem;
      }

      .settings-nav-header {
        display: none;
      }

      .settings-nav-item {
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
        border-left: none;
        font-size: 0.75rem;
      }

      .settings-nav-item .icon {
        font-size: 0.9rem;
      }

      .settings-nav-item.active {
        background: var(--accent-primary);
        color: #fff;
      }

      .permissions-grid {
        grid-template-columns: 1fr;
      }

      /* Gateway cards */
      .gateway-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
      }

      .gateway-status {
        width: 100%;
        justify-content: space-between;
      }

      .gateway-body .form-grid {
        grid-template-columns: 1fr;
      }

      /* Modals */
      .modal {
        width: 95%;
        max-width: none;
        max-height: 90vh;
        margin: 1rem;
      }

      .modal-body {
        max-height: calc(90vh - 140px);
      }

      .form-grid {
        grid-template-columns: 1fr;
      }

      /* Quick amounts */
      .quick-amounts {
        flex-wrap: wrap;
      }

      .quick-amounts button {
        flex: 1;
        min-width: 60px;
      }

      /* Cards on dashboard */
      .activity-grid {
        grid-template-columns: 1fr;
      }

      /* Login screen */
      .login-container {
        padding: 1.5rem;
        margin: 1rem;
      }

      /* User menu in sidebar */
      .user-menu-info {
        display: none;
      }

      /* Tabs */
      .detail-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }

      /* Toast */
      .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
      }

      /* Buttons */
      .btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.8rem;
      }

      .btn-sm {
        padding: 0.35rem 0.6rem;
      }

      /* Mini list items */
      .mini-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
      }

      .mini-list-item .btn-icon {
        align-self: flex-end;
      }

      /* Settings items */
      .settings-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
      }

      .settings-item .toggle-switch {
        align-self: flex-start;
      }
    }

    @media (max-width: 480px) {
      /* Extra small screens */
      .stats-grid {
        grid-template-columns: 1fr;
      }

      .stat-card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
      }

      .stat-icon {
        order: 2;
      }

      .page-header h1 {
        font-size: 1.35rem;
      }

      .table {
        min-width: 500px;
        font-size: 0.75rem;
      }

      .modal-header h2 {
        font-size: 1.1rem;
      }

      .login-header .logo-text {
        font-size: 1.25rem;
      }
      
      /* Better button stacking on mobile */
      .page-header-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
      }
      
      .page-header-actions .btn {
        width: 100%;
        text-align: center;
      }
      
      /* Donor detail modal improvements */
      .donor-detail-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
      }
      
      .donor-detail-header .avatar {
        margin: 0 auto;
      }
      
      .donor-stats {
        grid-template-columns: repeat(2, 1fr) !important;
      }
      
      /* Portal page grid */
      #view-portal > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
      }
      
      /* Form sections */
      .form-section-title {
        font-size: 0.8rem;
      }
      
      /* Quick add donor panel */
      #quickAddDonorPanel {
        padding: 0.75rem !important;
      }
      
      #quickAddDonorPanel .form-grid {
        gap: 0.5rem !important;
      }
    }

    /* Toast */
    .toast-container {
      position: fixed;
      bottom: 1.5rem;
      right: 1.5rem;
      z-index: 2000;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }

    .toast {
      padding: 0.75rem 1rem;
      border-radius: 8px;
      background: var(--bg-sidebar);
      color: #fff;
      font-size: 0.85rem;
      box-shadow: var(--shadow-lg);
      animation: toastIn 0.3s ease;
    }

    .toast.success { background: var(--accent-success); }
    .toast.error { background: var(--accent-danger); }
    .toast.warning { background: var(--accent-warning); }

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

    /* Sync Indicator */
    .sync-indicator {
      position: fixed;
      bottom: 20px;
      left: 20px;
      background: linear-gradient(135deg, #3b82f6, #1d4ed8);
      color: white;
      padding: 10px 18px;
      border-radius: 25px;
      font-size: 0.85rem;
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 10px;
      box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
      z-index: 9999;
      animation: slideInLeft 0.3s ease;
    }

    @keyframes slideInLeft {
      from { opacity: 0; transform: translateX(-20px); }
      to { opacity: 1; transform: translateX(0); }
    }

    .sync-spinner {
      width: 16px;
      height: 16px;
      border: 2px solid rgba(255,255,255,0.3);
      border-top-color: white;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* Pending/Syncing Items */
    tr._pending td,
    .card._pending,
    .list-item._pending {
      position: relative;
      opacity: 0.85;
    }

    tr._pending td::after,
    .card._pending::after,
    .list-item._pending::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(59, 130, 246, 0.05) 10px,
        rgba(59, 130, 246, 0.05) 20px
      );
      pointer-events: none;
    }

    .pending-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: #dbeafe;
      color: #1d4ed8;
      font-size: 0.7rem;
      padding: 2px 8px;
      border-radius: 10px;
      margin-left: 8px;
    }

    .pending-badge::before {
      content: '';
      width: 8px;
      height: 8px;
      border: 1.5px solid #1d4ed8;
      border-top-color: transparent;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }

    /* Loading */
    .loading {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 2rem;
    }

    .spinner {
      width: 32px;
      height: 32px;
      border: 3px solid var(--border-color);
      border-top-color: var(--accent-primary);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* Login Screen */
    .login-screen {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
      padding: 1.5rem;
    }

    .login-container {
      background: var(--bg-secondary);
      border-radius: 16px;
      padding: 2.5rem;
      width: 100%;
      max-width: 400px;
      box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    }

    .login-header {
      text-align: center;
      margin-bottom: 2rem;
    }

    .login-header .login-logo {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.75rem;
      margin-bottom: 0.75rem;
    }

    .login-header .logo-icon {
      width: 48px;
      height: 48px;
      background: linear-gradient(135deg, var(--accent-teal), var(--accent-primary));
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-weight: 700;
      font-size: 1.5rem;
    }

    .login-header .logo-text {
      font-size: 1.5rem;
      font-weight: 700;
      background: linear-gradient(135deg, var(--accent-teal), var(--accent-primary));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .login-header p {
      color: var(--text-muted);
      font-size: 0.9rem;
    }

    .login-form {
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .login-form .form-group label {
      display: block;
      margin-bottom: 0.4rem;
    }

    .login-form .form-group input {
      width: 100%;
      padding: 0.75rem 1rem;
      font-size: 0.95rem;
    }

    .login-btn {
      width: 100%;
      padding: 0.85rem;
      font-size: 1rem;
      margin-top: 0.5rem;
      justify-content: center;
    }

    .login-btn.loading {
      opacity: 0.7;
      pointer-events: none;
    }

    .login-error {
      background: rgba(239,68,68,0.1);
      border: 1px solid rgba(239,68,68,0.3);
      color: var(--accent-danger);
      padding: 0.75rem 1rem;
      border-radius: 8px;
      font-size: 0.85rem;
      text-align: center;
    }

    .login-footer {
      margin-top: 1.5rem;
      text-align: center;
      padding-top: 1.5rem;
      border-top: 1px solid var(--border-light);
    }

    .login-footer p {
      color: var(--text-muted);
      font-size: 0.8rem;
    }

    /* User Menu in Header */
    .user-menu {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.4rem 0.75rem;
      background: rgba(255,255,255,0.05);
      border-radius: 8px;
      cursor: pointer;
      transition: background 0.15s;
    }

    .user-menu:hover {
      background: rgba(255,255,255,0.1);
    }

    .user-menu .avatar {
      width: 32px;
      height: 32px;
      font-size: 0.85rem;
    }

    .user-menu-info {
      display: flex;
      flex-direction: column;
    }

    .user-menu-name {
      font-size: 0.85rem;
      font-weight: 600;
      color: #fff;
    }

    .user-menu-role {
      font-size: 0.7rem;
      color: var(--text-sidebar);
      text-transform: capitalize;
    }

    .user-menu-dropdown {
      position: absolute;
      bottom: 100%;
      left: 0;
      right: 0;
      background: #1e293b;
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 8px;
      box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
      margin-bottom: 0.5rem;
      display: none;
      overflow: hidden;
      z-index: 200;
    }

    .user-menu-dropdown.open {
      display: block;
    }

    .user-menu-dropdown-item {
      padding: 0.65rem 1rem;
      font-size: 0.85rem;
      color: #e2e8f0;
      cursor: pointer;
      transition: background 0.1s;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .user-menu-dropdown-item:hover {
      background: rgba(255,255,255,0.1);
    }

    .user-menu-dropdown-item.danger {
      color: #f87171;
    }
    
    .user-menu-dropdown-item.danger:hover {
      background: rgba(239, 68, 68, 0.2);
    }
    
    /* Sidebar bottom needs relative positioning for dropdown */
    .sidebar-bottom {
      position: relative;
    }

    /* Feedback Category Selector */
    .feedback-categories {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
    }

    .feedback-category {
      cursor: pointer;
    }

    .feedback-category input {
      display: none;
    }

    .feedback-category-btn {
      display: block;
      padding: 0.6rem 0.75rem;
      border: 2px solid var(--border-color);
      border-radius: 8px;
      text-align: center;
      font-size: 0.85rem;
      transition: all 0.2s;
      background: var(--bg-primary);
    }

    .feedback-category-btn:hover {
      border-color: var(--accent-primary);
      background: rgba(59, 130, 246, 0.05);
    }

    .feedback-category input:checked + .feedback-category-btn {
      border-color: var(--accent-primary);
      background: rgba(59, 130, 246, 0.1);
      color: var(--accent-primary);
      font-weight: 500;
    }

    /* Email Type Selector */
    .email-type-selector {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.75rem;
    }

    .email-type-option {
      cursor: pointer;
    }

    .email-type-option input {
      display: none;
    }

    .email-type-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 1rem 0.75rem;
      border: 2px solid var(--border-color);
      border-radius: 10px;
      text-align: center;
      transition: all 0.2s;
      background: var(--bg-primary);
    }

    .email-type-card:hover {
      border-color: var(--accent-primary);
      background: rgba(59, 130, 246, 0.03);
    }

    .email-type-option input:checked + .email-type-card {
      border-color: var(--accent-primary);
      background: rgba(59, 130, 246, 0.08);
    }

    .email-type-icon {
      font-size: 1.5rem;
      margin-bottom: 0.35rem;
    }

    .email-type-label {
      font-weight: 600;
      font-size: 0.85rem;
      color: var(--text-primary);
    }

    .email-type-desc {
      font-size: 0.7rem;
      color: var(--text-muted);
      margin-top: 0.2rem;
    }

    .checkbox-label {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.85rem;
      cursor: pointer;
    }

    .checkbox-label input[type="checkbox"] {
      width: 16px;
      height: 16px;
      cursor: pointer;
    }

    /* Custom Message Container */
    .custom-message-container {
      border: 1px solid var(--border-color);
      border-radius: 8px;
      overflow: hidden;
    }

    .custom-message-header {
      background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
      padding: 0.5rem 0.75rem;
      font-size: 0.75rem;
      color: #92400e;
      border-bottom: 1px solid #fcd34d;
    }

    .custom-message-container textarea {
      border: none;
      border-radius: 0;
      resize: vertical;
    }

    .custom-message-container textarea:focus {
      outline: none;
      box-shadow: none;
    }

    /* Toggle Switch */
    .toggle-switch {
      position: relative;
      display: inline-block;
      width: 50px;
      height: 28px;
      margin: 0;
    }

    .toggle-switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .toggle-slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #cbd5e1;
      transition: all 0.3s ease;
      border-radius: 28px;
      border: 2px solid transparent;
    }

    .toggle-slider:before {
      position: absolute;
      content: "";
      height: 20px;
      width: 20px;
      left: 2px;
      top: 2px;
      background-color: white;
      transition: all 0.3s ease;
      border-radius: 50%;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    /* Checked (enabled) state */
    .toggle-switch input:checked + .toggle-slider {
      background-color: #10b981;
      border-color: #059669;
    }

    .toggle-switch input:checked + .toggle-slider:before {
      transform: translateX(22px);
      box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    }

    /* Focus states */
    .toggle-slider:focus,
    .toggle-switch input:focus + .toggle-slider {
      box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    }

    /* Hover effects */
    .toggle-switch:hover .toggle-slider {
      transform: scale(1.02);
    }

    /* Mobile Header */
    .app-header-mobile {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: 56px;
      background: var(--bg-secondary);
      align-items: center;
      gap: 0.75rem;
      padding: 0 1rem;
      border-bottom: 1px solid var(--border-color);
      z-index: 200;
      box-shadow: var(--shadow-sm);
    }

    .icon-btn {
      background: linear-gradient(135deg, var(--accent-teal), var(--accent-primary));
      border: none;
      border-radius: 8px;
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.25rem;
      cursor: pointer;
      transition: transform 0.15s, opacity 0.15s;
      color: #fff;
    }

    .icon-btn:hover {
      opacity: 0.9;
    }

    .icon-btn:active {
      transform: scale(0.95);
    }

    .app-title-mobile {
      font-weight: 700;
      font-size: 1.1rem;
      background: linear-gradient(135deg, var(--accent-teal), var(--accent-primary));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    /* Mobile Overlay */
    .mobile-overlay {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.5);
      z-index: 140;
    }

    .mobile-overlay.open {
      display: block;
    }

    /* User Status Badge */
    .user-status {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.2rem 0.5rem;
      border-radius: 999px;
      font-size: 0.7rem;
      font-weight: 600;
    }

    .user-status.active {
      background: rgba(16,185,129,0.12);
      color: var(--accent-success);
    }

    .user-status.inactive {
      background: rgba(148,163,184,0.2);
      color: var(--text-muted);
    }

    /* Payment Gateway Cards */
    .gateway-card {
      border: 1px solid var(--border-color);
      border-radius: 12px;
      margin-bottom: 1rem;
      overflow: hidden;
      transition: all 0.3s ease;
    }

    .gateway-card:hover {
      border-color: var(--accent-primary);
      box-shadow: var(--shadow-sm);
    }

    .gateway-card.active {
      border-color: var(--accent-success);
      background: rgba(16, 185, 129, 0.03);
    }

    .gateway-card.enabled {
      border-color: #10b981 !important;
      box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.1);
    }

    .gateway-card.enabled .gateway-header {
      background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    }

    .gateway-card.disabled {
      opacity: 0.8;
      background-color: #f8fafc;
      border-color: #e2e8f0 !important;
    }

    .gateway-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 1rem;
      cursor: pointer;
      transition: background 0.15s;
    }

    .gateway-header:hover {
      background: var(--bg-card-hover);
    }

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

    .gateway-logo {
      width: 42px;
      height: 42px;
      background: linear-gradient(135deg, var(--accent-teal), var(--accent-primary));
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-weight: 700;
      font-size: 0.9rem;
    }

    .gateway-info h4 {
      font-size: 0.95rem;
      font-weight: 600;
      margin-bottom: 0.15rem;
    }

    .gateway-info p {
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    .gateway-status {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    /* Enhanced gateway status badges */
    .gateway-badge {
      display: inline-block;
      padding: 0.35rem 0.85rem;
      border-radius: 16px;
      font-size: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      transition: all 0.3s ease;
      border: 1px solid;
      white-space: nowrap;
      background: #f1f5f9;
      color: #64748b;
      border-color: #cbd5e1;
    }

    .gateway-badge.configured {
      background: rgba(16, 185, 129, 0.12);
      color: var(--accent-success);
    }

    /* Enabled state */
    .gateway-badge.enabled {
      background: #dcfce7 !important;
      color: #16a34a !important;
      border-color: #86efac !important;
    }

    /* Disabled state (configured but disabled) */
    .gateway-badge.disabled {
      background: #fef3c7 !important;
      color: #d97706 !important;
      border-color: #fcd34d !important;
    }

    /* Loading state */
    .gateway-badge.loading {
      opacity: 0.7;
      animation: pulse 1.5s infinite;
    }

    /* Add icons to badges */
    .gateway-badge.enabled::before {
      content: "✅ ";
    }

    .gateway-badge.disabled::before {
      content: "⚠️ ";
    }

    .gateway-badge.error {
      background: rgba(239, 68, 68, 0.12);
      color: var(--accent-danger);
    }

    .gateway-body {
      padding: 1rem 1rem 1.25rem;
      border-top: 1px solid var(--border-light);
      background: var(--bg-primary);
      display: none;
    }

    .gateway-body.open {
      display: block;
    }

    .gateway-actions {
      display: flex;
      justify-content: flex-end;
      gap: 0.5rem;
      margin-top: 1rem;
      padding-top: 1rem;
      border-top: 1px solid var(--border-light);
    }
  

/* ==================== CROWDFUNDING MODULE STYLES ==================== */
    
    /* Campaign Cards */
    .cf-campaigns-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
      gap: 1.5rem;
    }

    .cf-campaign-card {
      background: var(--bg-card);
      border-radius: 12px;
      overflow: hidden;
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--border-color);
      transition: all 0.2s;
    }

    .cf-campaign-card:hover {
      box-shadow: var(--shadow-md);
      transform: translateY(-2px);
    }

    .cf-campaign-header {
      background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-primary) 100%);
      padding: 20px;
      color: white;
      position: relative;
    }

    .cf-campaign-header h3 {
      font-size: 1.25rem;
      font-weight: 700;
      margin-bottom: 4px;
    }

    .cf-campaign-header p {
      opacity: 0.9;
      font-size: 0.875rem;
    }

    .cf-campaign-status {
      position: absolute;
      top: 12px;
      right: 12px;
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
    }

    .cf-campaign-status.active { background: #22c55e; }
    .cf-campaign-status.draft { background: #64748b; }
    .cf-campaign-status.paused { background: #f59e0b; }
    .cf-campaign-status.completed { background: #6366f1; }

    .cf-campaign-body {
      padding: 20px;
    }

    .cf-progress-section {
      margin-bottom: 16px;
    }

    .cf-progress-stats {
      display: flex;
      justify-content: space-between;
      margin-bottom: 8px;
    }

    .cf-progress-raised {
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--accent-teal);
    }

    .cf-progress-goal {
      font-size: 0.875rem;
      color: var(--text-secondary);
    }

    .cf-progress-bar {
      height: 8px;
      background: var(--border-color);
      border-radius: 4px;
      overflow: hidden;
    }

    .cf-progress-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--accent-teal), var(--accent-primary));
      border-radius: 4px;
      transition: width 0.5s;
    }

    .cf-campaign-stats {
      display: flex;
      gap: 20px;
      margin-bottom: 16px;
      padding-bottom: 16px;
      border-bottom: 1px solid var(--border-color);
    }

    .cf-stat {
      text-align: center;
    }

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

    .cf-stat-label {
      font-size: 0.75rem;
      color: var(--text-muted);
      text-transform: uppercase;
    }

    .cf-campaign-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .cf-campaign-actions .btn {
      flex: 1;
      min-width: 80px;
    }

    /* Teams Table */
    .cf-teams-table {
      width: 100%;
      border-collapse: collapse;
    }

    .cf-teams-table th,
    .cf-teams-table td {
      padding: 12px 16px;
      text-align: left;
      border-bottom: 1px solid var(--border-color);
    }

    .cf-teams-table th {
      background: var(--bg-primary);
      font-weight: 600;
      font-size: 0.75rem;
      text-transform: uppercase;
      color: var(--text-secondary);
    }

    .cf-team-rank {
      width: 36px;
      height: 36px;
      background: var(--accent-teal);
      color: white;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
    }

    .cf-team-rank.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
    .cf-team-rank.silver { background: linear-gradient(135deg, #9ca3af, #6b7280); }
    .cf-team-rank.bronze { background: linear-gradient(135deg, #d97706, #b45309); }

    .cf-team-name {
      font-weight: 600;
      color: var(--text-primary);
    }

    .cf-team-captain {
      font-size: 0.875rem;
      color: var(--text-secondary);
    }

    .cf-team-progress {
      width: 100px;
      height: 6px;
      background: var(--border-color);
      border-radius: 3px;
      overflow: hidden;
    }

    .cf-team-progress div {
      height: 100%;
      background: var(--accent-teal);
      border-radius: 3px;
    }

    /* Analytics Dashboard */
    .cf-analytics-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 1.5rem;
      margin-bottom: 1.5rem;
    }

    @media (max-width: 1200px) {
      .cf-analytics-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    @media (max-width: 600px) {
      .cf-analytics-grid {
        grid-template-columns: 1fr;
      }
      .cf-campaigns-grid {
        grid-template-columns: 1fr;
      }
    }

    .cf-analytics-card {
      background: var(--bg-card);
      border-radius: 12px;
      padding: 24px;
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--border-color);
    }

    .cf-analytics-card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 12px;
    }

    .cf-analytics-card-header span {
      font-size: 0.875rem;
      color: var(--text-secondary);
    }

    .cf-analytics-card-header i {
      font-size: 1.5rem;
      color: var(--accent-teal);
    }

    .cf-analytics-value {
      font-size: 2rem;
      font-weight: 800;
      color: var(--text-primary);
    }

    .cf-analytics-change {
      font-size: 0.875rem;
      color: var(--accent-success);
      display: flex;
      align-items: center;
      gap: 4px;
      margin-top: 4px;
    }

    .cf-analytics-change.negative {
      color: var(--accent-danger);
    }

    /* Chart Container */
    .cf-chart-container {
      background: var(--bg-card);
      border-radius: 12px;
      padding: 24px;
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--border-color);
      margin-bottom: 1.5rem;
    }

    .cf-chart-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
    }

    .cf-chart-header h3 {
      font-size: 1rem;
      font-weight: 600;
    }

    .cf-chart-body {
      height: 300px;
      display: flex;
      align-items: flex-end;
      gap: 8px;
      padding: 20px 0;
    }

    .cf-chart-bar {
      flex: 1;
      background: linear-gradient(180deg, var(--accent-teal), var(--accent-primary));
      border-radius: 4px 4px 0 0;
      min-height: 4px;
      transition: height 0.5s;
      position: relative;
    }

    .cf-chart-bar:hover {
      opacity: 0.8;
    }

    .cf-chart-labels {
      display: flex;
      gap: 8px;
      margin-top: 12px;
    }

    .cf-chart-labels span {
      flex: 1;
      text-align: center;
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    /* Leaderboard */
    .cf-leaderboard {
      background: var(--bg-card);
      border-radius: 12px;
      padding: 24px;
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--border-color);
    }

    .cf-leaderboard h3 {
      font-size: 1rem;
      font-weight: 600;
      margin-bottom: 16px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .cf-leaderboard-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px;
      background: var(--bg-primary);
      border-radius: 8px;
      margin-bottom: 8px;
    }

    .cf-leaderboard-item:last-child {
      margin-bottom: 0;
    }

    /* Recent Donations */
    .cf-recent-donations {
      background: var(--bg-card);
      border-radius: 12px;
      padding: 24px;
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--border-color);
    }

    .cf-donation-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 0;
      border-bottom: 1px solid var(--border-color);
    }

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

    .cf-donation-avatar {
      width: 40px;
      height: 40px;
      background: linear-gradient(135deg, var(--accent-teal), var(--accent-primary));
      color: white;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
    }

    .cf-donation-info {
      flex: 1;
    }

    .cf-donation-name {
      font-weight: 600;
      font-size: 0.875rem;
    }

    .cf-donation-meta {
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    .cf-donation-amount {
      font-weight: 700;
      color: var(--accent-teal);
    }

    /* Campaign Modal Tabs */
    .cf-modal-tabs {
      display: flex;
      gap: 4px;
      background: var(--bg-primary);
      padding: 4px;
      border-radius: 8px;
      margin-bottom: 24px;
    }

    .cf-modal-tab {
      flex: 1;
      padding: 10px 16px;
      background: transparent;
      border: none;
      border-radius: 6px;
      font-size: 0.875rem;
      font-weight: 500;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.2s;
    }

    .cf-modal-tab.active {
      background: white;
      color: var(--text-primary);
      box-shadow: var(--shadow-sm);
    }

    .cf-modal-tab-content {
      display: none;
    }

    .cf-modal-tab-content.active {
      display: block;
    }

    .cf-form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
    }

    @media (max-width: 600px) {
      .cf-form-row {
        grid-template-columns: 1fr;
      }
    }

    .cf-color-picker {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .cf-color-picker input[type="color"] {
      width: 50px;
      height: 40px;
      border: none;
      border-radius: 8px;
      cursor: pointer;
    }

    .cf-toggle-group {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .cf-toggle-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      background: var(--bg-primary);
      border-radius: 8px;
    }

    .cf-toggle-item label {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .cf-toggle-item label span:first-child {
      font-weight: 500;
      color: var(--text-primary);
    }

    .cf-toggle-item label span:last-child {
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    .cf-amount-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .cf-amount-chip {
      padding: 8px 16px;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 20px;
      font-size: 0.875rem;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .cf-amount-chip button {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 0;
      font-size: 1rem;
    }

    .cf-amount-chip button:hover {
      color: var(--accent-danger);
    }

    .cf-share-url {
      display: flex;
      gap: 8px;
      margin-top: 16px;
    }

    .cf-share-url input {
      flex: 1;
      padding: 12px;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      font-size: 0.875rem;
      color: var(--text-secondary);
    }

    .cf-share-url button {
      padding: 12px 20px;
      background: var(--accent-teal);
      border: none;
      border-radius: 8px;
      color: white;
      font-weight: 500;
      cursor: pointer;
    }

    /* ============================================
       V10 STYLES - Mobile, Yiddish, Logo, Schedules
       ============================================ */
    
    /* V10: Improved Mobile Payment Form */
    @media (max-width: 768px) {
      /* Payment modal improvements */
      #modal-payment .modal {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 12px 12px 0 0;
        max-height: 95vh;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
      }
      
      #modal-payment .modal-body {
        max-height: calc(95vh - 130px);
        overflow-y: auto;
        padding: 1rem;
        -webkit-overflow-scrolling: touch;
      }
      
      /* Credit card section compact */
      #creditCardSection {
        padding: 0.75rem !important;
      }
      
      #creditCardSection .form-grid {
        gap: 0.5rem;
      }
      
      /* Schedule options compact */
      #scheduleOptions {
        padding: 0.75rem;
      }
      
      #scheduleOptions .form-grid {
        grid-template-columns: 1fr 1fr !important;
      }
      
      /* Summary box compact */
      .summary-box {
        padding: 0.75rem;
      }
      
      .summary-box .summary-row {
        padding: 0.35rem 0;
        font-size: 0.85rem;
      }
      
      /* Quick amounts responsive */
      .quick-amounts {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
      }
      
      .quick-amounts button {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        flex: 1 1 calc(25% - 0.35rem);
        min-width: 55px;
      }
      
      /* Form sections tighter */
      #modal-payment .form-section {
        margin-bottom: 0.75rem;
        padding: 0.75rem;
      }
      
      #modal-payment .form-section-title {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
      }
      
      /* Inputs slightly smaller */
      #modal-payment input,
      #modal-payment select,
      #modal-payment textarea {
        padding: 0.6rem;
        font-size: 0.95rem;
      }
      
      /* Footer buttons */
      #modal-payment .modal-footer {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
        border-top: 1px solid var(--border-color);
        background: var(--bg-secondary);
      }
      
      #modal-payment .modal-footer .btn {
        flex: 1;
        min-width: 100px;
        padding: 0.75rem;
      }
    }

    @media (max-width: 480px) {
      /* Extra compact on smallest screens */
      #modal-payment .modal-header h2 {
        font-size: 1rem;
      }
      
      #modal-payment .modal-footer .btn {
        padding: 0.7rem 0.5rem;
        font-size: 0.85rem;
      }
      
      /* Stack schedule options */
      #scheduleOptions .form-grid {
        grid-template-columns: 1fr !important;
      }
      
      /* Stack credit card fields */
      #newCardForm .form-grid {
        grid-template-columns: 1fr !important;
      }
      
      #newCardForm .form-group[style*="grid-template-columns"] {
        display: flex !important;
        gap: 0.5rem;
      }
      
      #newCardForm .form-group[style*="grid-template-columns"] > div {
        flex: 1;
      }
      
      /* Jewish calendar options stack */
      #scheduleOptions div[style*="display: flex; gap: 1.5rem"] {
        flex-direction: column;
        gap: 0.75rem !important;
      }
    }

    /* V10: Yiddish/Hebrew name styling */
    input[dir="rtl"] {
      text-align: right;
      font-family: 'David', 'Times New Roman', 'Plus Jakarta Sans', serif;
    }
    
    .yiddish-name-section {
      background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
      border: 1px solid #fcd34d;
      border-radius: 8px;
      padding: 1rem;
      margin-bottom: 0.75rem;
    }
    
    .yiddish-name-section > .form-grid {
      display: grid;
      grid-template-columns: 100px 1fr 1fr 100px !important;
      gap: 0.75rem;
    }
    
    @media (max-width: 600px) {
      .yiddish-name-section > .form-grid {
        grid-template-columns: 1fr 1fr !important;
      }
    }
    
    .yiddish-name-section .form-section-title {
      color: #92400e;
      border-bottom-color: #fcd34d;
    }
    
    .yiddish-name-section .form-group {
      margin-bottom: 0;
    }
    
    .yiddish-name-section label {
      color: #78350f;
      font-weight: 500;
    }
    
    .yiddish-name-section input,
    .yiddish-name-section select {
      background: white;
      border-color: #fcd34d;
    }
    
    .yiddish-name-section input:focus,
    .yiddish-name-section select:focus {
      border-color: #f59e0b;
      box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
    }

    /* V10: Logo preview */
    #orgLogoPreview {
      transition: all 0.2s ease;
    }
    
    #orgLogoPreview:hover {
      border-color: var(--accent-primary);
    }
    
    #orgLogoPreview img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    /* V10: Payment schedule badge */
    .schedule-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      padding: 0.2rem 0.6rem;
      background: #dbeafe;
      color: #1e40af;
      border-radius: 12px;
      font-size: 0.7rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s;
    }
    
    .schedule-badge:hover {
      background: #bfdbfe;
    }

    .schedule-badge.completed {
      background: #dcfce7;
      color: #166534;
    }

    .schedule-badge.cancelled {
      background: #fee2e2;
      color: #991b1b;
    }
    
    .schedule-badge.pending {
      background: #fef3c7;
      color: #92400e;
    }

    /* V10: Pledge link in payment row */
    .pledge-link {
      color: var(--accent-primary);
      text-decoration: none;
      cursor: pointer;
      font-size: 0.8rem;
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
    }

    .pledge-link:hover {
      text-decoration: underline;
    }
    
    /* V10: Schedule group modal */
    .schedule-group-info .stat-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 0.75rem;
    }
    
    @media (max-width: 600px) {
      .schedule-group-info .stat-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }
    
    .schedule-group-info .stat {
      text-align: center;
      padding: 1rem;
      background: var(--bg-primary);
      border-radius: 8px;
    }
    
    .schedule-group-info .stat-value {
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--accent-teal);
    }
    
    .schedule-group-info .stat-label {
      font-size: 0.7rem;
      color: var(--text-muted);
      text-transform: uppercase;
      margin-top: 0.25rem;
    }
    
    /* Notification animations */
    @keyframes slideIn {
      from {
        transform: translateX(100%);
        opacity: 0;
      }
      to {
        transform: translateX(0);
        opacity: 1;
      }
    }
    
    @keyframes slideOut {
      from {
        transform: translateX(0);
        opacity: 1;
      }
      to {
        transform: translateX(100%);
        opacity: 0;
      }
    }
    
    @keyframes highlightNew {
      0% {
        background-color: rgba(16, 185, 129, 0.3);
        transform: scale(1.02);
      }
      100% {
        background-color: transparent;
        transform: scale(1);
      }
    }
    
    /* ======================================
       ZECHUSIM CALENDAR STYLES
    ====================================== */
    
    .zechusim-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1.5rem;
      flex-wrap: wrap;
      gap: 1rem;
    }
    
    .zechusim-views {
      display: flex;
      gap: 0.5rem;
      background: var(--bg-primary);
      padding: 0.25rem;
      border-radius: 8px;
    }
    
    .view-btn {
      padding: 0.5rem 1rem;
      border: none;
      background: transparent;
      color: var(--text-secondary);
      font-weight: 500;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s;
      font-size: 0.875rem;
    }
    
    .view-btn:hover {
      background: var(--bg-secondary);
      color: var(--text-primary);
    }
    
    .view-btn.active {
      background: var(--accent-primary);
      color: white;
    }
    
    .calendar-container {
      background: var(--bg-secondary);
      border-radius: 12px;
      padding: 1.5rem;
      box-shadow: var(--shadow-sm);
    }
    
    .calendar-controls {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1.5rem;
      padding: 1rem;
      background: var(--bg-primary);
      border-radius: 8px;
    }
    
    .month-nav {
      display: flex;
      align-items: center;
      gap: 1rem;
    }
    
    .month-display {
      min-width: 200px;
      text-align: center;
    }
    
    .month-name {
      font-size: 1.25rem;
      font-weight: 600;
      color: var(--text-primary);
    }
    
    .hebrew-month {
      font-size: 0.875rem;
      color: var(--text-secondary);
      margin-top: 0.25rem;
    }
    
    .calendar-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 1px;
      background: var(--border-color);
      border: 1px solid var(--border-color);
    }
    
    .calendar-weekday {
      background: var(--bg-primary);
      padding: 0.75rem;
      text-align: center;
      font-weight: 600;
      font-size: 0.875rem;
      color: var(--text-secondary);
    }
    
    .calendar-day {
      background: var(--bg-secondary);
      min-height: 100px;
      padding: 0.5rem;
      cursor: pointer;
      transition: all 0.2s;
      position: relative;
    }
    
    .calendar-day:hover {
      background: var(--bg-primary);
    }
    
    .calendar-day.other-month {
      opacity: 0.5;
      background: #fafafa;
    }
    
    .calendar-day.shabbat {
      background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    }
    
    .day-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 0.5rem;
    }
    
    .day-number {
      font-weight: 600;
      color: var(--text-primary);
      font-size: 1rem;
    }
    
    .hebrew-date {
      font-size: 0.85rem;
      color: var(--accent-secondary);
      font-weight: 500;
      direction: rtl;
    }
    
    .dedications-list {
      font-size: 0.7rem;
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
      margin-top: 0.25rem;
    }
    
    /* Drag and Drop Styles */
    .ded-calendar-item {
      cursor: grab;
      transition: transform 0.15s, box-shadow 0.15s;
    }
    
    .ded-calendar-item:hover {
      transform: scale(1.02);
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    
    .ded-calendar-item:active {
      cursor: grabbing;
    }
    
    .ded-drop-zone.drag-over,
    .ded-drop-zone[style*="dbeafe"] {
      border: 2px dashed #3b82f6 !important;
      background: #dbeafe !important;
    }
    
    .dedication-item {
      padding: 0.2rem 0.4rem;
      border-radius: 4px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: all 0.15s;
      font-weight: 500;
    }
    
    .dedication-item:hover {
      transform: scale(1.02);
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .dedication-institution {
      background: rgba(139, 92, 246, 0.2);
      color: #7c3aed;
    }
    
    .dedication-class-day {
      background: rgba(14, 165, 233, 0.2);
      color: #0284c7;
    }
    
    .dedication-class-week {
      background: rgba(16, 185, 129, 0.2);
      color: #059669;
    }
    
    .dedication-class-month {
      background: rgba(245, 158, 11, 0.2);
      color: #d97706;
    }
    
    /* Legacy class names for backwards compatibility */
    .dedication-class {
      background: rgba(14, 165, 233, 0.2);
      color: #0284c7;
    }
    
    .dedication-week {
      background: rgba(16, 185, 129, 0.2);
      color: #059669;
    }
    
    .dedication-month {
      background: rgba(245, 158, 11, 0.2);
      color: #d97706;
    }
    
    .week-view-grid {
      display: grid;
      grid-template-columns: 100px repeat(7, 1fr);
      gap: 1px;
      background: var(--border-color);
    }
    
    .time-slot {
      background: var(--bg-primary);
      padding: 0.5rem;
      font-size: 0.875rem;
      color: var(--text-secondary);
      text-align: center;
    }
    
    .week-day-cell {
      background: var(--bg-secondary);
      padding: 0.5rem;
      min-height: 60px;
      cursor: pointer;
      transition: all 0.2s;
    }
    
    .week-day-cell:hover {
      background: var(--bg-primary);
    }
    
    .day-view-container {
      display: grid;
      grid-template-columns: 100px 1fr;
      gap: 1px;
      background: var(--border-color);
    }
    
    .hour-block {
      background: var(--bg-secondary);
      padding: 1rem;
      min-height: 80px;
      border-bottom: 1px solid var(--border-color);
    }
    
    /* Zechus Type Legend */
    .zechus-legend {
      display: flex;
      gap: 2rem;
      margin-top: 1rem;
      padding: 1rem;
      background: var(--bg-primary);
      border-radius: 8px;
      flex-wrap: wrap;
    }
    
    .legend-item {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.875rem;
    }
    
    .legend-color {
      width: 20px;
      height: 20px;
      border-radius: 4px;
    }
    
    /* Zechusim Purchase Modal */
    .zechusim-modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.7);
      z-index: 1000;
      align-items: center;
      justify-content: center;
    }
    
    .zechusim-modal.active {
      display: flex;
    }
    
    .zechusim-modal .modal-content {
      background: var(--bg-secondary);
      border-radius: 12px;
      padding: 0;
      max-width: 650px;
      width: 90%;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    }
    
    .zechusim-modal .modal-header {
      background: var(--bg-primary);
      border-bottom: 1px solid var(--border-color);
      padding: 1.25rem 1.5rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-radius: 12px 12px 0 0;
    }
    
    .zechusim-modal .modal-body {
      padding: 1.5rem;
      background: white;
    }
    
    .zechusim-modal .modal-footer {
      padding: 1rem 1.5rem;
      border-top: 1px solid var(--border-color);
      display: flex;
      justify-content: flex-end;
      gap: 0.75rem;
      background: var(--bg-primary);
      border-radius: 0 0 12px 12px;
    }
    
    .zechus-type-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 1rem;
      margin-top: 0.5rem;
    }
    
    .zechus-type-card {
      border: 2px solid var(--border-color);
      border-radius: 12px;
      padding: 1.25rem;
      cursor: pointer;
      transition: all 0.2s;
      background: white;
    }
    
    .zechus-type-card:hover {
      border-color: var(--accent-primary);
      background: var(--bg-primary);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    
    .zechus-type-card.selected {
      border-color: var(--accent-primary);
      background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(14, 165, 233, 0.03));
      box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
    }
    
    .zechus-price {
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--accent-success);
      margin: 0.5rem 0;
    }
    
    .class-selection {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.75rem;
      margin-top: 0.75rem;
    }
    
    .class-option {
      padding: 0.75rem;
      border: 2px solid var(--border-color);
      border-radius: 8px;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
      background: white;
    }
    
    .class-option:hover:not(.sold) {
      background: var(--accent-primary);
      color: white;
      border-color: var(--accent-primary);
      transform: translateY(-2px);
    }
    
    .class-option.selected {
      background: var(--accent-primary);
      color: white;
      border-color: var(--accent-primary);
      box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
    }
    
    .class-option.sold {
      opacity: 0.5;
      cursor: not-allowed;
      background: repeating-linear-gradient(
        45deg,
        var(--bg-primary),
        var(--bg-primary) 10px,
        var(--border-color) 10px,
        var(--border-color) 20px
      );
    }

    /* ============================================
       GLOBAL SEARCH STYLES
       ============================================ */
    #modal-global-search .modal {
      animation: slideDown 0.2s ease-out;
    }
    
    @keyframes slideDown {
      from {
        opacity: 0;
        transform: translateY(-20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    
    .global-search-item {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.75rem 1rem;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.15s;
    }
    
    .global-search-item:hover,
    .global-search-item:focus,
    .global-search-item.selected {
      background: var(--bg-secondary);
      outline: none;
    }
    
    .global-search-item.selected {
      background: var(--accent-primary);
      color: white;
    }
    
    .global-search-item.selected .search-item-subtitle,
    .global-search-item.selected .search-item-shortcut {
      color: rgba(255,255,255,0.8) !important;
    }
    
    .search-item-icon {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1rem;
      color: white;
      flex-shrink: 0;
    }
    
    .search-item-content {
      flex: 1;
      min-width: 0;
    }
    
    .search-item-title {
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    
    .search-item-subtitle {
      font-size: 0.8rem;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    
    .search-item-shortcut {
      background: var(--bg-secondary);
      padding: 0.25rem 0.5rem;
      border-radius: 4px;
      font-size: 0.7rem;
      color: var(--text-muted);
      border: 1px solid var(--border-color);
      font-family: monospace;
    }
    
    .search-item-badge {
      font-size: 0.7rem;
      padding: 0.2rem 0.5rem;
      border-radius: 4px;
      background: var(--bg-secondary);
      color: var(--text-muted);
    }

    /* Quick Actions Bar */
    .quick-action-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 12px -3px rgba(0, 0, 0, 0.2) !important;
    }
    
    .quick-action-btn:active {
      transform: translateY(0);
    }

    /* Saved Filters */
    .saved-filter-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.75rem 1rem;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      margin-bottom: 0.5rem;
      cursor: pointer;
      transition: all 0.15s;
    }
    
    .saved-filter-item:hover {
      background: var(--bg-secondary);
      border-color: var(--accent-primary);
    }
    
    .saved-filter-item .filter-name {
      font-weight: 500;
    }
    
    .saved-filter-item .filter-meta {
      font-size: 0.8rem;
      color: var(--text-muted);
    }

    /* Duplicate Donor Item */
    .duplicate-donor-item {
      display: flex;
      align-items: center;
      gap: 1rem;
      padding: 1rem;
      border: 2px solid var(--border-color);
      border-radius: 10px;
      margin-bottom: 0.75rem;
      cursor: pointer;
      transition: all 0.15s;
    }
    
    .duplicate-donor-item:hover {
      border-color: var(--accent-primary);
      background: rgba(59, 130, 246, 0.05);
    }
    
    .duplicate-donor-item .donor-avatar {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background: linear-gradient(135deg, #3b82f6, #1d4ed8);
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.25rem;
      font-weight: 600;
      flex-shrink: 0;
    }
    
    .duplicate-donor-item .donor-info {
      flex: 1;
    }
    
    .duplicate-donor-item .donor-name {
      font-weight: 600;
      font-size: 1rem;
    }
    
    .duplicate-donor-item .donor-details {
      font-size: 0.85rem;
      color: var(--text-muted);
    }
    
    .duplicate-donor-item .match-score {
      padding: 0.25rem 0.75rem;
      border-radius: 20px;
      font-size: 0.75rem;
      font-weight: 600;
    }
    
    .duplicate-donor-item .match-score.high {
      background: #fee2e2;
      color: #dc2626;
    }
    
    .duplicate-donor-item .match-score.medium {
      background: #fef3c7;
      color: #d97706;
    }

    /* Keyboard shortcut hint */
    .keyboard-hint {
      position: fixed;
      bottom: 1.5rem;
      right: 1.5rem;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 0.5rem 0.75rem;
      font-size: 0.75rem;
      color: var(--text-muted);
      box-shadow: var(--shadow-lg);
      z-index: 100;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      opacity: 0;
      transform: translateY(10px);
      transition: all 0.3s;
      pointer-events: none;
    }
    
    .keyboard-hint.visible {
      opacity: 1;
      transform: translateY(0);
    }

    /* Saved filter button in headers */
    .saved-filters-btn {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 0.75rem;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 6px;
      font-size: 0.85rem;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.15s;
    }
    
    .saved-filters-btn:hover {
      background: var(--accent-primary);
      color: white;
      border-color: var(--accent-primary);
    }
    
    /* Column Chooser Button */
    .column-chooser-btn {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 0.75rem;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 6px;
      font-size: 0.85rem;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.15s;
    }
    
    .column-chooser-btn:hover {
      background: #64748b;
      color: white;
      border-color: #64748b;
    }
    
    /* Column Chooser List */
    .column-chooser-list {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      max-height: 350px;
      overflow-y: auto;
    }
    
    .column-chooser-item {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.65rem 0.75rem;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      cursor: grab;
      transition: all 0.15s;
    }
    
    .column-chooser-item:hover {
      background: var(--bg-card-hover);
      border-color: var(--accent-primary);
    }
    
    .column-chooser-item.dragging {
      opacity: 0.5;
      transform: scale(1.02);
      box-shadow: var(--shadow-md);
    }
    
    .column-chooser-item .drag-handle {
      color: var(--text-muted);
      cursor: grab;
      font-size: 1rem;
    }
    
    .column-chooser-item input[type="checkbox"] {
      width: 18px;
      height: 18px;
      cursor: pointer;
    }
    
    .column-chooser-item .column-name {
      flex: 1;
      font-size: 0.9rem;
      color: var(--text-primary);
    }
    
    .column-chooser-item.disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
    
    .column-chooser-item.disabled .drag-handle {
      cursor: not-allowed;
    }

    /* ============ BULK OPERATIONS ============ */
    .bulk-toolbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.75rem 1rem;
      background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
      border-bottom: 1px solid rgba(255,255,255,0.1);
      animation: slideDown 0.2s ease;
    }
    
    @keyframes slideDown {
      from { transform: translateY(-100%); opacity: 0; }
      to { transform: translateY(0); opacity: 1; }
    }
    
    .bulk-toolbar-left, .bulk-toolbar-right {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }
    
    .bulk-count {
      color: white;
      font-weight: 600;
      font-size: 0.9rem;
    }
    
    .bulk-toolbar .btn {
      padding: 0.4rem 0.75rem;
      font-size: 0.8rem;
    }
    
    .bulk-toolbar .btn-secondary {
      background: rgba(255,255,255,0.15);
      color: white;
      border: 1px solid rgba(255,255,255,0.3);
    }
    
    .bulk-toolbar .btn-secondary:hover {
      background: rgba(255,255,255,0.25);
    }
    
    .bulk-toolbar .btn-primary {
      background: white;
      color: #3b82f6;
    }
    
    .bulk-toolbar .btn-warning {
      background: #f59e0b;
      color: white;
      border: none;
    }
    
    .bulk-toolbar .btn-danger {
      background: #ef4444;
      color: white;
      border: none;
    }
    
    /* Checkbox styling in tables */
    .data-table input[type="checkbox"] {
      width: 16px;
      height: 16px;
      cursor: pointer;
      accent-color: var(--accent-primary);
    }
    
    .data-table tr.selected {
      background: rgba(59, 130, 246, 0.08) !important;
    }
    
    .data-table tr.selected:hover {
      background: rgba(59, 130, 246, 0.12) !important;
    }
    
    /* Merge modal field selection */
    .merge-field-row {
      display: grid;
      grid-template-columns: 140px 1fr 1fr;
      gap: 0.5rem;
      padding: 0.5rem 0;
      border-bottom: 1px solid var(--border-color);
      align-items: center;
    }
    
    .merge-field-label {
      font-weight: 500;
      color: var(--text-secondary);
      font-size: 0.85rem;
    }
    
    .merge-field-option {
      padding: 0.5rem 0.75rem;
      border: 2px solid var(--border-color);
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.15s;
      font-size: 0.85rem;
      background: var(--bg-primary);
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    
    .merge-field-option:hover {
      border-color: var(--accent-primary);
      background: rgba(59, 130, 246, 0.05);
    }
    
    .merge-field-option.selected {
      border-color: var(--accent-primary);
      background: rgba(59, 130, 246, 0.1);
    }
    
    .merge-field-option input[type="radio"] {
      margin: 0;
    }
    
    .merge-donor-card {
      padding: 1rem;
      border: 2px solid var(--border-color);
      border-radius: 8px;
      background: var(--bg-primary);
      cursor: pointer;
      transition: all 0.15s;
    }
    
    .merge-donor-card:hover {
      border-color: var(--accent-primary);
    }
    
    .merge-donor-card.primary {
      border-color: var(--accent-primary);
      background: rgba(59, 130, 246, 0.08);
    }
    
    .merge-donor-card .donor-header {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      margin-bottom: 0.5rem;
    }
    
    .merge-donor-card .badge-primary {
      background: var(--accent-primary);
      color: white;
      padding: 0.2rem 0.5rem;
      border-radius: 4px;
      font-size: 0.7rem;
      font-weight: 600;
    }
    
    .merge-stats {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.5rem;
      margin-top: 0.75rem;
      padding-top: 0.75rem;
      border-top: 1px solid var(--border-color);
      font-size: 0.8rem;
    }
    
    .merge-stat {
      text-align: center;
    }
    
    .merge-stat-value {
      font-weight: 600;
      color: var(--text-primary);
    }
    
    .merge-stat-label {
      color: var(--text-secondary);
      font-size: 0.7rem;
    }

    /* ============ PLEDGE ALLOCATION ============ */
    .pledge-allocation-section {
      margin-top: 1.5rem;
      padding: 1.25rem;
      background: var(--bg-secondary);
      border-radius: 16px;
    }
    
    .pledge-allocation-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1rem;
    }
    
    .pledge-allocation-title {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-weight: 600;
      font-size: 1rem;
      color: var(--text-primary);
    }
    
    .pledge-allocation-toggle {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.85rem;
      color: var(--text-secondary);
      cursor: pointer;
    }
    
    .pledge-allocation-toggle input[type="checkbox"] {
      accent-color: var(--accent-primary);
      width: 16px;
      height: 16px;
    }
    
    .pledge-allocation-actions {
      display: flex;
      gap: 0.5rem;
      margin-bottom: 1rem;
    }
    
    .btn-auto-allocate {
      background: linear-gradient(135deg, #10b981 0%, #059669 100%);
      color: white;
      border: none;
      padding: 0.6rem 1.25rem;
      border-radius: 10px;
      font-size: 0.9rem;
      font-weight: 500;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 0.4rem;
      transition: all 0.15s;
      box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    }
    
    .btn-auto-allocate:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    }
    
    .btn-clear-allocate {
      background: var(--card-bg);
      border: 1px solid var(--border-color);
      padding: 0.6rem 1rem;
      border-radius: 10px;
      font-size: 0.9rem;
      cursor: pointer;
      color: var(--text-secondary);
      transition: all 0.15s;
    }
    
    .btn-clear-allocate:hover {
      background: var(--bg-tertiary);
      color: var(--text-primary);
    }
    
    .pledge-list-container {
      max-height: 320px;
      overflow-y: auto;
      background: var(--card-bg);
      border: 1px solid var(--border-color);
      border-radius: 12px;
    }
    
    .pledge-allocation-item {
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 0.75rem;
      padding: 1rem 1.25rem;
      border-bottom: 1px solid var(--border-color);
      align-items: center;
      transition: background 0.15s;
    }
    
    .pledge-allocation-item:last-child {
      border-bottom: none;
    }
    
    .pledge-allocation-item:hover {
      background: var(--bg-secondary);
    }
    
    .pledge-allocation-item.selected {
      background: rgba(99, 102, 241, 0.08);
      border-left: 3px solid var(--accent-primary);
    }
    
    .pledge-allocation-item input[type="checkbox"] {
      width: 20px;
      height: 20px;
      accent-color: var(--accent-primary);
      cursor: pointer;
    }
    
    .pledge-allocation-info {
      min-width: 0;
    }
    
    .pledge-allocation-name {
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      flex-wrap: wrap;
    }
    
    .pledge-allocation-campaign {
      font-size: 0.75rem;
      background: var(--accent-primary);
      color: white;
      padding: 0.2rem 0.6rem;
      border-radius: 6px;
      font-weight: 500;
    }
    
    .pledge-allocation-meta {
      display: flex;
      gap: 1rem;
      font-size: 0.8rem;
      color: var(--text-secondary);
      margin-top: 0.35rem;
    }
    
    .pledge-allocation-meta span {
      display: flex;
      align-items: center;
      gap: 0.25rem;
    }
    
    .pledge-allocation-meta .balance-warning {
      color: var(--accent-warning);
      font-weight: 500;
    }
    
    .pledge-allocation-progress {
      height: 5px;
      background: var(--bg-tertiary);
      border-radius: 3px;
      margin-top: 0.5rem;
      overflow: hidden;
    }
    
    .pledge-allocation-progress-fill {
      height: 100%;
      background: linear-gradient(90deg, #10b981, #34d399);
      border-radius: 3px;
      transition: width 0.3s;
    }
    
    .pledge-allocation-amount {
      display: flex;
      align-items: center;
      gap: 0.25rem;
      background: var(--bg-secondary);
      padding: 0.25rem;
      border-radius: 8px;
    }
    
    .pledge-allocation-amount span {
      padding-left: 0.5rem;
      color: var(--text-secondary);
      font-weight: 500;
    }
    
    .pledge-allocation-amount input {
      width: 90px;
      padding: 0.5rem 0.75rem;
      border: none;
      background: transparent;
      font-size: 1rem;
      font-weight: 600;
      text-align: right;
      color: var(--text-primary);
    }
    
    .pledge-allocation-amount input:focus {
      outline: none;
    }
    
    .pledge-allocation-amount input:disabled {
      background: #f3f4f6;
      color: #9ca3af;
    }
    
    .allocation-summary {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 1rem;
      padding: 1rem 1.25rem;
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
      border: 1px solid rgba(16, 185, 129, 0.3);
      border-radius: 12px;
    }
    
    .allocation-total {
      font-weight: 600;
      color: var(--text-primary);
    }
    
    .allocation-total #allocatedAmount {
      color: var(--accent-success);
      font-size: 1.1rem;
    }
    
    .allocation-remaining {
      color: var(--accent-warning);
      font-weight: 500;
    }
    
    .allocation-summary.over-allocated {
      background: linear-gradient(135deg, #fef2f2, #fee2e2);
      border-color: #fca5a5;
    }
    
    .allocation-summary.under-allocated {
      background: linear-gradient(135deg, #fffbeb, #fef3c7);
      border-color: #fcd34d;
    }
    
    .allocation-total {
      font-weight: 600;
    }
    
    .allocation-remaining {
      font-size: 0.85rem;
      color: var(--text-secondary);
    }
    
    .allocation-remaining.warning {
      color: #f59e0b;
    }
    
    .allocation-remaining.error {
      color: #ef4444;
    }
    
    .no-pledges-message {
      padding: 2rem;
      text-align: center;
      color: var(--text-secondary);
    }
    
    .no-pledges-message .icon {
      font-size: 2rem;
      margin-bottom: 0.5rem;
    }

    /* ============ ATTACHMENTS ============ */
    .attachments-section {
      margin-top: 1.5rem;
      padding-top: 1.5rem;
      border-top: 1px solid var(--border-color);
    }
    
    .attachments-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1rem;
    }
    
    .attachments-title {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-weight: 600;
      font-size: 0.95rem;
    }
    
    .attachments-count {
      background: var(--bg-secondary);
      padding: 0.15rem 0.5rem;
      border-radius: 10px;
      font-size: 0.75rem;
      color: var(--text-secondary);
    }
    
    .attachment-upload-zone {
      border: 2px dashed var(--border-color);
      border-radius: 8px;
      padding: 1.5rem;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
      background: var(--bg-primary);
      margin-bottom: 1rem;
    }
    
    .attachment-upload-zone:hover,
    .attachment-upload-zone.dragover {
      border-color: var(--accent-primary);
      background: rgba(59, 130, 246, 0.05);
    }
    
    .attachment-upload-zone .upload-icon {
      font-size: 2rem;
      margin-bottom: 0.5rem;
    }
    
    .attachment-upload-zone .upload-text {
      color: var(--text-secondary);
      font-size: 0.9rem;
    }
    
    .attachment-upload-zone .upload-text strong {
      color: var(--accent-primary);
    }
    
    .attachment-upload-zone input[type="file"] {
      display: none;
    }
    
    .attachments-list {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      max-height: 200px;
      overflow-y: auto;
    }
    
    .attachment-item {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.75rem;
      background: var(--bg-secondary);
      border-radius: 8px;
      transition: all 0.15s;
    }
    
    .attachment-item:hover {
      background: var(--bg-tertiary, #e5e7eb);
    }
    
    .attachment-icon {
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      font-size: 1.25rem;
      flex-shrink: 0;
    }
    
    .attachment-icon.pdf { background: #fef2f2; color: #dc2626; }
    .attachment-icon.image { background: #f0fdf4; color: #16a34a; }
    .attachment-icon.doc { background: #eff6ff; color: #2563eb; }
    .attachment-icon.sheet { background: #f0fdf4; color: #16a34a; }
    .attachment-icon.other { background: #f5f5f5; color: #737373; }
    
    .attachment-info {
      flex: 1;
      min-width: 0;
    }
    
    .attachment-name {
      font-weight: 500;
      font-size: 0.9rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    
    .attachment-meta {
      display: flex;
      gap: 0.75rem;
      font-size: 0.75rem;
      color: var(--text-secondary);
      margin-top: 0.15rem;
    }
    
    .attachment-actions {
      display: flex;
      gap: 0.25rem;
    }
    
    .attachment-actions .btn-icon {
      width: 32px;
      height: 32px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      border: none;
      cursor: pointer;
      font-size: 1rem;
      transition: background 0.15s;
    }
    
    .attachment-actions .btn-icon:hover {
      background: rgba(0,0,0,0.1);
    }
    
    .attachment-actions .btn-icon.delete:hover {
      background: #fee2e2;
      color: #dc2626;
    }
    
    .attachment-preview {
      width: 40px;
      height: 40px;
      border-radius: 6px;
      object-fit: cover;
      flex-shrink: 0;
    }
    
    .attachment-uploading {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.75rem;
      background: linear-gradient(135deg, #eff6ff, #dbeafe);
      border-radius: 8px;
      border: 1px solid #93c5fd;
    }
    
    .attachment-uploading .spinner {
      width: 20px;
      height: 20px;
      border: 2px solid #93c5fd;
      border-top-color: #2563eb;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }
    
    .no-attachments {
      text-align: center;
      padding: 1rem;
      color: var(--text-secondary);
      font-size: 0.9rem;
    }
    
    .attachment-preview-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.85);
      z-index: 10000;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      visibility: hidden;
      transition: all 0.2s;
    }
    
    .attachment-preview-modal.active {
      opacity: 1;
      visibility: visible;
    }
    
    .attachment-preview-modal img {
      max-width: 90%;
      max-height: 90%;
      border-radius: 8px;
      box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    }
    
    .attachment-preview-modal .close-btn {
      position: absolute;
      top: 20px;
      right: 20px;
      width: 40px;
      height: 40px;
      background: white;
      border: none;
      border-radius: 50%;
      font-size: 1.5rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }

/* ==== extracted style block separator ==== */

.receipt-field-palette {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .receipt-field-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: grab;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .receipt-field-item:hover {
    background: #e0f2fe;
    border-color: #0ea5e9;
  }
  
  .receipt-field-item:active {
    cursor: grabbing;
  }
  
  .receipt-field-item .field-icon {
    font-size: 1rem;
  }
  
  .receipt-canvas-field {
    position: absolute;
    padding: 4px 8px;
    background: rgba(14, 165, 233, 0.1);
    border: 1px dashed #0ea5e9;
    border-radius: 4px;
    cursor: move;
    font-family: Arial, sans-serif;
    white-space: nowrap;
    user-select: none;
  }
  
  .receipt-canvas-field:hover {
    background: rgba(14, 165, 233, 0.2);
  }
  
  .receipt-canvas-field.selected {
    background: rgba(14, 165, 233, 0.3);
    border: 2px solid #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
  }
  
  .receipt-canvas-field .field-label {
    font-size: 10px;
    color: #0369a1;
    position: absolute;
    top: -16px;
    left: 0;
    background: #e0f2fe;
    padding: 1px 4px;
    border-radius: 3px;
    display: none;
  }
  
  .receipt-canvas-field:hover .field-label,
  .receipt-canvas-field.selected .field-label {
    display: block;
  }



/* ================================
   UI FIX PATCH — 2026-01-12
   Sidebar scrolling + Hebrew grid
   ================================ */

/* ---- SIDEBAR SCROLL FIX ---- */
.sidebar,
.side-nav,
.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar .sidebar-inner,
.sidebar .nav-sections,
.side-nav .nav-sections,
.app-sidebar .nav-sections {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 16px;
}

/* ---- MODAL / OVERLAY SAFETY ---- */
.modal-overlay {
  pointer-events: auto;
}

.login-screen.hidden {
  pointer-events: none;
}

/* ---- HEBREW / YIDDISH NAME GRID FIX ---- */
.yiddish-name-section .form-grid{
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.yiddish-name-section .form-grid > *{
  min-width: 0;
}

.yiddish-name-section input,
.yiddish-name-section select{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Mobile */
@media (max-width: 600px){
  .yiddish-name-section .form-grid{
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- SAVED FILTERS BUTTON FALLBACK STYLE ---- */
.btn-saved-filters,
#btnSavedFilters,
.saved-filters-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
  color: #2b2b2b;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.btn-saved-filters:hover,
#btnSavedFilters:hover,
.saved-filters-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.14);
}

.btn-saved-filters:active,
#btnSavedFilters:active,
.saved-filters-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* FundRaisePro - Sidebar scroll + click safety patch
   Load this AFTER your existing styles.css (or paste at the very bottom).
   Goal: fix sidebar not scrolling / not clickable WITHOUT changing your main content layout.
*/

/* 1) Make the sidebar container scrollable (supports common sidebar selectors) */
:where(
  #sidebar,
  .sidebar,
  .app-sidebar,
  .side-nav,
  .sidenav,
  .left-nav,
  .nav-sidebar,
  aside.sidebar,
  nav.sidebar
) {
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
}

/* 2) If you have an inner scroll area, make THAT scroll instead (common patterns) */
:where(
  #sidebar .sidebar-content,
  #sidebar .sidebar-nav,
  #sidebar .nav-content,
  .sidebar .sidebar-content,
  .sidebar .sidebar-nav,
  .app-sidebar .sidebar-content,
  .app-sidebar .sidebar-nav,
  .side-nav .nav-content,
  .side-nav .sidebar-content,
  .sidenav .nav-content,
  .nav-sidebar .nav-content
) {
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* 3) Click safety: sometimes an overlay/backdrop is left open with a high z-index.
      Ensure sidebar is above standard content, but below active modals (which should be higher). */
:where(#sidebar, .sidebar, .app-sidebar, .side-nav, .sidenav, .left-nav, .nav-sidebar) {
  position: relative; /* doesn't move it, but allows z-index to apply */
  z-index: 20;
}

/* 4) If a backdrop is covering the page when it shouldn't, this helps prevent it from blocking clicks.
      This targets typical overlay class names without touching your modal internals.
      (If you rely on these for true modals, they should already be inside the modal overlay.) */
:where(.backdrop, .overlay, .page-overlay) {
  pointer-events: none;
}

/* 5) Avoid global "body overflow: hidden" traps that kill sidebar scroll.
      We only undo it if it was forced inline by CSS (not by JS for an open modal).
      If you intentionally lock scroll on modal-open, keep your .modal-open class doing that.
*/
body:not(.modal-open):not(.drawer-open) {
  overflow-y: auto;
}



/* =========================================================
   Sidebar scroll fix (keeps main layout untouched)
   ========================================================= */
html, body {
  height: 100%;
}

/* =========================================================
   Sidebar & Layout Fix
   ========================================================= */

/* =========================================================
   Sidebar & Layout Fix (Desktop only - min-width: 769px)
   ========================================================= */
@media (min-width: 769px) {
  /* Sidebar - Fixed position, doesn't scroll with page */
  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
  }

  /* Main content - positioned next to fixed sidebar */
  .main-content {
    margin-left: 220px !important;
    width: calc(100% - 220px) !important;
    max-width: calc(100% - 220px) !important;
    padding: 1.5rem 2rem !important;
    min-height: 100vh;
    box-sizing: border-box;
  }
}

/* Sidebar navigation - scrolls internally */
.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Sidebar bottom - stays at bottom */
.sidebar-bottom {
  flex-shrink: 0;
}

/* =========================================================
   MOBILE-FIRST RESPONSIVE STYLES
   ========================================================= */

/* Mobile breakpoint: 768px and below */
@media (max-width: 768px) {
  /* Hide sidebar by default on mobile */
  .sidebar {
    position: fixed !important;
    left: -260px !important;
    width: 260px;
    transition: left 0.3s ease;
    z-index: 10000;
    box-shadow: none;
    display: flex !important;
    flex-direction: column;
    height: calc(100vh - 60px);
    top: 60px;
    background: #1a1f2e;
    padding-top: 0;
  }
  
  .sidebar.mobile-open {
    left: 0 !important;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }
  
  /* Full width main content on mobile */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem !important;
    padding-top: 70px !important; /* Space for mobile header */
  }
  
  /* Mobile header bar */
  .mobile-header {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1219 100%);
    z-index: 10001;
    align-items: center;
    padding: 0 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  }
  
  .mobile-menu-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .mobile-menu-btn:active {
    background: rgba(255,255,255,0.2);
  }
  
  .mobile-header-title {
    flex: 1;
    text-align: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
  }
  
  .mobile-header-logo {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .mobile-header-logo img {
    max-height: 32px;
    max-width: 32px;
  }
  
  /* Mobile overlay - behind sidebar (z-index 1000) but catches clicks to close */
  .mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  
  .mobile-overlay.active {
    display: block !important;
  }
  
  /* Page header adjustments */
  .page-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch !important;
  }
  
  .page-header .header-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .page-header .header-actions .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
  
  /* Card adjustments */
  .card {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .card-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch !important;
  }
  
  /* Stats grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .stat-value {
    font-size: 1.25rem;
  }
  
  /* Tables - horizontal scroll */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
  }
  
  table {
    min-width: 600px;
  }
  
  /* Filter bar */
  .filter-bar {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
  }
  
  .filter-bar input,
  .filter-bar select {
    width: 100%;
  }
  
  .filter-bar .filter-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }
  
  .filter-bar .filter-actions .btn {
    flex: 1;
  }
  
  /* Forms */
  .form-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .form-group {
    width: 100% !important;
    min-width: 100% !important;
  }
  
  /* Modal improvements */
  .modal-content {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 90vh;
    margin: 5vh auto;
    border-radius: 16px;
  }
  
  .modal-header {
    padding: 1rem;
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 10;
  }
  
  .modal-body {
    padding: 1rem;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
  }
  
  .modal-footer {
    padding: 1rem;
    position: sticky;
    bottom: 0;
    background: inherit;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .modal-footer .btn {
    flex: 1;
    min-width: 120px;
  }
  
  /* Settings page */
  .settings-layout {
    flex-direction: column !important;
  }
  
  .settings-nav {
    display: none !important;
  }
  
  .settings-content {
    width: 100% !important;
    padding: 0 !important;
  }
  
  .settings-section {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  /* Quick actions */
  .quick-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .quick-actions .btn {
    flex: 1;
    min-width: calc(50% - 0.25rem);
  }
  
  /* Dashboard charts */
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Donor detail sidebar */
  .detail-sidebar {
    position: fixed !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh;
    top: 0;
    right: -100%;
    transition: right 0.3s ease;
  }
  
  .detail-sidebar.open {
    right: 0;
  }
  
  /* Bottom navigation for key actions */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1219 100%);
    z-index: 998;
    padding: 0.5rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    justify-content: space-around;
    align-items: center;
  }
  
  .mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: rgba(255,255,255,0.6);
    font-size: 0.7rem;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 8px;
    min-width: 60px;
  }
  
  .mobile-bottom-nav .nav-item.active {
    color: var(--accent-primary);
  }
  
  .mobile-bottom-nav .nav-item .icon {
    font-size: 1.25rem;
  }
  
  /* Add bottom padding to content for bottom nav */
  .main-content {
    padding-bottom: 90px !important;
  }
  
  /* Touch-friendly buttons */
  .btn, button {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }
  
  .btn-icon {
    min-width: 44px;
    min-height: 44px;
  }
  
  /* Search input */
  .search-input, input[type="search"], input[type="text"] {
    font-size: 16px !important; /* Prevents zoom on iOS */
  }
  
  /* Tabs */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  
  .tab {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  
  .page-header h2 {
    font-size: 1.25rem;
  }
  
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }
  
  .modal-body {
    max-height: calc(100vh - 140px);
  }
  
  .card {
    border-radius: 12px;
  }
}

/* Desktop - hide mobile elements */
@media (min-width: 769px) {
  .mobile-header,
  .mobile-bottom-nav,
  .mobile-overlay {
    display: none !important;
  }
}

/* =========================================================
   SETTINGS PAGE REDESIGN
   ========================================================= */

.settings-section {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.settings-section-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #6366f1 100%);
  border-radius: 10px;
  font-size: 1.25rem;
}

.settings-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-section-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Settings toggle row */
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  transition: background 0.2s;
}

.settings-toggle-row:hover {
  background: var(--bg-tertiary);
}

.settings-toggle-info {
  flex: 1;
}

.settings-toggle-label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.settings-toggle-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Modern toggle switch */
.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  border-radius: 28px;
  transition: 0.3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #6366f1 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Settings input group */
.settings-input-group {
  margin-bottom: 1rem;
}

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

.settings-input-group input,
.settings-input-group select,
.settings-input-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.settings-input-group input:focus,
.settings-input-group select:focus,
.settings-input-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Settings grid for inline items */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

/* Compact settings list */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: 10px;
}

.settings-list-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
}

/* =========================================================
   CAMPAIGN STATS POPUP
   ========================================================= */

.campaign-stats-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.campaign-stats-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.campaign-stats-card {
  position: relative;
  background: var(--card-bg);
  border-radius: 20px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
  overflow: hidden;
}

.campaign-stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #6366f1 100%);
  color: white;
}

.campaign-stats-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.campaign-stats-header .btn-icon {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.campaign-stats-body {
  padding: 1.5rem;
}

.campaign-goal-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.goal-progress-container {
  height: 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.goal-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-success) 0%, #10b981 100%);
  border-radius: 6px;
  transition: width 0.5s ease;
}

.goal-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
}

.campaign-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.campaign-stats-grid .stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
}

.campaign-stats-grid .stat-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 10px;
  font-size: 1.25rem;
}

.campaign-stats-grid .stat-info {
  flex: 1;
}

.campaign-stats-grid .stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.campaign-stats-grid .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

.campaign-completion {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 12px;
}

.completion-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.completion-bar-container {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.completion-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary) 0%, #6366f1 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.completion-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: right;
}

.campaign-stats-footer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.campaign-stats-footer .btn {
  flex: 1;
}

/* =========================================================
   DONOR LINK STYLING (Clickable donor names in tables)
   ========================================================= */

.donor-link {
  color: var(--accent-primary);
  transition: color 0.2s;
}

.cell-donor:hover .donor-link {
  color: #6366f1;
  text-decoration: underline;
}

/* =========================================================
   IMPROVED PLEDGE ALLOCATION SECTION
   ========================================================= */

.allocation-section {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 1.25rem;
  margin-top: 1.5rem;
}

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

.allocation-header h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

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

.allocation-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}

.allocation-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.allocation-item:hover {
  border-color: var(--accent-primary);
}

.allocation-item.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.allocation-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-primary);
}

.allocation-info {
  flex: 1;
  min-width: 0;
}

.allocation-name {
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.allocation-details {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.allocation-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
}

.allocation-input-wrapper span {
  color: var(--text-secondary);
  font-weight: 500;
}

.allocation-input {
  width: 80px;
  padding: 0.5rem;
  border: none;
  background: transparent;
  text-align: right;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.allocation-input:focus {
  outline: none;
}

.allocation-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.allocation-summary-text {
  font-weight: 600;
  color: var(--text-primary);
}

.allocation-summary-unallocated {
  color: var(--accent-warning);
  font-size: 0.9rem;
}

.allocation-save-btn {
  margin-top: 1rem;
}

/* Animation keyframes */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =========================================================
   DATE RANGE FILTER STYLING
   ========================================================= */

.date-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 0.9rem;
  min-width: 130px;
}

.date-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.date-range-filter .btn.active {
  background: var(--accent-primary);
  color: white;
}

.date-range-inputs .btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.date-range-inputs .btn-icon:hover {
  background: var(--accent-danger);
  color: white;
  border-color: var(--accent-danger);
}

/* =========================================================
   DEDICATION MANAGER IMPROVED STYLING
   ========================================================= */

.dedication-category-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.dedication-item-row:hover {
  background: var(--bg-secondary) !important;
  border-color: var(--accent-primary) !important;
}

.btn-icon-sm {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.btn-icon-sm:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

/* =========================================================
   DONATION PICKUP STYLES
   ========================================================= */

.overdue-row {
  background: rgba(239, 68, 68, 0.1) !important;
}

.overdue-row:hover {
  background: rgba(239, 68, 68, 0.15) !important;
}

.route-stop {
  cursor: grab;
}

.route-stop:hover {
  border-color: var(--accent-primary) !important;
}

#pickupRouteMap {
  border-radius: 12px;
  overflow: hidden;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-weight: 500;
}

.input-with-icon input {
  padding-left: 28px;
}

.btn-block {
  width: 100%;
}

/* Settings Dashboard Cards */
.settings-card {
  transition: all 0.2s ease !important;
}

.settings-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
  border-color: var(--accent-primary) !important;
}

/* Donor Detail Modal Improvements */
.detail-tab.active {
  background: var(--accent-primary) !important;
  color: white !important;
}

.detail-tab {
  background: transparent;
  border: none;
  font-weight: 500;
  transition: all 0.2s;
}

.detail-tab:hover:not(.active) {
  background: var(--bg-primary);
}

/* ============================================
   Activity Timeline
   ============================================ */
/* ============================================ */
/* BEAUTIFUL ACTIVITY TIMELINE - ENHANCED STYLES */
/* ============================================ */

/* ============================================ */
/* 1. MODERN TIMELINE CARD CONTAINER */
/* ============================================ */

.activity-timeline-card {
  margin-top: 1.5rem;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.3s ease;
}

.activity-timeline-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* Modern Header */
.activity-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-weight: 600;
}

.timeline-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.timeline-icon-header {
  font-size: 1.25rem;
  opacity: 0.8;
}

.timeline-title-text {
  font-size: 1.1rem;
  color: #1e293b;
  font-weight: 700;
}

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

.timeline-refresh-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  background: white;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.timeline-refresh-btn:hover {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
  transform: translateY(-1px);
}

/* ============================================ */
/* 2. TIMELINE CONTAINER */
/* ============================================ */

.activity-timeline {
  padding: 1.5rem;
  background: #fefefe;
}

.activity-timeline-container {
  position: relative;
}

/* ============================================ */
/* 3. DATE GROUPING */
/* ============================================ */

.activity-date-group {
  margin-bottom: 2rem;
}

.activity-date-group:last-child {
  margin-bottom: 0;
}

.activity-date-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.activity-date-label {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.activity-date-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, #e2e8f0, transparent);
  border-radius: 1px;
}

.activity-date-items {
  position: relative;
}

/* ============================================ */
/* 4. TIMELINE ITEMS */
/* ============================================ */

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.timeline-item:last-child,
.timeline-item.timeline-item-last {
  margin-bottom: 0;
}

.timeline-item:hover {
  transform: translateX(4px);
}

/* Timeline Marker */
.timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

.timeline-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 3;
}

.timeline-emoji {
  font-size: 1.1rem;
  filter: brightness(1.1);
}

.timeline-line {
  width: 2px;
  height: 40px;
  background: linear-gradient(180deg, #e2e8f0 0%, #f1f5f9 100%);
  margin-top: 0.5rem;
  border-radius: 1px;
}

/* ============================================ */
/* 5. TIMELINE CONTENT CARDS */
/* ============================================ */

.timeline-content {
  flex: 1;
  min-width: 0;
}

.timeline-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.timeline-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.timeline-card.expanded {
  border-color: #3b82f6;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
}

.timeline-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--timeline-color, #3b82f6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timeline-card:hover::before,
.timeline-card.expanded::before {
  opacity: 1;
}

/* Timeline Header */
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.timeline-title {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.timeline-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
}

.timeline-action {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
  word-wrap: break-word;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
  white-space: nowrap;
}

.timeline-time {
  font-weight: 500;
  color: #475569;
}

.timeline-separator {
  color: #cbd5e1;
}

.timeline-user {
  color: #64748b;
  font-weight: 500;
}

/* Timeline Details */
.timeline-details {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.timeline-details p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
  font-size: 0.9rem;
}

/* ============================================ */
/* 6. LEGACY ACTIVITY ITEM STYLES (for backwards compatibility) */
/* ============================================ */

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  margin-bottom: 0.5rem;
}

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 0.35rem;
  background: #3b82f6;
  flex: 0 0 10px;
}

.activity-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.activity-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============================================ */
/* 7. LOADING STATES */
/* ============================================ */

.activity-timeline-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  color: #64748b;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f1f5f9;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.activity-timeline-loading span {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ============================================ */
/* 8. EMPTY STATES */
/* ============================================ */

.activity-timeline-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: #64748b;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
  animation: float 3s ease-in-out infinite;
}

.activity-timeline-empty h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #475569;
}

.activity-timeline-empty p {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
  max-width: 300px;
  line-height: 1.5;
}

/* ============================================ */
/* 9. ACTIVITY TYPE COLORS */
/* ============================================ */

.timeline-item[data-type="created"] {
  --timeline-color: #10b981;
}

.timeline-item[data-type="updated"] {
  --timeline-color: #3b82f6;
}

.timeline-item[data-type="deleted"] {
  --timeline-color: #ef4444;
}

.timeline-item[data-type="payment"] {
  --timeline-color: #059669;
}

.timeline-item[data-type="email"] {
  --timeline-color: #7c3aed;
}

.timeline-item[data-type="note"] {
  --timeline-color: #f59e0b;
}

.timeline-item[data-type="status"] {
  --timeline-color: #06b6d4;
}

.timeline-item[data-type="login"] {
  --timeline-color: #8b5cf6;
}

.timeline-item[data-type="export"] {
  --timeline-color: #84cc16;
}

/* ============================================ */
/* 10. ANIMATIONS */
/* ============================================ */

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

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

.timeline-item {
  animation: slideIn 0.4s ease;
}

/* ============================================ */
/* 11. RESPONSIVE DESIGN */
/* ============================================ */

@media (max-width: 768px) {
  .activity-timeline {
    padding: 1rem;
  }
  
  .activity-timeline-header {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .timeline-header-left {
    justify-content: center;
  }
  
  .activity-timeline-actions {
    justify-content: center;
  }
  
  .activity-date-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    text-align: center;
  }
  
  .activity-date-line {
    height: 1px;
  }
  
  .timeline-item {
    gap: 0.75rem;
  }
  
  .timeline-icon {
    width: 32px;
    height: 32px;
  }
  
  .timeline-emoji {
    font-size: 0.9rem;
  }
  
  .timeline-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .timeline-meta {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .timeline-type-badge {
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  .timeline-item {
    margin-bottom: 1rem;
  }
  
  .timeline-card {
    padding: 0.75rem;
  }
  
  .timeline-action {
    font-size: 0.95rem;
  }
  
  .timeline-meta {
    font-size: 0.8rem;
  }
  
  .activity-date-label {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}

/* ============================================ */
/* 12. DARK MODE SUPPORT */
/* ============================================ */

@media (prefers-color-scheme: dark) {
  .activity-timeline-card {
    background: #1e293b;
    border-color: #334155;
  }
  
  .activity-timeline-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  }
  
  .timeline-title-text {
    color: #e2e8f0;
  }
  
  .activity-timeline {
    background: #1e293b;
  }
  
  .timeline-card {
    background: #334155;
    border-color: #475569;
  }
  
  .timeline-card:hover {
    border-color: #60a5fa;
  }
  
  .timeline-action {
    color: #e2e8f0;
  }
  
  .timeline-meta {
    color: #94a3b8;
  }
  
  .timeline-time,
  .timeline-user {
    color: #cbd5e1;
  }
  
  .timeline-details p {
    color: #cbd5e1;
  }
  
  .timeline-details {
    border-color: #475569;
  }
  
  .activity-timeline-empty h4 {
    color: #e2e8f0;
  }
  
  .activity-timeline-empty p {
    color: #94a3b8;
  }
  
  .activity-timeline-loading {
    color: #94a3b8;
  }
  
  .timeline-refresh-btn {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
  }
  
  .timeline-refresh-btn:hover {
    background: #3b82f6;
    border-color: #3b82f6;
  }
}

/* ============================================ */
/* 13. ACCESSIBILITY */
/* ============================================ */

.timeline-card:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .timeline-item,
  .timeline-card,
  .activity-timeline-card,
  .timeline-refresh-btn,
  .empty-icon {
    animation: none;
    transition: none;
  }
  
  .timeline-item:hover {
    transform: none;
  }
  
  .timeline-card:hover {
    transform: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .timeline-card {
    border-width: 2px;
  }
  
  .timeline-icon {
    border-width: 4px;
  }
  
  .timeline-type-badge {
    font-weight: 700;
  }
}

/* ============================================ */
/* 14. PRINT STYLES */
/* ============================================ */

@media print {
  .activity-timeline-actions,
  .timeline-refresh-btn {
    display: none !important;
  }
  
  .activity-timeline-card {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .timeline-item {
    break-inside: avoid;
    animation: none;
    transition: none;
  }
  
  .timeline-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
.activity-meta {
  color: rgba(0, 0, 0, 0.55);
  font-size: 0.85rem;
}
.activity-details {
  color: rgba(0, 0, 0, 0.75);
  font-size: 0.92rem;
}

/* ============================================ */
/* PAYMENT GATEWAY ENHANCEMENTS */
/* ============================================ */

/* Modal layering fixes */
#modal-settings-panel {
  z-index: 9999 !important;
}

#modal-cardknox-profile {
  z-index: 10001 !important;
}

/* Ensure CardKnox profile modal overlay appears above settings modal */
#modal-cardknox-profile.modal-overlay {
  z-index: 10001 !important;
}

#modal-settings-panel.modal-overlay {
  z-index: 9999 !important;
}

/* Force CardKnox modal to sit above the settings modal when both are open */
#modal-cardknox-profile.open { z-index: 3000 !important; }
#modal-cardknox-profile.open .modal { z-index: 3001 !important; position: relative; }
#modal-settings-panel.open { z-index: 1500 !important; }

/* Pulse animation for loading states */
@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Responsive improvements */
@media (max-width: 768px) {
  .gateway-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.7rem;
  }
  
  .toggle-switch {
    width: 44px;
    height: 24px;
  }
  
  .toggle-slider:before {
    height: 16px;
    width: 16px;
  }
  
  .toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
  }
  
  .gateway-card {
    margin-bottom: 0.75rem;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .gateway-badge,
  .toggle-slider,
  .toggle-slider:before,
  .gateway-card {
    transition: none;
    animation: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .gateway-badge {
    border-width: 2px;
    font-weight: 700;
  }
  
  .toggle-slider {
    border-width: 3px;
  }
  
  .gateway-badge.enabled {
    background: #00aa00 !important;
    color: white !important;
    border-color: #008800 !important;
  }
  
  .gateway-badge.disabled {
    background: #ffaa00 !important;
    color: black !important;
    border-color: #dd8800 !important;
  }
}
.activity-sep {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
}

/* ============================================ */
/* Custom Fields Styling (merged 2026-01-19)    */
/* Source: custom-fields-styles.css             */
/* ============================================ */

.cf-host { margin-top: 0.5rem; }
.cf-host .custom-fields-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

/* Icon picker for dedication categories */
.icon-picker {
  position: relative;
  width: 100%;
}

.icon-picker-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-primary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.icon-picker-toggle:hover,
.icon-picker-toggle:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.icon-picker-caret {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.icon-picker-grid {
  position: absolute;
  margin-top: 0.4rem;
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 0.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
  gap: 0.4rem;
  max-height: 210px;
  overflow-y: auto;
}

.icon-picker-option {
  border: 1px solid transparent;
  background: var(--bg-secondary);
  border-radius: 8px;
  height: 42px;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease, background-color 0.1s ease;
}

.icon-picker-option:hover {
  border-color: var(--accent);
  background: #e0f2fe;
  transform: translateY(-1px);
}

/* 1. CUSTOM FIELDS MANAGEMENT MODAL */
.custom-fields-manager {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 70vh;
  background: #f8fafc;
  border-radius: 8px;
  overflow: hidden;
}

.custom-fields-list {
  background: white;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}

.custom-fields-header {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custom-fields-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #1e293b;
}

.fields-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.custom-field-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-field-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-field-item.selected {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.field-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.field-icon { font-size: 1.25rem; opacity: 0.8; }
.field-info { flex: 1; min-width: 0; }

.field-label {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-meta {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.field-actions { display: flex; gap: 0.25rem; opacity: 0; transition: opacity 0.2s ease; }
.custom-field-item:hover .field-actions,
.custom-field-item.selected .field-actions { opacity: 1; }

.btn-icon {
  width: 28px; height: 28px; border: none; background: transparent; border-radius: 4px;
  cursor: pointer; font-size: 0.8rem; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.btn-icon:hover { background: #f1f5f9; }
.btn-icon:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon.btn-danger:hover { background: #fef2f2; color: #dc2626; }

/* Empty state */
.empty-state { text-align: center; padding: 2rem 1rem; color: #64748b; }
.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h4 { margin: 0 0 0.5rem 0; color: #475569; }
.empty-state p { margin: 0 0 1.5rem 0; font-size: 0.9rem; }

/* 2. FIELD EDITOR PANEL */
.custom-field-editor { background: white; padding: 1.5rem; overflow-y: auto; }
.editor-placeholder { text-align: center; padding: 3rem 1rem; color: #64748b; }
.placeholder-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }
.editor-placeholder h3 { margin: 0 0 0.5rem 0; color: #475569; }
.editor-placeholder p { margin: 0; font-size: 0.9rem; }
.field-editor-form { max-width: 500px; }
.field-editor-form h3 {
  margin: 0 0 1.5rem 0; color: #1e293b; font-size: 1.25rem; border-bottom: 2px solid #e2e8f0; padding-bottom: 0.5rem;
}
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-weight: 600; color: #374151; margin-bottom: 0.5rem; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.75rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.9rem; transition: border-color 0.2s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-group input[type=\"checkbox\"] { width: auto; margin-right: 0.5rem; }

.option-editor { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.5rem; margin-bottom: 0.5rem; align-items: center; }
.options-empty { padding: 1rem; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 6px; text-align: center; color: #64748b; font-size: 0.9rem; }

.field-preview { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #e2e8f0; }
.field-preview h4 { margin: 0 0 1rem 0; color: #374151; font-size: 1rem; }
.preview-container { padding: 1rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; }
.preview-container input, .preview-container select, .preview-container textarea { margin-bottom: 0.5rem; }
.preview-container .radio-group { display: flex; flex-direction: column; gap: 0.5rem; }
.preview-container .radio-group label { display: flex; align-items: center; font-weight: normal; margin: 0; }
.preview-container .radio-group input { width: auto; margin: 0 0.5rem 0 0; }
.field-help { font-size: 0.8rem; color: #6b7280; margin-top: 0.5rem; font-style: italic; }

/* 3. CUSTOM FIELDS ACTIONS */
.custom-fields-actions { padding: 1rem 1.5rem; background: #f8fafc; border-top: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; }
.actions-left, .actions-right { display: flex; gap: 0.75rem; }

/* 4. CUSTOM FIELDS IN CONTACT FORMS */
.custom-fields-section { margin-top: 2rem; }
.custom-fields-section h3 {
  margin: 0 0 1rem 0; color: #374151; font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid #e2e8f0;
}
.custom-fields-container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.custom-field-wrapper { position: relative; }
.custom-field-wrapper .form-group { margin-bottom: 1rem; }
.custom-field-wrapper .field-help { font-size: 0.8rem; color: #6b7280; margin-top: 0.25rem; }
.custom-field-wrapper .required-indicator { color: #dc2626; font-weight: bold; }
.custom-field-currency input { padding-left: 2rem; background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 fill=%22none%22 viewBox=%220 0 24 24%22 stroke=%22%236b7280%22%3E%3Cpath stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22 d=%22M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1%22 /%3E%3C/svg%3E'); background-repeat: no-repeat; background-position: 0.5rem center; background-size: 1rem; }

.custom-field-percentage input::after { content: '%'; position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); color: #6b7280; font-size: 0.9rem; }

.custom-field-radio .radio-group { display: flex; flex-direction: column; gap: 0.5rem; }

.custom-field-radio .radio-option { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; border: 1px solid #e2e8f0; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; }

.custom-field-radio .radio-option:hover { background: #f8fafc; border-color: #3b82f6; }

.custom-field-radio .radio-option input[type=\"radio\"] { width: auto; margin: 0; }

.custom-field-radio .radio-option.selected { background: #eff6ff; border-color: #3b82f6; }

.custom-field-multiselect .checkbox-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.5rem; }

.custom-field-multiselect .checkbox-option { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; border: 1px solid #e2e8f0; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; }

.custom-field-multiselect .checkbox-option:hover { background: #f8fafc; border-color: #3b82f6; }

.custom-field-multiselect .checkbox-option input[type=\"checkbox\"] { width: auto; margin: 0; }

.custom-field-multiselect .checkbox-option.selected { background: #eff6ff; border-color: #3b82f6; }

/* 5. RESPONSIVE */
@media (max-width: 768px) {
  .custom-fields-manager { grid-template-columns: 1fr; height: auto; }
  .custom-fields-list { border-right: none; border-bottom: 1px solid #e2e8f0; max-height: 300px; }
  .custom-field-item { padding: 0.5rem; }
  .field-meta { font-size: 0.7rem; }
  .custom-field-editor { padding: 1rem; }
  .custom-fields-actions { padding: 1rem; flex-direction: column; gap: 1rem; align-items: stretch; }
  .actions-left, .actions-right { justify-content: center; }
  .custom-fields-container { grid-template-columns: 1fr; }
  .option-editor { grid-template-columns: 1fr; gap: 0.5rem; }
}

@media (max-width: 480px) {
  .custom-field-item .field-actions { opacity: 1; }
  .field-main { gap: 0.5rem; }
  .field-label { font-size: 0.85rem; }
  .field-meta { font-size: 0.65rem; }
  .btn-icon { width: 24px; height: 24px; font-size: 0.7rem; }
}

/* 6. ACCESSIBILITY */
.custom-field-item:focus { outline: 2px solid #3b82f6; outline-offset: 2px; }

.btn-icon:focus { outline: 2px solid #3b82f6; outline-offset: 2px; }

@media (prefers-contrast: high) {
  .custom-field-item { border-width: 2px; }
  .custom-field-item.selected { border-width: 3px; }
  .form-group input, .form-group select, .form-group textarea { border-width: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .custom-field-item, .btn-icon, .form-group input, .form-group select, .form-group textarea { transition: none; }
}

/* 7. DARK MODE */
@media (prefers-color-scheme: dark) {
  .custom-fields-manager { background: #0f172a; }
  .custom-fields-list, .custom-field-editor { background: #1e293b; border-color: #334155; }
  .custom-fields-header { background: #0f172a; border-color: #334155; }
  .custom-field-item { background: #334155; border-color: #475569; color: #e2e8f0; }
  .custom-field-item.selected { background: #1e3a8a; border-color: #3b82f6; }
  .field-label { color: #e2e8f0; }
  .field-meta { color: #94a3b8; }
  .form-group input, .form-group select, .form-group textarea { background: #334155; border-color: #475569; color: #e2e8f0; }
  .preview-container, .custom-fields-actions { background: #0f172a; border-color: #334155; }
}

/* 8. HIDE MOBILE ELEMENTS ON LOGIN SCREEN */
/* When login screen is visible (display:flex), hide mobile nav elements */
body.logged-out .mobile-bottom-nav,
body.logged-out .mobile-header,
body.logged-out .mobile-overlay {
  display: none !important;
}
