/* KPNS Web Application - Senior UI/UX Redesign & Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Brand & Status Color Palette */
  --bg-primary: #0F172A;
  --bg-card: #111827;
  --bg-surface: #1E293B;
  
  --accent-primary: #2563EB;
  --accent-primary-hover: #3B82F6;
  --accent-primary-glow: rgba(37, 99, 235, 0.25);
  
  --accent-success: #22C55E;
  --accent-success-glow: rgba(34, 197, 94, 0.2);
  
  --accent-warning: #F59E0B;
  --accent-warning-glow: rgba(245, 158, 11, 0.2);
  
  --accent-danger: #EF4444;
  --accent-danger-glow: rgba(239, 68, 68, 0.2);
  
  --accent-gold: #F59E0B;
  --accent-emerald: #22C55E;
  --accent-rose: #EF4444;
  --accent-blue: #2563EB;

  /* Glassmorphism & Borders */
  --glass-bg: rgba(17, 24, 39, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(30, 41, 59, 0.7);
  
  /* Typography */
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  /* Shadows & Radii */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
  
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 30%, rgba(37, 99, 235, 0.08), transparent 35%),
    radial-gradient(circle at 85% 70%, rgba(245, 158, 11, 0.06), transparent 35%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Outfit', sans-serif; }

/* ===================================
   FULL-PAGE LOGIN SCREEN
   =================================== */
.login-page {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.15), transparent 40%),
    radial-gradient(circle at 80% 50%, rgba(245, 158, 11, 0.1), transparent 40%);
  padding: 20px;
  animation: loginFadeIn 0.4s ease;
}

.login-page.hidden {
  display: none;
}

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

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 40px 32px;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(37, 99, 235, 0.08);
  overflow: hidden;
}

.login-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}

.login-watermark img {
  width: 240px;
  height: 240px;
  object-fit: contain;
  opacity: 0.04;
  filter: grayscale(100%);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.login-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  padding: 8px;
  background: var(--bg-card);
  margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.login-card form {
  position: relative;
  z-index: 1;
}

.login-card .form-group {
  margin-bottom: 18px;
}

.login-card .form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.login-card .form-control {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card .form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.login-message {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 12px;
  animation: fadeInDown 0.25s ease;
}
.login-message.error {
  display: flex;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #FCA5A5;
}
.login-message.success {
  display: flex;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86EFAC;
}
.login-message svg {
  flex-shrink: 0;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
#loginBtn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  position: relative;
  z-index: 1;
}

.login-footer p {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

@media (max-width: 480px) {
  .login-card {
    padding: 28px 20px;
    border-radius: 16px;
  }
  .login-logo {
    width: 64px;
    height: 64px;
  }
  .login-title {
    font-size: 1.2rem;
  }
}

/* ===================================
   TOAST NOTIFICATION ENGINE
   =================================== */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 0, 0, 0.3);
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

.toast.toast-hiding {
  animation: toastSlideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(50px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(50px) scale(0.9); }
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.toast-message {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: color 0.2s;
  line-height: 1;
}

.toast-close:hover { color: var(--text-primary); }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  animation: toastTimer linear forwards;
}

@keyframes toastTimer {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Toast Variants */
.toast-success { border-left: 4px solid var(--accent-success); }
.toast-success .toast-icon { background: rgba(34, 197, 94, 0.15); color: var(--accent-success); }
.toast-success .toast-progress { background: var(--accent-success); }

.toast-error { border-left: 4px solid var(--accent-danger); }
.toast-error .toast-icon { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger); }
.toast-error .toast-progress { background: var(--accent-danger); }

.toast-warning { border-left: 4px solid var(--accent-warning); }
.toast-warning .toast-icon { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }
.toast-warning .toast-progress { background: var(--accent-warning); }

.toast-info { border-left: 4px solid var(--accent-primary); }
.toast-info .toast-icon { background: rgba(37, 99, 235, 0.15); color: var(--accent-primary); }
.toast-info .toast-progress { background: var(--accent-primary); }

.toast-loading { border-left: 4px solid var(--accent-primary); }
.toast-loading .toast-icon { background: rgba(37, 99, 235, 0.15); color: var(--accent-primary); }
.toast-loading .toast-progress { background: linear-gradient(90deg, var(--accent-primary), var(--accent-warning)); }

/* Spinner for Toast Loading */
.toast-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent-primary-glow);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================================
   HEADER & NAVIGATION
   =================================== */
header {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 28px;
  height: 28px;
}

.brand-text h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.brand-text p {
  display: none;
}

nav#mainNav {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.nav-header-mobile, .nav-footer-mobile {
  display: none;
}

