:root {
  --green: var(--color-success);
  --green-light: var(--color-success-light);
  --blue: var(--color-primary);
  --blue-dark: var(--color-primary-dark);
  --blue-light: var(--color-primary-light);
  --purple: var(--color-purple);
  --purple-light: #f5f3ff;
  --text: var(--color-text);
  --text-muted: var(--color-text-muted);
  --bg: var(--color-bg);
  --white: var(--color-surface);
  --border: var(--color-border);
  --radius: var(--r);
  --radius-sm: var(--r-sm);
  --radius-full: var(--r-full);
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

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

body {
  min-height: 100dvh;
  background: var(--bg);
  font-family: 'Poppins', Arial, sans-serif;
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}

body:has(#auth-overlay.show),
body:has(.sidebar.open),
body:has(.modal-overlay.show) { overflow: hidden; }

/* --- Nav (top) ---
   Excludes .site-header-nav (the centered link group inside .site-header) so the
   modern site-header layout isn't fighting this legacy frosted-bar styling. */
nav:not(.bottom-nav):not(.site-header-nav) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.6rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 1px 16px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-height);
}

nav:not(.site-header-nav) > *:first-child { min-width: 4rem; }
nav:not(.site-header-nav) > *:last-child { margin-left: auto; }

.empty-state {
  color: var(--text-muted);
  font-size: 1.4rem;
  text-align: center;
  padding: 4rem 2rem;
  width: 100%;
  grid-column: 1 / -1;
}

nav > img {
  height: 4rem;
  width: auto;
  cursor: pointer;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--blue);
}
nav a:active,
nav a.pressed {
  color: var(--blue);
}

.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 4.4rem;
  height: 4.4rem;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius);
  margin-right: 0.4rem;
  transition: background 0.2s;
}
.nav-hamburger:hover { background: var(--bg); }
.nav-hamburger:active,
.nav-hamburger.pressed { background: var(--blue-light); color: var(--blue); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  transition: background 0.2s;
}

.nav-user:hover {
  background: var(--bg);
}

.nav-user img {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.nav-user span {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
}


/* --- Layout --- */
.layout {
  display: flex;
  flex: 1;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  margin-right: 4rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(0, 0, 0, 0.07);
  padding: 1.6rem 0;
  flex-shrink: 0;
  min-height: calc(100dvh - var(--nav-height));
  position: relative;
  display: flex;
  flex-direction: column;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem 2rem;
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.sidebar-item:hover {
  background: var(--bg);
  color: var(--text);
}

.sidebar-item.active {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--blue);
  border-radius: 0 3px 3px 0;
}

.sidebar-item svg {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

.sidebar-item.logout {
  color: #ef4444;
}

.sidebar-item.logout:hover {
  background: #fef2f2;
}

/* Sidebar auth section — pinned to bottom, separated from primary nav */
.sidebar-auth-section {
  margin-top: auto;
  padding: 1.2rem 0 0.8rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.sidebar-section-label {
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 0.4rem 2rem 0.6rem;
}

/* Secondary auth link (Log In) — outline style so the primary CTA owns the eye */
.sidebar-item.sidebar-auth-link {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid transparent;
}
.sidebar-item.sidebar-auth-link:hover {
  background: var(--blue-light);
  color: var(--blue);
}

.sidebar-item:active,
.sidebar-item.pressed {
  background: var(--blue-light);
  color: var(--blue);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  padding: 2.4rem;
  max-width: 104rem;
  overflow-y: auto;
}

.section {
  display: none;
  animation: fadeSlideIn 0.3s ease;
}

.section.active {
  display: block;
}

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

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

.section-header h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

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

/* --- Hero Banner --- */
.hero-banner {
  background: linear-gradient(135deg, var(--blue) 0%, #1d4ed8 50%, #4338ca 100%);
  border-radius: var(--radius);
  padding: 2.4rem 3.2rem;
  margin-bottom: 2.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.6rem;
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 40rem;
  height: 40rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}

.hero-banner::before {
  content: '';
  position: absolute;
  bottom: -30%;
  left: 30%;
  width: 30rem;
  height: 30rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-content h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.4rem;
}

.hero-content p {
  font-size: 1.3rem;
  color: rgba(255,255,255,0.8);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.btn-white {
  background: white;
  color: var(--blue);
  border: none;
}

.btn-white:hover {
  background: #f0f0f0;
}

.btn-outline-light {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.5);
  color: white;
}

.btn-outline-light:hover {
  border-color: white;
  background: rgba(255,255,255,0.1);
}

/* --- Cards --- */
.card-row {
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card h3 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.flex-1 { flex: 1; min-width: 24rem; }
.flex-2 { flex: 2; min-width: 28rem; }

/* --- Stat Cards --- */
.stat-card {
  flex: 1;
  min-width: 16rem;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-icon {
  width: 4.8rem;
  height: 4.8rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 2.4rem;
  height: 2.4rem;
}

.stat-blue .stat-icon { background: var(--blue-light); color: var(--blue); }
.stat-green .stat-icon { background: var(--green-light); color: var(--green); }
.stat-purple .stat-icon { background: var(--purple-light); color: var(--purple); }

.stat-info h4 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
}

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

.stat-info .stat-hint {
  font-size: 1.1rem;
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.2rem;
  display: block;
  text-decoration: none;
  transition: opacity 0.15s;
}
.stat-info .stat-hint:hover { opacity: 0.75; }

/* --- Quick Actions --- */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.2rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.action-btn:hover {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.14);
}

.action-btn svg {
  width: 2rem;
  height: 2rem;
}

/* --- Activity List --- */
.activity-list {
  list-style: none;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 1.3rem;
}

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

.activity-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.4rem;
}

.activity-dot.blue { background: var(--blue); }
.activity-dot.green { background: var(--green); }
.activity-dot.purple { background: var(--purple); }
.activity-dot.red { background: #ef4444; }

.activity-text {
  flex: 1;
  color: var(--text);
}

.activity-time {
  font-size: 1.1rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.activity-empty {
  color: var(--text-muted);
  font-size: 1.3rem;
  text-align: center;
  padding: 2rem;
}

/* --- Campaign Filters (same as guest page) --- */
.campaign-filters {
  width: 100%;
  margin: 0 auto 2rem;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow-lg);
}

.filter-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.time-period {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.filter-group + .location {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.time-period select, .location select {
  width: 100%;
  padding: 0.6rem 2.8rem 0.6rem 1.2rem;
  font-weight: 600;
  font-size: 1.2rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  appearance: none;
  background: var(--white) url("../images/chevron-down.svg") no-repeat right 0.8rem center / 1.2rem;
  color: var(--text);
  max-width: 100%;
  cursor: pointer;
  height: auto;
}

.devider-filter {
  height: 1px;
  background: var(--border);
  border: none;
  margin: 0.6rem 0;
}

.campaign-filters button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  font-size: 1.2rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.campaign-filters button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.filter-btn.active, .filter-row .active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* --- Campaign Grid --- */
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(28rem, 1fr));
  gap: 1.6rem;
}

.campaign-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
}

.campaign-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.campaign-card-img {
  width: 100%;
  height: 16rem;
  object-fit: cover;
  display: block;
}

.campaign-card-body {
  padding: 1.2rem 1.6rem 1.6rem;
}

.campaign-card-body h4 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.campaign-card-body > p {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.campaign-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.8rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--blue-light);
  color: var(--blue);
}

.camp-location {
  font-size: 1rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.2rem 0.8rem;
  border-radius: var(--radius-full);
}

.progress-bar {
  width: 100%;
  height: 0.8rem;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #2d9e33);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.campaign-progress {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.campaign-progress .raised {
  font-weight: 700;
  color: var(--green);
}

.campaign-actions {
  display: flex;
  gap: 0.6rem;
}

/* --- Profile --- */
.profile-card {
  overflow: hidden;
}

.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 2.4rem;
  flex-wrap: wrap;
}

.avatar-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.profile-display-name {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
  max-width: 18rem;
  word-break: break-word;
}

.profile-display-name.is-placeholder {
  color: var(--text-muted);
  font-weight: 600;
  font-style: italic;
}

.profile-role-badge {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.4rem 1.2rem;
  background: var(--color-bg-deep, #f1f5f9);
  border: 1px solid var(--border);
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}

/* Driven by body class set by PHP (see <body class="role-…"> in userhome.html) */
body.role-donor .profile-role-badge::before { content: "Donor"; }
body.role-taker .profile-role-badge::before { content: "Beneficiary"; }
body.role-org   .profile-role-badge::before { content: "Organisation"; }

/* Hide the badge entirely when there is no authenticated role (e.g. guest mode) */
body.is-guest .profile-role-badge { display: none; }

.avatar-upload {
  position: relative;
  width: 11rem;
  height: 11rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--white, #fff);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.18), 0 0 0 3px rgba(37, 99, 235, 0.12);
  cursor: pointer;
  flex-shrink: 0;
  background: var(--color-bg-deep, #f1f5f9);
}

.avatar-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 60%, rgba(0,0,0,0) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 1.2rem;
  gap: 0.3rem;
  opacity: 0;
  transition: opacity 0.2s;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.avatar-overlay svg {
  display: block;
}

.avatar-upload:hover .avatar-overlay,
.avatar-upload:focus-visible .avatar-overlay {
  opacity: 1;
}

.profile-fields {
  flex: 1;
  min-width: 24rem;
}

.profile-fields label {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.profile-fields input,
.profile-fields textarea {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.2s;
  margin-bottom: 0.4rem;
  background: var(--white);
}

.profile-fields input:focus,
.profile-fields textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235,.15);
}

.profile-fields textarea {
  resize: vertical;
  min-height: 8rem;
  margin-bottom: 1.2rem;
}

.field-hint {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.field-hint.error {
  color: #ef4444;
}

input.error,
textarea.error,
select.error {
  border-color: #ef4444 !important;
}

/* --- Wallet --- */
.wallet-card {
  background: linear-gradient(135deg, var(--blue) 0%, #1d4ed8 100%);
  color: white;
}

.wallet-card .balance-display {
  margin-bottom: 1.6rem;
}

.balance-label {
  font-size: 1.2rem;
  opacity: 0.8;
  margin-bottom: 0.2rem;
}

.wallet-balance {
  font-size: 3.6rem;
  font-weight: 700;
}

.wallet-card .wallet-balance {
  color: white;
}

.top-up-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.top-up-form input {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  transition: border-color 0.2s;
  background: rgba(255,255,255,0.15);
  color: white;
  font-family: 'Poppins', Arial, sans-serif;
}

.top-up-form input::placeholder {
  color: rgba(255,255,255,0.5);
}

.top-up-form input:focus {
  outline: none;
  border-color: white;
  background: rgba(255,255,255,0.25);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1.6rem;
  font-size: 1.3rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

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

.btn-primary:hover {
  background: var(--blue-dark);
}

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

.btn-green:hover {
  background: var(--color-success-dark);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 1.1rem;
}

/* --- Transactions --- */
.transaction-list {
  list-style: none;
}

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

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

.transaction-amount {
  font-weight: 700;
}

.transaction-amount.positive {
  color: var(--green);
}

.transaction-amount.negative {
  color: #ef4444;
}

.transaction-date {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* --- Campaign Form --- */
.campaign-form label {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  margin-top: 1.2rem;
}

.campaign-form label:first-child {
  margin-top: 0;
}

.campaign-form input,
.campaign-form select,
.campaign-form textarea {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.2s;
  background: var(--white);
}

.campaign-form input:focus,
.campaign-form select:focus,
.campaign-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235,.15);
}

.campaign-form textarea {
  resize: vertical;
  min-height: 10rem;
}

.campaign-form select {
  appearance: none;
  background: var(--white) url("../images/chevron-down.svg") no-repeat right 1rem center / 1.2rem;
  cursor: pointer;
}

.campaign-form .form-row {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.campaign-form .form-row > * {
  flex: 1;
  min-width: 20rem;
}

.campaign-form .btn {
  margin-top: 1.6rem;
}

.campaign-upload {
  position: relative;
  width: 100%;
  height: 16rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: var(--text-muted);
  font-size: 1.3rem;
  gap: 0.8rem;
  margin-top: 0.8rem;
  overflow: hidden;
}

.campaign-upload:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}

.campaign-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
}

.campaign-upload svg {
  width: 3.2rem;
  height: 3.2rem;
}

/* --- Empty State --- */
.empty-state svg {
  width: 6rem;
  height: 6rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.empty-state p {
  font-size: 1.3rem;
}

/* --- Toast --- */
.toast {
  position: fixed;
  top: 7rem;
  right: 2rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-sm);
  font-size: 1.3rem;
  font-weight: 600;
  color: white;
  background: var(--green);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  opacity: 0;
  transform: translateY(-1rem) scale(0.95);
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.error {
  background: #ef4444;
}

/* --- Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.4rem;
  width: 100%;
  max-width: 42rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: modalIn 0.25s ease;
}

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

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
}

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

.modal h3 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.modal-desc {
  font-size: 1.3rem;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
}

.modal-balance {
  font-size: 1.3rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.modal-balance strong {
  color: var(--text);
}

.modal label {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.modal input[type="number"],
.modal input[type="text"],
.modal input[type="email"] {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.6rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.modal input[type="number"]:focus,
.modal input[type="text"]:focus,
.modal input[type="email"]:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235,.15);
}

/* Guest-only fields in donate modal: subtle divider + tighter label rhythm */
.modal .guest-only-label {
  margin-top: 1.2rem;
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal .guest-only-label[for="modal-donor-name"] {
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px dashed var(--border);
}

.modal-hint {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
}

.modal-goal-info {
  margin-bottom: 1.6rem;
}

.modal-goal-text {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.modal-goal-text .raised {
  font-weight: 700;
  color: var(--green);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.6rem;
  justify-content: flex-end;
}

/* --- Mobile --- */
.mobile-overlay {
  display: none;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 5.8rem;
    left: 0;
    bottom: 0;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.3s;
    box-shadow: var(--shadow-lg);
    border-radius: 0 1.6rem 1.6rem 0;
    width: 28rem;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 25;
  }

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

  .main-content {
    padding: 1.6rem;
  }

  .hero-banner {
    padding: 1.6rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-content h1 {
    font-size: 1.8rem;
  }

  .profile-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1.8rem;
  }

  .avatar-column {
    align-self: center;
    gap: 1.2rem;
    padding-bottom: 0.4rem;
    width: 100%;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.8rem;
  }

  .avatar-upload {
    width: 12rem;
    height: 12rem;
  }

  /* On touch devices, hover never fires — show a subtle hint pill instead */
  .avatar-upload .avatar-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 55%);
    padding-bottom: 1rem;
    font-size: 1.05rem;
  }

  .profile-display-name {
    font-size: 2rem;
  }

  .profile-fields {
    width: 100%;
    min-width: 0;
  }

  .profile-save-btn {
    width: 100%;
    margin-top: 0.4rem;
    padding: 1.2rem;
    font-size: 1.5rem;
  }

  .stat-card {
    min-width: 100%;
  }

  .wallet-balance {
    font-size: 2.4rem;
  }

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

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .card-row {
    flex-direction: column;
  }

  .flex-1, .flex-2 {
    min-width: auto;
  }
}

@media (min-width: 769px) {
  .campaign-filters { padding: 2.5rem 3.5rem; }

  .filter-row {
    flex-direction: row;
    align-items: center;
  }

  .time-period { margin-left: auto; width: auto; }

  .filter-group + .location { margin-left: auto; width: auto; }

  .time-period select, .location select { width: auto; min-width: 14rem; }

  .campaign-filters button {
    padding: 0.8rem 1.6rem;
  }
}

/* --- Sidebar Brand --- */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 2rem 2rem 1.6rem;
  flex-shrink: 0;
  position: relative;
}

.sidebar-logo-circle {
  width: 5.2rem;
  height: 5.2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(37, 99, 235, 0.22);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.14), 0 0 0 3px rgba(37, 99, 235, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-circle img {
  width: 3.4rem;
  height: 3.4rem;
}

.sidebar-brand span {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* --- Sidebar User Card (profile chip at top) --- */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin: 0 1.2rem 1.2rem;
  padding: 1rem 1.2rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.03) 100%);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 1.2rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.2s;
  width: calc(100% - 2.4rem);
}

.sidebar-user:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14) 0%, rgba(37, 99, 235, 0.06) 100%);
  border-color: rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
}

