/* ================================================================
   Membership System — Custom Design System
   Font: Inter (Google Fonts)
   Theme: Light Blue, Clean, Indigo-accented
================================================================ */

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

/* ─── CSS Variables ─────────────────────────────────────────────── */
:root {
  --bg-base:        #EEF3FA;
  --bg-surface:     #E3EAF4;
  --bg-card:        #FFFFFF;
  --bg-card-hover:  #F0F5FF;
  --border:         rgba(99,122,180,0.18);
  --border-focus:   rgba(99,102,241,0.5);

  --sidebar-w:      260px;
  --sidebar-mini-w: 70px;
  --header-h:       64px;

  --accent:         #4F52C8;
  --accent-light:   #6366F1;
  --accent-glow:    rgba(99,102,241,0.18);

  --green:          #059669;
  --amber:          #D97706;
  --pink:           #DB2777;
  --red:            #DC2626;
  --slate:          #64748B;

  --text-primary:   #1E293B;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;

  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      16px;
  --radius-xl:      24px;

  --shadow-card:    0 2px 16px rgba(99,122,180,0.12);
  --shadow-glow:    0 0 32px rgba(99,102,241,0.12);
  --transition:     all 0.2s ease;
}


/* ─── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
input, textarea, select, button { font-family: inherit; }

/* ─── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ================================================================
   AUTH — Login Page
================================================================ */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 480px;
  background: var(--bg-base);
}

.auth-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  background: linear-gradient(135deg, #1E3A8A 0%, #1D4ED8 50%, #2563EB 100%);
}

.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 40%, rgba(255,255,255,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 75% 70%, rgba(147,197,253,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.auth-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 40px 40px;
}

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

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.auth-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px var(--accent-glow);
}

.auth-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-hero h1 {
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.auth-hero h1 span {
  background: linear-gradient(135deg, var(--accent-light), #a78bfa, var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-hero p { color: var(--text-secondary); font-size: 1rem; line-height: 1.7; max-width: 420px; }

.auth-features { margin-top: 48px; display: flex; flex-direction: column; gap: 16px; }

.auth-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
  transition: var(--transition);
}

.auth-feature:hover { background: var(--bg-card-hover); border-color: rgba(99,102,241,0.3); }

.auth-feature-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.auth-feature-text h4 { font-size: 0.875rem; font-weight: 600; margin-bottom: 2px; }
.auth-feature-text p  { font-size: 0.75rem; color: var(--text-secondary); }

/* Auth Form Panel */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: linear-gradient(180deg, #1E40AF 0%, #1D4ED8 40%, #2563EB 100%);
  border-left: none;
  position: relative;
  overflow: hidden;
}

.auth-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 20% 80%, rgba(147,197,253,0.10) 0%, transparent 60%);
  pointer-events: none;
}

.auth-form-card {
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

.auth-form-card h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; color: #fff; }
.auth-form-card .subtitle { color: rgba(255,255,255,0.65); font-size: 0.875rem; margin-bottom: 32px; }

/* Form elements */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

/* Login panel overrides — white labels on blue background */
.auth-panel .form-label { color: rgba(255,255,255,0.75); }
.auth-panel .form-check  { color: rgba(255,255,255,0.75); }

.form-input-wrapper { position: relative; }
.form-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.form-input.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input-no-icon { padding-left: 14px; }

/* Login panel — glass inputs on blue */
.auth-panel .form-input {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}
.auth-panel .form-input::placeholder { color: rgba(255,255,255,0.5); }
.auth-panel .form-input:focus {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.5);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.12);
}
.auth-panel .form-input-icon { color: rgba(255,255,255,0.55); }

