/* ============================================
   RUHULFA Foundation - Main Stylesheet
   Palette: Forest Green #1a4d2e, Gold #c9971c,
   Cream #f9f6ef, Deep Charcoal #1c1c1c
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --green-deep:   #1a4d2e;
  --green-mid:    #2d6a4f;
  --green-light:  #52b788;
  --gold:         #c9971c;
  --gold-light:   #e8c547;
  --cream:        #f9f6ef;
  --cream-dark:   #ede9de;
  --charcoal:     #1c1c1c;
  --gray:         #6b6b6b;
  --gray-light:   #d4d4d4;
  --white:        #ffffff;
  --danger:       #c0392b;
  --danger-light: #fdecea;
  --shadow-sm:    0 2px 8px rgba(26,77,46,0.10);
  --shadow-md:    0 6px 24px rgba(26,77,46,0.14);
  --shadow-lg:    0 12px 48px rgba(26,77,46,0.18);
  --radius:       12px;
  --radius-sm:    6px;
  --transition:   0.25s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.65;
  min-height: 100vh;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 { font-family: 'Playfair Display', serif; line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }
a { color: var(--green-mid); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

/* ── NAVBAR ── */
.navbar {
  background: var(--green-deep);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  gap: 1rem;
}
.nav-brand {
  display: flex; align-items: center; gap: 0.75rem;
  color: var(--white); font-family: 'Playfair Display', serif;
  font-size: 1.3rem; font-weight: 700; white-space: nowrap;
}
.nav-brand img { height: 44px; width: auto; border-radius: 4px; }
.nav-brand span em { color: var(--gold-light); font-style: normal; }
.nav-links { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.nav-links a {
  color: rgba(255,255,255,0.82);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}
.nav-links a.btn-gold {
  background: var(--gold); color: var(--white);
  font-weight: 600;
}
.nav-links a.btn-gold:hover { background: var(--gold-light); }
.nav-link-icon { margin-right: 0.4rem; display: inline-block; }

/* ── HAMBURGER BUTTON ── */
.nav-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: 6px; border-radius: 8px;
  transition: background var(--transition);
}
.nav-toggle:hover { background: rgba(255,255,255,0.1); }
.nav-toggle .bar {
  display: block; width: 22px; height: 2px;
  background: var(--white); border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}
.nav-toggle .bar + .bar { margin-top: 5px; }

/* Open state: animate to X */
.nav-toggle.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .bar:nth-child(2) { opacity: 0; width: 0; }
.nav-toggle.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE: bottom-sheet drawer ── */
@media (max-width: 700px) {
  .navbar { position: relative; z-index: 200; }
  .nav-toggle { display: flex; flex-direction: column; align-items: center; justify-content: center; }

  /* Backdrop */
  .nav-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(13,58,34,0.55);
    backdrop-filter: blur(2px);
    z-index: 190;
    animation: fadeIn 0.2s ease;
  }
  .nav-backdrop.open { display: block; }

  /* Drawer — cream background matches the brand instead of stark white */
  .nav-links {
    display: flex !important; /* always in DOM for animation */
    flex-direction: column;
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 195;
    background: var(--cream);
    border-radius: 24px 24px 0 0;
    padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
    box-shadow: 0 -12px 48px rgba(13,58,34,0.28);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32,0.72,0,1);
    overflow-y: auto;
    max-height: 85vh;
    border-top: 1px solid var(--cream-dark);
  }
  .nav-links.open {
    transform: translateY(0);
  }

  /* Drag handle */
  .nav-links::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: var(--gray-light);
    border-radius: 2px;
    margin: 14px auto 8px;
    flex-shrink: 0;
  }

  /* Nav items in drawer — icon badge + label, card-like on tap */
  .nav-links a {
    display: flex; align-items: center; gap: 0.9rem;
    margin: 0.15rem 0.75rem;
    padding: 0.8rem 0.9rem;
    color: var(--charcoal) !important;
    font-size: 0.95rem; font-weight: 600;
    border-radius: 14px; background: var(--white) !important;
    border: 1px solid var(--cream-dark);
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
  }
  .nav-links a:active { transform: scale(0.98); }
  .nav-links a:hover, .nav-links a.active {
    background: var(--white) !important;
    color: var(--green-deep) !important;
    border-color: var(--green-light);
  }
  .nav-links a.active {
    background: linear-gradient(150deg, var(--green-deep), var(--green-mid)) !important;
    color: var(--white) !important;
    font-weight: 700;
    border-color: transparent;
  }
  .nav-link-icon {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem; margin-right: 0;
    background: var(--cream);
    transition: background 0.15s;
  }
  .nav-links a.active .nav-link-icon { background: rgba(255,255,255,0.2); }
  .nav-links a.btn-gold .nav-link-icon { background: rgba(255,255,255,0.22); }
  .nav-links a.btn-gold {
    margin: 0.6rem 0.75rem 0.15rem;
    border-radius: 14px !important;
    background: linear-gradient(150deg, var(--gold), var(--gold-light)) !important;
    color: var(--white) !important;
    justify-content: center;
    font-weight: 700; border: none;
    padding: 0.9rem;
    box-shadow: 0 4px 14px rgba(201,151,28,0.3);
  }
  .nav-links a.btn-gold:hover { filter: brightness(1.05); }

  /* Nav badge sits naturally inline now instead of absolutely positioned */
  .nav-links .nav-badge { position: static; margin-left: auto; }
}

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

/* ── HERO ── */
.hero {
  background: linear-gradient(150deg, #0d3a22 0%, var(--green-deep) 45%, var(--green-mid) 100%);
  color: var(--white);
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  position: relative; overflow: hidden;
  isolation: isolate; /* guarantees this section is its own stacking context */
  height: auto; min-height: 0; /* defensive: never let this section inherit stretch */
}
.hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero::after {
  content: '';
  position: absolute; left: 50%; top: 20%; z-index: 0;
  width: 900px; height: 900px; max-width: 220vw; max-height: 220vw;
  transform: translate(-50%, 0);
  background: radial-gradient(ellipse at center, rgba(201,151,28,0.16) 0%, transparent 65%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-logo { width: 92px; height: auto; margin-bottom: 1.25rem; filter: drop-shadow(0 6px 20px rgba(0,0,0,0.35)); border-radius: 14px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.5rem); margin-bottom: 0.5rem; text-shadow: 0 2px 10px rgba(0,0,0,0.25); letter-spacing: -0.01em; }
.hero h1 span { color: var(--gold-light); }
.hero p { font-size: 1.05rem; opacity: 0.85; margin-top: 0.4rem; font-style: italic; }

/* ── Stat cards: self-contained glass tiles, never bare text on gradient ──
   NOTE: intentionally flexbox, not CSS Grid. Safari has a documented bug
   where backdrop-filter on grid *items* makes Safari miscompute the grid's
   implicit row track sizing, reserving large phantom empty space below
   the last row. Flexbox does not have this bug and wraps identically. */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: center;
  gap: 0.75rem;
  max-width: 640px;
  margin: 2.25rem auto 0;
}
.hero-stat {
  flex: 1 1 108px;
  max-width: 160px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 1rem 0.75rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.2s;
  position: relative; overflow: hidden;
}
.hero-stat:hover { background: rgba(255,255,255,0.13); transform: translateY(-2px); }
.hero-stat.hero-stat-primary {
  background: linear-gradient(150deg, rgba(201,151,28,0.22), rgba(201,151,28,0.08));
  border-color: rgba(201,151,28,0.35);
}
.hero-stat .num {
  font-family: 'Playfair Display', serif; font-size: 1.9rem; font-weight: 700;
  color: var(--gold-light); line-height: 1.1;
}
.hero-stat .lbl {
  font-size: 0.68rem; opacity: 0.8; text-transform: uppercase;
  letter-spacing: 0.07em; margin-top: 0.3rem; display: block;
}

/* ── PAGE WRAPPER ── */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; color: var(--green-deep);
  margin-bottom: 1.5rem; padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--cream-dark);
  display: flex; align-items: center; gap: 0.6rem;
}
.section-title .icon { font-size: 1.3rem; }

