/* ================================================================
   جمعية أم فيصل v4 — Ultra Premium Dark Theme
   Dark: Near-black luxury with gold / Light: Warm champagne premium
================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&family=Noto+Naskh+Arabic:wght@400;500;600;700&display=swap');

/* ══════════════════════════════════════════════════════════════
   DARK THEME (Default) — Obsidian + Gold
══════════════════════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg-page:       #060A10;
  --bg-sidebar:    #030508;
  --bg-card:       #0C1420;
  --bg-card2:      #111C2E;
  --bg-card3:      #162236;
  --bg-input:      rgba(255,255,255,0.05);
  --bg-hover:      rgba(255,255,255,0.04);
  --bg-glass:      rgba(12,20,32,0.8);

  /* Borders */
  --border:        rgba(201,168,76,0.2);
  --border-light:  rgba(255,255,255,0.06);
  --border-strong: rgba(201,168,76,0.4);

  /* Text */
  --text-primary:  #E8EDF5;
  --text-secondary:#7A94B0;
  --text-muted:    #3A506A;
  --text-gold:     #E8C97A;

  /* Brand */
  --topbar-bg:     rgba(3,5,8,0.92);
  --gold:          #C9A84C;
  --gold-light:    #E8C97A;
  --gold-bright:   #F5DFA0;
  --gold-pale:     rgba(201,168,76,0.1);
  --gold-glow:     rgba(201,168,76,0.15);

  /* Status */
  --success:       #3DB86A;
  --success-bg:    rgba(61,184,106,0.1);
  --danger:        #E84C4C;
  --danger-bg:     rgba(232,76,76,0.1);
  --warning:       #E8A84C;
  --warning-bg:    rgba(232,168,76,0.1);
  --info:          #4C8CE8;
  --info-bg:       rgba(76,140,232,0.1);

  /* Layout */
  --radius:        12px;
  --radius-lg:     18px;
  --radius-xl:     24px;
  --shadow:        0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg:     0 12px 48px rgba(0,0,0,0.65);
  --shadow-gold:   0 0 30px rgba(201,168,76,0.12);
  --sidebar-w:     260px;
  --font-h:        'Cairo', sans-serif;
  --font-b:        'Noto Naskh Arabic', serif;
}

/* ══════════════════════════════════════════════════════════════
   LIGHT THEME — Warm Champagne Luxury
══════════════════════════════════════════════════════════════ */
[data-theme="light"] {
  --bg-page:       #F0F4FA;
  --bg-sidebar:    #0D1826;
  --bg-card:       #FFFFFF;
  --bg-card2:      #F5F7FC;
  --bg-card3:      #EBF0FA;
  --bg-input:      #FFFFFF;
  --bg-hover:      rgba(17,34,64,0.05);
  --bg-glass:      rgba(255,255,255,0.95);

  --border:        rgba(17,34,64,0.14);
  --border-light:  rgba(17,34,64,0.09);
  --border-strong: rgba(17,34,64,0.3);

  --text-primary:  #0A1628;
  --text-secondary:#3A4E6A;
  --text-muted:    #6A7E9A;
  --text-gold:     #7A5A10;

  --topbar-bg:     rgba(255,255,255,0.97);
  --gold:          #9A7220;
  --gold-light:    #B8902A;
  --gold-bright:   #C9A84C;
  --gold-pale:     rgba(154,114,32,0.1);
  --gold-glow:     rgba(154,114,32,0.12);

  --success:       #1A7A38;
  --success-bg:    rgba(26,122,56,0.09);
  --danger:        #BE2020;
  --danger-bg:     rgba(190,32,32,0.09);
  --warning:       #8A5500;
  --warning-bg:    rgba(138,85,0,0.09);
  --info:          #1A4A9A;
  --info-bg:       rgba(26,74,154,0.09);

  --shadow:        0 2px 16px rgba(100,80,30,0.1);
  --shadow-lg:     0 8px 36px rgba(100,80,30,0.16);
  --shadow-gold:   0 0 24px rgba(180,140,60,0.1);
}

