/* =====================================================
   Dr. Rhodah Kithuku Campaign Website
   Main Stylesheet - Colors: Blue #1a56db, Orange #f97316
   ===================================================== */

:root {
  --blue: #1a56db;
  --blue-dark: #1344b0;
  --blue-light: #dbeafe;
  --orange: #f97316;
  --orange-dark: #ea6c0a;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --green: #16a34a;
  --red: #dc2626;
  --shadow: 0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --radius: 8px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--orange); }

img { max-width: 100%; }

@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .navbar {
    border-radius: 0 0 18px 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  }

  .btn,
  .form-control,
  .action-dropdown-button {
    min-height: 44px;
  }

  .login-card,
  .join-section,
  .add-user-modal-panel,
  .confirm-modal-panel {
    border-radius: 22px;
  }

  .dash-layout {
    min-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
}

/* Mobile nav toggle */
.nav-toggle { display: none; background: transparent; border: none; color: #fff; padding: 8px; cursor: pointer; }
.nav-toggle .hamburger { display: block; width: 22px; height: 2px; background: #fff; position: relative; }
.nav-toggle .hamburger::before, .nav-toggle .hamburger::after { content: ''; position: absolute; left: 0; width: 22px; height: 2px; background: #fff; }
.nav-toggle .hamburger::before { top: -7px; }
.nav-toggle .hamburger::after { top: 7px; }

/* ---- NAVBAR ---- */
.navbar {
  background: var(--blue);
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(26,86,219,0.3);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
}
.navbar-brand .initials {
  background: var(--orange);
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800;
}
.navbar-brand span { font-size: 0.75rem; opacity: 0.85; display: block; }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: background 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.nav-links a.btn-orange {
  background: var(--orange);
  font-weight: 600;
}
.nav-links a.btn-orange:hover { background: var(--orange-dark); }

/* ---- HERO ---- */
.hero {
  background: linear-gradient(135deg, var(--blue) 0%, #0f3a99 60%, #1344b0 100%);
  color: #fff;
  padding: 72px 24px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%; left: -10%;
  width: 60%; height: 200%;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.hero-tag {
  background: var(--orange);
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 { font-size: 2.8rem; font-weight: 900; line-height: 1.1; margin-bottom: 10px; }
.hero h1 span { color: var(--orange); }
.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 560px; margin: 0 auto 28px; }
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 26px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-white { background: #fff; color: var(--blue); }
.btn-white:hover { background: var(--gray-100); color: var(--blue); }
.btn-sm { padding: 7px 16px; font-size: 0.85rem; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-gray { background: var(--gray-200); color: var(--gray-800); }
.btn-gray:hover { background: var(--gray-400); }

.action-dropdown {
  position: relative;
  display: inline-block;
  font-size: 0.95rem;
}
.action-dropdown-button {
  min-width: 120px;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.4);
  background: #ffffff;
  color: var(--blue);
  font-weight: 700;
  padding: 9px 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.action-dropdown-button:hover,
.action-dropdown-button:focus {
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}
.action-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
  padding: 6px 0;
  z-index: 999;
  display: none;
  overflow: hidden;
}
.action-dropdown.open .action-dropdown-menu {
  display: block;
}
.action-dropdown-item,
.action-dropdown-menu a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--gray-800);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  outline: none;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.action-dropdown-menu a,
.action-dropdown-menu button {
  color: var(--gray-800);
}
.action-dropdown-item:hover,
.action-dropdown-menu a:hover,
.action-dropdown-menu button:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--blue);
}
.action-dropdown-menu form {
  margin: 0;
}
.action-dropdown-menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0;
}

@media (max-width: 768px) {
  .action-dropdown-menu {
    position: fixed;
    top: 80px;
    right: 12px;
    left: 12px;
    min-width: auto;
    width: auto;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }
}

/* ---- CARDS ---- */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 24px; }

/* ---- SECTION ---- */
.section { padding: 60px 0; }
.section-alt { background: #fff; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 6px;
}
.section-title span { color: var(--orange); }
.section-subtitle { color: var(--gray-600); margin-bottom: 36px; }
.section-head { text-align: center; margin-bottom: 40px; }

/* ---- GRID ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }

/* Responsive adjustments */
@media (max-width: 1024px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 2.2rem; }
}