/* ── CARDS ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--cream-dark);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: 1.5rem; }

/* Member card grid */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.25rem;
}
.member-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--cream-dark);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
}
.member-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.member-card-header {
  background: linear-gradient(120deg, var(--green-deep), var(--green-mid));
  padding: 1.25rem 1.25rem 1rem;
  display: flex; align-items: center; gap: 1rem;
}
.member-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; font-weight: 700; color: var(--white);
  border: 2px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
  overflow: hidden;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-card-name { color: var(--white); }
.member-card-name h3 { font-size: 1.05rem; font-weight: 600; }
.member-card-name .gen-code {
  font-size: 0.75rem; opacity: 0.75;
  font-family: 'Inter', sans-serif; font-weight: 400;
  letter-spacing: 0.04em;
}
.member-card-body { padding: 1rem 1.25rem; }
.member-info-row {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.875rem; color: var(--gray);
  margin-bottom: 0.45rem;
}
.member-info-row .mi-icon { color: var(--green-mid); font-size: 0.9rem; width: 16px; }
.member-info-row a { color: var(--green-mid); font-weight: 500; }
.gen-badge {
  display: inline-block;
  background: var(--cream-dark);
  color: var(--green-deep);
  font-size: 0.72rem; font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.member-card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--cream-dark);
  display: flex; gap: 0.5rem;
}