/* ══════════════════════════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-b);
  background: var(--bg-page);
  color: var(--text-primary);
  direction: rtl; text-align: right;
  min-height: 100vh; font-size: 15px; line-height: 1.6;
  transition: background 0.35s, color 0.35s;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.25); border-radius: 99px; }
a { text-decoration: none; color: inherit; }

/* ══════════════════════════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh; display: flex;
  background: #030508;
}
.auth-left {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 40px; position: relative; overflow: hidden;
}
.auth-left::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(201,168,76,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 80% 20%, rgba(12,20,32,0.9) 0%, transparent 70%);
}
/* Subtle grid lines */
.auth-left::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(201,168,76,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}
.auth-brand { position: absolute; top: 28px; right: 36px; z-index: 2; }
.auth-form-box { width: 100%; max-width: 400px; position: relative; z-index: 2; }
.auth-right {
  width: 460px;
  background: linear-gradient(160deg, #060E1A 0%, #0C1828 60%, #060E1A 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 48px; position: relative; overflow: hidden;
  border-right: 1px solid rgba(201,168,76,0.1);
}
.auth-right::before {
  content: ''; position: absolute; inset: 0; opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cpath d='M50 5 L95 50 L50 95 L5 50 Z' fill='none' stroke='%23C9A84C' stroke-width='0.8'/%3E%3Cpath d='M50 22 L78 50 L50 78 L22 50 Z' fill='none' stroke='%23C9A84C' stroke-width='0.5'/%3E%3Ccircle cx='50' cy='50' r='8' fill='none' stroke='%23C9A84C' stroke-width='0.5'/%3E%3C/svg%3E");
}
.auth-right::after {
  content: ''; position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(201,168,76,0.08) 0%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.auth-right-content { position: relative; z-index: 1; text-align: center; }
.auth-right h2 { font-family: var(--font-h); font-size: 30px; font-weight: 900; color: #E8EDF5; line-height: 1.3; margin-bottom: 14px; }
.auth-right h2 span { color: var(--gold-light); }
.auth-right p { color: rgba(255,255,255,0.35); font-size: 15px; line-height: 1.9; }
.auth-stats { display: flex; gap: 28px; margin-top: 36px; }
.auth-stat { text-align: center; }
.auth-stat-num { font-family: var(--font-h); font-size: 26px; font-weight: 900; color: var(--gold-light); }
.auth-stat-label { font-size: 12px; color: rgba(255,255,255,0.25); margin-top: 2px; }
@media(max-width:800px){ .auth-right { display: none; } }

/* ══════════════════════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════════════════════ */
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-left: 1px solid rgba(201,168,76,0.1);
  display: flex; flex-direction: column;
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 22px 20px;
  display: flex; align-items: center; gap: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(201,168,76,0.3), 0 0 0 1px rgba(201,168,76,0.2);
}
.logo-text { font-family: var(--font-h); font-size: 14px; font-weight: 900; color: #E8EDF5; line-height: 1.2; }
.logo-text span { color: rgba(232,201,122,0.55); display: block; font-size: 10px; font-weight: 400; margin-top: 2px; letter-spacing: 0.03em; }
.sidebar-user {
  padding: 16px 20px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.015);
}
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-h); font-size: 15px; font-weight: 700;
  color: #060A10; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.user-info .user-name { font-family: var(--font-h); font-size: 13px; font-weight: 700; color: #E8EDF5; }
.user-info .user-role { font-size: 11px; color: var(--gold-light); margin-top: 1px; opacity: 0.8; }
.sidebar-nav { padding: 10px 0; flex: 1; }
.nav-section-label {
  font-family: var(--font-h); font-size: 9px; font-weight: 700;
  letter-spacing: 0.15em; color: rgba(255,255,255,0.15);
  text-transform: uppercase; padding: 10px 20px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  font-family: var(--font-h); font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.38);
  transition: background 0.15s, color 0.15s; cursor: pointer;
  position: relative;
}
.nav-item:hover { color: rgba(255,255,255,0.75); background: rgba(255,255,255,0.03); }
.nav-item.active {
  color: var(--gold-light);
  background: rgba(201,168,76,0.08);
  border-right: 2px solid var(--gold);
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; opacity: 0.7; }
.nav-badge {
  margin-right: auto; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 99px;
  padding: 1px 6px; min-width: 18px; text-align: center;
}
.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.sidebar-logout {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-h); font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.25); cursor: pointer;
  padding: 8px 0; background: none; border: none; width: 100%; text-align: right;
  transition: color 0.2s;
}
.sidebar-logout:hover { color: var(--danger); }

