/* ============================================================
   Share & Earn Kenya - Main Stylesheet
   Design: Clean SaaS Dashboard with Kenyan Green Theme
   Fonts: Outfit (headings) + Nunito (body)
   ============================================================ */

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

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-light: #dcfce7;
  --primary-xlight: #f0fdf4;
  --secondary: #0ea5e9;
  --secondary-light: #e0f2fe;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #6366f1;
  --info-light: #ede9fe;
  --dark: #0f172a;
  --dark-2: #1e293b;
  --text: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --sidebar-w: 260px;
  --sidebar-collapsed: 70px;
  --topbar-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -4px rgba(0,0,0,0.04);
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-white: #1e293b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border: #334155;
  --border-light: #1e293b;
  --dark: #f8fafc;
  --dark-2: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3);
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--dark);
  font-weight: 600;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

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

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  transition: all 0.3s ease;
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  color: white;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
}

.brand-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
}

.brand-text span { color: var(--primary); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  padding: 16px 20px 6px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .nav-section-title { opacity: 0; }

.nav-item { margin: 1px 8px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
}

.nav-link:hover {
  background: var(--primary-xlight);
  color: var(--primary);
}

.nav-link.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.nav-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-link .nav-text { overflow: hidden; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}

/* ── Main Content ──────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

/* ── Top Bar ───────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 900;
  gap: 12px;
}

.topbar-start { display: flex; align-items: center; gap: 12px; }
.topbar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.sidebar-toggle {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}

.sidebar-toggle:hover { background: var(--border-light); color: var(--text); }

.page-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--dark);
  margin: 0;
}

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

.topbar-btn:hover { border-color: var(--primary); color: var(--primary); }

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

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 5px 12px 5px 5px;
  background: var(--bg-white);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.user-avatar-btn:hover { border-color: var(--primary); }

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-body { padding: 20px; }

/* ── Stat Cards ────────────────────────────────────────── */
.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-icon.green  { background: var(--primary-light); color: var(--primary); }
.stat-icon.blue   { background: var(--secondary-light); color: var(--secondary); }
.stat-icon.amber  { background: var(--accent-light); color: var(--accent); }
.stat-icon.red    { background: var(--danger-light); color: var(--danger); }
.stat-icon.purple { background: var(--info-light); color: var(--info); }

.stat-info { flex: 1; min-width: 0; }

.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 4px;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

.stat-value.green  { color: var(--primary); }
.stat-value.blue   { color: var(--secondary); }
.stat-value.amber  { color: var(--accent); }
.stat-value.red    { color: var(--danger); }

.stat-change {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Share Link Cards ──────────────────────────────────── */
.share-link-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.share-link-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
  border-radius: 4px 0 0 4px;
}

.share-link-card.completed::before { background: var(--text-light); }
.share-link-card.completed { opacity: 0.7; }

.share-link-num {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 6px;
}

.share-link-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--dark);
  margin-bottom: 4px;
}

.share-link-url {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-family: monospace;
}

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

.share-log-times {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 10px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.share-log-times span { display: flex; align-items: center; gap: 4px; }
.share-log-times .done { color: var(--primary); }

.share-completed-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; box-shadow: 0 4px 12px rgba(22,163,74,0.35); }

.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: #0284c7; color: white; }

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

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

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

.btn-success { background: var(--primary); color: white; }
.btn-warning { background: var(--accent); color: white; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

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

/* ── Forms ─────────────────────────────────────────────── */
.form-label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: block;
}

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

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.form-control.is-invalid { border-color: var(--danger); }
.form-text { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.invalid-feedback { font-size: 0.78rem; color: var(--danger); margin-top: 4px; display: block; }

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control { border-radius: 0; flex: 1; }
.input-group .form-control:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ── Tables ────────────────────────────────────────────── */
.table-container { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding: 10px 16px;
  border-bottom: 1.5px solid var(--border);
  background: var(--bg);
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--primary-xlight); }
.table .user-cell { display: flex; align-items: center; gap: 10px; }

