:root {
  --cream: #FAF7F2;
  --warm-white: #FFFEF9;
  --gold: #C9A84C;
  --gold-light: #E8D5A3;
  --gold-dark: #9B7B2E;
  --forest: #2C4A3E;
  --forest-light: #3D6357;
  --forest-pale: #EEF4F2;
  --charcoal: #2A2A2A;
  --mid-gray: #6B6B6B;
  --light-gray: #E8E4DE;
  --danger: #C0392B;
  --danger-light: #FDECEA;
  --success: #27AE60;
  --success-light: #EAFAF1;
  --warning: #E67E22;
  --warning-light: #FEF5EC;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; }

/* ── LOGIN ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-light) 100%);
  padding: 24px;
}

.login-card {
  background: var(--warm-white);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--forest);
  margin-bottom: 4px;
}

.login-sub {
  color: var(--mid-gray);
  font-size: 13px;
  margin-bottom: 36px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

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

.sidebar {
  width: 240px;
  background: var(--forest);
  color: white;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo h1 {
  font-size: 20px;
  color: var(--gold-light);
  letter-spacing: 0.02em;
}

.sidebar-logo p {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 16px 0;
  flex: 1;
}

.nav-section {
  padding: 8px 16px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
  font-weight: 400;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-left: 3px solid transparent;
}

.nav-item:hover { background: rgba(255,255,255,0.07); color: white; }
.nav-item.active { background: rgba(201,168,76,0.15); color: var(--gold-light); border-left-color: var(--gold); font-weight: 500; }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-user {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
}

.sidebar-user strong { display: block; color: white; }
.sidebar-user span { color: rgba(255,255,255,0.5); font-size: 11px; }

.btn-logout {
  margin-top: 8px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.6);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  width: 100%;
  transition: all 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.15); color: white; }

.main-content {
  margin-left: 240px;
  flex: 1;
  padding: 32px;
  max-width: 1100px;
}

/* ── TOPBAR ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-title { font-size: 26px; color: var(--forest); }
.page-subtitle { font-size: 13px; color: var(--mid-gray); margin-top: 2px; }

/* ── CARDS ── */
.card {
  background: var(--warm-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--light-gray);
  overflow: hidden;
}

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

.card-title { font-size: 15px; font-weight: 600; color: var(--forest); font-family: 'DM Sans', sans-serif; }
.card-body { padding: 20px; }

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--warm-white);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--light-gray);
  box-shadow: var(--shadow-sm);
}

.stat-value { font-size: 32px; font-family: 'Playfair Display', serif; color: var(--forest); line-height: 1; }
.stat-label { font-size: 12px; color: var(--mid-gray); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.08em; }
.stat-icon { font-size: 24px; margin-bottom: 8px; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mid-gray);
  font-weight: 600;
  background: var(--cream);
  border-bottom: 1px solid var(--light-gray);
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--light-gray);
  color: var(--charcoal);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--forest-pale); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--forest); color: white; }
.btn-primary:hover { background: var(--forest-light); }

.btn-gold { background: var(--gold); color: white; }
.btn-gold:hover { background: var(--gold-dark); }

.btn-outline { background: transparent; color: var(--forest); border: 1.5px solid var(--forest); }
.btn-outline:hover { background: var(--forest-pale); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #a93226; }

.btn-ghost { background: transparent; color: var(--mid-gray); border: 1px solid var(--light-gray); }
.btn-ghost:hover { background: var(--cream); color: var(--charcoal); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 7px; }

/* ── FORMS ── */
.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--mid-gray); }

.form-input, .form-select, .form-textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--light-gray);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  background: white;
  color: var(--charcoal);
  transition: border-color 0.15s;
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(44,74,62,0.08);
}

.form-textarea { resize: vertical; min-height: 80px; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge-green { background: var(--success-light); color: var(--success); }
.badge-gold { background: #FEF9EC; color: var(--gold-dark); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-gray { background: var(--cream); color: var(--mid-gray); }
.badge-orange { background: var(--warning-light); color: var(--warning); }

/* ── UPCOMING EVENT CARD ── */
.event-list { display: flex; flex-direction: column; gap: 8px; }

.event-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  border: 1px solid var(--light-gray);
  transition: all 0.15s;
}

.event-item:hover { border-color: var(--gold-light); background: #FFFBF0; }
.event-item.urgent { border-color: #F5C6C6; background: var(--danger-light); }
.event-item.soon { border-color: var(--gold-light); background: #FFFDF0; }

.event-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-red { background: var(--danger); }
.dot-gold { background: var(--gold); }
.dot-green { background: var(--success); }
.dot-gray { background: var(--mid-gray); }

.event-info { flex: 1; min-width: 0; }
.event-name { font-weight: 500; font-size: 14px; }
.event-label { font-size: 12px; color: var(--mid-gray); }

.event-date { text-align: right; font-size: 12px; }
.event-date strong { display: block; font-size: 14px; color: var(--forest); }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal {
  background: var(--warm-white);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}

.modal h2 { font-size: 22px; color: var(--forest); margin-bottom: 20px; }

.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ── TABS ── */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--light-gray); }

.tab {
  padding: 10px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--mid-gray);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.tab:hover { color: var(--forest); }
.tab.active { color: var(--forest); border-bottom-color: var(--forest); }

/* ── MEMBER PROFILE ── */
.profile-header {
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-light) 100%);
  color: white;
  padding: 32px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: '🎁';
  position: absolute;
  right: 24px; top: 50%;
  transform: translateY(-50%);
  font-size: 64px;
  opacity: 0.15;
}

.profile-name { font-size: 28px; color: var(--gold-light); margin-bottom: 4px; }
.profile-meta { font-size: 14px; color: rgba(255,255,255,0.7); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.info-item {
  background: var(--warm-white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.info-item-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mid-gray); font-weight: 600; margin-bottom: 4px; }
.info-item-value { font-size: 15px; color: var(--charcoal); font-weight: 500; }

/* ── TOAST ── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}

.toast {
  background: var(--charcoal);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.2s ease;
  max-width: 320px;
}

.toast.success { background: var(--forest); border-left: 4px solid var(--gold); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* ── EMPTY STATE ── */
.empty { text-align: center; padding: 40px 20px; color: var(--mid-gray); }
.empty-icon { font-size: 36px; margin-bottom: 8px; }
.empty p { font-size: 14px; }

/* ── UTILS ── */
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--mid-gray); }
.font-bold { font-weight: 600; }
.w-full { width: 100%; }

.section-gap { display: flex; flex-direction: column; gap: 20px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--light-gray); border-radius: 3px; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-240px); transition: transform 0.25s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 20px 16px; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .mobile-menu-btn { display: flex; }
}

.mobile-menu-btn {
  display: none;
  position: fixed; top: 16px; left: 16px; z-index: 200;
  background: var(--forest);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 18px;
}