/* ── Topbar ──────────────────────────────────────────────────── */
.main-content { margin-right: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border-light);
  padding: 0 28px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(20px) saturate(1.5);
  transition: background 0.35s;
}
.topbar-title { font-family: var(--font-h); font-size: 16px; font-weight: 700; color: var(--text-primary); }
.topbar-actions { display: flex; gap: 9px; align-items: center; }
.topbar-hamburger { display: none; background: none; border: none; cursor: pointer; font-size: 20px; color: var(--text-primary); padding: 4px 8px; }
.page-content { padding: 26px; flex: 1; }

/* ── Theme Toggle ────────────────────────────────────────────── */
.theme-toggle {
  width: 38px; height: 20px; border-radius: 99px;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.25);
  cursor: pointer; position: relative; flex-shrink: 0;
}
.theme-toggle-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); position: absolute;
  top: 2px; right: 2px; transition: transform 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
[data-theme="light"] .theme-toggle-thumb { transform: translateX(-18px); }
.theme-label { font-family: var(--font-h); font-size: 11px; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   TYPOGRAPHY
══════════════════════════════════════════════════════════════ */
h1,h2,h3,h4,h5 { font-family: var(--font-h); color: var(--text-primary); line-height: 1.3; }
h1{font-size:24px;font-weight:900} h2{font-size:20px;font-weight:700}
h3{font-size:16px;font-weight:700} h4{font-size:14px;font-weight:700}

/* ══════════════════════════════════════════════════════════════
   CARDS — Premium glass effect
══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: background 0.35s, border-color 0.35s;
  position: relative; overflow: hidden;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.card-title { font-family: var(--font-h); font-size: 14px; font-weight: 700; color: var(--text-primary); }

/* ── Stat Cards ──────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
  transition: all 0.25s;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 90px; height: 90px;
  background: radial-gradient(circle, rgba(201,168,76,0.06) 0%, transparent 65%);
  border-radius: 0 var(--radius-lg) 0 90px; pointer-events: none;
}
.stat-card::after {
  content: ''; position: absolute; bottom: 0; right: 0; left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.15), transparent);
}
.stat-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-lg);
  border-color: rgba(201,168,76,0.15);
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-num { font-family: var(--font-h); font-size: 22px; font-weight: 900; color: var(--text-primary); line-height: 1; }
.stat-label { font-family: var(--font-h); font-size: 11px; font-weight: 600; color: var(--text-muted); margin-top: 4px; }

/* ── Circle Cards ────────────────────────────────────────────── */
.circle-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.25s; cursor: pointer;
  position: relative; overflow: hidden;
}
.circle-card::before {
  content: ''; position: absolute; inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(201,168,76,0.12) 0%, transparent 40%, transparent 60%, rgba(201,168,76,0.04) 100%);
  opacity: 0; transition: opacity 0.25s; pointer-events: none; z-index: 0;
}
.circle-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg), var(--shadow-gold); border-color: rgba(201,168,76,0.2); }
.circle-card:hover::before { opacity: 1; }
.circle-card > * { position: relative; z-index: 1; }
.circle-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.circle-card-name { font-family: var(--font-h); font-size: 15px; font-weight: 700; color: var(--text-primary); }
.circle-card-admin { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.circle-card-amount { font-family: var(--font-h); font-size: 20px; font-weight: 900; color: var(--gold); }
.circle-card-amount span { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.progress-bar { height: 3px; background: rgba(255,255,255,0.05); border-radius: 99px; overflow: hidden; }
[data-theme="light"] .progress-bar { background: rgba(0,0,0,0.08); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 99px; transition: width 0.6s ease; }
.circle-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.members-stack { display: flex; }
.member-pip {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--bg-card);
  font-family: var(--font-h); font-size: 9px; font-weight: 700;
  color: #060A10; display: flex; align-items: center; justify-content: center;
  margin-left: -6px;
}
.member-pip:first-child { margin-left: 0; }

/* ══════════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-h); font-size: 10px; font-weight: 700;
  border-radius: 999px; padding: 3px 10px; letter-spacing: 0.02em;
}
.badge-gold    { background: rgba(201,168,76,0.12); color: #C9A84C; border: 1px solid rgba(201,168,76,0.2); }
.badge-green   { background: var(--success-bg);  color: var(--success); border: 1px solid rgba(61,184,106,0.2); }
.badge-red     { background: var(--danger-bg);   color: var(--danger);  border: 1px solid rgba(232,76,76,0.2); }
.badge-blue    { background: var(--info-bg);     color: var(--info);    border: 1px solid rgba(76,140,232,0.2); }
.badge-muted   { background: rgba(255,255,255,0.04); color: var(--text-muted); border: 1px solid var(--border-light); }
.badge-orange  { background: var(--warning-bg);  color: var(--warning); border: 1px solid rgba(232,168,76,0.2); }
[data-theme="light"] .badge-gold   { background: rgba(180,140,60,0.1); color: #8B6520; }
[data-theme="light"] .badge-green  { background: rgba(30,122,64,0.08); color: var(--success); }
[data-theme="light"] .badge-blue   { background: rgba(26,74,138,0.08); color: var(--info); }
[data-theme="light"] .badge-muted  { background: rgba(0,0,0,0.04); color: var(--text-muted); border-color: var(--border-light); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-h); font-size: 13px; font-weight: 700;
  border: none; border-radius: var(--radius); padding: 9px 18px;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  color: #060A10;
  box-shadow: 0 2px 12px rgba(201,168,76,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,168,76,0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: rgba(255,255,255,0.05); color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.12); }
[data-theme="light"] .btn-secondary { background: rgba(0,0,0,0.04); border-color: var(--border-light); }
[data-theme="light"] .btn-secondary:hover { background: rgba(0,0,0,0.07); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(232,76,76,0.2); }
.btn-danger:hover { background: rgba(232,76,76,0.18); }
.btn-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(61,184,106,0.2); }
.btn-success:hover { background: rgba(61,184,106,0.18); }
.btn-outline { background: transparent; color: var(--gold); border: 1px solid rgba(201,168,76,0.3); }
.btn-outline:hover { background: var(--gold-pale); border-color: rgba(201,168,76,0.5); }
.btn-sm { padding: 6px 13px; font-size: 12px; border-radius: 9px; }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: 14px; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ══════════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-family: var(--font-h); font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.03em; text-transform: uppercase; }
.form-input, .form-select, .form-textarea {
  width: 100%; font-family: var(--font-b); font-size: 15px;
  color: var(--text-primary); background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 11px 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.35s;
  direction: rtl;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: rgba(201,168,76,0.5);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.08);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 85px; resize: vertical; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; font-family: var(--font-h); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Auth form — always dark since auth page bg is always dark */
.auth-form-box .form-input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  color: #E8EDF5;
}
.auth-form-box .form-input::placeholder { color: rgba(255,255,255,0.25); }
.auth-form-box .form-input:focus { border-color: rgba(201,168,76,0.5); background: rgba(255,255,255,0.09); box-shadow: 0 0 0 3px rgba(201,168,76,0.1); }
.auth-form-box .form-label { color: rgba(255,255,255,0.5); text-transform: uppercase; }
.auth-form-box .form-select { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: #E8EDF5; }
.auth-form-box .btn-primary { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.auth-title { font-family: var(--font-h); font-size: 26px; font-weight: 900; color: #E8EDF5; margin-bottom: 4px; }
.auth-title span { color: var(--gold-light); }
.auth-sub { font-size: 14px; color: rgba(255,255,255,0.35); margin-bottom: 28px; line-height: 1.6; }
.auth-link { font-family: var(--font-h); font-size: 13px; color: rgba(255,255,255,0.32); text-align: center; margin-top: 18px; }
.auth-link a { color: var(--gold-light); font-weight: 600; }
.auth-link a:hover { color: var(--gold-bright); }

/* ══════════════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
thead th {
  font-family: var(--font-h); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; color: var(--text-muted); text-transform: uppercase;
  padding: 12px 14px; background: var(--bg-card2);
  border-bottom: 1px solid var(--border-light); white-space: nowrap;
}
tbody td { padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 14px; color: var(--text-primary); vertical-align: middle; }
[data-theme="light"] tbody td { border-bottom-color: var(--border-light); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-hover); }

/* ══════════════════════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════════════════════ */
.alert { padding: 11px 15px; border-radius: var(--radius); font-family: var(--font-h); font-size: 13px; font-weight: 600; margin-bottom: 14px; display: none; }
.alert.show { display: block; }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(232,76,76,0.2); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(61,184,106,0.2); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(232,168,76,0.2); }

/* ══════════════════════════════════════════════════════════════
   GRID UTILITIES
══════════════════════════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
@media(max-width:1200px){ .grid-4{grid-template-columns:repeat(2,1fr)} }
@media(max-width:900px)  { .grid-3{grid-template-columns:repeat(2,1fr)} }
@media(max-width:640px)  { .grid-2,.grid-3,.grid-4{grid-template-columns:1fr} .form-row{grid-template-columns:1fr} }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2{gap:8px} .gap-3{gap:12px} .gap-4{gap:16px}
.mt-1{margin-top:6px} .mt-2{margin-top:14px} .mt-3{margin-top:22px}
.mb-2{margin-bottom:14px} .mb-3{margin-bottom:22px} .mb-4{margin-bottom:30px}

/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 44px; margin-bottom: 12px; opacity: 0.6; }
.empty-state p { font-family: var(--font-h); font-size: 14px; }

/* ══════════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl); padding: 28px;
  width: 100%; max-width: 460px;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-light);
  position: relative;
  animation: modalIn .22s cubic-bezier(0.16,1,0.3,1);
}
@keyframes modalIn { from{opacity:0;transform:translateY(14px) scale(.96)} to{opacity:1;transform:translateY(0) scale(1)} }
.modal-close {
  position: absolute; top: 16px; left: 16px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-light);
  border-radius: 8px; width: 28px; height: 28px; font-size: 14px;
  cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.modal h3 { margin-bottom: 14px; }

/* ══════════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════════ */
#toast {
  position: fixed; bottom: 22px; left: 22px; z-index: 999;
  background: var(--bg-card3);
  color: var(--text-primary);
  font-family: var(--font-h); font-size: 13px; font-weight: 600;
  padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-light);
  border-right: 3px solid var(--gold);
  transform: translateY(80px); opacity: 0;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1); pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.error   { border-right-color: var(--danger); }