.sidebar-user-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--white, #fff);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  background: var(--color-bg-deep, #f1f5f9);
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.sidebar-user-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--blue, #2563eb);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}

/* Role label is set by the same body class PHP applies to .profile-role-badge */
body.role-donor .sidebar-user-role::before { content: "Donor"; }
body.role-taker .sidebar-user-role::before { content: "Beneficiary"; }
body.role-org   .sidebar-user-role::before { content: "Organisation"; }

.sidebar-user-chevron {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.6;
}

/* --- Preset Amount Buttons --- */
.preset-amounts {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.preset-btn {
  padding: 0.5rem 1.4rem;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Poppins', Arial, sans-serif;
}

.preset-btn:hover,
.preset-btn.selected {
  background: rgba(255, 255, 255, 0.28);
  border-color: white;
  color: white;
}

/* Preset buttons inside the modal (white background) */
.modal-presets .preset-btn {
  border-color: var(--border);
  background: var(--bg);
  color: var(--text-muted);
}

.modal-presets .preset-btn:hover,
.modal-presets .preset-btn.selected {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}

/* Top-up input row */
.top-up-input-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
  margin-top: 0.4rem;
}

.wallet-card .top-up-input-row {
  border-top-color: rgba(255, 255, 255, 0.2);
}

.top-up-input-row input {
  flex: 1;
  min-width: 14rem;
}

/* --- Auth Guard Overlay --- */
.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.6rem;
}

.auth-overlay.show {
  display: flex;
  overflow-y: auto;
}

.auth-modal {
  position: relative;
  background: white;
  border-radius: var(--radius);
  padding: 3.6rem 3.2rem;
  text-align: center;
  max-width: 40rem;
  width: 90%;
  box-shadow: var(--shadow-xl);
}

.auth-modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  border: none;
  background: var(--color-bg-deep);
  color: var(--color-text-muted);
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-modal-close:hover { background: var(--color-border); color: var(--color-text); }

.auth-modal-cancel {
  display: block;
  margin: 1.6rem auto 0;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.6rem 1rem;
}
.auth-modal-cancel:hover { color: var(--color-text); }

.auth-logo-wrap {
  width: 7.2rem;
  height: 7.2rem;
  background: linear-gradient(135deg, var(--blue-light) 0%, #fff 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  border: 1.5px solid rgba(37, 99, 235, 0.14);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
}

.auth-logo-wrap img {
  width: 4.4rem;
  height: 4.4rem;
}

.auth-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.8rem;
}

.auth-subtitle {
  font-size: 1.3rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2.4rem;
  font-weight: 400;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.8rem;
  border-radius: var(--radius-full);
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.auth-btn-primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.auth-btn-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.auth-btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.auth-btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* .sidebar-close removed — drawer closes via overlay tap or nav-item tap */

/* ─── Bottom nav (mobile only) ─────────── */
.bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 100;
    align-items: center;
    justify-content: space-around;
    padding: 0 0.8rem env(safe-area-inset-bottom, 0.4rem);
  }

  /* Add bottom padding to main so content isn't hidden behind bottom nav */
  .main-content {
    padding-bottom: 7rem;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    font-family: 'Poppins', Arial, sans-serif;
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
    flex: 1;
    min-width: 0;
  }

  .bottom-nav-item svg {
    width: 2.2rem;
    height: 2.2rem;
    flex-shrink: 0;
  }

  .bottom-nav-item span {
    font-size: 1rem;
    white-space: nowrap;
  }

  .bottom-nav-item:active,
  .bottom-nav-item.pressed {
    color: var(--blue);
    background: var(--blue-light);
    border-radius: var(--radius-sm);
  }

  .bottom-nav-item.active {
    color: var(--blue);
    position: relative;
  }
  .bottom-nav-item.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2.4rem;
    height: 0.3rem;
    border-radius: 3px 3px 0 0;
    background: var(--blue);
  }

  /* FAB-style centre button */
  .bottom-nav-fab {
    width: 4.8rem;
    height: 4.8rem;
    min-width: 4.8rem;
    background: var(--blue);
    color: #fff !important;
    border-radius: 50%;
    flex: 0 0 4.8rem;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    margin-top: -1.6rem;
    padding: 0;
  }

  .bottom-nav-fab svg {
    width: 2.6rem;
    height: 2.6rem;
  }

  .bottom-nav-fab.active {
    background: var(--blue-dark);
    color: #fff;
  }

  /* Guest mode: tap-locked items are dimmed so the 'sign in required'
     prompt doesn't feel like a surprise. */
  body.is-guest .bottom-nav-item[data-section="wallet"],
  body.is-guest .bottom-nav-item[data-section="profile"] {
    color: var(--color-text-light);
    opacity: 0.7;
  }
  body.is-guest .bottom-nav-fab {
    background: linear-gradient(135deg, var(--blue), var(--color-purple));
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.35);
  }
}