/* ── Status Badges ─────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.03em;
}

.badge-success, .badge-approved { background: var(--primary-light); color: var(--primary-dark); }
.badge-warning, .badge-pending  { background: var(--accent-light); color: #92400e; }
.badge-danger, .badge-rejected  { background: var(--danger-light); color: #991b1b; }
.badge-info, .badge-reviewing   { background: var(--info-light); color: #3730a3; }
.badge-paid { background: #dbeafe; color: #1e40af; }
.badge-secondary, .badge-inactive { background: var(--bg); color: var(--text-muted); }

/* ── Progress / Timeline ───────────────────────────────── */
.timeline {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 8px 0;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 80px;
  position: relative;
}

.timeline-step:not(:first-child)::before {
  content: '';
  position: absolute;
  left: calc(0% - 50%);
  top: 14px;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.timeline-step.done:not(:first-child)::before { background: var(--primary); }

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-light);
  z-index: 1;
  transition: all var(--transition);
}

.timeline-step.done .step-dot { border-color: var(--primary); background: var(--primary); color: white; }
.timeline-step.current .step-dot { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }

.step-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-light);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}

.timeline-step.done .step-label { color: var(--primary); }

/* ── Upload Zone ───────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-xlight);
}

.upload-zone i { font-size: 2.5rem; color: var(--text-light); margin-bottom: 12px; display: block; }
.upload-zone p { color: var(--text-muted); font-size: 0.875rem; margin: 0; }
.upload-zone strong { color: var(--primary); }

.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 16px; }

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.preview-item img { width: 100%; height: 100%; object-fit: cover; }

.preview-item .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(239,68,68,0.9);
  border-radius: 50%;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
}

/* ── Notifications ─────────────────────────────────────── */
.notif-dropdown {
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition);
}

.notif-item:hover { background: var(--primary-xlight); }
.notif-item.unread { background: var(--primary-xlight); }
.notif-item.unread::before { content: ''; display: block; width: 6px; height: 6px; background: var(--primary); border-radius: 50%; margin-top: 5px; flex-shrink: 0; }

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 0.8rem; font-weight: 600; color: var(--dark); margin-bottom: 2px; }
.notif-msg { font-size: 0.75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { font-size: 0.7rem; color: var(--text-light); margin-top: 2px; }

/* ── Wallet Card ───────────────────────────────────────── */
.wallet-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  padding: 28px;
  color: white;
  position: relative;
  overflow: hidden;
}

.wallet-hero::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.wallet-hero::before {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -20px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.wallet-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.8; }
.wallet-amount { font-family: 'Outfit', sans-serif; font-size: 2.2rem; font-weight: 800; margin: 4px 0; }
.wallet-sub { font-size: 0.8rem; opacity: 0.75; }

.wallet-stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.wallet-stat { background: rgba(255,255,255,0.12); border-radius: 10px; padding: 12px 14px; }
.wallet-stat-label { font-size: 0.7rem; opacity: 0.8; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.wallet-stat-val { font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 700; margin-top: 2px; }

/* ── Progress Bar ──────────────────────────────────────── */
.progress-bar-wrap { background: var(--border-light); border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary); border-radius: 20px; transition: width 0.4s ease; }

