/* ============================================================
   IVACCESS — Premium Dashboard Stylesheet
   Aesthetic: Luxury Dark / Art Deco Event Portal
   Fonts: Cormorant Garamond (display) + Outfit (UI)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Outfit:wght@300;400;500;600&family=DM+Mono:ital,wght@0,400;0,500;1,400&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand gold ramp */
  --iv-gold:         #C9A84C;
  --iv-gold-light:   #E8C96A;
  --iv-gold-pale:    #F5E9C4;
  --iv-gold-mid:     #B8942E;
  --iv-gold-dark:    #8A6A1E;
  --iv-gold-deep:    #5C4412;

  /* Dark surface ramp */
  --iv-bg:    #101010;
  --iv-dark:  #141414;
  --iv-dark2: #1A1A1A;
  --iv-dark3: #202020;
  --iv-dark4: #282828;
  --iv-dark5: #323232;
  --iv-dark6: #3B3B3B;

  /* Text */
  --iv-white:  #F0EDE6;
  --iv-off:    #C8C4BA;
  --iv-muted:  #706C62;
  --iv-faint:  #3A3730;

  /* Semantic */
  --iv-success:    #2ECC71;
  --iv-warning:    #F39C12;
  --iv-danger:     #E74C3C;
  --iv-info:       #3498DB;
  --iv-whatsapp:   #25D366;

  /* Gold glow */
  --gold-glow:    rgba(201, 168, 76, 0.18);
  --gold-glow-md: rgba(201, 168, 76, 0.28);
  --gold-glow-lg: rgba(201, 168, 76, 0.45);

  /* Spacing */
  --sidebar-w: 240px;
  --topbar-h:  60px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ── Fonts ───────────────────────────────────────────────── */
html {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  /* A deep, almost black background */
  background-color: #0a0a0a; 
  color: var(--iv-white, #ffffff);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  
  /* Layer 1: A subtle vignette (darker edges)
    Layer 2: The complex damask-style SVG pattern 
  */
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.6) 100%),
    url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23C9A84C' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
  
  /* Adjusted sizing for a denser, more intricate feel */
  background-size: auto, 150px 150px; 
  background-repeat: repeat;
  background-attachment: fixed;
}



/* ── Selection ───────────────────────────────────────────── */
::selection { background: var(--iv-gold-dark); color: var(--iv-white); }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--iv-dark5); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--iv-gold-dark); }

/* ── Page-load fade ──────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.5); opacity: 0.6; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

#app { animation: fadeUp 0.45s var(--ease-out) both; }

/* ══════════════════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════════════════ */
.topbar {
  height: var(--topbar-h);
  background: rgba(14, 14, 14, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(201, 168, 76, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 200;
  /* Gold line accent at bottom */
  box-shadow: 0 1px 0 rgba(201,168,76,0.08), 0 8px 32px rgba(0,0,0,0.6);
}

/* Decorative topbar left-edge gold bar */
.topbar::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--iv-gold-light), var(--iv-gold-dark));
  border-radius: 0 2px 2px 0;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(201,168,76,0.3));
  transition: filter 0.3s;
}
.topbar-logo-img:hover {
  filter: drop-shadow(0 0 14px rgba(201,168,76,0.55));
}

.topbar-nav {
  display: flex;
  gap: 2px;
  background: var(--iv-dark3);
  border-radius: var(--radius-md);
  padding: 4px;
  border: 0.5px solid var(--iv-faint);
}

.nav-btn {
  background: none;
  border: none;
  color: var(--iv-muted);
  padding: 6px 16px;
  border-radius: 7px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: all 0.18s var(--ease-out);
  white-space: nowrap;
  position: relative;
}
.nav-btn:hover {
  color: var(--iv-white);
  background: var(--iv-dark4);
}
.nav-btn.active {
  color: var(--iv-gold);
  background: linear-gradient(135deg, rgba(201,168,76,0.15), rgba(201,168,76,0.06));
  box-shadow: inset 0 0 0 0.5px rgba(201,168,76,0.35);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--iv-gold-mid), var(--iv-gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--iv-dark);
  border: 1.5px solid var(--iv-gold);
  box-shadow: 0 0 12px var(--gold-glow);
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.avatar:hover { box-shadow: 0 0 20px var(--gold-glow-md); }

/* ══════════════════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════════════════ */
.layout {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
}