/* ── GENERATION SECTION ── */
.gen-section { margin-bottom: 2.5rem; }
.gen-heading {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.gen-pill {
  background: var(--green-deep); color: var(--white);
  font-size: 0.78rem; font-weight: 700;
  padding: 0.3rem 0.8rem; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.gen-heading h2 {
  font-size: 1.3rem; color: var(--green-deep);
  border-left: 3px solid var(--gold);
  padding-left: 0.75rem;
}
.gen-count { color: var(--gray); font-size: 0.875rem; font-family: 'Inter', sans-serif; }

/* ── TREE VIEW ── */
.tree-wrap { overflow-x: auto; padding-bottom: 1rem; }
.tree-node { position: relative; }
.tree-node ul {
  list-style: none;
  margin-left: 2rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--green-light);
}
.tree-node ul li { position: relative; padding: 0.3rem 0; }
.tree-node ul li::before {
  content: '';
  position: absolute; left: -1.25rem; top: 1rem;
  width: 1rem; height: 2px;
  background: var(--green-light);
}
.tree-item {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: var(--white); border: 1px solid var(--cream-dark);
  padding: 0.45rem 0.9rem; border-radius: 8px;
  font-size: 0.875rem; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: default;
}
.tree-item:hover { box-shadow: var(--shadow-md); transform: translateX(3px); }
.tree-item.root-node {
  background: var(--green-deep); color: var(--white);
  font-weight: 600; font-size: 1rem;
  padding: 0.6rem 1.2rem;
}
.tree-item .t-code { font-size: 0.72rem; color: var(--gold); font-weight: 600; }
.tree-item.root-node .t-code { color: var(--gold-light); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1.1rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600; font-family: 'Inter', sans-serif;
  cursor: pointer; border: none; transition: all var(--transition);
  text-decoration: none; line-height: 1.3;
}
.btn-primary { background: var(--green-deep); color: var(--white); }
.btn-primary:hover { background: var(--green-mid); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: #b5841a; color: var(--white); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--green-deep); border: 1.5px solid var(--green-deep); }
.btn-outline:hover { background: var(--green-deep); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #a93226; color: var(--white); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-icon { padding: 0.4rem; border-radius: var(--radius-sm); }

/* ── FORMS ── */
.form-wrap {
  background: var(--white); border-radius: var(--radius);
  padding: 2rem; box-shadow: var(--shadow-sm);
  border: 1px solid var(--cream-dark);
  max-width: 680px;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-size: 0.875rem; font-weight: 600;
  color: var(--green-deep); margin-bottom: 0.4rem;
}
.form-group label .req { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-size: 0.9rem; font-family: 'Inter', sans-serif;
  color: var(--charcoal); background: var(--cream);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(45,106,79,0.12);
  background: var(--white);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }
.form-hint { font-size: 0.78rem; color: var(--gray); margin-top: 0.3rem; }

/* ── ALERTS ── */
.alert {
  padding: 0.85rem 1.1rem; border-radius: var(--radius-sm);
  margin-bottom: 1.25rem; font-size: 0.9rem;
  display: flex; align-items: flex-start; gap: 0.6rem;
  border-left: 4px solid;
}
.alert-success { background: #eaf7ee; border-color: #27ae60; color: #1e7e34; }
.alert-error   { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }
.alert-info    { background: #f0f7f2; border-color: var(--green-mid); color: var(--green-deep); }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; background: var(--white); font-size: 0.875rem; }
thead th {
  background: var(--green-deep); color: var(--white);
  padding: 0.85rem 1rem; text-align: left;
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600;
}
tbody tr { border-bottom: 1px solid var(--cream-dark); transition: background var(--transition); }
tbody tr:hover { background: #f3f9f5; }
tbody td { padding: 0.75rem 1rem; color: var(--charcoal); vertical-align: middle; }
tbody td:last-child { white-space: nowrap; }

/* ── SEARCH BAR ── */
.search-bar {
  display: flex; gap: 0.75rem; flex-wrap: wrap;
  margin-bottom: 1.75rem; align-items: center;
}
.search-input-wrap { position: relative; flex: 1; min-width: 220px; }
.search-input-wrap .search-icon {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  color: var(--gray); pointer-events: none; font-size: 0.9rem;
}
.search-input-wrap input {
  width: 100%; padding: 0.6rem 0.9rem 0.6rem 2.2rem;
  border: 1.5px solid var(--gray-light); border-radius: var(--radius-sm);
  font-size: 0.9rem; font-family: 'Inter', sans-serif;
  outline: none; background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input-wrap input:focus {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(45,106,79,0.10);
}
.filter-select {
  padding: 0.6rem 0.9rem; border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-sm); font-size: 0.9rem;
  font-family: 'Inter', sans-serif; background: var(--white);
  color: var(--charcoal); cursor: pointer; outline: none;
}

/* ── LOGIN ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%);
  padding: 1.5rem;
}
.login-card {
  background: var(--white); border-radius: 16px;
  padding: 2.5rem; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg); text-align: center;
}
.login-card .login-logo { height: 80px; margin-bottom: 1.25rem; border-radius: 8px; }
.login-card h2 { font-size: 1.5rem; color: var(--green-deep); margin-bottom: 0.25rem; }
.login-card p { color: var(--gray); font-size: 0.875rem; margin-bottom: 1.75rem; }

/* ── FOOTER ── */
footer {
  background: linear-gradient(150deg, var(--green-deep), #0d3a22);
  color: rgba(255,255,255,0.72);
  padding: 2.25rem 1.5rem 2rem;
  margin-top: 4rem; font-size: 0.85rem;
  border-top: 3px solid var(--gold);
}
.footer-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.footer-brand strong { color: var(--gold-light); font-family: 'Playfair Display', serif; font-size: 1.05rem; display: block; }
.footer-brand em { display: block; opacity: 0.7; font-size: 0.82rem; margin-top: 0.3rem; }
.footer-links {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.4rem; margin-top: 1.4rem;
}
.footer-links a {
  color: rgba(255,255,255,0.78);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.78rem; font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.footer-links a:hover {
  background: var(--gold); color: var(--white); border-color: var(--gold);
}

/* ── MODAL ── */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 500;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius);
  width: 100%; max-width: 520px; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}
.modal-header {
  background: var(--green-deep); color: var(--white);
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1.1rem; }
.modal-close { background: none; border: none; color: var(--white); font-size: 1.3rem; cursor: pointer; padding: 0 0.25rem; opacity: 0.8; }
.modal-close:hover { opacity: 1; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--cream-dark); display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ── MEMBER PROFILE ── */
.profile-header {
  background: linear-gradient(120deg, var(--green-deep), var(--green-mid));
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 2rem; display: flex; align-items: center; gap: 1.5rem;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 2rem; font-weight: 700; color: var(--white);
  border: 3px solid rgba(255,255,255,0.35);
  overflow: hidden; flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-meta h2 { color: var(--white); font-size: 1.6rem; }
.profile-meta .meta-code { color: var(--gold-light); font-size: 0.9rem; font-family: 'Inter', sans-serif; }

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.breadcrumb a { color: var(--green-mid); }
.breadcrumb span { color: var(--gray); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--gray);
}
.empty-state .es-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state h3 { font-size: 1.2rem; color: var(--charcoal); margin-bottom: 0.5rem; }

/* ── ANIMATIONS ── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: slideUp 0.35s ease both; }

/* ── UTILITIES ── */
.text-green  { color: var(--green-deep); }
.text-gold   { color: var(--gold); }
.text-gray   { color: var(--gray); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.d-none { display: none; }

/* Responsive tweaks */
@media (max-width: 600px) {
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .hero-stats { gap: 1.5rem; }
  .page-wrap { padding: 1.5rem 1rem; }
  .form-wrap { padding: 1.25rem; }
  .members-grid { grid-template-columns: 1fr; }
  .profile-header { flex-direction: column; align-items: flex-start; }
}

/* ── DEMISED MEMBER STYLES ── */
.member-demised .member-card-header {
  background: linear-gradient(120deg, #4a4a4a, #6b6b6b);
}
.member-demised.card .profile-header {
  background: linear-gradient(120deg, #4a4a4a, #6b6b6b);
}
.member-demised {
  opacity: 0.88;
  border-color: #bbb !important;
}
.member-demised .member-card-header,
.member-demised.card .profile-header {
  background: linear-gradient(120deg, #555, #777);
}
.demised-badge {
  font-size: 0.85rem;
  margin-left: 0.3rem;
  vertical-align: middle;
}
.demised-pill {
  display: inline-block;
  background: #e0e0e0;
  color: #555;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.demised-pill-lg {
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
  margin-left: 0;
}
.profile-field-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray);
  margin-bottom: 0.25rem;
}
/* Status filter data attribute for JS */
[data-member-card][data-status="demised"] .member-card-header {
  background: linear-gradient(120deg, #555, #777);
}

/* ── SPOUSE BANNER (member profile) ── */
.spouse-banner {
  display: flex; align-items: center; gap: 0.6rem;
  background: linear-gradient(90deg, #fff8e9, #fffaf0);
  border-bottom: 1px solid var(--cream-dark);
  padding: 0.75rem 2rem;
  font-size: 0.9rem;
}
.spouse-banner-icon { font-size: 1.1rem; }
.spouse-banner-text { color: var(--gray); }
.spouse-banner-link { font-weight: 700; color: var(--green-deep); }
.spouse-banner-link:hover { color: var(--gold); }
.spouse-banner-code { font-size: 0.75rem; color: var(--gray); }
.spouse-banner-anniversary { font-size: 0.8rem; color: var(--gold); font-weight: 600; }

/* ── SPOUSE CHIP (member cards / tree) ── */
.spouse-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem; color: var(--gold);
  margin-top: 0.2rem;
}

/* ── PARENTS LIST (profile page, shows couple together) ── */
.parents-list {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 0.15rem; font-size: 0.95rem;
}

/* ── INLINE GENERATION CODE CHIP ──
   Used everywhere a generation code appears beside a member name.
   Keeps it consistent: directory cards, profile, tree, admin table. */
.inline-code {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: 'Inter', monospace;
  color: var(--gold);
  background: rgba(201,151,28,0.10);
  border: 1px solid rgba(201,151,28,0.25);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-left: 0.2rem;
  white-space: nowrap;
}

/* ── NAV BADGE (pending submissions count) ── */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #e53e3e; color: #fff;
  font-size: 0.6rem; font-weight: 800;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 10px;
  position: absolute; top: 2px; right: -6px;
  line-height: 1;
}

/* ── PHOTO UPLOAD WIDGET ── */
.photo-upload-wrap {
  border: 2px dashed var(--gray-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  background: var(--cream);
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
  position: relative;
}
.photo-upload-wrap:hover,
.photo-upload-wrap.dragover {
  border-color: var(--green-mid);
  background: #f0faf4;
}
.photo-upload-wrap input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.photo-preview-ring {
  width: 80px; height: 80px; border-radius: 50%;
  margin: 0 auto 0.75rem;
  background: var(--cream-dark);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border: 2px solid var(--gray-light);
  transition: border-color var(--transition);
}
.photo-preview-ring img {
  width: 100%; height: 100%; object-fit: cover;
}
.photo-preview-ring .placeholder-icon { font-size: 2rem; opacity: 0.4; }
.photo-upload-label { font-size: 0.875rem; color: var(--gray); }
.photo-upload-label strong { color: var(--green-mid); }
.photo-size-badge {
  display: inline-block; margin-top: 0.4rem;
  font-size: 0.72rem; padding: 0.15rem 0.5rem;
  border-radius: 20px; font-weight: 600;
}
.photo-size-badge.ok      { background: #e8f5ee; color: #1a4d2e; }
.photo-size-badge.warning { background: #fff8e1; color: #92400e; }
.photo-size-badge.error   { background: #fee2e2; color: #991b1b; }

/* ── BRAND LOGO TEXT — RUH/ULFA two-color ── */
.nav-brand .brand-text { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 700; }
.brand-ruh  { font-style: normal; color: var(--gold-light); }
.brand-ulfa { font-style: normal; color: var(--white); }

/* ── HOME PAGE ANNOUNCEMENTS WIDGET ── */
.home-ann-strip {
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.home-ann-item {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--cream-dark);
  border-left: 3px solid transparent;
  transition: background 0.15s, border-left-color 0.15s, padding-left 0.15s;
  text-decoration: none; color: inherit;
}
.home-ann-item:last-child { border-bottom: none; }
.home-ann-item:hover { background: var(--cream); border-left-color: var(--green-light); padding-left: 1.4rem; }
.home-ann-item:has(.home-ann-when.today) { border-left-color: var(--gold); background: #fffcf5; }
.home-ann-icon {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; background: var(--cream);
}
.home-ann-info { flex: 1; min-width: 0; }
.home-ann-title { font-weight: 700; font-size: 0.88rem; color: var(--charcoal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-ann-sub   { font-size: 0.74rem; color: var(--gray); margin-top: 0.15rem; }
.home-ann-when  {
  font-size: 0.7rem; font-weight: 700; color: var(--green-mid); white-space: nowrap; flex-shrink: 0;
  background: #f0f7f2; padding: 0.25rem 0.6rem; border-radius: 20px;
}
.home-ann-when.today { color: var(--white); background: var(--gold); }
.home-ann-when.soon  { color: var(--green-deep); background: #e8f5ee; }

/* ── HISTORY TEASER CARD ── */
.history-teaser {
  background: linear-gradient(150deg, var(--green-deep) 0%, #163d27 60%, #0d3a22 100%);
  border-radius: 20px; padding: 2rem;
  color: var(--white); text-decoration: none;
  display: block; transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-md);
  position: relative; overflow: hidden; isolation: isolate;
}
.history-teaser::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.035'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.history-teaser::after {
  content: '';
  position: absolute; right: -15%; top: -20%; z-index: 0;
  width: 320px; height: 320px; max-width: 90%; max-height: 90%;
  background: radial-gradient(circle, rgba(201,151,28,0.18) 0%, transparent 70%);
}
.history-teaser > * { position: relative; z-index: 1; }
.history-teaser:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--white); }
.history-teaser .ht-ruh  { color: var(--gold-light); font-family: 'Playfair Display', serif; font-size: 1.7rem; font-weight: 700; letter-spacing: -0.01em; }
.history-teaser .ht-ulfa { color: var(--white); font-family: 'Playfair Display', serif; font-size: 1.7rem; font-weight: 700; letter-spacing: -0.01em; }
.history-teaser p { opacity: 0.82; font-size: 0.875rem; margin-top: 0.5rem; line-height: 1.65; }
.history-teaser .ht-cta {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-top: 1.1rem; background: var(--gold); color: var(--white);
  padding: 0.55rem 1.2rem; border-radius: 10px; font-size: 0.82rem; font-weight: 700;
  transition: background 0.18s, gap 0.18s;
}
.history-teaser:hover .ht-cta { background: var(--gold-light); gap: 0.55rem; }

/* ── HOME PAGE RESPONSIVE TWO-COLUMN ── */
@media (max-width: 720px) {
  .page-wrap > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}


/* ════════════════════════════════════════════════════════════════
   SECTION: SUBMIT PAGE
   ════════════════════════════════════════════════════════════════ */
.submit-hero {
  background: linear-gradient(135deg, var(--green-deep), var(--green-mid));
  color: var(--white); padding: 3rem 1.5rem 2.5rem; text-align: center;
}
.submit-hero h1 { font-size: clamp(1.6rem,4vw,2.4rem); margin-bottom: 0.5rem; }
.submit-hero p  { opacity: 0.85; font-size: 1rem; max-width: 560px; margin: 0 auto; }

.step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--green-deep); color: var(--white);
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.form-section-title {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--gray); font-weight: 700;
  margin: 1.5rem 0 0.85rem;
  border-top: 1px solid var(--cream-dark); padding-top: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.form-section-title:first-child { border-top: none; margin-top: 0; padding-top: 0; }

.success-box { text-align: center; padding: 3rem 2rem; }
.success-box .s-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.success-box h2 { font-size: 1.6rem; color: var(--green-deep); margin-bottom: 0.5rem; }
.success-box p  { color: var(--gray); max-width: 440px; margin: 0 auto 1.5rem; line-height: 1.7; }

.privacy-notice {
  padding: 1rem 1.25rem; background: var(--cream);
  border-radius: var(--radius-sm); border: 1px solid var(--cream-dark);
  font-size: 0.82rem; color: var(--gray); margin-top: 1.75rem;
}


/* ════════════════════════════════════════════════════════════════
   SECTION: FAMILY HISTORY PAGE
   ════════════════════════════════════════════════════════════════ */
.history-hero {
  background: linear-gradient(150deg, #0d2b1a 0%, var(--green-deep) 50%, #1a3d25 100%);
  color: var(--white); padding: 5rem 1.5rem 4rem;
  text-align: center; position: relative; overflow: hidden;
}
.history-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 120%, rgba(201,151,28,.15) 0%, transparent 70%);
}
.stats-strip {
  background: var(--green-deep);
  display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap;
  padding: 1.5rem; border-bottom: 2px solid rgba(201,151,28,.3);
}
.stat-item { text-align: center; color: var(--white); }
.stat-item .n { font-family: 'Playfair Display',serif; font-size: 2rem; font-weight: 700; color: var(--gold-light); }
.stat-item .l { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }

/* Timeline */
.timeline { position: relative; max-width: 820px; margin: 0 auto; padding: 2rem 0; }
.timeline::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(to bottom, var(--green-light), var(--gold), var(--green-light));
  transform: translateX(-50%);
}
.timeline-item { display: flex; gap: 2rem; margin-bottom: 3rem; align-items: flex-start; }
.timeline-item:nth-child(odd)  { flex-direction: row; }
.timeline-item:nth-child(even) { flex-direction: row-reverse; }
.timeline-content {
  flex: 1; background: var(--white); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow-md);
  border: 1px solid var(--cream-dark); position: relative;
}
.timeline-item:nth-child(odd)  .timeline-content::after {
  content: ''; position: absolute; right: -10px; top: 24px;
  border: 10px solid transparent; border-left-color: var(--white);
}
.timeline-item:nth-child(even) .timeline-content::after {
  content: ''; position: absolute; left: -10px; top: 24px;
  border: 10px solid transparent; border-right-color: var(--white);
}
.timeline-node {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--green-deep); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; z-index: 1;
  box-shadow: 0 0 0 4px var(--cream), 0 0 0 6px var(--green-light);
  align-self: flex-start; margin-top: .5rem;
}
.timeline-year {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--gold); font-weight: 700; margin-bottom: .4rem;
}
.timeline-content h2 { font-size: 1.2rem; color: var(--green-deep); margin-bottom: .15rem; }
.timeline-content .subtitle { font-size: .82rem; color: var(--gray); margin-bottom: .85rem; font-style: italic; }
.timeline-body { font-size: .9rem; color: var(--charcoal); line-height: 1.8; white-space: pre-wrap; }
@media (max-width: 640px) {
  .timeline::before { left: 28px; }
  .timeline-item, .timeline-item:nth-child(even) { flex-direction: row !important; }
  .timeline-content::after { display: none !important; }
  .timeline-node { width: 44px; height: 44px; font-size: 1.2rem; }
}


/* ════════════════════════════════════════════════════════════════
   SECTION: FAMILY TREE PAGE
   ════════════════════════════════════════════════════════════════ */
.founders-apex { text-align: center; margin-bottom: 1.25rem; }
.founders-couple { display: inline-flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.founder-chip {
  display: inline-flex; align-items: center; gap: 0.75rem;
  background: linear-gradient(120deg, var(--green-deep), var(--green-mid));
  color: var(--white); padding: 0.65rem 1.1rem; border-radius: 12px;
  text-decoration: none; transition: box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 4px 16px rgba(26,77,46,0.25);
}
.founder-chip:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26,77,46,0.3); color: var(--white); }
.founder-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 700;
  border: 2px solid rgba(255,255,255,0.35); flex-shrink: 0;
}
.founder-info { display: flex; flex-direction: column; }
.founder-name { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700; }
.founder-code { font-size: 0.72rem; opacity: 0.72; }
.couple-heart { font-size: 1.4rem; }
.founder-connector { display: flex; align-items: center; gap: 0.75rem; justify-content: center; margin: 0.75rem auto; max-width: 320px; }
.connector-line { flex: 1; height: 1px; background: var(--green-light); opacity: 0.6; }
.connector-label { font-size: 0.75rem; color: var(--gray); white-space: nowrap; }
.tree-root-list { list-style: none; display: flex; flex-direction: column; gap: 0.1rem; padding-left: 0; }
.tree-root-list > li { border-left: none; }
.tree-demised { opacity: 0.6; background: var(--cream-dark) !important; color: var(--gray) !important; }
.tree-demised .t-code { color: var(--gray) !important; }
.tree-demised a { color: var(--gray) !important; }
.tree-spouse { background: #fff8e9 !important; border-color: #e8d9b0 !important; }
.couple-link { font-size: 0.8rem; opacity: 0.85; }


/* ════════════════════════════════════════════════════════════════
   SECTION: ANNOUNCEMENTS PAGE
   ════════════════════════════════════════════════════════════════ */
.ann-hero {
  background: linear-gradient(135deg, var(--green-deep), var(--green-mid));
  color: var(--white); padding: 3.5rem 1.5rem 2.5rem; text-align: center;
}
.ann-hero h1 { font-size: clamp(1.8rem,4vw,2.8rem); margin-bottom: .4rem; }
.ann-hero p  { opacity: .75; font-size: 1rem; }
.ann-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 1.1rem; }
.ann-grid-past { grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); }
.ann-card {
  background: var(--white); border-radius: var(--radius);
  border: 1.5px solid var(--cream-dark); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: box-shadow .2s, transform .2s;
}
.ann-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
/* When the whole card is a link (single-member events: birthdays,
   remembrances) it must behave like a block element, not inline, and
   should never look like a "visited link" — colors stay card-native. */
.ann-card-link {
  display: block; text-decoration: none; color: inherit; cursor: pointer;
}
.ann-card-link:hover .ann-title { color: var(--green-deep); }
.ann-card-link:hover:not(.ann-past) { border-color: var(--green-light); }
.ann-today { border-color: var(--gold); animation: pulse-gold 2s ease-in-out infinite; }
.ann-soon  { border-color: var(--green-mid); }
.ann-past  { opacity: .65; }
@keyframes pulse-gold {
  0%,100% { box-shadow: 0 0 0 3px rgba(201,151,28,.2); }
  50%      { box-shadow: 0 0 0 7px rgba(201,151,28,.08); }
}
.ann-card-top { padding: 1.1rem 1.1rem .75rem; display: flex; align-items: flex-start; gap: .85rem; }
.ann-icon { font-size: 1.75rem; flex-shrink: 0; line-height: 1; }
.ann-title { font-weight: 700; font-size: .95rem; color: var(--charcoal); line-height: 1.3; }
.ann-members { font-size: .78rem; color: var(--gray); margin-top: .25rem; }
.ann-members a { color: var(--green-mid); font-weight: 600; }
.ann-badge {
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: .2rem .55rem; border-radius: 20px;
  white-space: nowrap; flex-shrink: 0; align-self: flex-start;
}
.badge-birthday     { background: #fef8e7; color: #92600a; }
.badge-anniversary  { background: #e8f5ee; color: var(--green-deep); }
.badge-milestone    { background: #fdf4e3; color: #7a4f00; }
.badge-remembrance  { background: #eef1ef; color: #4a5a52; }
.badge-announcement { background: #f0f7f2; color: var(--green-mid); }
.ann-card-footer {
  padding: .6rem 1.1rem; border-top: 1px solid var(--cream-dark);
  display: flex; align-items: center; justify-content: space-between; background: var(--cream);
}
.ann-date { font-size: .78rem; color: var(--gray); }
.ann-countdown { font-size: .78rem; font-weight: 700; color: var(--green-mid); }
.countdown-today { color: var(--gold); font-size: .85rem; }
.ann-body { padding: .6rem 1.1rem .85rem; font-size: .82rem; color: var(--gray); line-height: 1.6; border-top: 1px solid var(--cream-dark); }
.pin-badge {
  font-size: .65rem; background: #fef8e7; color: #92600a;
  padding: .1rem .4rem; border-radius: 4px; margin-left: .35rem; vertical-align: middle;
}


/* ════════════════════════════════════════════════════════════════
   SECTION: ADMIN — SUBMISSIONS
   ════════════════════════════════════════════════════════════════ */
.sub-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--cream-dark); box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem; overflow: hidden; transition: box-shadow 0.2s;
}
.sub-card:hover { box-shadow: var(--shadow-md); }
.sub-card-header {
  padding: 1rem 1.25rem;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--cream-dark);
}
.sub-card-header.pending  { background: #fffbea; }
.sub-card-header.approved { background: #eaf7ee; }
.sub-card-header.rejected { background: #fdecea; }
.sub-name { font-family: 'Playfair Display',serif; font-size: 1.1rem; font-weight: 700; color: var(--charcoal); }
.sub-code {
  font-size: 0.78rem; font-weight: 700; color: var(--gold);
  background: rgba(201,151,28,0.1); border: 1px solid rgba(201,151,28,0.25);
  padding: 0.1rem 0.4rem; border-radius: 4px; margin-left: 0.35rem;
}
.sub-meta { font-size: 0.78rem; color: var(--gray); margin-top: 0.2rem; }
.sub-body { padding: 1rem 1.25rem; display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 0.75rem; }
.sub-field label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--gray); font-weight: 700; display: block; margin-bottom: 0.15rem;
}
.sub-field span { font-size: 0.875rem; color: var(--charcoal); font-weight: 500; }
.sub-submitter {
  background: var(--cream); border-top: 1px solid var(--cream-dark);
  padding: 0.75rem 1.25rem; font-size: 0.82rem; color: var(--charcoal);
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.sub-submitter strong { color: var(--green-deep); }
.sub-footer {
  padding: 0.85rem 1.25rem; border-top: 1px solid var(--cream-dark);
  display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap;
}
.badge-pending  { background: #fef8e7; color: #92600a; border: 1px solid var(--gold-light); padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.72rem; font-weight: 700; }
.badge-approved { background: #e8f5ee; color: var(--green-deep); border: 1px solid var(--green-light); padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.72rem; font-weight: 700; }
.badge-rejected { background: var(--danger-light); color: var(--danger); border: 1px solid #f5c6c6; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.72rem; font-weight: 700; }
.tab-bar { display: flex; gap: 0; border-bottom: 2px solid var(--cream-dark); margin-bottom: 1.5rem; }
.tab-btn {
  padding: 0.65rem 1.25rem; font-size: 0.875rem; font-weight: 600;
  color: var(--gray); border: none; background: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  text-decoration: none; display: flex; align-items: center; gap: 0.4rem;
  transition: color 0.2s, border-color 0.2s;
}
.tab-btn:hover  { color: var(--green-deep); }
.tab-btn.active { color: var(--green-deep); border-bottom-color: var(--green-deep); }
.tab-count {
  background: var(--green-deep); color: var(--white);
  font-size: 0.68rem; font-weight: 700; padding: 0.1rem 0.45rem;
  border-radius: 20px; min-width: 20px; text-align: center;
}
.tab-count.orange { background: var(--gold); }
.tab-count.red    { background: var(--danger); }
.reject-note { width: 100%; margin-top: 0.75rem; }


/* ════════════════════════════════════════════════════════════════
   SECTION: ADMIN — MEMBER TABLE & MODALS
   ════════════════════════════════════════════════════════════════ */
.member-form-modal .modal { max-width: 680px; }
.status-toggle { display: flex; gap: 0.5rem; }
.status-toggle label {
  flex: 1; display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
  padding: 0.55rem 0.9rem; border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; transition: all 0.2s;
}
.status-toggle input[type=radio] { display: none; }
.status-toggle input[type=radio]:checked + label.alive-lbl   { border-color: var(--green-mid); background: #eaf7ee; color: var(--green-deep); }
.status-toggle input[type=radio]:checked + label.demised-lbl { border-color: var(--gray); background: var(--cream-dark); color: var(--charcoal); }
.members-table th { cursor: default; }
.members-table .name-cell { font-weight: 600; }
.members-table .code-cell { font-weight: 700; color: var(--gold); font-size: 0.82rem; }
.members-table .status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.dot-alive   { background: var(--green-light); }
.dot-demised { background: var(--gray); }


/* ════════════════════════════════════════════════════════════════
   SECTION: ADMIN — ANNOUNCEMENT TYPE PILLS
   ════════════════════════════════════════════════════════════════ */
.type-radio { display: none; }
.type-label {
  padding: .45rem 1rem; border-radius: 20px; cursor: pointer;
  font-size: .82rem; font-weight: 600; border: 1.5px solid var(--gray-light);
  background: var(--cream); transition: all .2s; display: inline-block; margin: .2rem .2rem 0 0;
}
.type-radio:checked + .type-label.birthday     { background: #fef8e7; border-color: var(--gold); color: #92600a; }
.type-radio:checked + .type-label.anniversary  { background: #e8f5ee; border-color: var(--green-deep); color: var(--green-deep); }
.type-radio:checked + .type-label.milestone    { background: #fdf4e3; border-color: var(--gold-light); color: #7a4f00; }
.type-radio:checked + .type-label.announcement { background: #f0f7f2; border-color: var(--green-mid); color: var(--green-mid); }

.ann-type-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.dot-birthday     { background: var(--gold); }
.dot-anniversary  { background: var(--green-mid); }
.dot-milestone    { background: var(--gold-light); }
.dot-announcement { background: var(--green-light); }


/* ════════════════════════════════════════════════════════════════
   SECTION: ADMIN LOGIN
   ════════════════════════════════════════════════════════════════ */
.lockout-box {
  background: #fef8e7; border: 1.5px solid var(--gold);
  border-radius: 8px; padding: 1rem; text-align: center;
  color: #92600a; font-size: 0.875rem; margin-bottom: 1.25rem;
}
.lockout-box .lock-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.lockout-box strong { display: block; font-size: 1rem; margin-bottom: 0.25rem; }
.attempt-dots { display: flex; gap: 0.35rem; justify-content: center; margin: 0.75rem 0; }
.attempt-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--cream-dark); border: 1.5px solid var(--gray-light);
  transition: background 0.2s, border-color 0.2s;
}
.attempt-dot.used { background: var(--danger); border-color: #a93226; }


/* ════════════════════════════════════════════════════════════════
   SECTION: PROFILE — FIELD LABELS
   ════════════════════════════════════════════════════════════════ */
.profile-field-label {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--gray); margin-bottom: 0.25rem;
}
.parents-list { display: flex; align-items: center; flex-wrap: wrap; gap: 0.15rem; font-size: 0.95rem; }


/* ════════════════════════════════════════════════════════════════
   SECTION: UTILITY CLASSES (replaces remaining inline styles)
   ════════════════════════════════════════════════════════════════ */

/* Text */
.text-xs-gray  { font-size: 0.78rem; color: var(--gray); }
.text-xxs-gray { font-size: 0.72rem; color: var(--gray); }
.text-sm-gray  { font-size: 0.82rem; color: var(--gray); }
.text-sm       { font-size: 0.875rem; color: var(--charcoal); }
.text-bold-green { font-weight: 700; color: var(--green-deep); }
.text-italic   { font-style: italic; }
.link-green    { font-weight: 600; color: var(--green-mid); }
.link-green:hover { color: var(--gold); }
.profile-phone { font-weight: 600; font-size: 1rem; color: var(--green-deep); }

/* Layout */
.w-full    { width: 100%; }
.flex-1    { flex: 1; }
.ml-auto   { margin-left: auto; }

/* Form section title label (used in admin add/edit standalone pages) */
.form-section-title-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--gray); font-weight: 700;
  margin: 1.25rem 0 0.75rem;
  border-top: 1px solid var(--cream-dark); padding-top: 1rem;
}

/* Profile grid */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.profile-grid-full { grid-column: 1 / -1; }

/* ── PROFILE NOTES SECTION ── */
.profile-notes {
  margin-top: 1.25rem; padding-top: 1.25rem;
  border-top: 1px solid var(--cream-dark);
  grid-column: 1 / -1;
}
.profile-notes .profile-field-label { margin-bottom: 0.5rem; }
.profile-notes p { font-size: 0.9rem; color: var(--charcoal); line-height: 1.7; }

/* ── HOME PAGE TWO-COLUMN GRID ── */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 720px) {
  .home-grid { grid-template-columns: 1fr; }
}


/* ════════════════════════════════════════════════════════════════
   SECTION: HOME PAGE COMPONENTS
   ════════════════════════════════════════════════════════════════ */
/* Quick nav button row */
/* ── Home quick-nav: icon-badge tile cards ── */
.nav-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.85rem;
  margin-bottom: 2rem;
}
.nav-tile {
  display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: 16px;
  padding: 1.25rem 0.75rem;
  text-decoration: none; color: var(--charcoal);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.nav-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-light);
  color: var(--charcoal);
}
.nav-tile-icon {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  background: var(--cream);
  transition: background 0.18s ease, transform 0.18s ease;
}
.nav-tile:hover .nav-tile-icon { transform: scale(1.06); }
.nav-tile-label { font-size: 0.82rem; font-weight: 700; text-align: center; }
.nav-tile-primary .nav-tile-icon { background: linear-gradient(150deg, var(--green-deep), var(--green-mid)); color: var(--white); }
.nav-tile-primary { border-color: var(--green-light); }
.nav-tile-gold .nav-tile-icon { background: linear-gradient(150deg, var(--gold), var(--gold-light)); color: var(--white); font-weight: 800; }
.nav-tile-gold { border-color: var(--gold-light); }

/* Section header row with "View all" link */
.section-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.section-row .section-title { border: none; margin: 0; padding: 0; font-size: 1.15rem; }
.section-row-link { font-size: 0.8rem; color: var(--green-mid); white-space: nowrap; }
.section-row-link:hover { color: var(--gold); }

/* Upcoming events empty state in home widget */
.ann-empty { padding: 2rem; text-align: center; color: var(--gray); font-size: 0.875rem; }
.ann-empty-icon { font-size: 2rem; margin-bottom: .5rem; }

/* "View N more" link at bottom of announcements strip */
.ann-more-link {
  display: block; text-align: center; padding: .75rem;
  font-size: .8rem; color: var(--green-mid);
  border-top: 1px solid var(--cream-dark);
}
.ann-more-link:hover { background: var(--cream); color: var(--gold); }

/* Recent members compact list */
.recent-members-list { display: flex; flex-direction: column; gap: 0.6rem; }
.recent-member-row {
  display: flex; align-items: center; gap: .85rem;
  background: var(--white); border: 1px solid var(--cream-dark);
  border-radius: 14px; padding: .75rem .9rem;
  text-decoration: none; box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.recent-member-row:hover { box-shadow: var(--shadow-md); transform: translateX(2px); border-color: var(--green-light); }
.recent-member-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(150deg, var(--green-deep), var(--green-mid));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--white); font-size: 1rem;
  flex-shrink: 0; overflow: hidden;
  box-shadow: 0 0 0 3px var(--cream);
}
.recent-member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.recent-member-info { flex: 1; min-width: 0; }
.recent-member-name {
  font-weight: 700; font-size: .875rem; color: var(--charcoal);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recent-member-meta { font-size: .72rem; color: var(--gray); margin-top: 0.1rem; }
.recent-member-arrow {
  font-size: .8rem; color: var(--gray-light); flex-shrink: 0;
  transition: transform 0.18s, color 0.18s;
}
.recent-member-row:hover .recent-member-arrow { color: var(--green-mid); transform: translateX(2px); }

/* Hero RUHULFA color split */
.hero-ruh  { color: var(--gold-light); }
.hero-ulfa { color: var(--white); }

/* History teaser brand words */
.ht-ruh-text  { color: var(--gold-light); font-weight: 700; }
.ht-ulfa-text { color: var(--gold-light); font-weight: 700; }


/* ════════════════════════════════════════════════════════════════
   SECTION: ADMIN — GENERATIONS, HISTORY, GENERAL ADMIN
   ════════════════════════════════════════════════════════════════ */
/* Section card header */
.card-section-header {
  padding: 1.1rem 1.5rem;
  background: var(--cream); border-bottom: 1px solid var(--cream-dark);
}
.card-section-header h3 { font-size: 1rem; color: var(--green-deep); }
.card-section-header p  { font-size: 0.82rem; color: var(--gray); margin-top: 0.2rem; }

/* Admin stat cards row */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill,minmax(130px,1fr)); gap: 1rem; margin-bottom: 2rem; }
.admin-stat-card { text-align: center; }
.admin-stat-card .card-body { padding: 1.1rem 0.75rem; }
.admin-stat-num { font-family: 'Playfair Display',serif; font-size: 1.9rem; font-weight: 700; }
.admin-stat-lbl { font-size: .72rem; color: var(--gray); text-transform: uppercase; letter-spacing: .05em; }

/* History section list item */
.history-section-item { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem 1.25rem; }
.history-section-sort { display: flex; flex-direction: column; gap: 0.25rem; flex-shrink: 0; }
.history-section-icon { font-size: 2rem; flex-shrink: 0; line-height: 1; }
.history-section-body { flex: 1; min-width: 0; }
.history-section-year { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--gold); font-weight: 700; margin-bottom: .2rem; }
.history-section-title { font-size: 1rem; color: var(--green-deep); margin-bottom: .15rem; }
.history-section-subtitle { font-size: .8rem; color: var(--gray); font-style: italic; margin-bottom: .3rem; }
.history-section-preview { font-size: .8rem; color: var(--gray); margin: 0; }
.history-section-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* Admin bar above tables */
.admin-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.75rem; }
.admin-bar .section-title { border: none; margin: 0; padding: 0; font-size: 1.2rem; }

/* Login page show-password button */
.pw-toggle-wrap { position: relative; }
.pw-toggle-btn {
  position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: var(--gray); padding: 0.25rem;
}
.pw-toggle-btn:hover { color: var(--green-mid); }

/* Announce/history submitter info */
.submitter-info {
  background: var(--cream); border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm); padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem; font-size: 0.875rem;
  color: var(--charcoal); display: flex; gap: 1.5rem; flex-wrap: wrap;
}
.submitter-info strong { color: var(--green-deep); }

/* Member form partial — section divider */
.form-divider {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--gray); font-weight: 700;
  margin: 1.25rem 0 0.75rem;
  border-top: 1px solid var(--cream-dark); padding-top: 1rem;
}

/* Tree legend row */
.tree-legend-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.82rem; }

/* Announce public page section title */
.ann-section-title { margin-top: 1.5rem; }


/* ════════════════════════════════════════════════════════════════
   SECTION: GENERATIONS ADMIN TABLE
   ════════════════════════════════════════════════════════════════ */
.section-title-plain { border: none; margin: 0; padding: 0; }

.card-section-footer {
  padding: 1rem 1.5rem; border-top: 1px solid var(--cream-dark);
  background: var(--cream); display: flex; gap: 0.75rem;
}
.table-scroll { overflow-x: auto; }

.gen-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.gen-table th {
  padding: 0.75rem 1rem; background: var(--green-deep); color: var(--white);
  text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.gen-table th.col-level   { width: 70px; }
.gen-table th.col-order   { width: 80px; }
.gen-table th.col-members { width: 90px; }
.gen-table th.col-actions { width: 60px; }
.gen-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--cream-dark); }
.gen-table td.col-members { text-align: center; }
.gen-level-num { font-weight: 700; color: var(--gold); font-size: 1rem; }
.form-control-cell { margin: 0; }
.form-control-narrow { width: 60px; }
.label-optional { font-weight: 400; color: var(--gray); }
.form-flex-2 { flex: 2; }
.form-flex-icon { flex: 0 0 90px; }
.icon-input { font-size: 1.4rem; text-align: center; padding: 0.45rem; }
.form-narrow { max-width: 140px; }
.history-sections-list { display: flex; flex-direction: column; gap: 0.85rem; }


/* ════════════════════════════════════════════════════════════════
   SECTION: SUBMIT PAGE — remaining components
   ════════════════════════════════════════════════════════════════ */
.page-wrap-narrow { max-width: 760px; }
.form-wrap-full { max-width: 100%; }
.justify-center { justify-content: center; }
.uppercase-input { text-transform: uppercase; }
.text-xxs { font-size: 0.75rem; }
.mt-1 { margin-top: 0.5rem; }

.card-howitworks { background: linear-gradient(135deg, var(--cream), var(--white)); }
.howitworks-title { font-size: 1rem; color: var(--green-deep); margin-bottom: 0.85rem; }
.howitworks-steps { display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.875rem; color: var(--gray); }
.howitworks-step { display: flex; gap: 0.75rem; align-items: flex-start; }

.label-photo-url { font-size: 0.78rem; color: var(--gray); font-weight: 500; }
.btn-submit-wide { flex: 1; justify-content: center; padding: 0.85rem; }


/* ════════════════════════════════════════════════════════════════
   SECTION: MEMBER PROFILE — remaining components
   ════════════════════════════════════════════════════════════════ */
.justify-end { justify-content: flex-end; }
.demised-icon-lg { font-size: 1.5rem; margin-left: 0.4rem; }
.demised-date-header { color: rgba(255,255,255,0.7); font-size: 0.85rem; margin-left: 0.5rem; }
.text-italic-gray { color: var(--gray); font-style: italic; font-size: 0.9rem; }
.admin-only-tag { font-size: 0.75rem; color: var(--gold); font-weight: 400; }
.couple-ring-icon { margin: 0 0.3rem; color: var(--gold); }
.status-demised-text { font-weight: 600; color: var(--gray); }
.field-value { font-weight: 600; }
.notes-text { color: var(--charcoal); font-size: 0.9rem; line-height: 1.7; }
.shared-with-text { font-size: 0.8rem; font-weight: 400; color: var(--gray); margin-left: 0.25rem; }


/* ════════════════════════════════════════════════════════════════
   SECTION: FAMILY TREE — remaining components
   ════════════════════════════════════════════════════════════════ */
.tree-node-row { display: flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0; }
.tree-toggle-btn { padding: 0.15rem 0.4rem; font-size: 0.7rem; line-height: 1; }
.tree-toggle-spacer { width: 26px; display: inline-block; }
.tree-node-link { color: inherit; font-weight: 600; }
.tree-demised-icon { font-size: 0.75rem; }
.tree-phone-icon { font-size: 0.7rem; opacity: 0.55; }
.tree-wrap-sized { font-size: 0.875rem; }

.legend-title { font-size: 1rem; color: var(--green-deep); }
.legend-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
  gap: 0.75rem; margin-bottom: 1.25rem;
}
.legend-item { display: flex; gap: 0.6rem; align-items: flex-start; }
.legend-item-label { font-weight: 600; font-size: 0.875rem; color: var(--charcoal); }
.legend-gen-badge {
  background: var(--green-deep); color: var(--white);
  font-size: 0.7rem; font-weight: 700;
  padding: 0.15rem 0.5rem; border-radius: 20px;
  white-space: nowrap; margin-top: 2px; display: inline-block;
}
.legend-footnote {
  border-top: 1px solid var(--cream-dark); padding-top: 0.85rem;
  font-size: 0.82rem; color: var(--gray);
  display: flex; align-items: center; gap: 0.4rem;
}
.legend-couple-icon { font-size: 0.9rem; }


