/* ===========================
   BUTTON COMPONENTS
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1.5px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-light)); color: white; }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(26,58,92,0.4); transform: translateY(-1px); }
.btn-accent { background: linear-gradient(135deg, var(--clr-accent-dark), var(--clr-accent)); color: white; }
.btn-accent:hover { box-shadow: 0 4px 16px rgba(200,150,62,0.4); transform: translateY(-1px); }
.btn-danger { background: linear-gradient(135deg, #b91c1c, #dc2626); color: white; }
.btn-danger:hover { transform: translateY(-1px); }
.btn-success { background: linear-gradient(135deg, #15803d, #16a34a); color: white; }
.btn-success:hover { transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--clr-primary); border-color: var(--clr-primary); }
.btn-outline:hover { background: var(--clr-primary); color: white; }
.btn-ghost { background: transparent; color: var(--clr-text-muted); border-color: var(--clr-border); }
.btn-ghost:hover { background: var(--clr-surface-2); color: var(--clr-text); }
.btn-sm { padding: var(--sp-1) var(--sp-3); font-size: var(--text-xs); }
.btn-lg { padding: var(--sp-4) var(--sp-8); font-size: var(--text-base); }
.btn-xl { padding: var(--sp-5) var(--sp-10); font-size: var(--text-lg); border-radius: var(--radius-md); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* ===========================
   TABS
   =========================== */
.tabs { display: flex; border-bottom: 2px solid var(--clr-border); margin-bottom: var(--sp-6); }
.tab-btn { padding: var(--sp-3) var(--sp-5); font-size: var(--text-sm); font-weight: 500; color: var(--clr-text-muted); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition-fast); display: flex; align-items: center; gap: var(--sp-2); }
.tab-btn:hover { color: var(--clr-primary); }
.tab-btn.active { color: var(--clr-primary); border-bottom-color: var(--clr-primary); font-weight: 600; }

/* ===========================
   PROGRESS STEPS
   =========================== */
.progress-steps { display: flex; align-items: center; justify-content: center; margin-bottom: var(--sp-10); }
.step-item { display: flex; flex-direction: column; align-items: center; position: relative; flex: 1; max-width: 120px; }
.step-item:not(:last-child)::after { content: ''; position: absolute; top: 17px; left: 50%; width: 100%; height: 2px; background: var(--clr-border); z-index: 0; transition: background var(--transition); }
.step-item.completed:not(:last-child)::after { background: var(--clr-primary); }
.step-circle { width: 34px; height: 34px; border-radius: 50%; background: var(--clr-surface-2); color: var(--clr-text-muted); display: flex; align-items: center; justify-content: center; font-size: var(--text-sm); font-weight: 700; position: relative; z-index: 1; transition: all var(--transition); border: 2px solid var(--clr-border); }
.step-item.active .step-circle { background: var(--clr-primary); color: white; border-color: var(--clr-primary); box-shadow: 0 0 0 4px rgba(26,58,92,0.15); }
.step-item.completed .step-circle { background: var(--clr-active); color: white; border-color: var(--clr-active); }
.step-label { font-size: 0.65rem; font-weight: 600; color: var(--clr-text-muted); margin-top: var(--sp-1); text-align: center; text-transform: uppercase; letter-spacing: 0.04em; }
.step-item.active .step-label { color: var(--clr-primary); }
.step-item.completed .step-label { color: var(--clr-active); }

/* ===========================
   MEMBER CARDS
   =========================== */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-8); }