.main {
  flex: 1;
  padding: 2rem 2rem 2rem 1.75rem;
  overflow: auto;
  min-width: 0;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
/* ── Sidebar scroll fix ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: rgba(14, 14, 14, 0.7);
  border-right: 1px solid rgba(201, 168, 76, 0.1);
  padding: 1.75rem 0 1rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overflow-x: hidden;
  /* Custom scrollbar — subtle gold */
  scrollbar-width: thin;
  scrollbar-color: var(--iv-dark5) transparent;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--iv-dark5);
  border-radius: 99px;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--iv-gold-dark); }

/* Footer stays at the bottom ONLY when there's room; scrolls naturally otherwise */
.sidebar-footer {
  margin-top: auto;
  border-top: 0.5px solid rgba(201,168,76,0.08);
  padding-top: 1.25rem;
}
/* Remove the last-child rule that was doing the same job badly */
.sidebar-section:last-child {
  margin-top: 0;   /* reset — sidebar-footer class handles this now */
}

.sidebar-section {
  margin-bottom: 2rem;
  padding: 0 12px;
}

.sidebar-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--iv-muted);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  color: var(--iv-muted);
  transition: all 0.18s var(--ease-out);
  margin-bottom: 1px;
  position: relative;
}
.sidebar-item:hover {
  color: var(--iv-off);
  background: rgba(255,255,255,0.04);
}
.sidebar-item.active {
  color: var(--iv-gold);
  background: linear-gradient(90deg, rgba(201,168,76,0.12), rgba(201,168,76,0.04));
  font-weight: 500;
}
/* Left gold bar on active */
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 4px; bottom: 4px;
  width: 2.5px;
  background: linear-gradient(180deg, var(--iv-gold-light), var(--iv-gold-dark));
  border-radius: 0 2px 2px 0;
}

.sidebar-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.85;
}
.sidebar-item.active .sidebar-icon { opacity: 1; }

.badge {
  background: var(--iv-gold-dark);
  color: var(--iv-gold-pale);
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 99px;
  margin-left: auto;
  letter-spacing: 0.3px;
}
.badge.green {
  background: rgba(46,204,113,0.15);
  color: var(--iv-success);
  border: 0.5px solid rgba(46,204,113,0.3);
}

/* Sidebar divider */
.sidebar-section:last-child {
  margin-top: auto;
  margin-bottom: 0;
  border-top: 0.5px solid rgba(201,168,76,0.08);
  padding-top: 1.25rem;
}

/* ══════════════════════════════════════════════════════════
   MOBILE MENU — slide + glow animation
══════════════════════════════════════════════════════════ */

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}
@keyframes fadeOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeOverlayOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--iv-gold);
  display: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.mobile-menu-btn:hover { background: rgba(201,168,76,0.1); }

.mobile-menu {
  position: fixed;
  top: 0; right: 0;
  bottom: 0;
  width: 260px;
  background: var(--iv-dark3);
  border-left: 1px solid rgba(201,168,76,0.25);
  box-shadow: -8px 0 48px rgba(0,0,0,0.65);
  padding: 1.5rem;
  transform: translateX(100%);
  opacity: 0;
  transition: none;
  z-index: 9999;
}
.mobile-menu.active {
  animation: slideIn 0.4s var(--ease-in-out) forwards;
}
.mobile-menu.closing {
  animation: slideOut 0.35s var(--ease-in-out) forwards;
}

.mobile-menu-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--iv-muted);
  cursor: pointer;
  transition: color 0.2s;
}
.mobile-menu-close:hover { color: var(--iv-gold); }

.mobile-logo {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 1.75rem;
}
.mobile-logo img {
  height: 52px;
  filter: drop-shadow(0 0 10px rgba(201,168,76,0.35));
  animation: fadeUp 0.6s var(--ease-out);
}

/* ══════════════════════════════════════════════════════════
   MOBILE NAV LINKS — Consolidated & Cleaned
   ══════════════════════════════════════════════════════════ */

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Base style for all links in the mobile menu */
.mobile-nav a {
  display: block;
  width: 100%;
  padding: 12px 16px;
  color: var(--iv-off);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.03); /* Subtle dark tile effect */
  border: 1px solid transparent;
}

/* Hover & Active States */
.mobile-nav a:hover {
  background: rgba(201, 168, 76, 0.12);
  color: var(--iv-gold);
  border-color: rgba(201, 168, 76, 0.2);
}