.nav-links {
  display: flex;
  gap: 4px;
  height: 100%;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0 12px;
  height: 100%;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  position: relative;
  font-family: 'Inter', 'Outfit', sans-serif;
}

.nav-btn svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.nav-btn:hover {
  color: var(--text-primary);
}

.nav-btn:hover svg {
  opacity: 1;
}

.nav-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-primary);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.nav-btn.active {
  color: var(--text-primary);
  background: transparent;
  border: none;
  box-shadow: none;
}

.nav-btn.active svg {
  opacity: 1;
  color: var(--accent-primary);
}

.nav-btn.active::after {
  transform: scaleX(1);
}

.user-profile {
  display: flex;
  align-items: center;
  height: 100%;
}

.user-dropdown-container {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.user-dropdown-toggle {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.user-dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), #3b82f6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.user-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.role-badge {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  background: transparent;
  border: none;
  padding: 0;
}

.dropdown-chevron {
  color: var(--text-muted);
  transition: transform 0.2s;
}

.user-dropdown-container.open .dropdown-chevron {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 220px;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
}

.user-dropdown-container.open .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.dropdown-item svg {
  color: var(--text-muted);
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-item:hover svg {
  color: var(--text-primary);
}

.dropdown-item.text-danger {
  color: var(--accent-danger);
}

.dropdown-item.text-danger svg {
  color: var(--accent-danger);
}

.dropdown-item.text-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.dropdown-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 6px 0;
}

/* ===================================
   MAIN LAYOUT & CARDS
   =================================== */
main {
  flex: 1;
  padding: 32px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.tab-content {
  display: none;
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tab-content.active {
  display: block;
}

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

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  background: var(--glass-hover);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), transparent);
}

.metric-card.emerald::before { background: linear-gradient(90deg, var(--accent-success), transparent); }
.metric-card.rose::before { background: linear-gradient(90deg, var(--accent-danger), transparent); }

.metric-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.metric-value {
  font-size: 2.1rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
}

.metric-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

/* ===================================
   BUTTONS & ACTIONS
   =================================== */
