/* ══════════════════════════════════════════════════════════════
   Scout Privilege Platform — Fully Responsive
   Brand colors → edit static/css/brand.css
══════════════════════════════════════════════════════════════ */
@import url('/static/css/brand.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── Variables ──────────────────────────────────────────────── */
:root {
  --navy:         var(--brand-navy);
  --navy-mid:     var(--brand-navy-mid);
  --blue:         var(--brand-dark);
  --blue-mid:     var(--brand);
  --blue-light:   var(--brand-light);
  --blue-pale:    var(--brand-pale);
  --blue-soft:    var(--brand-soft);

  --white:        #ffffff;
  --bg:           #f8fafc;
  --surface:      #ffffff;
  --border:       #e2e8f0;
  --border-light: #f1f5f9;
  --text:         #0f172a;
  --text-2:       #334155;
  --text-muted:   #64748b;
  --text-light:   #94a3b8;

  --success:      #059669;
  --success-pale: #d1fae5;
  --warning:      #d97706;
  --warning-pale: #fef3c7;
  --danger:       #dc2626;
  --danger-pale:  #fee2e2;

  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    20px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --shadow:       0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:    0 20px 60px rgba(0,0,0,0.12);
  --shadow-brand: 0 4px 20px rgba(0,0,0,0.18);
  --navbar-h:     64px;
  --safe-top:     env(safe-area-inset-top, 0px);
  --safe-bottom:  env(safe-area-inset-bottom, 0px);
}

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

/* html background fills the overscroll bounce areas on iOS with brand navy.
   No padding on html — the navbar and footer handle safe zones themselves. */
html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
  background-color: #0d1b3e;
  background-image: linear-gradient(135deg, #0d1b3e 0%, #1a3160 100%);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* background-color must be set explicitly — gradients are background-image and
     do NOT paint iOS safe-area padding zones. background-color does. */
  background-color: #0d1b3e;
  background-image: linear-gradient(135deg, #0d1b3e 0%, #1a3160 100%);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  width: 100%;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Authenticated pages: navbar occupies safe-area-top + navbar height */
body.has-navbar {
  padding-top: calc(var(--navbar-h) + env(safe-area-inset-top, 0px));
}


a { color: var(--blue-mid); text-decoration: none; transition: color .15s; }
a:hover { color: var(--blue); }

/* ══════════════════════════════════════════════════════════════
   NAVBAR — sticky, collapses gracefully at all sizes
══════════════════════════════════════════════════════════════ */
.navbar {
  /* background-color MUST match the gradient's 0% stop.
     iOS Safari paints the safe-area zone (status bar) using background-color only,
     not background-image. Matching them makes the gradient seamless from top of screen. */
  background-color: #1e3970;
  background-image: linear-gradient(to bottom, #1e3970 0%, #0d1b3e 65%, #122248 100%);
  /* Fixed to viewport top — must include safe-area-inset-top as its own padding
     because position:fixed ignores html's padding-top offset */
  padding: env(safe-area-inset-top, 0px) clamp(1rem, 3vw, 2rem) 0;
  height: calc(var(--navbar-h) + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: flex-end;
  padding-bottom: 0.5rem;
  gap: 1rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
  width: 100%;
  overflow: hidden;
}

.navbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-light), var(--blue-pale), var(--blue-light), transparent);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand:hover { text-decoration: none; opacity: 0.88; }
.nav-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1;
}
.nav-brand-name {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.nav-brand-sub {
  font-size: 0.6rem;
  font-weight: 500;
  color: rgba(255,255,255,0.48);
  letter-spacing: 0.04em;
  line-height: 1;
  margin-top: 0.15rem;
  text-transform: uppercase;
}

.nav-logo-img {
  height: 36px; width: 36px;
  object-fit: contain;
  border-radius: 0;
  flex-shrink: 0;
}
.nav-logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--blue-mid), var(--blue-light));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex: 1;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  color: rgba(255,255,255,0.72);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: clamp(0.78rem, 1.5vw, 0.875rem);
  font-weight: 500;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 36px;
  display: flex; align-items: center;
}
.nav-links a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-links a.active { background: rgba(255,255,255,0.15); color: #fff; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--blue-mid), var(--blue-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.82rem; color: #fff;
  flex-shrink: 0;
}
.nav-name {
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem; font-weight: 500;
  max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-logout {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85) !important;
  padding: 0.38rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 500;
  text-decoration: none !important;
  transition: all .15s;
  white-space: nowrap;
  min-height: 36px;
  display: flex; align-items: center;
}
.btn-logout:hover { background: rgba(255,255,255,0.18); color: #fff !important; }

/* ─── Nav right area (desktop user info + hamburger) ─────────── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-user-desktop {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ─── Hamburger button ───────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 46px; height: 46px;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.22);
  border-radius: 12px;
  cursor: pointer;
  gap: 5.5px;
  flex-shrink: 0;
  transition: background .18s, border-color .18s, transform .18s;
}
.nav-hamburger:hover  { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.35); }
.nav-hamburger:active { transform: scale(0.94); }
.nav-hamburger span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .28s cubic-bezier(0.4,0,0.2,1), opacity .2s, width .2s;
  transform-origin: center;
}
/* Staggered bar widths for a premium feel */
.nav-hamburger span:nth-child(1) { width: 22px; }
.nav-hamburger span:nth-child(2) { width: 15px; align-self: flex-start; margin-left: 3.5px; }
.nav-hamburger span:nth-child(3) { width: 22px; }
/* Hamburger → X animation */
.nav-hamburger.nav-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); width: 22px; }
.nav-hamburger.nav-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.nav-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); width: 22px; }

/* ─── Mobile overlay ─────────────────────────────────────────── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5,12,30,0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 198;
  opacity: 0;
  transition: opacity .28s;
}
.nav-overlay.nav-open { opacity: 1; }

/* ─── Sign-out / user card / nav labels — hidden on desktop ──── */
.nav-signout-mobile  { display: none !important; }
.mobile-user-card    { display: none; }
.mobile-nav-links    { display: contents; }
.mobile-nav-label    { display: none; }