@media (max-width: 900px) {
  body { overflow-x: hidden; }
  .container { padding: 0 14px; }
  .nav-links { display: none; position: absolute; top: 64px; right: 0; left: 0; background: var(--blue); flex-direction: column; padding: 12px; gap: 8px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 16px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .navbar { position: relative; padding: 0 16px; min-height: 64px; height: auto; }
  .navbar-brand { font-size: 0.95rem; }
  .navbar-brand .initials { width: 34px; height: 34px; }

  .hero { padding: 40px 12px; }
  .hero > div { flex-direction: column; }
  .hero .hero-tag { margin-bottom: 10px; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .hero-btns { flex-direction: column; align-items: center; }
  .hero-btns .btn { width: min(100%, 260px); justify-content: center; }

  .section { padding: 38px 0; }
  .section-title { font-size: 1.6rem; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .event-card-img { height: 140px; }
  .join-section, .login-card { padding: 24px 18px; }
  .login-page { padding: 20px 14px; }
}

@media (max-width: 480px) {
  .navbar-brand span { display: none; }
  .navbar-brand strong { font-size: 0.88rem; }
  .nav-links a { font-size: 0.82rem; }
  .hero h1 { font-size: 1.6rem; }
  .hero { min-height: auto; }
  .hero-btns .btn,
  .login-card .btn,
  .join-section .btn { width: 100%; justify-content: center; }
  .section-title { font-size: 1.3rem; }
  .event-card-body { padding: 16px; }
  .join-section { padding: 18px 14px; }
  .login-logo h1 { font-size: 1.25rem; }
}

/* ---- EVENT CARD ---- */
.event-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.event-card-img {
  height: 180px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.event-card-img img { width: 100%; height: 100%; object-fit: cover; }
.event-card-img .icon { font-size: 3rem; opacity: 0.5; }
.event-card-body { padding: 18px; }
.event-card-body h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; color: var(--gray-800); }
.event-card-body .meta { font-size: 0.82rem; color: var(--gray-600); margin-bottom: 8px; }
.event-card-body .meta span { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; }

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-orange { background: #fff7ed; color: var(--orange); }
.badge-green { background: #dcfce7; color: var(--green); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-purple { background: #f3e8ff; color: #7c3aed; }
.badge-red { background: #fee2e2; color: var(--red); }

/* ---- FORMS ---- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: var(--gray-800); }
.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 16px;
  font-size: 0.95rem;
  transition: border 0.2s, box-shadow 0.2s, transform 0.2s;
  background: #f8fafc;
  color: var(--gray-900);
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
  background: #fff;
}
.form-control.error { border-color: var(--red); }
.form-hint { font-size: 0.82rem; color: var(--gray-600); margin-top: 6px; }
.form-error { font-size: 0.84rem; color: var(--red); margin-top: 4px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
textarea.form-control { resize: vertical; min-height: 100px; }

.add-user-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}
.add-user-modal.hidden {
  display: none !important;
}
.add-user-modal-panel {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  box-shadow: var(--shadow-lg);
  padding: 26px;
  position: relative;
}
.add-user-modal-panel h2 {
  margin-bottom: 20px;
}
.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  border: none;
  background: transparent;
  color: var(--gray-500);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover {
  color: var(--gray-800);
}
.add-user-modal-panel form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.confirm-modal {
  position: fixed !important;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 2147483647 !important; /* maximal z-index to ensure overlay wins */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: auto;
  animation: confirmModalFadeIn 0.15s ease;
}
.confirm-modal.hidden {
  display: none !important;
}
@keyframes confirmModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes confirmModalPanelIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.confirm-modal-panel {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28), 0 4px 12px rgba(15, 23, 42, 0.08);
  padding: 28px 28px 24px;
  position: relative;
  pointer-events: auto;
  margin-left: auto;
  margin-right: auto;
  animation: confirmModalPanelIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.confirm-modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.1);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 16px;
}
.confirm-modal-panel h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: -0.01em;
}
.confirm-modal-panel p {
  color: var(--gray-600);
  line-height: 1.55;
  margin-bottom: 26px;
  font-size: 0.94rem;
}
.confirm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.confirm-modal-footer .btn {
  min-width: 108px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 10px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.confirm-modal-footer .btn:active {
  transform: scale(0.98);
}
.confirm-modal-footer .btn-outline {
  border-width: 1.5px;
}
.confirm-modal-footer .btn-danger {
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}
.confirm-modal-footer .btn-danger:hover {
  background: #c11d1d;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.32);
}
.confirm-modal-panel .modal-close {
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 1.1rem;
}
.confirm-modal-panel .modal-close:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}
@media (max-width: 640px) {
  .add-user-modal {
    padding: 16px;
  }
  .add-user-modal-panel {
    max-width: 100%;
    max-height: calc(100vh - 30px);
    padding: 18px;
    border-radius: 14px;
  }
  .add-user-modal-panel .btn {
    width: 100%;
  }
}

/* ---- ALERTS ---- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
}
.alert-success { background: #dcfce7; color: #15803d; border-left: 4px solid var(--green); }
.alert-error   { background: #fee2e2; color: var(--red); border-left: 4px solid var(--red); }
.alert-info    { background: var(--blue-light); color: var(--blue); border-left: 4px solid var(--blue); }
.alert-warning { background: #fef9c3; color: #92400e; border-left: 4px solid #f59e0b; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
thead th {
  background: var(--gray-50);
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  border-bottom: 2px solid var(--gray-200);
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
tbody tr:hover { background: var(--gray-50); }
.masked-phone {
  font-family: monospace;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.88rem;
}

/* ---- DASHBOARD ---- */
.dash-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 240px;
  background: var(--blue-dark);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand .initials {
  background: var(--orange);
  border-radius: 50%;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.sidebar-brand h2 { font-size: 0.9rem; font-weight: 700; line-height: 1.3; }
.sidebar-brand p  { font-size: 0.72rem; opacity: 0.7; }
.sidebar nav { padding: 12px 0; flex: 1; }
.sidebar-section { padding: 8px 18px 4px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.5; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  transition: all 0.2s;
}
.sidebar nav a:hover, .sidebar nav a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-left: 3px solid var(--orange);
}
.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.82rem;
  opacity: 0.7;
}
.dash-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.dash-topbar {
  background: #fff;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
}
.dash-topbar h1 { font-size: 1.1rem; font-weight: 700; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-50); padding: 6px 14px;
  border-radius: 20px; font-size: 0.88rem;
}
.user-chip .role-badge {
  background: var(--blue);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  text-transform: capitalize;
}
.dash-content { padding: 28px; flex: 1; overflow-y: auto; }

.mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 1.2rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  z-index: 1099;
}

.mobile-bottom-bar {
  display: none;
}

/* Keep navbar sticky for logged-in users (including on smaller screens) */
.logged-in .navbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  width: 100%;
}

@media (max-width: 900px) {
  /* override the mobile rule that sets .navbar to relative for logged-in users */
  .logged-in .navbar {
    position: sticky;
    top: 0;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .dash-layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: -90vw;
    top: 0;
    bottom: 0;
    width: min(84vw, 300px);
    height: 100vh;
    z-index: 1100;
    transition: left 0.22s ease;
    box-shadow: 12px 0 36px rgba(15, 23, 42, 0.22);
  }

  body.sidebar-open .sidebar {
    left: 0;
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
  }

  .sidebar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px;
  }

  .sidebar nav a {
    flex: 1 1 calc(50% - 6px);
    min-width: 140px;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .sidebar nav a:hover, .sidebar nav a.active {
    border-left: none;
    border-bottom: 3px solid var(--orange);
  }

  .sidebar-brand {
    padding: 14px 16px;
    justify-content: center;
    text-align: center;
  }

  .sidebar-section {
    width: 100%;
    padding: 8px 4px 4px;
    font-size: 0.65rem;
  }

  .sidebar-footer {
    padding: 10px 16px 14px;
    text-align: center;
  }

  .dash-topbar {
    padding: 12px 14px;
    height: auto;
    gap: 10px;
    flex-wrap: wrap;
  }

  .dash-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
  }

  .dash-topbar h1 {
    font-size: 1rem;
    width: 100%;
    margin: 0;
  }

  .dash-content {
    padding: 16px 14px 80px;
  }

  .user-chip {
    font-size: 0.75rem;
    padding: 6px 10px;
  }

  .mobile-bottom-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow: 0 -8px 26px rgba(15, 23, 42, 0.14);
    z-index: 1050;
    backdrop-filter: blur(10px);
  }

  .bottom-bar-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px 7px;
    border-radius: 12px;
    color: var(--gray-600);
    font-size: 0.7rem;
    font-weight: 700;
  }

  .bottom-bar-link.active,
  .bottom-bar-link:hover {
    background: rgba(26, 86, 219, 0.09);
    color: var(--blue);
  }
}