/* ════════════════════════════════════════════════════════════════
   SECTION: HEADER / FOOTER / MEMBER CARD — remaining components
   ════════════════════════════════════════════════════════════════ */
.nav-badge-wrap { position: relative; }
.contact-hidden-text { color: var(--gray); font-size: 0.82rem; font-style: italic; }
.card-spouse-link { font-size: 0.82rem; font-weight: 600; }


/* ════════════════════════════════════════════════════════════════
   SECTION: HISTORY HERO / ANNOUNCEMENTS — remaining components
   ════════════════════════════════════════════════════════════════ */
.history-hero-eyebrow {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .15em;
  opacity: .6; margin-bottom: .75rem; position: relative; z-index: 1;
}
.history-hero-title { font-size: clamp(2.2rem,6vw,4rem); margin-bottom: .5rem; position: relative; z-index: 1; }
.history-hero-sub { font-size: 1.05rem; opacity: .8; max-width: 520px; margin: 0 auto; position: relative; z-index: 1; }

.ann-info-col { flex: 1; min-width: 0; }
.ann-icon-faded { opacity: .5; }
.ann-title-faded { opacity: .7; }


/* ════════════════════════════════════════════════════════════════
   SECTION: ADMIN LOGIN — remaining components
   ════════════════════════════════════════════════════════════════ */