/* ── FAB entrance pulse ── */
@keyframes fab-pulse {
  0%,100% { box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3); }
  50%      { box-shadow: 0 4px 30px rgba(37, 99, 235, 0.55), 0 0 0 8px rgba(37, 99, 235, 0.1); }
}
.bottom-nav-fab { animation: fab-pulse 2.4s 1s ease-in-out 3; }

/* ── Sidebar visual polish ── */

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-purple) 100%);
  pointer-events: none;
}

/* ── Sidebar toggle button (inside brand) ── */
.sidebar-toggle {
  display: none;
  margin-left: auto;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.sidebar-toggle:hover {
  background: var(--blue-light);
  color: var(--blue);
}
.sidebar-toggle:active,
.sidebar-toggle.pressed {
  background: var(--blue-light);
  color: var(--blue);
}
.sidebar-toggle svg {
  transition: transform 0.25s ease;
}

@media (min-width: 769px) {
  .sidebar-toggle { display: flex; }
  .sidebar { transition: width 0.25s ease; }
}

/* ── Sidebar collapsed (icon-only) ── */
.sidebar.collapsed {
  width: 6rem;
}
.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .sidebar-item span {
  display: none;
}
.sidebar.collapsed .sidebar-user {
  margin: 0 0.8rem 1.2rem;
  padding: 0.6rem;
  width: calc(100% - 1.6rem);
  justify-content: center;
}
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-user-chevron {
  display: none;
}
.sidebar.collapsed .sidebar-user-avatar {
  width: 3.6rem;
  height: 3.6rem;
}
.sidebar.collapsed .sidebar-brand {
  justify-content: flex-start;
  padding: 1.2rem 0 1.2rem 0.8rem;
  gap: 0;
}
.sidebar.collapsed .sidebar-item {
  justify-content: center;
  padding: 1.2rem 0;
}
.sidebar.collapsed .sidebar-brand .sidebar-toggle {
  position: absolute;
  right: -3rem;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  width: 3.2rem;
  height: 3.2rem;
}
.sidebar.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}
.sidebar.collapsed .sidebar-item.active::before {
  top: 0.6rem;
  bottom: 0.6rem;
}

/* ── Filter bar ── */
.filter-primary-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.filter-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  flex: 1;
}

@media (max-width: 768px) {
  .filter-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0.2rem;
  }
  .filter-scroll::-webkit-scrollbar { display: none; }
}

.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1.4rem;
  font-size: 1.2rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 4.4rem;
  font-family: 'Poppins', Arial, sans-serif;
  transition: all 0.2s;
}
.filter-toggle-btn:hover,
.filter-toggle-btn.active {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}

/* ── Touch targets — min 44 px ── */
.filter-btn,
.filter-group button {
  min-height: 4.4rem;
}
.preset-btn { min-height: 4rem; }
.action-btn { min-height: 6rem; }
.btn        { min-height: 4.4rem; }

/* ── Mobile font & spacing boost ── */
@media (max-width: 768px) {
  .card { padding: 2rem; }

  .campaign-card-body > p { font-size: 1.3rem; }
  .activity-item          { font-size: 1.4rem; }
  .section-header p       { font-size: 1.4rem; }
  .stat-info p            { font-size: 1.3rem; }
  .transaction-item       { font-size: 1.4rem; }
}