/* Make dashboard topbar sticky so it remains visible while scrolling */
.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* ---- STAT CARDS ---- */
.stat-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-bottom: 28px; }
.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: var(--blue-light); }
.stat-icon.orange { background: #fff7ed; }
.stat-icon.green  { background: #dcfce7; }
.stat-icon.purple { background: #f3e8ff; }
.stat-card h3 { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-card p  { font-size: 0.82rem; color: var(--gray-600); }

/* ---- DONATE SECTION ---- */
.donate-section {
  background: linear-gradient(135deg, var(--orange), #e55a00);
  color: #fff;
  padding: 60px 20px;
  text-align: center;
}
.donate-section h2 { font-size: 2rem; font-weight: 800; margin-bottom: 10px; }
.donate-section p  { max-width: 500px; margin: 0 auto 28px; opacity: 0.9; }
.donate-methods {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.donate-method {
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-lg);
  padding: 18px 28px;
  text-align: center;
  min-width: 160px;
}
.donate-method h4 { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.donate-method p { font-size: 0.85rem; opacity: 0.85; margin: 0; }

/* ---- JOIN FORM ---- */
.join-section {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 700px;
  margin: 0 auto;
  padding: 40px;
}
.join-section h2 { color: var(--blue); font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }

/* ---- FOOTER ---- */
footer {
  background: var(--gray-800);
  color: #fff;
  padding: 40px 20px 24px;
}
footer .footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; margin-bottom: 30px; }
footer h4 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; color: var(--orange); }
footer p, footer a { font-size: 0.88rem; color: rgba(255,255,255,0.7); line-height: 1.9; }
footer a:hover { color: var(--orange); }
footer ul { list-style: none; }
footer ul li { margin-bottom: 6px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 18px;
  text-align: center;
  font-size: 0.82rem;
  opacity: 0.6;
}
.hashtags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.hashtag { background: var(--blue); color: #fff; padding: 3px 10px; border-radius: 12px; font-size: 0.78rem; }

/* ---- LOGIN PAGE ---- */
.login-page {
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 24%), linear-gradient(135deg, #0f3a99 0%, #1a56db 55%, #153f8d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.login-card {
  background: rgba(255,255,255,0.98);
  border-radius: 28px;
  padding: 48px 44px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 32px 64px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  backdrop-filter: blur(10px);
}
.login-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 40px 90px rgba(15, 23, 42, 0.2);
}
.login-logo {
  text-align: center;
  margin-bottom: 34px;
}
.login-logo .logo-circle {
  width: 78px;
  height: 78px;
  background: linear-gradient(135deg, var(--orange), #dd6b16);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  margin: 0 auto 14px;
  box-shadow: 0 16px 36px rgba(26, 86, 219, 0.16);
}
.login-logo h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 10px;
}
.login-logo p {
  font-size: 0.95rem;
  color: var(--gray-600);
  line-height: 1.75;
  max-width: 320px;
  margin: 0 auto;
}
.login-card .text-center {
  margin-top: 20px;
}
.login-card .text-center a {
  color: var(--blue);
}
.login-card .text-center a:hover {
  color: var(--orange);
}

/* ---- PAGINATION ---- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; }
.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  font-size: 0.88rem;
  color: var(--gray-800);
}
.pagination a:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.pagination .current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .sidebar { display: none; }
  .hero h1 { font-size: 2rem; }
  footer .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stat-cards { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.6rem; }
  .join-section { padding: 24px; }
  .hero-btns { flex-direction: column; align-items: center; }
  .nav-links { gap: 2px; }
  .nav-links a { padding: 6px 10px; font-size: 0.82rem; }
}

/* ---- MISC ---- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.font-bold { font-weight: 700; }
.text-blue { color: var(--blue); }
.text-orange { color: var(--orange); }
.text-gray { color: var(--gray-600); }
.text-sm { font-size: 0.85rem; }
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 24px 0; }
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--gray-600);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 14px; }
.toggle-wrap { display: flex; align-items: center; gap: 12px; }
.toggle { position: relative; display: inline-block; width: 48px; height: 26px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--gray-400); border-radius: 26px;
  transition: 0.3s;
}
.slider:before {
  content: ''; position: absolute;
  height: 20px; width: 20px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: 0.3s;
}
input:checked + .slider { background: var(--green); }
input:checked + .slider:before { transform: translateX(22px); }

/* ---- HERO SPLIT LAYOUT responsive ---- */
@media (max-width: 860px) {
    .hero > div { flex-direction: column !important; }
    .hero > div > div:last-child {
        flex: 0 0 280px !important;
        max-width: 100% !important;
        max-height: 280px;
    }
    .hero > div > div:first-child {
        padding: 40px 24px !important;
    }
    .hero > div > div:first-child h1 { font-size: 2.2rem !important; }
}