.mobile-nav a:active {
  transform: scale(0.98);
  background: rgba(201, 168, 76, 0.2);
}

/* Special styling for logout */
.mobile-nav .mobile-nav-logout {
  color: #ff4d4d;
  margin-top: 0.5rem;
  background: rgba(255, 77, 77, 0.05);
}

.mobile-nav .mobile-nav-logout:hover {
  background: rgba(255, 77, 77, 0.15);
  color: #ff4d4d;
  border-color: rgba(255, 77, 77, 0.3);
}

/* Divider styling */
.mobile-nav-divider {
  height: 1px;
  background: rgba(201, 168, 76, 0.15);
  margin: 1rem 0;
}

#mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  z-index: 9990;        /* menu is 9999 — overlay must be below it */
  opacity: 0;
  transition: opacity 0.35s ease;
}

#mobile-overlay.active {
  display: block;
  opacity: 1;
}


/* Show toggle icon on smaller screens */
@media (max-width: 820px) {
  .mobile-menu-btn { display: block; }
}


/* ══════════════════════════════════════════════════════════
   PAGE TRANSITIONS
══════════════════════════════════════════════════════════ */

.page.active {
  display: block;
  animation: fadeUp 0.3s var(--ease-out) both;
}

/* ══════════════════════════════════════════════════════════
   SECTION HEADER
══════════════════════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--iv-white);
  letter-spacing: 0.3px;
  line-height: 1.2;
}
.section-sub {
  font-size: 12px;
  color: var(--iv-muted);
  margin-top: 3px;
  font-weight: 300;
}

/* ══════════════════════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--iv-dark2);
  border: 0.5px solid rgba(201,168,76,0.12);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.stat-card:hover {
  border-color: rgba(201,168,76,0.3);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 0 0 0.5px rgba(201,168,76,0.08);
}
/* Top gold accent line per card */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 1.25rem; right: 1.25rem;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--iv-gold), transparent);
  opacity: 0.5;
  border-radius: 1px;
}
/* Subtle glow blob */
.stat-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  pointer-events: none;
}

.stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 9.5px;
  color: var(--iv-muted);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 38px;
  font-weight: 600;
  color: var(--iv-gold);
  line-height: 1;
  margin-bottom: 6px;
  /* Metallic shimmer effect */
  background: linear-gradient(90deg,
    var(--iv-gold-dark) 0%,
    var(--iv-gold-light) 30%,
    var(--iv-gold) 50%,
    var(--iv-gold-light) 70%,
    var(--iv-gold-dark) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}
.stat-sub {
  font-size: 11px;
  color: var(--iv-muted);
  font-weight: 300;
}
.stat-sub.up {
  color: var(--iv-success);
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-sub.up::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--iv-success);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════ */
.card {
  background: var(--iv-dark2);
  border: 0.5px solid rgba(201,168,76,0.14);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  transition: border-color 0.22s;
}
.card:hover { border-color: rgba(201,168,76,0.24); }
.card-gold { border-color: rgba(201,168,76,0.4); }

/* ══════════════════════════════════════════════════════════
   BUTTON SYSTEM
══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.18s var(--ease-out);
  letter-spacing: 0.2px;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
/* Ripple shimmer on hover */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s;
}
.btn:hover::after { transform: translateX(100%); }
.btn:active { transform: scale(0.97); }

.btn-gold {
  background: linear-gradient(135deg, var(--iv-gold-mid), var(--iv-gold));
  color: #0D0D0D;
  box-shadow: 0 2px 12px rgba(201,168,76,0.25);
  font-weight: 600;
}
.btn-gold:hover {
  background: linear-gradient(135deg, var(--iv-gold), var(--iv-gold-light));
  box-shadow: 0 4px 20px rgba(201,168,76,0.4);
}

.btn-outline {
  background: transparent;
  border: 0.5px solid rgba(201,168,76,0.4);
  color: var(--iv-gold);
}
.btn-outline:hover {
  background: rgba(201,168,76,0.08);
  border-color: var(--iv-gold);
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--iv-muted);
  padding: 6px 8px;
}
.btn-ghost:hover { color: var(--iv-white); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }

.btn-danger {
  background: rgba(231,76,60,0.1);
  border: 0.5px solid rgba(231,76,60,0.35);
  color: var(--iv-danger);
}
.btn-danger:hover { background: rgba(231,76,60,0.18); }