/* ── Wallet balance prominence ── */
.stat-blue {
  border: 1.5px solid rgba(37, 99, 235, 0.18);
  background: linear-gradient(135deg, #fff 65%, var(--blue-light) 100%);
}
.stat-blue .stat-info h4 {
  font-size: 2.2rem;
  color: var(--blue);
}

/* ── 3-column campaign grid on wide screens ── */
@media (min-width: 1280px) {
  .campaign-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Keyboard focus ring ── */
:focus-visible {
  outline: 2.5px solid var(--blue);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ── Modal confirm step ── */
.modal-confirm-icon {
  width: 6.4rem;
  height: 6.4rem;
  border-radius: 50%;
  background: var(--color-success-light);
  border: 2px solid var(--color-success-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.6rem;
  color: var(--color-success);
}
.modal-confirm-label {
  font-size: 1.4rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.4rem;
}
.modal-confirm-amount {
  font-size: 3.6rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 0.4rem;
}
.modal-confirm-to {
  font-size: 1.4rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.2rem;
}
.modal-confirm-to strong { color: var(--text); }
.modal-confirm-note {
  font-size: 1.2rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem 1.2rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 1.6rem;
  line-height: 1.5;
}

/* ── Read-more on campaign cards ── */
.campaign-card-body > p.expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.read-more-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0;
  font-family: 'Poppins', Arial, sans-serif;
  display: block;
  transition: opacity 0.2s;
}
.read-more-btn:hover { opacity: 0.7; }

/* ── Empty state CTA button ── */
.empty-state .btn {
  margin-top: 1.6rem;
}

/* ════════════════════════════════════════════════════════════
   Dashboard redesign — Sawa blue palette
   Header (greeting + search + bell + CTA) → 3 stat tiles
   → 2-col (Recent Donations | Urgent Campaigns)
   ════════════════════════════════════════════════════════════ */

/* Header row */
.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  padding: 0.4rem 0 2rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 2.4rem;
}
.dash-greeting h1 {
  font-size: 2.6rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}
.dash-greeting p {
  font-size: 1.4rem;
  color: #64748b;
  margin: 0;
}
.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.dash-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 32rem;
  max-width: 100%;
}
.dash-search svg {
  position: absolute;
  left: 1.4rem;
  width: 1.8rem;
  height: 1.8rem;
  color: #94a3b8;
  pointer-events: none;
}
.dash-search input {
  width: 100%;
  height: 4.4rem;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 9999px;
  padding: 0 1.6rem 0 4.2rem;
  font-family: inherit;
  font-size: 1.4rem;
  color: #0f172a;
  outline: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.dash-search input::placeholder { color: #94a3b8; }
.dash-search input:focus {
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.dash-bell-wrap { position: relative; }
.dash-bell {
  position: relative;
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 50%;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.dash-bell-wrap.open .dash-bell { background: var(--color-primary-light); border-color: var(--color-primary); color: var(--color-primary); }

/* Notifications dropdown panel */
.dash-notif-panel {
  position: absolute;
  top: calc(100% + 0.8rem);
  right: 0;
  width: 36rem;
  max-width: calc(100vw - 2rem);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.4rem;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
  z-index: 100;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  overflow: hidden;
}
.dash-bell-wrap.open .dash-notif-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.dash-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.6rem;
  border-bottom: 1px solid #f1f5f9;
}
.dash-notif-head strong { font-size: 1.45rem; color: #0f172a; }
.dash-notif-mark {
  font-size: 1.2rem;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.dash-notif-mark:hover { text-decoration: underline; }

.dash-notif-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 36rem;
  overflow-y: auto;
}
.dash-notif-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.2rem 1.6rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.dash-notif-row:hover { background: #f8fafc; }
.dash-notif-row:last-child { border-bottom: none; }
.dash-notif-row.unread::before {
  content: '';
  position: absolute;
  left: 0.6rem;
  top: 50%;
  width: 0.6rem;
  height: 0.6rem;
  background: var(--color-primary);
  border-radius: 50%;
  transform: translateY(-50%);
}
.dash-notif-icon {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-notif-icon svg { width: 1.6rem; height: 1.6rem; }
.dash-notif-icon.icon-heart { background: rgba(239, 68, 68, 0.10); color: #ef4444; }
.dash-notif-icon.icon-check { background: rgba(22, 163, 74, 0.10); color: #16a34a; }
.dash-notif-icon.icon-bell  { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.dash-notif-icon.icon-users { background: rgba(37, 99, 235, 0.10); color: var(--color-primary); }
.dash-notif-text { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.dash-notif-text strong { font-size: 1.3rem; color: #0f172a; }
.dash-notif-text small { font-size: 1.15rem; color: #64748b; }

.dash-notif-foot {
  display: block;
  padding: 1rem;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}
.dash-notif-foot:hover { background: #eff6ff; }
.dash-bell svg { width: 1.8rem; height: 1.8rem; }
.dash-bell:hover { background: #f8fafc; color: var(--color-primary); border-color: #cbd5e1; }
.dash-bell-dot {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
}
.dash-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  height: 4.4rem;
  padding: 0 2rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
}
.dash-cta svg { width: 1.6rem; height: 1.6rem; }
.dash-cta:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.36);
}

/* 3 stat tiles */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
  margin-bottom: 2.4rem;
}
.stat-tile {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.6rem;
  padding: 2rem 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.18s, transform 0.18s;
}
.stat-tile:hover {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}
.stat-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-tile-label {
  font-size: 1.4rem;
  color: #64748b;
  font-weight: 500;
}
.stat-tile-icon {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stat-tile-icon svg { width: 1.8rem; height: 1.8rem; }
.stat-icon-trend { background: rgba(22, 163, 74, 0.10); color: #16a34a; }
.stat-icon-users { background: rgba(37, 99, 235, 0.10); color: var(--color-primary); }
.stat-icon-cal   { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }

.stat-tile-value {
  font-size: 3rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat-tile-delta {
  font-size: 1.25rem;
  font-weight: 500;
}
.delta-up { color: #16a34a; }
.delta-down { color: #ef4444; }

/* Two-column lower */
.dash-lower {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.8rem;
}
.dash-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.6rem;
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-card-head h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.dash-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  cursor: pointer;
}
.dash-card-link svg { width: 1.4rem; height: 1.4rem; }
.dash-card-link:hover { color: var(--color-primary-dark); }

/* Recent donations list */
.recent-donations {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.recent-donation {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem 1.4rem;
  background: #f8fafc;
  border-radius: 1.2rem;
  transition: background 0.15s;
}
.recent-donation:hover { background: #f1f5f9; }
.rd-icon {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.10);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rd-icon svg { width: 1.6rem; height: 1.6rem; }
.rd-meta { display: flex; flex-direction: column; min-width: 0; }
.rd-meta strong { font-size: 1.4rem; font-weight: 600; color: #0f172a; }
.rd-meta small { font-size: 1.2rem; color: #64748b; }
.rd-right { display: flex; flex-direction: column; align-items: flex-end; }
.rd-amount { font-size: 1.5rem; font-weight: 700; color: #0f172a; }
.rd-time { font-size: 1.15rem; color: #94a3b8; }
.rd-status {
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  white-space: nowrap;
}
.status-delivered { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.status-transit   { background: rgba(245, 158, 11, 0.14); color: #b45309; }

/* Urgent campaigns list */
.urgent-list { display: flex; flex-direction: column; gap: 1.4rem; }
.urgent-item {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 1.4rem;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.urgent-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.urgent-meta { display: flex; flex-direction: column; gap: 0.2rem; }
.urgent-meta strong { font-size: 1.5rem; font-weight: 700; color: #0f172a; }
.urgent-meta small { font-size: 1.2rem; color: #64748b; }
.urgent-priority {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  white-space: nowrap;
}
.priority-high   { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.priority-medium { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.urgent-progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  color: #475569;
}
.urgent-progress-row strong { color: #0f172a; font-weight: 700; }
.urgent-item .progress-bar {
  width: 100%;
  height: 0.7rem;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}
.urgent-item .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #60a5fa);
  border-radius: 9999px;
  transition: width 0.4s ease;
}
.urgent-donate {
  margin-top: 0.4rem;
  height: 4.4rem;
  border: none;
  border-radius: 1.2rem;
  background: var(--color-primary);
  color: #fff;
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, box-shadow 0.18s;
}
.urgent-donate:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 960px) {
  .dash-lower { grid-template-columns: 1fr; }
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .dash-search { width: 24rem; }
}
@media (max-width: 640px) {
  .dash-header { flex-direction: column; align-items: stretch; }
  .dash-header-actions { flex-wrap: wrap; }
  .dash-search { width: 100%; order: -1; }
  .dash-stats { grid-template-columns: 1fr; }
  .dash-greeting h1 { font-size: 2.2rem; }
  .stat-tile-value { font-size: 2.6rem; }
  .recent-donation {
    grid-template-columns: auto 1fr auto;
    gap: 0.8rem;
  }
  .recent-donation .rd-status { grid-column: 1 / -1; justify-self: start; }
}

/* ════════════════════════════════════════════════════════════
   Discover — improved campaign cards
   ════════════════════════════════════════════════════════════ */
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(28rem, 1fr));
  gap: 2rem;
}

.camp-card {
  position: relative;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.8rem;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.camp-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
  border-color: #cbd5e1;
}
.camp-card:focus-within {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Media area: category-coloured gradient with a faded icon background */
.camp-card-media {
  position: relative;
  height: 12rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.4rem;
  overflow: hidden;
}
.camp-card-bg-icon {
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 4.4rem;
  height: 4.4rem;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}
@media (max-width: 640px) {
  .camp-card-bg-icon { width: 3.6rem; height: 3.6rem; right: 0.8rem; top: 0.8rem; }
}

/* Per-category gradient */
.cat-medical { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); }
.cat-food    { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.cat-shelter { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.cat-edu     { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); }

/* IMAGE_PLACEHOLDER:
   Add data-image="path/to/photo.jpg" on the .camp-card-media element to swap the
   gradient illustration for a real photo. The decorative SVG icon stays hidden when
   a real image is set, but the category tag + urgent badge still float over it. */
.camp-card-media[data-image] {
  background-size: cover;
  background-position: center;
}
.camp-card-media[data-image]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
.camp-card-media[data-image] .camp-card-bg-icon { display: none; }
.camp-card-media[data-image] .camp-cat-tag,
.camp-card-media[data-image] .camp-urgent-badge { position: relative; z-index: 1; }

/* Category tag */
.camp-cat-tag {
  background: rgba(255, 255, 255, 0.94);
  color: #1e293b;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  z-index: 1;
}

/* Urgent badge */
.camp-urgent-badge {
  display: inline-flex;
  align-items: center;
  background: #fff;
  color: #b91c1c;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.camp-urgent-badge::before {
  content: '';
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #ef4444;
  margin-right: 0.5rem;
  animation: campUrgentPulse 1.6s infinite;
}
@keyframes campUrgentPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* Body */
.camp-card-content {
  padding: 1.6rem 1.8rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}
.camp-card-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
}
.camp-card-desc {
  font-size: 1.3rem;
  line-height: 1.55;
  color: #64748b;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Progress */
.camp-progress-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 1.25rem;
  color: #64748b;
  margin-top: 0.2rem;
}
.camp-raised strong {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin-right: 0.4rem;
}
.camp-pct {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
}
.camp-card .progress-bar {
  width: 100%;
  height: 0.7rem;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin: 0;
}
.camp-card .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, #60a5fa 100%);
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* Footer: donors count + donate button */
.camp-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.4rem;
}
.camp-donor-count {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  color: #64748b;
  font-weight: 500;
}
.camp-donor-count svg { width: 1.4rem; height: 1.4rem; }
.camp-donate {
  height: 4rem;
  padding: 0 1.8rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
}
.camp-donate:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.32);
}
.camp-donate:active { transform: translateY(0); }

@media (max-width: 480px) {
  .camp-card-title { font-size: 1.5rem; }
  .camp-card-media { height: 10rem; }
}

.discover-search-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #64748b;
  font-size: 1.4rem;
  background: #f8fafc;
  border-radius: 1.4rem;
  margin-top: 1rem;
}

/* ── Taker dashboard: wide campaign summary card spans full row ── */
.dash-card.dash-card-wide { grid-column: 1 / -1; }
.taker-camp-summary { display: flex; flex-direction: column; gap: 1rem; }
.taker-camp-summary h4 {
  font-size: 1.7rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.taker-camp-summary p {
  font-size: 1.35rem;
  color: #64748b;
  margin: 0;
}
.taker-camp-summary .progress-bar { height: 0.8rem; }
.taker-camp-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}
.taker-camp-actions .btn {
  height: 4.4rem;
  padding: 0 2rem;
  border-radius: 9999px;
  font-size: 1.35rem;
  font-weight: 600;
}

/* Status pill in card header */
.status-pill {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}
.status-active { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.status-pending { background: rgba(245, 158, 11, 0.14); color: #b45309; }

/* ── Donate modal: payment + thank-you steps ── */
.modal-sub {
  font-size: 1.3rem;
  color: #64748b;
  margin: 0.4rem 0 1.4rem;
}

/* Animated card preview */
.card-preview {
  position: relative;
  background: linear-gradient(135deg, #1e3a8a 0%, var(--color-primary) 60%, #3b82f6 100%);
  color: #fff;
  border-radius: 1.4rem;
  padding: 1.8rem;
  height: 14rem;
  margin: 0.4rem 0 1.8rem;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.30);
  overflow: hidden;
}
.card-preview::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
}
.card-preview::after {
  content: '';
  position: absolute;
  bottom: -40%;
  right: -20%;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}
.card-preview-chip {
  width: 3.4rem;
  height: 2.6rem;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 0.5rem;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.20);
  position: relative;
  z-index: 1;
}
.card-preview-brand {
  position: absolute;
  top: 1.8rem;
  right: 1.8rem;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  font-style: italic;
  z-index: 1;
}
.card-preview-number {
  position: absolute;
  left: 1.8rem;
  right: 1.8rem;
  bottom: 4.2rem;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
  z-index: 1;
}
.card-preview-row {
  position: absolute;
  left: 1.8rem;
  right: 1.8rem;
  bottom: 1.2rem;
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  z-index: 1;
}
.card-preview-row span { display: flex; flex-direction: column; gap: 0.2rem; }
.card-preview-row small {
  font-size: 0.95rem;
  opacity: 0.7;
  letter-spacing: 0.08em;
}
.card-preview-row strong {
  font-size: 1.25rem;
  letter-spacing: 0.05em;
}

/* Payment form fields (legacy class kept for backwards compat) */
.card-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

/* ════════════════════════════════════════════════════════════
   Payment step v2 — fields, brand chips, trust strip
   ════════════════════════════════════════════════════════════ */

/* Accepted brand chip strip (above the inputs) */
.payment-brand-strip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.4rem 0 1.6rem;
  padding: 0.8rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
}
.payment-brand-strip::before {
  content: 'We accept';
  font-size: 1.05rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.04em;
  margin-right: 0.4rem;
}
.pay-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.2rem;
  padding: 0 0.6rem;
  border-radius: 0.4rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.pay-brand-visa     { color: #1a1f71; font-style: italic; }
.pay-brand-amex     { color: #2e77bb; }
.pay-brand-discover { color: #ff6000; font-size: 0.9rem; }
.pay-brand-mc {
  gap: 0.2rem;
  padding: 0 0.5rem;
}
.mc-circle { width: 1rem; height: 1rem; border-radius: 50%; }
.mc-red    { background: #eb001b; }
.mc-yellow { background: #f79e1b; margin-left: -0.4rem; mix-blend-mode: multiply; }

/* Field wrapper */
.payment-field {
  margin-bottom: 1.2rem;
}
.payment-field label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: #475569 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem !important;
}

/* Tiny "?" help bubble next to CVV */
.payment-label-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  background: #e2e8f0;
  color: #64748b;
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: help;
}

/* Input wrapper supports leading + trailing icons */
.payment-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}
.payment-input {
  flex: 1;
  width: 100%;
  height: 4.8rem;
  padding: 0 1.4rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.8rem;
  font-size: 1.5rem;
  font-weight: 500;
  color: #0f172a;
  font-family: inherit;
  background: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.payment-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
  letter-spacing: 0;
}
.payment-input:hover { border-color: #cbd5e1; }
.payment-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  background: #fff;
}

/* Leading icon (left side of input) */
.payment-input-leading,
.payment-input-trailing {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: #94a3b8;
  pointer-events: none;
}
.payment-input-leading  { left: 1.2rem; }
.payment-input-trailing { right: 1.2rem; }
.payment-input-leading svg,
.payment-input-trailing svg { width: 1.8rem; height: 1.8rem; }
.payment-input-wrap:has(.payment-input-leading)  .payment-input { padding-left: 4rem; }
.payment-input-wrap:has(.payment-input-trailing) .payment-input { padding-right: 4rem; }

.payment-input-wrap:focus-within .payment-input-leading,
.payment-input-wrap:focus-within .payment-input-trailing {
  color: var(--color-primary);
}

/* Expiry + CVV side by side */
.payment-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Trust strip below all fields */
.payment-trust {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.2rem 0 0.4rem;
  padding: 0.8rem 1.2rem;
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.22);
  border-radius: 0.8rem;
  font-size: 1.15rem;
  color: #15803d;
  font-weight: 600;
}
.payment-trust svg {
  width: 1.4rem;
  height: 1.4rem;
  flex-shrink: 0;
  color: #16a34a;
}

@media (max-width: 480px) {
  .payment-brand-strip { gap: 0.4rem; padding: 0.6rem 0.8rem; flex-wrap: wrap; }
  .payment-brand-strip::before { font-size: 1rem; margin-right: 0.2rem; }
  .payment-input { height: 4.6rem; font-size: 1.4rem; }
  .payment-row-2 { gap: 0.8rem; }
}

/* Review card line */
.modal-confirm-card {
  font-size: 1.25rem;
  color: #64748b;
  margin: 0.6rem 0 1rem;
  text-align: center;
}

/* ── Thank-you screen ── */
.modal-thanks {
  text-align: center;
  padding: 1rem 0.4rem;
}
.thanks-icon {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.4rem;
  box-shadow: 0 12px 30px rgba(22, 163, 74, 0.30);
  animation: thanksPop 0.4s ease;
}
.thanks-icon svg { width: 3.2rem; height: 3.2rem; }
@keyframes thanksPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.modal-thanks h3 {
  font-size: 2.2rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.8rem;
}
.thanks-amount-line {
  font-size: 1.4rem;
  color: #475569;
  margin: 0 0 0.6rem;
}
.thanks-amount-line strong { color: #0f172a; }
.thanks-receipt {
  font-size: 1.25rem;
  color: #64748b;
  margin: 0 0 1.8rem;
}

/* Guest sign-up CTA inside thank-you */
.thanks-guest-cta {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(96, 165, 250, 0.12) 100%);
  border: 1.5px dashed rgba(37, 99, 235, 0.30);
  border-radius: 1.4rem;
  padding: 1.6rem;
  margin: 0 0 1.4rem;
  text-align: center;
}
.thanks-cta-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.4rem;
}
.thanks-cta-body {
  font-size: 1.3rem;
  color: #475569;
  margin: 0 0 1.2rem;
  line-height: 1.5;
}
.thanks-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 4.4rem;
  padding: 0 2rem;
  border-radius: 9999px;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
}
.thanks-cta-btn svg { width: 1.5rem; height: 1.5rem; }

/* ── Donors modal ── */
.donors-modal-content {
  max-width: 52rem;
  width: 100%;
  padding: 2.4rem;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.donors-modal-head {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 1.6rem;
  margin-bottom: 1.4rem;
}
.donors-modal-head h3 {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.4rem;
}
.donors-modal-head p {
  font-size: 1.3rem;
  color: #64748b;
  margin: 0 0 1.4rem;
}
.donors-summary {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.2rem 1.6rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(96, 165, 250, 0.10) 100%);
  border-radius: 1.2rem;
}
.donors-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.donors-summary-item strong {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}
.donors-summary-item small { font-size: 1.15rem; color: #64748b; }
.donors-summary-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(37, 99, 235, 0.15);
}

.donors-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.donors-list::-webkit-scrollbar { width: 6px; }
.donors-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.donor-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  transition: background 0.15s;
}
.donor-row:hover { background: #f8fafc; }
.donor-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, #60a5fa 100%);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.donor-avatar.donor-anon {
  background: #e2e8f0;
  color: #64748b;
}
.donor-meta { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.donor-meta strong { font-size: 1.4rem; font-weight: 600; color: #0f172a; }
.donor-meta small { font-size: 1.15rem; color: #94a3b8; }
.donor-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.donors-modal-foot {
  border-top: 1px solid #e5e7eb;
  padding-top: 1.4rem;
  margin-top: 1.4rem;
  display: flex;
  justify-content: flex-end;
}
.donors-modal-foot .btn-primary {
  height: 4.4rem;
  padding: 0 2rem;
  border-radius: 9999px;
  font-size: 1.4rem;
}

@media (max-width: 480px) {
  .donors-modal-content { padding: 1.6rem; }
  .donors-summary { gap: 1.4rem; padding: 1rem; }
  .donors-summary-item strong { font-size: 1.6rem; }
  .donor-avatar { width: 3.4rem; height: 3.4rem; font-size: 1.15rem; }
}

/* ════════════════════════════════════════════════════════════
   Guest vs auth visibility toggles
   body.is-auth  → show .auth-only, hide .guest-only
   body.is-guest → show .guest-only, hide .auth-only
   ════════════════════════════════════════════════════════════ */
body.is-auth  .guest-only { display: none !important; }
body.is-guest .auth-only  { display: none !important; }

/* Role-specific gating — only one of role-donor / role-taker / role-org is active */
body:not(.role-donor) .donor-only { display: none !important; }
body:not(.role-taker) .taker-only { display: none !important; }
body:not(.role-org)   .org-only   { display: none !important; }

/* Guests can't access locked sections — also hide their <section> targets */
body.is-guest #profile,
body.is-guest #wallet,
body.is-guest #campaign-new,
body.is-guest #campaigns { display: none !important; }

/* Sign Up CTA in sidebar — primary style */
.sidebar-item.sidebar-cta {
  background: var(--color-primary);
  color: #fff;
  margin-top: 0.4rem;
}
.sidebar-item.sidebar-cta:hover {
  background: var(--color-primary-dark);
}
.sidebar-item.sidebar-cta svg { color: #fff; }

/* Anchor sidebar-items inherit button look */
a.sidebar-item {
  text-decoration: none;
}

/* ── Guest hero banner (only shown for guests) ── */
.guest-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e3a8a 0%, var(--color-primary) 55%, #3b82f6 100%);
  color: #fff;
  border-radius: 2rem;
  padding: 2.8rem 3.2rem;
  margin-bottom: 2rem;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.22);
}
.guest-hero-text {
  position: relative;
  z-index: 1;
  max-width: 68rem;
}
.guest-hero-eyebrow {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.14);
  padding: 0.5rem 1.2rem;
  border-radius: 9999px;
  margin-bottom: 1.4rem;
}
.guest-hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 0.9rem;
  color: #fff;
}
.guest-hero p {
  font-size: 1.35rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 1.6rem;
  max-width: 56rem;
}
.guest-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.guest-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 5rem;
  padding: 0 2.2rem;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 1.45rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: transform 0.15s, box-shadow 0.18s, background 0.18s;
}
.guest-hero-btn svg { width: 1.6rem; height: 1.6rem; }
.guest-hero-btn.primary {
  background: #fff;
  color: var(--color-primary-dark);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.guest-hero-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.guest-hero-btn.secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.36);
}
.guest-hero-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.22);
}
.guest-hero-glow {
  position: absolute;
  top: -10%;
  right: -8%;
  width: 38rem;
  height: 38rem;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.55) 0%, rgba(96, 165, 250, 0) 65%);
  pointer-events: none;
}

@media (max-width: 640px) {
  .guest-hero { padding: 2.8rem 2rem; }
  .guest-hero h1 { font-size: 2.4rem; }
  .guest-hero p { font-size: 1.35rem; }
  .guest-hero-glow { width: 22rem; height: 22rem; }
}

/* ════════════════════════════════════════════════════════════
   Guest-only featured content (below stats)
   ════════════════════════════════════════════════════════════ */
.guest-feature-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.8rem;
  margin-top: 2rem;
}
@media (max-width: 900px) {
  .guest-feature-grid { grid-template-columns: 1fr; }
}

/* Featured campaigns list (compact card list) */
.featured-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.featured-camp {
  display: grid;
  grid-template-columns: 7.2rem 1fr;
  gap: 1.4rem;
  padding: 1.2rem;
  background: #f8fafc;
  border-radius: 1.2rem;
  transition: background 0.15s, transform 0.15s;
}
.featured-camp:hover { background: #f1f5f9; transform: translateY(-1px); }
.featured-camp-thumb {
  position: relative;
  width: 7.2rem;
  height: 7.2rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  /* PLACEHOLDER: replace this with a real photo using background-image when content is ready */
}
.featured-camp-thumb svg { width: 3.2rem; height: 3.2rem; opacity: 0.92; }
.featured-camp-thumb.cat-medical { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); }
.featured-camp-thumb.cat-food    { background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%); }
.featured-camp-thumb.cat-edu     { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%); }
.featured-camp-thumb.cat-shelter { background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%); }
.featured-camp-thumb .camp-urgent-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.95);
  color: #b91c1c;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}
.featured-camp-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}
.featured-camp-body strong { font-size: 1.4rem; font-weight: 700; color: #0f172a; }
.featured-camp-body small { font-size: 1.2rem; color: #64748b; line-height: 1.4; }
.featured-camp-body .progress-bar { height: 0.6rem; margin: 0.2rem 0; }
.featured-camp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1.2rem;
  color: #64748b;
}
.featured-camp-meta strong { color: #0f172a; font-weight: 700; font-size: 1.3rem; }
.featured-camp-donate {
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 1.2rem;
  padding: 0.6rem 1.2rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.featured-camp-donate:hover { background: var(--color-primary-dark); }
.featured-camp-donate:active { transform: scale(0.97); }

/* How It Works card */
.how-it-works-card { justify-content: space-between; }
.how-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.how-steps li {
  display: grid;
  grid-template-columns: 3.6rem 1fr;
  gap: 1.2rem;
  align-items: flex-start;
}
.how-step-num {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.how-steps li > div { display: flex; flex-direction: column; gap: 0.2rem; }
.how-steps li strong { font-size: 1.35rem; font-weight: 600; color: #0f172a; }
.how-steps li small { font-size: 1.2rem; color: #64748b; line-height: 1.45; }
.how-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  padding: 1rem 1.6rem;
  border-radius: 9999px;
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 0.4rem;
  transition: background 0.15s, transform 0.1s;
}
.how-cta-btn svg { width: 1.4rem; height: 1.4rem; }
.how-cta-btn:hover { background: var(--color-primary-dark); }
.how-cta-btn:active { transform: scale(0.98); }

/* Trust strip (testimonials) */
.trust-strip {
  margin-top: 2rem;
  padding: 2.4rem 2.2rem;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px solid #e5e7eb;
  border-radius: 1.6rem;
}
.trust-strip-head { text-align: center; margin-bottom: 2rem; }
.trust-strip-head h3 { font-size: 1.8rem; font-weight: 700; color: #0f172a; margin: 0 0 0.4rem; }
.trust-strip-head p { font-size: 1.25rem; color: #64748b; margin: 0; }
.trust-strip-head em { color: #94a3b8; font-style: italic; font-size: 1.15rem; }
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
@media (max-width: 900px) { .testimonials-grid { grid-template-columns: 1fr; } }
.testimonial-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.2rem;
  padding: 1.6rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s, box-shadow 0.15s;
}
.testimonial-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08); }
.testimonial-card blockquote {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.55;
  color: #1f2937;
  font-style: italic;
  quotes: "\201C" "\201D";
}
.testimonial-card blockquote::before { content: open-quote; color: var(--color-primary); font-size: 1.6rem; margin-right: 0.2rem; }
.testimonial-card blockquote::after  { content: close-quote; color: var(--color-primary); font-size: 1.6rem; margin-left: 0.2rem; }
.testimonial-card figcaption {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  border-top: 1px solid #f1f5f9;
  padding-top: 1.2rem;
}
.testimonial-avatar {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.testimonial-card figcaption span:last-child { display: flex; flex-direction: column; }
.testimonial-card figcaption strong { font-size: 1.3rem; color: #0f172a; }
.testimonial-card figcaption small { font-size: 1.15rem; color: #64748b; }

/* ════════════════════════════════════════════════════════════
   Discover toolbar — search + sort + chip filters (redesigned)
   ════════════════════════════════════════════════════════════ */
.discover-toolbar {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1.4rem;
}
.discover-search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  padding: 0 1.4rem;
  min-height: 4.8rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.discover-search-bar:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.discover-search-bar svg {
  width: 1.8rem;
  height: 1.8rem;
  color: #94a3b8;
  flex-shrink: 0;
}
.discover-search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.4rem;
  font-family: inherit;
  color: #0f172a;
  min-width: 0;
}
.discover-search-bar input::placeholder { color: #94a3b8; }
.discover-search-clear {
  border: none;
  background: #f1f5f9;
  color: #64748b;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.discover-search-clear:hover { background: #e2e8f0; color: #334155; }

.discover-sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  padding: 0 1.4rem 0 1.6rem;
  min-height: 4.8rem;
  transition: border-color 0.15s;
}
.discover-sort-wrap:focus-within { border-color: var(--color-primary); }
.discover-sort-label {
  font-size: 1.2rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
}
#discover-sort {
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  padding-right: 1.6rem;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right center;
}

/* Category chip row */
.discover-filters { margin-bottom: 1.6rem; }
.discover-cat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  padding: 0.8rem 1.4rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  min-height: 4.4rem;
  font-family: inherit;
  transition: all 0.15s;
}
.cat-chip svg { width: 1.6rem; height: 1.6rem; flex-shrink: 0; }
.cat-chip:hover { border-color: var(--color-primary); color: var(--color-primary); background: rgba(37, 99, 235, 0.04); }
.cat-chip.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.92) 0%, rgba(59, 130, 246, 0.92) 100%);
  border-color: rgba(37, 99, 235, 0.55);
  color: #fff;
  box-shadow:
    0 8px 22px rgba(37, 99, 235, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
}
.cat-chip.active svg { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.16)); }
.cat-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  background: rgba(15, 23, 42, 0.06);
  color: inherit;
  border-radius: 9999px;
  font-size: 1.1rem;
  font-weight: 700;
}
.cat-chip.active .cat-chip-count { background: rgba(255, 255, 255, 0.26); color: #fff; backdrop-filter: blur(4px); }
.cat-chip-more {
  margin-left: auto;
  border-style: dashed;
}
.cat-chip-more.active {
  background: var(--blue-light);
  border-color: var(--color-primary);
  border-style: solid;
  color: var(--color-primary);
  box-shadow: none;
}
.filter-active-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 9999px;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Advanced panel */
.discover-advanced {
  margin-top: 1.2rem;
  padding: 1.6rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 2.4rem;
  align-items: flex-end;
}
.discover-advanced[hidden] { display: none; }
.adv-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 16rem;
}
.adv-label {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}
.adv-pills { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.adv-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  padding: 0.7rem 1.4rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  min-height: 4rem;
  font-family: inherit;
  transition: all 0.15s;
}
.adv-pill svg { width: 1.4rem; height: 1.4rem; }
.adv-pill:hover { border-color: var(--color-primary); color: var(--color-primary); background: rgba(37, 99, 235, 0.04); }
.adv-pill.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.92) 0%, rgba(59, 130, 246, 0.92) 100%);
  border-color: rgba(37, 99, 235, 0.55);
  color: #fff;
  box-shadow:
    0 6px 16px rgba(37, 99, 235, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
}
.adv-group select {
  height: 4rem;
  padding: 0 2.6rem 0 1.2rem;
  border: 1.5px solid var(--border);
  border-radius: 0.8rem;
  font-family: inherit;
  font-size: 1.35rem;
  color: #0f172a;
  background: #fff;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  min-width: 18rem;
}
.adv-group select:focus { border-color: var(--color-primary); outline: none; }
.adv-reset {
  margin-left: auto;
  background: transparent;
  border: 1.5px solid var(--color-danger);
  color: var(--color-danger);
  border-radius: 9999px;
  padding: 0.7rem 1.4rem;
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 4rem;
  font-family: inherit;
  transition: all 0.15s;
}
.adv-reset:hover { background: var(--color-danger-light); }

/* Active filter pills bar */
.discover-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
  align-items: center;
}
.discover-active-filters[hidden] { display: none; }
.active-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--blue-light);
  color: var(--color-primary);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 9999px;
  padding: 0.4rem 0.4rem 0.4rem 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.active-filter-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.18);
  font-size: 1.4rem;
  margin-left: 0.2rem;
}
.active-filter-pill:hover { background: rgba(37, 99, 235, 0.18); }
.active-filter-clearall {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.3rem;
  padding: 0.4rem 0.8rem;
  font-family: inherit;
}
.active-filter-clearall:hover { color: var(--color-primary); }