.text-left { text-align: left; }
.login-form { text-align: left; }
.pw-toggle-wrap { position: relative; }
.pw-input { padding-right: 2.5rem; }
.pw-toggle-btn {
  position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: var(--gray); padding: 0.25rem;
}
.pw-toggle-btn:hover { color: var(--green-mid); }
.btn-login-submit { width: 100%; justify-content: center; padding: 0.75rem; margin-top: 0.25rem; }
.login-footer {
  margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--cream-dark);
  text-align: center; font-size: 0.78rem; color: var(--gray);
}
.login-back-link { color: var(--gray); }
.login-back-link:hover { color: var(--green-mid); }


/* ════════════════════════════════════════════════════════════════
   SECTION: ADMIN MEMBERS TABLE — remaining components
   ════════════════════════════════════════════════════════════════ */
.admin-stat-card { text-align: center; }
.stat-green-deep { color: var(--green-deep); }
.stat-green-mid  { color: var(--green-mid); }
.stat-gray       { color: var(--gray); }
.stat-gold       { color: var(--gold); }

.search-input-wrap-md { max-width: 380px; }
.col-actions-wide { width: 110px; }
.gen-badge-sm { font-size: 0.7rem; }
.link-green-bold { color: var(--green-mid); font-weight: 600; }
.link-green-bold:hover { color: var(--gold); }
.cell-empty { opacity: .35; }
.cell-faded-sm { opacity: .5; font-size: .72rem; }
.text-gold { color: var(--gold); }