.btn-wa {
  background: var(--iv-whatsapp);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(37,211,102,0.25);
}
.btn-wa:hover { box-shadow: 0 4px 20px rgba(37,211,102,0.4); filter: brightness(1.08); }

.btn-success {
  background: rgba(46,204,113,0.12);
  border: 0.5px solid rgba(46,204,113,0.4);
  color: var(--iv-success);
}
.btn-success:hover { background: rgba(46,204,113,0.2); }

/* ══════════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

thead tr {
  background: var(--iv-dark3);
}
thead tr th:first-child { border-radius: var(--radius-sm) 0 0 0; }
thead tr th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

th {
  text-align: left;
  padding: 11px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--iv-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(201,168,76,0.1);
  font-weight: 500;
  white-space: nowrap;
}

td {
  padding: 13px 14px;
  border-bottom: 0.5px solid rgba(255,255,255,0.035);
  color: var(--iv-white);
  vertical-align: middle;
  transition: background 0.12s;
  font-weight: 300;
}
td:first-child { font-weight: 500; color: var(--iv-off); }

tbody tr { transition: background 0.12s; }
tbody tr:hover td { background: rgba(201,168,76,0.04); }
tbody tr:last-child td { border-bottom: none; }

/* ══════════════════════════════════════════════════════════
   STATUS PILLS
══════════════════════════════════════════════════════════ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.pill::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
  flex-shrink: 0;
}
.pill-pending  { background: rgba(243,156,18,0.1);  color: var(--iv-warning); border: 0.5px solid rgba(243,156,18,0.25); }
.pill-sent     { background: rgba(52,152,219,0.1);  color: var(--iv-info);    border: 0.5px solid rgba(52,152,219,0.25); }
.pill-accepted { background: rgba(46,204,113,0.1);  color: var(--iv-success); border: 0.5px solid rgba(46,204,113,0.25); }
.pill-declined { background: rgba(231,76,60,0.1);   color: var(--iv-danger);  border: 0.5px solid rgba(231,76,60,0.25); }
.pill-confirmed { background: rgba(201,168,76,0.12); color: var(--iv-gold);   border: 0.5px solid rgba(201,168,76,0.3); }

/* ══════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.1rem; }

.form-label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--iv-muted);
  margin-bottom: 7px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  background: var(--iv-dark3);
  border: 0.5px solid rgba(201,168,76,0.18);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--iv-white);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  -webkit-appearance: none;
}
.form-input::placeholder { color: var(--iv-muted); font-weight: 300; }
.form-input:focus {
  border-color: var(--iv-gold);
  background: var(--iv-dark4);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}
.form-input:hover:not(:focus) { border-color: rgba(201,168,76,0.3); }

select.form-input option { background: var(--iv-dark3); color: var(--iv-white); }
textarea.form-input { resize: vertical; min-height: 90px; line-height: 1.6; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* The Overlay */

/* ══════════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal {
  background: var(--iv-dark2);
  border: 0.5px solid rgba(201,168,76,0.25);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 0 0 0.5px rgba(201,168,76,0.08),
    0 32px 80px rgba(0,0,0,0.7),
    0 0 60px rgba(201,168,76,0.05);
  animation: fadeUp 0.25s var(--ease-out) both;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 0.5px solid rgba(201,168,76,0.12);
}

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--iv-gold);
  letter-spacing: 0.3px;
}

/* ══════════════════════════════════════════════════════════
   PROGRESS BAR
══════════════════════════════════════════════════════════ */
.progress-bar {
  height: 3px;
  background: var(--iv-dark5);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--iv-gold-dark), var(--iv-gold-light), var(--iv-gold));
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
  border-radius: 99px;
  transition: width 0.6s var(--ease-out);
}

/* ══════════════════════════════════════════════════════════
   MINI BAR CHART
══════════════════════════════════════════════════════════ */
.mini-bar-wrap { display: flex; flex-direction: column; gap: 10px; }

.mini-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.mini-bar-label {
  width: 68px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--iv-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  flex-shrink: 0;
}
.mini-bar-track {
  flex: 1;
  height: 5px;
  background: var(--iv-dark4);
  border-radius: 99px;
  overflow: hidden;
}
.mini-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.7s var(--ease-out);
}
.mini-bar-count {
  width: 26px;
  text-align: right;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--iv-off);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════
   EVENT CARDS