/* Checkbox */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Error / Success alerts */
.form-error { color: var(--red); font-size: 0.78rem; margin-top: 6px; }
.alert-danger {
  padding: 12px 16px;
  background: rgba(220,38,38,0.12);
  border: 1px solid rgba(220,38,38,0.3);
  border-radius: var(--radius-md);
  color: var(--red);
  font-size: 0.875rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success {
  padding: 12px 16px;
  background: rgba(5,150,105,0.1);
  border: 1px solid rgba(5,150,105,0.3);
  border-radius: var(--radius-md);
  color: var(--green);
  font-size: 0.875rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Alert overrides inside blue login panel */
.auth-panel .alert-danger  { background: rgba(255,255,255,0.1); border-color: rgba(255,100,100,0.4); color: #FCA5A5; }
.auth-panel .alert-success { background: rgba(255,255,255,0.1); border-color: rgba(100,255,200,0.3); color: #A7F3D0; }
.auth-panel .form-error    { color: #FCA5A5; }

/* Sign-in button — solid white on blue panel */
.auth-panel .btn-primary {
  background: #fff;
  color: #1D4ED8;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.auth-panel .btn-primary:hover {
  background: #EFF6FF;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}

/* Copyright footer on blue */
.auth-panel .auth-copyright { color: rgba(255,255,255,0.45); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99,102,241,0.4);
}

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

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover { background: var(--bg-card-hover); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #DC2626; }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* ================================================================
   APP LAYOUT — Collapsible Sidebar + Main
================================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #1E40AF 0%, #1D4ED8 40%, #2563EB 100%);
  border-right: none;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(29,78,216,0.25);
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease;
}

.sidebar-header {
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: var(--header-h);
  transition: padding 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--accent-glow);
  flex-shrink: 0;
}

.sidebar-logo-info {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.sidebar-logo-text { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.sidebar-logo-sub  { font-size: 0.7rem; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.06em; }

/* Sidebar Collapse Mini-Button */
.sidebar-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.08);
}

.sidebar-nav { flex: 1; padding: 16px 12px; transition: padding 0.25s ease; }

.sidebar-nav-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  padding: 0 8px;
  margin: 16px 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s ease;
}

.sidebar-nav-label:first-child { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.nav-item.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 600;
}

.nav-item.active .nav-icon { color: #fff; }

.nav-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
  font-size: 1.1rem;
  transition: background 0.2s ease;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  background: rgba(255,255,255,0.15);
}

.nav-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s ease;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.12);
  transition: padding 0.25s ease;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  overflow: hidden;
  transition: var(--transition);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.sidebar-user-name  { font-size: 0.8rem; font-weight: 600; color: #fff; }
.sidebar-user-role  { font-size: 0.7rem; color: rgba(255,255,255,0.6); }

.sidebar-logout {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.55);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

.sidebar-logout:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ─── Main Content ─────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Top Header ─────────────────────────────────────────────────── */
.top-header {
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(238,243,250,0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.sidebar-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  color: var(--accent);
  transform: scale(1.05);
}

.header-title h1 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; }
.header-title p  { font-size: 0.75rem; color: var(--text-muted); }

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

.header-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
}

.role-pill {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ================================================================
   COLLAPSIBLE SIDEBAR STATES & HOVER-TO-EXPAND
================================================================ */
/* Base Collapsed Layout */
.app-layout.sidebar-collapsed .main-content,
html.sidebar-collapsed-init .app-layout .main-content {
  margin-left: var(--sidebar-mini-w);
}

.app-layout.sidebar-collapsed .sidebar,
html.sidebar-collapsed-init .app-layout .sidebar {
  width: var(--sidebar-mini-w);
}

.app-layout.sidebar-collapsed .sidebar-header,
html.sidebar-collapsed-init .app-layout .sidebar-header {
  padding: 16px 14px;
  justify-content: center;
}

.app-layout.sidebar-collapsed .sidebar-logo-info,
.app-layout.sidebar-collapsed .sidebar-collapse-btn,
.app-layout.sidebar-collapsed .sidebar-nav-label,
.app-layout.sidebar-collapsed .nav-text,
.app-layout.sidebar-collapsed .nav-caret,
.app-layout.sidebar-collapsed .sidebar-user-info,
.app-layout.sidebar-collapsed .sidebar-logout .nav-text,
html.sidebar-collapsed-init .app-layout .sidebar-logo-info,
html.sidebar-collapsed-init .app-layout .sidebar-collapse-btn,
html.sidebar-collapsed-init .app-layout .sidebar-nav-label,
html.sidebar-collapsed-init .app-layout .nav-text,
html.sidebar-collapsed-init .app-layout .nav-caret,
html.sidebar-collapsed-init .app-layout .sidebar-user-info,
html.sidebar-collapsed-init .app-layout .sidebar-logout .nav-text {
  display: none;
  opacity: 0;
}

.app-layout.sidebar-collapsed .sidebar-nav,
html.sidebar-collapsed-init .app-layout .sidebar-nav {
  padding: 16px 8px;
}

.app-layout.sidebar-collapsed .nav-item,
html.sidebar-collapsed-init .app-layout .nav-item {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
}

.app-layout.sidebar-collapsed .sidebar-footer,
html.sidebar-collapsed-init .app-layout .sidebar-footer {
  padding: 16px 8px;
}

.app-layout.sidebar-collapsed .sidebar-user,
html.sidebar-collapsed-init .app-layout .sidebar-user {
  padding: 6px;
  justify-content: center;
  background: transparent;
  border-color: transparent;
}

.app-layout.sidebar-collapsed .sidebar-logout,
html.sidebar-collapsed-init .app-layout .sidebar-logout {
  justify-content: center;
  padding: 9px 0;
  gap: 0;
}

.app-layout.sidebar-collapsed .nav-submenu-items,
html.sidebar-collapsed-init .app-layout .nav-submenu-items {
  display: none !important;
}

/* ── Hover-To-Expand Behavior when Minimized ─────────────────────── */
.app-layout.sidebar-collapsed .sidebar:hover {
  width: var(--sidebar-w);
  box-shadow: 8px 0 36px rgba(15, 23, 42, 0.4);
  z-index: 200;
}

.app-layout.sidebar-collapsed .sidebar:hover .sidebar-header {
  padding: 20px 18px;
  justify-content: space-between;
}

.app-layout.sidebar-collapsed .sidebar:hover .sidebar-logo-info,
.app-layout.sidebar-collapsed .sidebar:hover .sidebar-collapse-btn,
.app-layout.sidebar-collapsed .sidebar:hover .sidebar-nav-label,
.app-layout.sidebar-collapsed .sidebar:hover .nav-text,
.app-layout.sidebar-collapsed .sidebar:hover .sidebar-user-info,
.app-layout.sidebar-collapsed .sidebar:hover .sidebar-logout .nav-text {
  display: block;
  opacity: 1;
}

.app-layout.sidebar-collapsed .sidebar:hover .nav-caret {
  display: inline-block;
  opacity: 1;
  margin-left: auto;
}

.app-layout.sidebar-collapsed .sidebar:hover .sidebar-nav {
  padding: 16px 12px;
}

.app-layout.sidebar-collapsed .sidebar:hover .nav-item {
  justify-content: flex-start;
  padding: 10px 12px;
  gap: 10px;
}

.app-layout.sidebar-collapsed .sidebar:hover .sidebar-footer {
  padding: 16px 12px;
}

.app-layout.sidebar-collapsed .sidebar:hover .sidebar-user {
  padding: 10px 12px;
  justify-content: flex-start;
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.15);
}

.app-layout.sidebar-collapsed .sidebar:hover .sidebar-logout {
  justify-content: flex-start;
  padding: 9px 12px;
  gap: 8px;
}

.app-layout.sidebar-collapsed .sidebar:hover .nav-submenu[open] .nav-submenu-items {
  display: block !important;
}

/* ─── Page Content ─────────────────────────────────────────────── */
.page-content { padding: 28px; flex: 1; }

/* ─── Stats Cards ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  transition: var(--transition);
  animation: fadeSlideUp 0.4s ease both;
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.stat-card-info {}
.stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.stat-change { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* ─── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: fadeSlideUp 0.4s ease both;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title { font-size: 0.95rem; font-weight: 700; }
.card-subtitle { font-size: 0.75rem; color: var(--text-muted); }
.card-body { padding: 24px; }

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ─── Table ──────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.875rem;
  vertical-align: middle;
}

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

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

/* ─── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-active   { background: rgba(5,150,105,0.12);   color: #065F46; }
.badge-inactive { background: rgba(220,38,38,0.10);   color: #991B1B; }
.badge-admin    { background: rgba(79,82,200,0.12);   color: #3730A3; }
.badge-finance  { background: rgba(5,150,105,0.12);   color: #065F46; }
.badge-cs       { background: rgba(217,119,6,0.12);   color: #92400E; }
.badge-marketing{ background: rgba(219,39,119,0.12);  color: #9D174D; }
.badge-tenant-relations { background: rgba(109,40,217,0.10); color: #5B21B6; }
.badge-member   { background: rgba(100,116,139,0.12); color: #334155; }

/* Member Type Badges */
.badge-member-silver { background: linear-gradient(135deg, rgba(148,163,184,0.15), rgba(203,213,225,0.12)); color: #94a3b8; border: 1px solid rgba(148,163,184,0.3); }
.badge-member-gold   { background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(217,119,6,0.12));   color: #d97706; border: 1px solid rgba(245,158,11,0.3); }
.badge-member-galuh  { background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(168,85,247,0.12));  color: #8b5cf6; border: 1px solid rgba(139,92,246,0.3); }

/* ─── Avatar ──────────────────────────────────────────────────────── */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-cell { display: flex; align-items: center; gap: 12px; }
.user-cell-name  { font-size: 0.875rem; font-weight: 600; }
.user-cell-email { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Actions ──────────────────────────────────────────────────────── */
.action-group { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
}

.icon-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: rgba(255,255,255,0.15); }
.icon-btn.danger:hover { background: rgba(239,68,68,0.12); color: #FCA5A5; border-color: rgba(239,68,68,0.3); }

/* ─── Page Header ──────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  animation: fadeSlideUp 0.3s ease both;
}

.page-header-text h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.page-header-text p  { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* ─── Search / Filters ─────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 9px 14px 9px 38px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus { border-color: var(--border-focus); }

.search-wrapper { position: relative; flex: 1; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.85rem; }

.filter-select {
  padding: 9px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.filter-select:focus { border-color: var(--border-focus); }
.filter-select option { background: #FFFFFF; color: var(--text-primary); }

/* ─── Permissions Table ──────────────────────────────────────────── */
.perm-table th,
.perm-table td { padding: 11px 16px; }

.perm-route-name { font-family: 'Courier New', monospace; font-size: 0.78rem; color: var(--accent-light); }
.perm-group      { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(99,122,180,0.15);
  border-radius: 99px;
  cursor: pointer;
  transition: 0.3s;
  border: 1px solid var(--border);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(79,82,200,0.2);
  border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: var(--accent-light);
}

/* ─── Change Password Form ──────────────────────────────────────────── */
.pw-card {
  max-width: 500px;
}

/* ─── Member Page ──────────────────────────────────────────────── */
.member-page {
  min-height: 100vh;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
}

.member-topbar {
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.member-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background:
    radial-gradient(ellipse 50% 50% at 30% 30%, rgba(99,102,241,0.1) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 70% 70%, rgba(236,72,153,0.07) 0%, transparent 60%);
}

.member-card {
  max-width: 520px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow-glow);
}

.member-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--slate), #334155);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto 20px;
  border: 3px solid var(--border);
}

.member-card h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.member-card p  { color: var(--text-secondary); font-size: 0.875rem; }

.member-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}