/* ════════════════════════════════════════════════════════════════
   SECTION: ADMIN ANNOUNCEMENTS / SUBMISSIONS — remaining
   ════════════════════════════════════════════════════════════════ */
.checkbox-row-wide { display: flex; gap: 2rem; flex-wrap: wrap; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .875rem; font-weight: 500; }
.checkbox-auto { width: auto; }
.cell-bold { font-weight: 600; }
.cell-nowrap { white-space: nowrap; }

.ml-sm { margin-left: 0.35rem; }
.sub-field-full { grid-column: 1 / -1; }
.text-danger { color: var(--danger); }
.inline-form { display: inline; }
.reject-panel { display: none; width: 100%; margin-top: 0.5rem; }
.approved-tag { font-size: 0.82rem; color: var(--green-mid); font-weight: 600; }


/* ════════════════════════════════════════════════════════════════
   SECTION: MARKDOWN OUTPUT (parseMarkdown helper in config.php)
   ════════════════════════════════════════════════════════════════ */
.md-bold { color: var(--green-deep); }
.md-rtl  { font-size: 1.15em; font-family: serif; }


/* ════════════════════════════════════════════════════════════════
   SECTION: PHOTO UPLOAD WIDGET — remaining components
   ════════════════════════════════════════════════════════════════ */