#toast.success { border-right-color: var(--success); }

/* ══════════════════════════════════════════════════════════════
   MOBILE SIDEBAR
══════════════════════════════════════════════════════════════ */
.mobile-overlay { display: none; position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,0.75); backdrop-filter: blur(4px); }
.mobile-overlay.open { display: block; }
.mobile-sidebar { position: fixed; top: 0; right: -280px; bottom: 0; z-index: 91; width: 270px; background: var(--bg-sidebar); border-left: 1px solid var(--border); overflow-y: auto; transition: right .28s cubic-bezier(.4,0,.2,1); }
.mobile-sidebar.open { right: 0; }
@media(max-width:900px){ .sidebar{display:none!important} .main-content{margin-right:0!important} .topbar-hamburger{display:block} .page-content{padding:16px} }

/* ══════════════════════════════════════════════════════════════
   NOTIFICATION ITEMS
══════════════════════════════════════════════════════════════ */
.notif-item { display: flex; gap: 13px; align-items: flex-start; padding: 15px 18px; border-bottom: 1px solid var(--border-light); transition: background 0.15s; cursor: pointer; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: rgba(201,168,76,0.04); }
.notif-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.notif-title { font-family: var(--font-h); font-size: 13px; font-weight: 700; color: var(--text-primary); }
.notif-body  { font-size: 13px; color: var(--text-secondary); margin-top: 2px; line-height: 1.6; }
.notif-time  { font-family: var(--font-h); font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.notif-dot   { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex-shrink: 0; margin-top: 7px; box-shadow: 0 0 6px rgba(201,168,76,0.5); }

/* ══════════════════════════════════════════════════════════════
   ACTIVITY LOG
══════════════════════════════════════════════════════════════ */
.activity-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.03); }
[data-theme="light"] .activity-item { border-bottom-color: var(--border-light); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex-shrink: 0; margin-top: 7px; box-shadow: 0 0 0 3px rgba(201,168,76,0.1); }
.activity-text { font-size: 13px; color: var(--text-primary); line-height: 1.6; }
.activity-time { font-family: var(--font-h); font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════
   INVITE BOX
══════════════════════════════════════════════════════════════ */
.invite-box { display: flex; align-items: center; gap: 9px; background: var(--gold-pale); border: 1px dashed rgba(201,168,76,0.25); border-radius: var(--radius); padding: 12px 14px; }
.invite-link { flex: 1; font-family: monospace; font-size: 12px; color: var(--text-secondary); word-break: break-all; direction: ltr; }

/* ══════════════════════════════════════════════════════════════
   MINI CHART
══════════════════════════════════════════════════════════════ */
.mini-chart { display: flex; align-items: flex-end; gap: 3px; height: 38px; }
.mini-bar { flex: 1; border-radius: 3px 3px 0 0; background: linear-gradient(to top, var(--gold) 0%, var(--gold-light) 100%); opacity: 0.45; transition: opacity 0.2s; min-height: 3px; }
.mini-bar:hover { opacity: 0.9; }

/* ══════════════════════════════════════════════════════════════
   PAYMENT CELL
══════════════════════════════════════════════════════════════ */
.payment-cell {
  border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 10px 7px; text-align: center; cursor: pointer;
  transition: all 0.2s; background: var(--bg-card2); min-width: 66px;
}
.payment-cell:hover { border-color: rgba(201,168,76,0.3); transform: translateY(-2px); box-shadow: var(--shadow); }
.payment-cell.paid   { border-color: rgba(61,184,106,0.25);  background: rgba(61,184,106,0.05); }
.payment-cell.late   { border-color: rgba(232,76,76,0.25);   background: rgba(232,76,76,0.05); }

/* ══════════════════════════════════════════════════════════════
   MEMBER ROW
══════════════════════════════════════════════════════════════ */
.member-row { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.03); }
[data-theme="light"] .member-row { border-bottom-color: var(--border-light); }
.member-row:last-child { border-bottom: none; }