/* Result count */
.discover-result-bar {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: #64748b;
  font-weight: 600;
}
.discover-result-count { color: #0f172a; }

/* Empty state for Discover */
.discover-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 1.6rem;
  margin-bottom: 1.6rem;
}
.discover-empty svg { width: 4.8rem; height: 4.8rem; color: #cbd5e1; margin-bottom: 1.2rem; }
.discover-empty h3 { font-size: 1.6rem; color: #0f172a; margin: 0 0 0.4rem; }
.discover-empty p  { font-size: 1.3rem; color: #64748b; margin: 0 0 1.6rem; }

/* Mobile toolbar — stack search above sort, scrollable category chips */
@media (max-width: 768px) {
  .discover-toolbar { flex-direction: column; gap: 0.8rem; }
  .discover-sort-wrap { align-self: stretch; justify-content: space-between; }
  .discover-cat-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0.4rem;
    margin: 0 -1.6rem;
    padding-left: 1.6rem;
    padding-right: 1.6rem;
  }
  .discover-cat-row::-webkit-scrollbar { display: none; }
  .cat-chip-more { margin-left: 0; }
  .discover-advanced { padding: 1.4rem; }
  .adv-group { min-width: 100%; }
  .adv-reset { margin-left: 0; width: 100%; }
}

/* ════════════════════════════════════════════════════════════
   Redesign v2 — dark navy hero, horizontal stats
   ════════════════════════════════════════════════════════════ */

/* Hide the old guest hero just in case any markup remains */
.guest-hero.guest-only { display: none !important; }

/* Hero v2 — dark navy slab with horizontal stats below the CTA */
.guest-hero-v2 {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(80rem 40rem at 85% -10%, rgba(37, 99, 235, 0.32), transparent 60%),
    radial-gradient(60rem 30rem at -10% 110%, rgba(96, 165, 250, 0.18), transparent 65%),
    linear-gradient(160deg, #0b1220 0%, #0f172a 55%, #111d33 100%);
  color: #fff;
  border-radius: 2rem;
  padding: 3.6rem 3.2rem 2.8rem;
  margin-bottom: 2.4rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
}
.guest-hero-v2-inner { position: relative; z-index: 1; max-width: 76rem; }

.guest-hero-v2-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(219, 234, 254, 0.92);
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.32);
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  margin-bottom: 1.4rem;
}
.hero-eyebrow-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.32);
  animation: heroEyePulse 2.6s ease-in-out infinite;
}
@keyframes heroEyePulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.05); }
}