.d-inline-block { display: inline-block; }
.remove-photo-label { cursor: pointer; color: var(--danger); }
.mr-sm { margin-right: 0.25rem; }


/* ════════════════════════════════════════════════════════════════
   SECTION: ADMIN SHELL — sidebar-based professional admin layout
   ════════════════════════════════════════════════════════════════ */
.admin-body { background: var(--cream); overflow-x: hidden; max-width: 100vw; }

.admin-shell {
  display: flex;
  min-height: 100vh;
  max-width: 100vw;
}

/* ── SIDEBAR ── */
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--green-deep);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar-brand {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 1.35rem 1.25rem 0.5rem;
  text-decoration: none;
}
.admin-sidebar-brand img { height: 32px; width: auto; border-radius: 4px; }
.admin-brand-text { font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 700; }
.admin-sidebar-tag {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.45); font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.75rem;
}

.admin-nav { flex: 1; padding: 0 0.75rem; }
.admin-nav-group { margin-bottom: 1.25rem; }
.admin-nav-group-label {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35); font-weight: 700;
  padding: 0 0.6rem; margin-bottom: 0.4rem;
}
.admin-nav-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.55rem 0.6rem; border-radius: 8px;
  color: rgba(255,255,255,0.78); text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
  transition: background 0.15s, color 0.15s;
  position: relative; margin-bottom: 0.1rem;
}
.admin-nav-item:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.admin-nav-item.active {
  background: rgba(255,255,255,0.14); color: var(--white); font-weight: 700;
}
.admin-nav-item.active::before {
  content: ''; position: absolute; left: -0.75rem; top: 0.35rem; bottom: 0.35rem;
  width: 3px; background: var(--gold); border-radius: 0 3px 3px 0;
}
.admin-nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.admin-nav-label { flex: 1; }
.admin-nav-badge {
  background: var(--gold); color: var(--white);
  font-size: 0.65rem; font-weight: 800;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
}