══════════════════════════════════════════════════════════ */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

/* Replace existing .event-card padding */
.event-card {
  background: var(--iv-dark2);
  border: 0.5px solid rgba(201,168,76,0.14);
  border-radius: var(--radius-lg);
  padding: 0;          /* ← was 1.5rem — banner needs to sit flush */
  cursor: pointer;
  transition: all 0.22s var(--ease-out);
  position: relative;
  overflow: hidden;
}

/* Banner gets rounded top corners to match card */
.event-banner {
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: var(--iv-dark3); /* fallback if image fails */
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Body and buttons now carry the padding */
.event-card-body {
  padding: 14px 16px 0;
}

.banner-placeholder {
    font-size: 40px;
    opacity: 0.3;
}

/* Decorative corner mark */
.event-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 28px 28px 0;
  border-color: transparent rgba(201,168,76,0.15) transparent transparent;
  transition: border-color 0.22s;
}
.event-card:hover {
  border-color: rgba(201,168,76,0.38);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.5), 0 0 0 0.5px rgba(201,168,76,0.1);
}
.event-card:hover::before {
  border-color: transparent rgba(201,168,76,0.4) transparent transparent;
}
.event-card:active { transform: translateY(-1px); }

.event-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--iv-white);
  margin-bottom: 5px;
  letter-spacing: 0.2px;
}
.event-date {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  color: var(--iv-muted);
  margin-bottom: 14px;
  letter-spacing: 0.3px;
}
.event-meta {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 0.5px solid rgba(201,168,76,0.08);
}
.event-meta-item {
  font-size: 11px;
  color: var(--iv-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.event-meta-item span {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--iv-gold);
}

/* ══════════════════════════════════════════════════════════
   TABS
══════════════════════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 3px;
  background: var(--iv-dark3);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 1.25rem;
  border: 0.5px solid var(--iv-faint);
}
.tab {
  flex: 1;
  padding: 7px;
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-radius: 7px;
  cursor: pointer;
  color: var(--iv-muted);
  transition: all 0.15s var(--ease-out);
}
.tab:hover { color: var(--iv-off); background: rgba(255,255,255,0.04); }
.tab.active {
  background: var(--iv-dark2);
  color: var(--iv-gold);
  border: 0.5px solid rgba(201,168,76,0.25);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ══════════════════════════════════════════════════════════
   NOTIFICATION DOT
══════════════════════════════════════════════════════════ */
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--iv-gold);
  flex-shrink: 0;
  animation: pulse-dot 2.4s ease-in-out infinite;
}
.dot.green { background: var(--iv-success); }

/* ══════════════════════════════════════════════════════════
   SCANNER PAGE
══════════════════════════════════════════════════════════ */
.scanner-box {
  background: var(--iv-dark3);
  border: 1.5px dashed rgba(201,168,76,0.25);
  border-radius: var(--radius-xl);
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.scanner-box::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--iv-gold), transparent);
  transform: translateY(-50%);
  animation: scanLine 2.5s ease-in-out infinite;
  opacity: 0;
}
@keyframes scanLine {
  0%   { opacity: 0; top: 15%; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { opacity: 0; top: 85%; }
}
.scanner-box:hover {
  border-color: rgba(201,168,76,0.5);
  background: var(--iv-dark4);
  box-shadow: 0 0 40px rgba(201,168,76,0.08) inset;
}
.scanner-box:hover::before { opacity: 1; }

/* ══════════════════════════════════════════════════════════
   INVITE LIST ITEMS (scanner recent check-ins)
══════════════════════════════════════════════════════════ */
.invite-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(255,255,255,0.04);
  transition: background 0.12s;
}
.invite-item:last-child { border-bottom: none; }

.invite-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--iv-dark4), var(--iv-dark5));
  border: 1px solid rgba(201,168,76,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--iv-gold);
  flex-shrink: 0;
}
.invite-name { font-size: 13px; font-weight: 500; color: var(--iv-white); }
.invite-phone { font-size: 11px; color: var(--iv-muted); margin-top: 1px; }
.invite-actions { margin-left: auto; display: flex; gap: 6px; }

/* ══════════════════════════════════════════════════════════
   QR BLOCK
══════════════════════════════════════════════════════════ */
.qr-block {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 14px;
  display: inline-block;
  box-shadow: 0 8px 32px rgba(201,168,76,0.15);
}