.quick-action-card { background: var(--clr-surface); border: 1px solid var(--clr-border); border-radius: var(--radius-lg); padding: var(--sp-5); cursor: pointer; text-align: center; transition: all var(--transition); display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
.quick-action-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--clr-primary); }
.quick-action-icon { width: 52px; height: 52px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.quick-action-label { font-size: var(--text-sm); font-weight: 600; color: var(--clr-text); }

.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-5); }
.member-card { background: var(--clr-surface); border: 1px solid var(--clr-border); border-radius: var(--radius-lg); padding: var(--sp-6); transition: all var(--transition); }
.member-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.member-card-header { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.member-card-avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent)); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: var(--text-xl); flex-shrink: 0; }
.member-card-name { font-size: var(--text-lg); font-weight: 700; }
.member-card-id { font-size: var(--text-xs); color: var(--clr-text-muted); }
.member-card-details { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.member-card-detail-label { color: var(--clr-text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: 0.04em; font-size: 0.65rem; margin-bottom: 1px; }
.member-card-detail-value { font-weight: 500; color: var(--clr-text); font-size: var(--text-xs); }
.member-card-actions { display: flex; gap: var(--sp-2); padding-top: var(--sp-4); border-top: 1px solid var(--clr-border); }

/* ===========================
   VIEW TOGGLE & FILTERS
   =========================== */
.view-toggle { display: flex; gap: 2px; background: var(--clr-surface-2); border: 1px solid var(--clr-border); border-radius: var(--radius); padding: 3px; }
.view-toggle-btn { padding: 5px 10px; border-radius: calc(var(--radius) - 2px); cursor: pointer; color: var(--clr-text-muted); font-size: 0.85rem; border: none; background: none; transition: all var(--transition-fast); }
.view-toggle-btn.active { background: var(--clr-surface); color: var(--clr-primary); box-shadow: var(--shadow-sm); }
.filter-bar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.filter-select { padding: var(--sp-2) var(--sp-4); border: 1px solid var(--clr-border); border-radius: var(--radius); font-size: var(--text-sm); color: var(--clr-text); background: var(--clr-surface); cursor: pointer; }
.filter-select:focus { outline: none; border-color: var(--clr-primary); }
.pagination { display: flex; align-items: center; gap: var(--sp-1); justify-content: center; padding: var(--sp-4); }
.page-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); font-size: var(--text-sm); cursor: pointer; border: 1px solid var(--clr-border); background: var(--clr-surface); color: var(--clr-text); transition: all var(--transition-fast); }
.page-btn:hover, .page-btn.active { background: var(--clr-primary); color: white; border-color: var(--clr-primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===========================
   ALERTS
   =========================== */
.alert { padding: var(--sp-4) var(--sp-5); border-radius: var(--radius); font-size: var(--text-sm); display: flex; gap: var(--sp-3); align-items: flex-start; margin-bottom: var(--sp-4); }
.alert-icon { font-size: 1.1rem; flex-shrink: 0; }
.alert-content { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 2px; }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ===========================
   DROPDOWN
   =========================== */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; top: calc(100% + 4px); right: 0; min-width: 180px; background: var(--clr-surface); border: 1px solid var(--clr-border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 500; overflow: hidden; animation: scaleIn 0.15s ease; }
.dropdown-menu.hidden { display: none; }
.dropdown-item { padding: var(--sp-3) var(--sp-4); font-size: var(--text-sm); color: var(--clr-text); cursor: pointer; display: flex; align-items: center; gap: var(--sp-2); transition: background var(--transition-fast); }
.dropdown-item:hover { background: var(--clr-surface-2); }
.dropdown-item.danger { color: #dc2626; }
.dropdown-item.danger:hover { background: #fee2e2; }
.dropdown-divider { height: 1px; background: var(--clr-border); margin: var(--sp-1) 0; }

/* ===========================
   TIMELINE
   =========================== */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: var(--sp-4); position: relative; padding-bottom: var(--sp-4); }
.timeline-item:not(:last-child)::before { content: ''; position: absolute; left: 16px; top: 36px; bottom: 0; width: 1px; background: var(--clr-border); }
.timeline-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; position: relative; z-index: 1; }
.timeline-content { flex: 1; padding-top: var(--sp-1); }
.timeline-title { font-size: var(--text-sm); font-weight: 600; }
.timeline-desc { font-size: var(--text-xs); color: var(--clr-text-muted); margin-top: 2px; }
.timeline-time { font-size: 0.65rem; color: var(--clr-text-light); margin-top: 4px; }

/* misc */
.expiry-badge { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); font-weight: 600; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; padding: 3px 10px; border-radius: var(--radius-full); }
.death-event-card { border-left: 4px solid #dc2626; }
.contribution-bar { height: 8px; background: var(--clr-border); border-radius: var(--radius-full); overflow: hidden; margin-top: var(--sp-2); }
.contribution-fill { height: 100%; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--clr-active), #22c55e); transition: width 1s ease; }
.notif-badge { position: relative; }
.notif-badge::after { content: ''; position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; background: #dc2626; border-radius: 50%; border: 2px solid var(--clr-surface); }

/* ===========================
   NOTIFICATION BELL
   =========================== */
.topbar-notif-bell {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--clr-surface-2);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--clr-text-muted);
}
.topbar-notif-bell:hover {
  background: var(--clr-border);
  color: var(--clr-primary);
}
.topbar-notif-bell .badge-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #dc2626;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--clr-surface);
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: -10px;
  width: 320px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  overflow: hidden;
  display: none;
  flex-direction: column;
  animation: slideInUp 0.2s ease;
}
.notif-dropdown.show {
  display: flex;
}
.notif-dropdown-header {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-dropdown-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
}
.notif-dropdown-list {
  max-height: 400px;
  overflow-y: auto;
}
.notif-item {
  padding: var(--sp-4);
  display: flex;
  gap: var(--sp-3);
  border-bottom: 1px solid var(--clr-border);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.notif-item:hover {
  background: var(--clr-surface-2);
}
.notif-item.unread {
  background: #f0f7ff;
}
.notif-item.unread::after {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--clr-primary);
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.notif-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--clr-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.notif-item-content {
  flex: 1;
}
.notif-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.notif-item-desc {
  font-size: 0.75rem;
  color: var(--clr-text-muted);
  line-height: 1.4;
}
.notif-item-time {
  font-size: 0.65rem;
  color: var(--clr-text-light);
  margin-top: 4px;
}
.notif-dropdown-footer {
  padding: var(--sp-3);
  text-align: center;
  border-top: 1px solid var(--clr-border);
}
.notif-dropdown-footer a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--clr-primary);
  text-decoration: none;
}