.daily-progress-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.daily-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.daily-label span { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.daily-label strong { color: var(--primary); font-family: 'Outfit', sans-serif; font-size: 1.1rem; }

/* ── Auth Pages ────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 50%, #e0f2fe 100%);
}

.auth-brand-side {
  flex: 1;
  background: linear-gradient(160deg, var(--primary), var(--primary-dark) 60%, #064e3b);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.auth-brand-side::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  top: -100px;
  right: -100px;
}

.auth-brand-side::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  bottom: -80px;
  left: -80px;
}

.auth-brand-logo {
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: white;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 20px;
  z-index: 1;
}

.auth-brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: white;
  text-align: center;
  z-index: 1;
  line-height: 1.2;
}

.auth-brand-sub {
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  text-align: center;
  margin-top: 12px;
  z-index: 1;
  max-width: 320px;
}

.auth-features { margin-top: 40px; z-index: 1; }
.auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
}

.auth-feature-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.auth-form-side {
  width: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px;
  background: white;
  overflow-y: auto;
}

.auth-form-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.auth-form-sub { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 28px; }

/* ── Alerts ────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-success { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #bbf7d0; }
.alert-danger   { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-info     { background: var(--secondary-light); color: #0c4a6e; border: 1px solid #bae6fd; }
.alert-warning  { background: var(--accent-light); color: #92400e; border: 1px solid #fde68a; }
.alert .btn-close { margin-left: auto; background: none; border: none; cursor: pointer; opacity: 0.6; font-size: 1rem; padding: 0; }

/* ── Dropdown ──────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 9999;
  display: none;
  overflow: hidden;
}

.dropdown-menu.show { display: block; animation: fadeIn 0.15s ease; }

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

.dropdown-item:hover { background: var(--primary-xlight); color: var(--primary); }
.dropdown-item.text-danger:hover { background: var(--danger-light); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Admin Sidebar ─────────────────────────────────────── */
.admin-sidebar .brand-icon { background: var(--dark-2); }

/* ── Modals ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal-box {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: translateY(20px);
  transition: transform 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.open .modal-box { 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-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1.05rem; }
.modal-close { width: 30px; height: 30px; border: none; background: var(--bg); border-radius: 50%; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: background var(--transition); }
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.fade-in { animation: fadeIn 0.3s ease both; }
.slide-in { animation: slideIn 0.3s ease both; }

/* ── Toast ─────────────────────────────────────────────── */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
}

.toast {
  background: var(--dark);
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: slideIn 0.3s ease;
}

.toast.success { background: var(--primary); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--secondary); }

/* ── Charts Container ──────────────────────────────────── */
.chart-wrap { position: relative; height: 240px; }

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 24px;
  text-align: center;
}

.empty-icon {
  width: 72px;
  height: 72px;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  flex-shrink: 0;
}
.empty-icon i {
  font-size: 1.75rem;
  color: var(--text-light);
  opacity: 0.7;
}
.empty-title { font-size: 0.975rem; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.empty-sub { font-size: 0.825rem; color: var(--text-muted); max-width: 260px; line-height: 1.5; }

/* ── Search Box ────────────────────────────────────────── */
.search-box {
  position: relative;
  max-width: 280px;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.9rem;
}

.search-box input { padding-left: 36px; }

/* ── Dark Mode Toggle ──────────────────────────────────── */
.theme-toggle {
  width: 42px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  border: none;
}

.theme-toggle.on { background: var(--primary); }
.theme-toggle::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
  box-shadow: var(--shadow);
}

.theme-toggle.on::after { transform: translateX(20px); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .auth-brand-side { display: none; }
  .auth-form-side { width: 100%; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  
  .sidebar {
    width: 260px;
    transform: translateX(-100%);
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  
  .main-content { margin-left: 0 !important; }
  
  .page-content { padding: 16px; }
  
  .auth-form-side { padding: 24px; }
  
  .stat-grid { grid-template-columns: 1fr 1fr !important; }
  
  .wallet-stats-row { grid-template-columns: 1fr; }
  
  .table-responsive-sm { overflow-x: auto; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr !important; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 12px; }
}

/* ── Utilities ─────────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--primary) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--accent) !important; }
.text-dark { color: var(--dark) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.font-outfit { font-family: 'Outfit', sans-serif; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 24px; }
.p-0 { padding: 0 !important; }
.w-100 { width: 100%; }
.img-fluid { max-width: 100%; height: auto; }
.rounded { border-radius: var(--radius-sm); }
.rounded-circle { border-radius: 50%; }
.shadow { box-shadow: var(--shadow); }
.separator { height: 1px; background: var(--border); margin: 16px 0; }

/* Spinner */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 999;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.show { display: block; }