/* ══════════════════════════════════════════════════════════
   ALERT
══════════════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 1rem;
  border: 0.5px solid transparent;
}
.alert-success {
  background: rgba(46,204,113,0.07);
  border-color: rgba(46,204,113,0.25);
  color: var(--iv-success);
}
.alert-info {
  background: rgba(52,152,219,0.07);
  border-color: rgba(52,152,219,0.25);
  color: var(--iv-info);
}

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════ */
.empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--iv-muted);
}
.empty-icon {
  font-size: 36px;
  margin-bottom: 1rem;
  opacity: 0.25;
  display: block;
}

/* ══════════════════════════════════════════════════════════
   FLASH MESSAGES
══════════════════════════════════════════════════════════ */
#flash-container {
  position: fixed;
  top: calc(var(--topbar-h) + 1rem);
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.fmsg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 400;
  border: 0.5px solid transparent;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  backdrop-filter: blur(12px);
  animation: fadeUp 0.3s var(--ease-out) both;
}

.f-close {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.f-close:hover { opacity: 1; }

.f-success { background: rgba(5, 46, 22, 0.9);  color: #86efac; border-color: rgba(134,239,172,0.2); }
.f-error,
.f-danger   { background: rgba(45, 6, 6, 0.9);   color: #fca5a5; border-color: rgba(252,165,165,0.2); }
.f-warning  { background: rgba(45, 27, 0, 0.9);  color: #fde68a; border-color: rgba(253,230,138,0.2); }
.f-info     { background: rgba(8, 32, 64, 0.9);  color: #93c5fd; border-color: rgba(147,197,253,0.2); }

/* ══════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════ */
#toast {
  font-family: 'Outfit', sans-serif !important;
  font-size: 13px !important;
  border-radius: var(--radius-lg) !important;
  letter-spacing: 0.1px;
  backdrop-filter: blur(12px);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — compact below 1100px
══════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  :root { --sidebar-w: 200px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .sidebar { display: none; }
  .main { padding: 1.25rem; }
  .topbar-nav { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .section-title { font-size: 18px; }

  /* Dashboard two-column grid → single column */
  #page-dashboard > div[style*="grid-template-columns:1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Packages / Subscription inner 4-col grids → 2 col */
  #page-dashboard .card div[style*="repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Event cards already use auto-fill but min 290px is too wide */
  .events-grid {
    grid-template-columns: 1fr !important;
  }

  /* Event card action buttons — wrap gracefully */
  .event-card-body + div,
  .event-card [style*="display:flex;gap:6px"] {
    flex-wrap: wrap;
  }
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .events-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 1rem; }
  .main { padding: 1rem; }

  /* Packages inner grid → 1 col on very small screens */
  #page-dashboard .card div[style*="repeat(4,1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Stat values slightly smaller */
  .stat-value { font-size: 28px; }

  /* Mini bar labels truncate cleanly */
  .mini-bar-label { width: 52px; font-size: 9px; }

  /* Table horizontal scroll with a hint shadow */
  .table-wrap {
    -webkit-overflow-scrolling: touch;
    box-shadow: inset -8px 0 8px -8px rgba(201,168,76,0.15);
  }
}
/* ── Search / Filter Bar ─────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--iv-dark2);
  border: 0.5px solid rgba(201,168,76,0.14);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 1rem;
}
.filter-bar-search {
  flex: 1;
  min-width: 160px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--iv-white);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
}
.filter-bar-search::placeholder { color: var(--iv-muted); }
.filter-bar-divider {
  width: 0.5px;
  height: 18px;
  background: rgba(201,168,76,0.15);
  flex-shrink: 0;
}
.filter-select {
  background: transparent;
  border: none;
  outline: none;
  color: var(--iv-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
}
.filter-select option { background: var(--iv-dark3); color: var(--iv-white); }
.filter-count {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--iv-muted);
  margin-left: auto;
  white-space: nowrap;
}
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 10px;
}
.page-link {
    padding: 6px 12px;
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 4px;
    color: var(--iv-fg);
    cursor: pointer;
    background: rgba(255,255,255,0.05);
    font-size: 13px;
    transition: all 0.2s;
}
.page-link:hover:not(.disabled) {
    background: var(--iv-gold);
    color: #000;
}
.page-link.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.page-info {
    font-size: 13px;
    color: var(--iv-muted);
}