.guest-hero-v2 h1 {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: #fff;
}
.hero-accent {
  color: #93c5fd;
  background: linear-gradient(120deg, #93c5fd, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.guest-hero-v2 p {
  font-size: 1.4rem;
  line-height: 1.55;
  color: rgba(241, 245, 249, 0.85);
  margin: 0 0 2rem;
  max-width: 56rem;
}

.guest-hero-v2-cta-row {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
  margin-bottom: 2.8rem;
}
.hero-primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1.4rem;
  padding: 1.15rem 2rem;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  font-family: inherit;
  min-height: 4.8rem;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.32);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.hero-primary-btn svg { width: 1.6rem; height: 1.6rem; }
.hero-primary-btn:hover { background: var(--color-primary-dark); transform: translateY(-1px); box-shadow: 0 14px 32px rgba(37, 99, 235, 0.42); }
.hero-primary-btn:active { transform: translateY(0); }

.hero-text-link {
  color: rgba(219, 234, 254, 0.9);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.3rem;
  transition: color 0.15s;
  padding: 0.6rem 0.4rem;
  min-height: 4.4rem;
  display: inline-flex;
  align-items: center;
}
.hero-text-link:hover { color: #fff; }

/* Horizontal stats grid inside hero */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.6rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
}
.hero-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 1rem;
  background: rgba(37, 99, 235, 0.16);
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}
.hero-stat-icon-accent {
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
}
.hero-stat-icon svg { width: 1.8rem; height: 1.8rem; }
.hero-stat strong {
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.hero-stat-label {
  font-size: 1.2rem;
  color: rgba(203, 213, 225, 0.78);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .guest-hero-v2 { padding: 2.6rem 2rem 2.2rem; border-radius: 1.4rem; }
  .guest-hero-v2 h1 { font-size: 2.4rem; }
  .guest-hero-v2 p { font-size: 1.3rem; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; padding-top: 1.6rem; }
  .hero-stat strong { font-size: 2rem; }
}

/* ════════════════════════════════════════════════════════════
   Guest unified header + mobile drawer
   ════════════════════════════════════════════════════════════ */

/* For guests: hide the legacy sidebar + the legacy nav-user/links
   (the new .site-header replaces them entirely).
   The .layout flex collapses cleanly because aside is removed from flow. */
body.is-guest .sidebar,
body.is-guest .mobile-overlay { display: none !important; }
body.is-guest .layout .main-content { padding-top: 2.4rem; }

/* Guest mode also needs no margin where the sidebar used to sit */
body.is-guest .layout { display: block; }
body.is-guest .main-content { max-width: 124rem; margin: 0 auto; padding: 2.4rem; }
@media (max-width: 768px) {
  body.is-guest .main-content { padding: 1.6rem 1.6rem 8rem; }
}

/* The new guest-only header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}
.site-header-inner {
  max-width: 128rem;
  margin: 0 auto;
  padding: 0 2.4rem;
  height: 6.8rem;
  display: flex;
  align-items: center;
  gap: 2.4rem;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  flex-shrink: 0;
}
.site-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.8rem;
  height: 3.8rem;
  background: #fff;
  border: 1.5px solid rgba(37, 99, 235, 0.28);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.18);
  border-radius: 50%;
}
.site-brand-mark img { width: 2.4rem; height: 2.4rem; }
.site-brand-name {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--color-text-navy);
  letter-spacing: -0.01em;
}

.site-header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}
.site-nav-link {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 600;
  padding: 0.9rem 1.4rem;
  border-radius: 9999px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  min-height: 4rem;
  display: inline-flex;
  align-items: center;
}
/* Hover/active blend into the frosted nav bar — no filled pill,
   just a subtle background tint + color shift so the links feel
   like part of the nav surface, not separate buttons. */
.site-nav-link:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--color-text-navy);
}
.site-nav-link.is-active {
  background: transparent;
  color: var(--color-text-navy);
  font-weight: 700;
  position: relative;
}
.site-nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 1.4rem;
  right: 1.4rem;
  bottom: -1.7rem;
  height: 0.3rem;
  background: var(--color-primary);
  border-radius: 0.3rem 0.3rem 0 0;
}