/* ══════════════════════════════════════════════════════════════
   PENDING APPROVAL BANNER
══════════════════════════════════════════════════════════════ */
.pending-banner {
  background: rgba(232,168,76,0.08); border: 1px solid rgba(232,168,76,0.18);
  border-radius: var(--radius); padding: 13px 16px;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-h); font-size: 13px; color: var(--warning);
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════════════════════════
   PRINT
══════════════════════════════════════════════════════════════ */
@media print {
  .sidebar,.topbar,.topbar-hamburger,.mobile-sidebar,.mobile-overlay,.btn,#toast,.no-print{display:none!important}
  .main-content{margin:0!important} body{background:white!important;font-size:12px;}
  .card{box-shadow:none!important;border:1px solid #ddd!important}
  .print-header{display:block!important}
}
.print-header{display:none}

/* ══════════════════════════════════════════════════════════════
   LOADING
══════════════════════════════════════════════════════════════ */
.spinner { width: 28px; height: 28px; border: 2.5px solid rgba(201,168,76,0.12); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; margin: 28px auto; }
@keyframes spin { to{transform:rotate(360deg)} }
.loading-page { display: flex; align-items: center; justify-content: center; min-height: 220px; flex-direction: column; gap: 12px; }
.loading-page p { font-family: var(--font-h); font-size: 13px; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   SIDEBAR SCROLLBAR
══════════════════════════════════════════════════════════════ */
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.15); }