.btn {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px var(--accent-primary-glow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  background: linear-gradient(135deg, #3B82F6, #2563EB);
}

.btn:active { transform: translateY(0); }

.btn-emerald {
  background: linear-gradient(135deg, #22C55E, #16A34A);
  box-shadow: 0 4px 14px var(--accent-success-glow);
}
.btn-emerald:hover {
  background: linear-gradient(135deg, #4ADE80, #22C55E);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);
}

.btn-rose {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  box-shadow: 0 4px 14px var(--accent-danger-glow);
}
.btn-rose:hover {
  background: linear-gradient(135deg, #F87171, #EF4444);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  box-shadow: none;
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}
.btn-whatsapp:hover {
  background: linear-gradient(135deg, #4ADE80, #25D366);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}

/* ===================================
   TABLES & BADGES
   =================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

th {
  background: rgba(15, 23, 42, 0.7);
  padding: 14px 18px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--glass-border);
}

td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: background 0.2s ease;
}

tr:last-child td { border-bottom: none; }

tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.badge {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-block;
  letter-spacing: 0.5px;
}

.badge-pending { background: rgba(239, 68, 68, 0.15); color: #FCA5A5; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-completed { background: rgba(34, 197, 94, 0.15); color: #86EFAC; border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-partial { background: rgba(245, 158, 11, 0.15); color: #FDE047; border: 1px solid rgba(245, 158, 11, 0.3); }

/* ===================================
   MODALS & FORMS
   =================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 30px var(--accent-primary-glow);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: 18px 26px;
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.close-btn:hover { 
  background: rgba(239, 68, 68, 0.2);
  color: #FFFFFF;
  border-color: rgba(239, 68, 68, 0.4);
}

.modal-body {
  padding: 26px;
  max-height: 75vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 7px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s ease;
}

.form-control:focus {
  border-color: var(--accent-primary);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.form-control::placeholder {
  color: #475569;
}

/* ===================================
   RECEIPT CARD & PASSBOOK STYLES
   =================================== */
.receipt-card {
  background: #FFFFFF;
  color: #0F172A;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-family: 'Outfit', sans-serif;
  position: relative;
  border: 4px solid var(--accent-warning);
  overflow: hidden;
}

.receipt-card::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 280px;
  height: 280px;
  transform: translate(-50%, -50%);
  background-image: url('../assets/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

.receipt-header {
  text-align: center;
  border-bottom: 2px dashed #CBD5E1;
  padding-bottom: 18px;
  margin-bottom: 18px;
  position: relative;
}

.receipt-header img {
  width: 60px;
  height: 60px;
  margin-bottom: 10px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.receipt-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0F172A;
}

.receipt-header p {
  font-size: 0.8rem;
  color: #64748B;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.receipt-title-tag {
  background: #FEF3C7;
  color: #B45309;
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  margin-top: 10px;
  border: 1px solid #FDE68A;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 11px;
  font-size: 0.9rem;
}

.receipt-label { color: #64748B; font-weight: 500; }
.receipt-val { font-weight: 700; color: #1E293B; text-align: right; }

.receipt-amount-box {
  background: linear-gradient(135deg, #F0FDF4, #DCFCE7);
  border: 2px solid #86EFAC;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  margin: 18px 0;
}

.receipt-amount-box .amount {
  font-size: 2rem;
  font-weight: 900;
  color: #166534;
}

.receipt-footer {
  text-align: center;
  border-top: 2px dashed #CBD5E1;
  padding-top: 14px;
  margin-top: 18px;
  font-size: 0.78rem;
  color: #94A3B8;
}

.passbook-summary-box {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.passbook-item {
  flex: 1;
  min-width: 170px;
}

.passbook-item label { 
  font-size: 0.78rem; 
  color: var(--text-secondary); 
  text-transform: uppercase; 
  letter-spacing: 1px;
  font-weight: 600;
}
.passbook-item p { 
  font-size: 1.35rem; 
  font-weight: 800; 
  margin-top: 6px; 
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
}

/* ===================================
   MOBILE-FIRST RESPONSIVE ARCHITECTURE
   =================================== */

/* Touch Target & Accessibility Standards */
.btn, .nav-btn, .form-control, .close-btn, .mobile-toggle {
  min-height: 44px;
}

/* Mobile Toggle Hamburger Button */
.mobile-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  padding: 0;
  transition: all 0.2s ease;
}
.mobile-toggle:hover, .mobile-toggle:active {
  background: var(--glass-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary-hover);
}

/* Nav Overlay Backdrop */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 998;
}
.nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Base Body Safe Area & Overflow Control */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  header {
    padding: 0 16px;
    height: 60px;
    background: #0F172A;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 1000;
  }
  
  .mobile-toggle {
    display: flex;
  }

  .user-profile {
    display: flex;
    align-items: center;
  }

  .user-details {
    display: none; /* Hide detailed text on mobile header */
  }

  .user-dropdown-toggle {
    padding: 4px;
    background: transparent;
    border: none;
  }

  nav#mainNav {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background: #0F172A;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-right: 1px solid var(--glass-border);
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    gap: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1005;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  nav#mainNav.mobile-active {
    transform: translateX(280px); /* Move into view */
  }

  .nav-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 16px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 8px;
  }

  .user-info-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .user-details-mobile {
    display: flex;
    flex-direction: column;
  }

  .close-drawer {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
  }

  .nav-links {
    flex-direction: column;
    padding: 0 12px;
    height: auto;
    flex: 1;
    overflow-y: auto;
    gap: 4px;
  }

  .nav-btn {
    height: 44px;
    width: 100%;
    justify-content: flex-start;
    padding: 0 12px;
    border-radius: var(--radius-sm);
  }

  .nav-btn::after {
    display: none;
  }

  .nav-btn.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-primary);
  }

  .nav-footer-mobile {
    display: block;
    padding: 16px;
    border-top: 1px solid var(--glass-border);
  }

  /* Mobile Grid Layouts */
  main {
    padding: 16px 12px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .metric-card {
    padding: 18px;
  }

  .metric-value {
    font-size: 1.75rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section-title {
    font-size: 1.2rem;
  }

  /* Mobile Form & Modal */
  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    max-width: 100%;
    border-radius: var(--radius-md);
  }

  .modal-body {
    padding: 18px;
    max-height: 80vh;
  }

  /* Mobile Toast Position (Fixed at bottom for easy thumb access) */
  #toast-container {
    top: auto;
    bottom: max(16px, env(safe-area-inset-bottom));
    right: 14px;
    left: 14px;
    width: auto;
    max-width: none;
  }

  /* Receipt Card Scaling on Mobile */
  .receipt-card {
    padding: 20px 16px;
    border-width: 3px;
  }

  .receipt-amount-box .amount {
    font-size: 1.7rem;
  }
}

@media (max-width: 480px) {
  .brand-text p {
    display: none;
  }

  .passbook-summary-box {
    flex-direction: column;
    padding: 16px;
  }

  .passbook-item p {
    font-size: 1.15rem;
  }
}

/* Compact Members Table */
#members table th, 
#members table td {
  padding: 6px 8px !important;
  font-size: 0.78rem !important;
  white-space: nowrap;
}
#members table th { font-size: 0.72rem !important; }
#members .badge { padding: 3px 6px !important; font-size: 0.68rem !important; }
#members .btn-sm { padding: 3px 6px !important; font-size: 0.68rem !important; min-height: 32px !important; }

/* Skeleton Loading Animation */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeletonLoading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===================================
   PRINT / PDF STYLES
   =================================== */
@media print {
  body * { visibility: hidden !important; }
  #reportContainer, #reportContainer * { visibility: visible !important; }
  #reportContainer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: #FFFFFF !important;
    color: #0F172A !important;
    padding: 24px !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  #reportContainer h2, #reportContainer h3, #reportContainer p, #reportContainer span, 
  #reportContainer td, #reportContainer th, #reportContainer strong, #reportContainer div { color: #0F172A !important; }
  #reportContainer table { width: 100% !important; border-collapse: collapse !important; background: #FFF !important; }
  #reportContainer th { background: #F1F5F9 !important; border: 1px solid #CBD5E1 !important; padding: 8px 10px !important; font-size: 0.8rem !important; }
  #reportContainer td { border: 1px solid #E2E8F0 !important; padding: 7px 10px !important; font-size: 0.8rem !important; background: #FFF !important; }
  #reportContainer .metric-card { background: #F8FAFC !important; border: 1px solid #CBD5E1 !important; box-shadow: none !important; }
  #reportContainer .metric-card * { color: #0F172A !important; }
  #reportContainer .badge { border: 1px solid #94A3B8 !important; background: #F1F5F9 !important; color: #0F172A !important; }
  @page { margin: 12mm 10mm; size: A4 portrait; }
}

/* ===================================
   MEMBER SEARCH SELECT COMPONENT
   =================================== */
.member-search-select-wrapper {
  position: relative;
  width: 100%;
}

.member-search-container {
  position: relative;
  width: 100%;
}

/* --- Search Input Box --- */
.search-input-box-wrapper {
  position: relative;
  width: 100%;
}

.search-input-inner {
  position: relative;
  display: flex;
  align-items: center;
}

.member-search-input {
  width: 100%;
  padding-right: 36px !important;
  background: var(--bg-card) !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-primary) !important;
  font-size: 0.9rem !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

.member-search-input:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
  outline: none !important;
}

.btn-input-reset {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
  z-index: 2;
}

.btn-input-reset:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.08);
}

/* --- Dropdown List --- */
.member-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.3);
  z-index: 9999;
  max-height: 340px;
  overflow: hidden;
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.member-search-results-list {
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.member-search-results-list::-webkit-scrollbar { width: 4px; }
.member-search-results-list::-webkit-scrollbar-track { background: transparent; }
.member-search-results-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

/* --- Result Items --- */
.member-search-item {
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

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

.member-search-item:hover,
.member-search-item.highlighted {
  background: rgba(99, 102, 241, 0.12);
}

.member-search-item .item-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.member-search-item .item-code {
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.member-search-item .item-name {
  font-size: 0.92rem;
  color: var(--text-primary);
  font-weight: 600;
}

.member-search-item .item-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.badge-sm {
  font-size: 0.65rem !important;
  padding: 2px 7px !important;
  border-radius: 20px !important;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34D399 !important;
  border: 1px solid rgba(52, 211, 153, 0.25) !important;
}

.badge-inactive {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #F87171 !important;
  border: 1px solid rgba(248, 113, 113, 0.25) !important;
}

/* --- Highlighted match text --- */
.search-highlight {
  background: rgba(234, 179, 8, 0.25);
  color: #FACC15;
  border-radius: 2px;
  padding: 0 1px;
  font-style: normal;
}

/* --- Empty State --- */
.member-search-empty-state {
  padding: 24px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.member-search-empty-state .empty-icon { font-size: 2rem; margin-bottom: 8px; opacity: 0.5; }
.member-search-empty-state .empty-title { font-weight: 600; color: var(--text-primary); margin-bottom: 4px; font-size: 0.92rem; }
.member-search-empty-state .empty-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 6px; }

.member-search-empty-state .empty-tips {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: left;
  display: inline-block;
}

.member-search-empty-state .empty-tips li { padding: 2px 0; }

/* --- Selected Member Profile Card --- */
.selected-member-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1.5px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  gap: 12px;
  animation: cardSlideIn 0.2s ease-out;
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.member-card-content { flex: 1; min-width: 0; }

.member-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.member-avatar { font-size: 1.4rem; flex-shrink: 0; }

.member-main-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.member-name-title { font-size: 0.97rem; font-weight: 700; color: var(--text-primary); }

.member-badge { font-size: 0.68rem; padding: 2px 8px; border-radius: 20px; font-weight: 600; }

.member-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding-left: 2px;
}

.member-card-details span { display: flex; align-items: center; gap: 4px; }

/* --- Clear Selection Button --- */
.btn-clear-selection {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  transition: background 0.2s, transform 0.15s;
}

.btn-clear-selection:hover {
  background: rgba(239, 68, 68, 0.22);
  transform: scale(1.1);
}

/* ==========================================================================
   ORGANIZATION MEMBERS SAAS REDESIGN STYLES
   ========================================================================== */

/* ── Metrics Summary Bar ─────────────────────────────────────────────── */
.member-metrics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.member-metric-card {
  background: rgba(17, 24, 39, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.member-metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.member-metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.member-metric-info {
  display: flex;
  flex-direction: column;
}

.member-metric-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.member-metric-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

/* ── Filter Chips & Toolbar ──────────────────────────────────────────── */
.member-toolbar-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.member-toolbar-top {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.member-search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.member-search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.88rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.member-search-box input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.member-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.filter-chips-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: all 0.2s ease;
  user-select: none;
}

.filter-chip:hover {
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.filter-chip.active {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--accent-primary);
  color: #60A5FA;
}

.filter-chip-count {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
}

.sort-select-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.sort-select-wrapper label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sort-select-wrapper select {
  padding: 6px 10px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
}

/* ── Initials Avatar System ─────────────────────────────────────────── */
.member-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.15);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Compact Member Table ───────────────────────────────────────────── */
.member-table-compact {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.member-table-compact thead th {
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
  text-align: left;
}

.member-table-compact tbody tr.member-row-main {
  background: rgba(17, 24, 39, 0.65);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.member-table-compact tbody tr.member-row-main:hover {
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.member-table-compact tbody tr.member-row-main td {
  padding: 12px 14px;
  vertical-align: middle;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}

.member-table-compact tbody tr.member-row-main td:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  border-left: 1px solid var(--glass-border);
}

.member-table-compact tbody tr.member-row-main td:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  border-right: 1px solid var(--glass-border);
}

/* Member cell layout */
.member-cell-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-name-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.member-name-clickable {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: color 0.15s;
}

.member-name-clickable:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

.member-sub-details {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

/* Action Trigger Buttons */
.action-btn-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(30, 41, 59, 0.5);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-action-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* Action Dropdown Menu */
.action-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.action-dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  width: 190px;
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  z-index: 500;
  display: none;
  animation: dropdownFade 0.15s ease;
}

.action-dropdown-menu.show {
  display: block;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.dropdown-action-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-action-item.danger {
  color: #F87171;
}

.dropdown-action-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* ── Expandable Row Accordion ───────────────────────────────────────── */
tr.member-row-expand {
  display: none;
}

tr.member-row-expand.show {
  display: table-row;
}

.member-expand-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 4px 0 10px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 20px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
}

.expand-info-item {
  display: flex;
  flex-direction: column;
}

.expand-info-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.expand-info-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
}

/* ── Slide-In Member Profile Drawer ─────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.active {
  display: block;
  opacity: 1;
}

.profile-drawer-panel {
  position: fixed;
  top: 0;
  right: -480px;
  width: 460px;
  max-width: 90vw;
  height: 100vh;
  background: #0F172A;
  border-left: 1px solid var(--glass-border);
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.7);
  z-index: 9500;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.profile-drawer-panel.open {
  right: 0;
}

.drawer-header {
  padding: 20px 24px;
  background: #1E293B;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-profile-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
}

.drawer-avatar {
  width: 56px;
  height: 56px;
  font-size: 1.3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #FFF;
  flex-shrink: 0;
}

.drawer-grid-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px;
}

.drawer-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Mobile Card Grid Layout ────────────────────────────────────────── */
.members-card-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .member-table-compact {
    display: none;
  }
  .members-card-grid {
    display: grid;
  }
}

.member-mobile-card {
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.mobile-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  border-top: 1px solid var(--glass-border);
  padding-top: 10px;
}

/* ── Bulk Selection Bar ─────────────────────────────────────────────── */
.bulk-action-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1E293B;
  border: 1px solid rgba(37, 99, 235, 0.4);
  border-radius: 30px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
  z-index: 4000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bulk-action-bar.show {
  transform: translateX(-50%) translateY(0);
}

/* ── Pagination Footer Controls ─────────────────────────────────────── */
.member-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  margin-top: 14px;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: rgba(30, 41, 59, 0.5);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.page-btn:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--accent-primary);
  color: #60A5FA;
}