.site-header-auth {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
}
.site-auth-link {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.35rem;
  padding: 0.9rem 1.4rem;
  border-radius: 9999px;
  min-height: 4.4rem;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s;
}
.site-auth-link:hover { background: var(--color-bg-deep); }
.site-auth-btn {
  display: inline-flex;
  align-items: center;
  background: var(--color-text-navy);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.35rem;
  padding: 0.9rem 1.8rem;
  border-radius: 9999px;
  min-height: 4.4rem;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}
.site-auth-btn:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.site-header-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 4.4rem;
  height: 4.4rem;
  background: transparent;
  border: none;
  color: var(--color-text-navy);
  border-radius: 1rem;
  cursor: pointer;
  margin-left: auto;
  transition: background 0.15s;
  flex-shrink: 0;
}
.site-header-burger:hover { background: var(--color-bg-deep); }

/* Auth header right-side: avatar + name + role pill. Clicking it goes Home. */
.site-header-user {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 0.4rem 1.2rem 0.4rem 0.4rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9999px;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.site-header-user:hover {
  background: var(--color-bg-deep);
  border-color: var(--color-border);
}
.site-header-user:active { transform: scale(0.98); }
.site-header-user img {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
}
.site-header-user-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  gap: 0.1rem;
}
.site-header-user-text strong {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text-navy);
}
.site-header-user-role {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* Role text is driven by body class so PHP just sets <body class="... role-X">. */
body.role-donor .site-header-user-role::before { content: "Donor"; }
body.role-taker .site-header-user-role::before { content: "Beneficiary"; }
body.role-org   .site-header-user-role::before { content: "Organisation"; }

/* ── Variant: profile chip on the left, nav pinned to the right (userhome only) ── */
/* Drop the centered max-width so the chip lines up with the sidebar logo below.
   Sidebar logo circle center sits at x = 2rem (sidebar-brand padding) + 2.6rem
   (half of 5.2rem circle) = 4.6rem. Chip avatar (4rem) center sits at
   inner padding-left + 0.4rem (chip padding) + 2rem. Solve for 4.6 → 2.2rem. */
.site-header--user-lead .site-header-inner {
  max-width: none;
  padding-left: 2.2rem;
  padding-right: 2.4rem;
}
.site-header--user-lead .site-header-user {
  margin-right: auto;            /* keep nav links pushed to the right */
  padding: 0.4rem 1.4rem 0.4rem 0.4rem;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.6);
}
.site-header--user-lead .site-header-user:hover {
  background: var(--white, #fff);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.12);
}
.site-header--user-lead .site-header-user img {
  width: 4rem;
  height: 4rem;
  border-color: rgba(37, 99, 235, 0.25);
}
.site-header--user-lead .site-header-nav {
  flex: 0 0 auto;                /* don't stretch — sit on the right */
  justify-content: flex-end;
  margin-left: auto;
}

/* Slide-out drawer (mobile guest menu) */
.guest-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.guest-drawer-backdrop.is-open { opacity: 1; }

.guest-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86vw, 34rem);
  background: #fff;
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 2rem 2rem 2.4rem;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -16px 0 40px rgba(15, 23, 42, 0.18);
}
.guest-drawer.is-open { transform: translateX(0); }

.guest-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--color-border);
}
.guest-drawer-close {
  width: 4.4rem;
  height: 4.4rem;
  background: var(--color-bg-deep);
  border: none;
  border-radius: 50%;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
}
.guest-drawer-close:hover { background: var(--color-border); color: var(--color-text); }

.guest-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1.4rem;
  flex: 1;
}
.guest-drawer-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: transparent;
  border: none;
  text-align: left;
  text-decoration: none;
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-text);
  padding: 1.2rem 1.4rem;
  border-radius: 1rem;
  cursor: pointer;
  min-height: 4.8rem;
  transition: background 0.15s, color 0.15s;
}
.guest-drawer-link svg { width: 2rem; height: 2rem; color: var(--color-text-muted); flex-shrink: 0; }
.guest-drawer-link:hover { background: var(--color-bg-deep); }
.guest-drawer-link.is-active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}
.guest-drawer-link.is-active svg { color: var(--color-primary); }

.guest-drawer-auth {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--color-border);
  margin-top: 1rem;
}
.guest-drawer-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.4rem;
  padding: 1.2rem 1.6rem;
  border-radius: 9999px;
  min-height: 4.8rem;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}
.guest-drawer-cta svg { width: 1.6rem; height: 1.6rem; }
.guest-drawer-cta:hover { background: var(--color-primary-dark); }
.guest-drawer-link-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.3rem;
  padding: 0.9rem;
  min-height: 4.4rem;
}
.guest-drawer-link-secondary:hover { color: var(--color-primary-dark); }

/* Mobile: collapse desktop centred nav, keep brand + auth/user compact.
   Hamburger is intentionally removed on mobile — the bottom-nav handles
   primary navigation, and the profile widget opens the account drawer. */
.site-brand-mobile { display: none; }

@media (max-width: 900px) {
  .site-header-nav { display: none; }
  .site-header-burger { display: none !important; }

  .site-header-inner { padding: 0 1.6rem; height: 5.8rem; gap: 1rem; }
  /* Keep the user-lead chip aligned with the sidebar/drawer logo (x = 2.2rem) */
  .site-header--user-lead .site-header-inner { padding-left: 2.2rem; padding-right: 1.6rem; }

  /* Auth: show brand on left, user widget on right */
  .site-header.auth-only .site-brand-mobile { display: inline-flex; }
  .site-header.auth-only .site-header-user { margin-left: auto; }

  /* User-lead variant: chip stays on the LEFT on mobile.
     4-class compound selector outranks .site-header.auth-only .site-header-user. */
  .site-header.site-header--user-lead.auth-only .site-header-user { margin-left: 0; margin-right: auto; }

  /* Guest: compact the auth pair so both fit comfortably on narrow screens */
  .site-header.guest-only .site-header-auth {
    margin-left: auto;
    gap: 0.4rem;
  }
  .site-header.guest-only .site-auth-link {
    padding: 0.6rem 1rem;
    font-size: 1.25rem;
    min-height: 4rem;
  }
  .site-header.guest-only .site-auth-btn {
    padding: 0.7rem 1.3rem;
    font-size: 1.25rem;
    min-height: 4rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
  }
  .site-header.guest-only .site-brand-name { font-size: 1.55rem; }
  .site-header.guest-only .site-brand-mark { width: 3.4rem; height: 3.4rem; }

  /* Mobile: drop the "Account" label in the sidebar (the top-nav user widget already shows identity) */
  body.is-auth .sidebar-section-label.auth-only { display: none; }
  body.is-auth .sidebar-auth-section { border-top: none; padding-top: 0.4rem; }
}
@media (max-width: 480px) {
  /* Very narrow: keep avatar but drop the name/role text to save room */
  .site-header.auth-only .site-header-user-text { display: none; }
  .site-header.auth-only .site-header-user { padding: 0.4rem; }
  /* On very small screens, drop the "Log In" text — the Sign Up Free pill is enough */
  .site-header.guest-only .site-auth-link { display: none; }
  .site-header.guest-only .site-brand-name { display: none; }
}

/* ════════════════════════════════════════════════════════════
   Sticky search/filter bar for guest mode (Discover section)
   ════════════════════════════════════════════════════════════ */
body.is-guest #discover .discover-toolbar {
  position: sticky;
  top: 6.8rem;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem 0;
  margin: -1rem 0 1.4rem;
  border-bottom: 1px solid var(--color-border);
}
body.is-guest #discover .discover-filters {
  position: sticky;
  top: calc(6.8rem + 6.4rem);
  z-index: 29;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding-top: 0.6rem;
  margin-top: -0.4rem;
}

@media (max-width: 768px) {
  body.is-guest #discover .discover-toolbar { top: 5.6rem; padding: 0.8rem 0; }
  body.is-guest #discover .discover-filters { top: calc(5.6rem + 9rem); }
}

/* ════════════════════════════════════════════════════════════
   Campaign card v2 — location, creator, time, prominent progress
   ════════════════════════════════════════════════════════════ */

/* Location badge in card media area */
.camp-location-badge {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 9999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2;
}
.camp-location-badge svg { width: 1.2rem; height: 1.2rem; }

/* Creator row — sits between title and description */
.camp-creator-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.4rem 0 0.6rem;
}
.camp-creator-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 700;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.camp-creator-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-muted);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.camp-verified-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  color: var(--color-primary);
  flex-shrink: 0;
}
.camp-verified-badge > svg:first-child {
  width: 1.8rem;
  height: 1.8rem;
}
.camp-verified-tick {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.9rem !important;
  height: 0.9rem !important;
  color: #fff;
}