/* ══════════════════════════════════════════════════════════════
   LIGHT MODE — Comprehensive Overrides
   Ensures every element has proper contrast & visibility
══════════════════════════════════════════════════════════════ */

/* ── Form inputs ─────────────────────────────────────────────── */
[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea {
  color: #0A1628;
  background: #FFFFFF;
  border-color: rgba(17,34,64,0.15);
}
[data-theme="light"] .form-input::placeholder { color: #8A9BB0; }
[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus,
[data-theme="light"] .form-textarea:focus {
  border-color: #9A7220;
  box-shadow: 0 0 0 3px rgba(154,114,32,0.1);
}
[data-theme="light"] .form-label { color: #3A4E6A; }
[data-theme="light"] .form-hint  { color: #6A7E9A; }

/* ── Topbar ───────────────────────────────────────────────────── */
[data-theme="light"] .topbar {
  background: rgba(255,255,255,0.97);
  border-bottom-color: rgba(17,34,64,0.1);
  box-shadow: 0 1px 8px rgba(17,34,64,0.06);
}
[data-theme="light"] .topbar-title { color: #0A1628; }
[data-theme="light"] .topbar-hamburger { color: #0A1628; }

/* ── Cards ───────────────────────────────────────────────────── */
[data-theme="light"] .card {
  background: #FFFFFF;
  border-color: rgba(17,34,64,0.09);
  box-shadow: 0 2px 12px rgba(17,34,64,0.07);
}
[data-theme="light"] .card-title { color: #0A1628; }
[data-theme="light"] .stat-card {
  background: #FFFFFF;
  border-color: rgba(17,34,64,0.09);
  box-shadow: 0 2px 12px rgba(17,34,64,0.07);
}
[data-theme="light"] .stat-card::before {
  background: radial-gradient(circle, rgba(154,114,32,0.06) 0%, transparent 65%);
}
[data-theme="light"] .stat-card::after {
  background: linear-gradient(90deg, transparent, rgba(154,114,32,0.12), transparent);
}
[data-theme="light"] .stat-num  { color: #0A1628; }
[data-theme="light"] .stat-label { color: #6A7E9A; }

/* ── Circle cards ─────────────────────────────────────────────── */
[data-theme="light"] .circle-card {
  background: #FFFFFF;
  border-color: rgba(17,34,64,0.09);
  box-shadow: 0 2px 12px rgba(17,34,64,0.07);
}
[data-theme="light"] .circle-card::before {
  background: linear-gradient(135deg, rgba(154,114,32,0.08) 0%, transparent 40%, transparent 60%, rgba(154,114,32,0.03) 100%);
}
[data-theme="light"] .circle-card:hover {
  box-shadow: 0 8px 28px rgba(17,34,64,0.12), 0 0 0 1px rgba(154,114,32,0.2);
  border-color: rgba(154,114,32,0.25);
}
[data-theme="light"] .circle-card-name  { color: #0A1628; }
[data-theme="light"] .circle-card-admin { color: #6A7E9A; }
[data-theme="light"] .circle-card-amount { color: #9A7220; }
[data-theme="light"] .member-pip { border-color: #FFFFFF; }

/* ── Tables ──────────────────────────────────────────────────── */
[data-theme="light"] thead th {
  background: #F5F7FC;
  color: #6A7E9A;
  border-bottom-color: rgba(17,34,64,0.1);
}
[data-theme="light"] tbody td { color: #0A1628; border-bottom-color: rgba(17,34,64,0.06); }
[data-theme="light"] tbody tr:hover td { background: rgba(17,34,64,0.03); }

/* ── Buttons ──────────────────────────────────────────────────── */
[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #C9A84C 0%, #9A7220 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 12px rgba(154,114,32,0.3);
}
[data-theme="light"] .btn-primary:hover { box-shadow: 0 5px 18px rgba(154,114,32,0.4); }
[data-theme="light"] .btn-secondary {
  background: rgba(17,34,64,0.05);
  color: #0A1628;
  border-color: rgba(17,34,64,0.12);
}
[data-theme="light"] .btn-secondary:hover { background: rgba(17,34,64,0.09); }
[data-theme="light"] .btn-outline { color: #9A7220; border-color: rgba(154,114,32,0.4); }
[data-theme="light"] .btn-outline:hover { background: rgba(154,114,32,0.07); }

/* ── Badges ──────────────────────────────────────────────────── */
[data-theme="light"] .badge-gold   { background: rgba(154,114,32,0.1); color: #7A5010; border-color: rgba(154,114,32,0.2); }
[data-theme="light"] .badge-green  { background: rgba(26,122,56,0.09); color: #1A7A38; border-color: rgba(26,122,56,0.2); }
[data-theme="light"] .badge-red    { background: rgba(190,32,32,0.09); color: #BE2020; border-color: rgba(190,32,32,0.2); }
[data-theme="light"] .badge-blue   { background: rgba(26,74,154,0.09); color: #1A4A9A; border-color: rgba(26,74,154,0.2); }
[data-theme="light"] .badge-muted  { background: rgba(17,34,64,0.06); color: #6A7E9A; border-color: rgba(17,34,64,0.1); }
[data-theme="light"] .badge-orange { background: rgba(138,85,0,0.09); color: #8A5500; border-color: rgba(138,85,0,0.2); }

/* ── Modal ───────────────────────────────────────────────────── */
[data-theme="light"] .modal {
  background: #FFFFFF;
  border-color: rgba(17,34,64,0.1);
  box-shadow: 0 20px 60px rgba(17,34,64,0.2);
}
[data-theme="light"] .modal-close {
  background: rgba(17,34,64,0.06);
  border-color: rgba(17,34,64,0.1);
  color: #6A7E9A;
}
[data-theme="light"] .modal-close:hover { background: rgba(17,34,64,0.1); color: #0A1628; }

/* ── Toast ───────────────────────────────────────────────────── */
[data-theme="light"] #toast {
  background: #FFFFFF;
  color: #0A1628;
  border-color: rgba(17,34,64,0.1);
  box-shadow: 0 8px 32px rgba(17,34,64,0.15);
  border-right-color: #9A7220;
}
[data-theme="light"] #toast.error   { border-right-color: #BE2020; }
[data-theme="light"] #toast.success { border-right-color: #1A7A38; }

/* ── Notifications ───────────────────────────────────────────── */
[data-theme="light"] .notif-item:hover    { background: rgba(17,34,64,0.03); }
[data-theme="light"] .notif-item.unread   { background: rgba(154,114,32,0.04); }
[data-theme="light"] .notif-title  { color: #0A1628; }
[data-theme="light"] .notif-body   { color: #3A4E6A; }
[data-theme="light"] .notif-time   { color: #6A7E9A; }
[data-theme="light"] .notif-dot    { background: #9A7220; box-shadow: 0 0 6px rgba(154,114,32,0.4); }

/* ── Activity log ────────────────────────────────────────────── */
[data-theme="light"] .activity-dot { background: #9A7220; box-shadow: 0 0 0 3px rgba(154,114,32,0.1); }
[data-theme="light"] .activity-text { color: #0A1628; }
[data-theme="light"] .activity-time { color: #6A7E9A; }

/* ── Invite box ──────────────────────────────────────────────── */
[data-theme="light"] .invite-box {
  background: rgba(154,114,32,0.06);
  border-color: rgba(154,114,32,0.2);
}
[data-theme="light"] .invite-link { color: #3A4E6A; }

/* ── Payment cells ───────────────────────────────────────────── */
[data-theme="light"] .payment-cell {
  background: #F5F7FC;
  border-color: rgba(17,34,64,0.1);
}
[data-theme="light"] .payment-cell:hover { border-color: rgba(154,114,32,0.35); }
[data-theme="light"] .payment-cell.paid  { background: rgba(26,122,56,0.06); border-color: rgba(26,122,56,0.25); }
[data-theme="light"] .payment-cell.late  { background: rgba(190,32,32,0.06); border-color: rgba(190,32,32,0.25); }

/* ── Pending banner ──────────────────────────────────────────── */
[data-theme="light"] .pending-banner {
  background: rgba(138,85,0,0.07);
  border-color: rgba(138,85,0,0.18);
  color: #8A5500;
}

/* ── Alerts ──────────────────────────────────────────────────── */
[data-theme="light"] .alert-error   { background: rgba(190,32,32,0.07);  color: #BE2020; }
[data-theme="light"] .alert-success { background: rgba(26,122,56,0.07);  color: #1A7A38; }
[data-theme="light"] .alert-warning { background: rgba(138,85,0,0.07);   color: #8A5500; }

/* ── Spinner ─────────────────────────────────────────────────── */
[data-theme="light"] .spinner { border-color: rgba(154,114,32,0.15); border-top-color: #9A7220; }
[data-theme="light"] .loading-page p { color: #6A7E9A; }

/* ── Empty state ─────────────────────────────────────────────── */
[data-theme="light"] .empty-state { color: #6A7E9A; }

/* ── Page content text ───────────────────────────────────────── */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5 { color: #0A1628; }

[data-theme="light"] .page-content { background: #F0F4FA; }

/* ── Mobile sidebar in light (stays dark — correct) ─────────── */
[data-theme="light"] .mobile-sidebar { background: #0D1826; border-color: rgba(255,255,255,0.06); }

/* ── Section labels visible on light ────────────────────────── */
[data-theme="light"] .nav-section-label { color: rgba(255,255,255,0.3); }

/* ── Mini chart ──────────────────────────────────────────────── */
[data-theme="light"] .mini-bar { background: linear-gradient(to top, #9A7220, #C9A84C); opacity: 0.55; }
[data-theme="light"] .mini-bar:hover { opacity: 1; }

/* ── Scrollbar ────────────────────────────────────────────────── */
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(154,114,32,0.2); }

/* ── Theme toggle ─────────────────────────────────────────────── */
[data-theme="light"] .theme-toggle {
  background: rgba(154,114,32,0.12);
  border-color: rgba(154,114,32,0.25);
}
[data-theme="light"] .theme-toggle-thumb { background: #9A7220; }