/* ══════════════════════════════════════════════════════════════
   MOBILE DRAWER — full redesign
══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .nav-hamburger     { display: flex; }
  .nav-user-desktop  { display: none; }
  .nav-overlay       { display: block; pointer-events: none; }
  .nav-overlay.nav-open { pointer-events: auto; }

  /* ── Drawer panel ── */
  .nav-links {
    position: fixed;
    top: calc(var(--navbar-h) + env(safe-area-inset-top, 0px));
    right: 0;
    width: min(82vw, 320px);
    height: calc(100dvh - var(--navbar-h) - env(safe-area-inset-top, 0px));
    background-color: #0c1e45;
    background-image:
      radial-gradient(ellipse 120% 40% at 60% 0%, rgba(40,80,160,0.45) 0%, transparent 70%),
      linear-gradient(to bottom, #122248 0%, #0c1e45 50%, #0d1b3e 100%);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 199;
    transform: translateX(110%);
    transition: transform .32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -16px 0 48px rgba(0,0,0,0.55), -2px 0 8px rgba(0,0,0,0.3);
  }
  .nav-links.nav-open { transform: translateX(0); }

  /* ── User hero card ── */
  .mobile-user-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 1.35rem 1.25rem 1.25rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.09) 0%, rgba(255,255,255,0.04) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
  }
  /* Subtle glowing orb behind avatar */
  .mobile-user-card::before {
    content: '';
    position: absolute;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(80,130,255,0.18) 0%, transparent 70%);
    top: -30px; left: -20px;
    pointer-events: none;
  }
  .mobile-user-avatar {
    width: 54px; height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-mid), var(--blue-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.08), 0 4px 16px rgba(0,0,0,0.35);
    position: relative;
    z-index: 1;
  }
  .mobile-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    position: relative;
    z-index: 1;
  }
  .mobile-user-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.02em;
  }
  .mobile-user-role {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 0.18rem 0.6rem;
    width: fit-content;
    letter-spacing: 0.01em;
  }

  /* ── Section label ── */
  .mobile-nav-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
    padding: 1.1rem 1.35rem 0.4rem;
    width: 100%;
    flex-shrink: 0;
  }

  /* ── Nav links ── */
  .mobile-nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0 0.75rem;
    gap: 0.1rem;
    flex-shrink: 0;
  }
  .mobile-nav-links a {
    width: 100%;
    font-size: 0.94rem;
    font-weight: 600;
    padding: 0.78rem 1rem;
    border-radius: 10px;
    color: rgba(255,255,255,0.72);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    transition: background .16s, color .16s, box-shadow .16s;
  }
  .mobile-nav-links a::after {
    content: '›';
    margin-left: auto;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.25;
    font-weight: 300;
    flex-shrink: 0;
  }
  .mobile-nav-links a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
  }
  .mobile-nav-links a:hover::after { opacity: 0.5; }
  .mobile-nav-links a.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-weight: 700;
    box-shadow: inset 3px 0 0 rgba(255,255,255,0.7);
  }
  .mobile-nav-links a.active::after { opacity: 0.55; }

  /* ── Sign out ── */
  .nav-signout-mobile {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0.75rem calc(max(env(safe-area-inset-bottom, 0px), 1rem) + 0.5rem);
    padding: 0.85rem 1rem;
    border-top: none;
    border: 1.5px solid rgba(220, 60, 60, 0.45);
    border-radius: 12px;
    background: rgba(220, 38, 38, 0.1) !important;
    width: calc(100% - 1.5rem);
    box-sizing: border-box;
    color: #ff8888 !important;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    flex-shrink: 0;
    transition: background .16s, border-color .16s, color .16s;
  }
  .nav-signout-mobile:hover {
    background: rgba(220,38,38,0.22) !important;
    border-color: rgba(220, 60, 60, 0.7) !important;
    color: #ffaaaa !important;
    text-decoration: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════════ */
.site-footer {
  background-color: #0d1b3e;
  background-image: linear-gradient(135deg, #0d1b3e 0%, #1a3160 100%);
  color: rgba(255,255,255,0.6);
  padding: 0 clamp(1rem, 4vw, 2rem) calc(clamp(1.5rem, 3vw, 2rem) + env(safe-area-inset-bottom, 0px));
  margin-top: auto;
  width: 100%;
  position: relative;
  overflow: hidden;
}
/* Decorative background orbs */
.site-footer::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  top: -120px; right: -80px;
  pointer-events: none;
}
.site-footer::after {
  content: '';
  position: absolute;
  width: 250px; height: 250px;
  border-radius: 50%;
  background: rgba(255,255,255,0.025);
  bottom: -60px; left: -40px;
  pointer-events: none;
}

.footer-shimmer {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-light), var(--blue-pale), var(--blue-light), transparent);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

/* Three-column grid */
.footer-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  position: relative; z-index: 1;
}

.footer-col {}

/* Brand column */
.footer-col-brand {}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  text-decoration: none;
}
.footer-logo-img {
  height: 36px; width: 36px;
  object-fit: contain;
  border-radius: 0;
  flex-shrink: 0;
}
.footer-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1;
}
.footer-brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.footer-brand-sub {
  font-size: 0.6rem;
  font-weight: 500;
  color: rgba(255,255,255,0.48);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 0.15rem;
}
.footer-tagline {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.65;
  max-width: 280px;
  margin-bottom: 1.25rem;
}
.footer-country-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem; font-weight: 600;
  color: rgba(255,255,255,0.75);
}
.footer-flag { font-size: 1rem; }

/* Column headings */
.footer-col-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 1.1rem;
}

