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

:root {
  --primary: #4C1D95;
  --primary-light: #6D28D9;
  --primary-dark: #2E1065;
  --accent: #7C3AED;
  --accent-light: #A78BFA;
  --gold: #F59E0B;
  --gold-light: #FDE68A;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --info: #3B82F6;
  --bg: #F8F7FF;
  --bg-card: #FFFFFF;
  --bg-sidebar: #1E0A47;
  --text: #1A1033;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --shadow-sm: 0 1px 3px rgba(76,29,149,0.08);
  --shadow: 0 4px 16px rgba(76,29,149,0.12);
  --shadow-lg: 0 8px 32px rgba(76,29,149,0.16);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --transition: all 0.2s ease;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-logo {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gold), #F97316);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.logo-text { color: white; }
.logo-text h2 { font-size: 16px; font-weight: 700; line-height: 1.2; }
.logo-text span { font-size: 11px; color: rgba(255,255,255,0.5); }

.sidebar-menu {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-menu::-webkit-scrollbar { display: none; }

.menu-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  padding: 12px 20px 6px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  border-radius: 0;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.menu-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.menu-item.active {
  background: linear-gradient(90deg, rgba(124,58,237,0.3), transparent);
  color: white;
  border-left: 3px solid var(--accent-light);
}

.menu-item .icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.menu-badge {
  margin-left: auto;
  background: var(--gold);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-card {
  display: flex; align-items: center; gap: 10px;
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info strong { display: block; font-size: 13px; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info span { font-size: 11px; color: rgba(255,255,255,0.45); }

/* ===== MAIN LAYOUT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

/* ===== NAVBAR ===== */
.topbar {
  background: white;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

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

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
}

.icon-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: 24px;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.card-body { padding: 20px; }

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

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.08;
  transform: translate(20px, -20px);
}

.stat-card.purple::before { background: var(--primary); }
.stat-card.gold::before { background: var(--gold); }
.stat-card.green::before { background: var(--success); }
.stat-card.blue::before { background: var(--info); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.stat-card.purple .stat-icon { background: rgba(76,29,149,0.1); }
.stat-card.gold .stat-icon { background: rgba(245,158,11,0.1); }
.stat-card.green .stat-icon { background: rgba(16,185,129,0.1); }
.stat-card.blue .stat-icon { background: rgba(59,130,246,0.1); }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 8px;
}

.stat-trend.up { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-trend.down { background: rgba(239,68,68,0.1); color: var(--danger); }

/* ===== TABLES ===== */
.table-wrapper {
  overflow-x: auto;
}

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

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: rgba(16,185,129,0.12); color: #059669; }
.badge-danger { background: rgba(239,68,68,0.12); color: #DC2626; }
.badge-warning { background: rgba(245,158,11,0.12); color: #D97706; }
.badge-info { background: rgba(59,130,246,0.12); color: #2563EB; }
.badge-purple { background: rgba(76,29,149,0.12); color: var(--primary); }
.badge-gray { background: var(--bg); color: var(--text-muted); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
  font-family: 'Outfit', sans-serif;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(76,29,149,0.3); }

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-gold { background: var(--gold); color: white; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: 'Outfit', sans-serif;
  color: var(--text);
  background: white;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

select.form-control { cursor: pointer; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,5,30,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

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

.modal-title { font-size: 17px; font-weight: 700; }

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 16px;
  transition: var(--transition);
}
.modal-close:hover { background: var(--danger); color: white; }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

.toast {
  background: white;
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  border-left: 4px solid var(--success);
  animation: slideIn 0.3s ease;
}

.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast.info { border-color: var(--info); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== CHARTS ===== */
.chart-container {
  width: 100%;
  height: 220px;
  position: relative;
}

/* ===== AVATAR ===== */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  color: white;
  flex-shrink: 0;
}

/* ===== SEARCH ===== */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--accent);
  background: white;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  font-family: 'Outfit', sans-serif;
  color: var(--text);
  width: 200px;
}

/* ===== ANNOUNCEMENTS ===== */
.announcement-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  margin-bottom: 16px;
}
.announcement-card:hover { box-shadow: var(--shadow); }

.ann-header { padding: 16px; display: flex; align-items: center; gap: 12px; }
.ann-body { padding: 0 16px 12px; font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.ann-image { width: 100%; height: 200px; object-fit: cover; }
.ann-footer { padding: 12px 16px; border-top: 1px solid var(--border-light); display: flex; gap: 16px; }
.ann-action { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); cursor: pointer; }
.ann-action:hover { color: var(--primary); }

/* ===== WALLET ===== */
.wallet-card {
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  border-radius: var(--radius-lg);
  padding: 28px;
  color: white;
  position: relative;
  overflow: hidden;
}

.wallet-card::before {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  top: -60px; right: -60px;
}

.wallet-card::after {
  content: '';
  position: absolute;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  bottom: -40px; left: 40px;
}

.wallet-label { font-size: 12px; opacity: 0.7; margin-bottom: 4px; }
.wallet-amount { font-size: 36px; font-weight: 800; margin-bottom: 20px; }
.wallet-meta { display: flex; gap: 24px; font-size: 12px; opacity: 0.75; }

/* ===== MISC ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.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; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.font-bold { font-weight: 700; }
.text-right { text-align: right; }

/* ===== HAMBURGER ===== */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .search-box input { width: 140px; }
  .page-content { padding: 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 22px; }
}

/* ===== OVERLAY ===== */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}
.sidebar-overlay.active { display: block; }

/* ===== PROGRESS BARS ===== */
.progress-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 1s ease;
}

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-state .emoji { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 13px; }

/* Tab Styles */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-color: var(--primary); }

/* Mini Chart */
.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 40px;
}
.mini-bar {
  flex: 1;
  background: var(--primary);
  opacity: 0.2;
  border-radius: 2px;
  transition: opacity 0.2s;
  min-width: 4px;
}
.mini-bar.active { opacity: 0.8; }