.member-info-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: left;
}

.member-info-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.member-info-value { font-size: 0.9rem; font-weight: 600; }

/* ─── Pagination ──────────────────────────────────────────────────── */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.page-link {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.8rem;
  transition: var(--transition);
  cursor: pointer;
}

.page-link:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.page-link.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-link.disabled { opacity: 0.3; pointer-events: none; }

/* ─── Animations ──────────────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* Stagger animation delay for stat cards */
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }

/* ─── Role Colors on sidebar ─────────────────────────────────────── */
.role-admin     { color: #4F52C8; }
.role-finance   { color: #059669; }
.role-cs        { color: #B45309; }
.role-marketing { color: #BE185D; }
.role-member    { color: #475569; }

.bg-accent     { background: rgba(79,82,200,0.12); }
.bg-green      { background: rgba(5,150,105,0.12); }
.bg-amber      { background: rgba(217,119,6,0.12);  }
.bg-pink       { background: rgba(219,39,119,0.12);  }
.bg-slate      { background: rgba(100,116,139,0.12); }

.text-accent     { color: var(--accent-light); }
.text-green      { color: #059669; }
.text-amber      { color: #D97706; }
.text-pink       { color: #DB2777; }
.text-slate      { color: #64748B; }

/* ─── Utilities ─────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.w-full { width: 100%; }
.text-sm    { font-size: 0.875rem; }
.text-xs    { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.font-bold  { font-weight: 700; }

/* ================================================================
   SIDEBAR SUBMENU (details/summary accordion)
================================================================ */
details.nav-submenu { display: block; }
details.nav-submenu > summary { list-style: none; cursor: pointer; }
details.nav-submenu > summary::-webkit-details-marker { display: none; }

.nav-caret {
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform 0.25s ease;
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
}

details.nav-submenu[open] > summary .nav-caret {
  transform: rotate(180deg);
}

.nav-submenu-items {
  padding-left: 0;
  margin-top: 2px;
}

.nav-subitem {
  padding-left: 44px;
  font-size: 0.83rem;
}

/* ================================================================
   IMAGE UPLOAD BOX
================================================================ */
.upload-box {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}

.upload-box:hover {
  border-color: rgba(99,102,241,0.4);
  background: rgba(99,102,241,0.04);
}

.upload-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  pointer-events: none;
}

.upload-placeholder i { font-size: 2rem; color: var(--border); }
.upload-placeholder span { font-size: 0.875rem; }

.upload-preview {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
  margin: 0 auto;
}

.upload-current {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.upload-current img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ================================================================
   QUILL RICH TEXT EDITOR — Light Theme Overrides
================================================================ */
.ql-toolbar.ql-snow {
  background: var(--bg-surface);
  border: 1px solid var(--border) !important;
  border-bottom: none !important;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 8px 12px;
}

.ql-container.ql-snow {
  background: var(--bg-card);
  border: 1px solid var(--border) !important;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
}

.ql-toolbar.ql-snow .ql-stroke  { stroke: var(--text-secondary); }
.ql-toolbar.ql-snow .ql-fill    { fill: var(--text-secondary); }
.ql-toolbar.ql-snow .ql-picker  { color: var(--text-secondary); }
.ql-toolbar.ql-snow .ql-picker-options { background: var(--bg-surface); border: 1px solid var(--border); }
.ql-toolbar.ql-snow .ql-picker-item { color: var(--text-secondary); }
.ql-toolbar.ql-snow button:hover .ql-stroke { stroke: var(--text-primary); }
.ql-toolbar.ql-snow button.ql-active .ql-stroke { stroke: var(--accent-light); }
.ql-toolbar.ql-snow button.ql-active .ql-fill  { fill: var(--accent-light); }
.ql-toolbar.ql-snow .ql-picker-label { color: var(--text-secondary); }
.ql-toolbar.ql-snow .ql-picker-label:hover { color: var(--text-primary); }

.ql-editor { min-height: 180px; color: var(--text-primary); line-height: 1.7; }
.ql-editor.ql-blank::before { color: var(--text-muted); font-style: normal; }
.ql-editor p, .ql-editor h1, .ql-editor h2, .ql-editor h3 { color: var(--text-primary); }

/* ================================================================
   TABLE IMAGE THUMBNAIL
================================================================ */
.tbl-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.tbl-img-placeholder {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.1rem;
}


/* ================================================================
   CUSTOM DELETE CONFIRMATION MODAL
================================================================ */
@keyframes modalPop {
  0%   { opacity: 0; transform: scale(0.88) translateY(16px); }
  70%  { transform: scale(1.03) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes ringRotate { to { transform: rotate(360deg); } }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.18s ease both;
}
.modal-overlay.hidden { display: none; }

.delete-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 36px 32px;
  max-width: 420px;
  width: calc(100% - 40px);
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.08);
  animation: modalPop 0.32s cubic-bezier(0.34,1.56,0.64,1) both;
}
.delete-modal-icon-wrap {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(220,38,38,0.08); border: 2px solid rgba(220,38,38,0.18);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; position: relative;
}
.delete-modal-icon-wrap::after {
  content: ''; position: absolute; inset: -7px; border-radius: 50%;
  border: 1px dashed rgba(220,38,38,0.22);
  animation: ringRotate 10s linear infinite;
}
.delete-modal-icon-wrap i { font-size: 2rem; color: var(--red); }
.delete-modal-title { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); margin-bottom: 10px; }
.delete-modal-msg { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.65; margin-bottom: 6px; }
.delete-item-highlight {
  display: inline-block; font-weight: 700; color: var(--text-primary);
  background: rgba(220,38,38,0.07); border: 1px solid rgba(220,38,38,0.18);
  border-radius: 6px; padding: 1px 8px; margin: 0 2px; word-break: break-word;
}
.delete-modal-warning {
  font-size: 0.77rem; color: var(--text-muted); margin-bottom: 28px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.delete-modal-divider { height: 1px; background: var(--border); margin: 0 -36px 24px; }
.delete-modal-actions { display: flex; gap: 10px; }
.btn-modal-cancel, .btn-modal-delete {
  flex: 1; padding: 11px 16px; font-size: 0.875rem; font-weight: 600;
  border-radius: var(--radius-md); cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit;
}
.btn-modal-cancel { background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-secondary); }
.btn-modal-cancel:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-modal-delete { background: linear-gradient(135deg,#DC2626,#B91C1C); color: #fff; border: none; box-shadow: 0 4px 14px rgba(220,38,38,0.3); }
.btn-modal-delete:hover { background: linear-gradient(135deg,#EF4444,#DC2626); box-shadow: 0 6px 20px rgba(220,38,38,0.45); transform: translateY(-1px); }
.btn-modal-delete:active { transform: translateY(0); }