.admin-sidebar-footer {
  padding: 0.85rem 0.75rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; gap: 0.15rem;
}
.admin-sidebar-footer-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.6rem; border-radius: 8px;
  color: rgba(255,255,255,0.62); text-decoration: none;
  font-size: 0.82rem; transition: background 0.15s, color 0.15s;
}
.admin-sidebar-footer-link:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.admin-logout-link:hover { color: #ffb4b4; }

/* ── MOBILE TOPBAR (hidden on desktop) ── */
.admin-mobile-topbar {
  display: none; position: sticky; top: 0; z-index: 120;
  background: var(--green-deep); color: var(--white);
  align-items: center; gap: 0.85rem; padding: 0.75rem 1rem;
}
.admin-sidebar-toggle {
  background: none; border: none; cursor: pointer; padding: 4px;
  display: flex; flex-direction: column; gap: 4px;
}
.admin-sidebar-toggle .bar { width: 20px; height: 2px; background: var(--white); border-radius: 2px; }
.admin-mobile-brand { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700; }
.admin-sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 110;
}
.admin-sidebar-backdrop.open { display: block; }

/* ── MAIN CONTENT AREA ── */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding: 1.5rem 2rem 1rem;
  border-bottom: 1px solid var(--cream-dark);
  background: var(--white);
}
.admin-page-title {
  font-family: 'Playfair Display', serif; font-size: 1.5rem;
  color: var(--green-deep); margin: 0;
}
.admin-page-subtitle { font-size: 0.85rem; color: var(--gray); margin-top: 0.25rem; }
.admin-topbar-user {
  display: flex; align-items: center; gap: 0.6rem;
  flex-shrink: 0; padding-top: 0.15rem;
}
.admin-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--green-deep); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.admin-user-name { font-size: 0.85rem; font-weight: 600; color: var(--charcoal); }

.admin-content { padding: 1.75rem 2rem 3rem; max-width: 1200px; width: 100%; }

/* ── RESPONSIVE: collapse sidebar to drawer below 960px ──
   Uses !important + display:block on the shell so this NEVER depends on
   flex-shrink arithmetic — the single most common source of "sidebar
   won't collapse, whole page renders zoomed out" bugs on mobile Safari. */
@media (max-width: 960px) {
  .admin-shell {
    display: block !important;
  }
  .admin-sidebar {
    position: fixed !important;
    left: 0 !important; top: 0 !important; bottom: 0 !important;
    width: 260px !important;
    z-index: 130;
    transform: translateX(-100%) !important;
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .admin-sidebar.open {
    transform: translateX(0) !important;
  }
  .admin-mobile-topbar { display: flex; }
  .admin-main {
    display: block !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  .admin-topbar { padding: 1.1rem 1.25rem 0.85rem; }
  .admin-content {
    padding: 1.25rem 1.25rem 2.5rem;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
  }
  .admin-user-name { display: none; }
}
@media (max-width: 560px) {
  .admin-page-title { font-size: 1.2rem; }
}

/* Belt-and-suspenders: any table inside admin content must never force
   the page wider than the viewport — it scrolls internally instead. */
.admin-content .table-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.admin-content table { min-width: max-content; }


/* ════════════════════════════════════════════════════════════════
   SECTION: ADMIN DASHBOARD
   ════════════════════════════════════════════════════════════════ */
.dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 1.75rem;
}
.dash-stat-card {
  background: var(--white); border: 1px solid var(--cream-dark);
  border-radius: var(--radius); padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  text-decoration: none; position: relative;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.2s, transform 0.2s;
}
.dash-stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dash-stat-alert { border-color: var(--gold-light); background: #fffcf5; }
.dash-stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.dash-icon-green { background: #e8f5ee; }
.dash-icon-gold  { background: #fef8e7; }
.dash-stat-num { font-family: 'Playfair Display', serif; font-size: 1.7rem; font-weight: 700; color: var(--charcoal); line-height: 1; }
.dash-stat-label { font-size: 0.78rem; color: var(--gray); margin-top: 0.2rem; }
.dash-stat-badge {
  position: absolute; top: 0.6rem; right: 0.6rem;
  background: var(--gold); color: var(--white);
  font-size: 0.62rem; font-weight: 700; padding: 0.15rem 0.5rem;
  border-radius: 20px; text-transform: uppercase; letter-spacing: 0.03em;
}

.dash-grid-2col { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.25rem; }
@media (max-width: 860px) { .dash-grid-2col { grid-template-columns: 1fr; } }

.dash-section-card { overflow: hidden; }
.dash-quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; padding: 1.1rem 1.25rem; }
@media (max-width: 520px) { .dash-quick-actions { grid-template-columns: 1fr; } }
.dash-action-btn {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 0.85rem; border-radius: var(--radius-sm);
  background: var(--cream); border: 1px solid var(--cream-dark);
  color: var(--charcoal); text-decoration: none; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
  position: relative;
}
.dash-action-btn:hover { background: var(--white); border-color: var(--green-light); color: var(--green-deep); }
.dash-action-icon { font-size: 1.1rem; }
.dash-action-badge { position: static; margin-left: auto; }

.dash-empty { text-align: center; padding: 2rem 1.25rem; color: var(--gray); font-size: 0.875rem; }
.dash-empty-icon { font-size: 2rem; margin-bottom: 0.5rem; }

.dash-event-list { padding: 0.5rem 0; }
.dash-event-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 1.25rem; border-bottom: 1px solid var(--cream-dark);
}
.dash-event-row:last-child { border-bottom: none; }
.dash-event-icon { font-size: 1.3rem; flex-shrink: 0; }
.dash-event-info { flex: 1; min-width: 0; }
.dash-event-title { font-size: 0.85rem; font-weight: 600; color: var(--charcoal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-event-when { font-size: 0.75rem; font-weight: 700; color: var(--green-mid); white-space: nowrap; }

.dash-view-all {
  display: block; text-align: center; padding: 0.75rem;
  font-size: 0.82rem; color: var(--green-mid); font-weight: 600;
  border-top: 1px solid var(--cream-dark); text-decoration: none;
}
.dash-view-all:hover { background: var(--cream); color: var(--gold); }


/* ════════════════════════════════════════════════════════════════
   SECTION: PUBLIC NAV — single Admin Panel entry point
   ════════════════════════════════════════════════════════════════ */
.nav-admin-link { position: relative; display: inline-flex; align-items: center; gap: 0.4rem; }
.nav-admin-link .nav-badge { position: static; margin-left: 0.15rem; }