/* Days remaining pill in card footer */
.camp-days-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-bg-deep);
  color: var(--color-text-muted);
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  white-space: nowrap;
}
.camp-days-pill svg { width: 1.2rem; height: 1.2rem; }
.camp-days-pill.is-urgent {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

/* Percentage chip floating on the progress bar */
.camp-card .progress-bar { position: relative; height: 1rem !important; }
.progress-pct-chip {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  transform: translateY(-50%);
  background: var(--color-surface);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-primary-light);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
/* Hide the inline % since it's now on the chip */
.camp-card .camp-pct { display: none; }

/* Layout: make card footer wrap on small space, keep button right */
.camp-card-footer {
  flex-wrap: wrap;
  gap: 0.6rem;
}
.camp-card-footer .camp-days-pill { margin-right: auto; }
.camp-card-footer .camp-donor-count { font-weight: 600; }

/* ════════════════════════════════════════════════════════════
   Two-column row (activity + trust)
   ════════════════════════════════════════════════════════════ */
.dash-two-col {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1.8rem;
  margin-top: 2rem;
}
@media (max-width: 900px) { .dash-two-col { grid-template-columns: 1fr; } }

/* Live activity feed */
.activity-card .dash-card-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.live-dot {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  animation: livePulse 1.8s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  50%      { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}
.activity-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 42rem;
  overflow-y: auto;
}
.activity-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 1rem;
  transition: background 0.15s;
}
.activity-row:hover { background: #f8fafc; }
.activity-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 700;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.activity-avatar-anon { background: #f1f5f9; color: #94a3b8; }
.activity-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 1.3rem;
  color: #0f172a;
  line-height: 1.45;
  min-width: 0;
}
.activity-text strong { font-weight: 600; }
.activity-amount { color: var(--color-success-dark); font-weight: 700; }
.activity-meta {
  font-size: 1.15rem;
  color: #64748b;
  font-weight: 500;
}

/* Trust / Why families trust Sawa */
.trust-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.trust-item {
  display: grid;
  grid-template-columns: 3.6rem 1fr;
  gap: 1rem;
  align-items: flex-start;
}
.trust-icon {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.trust-icon svg { width: 1.8rem; height: 1.8rem; }
.trust-icon-green  { background: rgba(34, 197, 94, 0.14); color: #16a34a; }
.trust-icon-blue   { background: rgba(37, 99, 235, 0.14); color: var(--color-primary); }
.trust-icon-purple { background: rgba(124, 58, 237, 0.14); color: #7c3aed; }
.trust-icon-amber  { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.trust-item strong { display: block; font-size: 1.35rem; font-weight: 700; color: #0f172a; margin-bottom: 0.2rem; }
.trust-item small  { font-size: 1.2rem; color: #64748b; line-height: 1.45; }

.trust-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.4rem;
  border-top: 1px solid #f1f5f9;
}
.trust-stats > div { text-align: center; }
.trust-stats strong { display: block; font-size: 1.8rem; font-weight: 800; color: var(--color-primary-dark); }
.trust-stats span   { font-size: 1.1rem; color: #64748b; }

/* ════════════════════════════════════════════════════════════
   Site footer (guest-only marketing footer)
   ════════════════════════════════════════════════════════════ */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  margin-top: 4rem;
  padding: 4rem 2rem 2rem;
}
.site-footer-inner {
  max-width: 128rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: 3rem 2.4rem;
}
.site-footer .site-brand-name { color: #fff; }
.site-footer .site-brand-mark {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(96, 165, 250, 0.36);
  box-shadow: none;
}
.site-footer-mission {
  font-size: 1.3rem;
  line-height: 1.55;
  color: rgba(203, 213, 225, 0.78);
  margin: 1.2rem 0 1.6rem;
  max-width: 32rem;
}
.site-footer-social {
  display: flex;
  gap: 0.8rem;
}
.site-footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(203, 213, 225, 0.78);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.site-footer-social a:hover { background: var(--color-primary); color: #fff; transform: translateY(-2px); }
.site-footer-social svg { width: 1.6rem; height: 1.6rem; }

.site-footer-col h4 {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  margin: 0 0 1.2rem;
}
.site-footer-col a,
.site-footer-col button,
.site-footer-col .site-footer-meta {
  display: block;
  background: none;
  border: none;
  padding: 0.4rem 0;
  font-family: inherit;
  font-size: 1.25rem;
  color: rgba(203, 213, 225, 0.78);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s;
}
.site-footer-col a:hover,
.site-footer-col button:hover { color: var(--color-primary-light); }
.site-footer-col .site-footer-meta { cursor: default; color: rgba(148, 163, 184, 0.7); }

.site-footer-bottom {
  max-width: 128rem;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1.15rem;
  color: rgba(148, 163, 184, 0.7);
}
.site-footer-bottom p { margin: 0; }
.site-footer-trust {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.site-footer-trust svg { width: 1.4rem; height: 1.4rem; color: var(--color-primary-light); }

@media (max-width: 900px) {
  .site-footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .site-footer { padding: 3rem 1.6rem 1.6rem; }
  .site-footer-inner { grid-template-columns: 1fr; gap: 2.4rem; }
  .site-footer-bottom { justify-content: flex-start; }
}

/* ════════════════════════════════════════════════════════════
   Guest "sign in to unlock" banner
   ════════════════════════════════════════════════════════════ */
.guest-unlock {
  margin-top: 2rem;
  padding: 2.4rem;
  border-radius: 1.6rem;
  background:
    radial-gradient(40rem 24rem at 100% 0%, rgba(37, 99, 235, 0.12), transparent 60%),
    linear-gradient(135deg, #fff 0%, var(--color-primary-light) 100%);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.guest-unlock-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-dark);
  background: rgba(37, 99, 235, 0.1);
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
}
.guest-unlock-eyebrow svg { width: 1.2rem; height: 1.2rem; }
.guest-unlock h3 {
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.6rem;
  line-height: 1.25;
}
.guest-unlock p {
  font-size: 1.35rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0 0 1.6rem;
  max-width: 64rem;
}
.guest-unlock-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.guest-unlock-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 1rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.guest-unlock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.8rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  flex-shrink: 0;
}
.guest-unlock-icon svg { width: 1.6rem; height: 1.6rem; }
.guest-unlock-list strong { display: block; font-size: 1.3rem; font-weight: 700; color: #0f172a; margin-bottom: 0.1rem; }
.guest-unlock-list small  { font-size: 1.15rem; color: var(--color-text-muted); line-height: 1.4; }
.guest-unlock-cta-row {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.guest-unlock-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.4rem;
  padding: 1.1rem 2rem;
  border-radius: 9999px;
  min-height: 4.8rem;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.3);
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}
.guest-unlock-cta svg { width: 1.6rem; height: 1.6rem; }
.guest-unlock-cta:hover { background: var(--color-primary-dark); transform: translateY(-1px); box-shadow: 0 14px 28px rgba(37, 99, 235, 0.4); }
.guest-unlock-link {
  color: var(--color-text-muted);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.8rem 0.4rem;
  min-height: 4.4rem;
  display: inline-flex;
  align-items: center;
}
.guest-unlock-link:hover { color: var(--color-primary-dark); }

@media (max-width: 768px) {
  .guest-unlock { padding: 1.8rem; }
  .guest-unlock h3 { font-size: 1.7rem; }
  .guest-unlock-list { grid-template-columns: 1fr; }
  .guest-unlock-cta-row { flex-direction: column; align-items: stretch; }
  .guest-unlock-cta { width: 100%; }
  .guest-unlock-link { justify-content: center; }
}

/* ════════════════════════════════════════════════════════════
   Fix 4: Mobile responsive — campaign grid + Featured cards
   stack cleanly, kill any horizontal overflow / overlap
   ════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Discover grid: single column with proper gap to prevent overlap */
  body.is-guest #discover .campaign-grid,
  #discover .campaign-grid {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }
  /* Featured-campaigns side card: stack thumb + body, center align */
  .featured-camp {
    grid-template-columns: 6rem 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  .featured-camp-thumb { width: 6rem; height: 6rem; }
  .featured-camp-thumb svg { width: 2.6rem; height: 2.6rem; }
  /* Guest feature grid stacks */
  .guest-feature-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  /* Prevent main-content from overflowing the viewport */
  body.is-guest .main-content { padding: 1.6rem; }
  /* Ensure card content is contained */
  .camp-card { width: 100%; overflow: hidden; }
  .camp-card-content { padding: 1.4rem; }
  /* Activity rows: tighter spacing */
  .activity-row { padding: 0.8rem; gap: 0.8rem; }
  .activity-avatar { width: 3rem; height: 3rem; font-size: 1.2rem; }
  .activity-text { font-size: 1.2rem; }
  .activity-meta { font-size: 1.05rem; }
}

/* ════════════════════════════════════════════════════════════
   Unified mobile-style layout (applies at ALL viewport widths):
   - Sidebar is a slide-in drawer opened via the profile chip
   - Bottom nav is always visible as primary navigation
   - Main content is centered with comfortable max-width
   ════════════════════════════════════════════════════════════ */

/* Kill the desktop expand/collapse toggle entirely */
.sidebar-toggle { display: none !important; }
.sidebar.collapsed { width: 28rem; }
.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .sidebar-item span,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-user-chevron { display: initial; }

/* Sidebar = fixed slide-in drawer at every width (no longer occupies layout flow) */
.layout { display: block; }

.sidebar {
  position: fixed;
  top: 5.8rem;
  left: 0;
  bottom: 0;
  z-index: 30;
  width: 28rem;
  margin-right: 0;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
  border-radius: 0 1.6rem 1.6rem 0;
}
.sidebar.open { transform: translateX(0); }

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 25;
}
.mobile-overlay.show { display: block; }

/* Bottom nav: visible at all widths (auth users only — guests use site header) */
body.is-auth .bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 100;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.8rem env(safe-area-inset-bottom, 0.4rem);
}

/* Bottom-nav items — were previously only styled inside the mobile media query */
body.is-auth .bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  font-family: 'Poppins', Arial, sans-serif;
  font-weight: 500;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
  flex: 1;
  min-width: 0;
}
body.is-auth .bottom-nav-item svg {
  width: 2.2rem;
  height: 2.2rem;
  flex-shrink: 0;
}
body.is-auth .bottom-nav-item span {
  font-size: 1rem;
  white-space: nowrap;
}
body.is-auth .bottom-nav-item:active,
body.is-auth .bottom-nav-item.pressed {
  color: var(--blue);
  background: var(--blue-light);
  border-radius: var(--radius-sm);
}
body.is-auth .bottom-nav-item.active {
  color: var(--blue);
  position: relative;
}
body.is-auth .bottom-nav-item.active::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2.4rem;
  height: 0.3rem;
  border-radius: 3px 3px 0 0;
  background: var(--blue);
}

/* FAB-style centre button */
body.is-auth .bottom-nav-fab {
  width: 4.8rem;
  height: 4.8rem;
  min-width: 4.8rem;
  background: var(--blue);
  color: #fff !important;
  border-radius: 50%;
  flex: 0 0 4.8rem;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  margin-top: -1.6rem;
  padding: 0;
}
body.is-auth .bottom-nav-fab svg {
  width: 2.6rem;
  height: 2.6rem;
}
body.is-auth .bottom-nav-fab.active {
  background: var(--blue-dark);
  color: #fff;
}

/* On wider screens, cap the bottom nav width and center it so items
   don't get spread across a huge viewport */
@media (min-width: 769px) {
  body.is-auth .bottom-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(56rem, calc(100% - 3.2rem));
    bottom: 1.6rem;
    border-radius: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  }
}

/* Centered main content with breathing room on the sides */
body.is-auth .main-content {
  max-width: 124rem;
  margin: 0 auto;
  padding: 2.4rem;
  padding-bottom: 8rem; /* clear the fixed bottom nav */
}

@media (max-width: 640px) {
  body.is-auth .main-content { padding: 1.6rem 1.6rem 8rem; }
}