.page-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #FFFFFF;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════
   EVENTS SaaS REDESIGN — CSS
   ═══════════════════════════════════════════════════════════════════ */

/* ── Events Summary Metrics Bar ────────────────────────────────── */
.event-metrics-summary {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.event-metric-card {
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.event-metric-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37,99,235,0.04), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.event-metric-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
}

.event-metric-card:hover::before { opacity: 1; }

.event-metric-card.active-filter {
  border-color: var(--accent-primary);
  background: rgba(37, 99, 235, 0.1);
}

.event-metric-icon { font-size: 1.4rem; margin-bottom: 6px; }

.event-metric-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.event-metric-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Events Toolbar ─────────────────────────────────────────────── */
.event-toolbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.event-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.event-search-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Event Cards Grid ───────────────────────────────────────────── */
.event-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
  margin-bottom: 16px;
}

/* ── Individual Event Card ─────────────────────────────────────── */
.event-card {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.event-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), #818CF8);
  opacity: 0;
  transition: opacity 0.2s;
}

.event-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.event-card:hover::after { opacity: 1; }

/* ── Event Card Header ─────────────────────────────────────────── */
.event-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.event-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.event-card-title-block { flex: 1; min-width: 0; }

.event-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  line-height: 1.3;
  transition: color 0.15s;
  word-break: break-word;
}