/* Nav links in columns */
.footer-nav-links {
  display: flex; flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.footer-nav-links a {
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color .15s, padding-left .15s;
  display: inline-flex; align-items: center; gap: 0.4rem;
  text-decoration: none;
}
.footer-nav-links a::before {
  content: '';
  width: 0; height: 1px;
  background: var(--blue-light);
  transition: width .2s;
  display: inline-block;
}
.footer-nav-links a:hover {
  color: #fff;
  padding-left: 2px;
}
.footer-nav-links a:hover::before { width: 12px; }

/* Scout stats */
.footer-scout-info {
  display: flex; gap: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-scout-stat { display: flex; flex-direction: column; gap: 0.1rem; }
.footer-scout-stat-num {
  font-size: 1.2rem; font-weight: 800;
  color: #fff; letter-spacing: -0.03em;
}
.footer-scout-stat-label {
  font-size: 0.72rem; color: rgba(255,255,255,0.4);
  font-weight: 500;
}

/* Bottom bar */
.footer-bottom {
  max-width: 1200px; margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.25rem;
  font-size: 0.8rem; color: rgba(255,255,255,0.3);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.5rem;
  position: relative; z-index: 1;
}
.footer-bottom-left {
  display: flex; align-items: center; gap: 0.6rem;
}
.footer-bottom-logo img {
  height: 18px; width: auto; object-fit: contain;
  opacity: 0.5; border-radius: 3px;
  vertical-align: middle;
}
.footer-bottom-right { color: rgba(255,255,255,0.25); }

/* ══════════════════════════════════════════════════════════════
   MAIN CONTAINER — constrains interior pages, not home
══════════════════════════════════════════════════════════════ */
main.container {
  flex: 1;
  width: 100%;
  max-width: 100%;       /* Full viewport width — no navy strips on the sides */
  margin: 0;
  background: var(--bg);
  /* Horizontal padding grows on wide screens to keep content ≤1200px centered */
  padding: clamp(1rem, 3vw, 2.5rem)
           max(clamp(1rem, 3vw, 1.5rem), calc((100vw - 1200px) / 2));
}

/* Home page overrides — full bleed sections, transparent so body navy shows in safe zones */
main.container.home-page {
  padding: 0;
  max-width: 100%;
  background: transparent;
}

/* ══════════════════════════════════════════════════════════════
   FLASH MESSAGES
══════════════════════════════════════════════════════════════ */
.flash-messages { margin-bottom: 1.25rem; }
.alert {
  display: flex; align-items: flex-start; gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
  font-size: 0.88rem; font-weight: 500;
  border: 1px solid transparent;
  animation: slideDown .35s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.alert::before { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-pale); border-color: #a7f3d0; color: #065f46; }
.alert-success::before { content: '✓'; }
.alert-danger  { background: var(--danger-pale);  border-color: #fca5a5; color: #991b1b; }
.alert-danger::before  { content: '✕'; }
.alert-warning { background: var(--warning-pale); border-color: #fcd34d; color: #92400e; }
.alert-warning::before { content: '⚠'; }
.alert-info    { background: #e0f2fe; border-color: #7dd3fc; color: #075985; }
.alert-info::before    { content: 'ℹ'; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all .15s;
  text-decoration: none !important;
  white-space: nowrap;
  min-height: 40px;
  position: relative;
}
.btn:active { transform: scale(0.97); }

.btn-primary  { background: linear-gradient(135deg, var(--blue-mid), var(--blue-light)); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { filter: brightness(1.1); color: #fff; }

.btn-secondary { background: var(--bg); color: var(--text-2); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--border-light); color: var(--text); }

.btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.4); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.7); }

.btn-success { background: linear-gradient(135deg,#059669,#10b981); color:#fff; }
.btn-success:hover { filter: brightness(1.08); color:#fff; }
.btn-alumni  { background: linear-gradient(135deg,#c0392b,#e74c3c); color:#fff; box-shadow:0 4px 14px rgba(192,57,43,0.35); }
.btn-alumni:hover { filter: brightness(1.08); color:#fff; }
.btn-danger  { background: linear-gradient(135deg,#dc2626,#ef4444); color:#fff; }
.btn-danger:hover  { filter: brightness(1.08); color:#fff; }
.btn-warning { background: linear-gradient(135deg,#d97706,#f59e0b); color:#fff; }
.btn-warning:hover { filter: brightness(1.08); color:#fff; }
.btn-disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }

.btn-sm   { padding: 0.32rem 0.75rem; font-size: 0.8rem; min-height: 32px; }
.btn-lg   { padding: 0.8rem 2rem; font-size: 1rem; min-height: 48px; border-radius: var(--radius); }
.btn-full { width: 100%; }

/* ══════════════════════════════════════════════════════════════
   HOME / LANDING PAGE — truly full-width at all screen sizes
══════════════════════════════════════════════════════════════ */

/* Hero */
.hero {
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-mid) 45%, #1a3a8f 100%);
  color: #fff;
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 3rem) clamp(2.5rem, 6vw, 5rem);
  text-align: center;
  position: relative;
  overflow: hidden;
  width: 100%;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(255,255,255,0.04) 0%, transparent 70%);
  pointer-events: none;
}
.hero-orb { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.03); pointer-events: none; }
.hero-orb-1 { width: min(500px, 70vw); height: min(500px, 70vw); top: -30%; right: -15%; }
.hero-orb-2 { width: min(300px, 50vw); height: min(300px, 50vw); bottom: -10%; left: -8%; }

.hero-content { position: relative; z-index: 1; max-width: 780px; margin: 0 auto; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 0.38rem 1rem;
  border-radius: 20px;
  font-size: clamp(0.68rem, 1.5vw, 0.8rem); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--blue-pale);
  margin-bottom: clamp(1rem, 3vw, 1.75rem);
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.6rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: clamp(0.75rem, 2vw, 1.25rem);
}
.hero h1 span {
  background: linear-gradient(135deg, var(--blue-pale), var(--blue-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: rgba(255,255,255,0.7);
  max-width: 540px; margin: 0 auto clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.7;
}

.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(1.25rem, 5vw, 3rem);
  flex-wrap: wrap;
  margin-top: clamp(2rem, 5vw, 4rem);
  padding-top: clamp(1.5rem, 4vw, 3rem);
  border-top: 1px solid rgba(255,255,255,0.1);
  position: relative; z-index: 1;
}
.hero-stat-num {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 900; letter-spacing: -0.04em;
  background: linear-gradient(135deg, #fff, var(--blue-pale));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-stat-label { font-size: clamp(0.72rem, 1.5vw, 0.82rem); color: rgba(255,255,255,0.5); margin-top: 0.2rem; font-weight: 500; }

/* Sections */
.section { padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 2rem); width: 100%; }
.section-white { background: var(--white); }
.section-gray  { background: var(--bg); }
.section-navy  { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%); color: #fff; }

.section-inner { max-width: 1100px; margin: 0 auto; }

.section-label {
  display: inline-block;
  background: var(--blue-pale); color: var(--blue-mid);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.3rem 0.85rem; border-radius: 20px; margin-bottom: 0.85rem;
}
.section-navy .section-label { background: rgba(255,255,255,0.12); color: var(--blue-pale); }

.section-title {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.75rem; color: var(--text);
}
.section-navy .section-title { color: #fff; }
.section-sub { font-size: clamp(0.88rem, 1.8vw, 1rem); color: var(--text-muted); max-width: 520px; line-height: 1.7; margin-bottom: 2.5rem; }
.section-navy .section-sub { color: rgba(255,255,255,0.65); }

/* Feature cards */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(0.75rem, 2vw, 1.5rem);
}
.feature-card {
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow-sm); transition: all .2s;
  position: relative; overflow: hidden;
}
.feature-card::before { content: ''; position: absolute; top:0;left:0;right:0;height:3px; background: linear-gradient(90deg,var(--blue-mid),var(--blue-light)); opacity:0; transition:opacity .2s; }
.feature-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.feature-card:hover::before { opacity: 1; }
.feature-icon { width:50px;height:50px;background:var(--blue-soft);border-radius:var(--radius);display:flex;align-items:center;justify-content:center;font-size:1.4rem;margin-bottom:1rem;border:1px solid var(--blue-pale); }
.feature-card h3 { font-size:1rem;font-weight:700;margin-bottom:0.5rem; }
.feature-card p  { font-size:0.87rem;color:var(--text-muted);line-height:1.7; }

/* How it works */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: clamp(1.25rem, 4vw, 2rem);
}
.step-card { text-align: center; }
.step-num { width:52px;height:52px;background:linear-gradient(135deg,var(--blue-mid),var(--blue-light));border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:1.2rem;font-weight:900;color:#fff;margin:0 auto 1rem;box-shadow:var(--shadow-brand); }
.step-card h3 { font-size:0.95rem;font-weight:700;margin-bottom:0.5rem; }
.step-card p  { font-size:0.86rem;color:var(--text-muted);line-height:1.7; }

/* Roles */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: clamp(0.75rem, 2vw, 1.25rem);
}
.role-card { background:rgba(255,255,255,0.07);border:1px solid rgba(255,255,255,0.12);border-radius:var(--radius);padding:clamp(1.25rem, 3vw, 1.75rem) 1.25rem;text-align:center;transition:all .2s; }
.role-card:hover { background:rgba(255,255,255,0.12);transform:translateY(-3px); }
.role-icon  { font-size:2rem;margin-bottom:0.75rem;display:block; }
.role-title { font-size:0.95rem;font-weight:700;color:#fff;margin-bottom:0.4rem; }
.role-desc  { font-size:0.82rem;color:rgba(255,255,255,0.55);line-height:1.6; }

/* CTA */
.cta-section { background:linear-gradient(135deg,var(--navy) 0%,#1a3a8f 100%);padding:clamp(3rem,7vw,5rem) clamp(1rem,4vw,2rem);text-align:center;position:relative;overflow:hidden;width:100%; }
.cta-section::before { content:'';position:absolute;inset:0;background:radial-gradient(ellipse 60% 80% at 50% 50%,rgba(255,255,255,0.04) 0%,transparent 70%); }
.cta-content { position:relative;z-index:1;max-width:600px;margin:0 auto; }
.cta-section h2 { font-size:clamp(1.6rem,4vw,2.6rem);font-weight:900;color:#fff;letter-spacing:-0.03em;margin-bottom:1rem; }
.cta-section p  { color:rgba(255,255,255,0.65);font-size:clamp(0.88rem,2vw,1rem);margin-bottom:2rem;line-height:1.7; }
.cta-buttons { display:flex;gap:0.75rem;justify-content:center;flex-wrap:wrap; }

/* ══════════════════════════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════════════════════════ */
.auth-wrapper {
  min-height: 100dvh;
  display: flex;
  width: 100%;
}

.auth-side {
  flex: 0 0 clamp(260px, 38%, 440px);
  /* Split background-color + background-image so iOS safe-area zone (painted via
     background-color only) matches the gradient's 0% stop exactly. */
  background-color: #0d1b3e;
  background-image: linear-gradient(to bottom, #0d1b3e 0%, #122868 55%, #1a3a8f 100%);
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
  padding-top: calc(env(safe-area-inset-top, 0px) + clamp(2rem, 4vw, 3rem));
  position: relative; overflow: hidden;
}
.auth-side::before { content:'';position:absolute;width:min(400px,80vw);height:min(400px,80vw);border-radius:50%;background:rgba(255,255,255,0.05);top:-25%;right:-20%; }
.auth-side::after  { content:'';position:absolute;width:min(250px,50vw);height:min(250px,50vw);border-radius:50%;background:rgba(255,255,255,0.04);bottom:-15%;left:-10%; }
.auth-side-content { position:relative;z-index:1; }
.auth-side-logo { display:flex;align-items:center;justify-content:center;gap:0.75rem;margin-bottom:2rem; }
.auth-side-icon { width:52px;height:52px;display:flex;align-items:center;justify-content:center;flex-shrink:0; }
.auth-side-icon img { width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 2px 8px rgba(0,0,0,0.4)); }
.auth-side-title { font-size:1rem;font-weight:800;color:#fff;line-height:1.2; }
.auth-side-sub   { font-size:0.76rem;color:rgba(255,255,255,0.5); }
.auth-side h2 { color:#fff;font-size:clamp(1.4rem,3vw,2rem);font-weight:800;line-height:1.2;margin-bottom:0.85rem;letter-spacing:-0.03em; }
.auth-side p  { color:rgba(255,255,255,0.6);font-size:0.9rem;line-height:1.7;margin-bottom:1.75rem; }
.auth-perks { list-style:none;display:flex;flex-direction:column;gap:0.8rem; }
.auth-perks li { display:flex;align-items:center;gap:0.7rem;color:rgba(255,255,255,0.8);font-size:0.87rem; }
.auth-perks li::before { content:'✓';width:22px;height:22px;background:rgba(255,255,255,0.1);border:1px solid rgba(255,255,255,0.2);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:0.7rem;color:var(--blue-pale);flex-shrink:0; }

.auth-main {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem);
  background: var(--white);
  overflow-y: auto;
}
.auth-form-box { width: 100%; max-width: 400px; }
.auth-form-title { font-size: clamp(1.3rem, 3vw, 1.6rem); font-weight: 800; color: var(--text); letter-spacing: -0.03em; margin-bottom: 0.3rem; }
.auth-form-sub   { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1.75rem; }

.auth-wrapper-centered {
  min-height: 100dvh;
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(0.75rem, 3vw, 1rem);
  padding-top: calc(env(safe-area-inset-top, 0px) + clamp(1.25rem, 4vw, 2.5rem));
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(1.25rem, 4vw, 2.5rem));
  background: var(--bg);
  width: 100%;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  width: 100%;
  max-width: 680px;
  border: 1px solid var(--border-light);
}
.auth-card-header { text-align:center;margin-bottom:1.75rem;padding-bottom:1.25rem;border-bottom:1px solid var(--border-light); }
.logo-icon-lg { width:52px;height:52px;background:linear-gradient(135deg,var(--blue-mid),var(--blue-light));border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:1.5rem;margin:0 auto 0.85rem;box-shadow:var(--shadow-brand);overflow:hidden; }
.logo-icon-lg img { width:100%;height:100%;object-fit:contain; }
.auth-card-header h1 { font-size:clamp(1.2rem,2.5vw,1.4rem);font-weight:800;color:var(--text); }
.auth-card-header p  { color:var(--text-muted);font-size:0.87rem;margin-top:0.2rem; }
.auth-footer-text { text-align:center;margin-top:1.25rem;color:var(--text-muted);font-size:0.87rem; }

/* ══════════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1rem; }
.form-group label { display:block;font-size:0.82rem;font-weight:600;color:var(--text-2);margin-bottom:0.38rem; }
.form-group input,
.form-group select,
.form-group textarea {
  width:100%;
  box-sizing: border-box;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  transition: all .15s;
  outline: none;
  min-height: 44px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--blue-mid); box-shadow: 0 0 0 3px var(--blue-soft); }
.form-group input::placeholder { color: var(--text-light); }
.form-group input[type="date"] {
  height: 44px;
  -webkit-appearance: none;
  appearance: none;
}
.form-group-sm input { min-height: 38px; font-size: 0.87rem; }

/* ── Searchable group select ───────────────────────────────── */
.group-select-wrap {
  position: relative;
}
.group-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 2.2rem 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  height: 44px;
  cursor: pointer;
}
.group-search-input:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px var(--blue-soft);
  cursor: text;
}
.group-select-arrow {
  position: absolute;
  right: 0.85rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
  transition: transform .2s;
}
.group-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  z-index: 500;
  list-style: none;
  padding: 0.3rem 0;
  margin: 0;
}
.group-dropdown.open { display: block; }
.group-dropdown li {
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  transition: background .1s;
}
.group-dropdown li:hover,
.group-dropdown li.active {
  background: var(--blue-soft);
  color: var(--blue);
}

/* ─── Phone input with +961 prefix ──────────────────────────── */
.phone-input-group {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  min-height: 44px;
  width: 100%;
  box-sizing: border-box;
}
.phone-input-group:focus-within {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.phone-prefix {
  padding: 0 0.75rem;
  background: var(--bg);
  border-right: 1.5px solid var(--border);
  color: var(--text-2);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.phone-input-group input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  font-family: inherit;
  background: transparent;
  color: var(--text);
  outline: none;
  min-height: unset;
  width: 100%;
}
.phone-input-group input:focus {
  box-shadow: none !important;
}
.form-row   { display:flex;align-items:center;justify-content:space-between;margin-bottom:1.1rem; }
.form-row-2 { display:grid;grid-template-columns:1fr 1fr;gap:0.85rem; }
.form-row-3 { display:grid;grid-template-columns:1fr 1fr 1fr;gap:0.85rem; }
.form-check { font-size:0.87rem;color:var(--text-muted); }
.form-check label { display:flex;align-items:center;gap:0.4rem;cursor:pointer; }

/* ══════════════════════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════════════════════ */
.page-header { margin-bottom:1.75rem;padding-bottom:1.25rem;border-bottom:1px solid var(--border-light);display:flex;align-items:center;gap:0.85rem;flex-wrap:wrap; }
.page-header h2 { font-size:clamp(1.3rem,3vw,1.7rem);font-weight:800;color:var(--text);letter-spacing:-0.03em;flex:1;min-width:160px; }
.page-header p  { color:var(--text-muted);font-size:0.9rem;width:100%;margin-top:-0.4rem; }
.section-header { display:flex;align-items:center;justify-content:space-between;margin-bottom:0.85rem;flex-wrap:wrap;gap:0.5rem; }
.section-header h3 { font-size:1rem;font-weight:700;color:var(--text); }

/* ══════════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════════ */
.badge { display:inline-flex;align-items:center;padding:0.22rem 0.65rem;border-radius:20px;font-size:0.7rem;font-weight:700;letter-spacing:0.03em;white-space:nowrap;text-transform:uppercase; }
.badge-scout         { background:var(--blue-pale);    color:var(--blue-mid); }
.badge-alumni        { background:#fde8e8;             color:#9b1c1c; }
.badge-cg            { background:#e0e7ff;             color:#3730a3; }
.badge-business      { background:#f3e8ff;             color:#6b21a8; }
.badge-chef_louvetaux { background:#d1fae5;            color:#065f46; }
.badge-chef_troupe   { background:#fce7f3;             color:#9d174d; }
.badge-chef_clan     { background:#fff7ed;             color:#9a3412; }
/* Branch labels */
.badge-branch-louvetaux  { background:#d1fae5; color:#065f46; }
.badge-branch-eclaireurs { background:#dbeafe; color:#1e40af; }
.badge-branch-routiers   { background:#ede9fe; color:#5b21b6; }
.badge-branch-none       { background:#f1f5f9; color:#475569; }
.badge-admin    { background:var(--danger-pale);  color:#991b1b; }
.badge-success  { background:var(--success-pale); color:#065f46; }
.badge-muted    { background:var(--border-light); color:var(--text-muted); }
.badge-available{ background:var(--success-pale); color:#065f46; }
.badge-used     { background:var(--border-light); color:var(--text-light); }

/* ══════════════════════════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════════════════════════ */
.card-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));gap:clamp(0.6rem,2vw,1rem);margin-bottom:1.75rem; }
.stat-card { background:var(--white);border:1px solid var(--border-light);border-radius:var(--radius);padding:clamp(1rem,2.5vw,1.5rem) 1rem;text-align:center;box-shadow:var(--shadow-sm);transition:all .2s;position:relative;overflow:hidden; }
.stat-card::before { content:'';position:absolute;top:0;left:0;right:0;height:3px;background:var(--border-light);transition:background .2s; }
.stat-card:hover { box-shadow:var(--shadow);transform:translateY(-2px); }
.stat-card:hover::before { background:var(--blue-mid); }
.stat-card-highlight { border-color:var(--blue-pale); }
.stat-card-highlight::before { background:linear-gradient(90deg,var(--blue-mid),var(--blue-light)); }
.stat-card-warning { border-color:#fde68a; }
.stat-card-warning::before { background:linear-gradient(90deg,var(--warning),#fbbf24); }
.stat-num { font-size:clamp(1.6rem,4vw,2.25rem);font-weight:800;color:var(--text);line-height:1;letter-spacing:-0.04em; }
.stat-card-highlight .stat-num { color:var(--blue-mid); }
.stat-card-warning   .stat-num { color:var(--warning); }
.stat-label { font-size:0.72rem;color:var(--text-muted);margin-top:0.35rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em; }

/* ══════════════════════════════════════════════════════════════
   TABLES — horizontal scroll on small screens
══════════════════════════════════════════════════════════════ */
.table-wrapper { background:var(--white);border-radius:var(--radius);box-shadow:var(--shadow-sm);border:1px solid var(--border-light);overflow-x:auto;overflow-y:visible;width:100%;max-width:100%;-webkit-overflow-scrolling:touch; }
.table-scroll  { overflow-x:auto; }

table { width:100%;border-collapse:collapse;font-size:clamp(0.8rem,1.5vw,0.88rem); }
thead { background:linear-gradient(135deg,var(--navy),var(--navy-mid)); }
thead th { padding:clamp(0.6rem,1.5vw,0.9rem) clamp(0.6rem,1.5vw,1rem);text-align:left;font-weight:600;font-size:clamp(0.68rem,1.2vw,0.75rem);text-transform:uppercase;letter-spacing:0.06em;color:rgba(255,255,255,0.85);white-space:nowrap; }
tbody tr { border-bottom:1px solid var(--border-light);transition:background .1s; }
tbody tr:hover { background:var(--blue-soft); }
tbody tr:last-child { border-bottom:none; }
td { padding:clamp(0.6rem,1.5vw,0.8rem) clamp(0.6rem,1.5vw,1rem);vertical-align:middle;color:var(--text-2); }
.text-truncate { max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }

/* ══════════════════════════════════════════════════════════════
   STATUS CARDS
══════════════════════════════════════════════════════════════ */
.status-card { background:var(--white);border-radius:var(--radius-lg);padding:clamp(1.75rem,4vw,3rem) clamp(1.25rem,4vw,2.5rem);text-align:center;box-shadow:var(--shadow);max-width:480px;margin:1.5rem auto;border:1px solid var(--border-light);position:relative;overflow:hidden; }
.status-card::before { content:'';position:absolute;top:0;left:0;right:0;height:4px; }
.status-pending::before  { background:linear-gradient(90deg,var(--warning),#fbbf24); }
.status-rejected::before { background:linear-gradient(90deg,var(--danger),#ef4444); }
.status-alumni::before   { background:linear-gradient(90deg,#c0392b,#e74c3c); }
.status-icon { font-size:clamp(2.5rem,6vw,3.5rem);margin-bottom:0.85rem;display:block; }
.status-card h3 { font-size:clamp(1.1rem,2.5vw,1.35rem);font-weight:800;margin-bottom:0.65rem; }
.status-card p  { color:var(--text-muted);font-size:0.9rem;line-height:1.7; }

/* ══════════════════════════════════════════════════════════════
   DIGITAL CARD
══════════════════════════════════════════════════════════════ */
.digital-card { background:linear-gradient(135deg,var(--navy) 0%,#1a3a8f 50%,var(--blue-mid) 100%);color:#fff;border-radius:20px;overflow:hidden;max-width:min(380px,100%);box-shadow:0 20px 60px rgba(0,0,0,0.3);position:relative; }
.digital-card-alumni { background:linear-gradient(135deg,#7b1416 0%,#c0392b 55%,#e74c3c 100%); box-shadow:0 20px 60px rgba(192,57,43,0.35); }
.digital-card::before { content:'';position:absolute;width:200px;height:200px;border-radius:50%;background:rgba(255,255,255,0.04);top:-60px;right:-60px; }
.digital-card-header { background:rgba(0,0,0,0.25);padding:0.85rem 1.25rem;font-size:0.75rem;font-weight:700;display:flex;align-items:center;gap:0.5rem;letter-spacing:0.05em;text-transform:uppercase;position:relative;z-index:1; }
.digital-card-body   { padding:1.5rem 1.25rem;position:relative;z-index:1; }
.digital-card-name   { font-size:clamp(1.2rem,3vw,1.6rem);font-weight:800;margin-bottom:0.5rem; }
.digital-card-meta   { font-size:0.83rem;opacity:0.75;margin-bottom:1rem;display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap; }
.digital-card-id     { font-size:0.7rem;opacity:0.45;font-family:monospace;letter-spacing:0.1em; }

/* ══════════════════════════════════════════════════════════════
   OFFERS GRID
══════════════════════════════════════════════════════════════ */
.offers-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:clamp(0.75rem,2vw,1.25rem); }
.offer-card { background:var(--white);border:1px solid var(--border-light);border-radius:var(--radius);padding:clamp(1rem,2.5vw,1.5rem);box-shadow:var(--shadow-sm);display:flex;flex-direction:column;gap:0.75rem;transition:all .2s;position:relative;overflow:hidden; }
.offer-card::before { content:'';position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,var(--blue-mid),var(--blue-light)); }
.offer-card:hover { box-shadow:var(--shadow);transform:translateY(-2px); }
.offer-card-used { opacity:0.6; }
.offer-card-used::before { background:var(--border); }
.offer-card-header { display:flex;justify-content:space-between;align-items:flex-start;gap:0.5rem; }
.offer-card-header h3 { font-size:1rem;font-weight:700;color:var(--text); }
.offer-address    { font-size:0.82rem;color:var(--text-muted); }
.offer-description{ font-size:0.87rem;color:var(--text-muted);flex:1;line-height:1.6; }
.redeem-form { margin-top:auto; }

/* ══════════════════════════════════════════════════════════════
   REDEEM LIVE
══════════════════════════════════════════════════════════════ */
.redeem-live-wrapper { display:flex;flex-direction:column;align-items:center;padding:clamp(1rem,3vw,2rem) 1rem;min-height:60vh;justify-content:center;width:100%; }
.redeem-live-card { background:var(--white);border:2px solid var(--blue-mid);border-radius:clamp(16px,3vw,24px);padding:clamp(1.5rem,4vw,2.5rem);max-width:min(440px,100%);width:100%;text-align:center;box-shadow:0 20px 60px rgba(0,0,0,0.1);position:relative;overflow:hidden; }
.redeem-live-card::before { content:'';position:absolute;top:0;left:0;right:0;height:4px;background:linear-gradient(90deg,var(--blue-mid),var(--blue-light)); }
.redeem-live-card.redeem-expired { border-color:var(--danger); }
.redeem-live-card.redeem-expired::before { background:linear-gradient(90deg,var(--danger),#ef4444); }
.redeem-live-header { font-size:0.72rem;font-weight:700;color:var(--blue-mid);margin-bottom:1.25rem;display:flex;align-items:center;justify-content:center;gap:0.5rem;text-transform:uppercase;letter-spacing:0.08em; }
.redeem-restaurant { font-size:clamp(1.3rem,4vw,1.75rem);font-weight:800;color:var(--text);margin-bottom:0.4rem;letter-spacing:-0.02em; }
.redeem-offer-text { font-size:0.87rem;color:var(--text-muted);margin-bottom:1.25rem; }
.redeem-status-label { display:inline-block;background:var(--success-pale);color:var(--success);font-size:0.73rem;font-weight:800;padding:0.3rem 1rem;border-radius:20px;letter-spacing:0.12em;text-transform:uppercase;margin-bottom:1.25rem;border:1px solid #a7f3d0; }
.redeem-status-label.status-expired { background:var(--danger-pale);color:var(--danger);border-color:#fca5a5; }
.redeem-timer { font-size:clamp(3rem,10vw,5rem);font-weight:900;color:var(--text);font-variant-numeric:tabular-nums;line-height:1;margin-bottom:0.25rem;transition:color .3s; }
.redeem-timer.timer-warning { color:var(--danger); }
.redeem-timer-label { font-size:0.75rem;color:var(--text-muted);margin-bottom:1.5rem;text-transform:uppercase;letter-spacing:0.08em;font-weight:600; }
.redeem-meta { background:var(--bg);border-radius:var(--radius-sm);padding:0.85rem 1rem;font-size:0.82rem;text-align:left;display:flex;flex-direction:column;gap:0.35rem;border:1px solid var(--border-light); }
.redeem-expired-msg { padding:1rem 0; }
.redeem-expired-icon { font-size:2.5rem;margin-bottom:0.75rem; }
@keyframes pulse-border { 0%,100%{border-color:var(--blue-mid)} 50%{border-color:var(--blue-light)} }
.redeem-live-card:not(.redeem-expired) { animation:pulse-border 3s ease-in-out infinite; }

/* ══════════════════════════════════════════════════════════════
   BAR CHART
══════════════════════════════════════════════════════════════ */
.bar-chart-wrapper { display:flex;align-items:flex-end;gap:0.5rem;padding:1.25rem 1rem 0;background:var(--white);border:1px solid var(--border-light);border-radius:var(--radius);min-height:180px;box-shadow:var(--shadow-sm);overflow-x:auto;-webkit-overflow-scrolling:touch; }
.bar-col { display:flex;flex-direction:column;align-items:center;gap:0.35rem;min-width:48px;flex:1; }
.bar { width:100%;max-width:40px;background:linear-gradient(180deg,var(--blue-light),var(--blue-mid));border-radius:5px 5px 0 0;min-height:4px;transition:all .2s; }
.bar:hover { filter:brightness(1.15); }
.bar-label     { font-size:0.68rem;color:var(--text-muted);text-align:center;padding-bottom:0.6rem;font-weight:500; }
.bar-label-top { font-size:0.75rem;font-weight:700;color:var(--blue-mid); }

/* ══════════════════════════════════════════════════════════════
   MISC COMPONENTS
══════════════════════════════════════════════════════════════ */
.info-box { background:var(--blue-soft);border:1px solid var(--blue-pale);border-left:3px solid var(--blue-mid);border-radius:var(--radius-sm);padding:0.8rem 1rem;font-size:0.86rem;color:#1e40af;margin-bottom:1rem;line-height:1.6; }

.quick-actions { display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,150px),1fr));gap:clamp(0.6rem,2vw,1rem); }
.quick-action-card { background:var(--white);border:1px solid var(--border-light);border-radius:var(--radius);padding:clamp(1.25rem,3vw,1.75rem) 1rem;text-align:center;text-decoration:none !important;color:var(--text);transition:all .2s;box-shadow:var(--shadow-sm);position:relative;overflow:hidden; }
.quick-action-card::before { content:'';position:absolute;top:0;left:0;right:0;height:3px;background:var(--border-light);transition:background .2s; }
.quick-action-card:hover { border-color:var(--blue-pale);box-shadow:var(--shadow);transform:translateY(-3px); }
.quick-action-card:hover::before { background:linear-gradient(90deg,var(--blue-mid),var(--blue-light)); }
.qa-icon  { font-size:2rem;margin-bottom:0.5rem;display:block; }
.qa-label { font-size:0.82rem;font-weight:600;color:var(--text-2); }

.filter-bar { display:flex;align-items:center;gap:0.65rem;margin-bottom:1rem;flex-wrap:wrap;background:var(--white);padding:0.75rem 1rem;border-radius:var(--radius-sm);border:1px solid var(--border-light);box-shadow:var(--shadow-sm); }
.filter-bar select { padding:0.42rem 0.85rem;border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:0.87rem;background:var(--bg);outline:none;cursor:pointer;font-family:inherit;min-height:38px; }

.two-col-layout { display:grid;grid-template-columns:minmax(0,1fr) clamp(280px,30%,400px);gap:clamp(1rem,2vw,1.5rem);align-items:start; }
.two-col-layout > * { min-width: 0; }
.form-card { background:var(--white);border:1px solid var(--border-light);border-radius:var(--radius);padding:clamp(1.25rem,3vw,1.75rem);box-shadow:var(--shadow-sm);max-width:100%;box-sizing:border-box; }
.form-card h3 { font-size:0.95rem;font-weight:700;margin-bottom:1rem;color:var(--text);padding-bottom:0.65rem;border-bottom:1px solid var(--border-light); }

.modal-overlay { position:fixed;inset:0;background:rgba(15,23,42,0.6);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:1000;padding:1rem;animation:fadeIn .2s ease; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.modal { background:var(--white);border-radius:var(--radius-lg);padding:clamp(1.25rem,3vw,2rem);width:100%;max-width:560px;box-shadow:var(--shadow-lg);max-height:90vh;overflow-y:auto;animation:scaleUp .2s ease;border:1px solid var(--border-light); }
@keyframes scaleUp { from{transform:scale(0.95);opacity:0} to{transform:scale(1);opacity:1} }
.modal-header { display:flex;justify-content:space-between;align-items:center;margin-bottom:1.25rem;padding-bottom:0.85rem;border-bottom:1px solid var(--border-light); }
.modal-header h3 { font-size:1.05rem;font-weight:700; }
.modal-close { background:var(--bg);border:1px solid var(--border);font-size:1rem;cursor:pointer;color:var(--text-muted);padding:0;border-radius:6px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;transition:all .15s;flex-shrink:0; }
.modal-close:hover { background:var(--border);color:var(--text); }
.modal-actions { display:flex;gap:0.65rem;justify-content:flex-end;margin-top:1.25rem;padding-top:0.85rem;border-top:1px solid var(--border-light);flex-wrap:wrap; }

.pagination { display:flex;align-items:center;gap:0.85rem;justify-content:center;margin-top:1.25rem;flex-wrap:wrap; }
.page-info { font-size:0.87rem;color:var(--text-muted);font-weight:500; }

.empty-state { text-align:center;padding:clamp(2rem,5vw,4rem) 1rem;color:var(--text-muted);background:var(--white);border-radius:var(--radius);border:1px dashed var(--border); }
.empty-icon { font-size:3rem;margin-bottom:0.75rem;display:block;opacity:0.6; }

.text-muted  { color: var(--text-muted) !important; }
.link-subtle { color:var(--text-muted);font-size:0.87rem;transition:color .15s; }
.link-subtle:hover { color:var(--blue-mid); }
hr { border:none;border-top:1px solid var(--border-light);margin:1rem 0; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
══════════════════════════════════════════════════════════════ */

/* ── Tablet ≤ 900px ──────────────────────────────────────────── */
@media (max-width: 900px) {
  /* Footer: two-column on tablet */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .footer-col-brand { grid-column: 1 / -1; }
  .footer-tagline { max-width: 100%; }

  /* Auth: stack side panel above form */
  .auth-wrapper { flex-direction: column; }
  .auth-side { flex: none; min-height: auto; padding: clamp(1.5rem,4vw,2.5rem); padding-top: calc(env(safe-area-inset-top, 0px) + clamp(1.5rem,4vw,2.5rem)); }
  .auth-perks { display: none; }
  .auth-side p { display: none; }
  .auth-side h2 { font-size: clamp(1.2rem,3vw,1.6rem); margin-bottom: 0; }
  .auth-main { padding: clamp(1.5rem,4vw,2.5rem) clamp(1rem,3vw,2rem); align-items: flex-start; }

  /* Two-col layout stacks */
  .two-col-layout { grid-template-columns: minmax(0, 1fr); }
  .two-col-layout > * { min-width: 0; }

  /* Tables scroll horizontally */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── Mobile ≤ 640px ──────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Footer: compact single column on mobile */
  .site-footer { padding-top: 0; }
  .footer-shimmer { margin-bottom: 1.25rem; }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .footer-col-brand { grid-column: auto; }
  .footer-tagline { margin-bottom: 0.75rem; font-size: 0.82rem; }
  .footer-country-badge { padding: 0.2rem 0.65rem; font-size: 0.75rem; }
  .footer-col-title { margin-bottom: 0.6rem; }
  .footer-nav-links { gap: 0.4rem; margin-bottom: 0.75rem; }
  .footer-col-org { display: none; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.3rem; padding-top: 1rem; }
  .footer-bottom-right { display: none; }

  /* Navbar bar on mobile */
  .navbar {
    height: calc(var(--navbar-h) + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 1rem 0;
    align-items: flex-end;
    padding-bottom: 0.5rem;
  }
  .nav-brand .nav-logo-img { height: 44px; width: 44px; }
  .nav-brand-name { font-size: 1.2rem; }
  .nav-brand-sub  { font-size: 0.65rem; margin-top: 0.2rem; }
  .nav-name  { display: none; }

  /* Forms: single column */
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }

  /* iOS Safari zoom prevention — font-size must be >= 16px on inputs */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Stat cards: 2 per row on small phones */
  .card-grid { grid-template-columns: repeat(2, 1fr); }

  /* Footer stacks */
  .footer-inner { flex-direction: column; }
  .footer-links { display: none; }
  .footer-bottom { flex-direction: column; gap: 0.25rem; }

  /* CTA/Hero buttons: full width on tiny screens */
  .hero-cta, .cta-buttons { flex-direction: column; align-items: stretch; }
  .hero-cta .btn, .cta-buttons .btn { width: 100%; max-width: 340px; margin: 0 auto; }

  /* Hero stats: 2 across */
  .hero-stats { gap: 1rem; }
  .hero-stats > div { min-width: 40%; text-align: center; }

  /* Tables: ensure they scroll */
  .table-wrapper { overflow-x: auto; }
  table { min-width: 480px; }

  /* Quick actions: 2 across */
  .quick-actions { grid-template-columns: repeat(2, 1fr); }

  /* Modal: full width on phones */
  .modal { border-radius: var(--radius); padding: 1.25rem; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }

  /* Auth card on phones */
  .auth-card { border-radius: var(--radius); }
}

/* ── Very small phones ≤ 380px ───────────────────────────────── */
@media (max-width: 380px) {
  .card-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .nav-avatar { display: none; }
}


/* ── Location Picker ─────────────────────────────────────────── */
.loc-picker-host { display: block; }
.lp-wrapper { position: relative; display: block; }

.lp-search {
  width: 100%;
  padding: 0.55rem 2.2rem 0.55rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
  transition: border-color .18s, box-shadow .18s;
  cursor: pointer;
}
.lp-search:focus {
  outline: none;
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.lp-search.lp-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15) !important;
}
.lp-chevron {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: transform .2s;
  line-height: 1;
  margin-top: 1px;
}
.lp-dropdown {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 9999;
  box-shadow: 0 8px 28px rgba(0,0,0,0.16);
  scroll-behavior: smooth;
}
.lp-group {
  padding: 0.55rem 0.85rem 0.2rem;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg, #f8fafc);
  border-top: 1px solid var(--border);
  position: sticky;
  top: 0;
}
.lp-group.lp-group-first { border-top: none; }
.lp-option {
  padding: 0.45rem 0.85rem 0.45rem 1.4rem;
  font-size: 0.91rem;
  color: var(--text);
  cursor: pointer;
  transition: background .1s;
}
.lp-option mark {
  background: rgba(59,130,246,0.18);
  color: var(--primary, #1e3970);
  border-radius: 2px;
  font-weight: 600;
}
.lp-option:hover,
.lp-option.lp-active {
  background: rgba(30,57,112,0.07);
  color: var(--primary, #1e3970);
}
.lp-empty {
  padding: 0.9rem 0.85rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}
.lp-has-error .lp-search { border-color: #ef4444; }