.event-card-title:hover { color: #93C5FD; text-decoration: underline; }

.event-card-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.event-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.event-select-cb {
  margin-top: 3px;
  accent-color: var(--accent-primary);
  cursor: pointer;
  width: 16px; height: 16px;
  flex-shrink: 0;
}

/* ── Event Type Badge ───────────────────────────────────────────── */
.ev-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ev-type-fixed {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ADE80;
}

.ev-type-flexible {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #A78BFA;
}

/* ── Event Status Badge ─────────────────────────────────────────── */
.ev-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.ev-status-active    { background: rgba(34,197,94,0.12);  border:1px solid rgba(34,197,94,0.3);  color:#4ADE80; }
.ev-status-upcoming  { background: rgba(234,179,8,0.12);  border:1px solid rgba(234,179,8,0.3);  color:#FCD34D; }
.ev-status-completed { background: rgba(99,102,241,0.12); border:1px solid rgba(99,102,241,0.3); color:#818CF8; }
.ev-status-draft     { background: rgba(100,116,139,0.12);border:1px solid rgba(100,116,139,0.3);color:#94A3B8; }

/* ── Progress Bar ────────────────────────────────────────────────── */
.event-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.event-progress-label { color: var(--text-muted); }
.event-progress-pct   { font-weight: 700; color: var(--text-primary); }

.event-progress-bar {
  width: 100%;
  height: 7px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}

.event-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #22C55E, #4ADE80);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 0;
}

.event-progress-fill.pct-low  { background: linear-gradient(90deg, #EF4444, #F87171); }
.event-progress-fill.pct-mid  { background: linear-gradient(90deg, #F59E0B, #FCD34D); }
.event-progress-fill.pct-high { background: linear-gradient(90deg, #22C55E, #4ADE80); }
.event-progress-fill.pct-full { background: linear-gradient(90deg, #818CF8, #6EE7B7); }

.event-progress-amounts {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ── Event Stats Grid (Assigned / Paid / Pending) ─────────────── */
.event-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.event-stat-cell {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}

.event-stat-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.event-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* ── Event Financial Summary Row ─────────────────────────────── */
.event-finance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--glass-border);
  font-size: 0.8rem;
}

.event-finance-item { text-align: center; }

.event-finance-val { font-weight: 700; font-size: 0.9rem; }
.ev-collected-val  { color: #4ADE80; }
.ev-outstanding-val{ color: #F87171; }
.ev-expenses-val   { color: #FCD34D; }
.ev-expected-val   { color: #93C5FD; }

.event-finance-lbl { font-size: 0.67rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }

/* ── Event Financial Breakdown (User Spec) ──────────────────── */
.event-financial-breakdown {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fin-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  line-height: 1.4;
}

.fin-breakdown-row.sub-row {
  padding-left: 10px;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.fin-breakdown-row.highlight-row {
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  padding: 3px 6px;
  border-radius: 6px;
}

.fin-breakdown-row.main-collected {
  font-size: 0.86rem;
  font-weight: 700;
}

.fin-breakdown-row.total-row {
  font-size: 0.9rem;
  font-weight: 800;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.fin-breakdown-label {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fin-breakdown-val {
  font-weight: 700;
  font-family: inherit;
}

.fin-breakdown-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 4px 0;
}

/* ── Event Balance Sheet Report Styles ───────────────────────── */
.ev-report-section-hdr {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
  border-left: 3px solid var(--accent-gold);
  padding: 6px 12px;
  margin: 20px 0 10px;
  background: rgba(245, 158, 11, 0.06);
  border-radius: 0 6px 6px 0;
}

.ev-report-fin-block {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.ev-report-fin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
}

.ev-report-fin-row.sub-indent {
  padding-left: 16px;
  font-size: 0.8rem;
}

.ev-report-fin-label {
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ev-report-fin-val {
  font-weight: 700;
  font-size: 0.92rem;
}

/* ── Event Card Actions Footer ───────────────────────────────── */
.event-card-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--glass-border);
}

.event-card-footer .btn { font-size: 0.78rem; padding: 6px 12px; }

.ev-action-more-wrap { position: relative; margin-left: auto; }

.ev-more-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: all 0.15s;
}

.ev-more-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: var(--text-primary);
}

/* ── Event Dropdown Menu ─────────────────────────────────────── */
.event-dropdown-menu {
  position: absolute;
  right: 0; top: 100%;
  margin-top: 6px;
  min-width: 190px;
  background: #1E293B;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  z-index: 600;
  display: none;
  animation: dropdownFade 0.15s ease;
}

.event-dropdown-menu.open { display: block; }

.event-dropdown-menu .dropdown-item {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-dropdown-menu .dropdown-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.event-dropdown-menu .dropdown-item.text-rose { color: #F87171; }
.event-dropdown-menu .dropdown-item.text-rose:hover { background: rgba(239,68,68,0.1); }

/* ── Event Slide-In Drawer ──────────────────────────────────── */
.event-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
  z-index: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.event-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.event-drawer-panel {
  position: fixed;
  top: 0; right: -480px;
  width: min(480px, 95vw);
  height: 100vh;
  background: #0F172A;
  border-left: 1px solid var(--glass-border);
  z-index: 801;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.event-drawer-panel.open { right: 0; }

.event-drawer-header {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(17, 24, 39, 0.9);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.event-drawer-header > div:first-child {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex: 1;
}

.event-drawer-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.event-drawer-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.event-drawer-close:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); }

.event-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.event-drawer-body::-webkit-scrollbar { width: 5px; }
.event-drawer-body::-webkit-scrollbar-track { background: transparent; }
.event-drawer-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }

.ev-drawer-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 16px;
}

.ev-drawer-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.ev-drawer-kv { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.ev-drawer-kv:last-child { border-bottom: none; }
.ev-drawer-key { color: var(--text-muted); }
.ev-drawer-val { color: var(--text-primary); font-weight: 500; text-align: right; }

.ev-drawer-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ev-drawer-metric {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.ev-drawer-metric-val { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }
.ev-drawer-metric-lbl { font-size: 0.68rem; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; }

.ev-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ev-drawer-actions .btn { font-size: 0.82rem; }

/* ── Contribution amount highlight ────────────────────────── */
.ev-contribution-amount {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ── Mobile Event Cards ─────────────────────────────────────── */
@media (max-width: 767px) {
  .event-metrics-summary {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .event-metric-value { font-size: 1.2rem; }
  .event-metric-card  { padding: 12px 8px; }

  .event-toolbar-container {
    flex-direction: column;
    align-items: stretch;
  }

  .event-search-sort { flex-direction: column; }

  .event-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 480px) {
  .event-metrics-summary { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════════
   MEMBER PASSBOOK STATEMENT SaaS & MOBILE-FIRST REDESIGN
   ═══════════════════════════════════════════════════════════════════ */

/* ── Passbook Toolbar & Filters Box ──────────────────────────── */
.passbook-toolbar-box {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.passbook-search-group {
  flex: 2;
  min-width: 260px;
}

.passbook-date-group {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.form-label-sm {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.form-control-sm {
  padding: 6px 10px;
  font-size: 0.82rem;
  height: 34px;
}

/* ── Passbook Main Container ──────────────────────────────────── */
.passbook-container-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  position: relative;
}

/* ── Stacked Member Profile Card Header ───────────────────────── */
.passbook-member-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--glass-border);
  flex-wrap: wrap;
}

.passbook-avatar-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.passbook-member-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.passbook-member-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-gold);
  line-height: 1.2;
}

.passbook-member-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.passbook-period-block {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.passbook-org-badge {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-emerald);
  letter-spacing: -0.3px;
}

.passbook-period-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Balance Cards Track (Horizontal Swipe on Mobile) ────────── */
.passbook-balance-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.passbook-metric-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.passbook-metric-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.passbook-metric-card.highlight-due {
  background: rgba(234, 179, 8, 0.08);
  border-color: rgba(234, 179, 8, 0.3);
}

.pb-metric-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.pb-metric-content {
  display: flex;
  flex-direction: column;
}

.pb-metric-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pb-metric-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.pb-metric-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ── Quick Filter Chips ───────────────────────────────────────── */
.passbook-filter-row {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--glass-border);
}

/* ── Passbook Rich Badging ───────────────────────────────────── */
.pb-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.pb-badge-opening {
  background: rgba(245, 158, 11, 0.15);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.pb-badge-charge {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.pb-badge-payment {
  background: rgba(34, 197, 94, 0.15);
  color: #4ADE80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.pb-badge-adjustment {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.pb-badge-member-donation {
  background: rgba(168, 85, 247, 0.15);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.pb-badge-revoked {
  background: rgba(148, 163, 184, 0.15);
  color: #CBD5E1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* ── Desktop View Table Options ───────────────────────────────── */
.passbook-desktop-view {
  display: block;
}

.passbook-row-expandable {
  cursor: pointer;
  transition: background 0.15s ease;
}

.passbook-row-expandable:hover {
  background: rgba(255, 255, 255, 0.03);
}

.passbook-row-detail {
  background: rgba(15, 23, 42, 0.6);
  font-size: 0.82rem;
}

.passbook-detail-box {
  padding: 12px 16px;
  border-left: 3px solid var(--accent-primary);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

/* ── Mobile Timeline View (<768px) ────────────────────────────── */
.passbook-mobile-timeline {
  display: none;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

/* Vertical Timeline Connecting Line */
.passbook-mobile-timeline::before {
  content: '';
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 20px;
  width: 2px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.passbook-timeline-card {
  position: relative;
  z-index: 2;
  margin-left: 42px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.passbook-timeline-card::before {
  content: '';
  position: absolute;
  left: -30px;
  top: 18px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--text-muted);
  z-index: 3;
}

.passbook-timeline-card.type-opening::before { border-color: #F59E0B; background: #F59E0B; }
.passbook-timeline-card.type-charge::before  { border-color: #EF4444; background: #EF4444; }
.passbook-timeline-card.type-payment::before { border-color: #10B981; background: #10B981; }
.passbook-timeline-card.type-adjust::before  { border-color: #3B82F6; background: #3B82F6; }

.passbook-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.passbook-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.passbook-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.passbook-card-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.passbook-card-amount {
  font-size: 1.15rem;
  font-weight: 800;
}

.passbook-card-balance {
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.passbook-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.passbook-card-drawer {
  margin-top: 10px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Sticky Top Balance Header ────────────────────────────────── */
.passbook-sticky-bar {
  position: sticky;
  top: 60px;
  z-index: 99;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.passbook-sticky-info {
  display: flex;
  flex-direction: column;
}

.passbook-sticky-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.passbook-sticky-code {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.passbook-sticky-due {
  text-align: right;
  display: flex;
  flex-direction: column;
}

.passbook-sticky-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.passbook-sticky-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-gold);
}

/* ── Floating Action Button (FAB) ────────────────────────────── */
.passbook-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: none;
  border-radius: 30px;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.passbook-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.5);
}

.passbook-empty-state {
  text-align: center;
  padding: 40px 20px;
  background: rgba(30, 41, 59, 0.4);
  border-radius: var(--radius-md);
  border: 1px dashed var(--glass-border);
}

/* ── Responsive Breakpoint Overrides ─────────────────────────── */
@media (max-width: 991px) {
  .passbook-balance-track {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .passbook-toolbar-box {
    flex-direction: column;
    align-items: stretch;
  }

  .passbook-member-card {
    flex-direction: column;
    align-items: stretch;
  }

  .passbook-period-block {
    text-align: left;
    align-items: flex-start;
  }

  /* Horizontal swipe balance cards on mobile */
  .passbook-balance-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .passbook-balance-track::-webkit-scrollbar {
    height: 4px;
  }

  .passbook-balance-track::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
  }

  .passbook-metric-card {
    flex: 0 0 82%;
    scroll-snap-align: start;
  }

  /* Switch view to Mobile Timeline */
  .passbook-desktop-view {
    display: none !important;
  }

  .passbook-mobile-timeline {
    display: flex !important;
  }
}

