/* SelebMoney - Main Stylesheet */
:root {
  --sm-navy: #0a1628;
  --sm-navy-light: #112240;
  --sm-emerald: #10b981;
  --sm-emerald-dark: #059669;
  --sm-emerald-light: #d1fae5;
  --sm-white: #ffffff;
  --sm-gray-50: #f8fafc;
  --sm-gray-100: #f1f5f9;
  --sm-gray-200: #e2e8f0;
  --sm-gray-400: #94a3b8;
  --sm-gray-600: #475569;
  --sm-gray-800: #1e293b;
  --sm-charcoal: #0f172a;
  --sm-gold: #f59e0b;
  --sm-red: #ef4444;
  --sm-blue: #3b82f6;
  --sidebar-width: 260px;
  --header-height: 64px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --transition: all .2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--sm-gray-50);
  color: var(--sm-gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== TYPOGRAPHY ===== */
h1,h2,h3,h4,h5,h6 { font-weight: 600; line-height: 1.3; color: var(--sm-charcoal); }
.text-emerald { color: var(--sm-emerald) !important; }
.text-navy { color: var(--sm-navy) !important; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ===== BUTTONS ===== */
.btn { border-radius: var(--border-radius-sm); font-weight: 500; transition: var(--transition); letter-spacing: .01em; }
.btn-primary { background: var(--sm-emerald); border-color: var(--sm-emerald); color: #fff; }
.btn-primary:hover { background: var(--sm-emerald-dark); border-color: var(--sm-emerald-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,185,129,.3); }
.btn-navy { background: var(--sm-navy); border-color: var(--sm-navy); color: #fff; }
.btn-navy:hover { background: var(--sm-navy-light); border-color: var(--sm-navy-light); color: #fff; }
.btn-outline-emerald { border-color: var(--sm-emerald); color: var(--sm-emerald); }
.btn-outline-emerald:hover { background: var(--sm-emerald); color: #fff; }
.btn-lg { padding: .75rem 2rem; font-size: 1rem; }
.btn-xl { padding: 1rem 2.5rem; font-size: 1.1rem; border-radius: 10px; }

/* ===== CARDS ===== */
.card { border: 1px solid var(--sm-gray-200); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); transition: var(--transition); background: #fff; }
.card:hover { box-shadow: var(--shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--sm-gray-200); padding: 1.25rem 1.5rem; font-weight: 600; }
.card-body { padding: 1.5rem; }

/* Stat Cards */
.stat-card { border-radius: var(--border-radius); padding: 1rem 1.125rem; position: relative; overflow: hidden; transition: var(--transition); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .stat-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.stat-card .stat-value { font-size: 1.35rem; font-weight: 700; line-height: 1; margin: .35rem 0 .2rem; }
.stat-card .stat-label { font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; opacity: .7; }
.stat-card .stat-change { font-size: .7rem; font-weight: 500; margin-top: .25rem; }
.stat-card-emerald { background: linear-gradient(135deg, var(--sm-emerald) 0%, var(--sm-emerald-dark) 100%); color: #fff; }
.stat-card-navy { background: linear-gradient(135deg, var(--sm-navy-light) 0%, var(--sm-navy) 100%); color: #fff; }
.stat-card-gold { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #fff; }
.stat-card-blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: #fff; }
.stat-card-white { background: #fff; border: 1px solid var(--sm-gray-200); }

/* ===== SIDEBAR ===== */
.sidebar { width: var(--sidebar-width); height: 100vh; position: fixed; top: 0; left: 0; background: var(--sm-navy); z-index: 1000; display: flex; flex-direction: column; transition: transform .3s ease; overflow-y: auto; }
.sidebar-brand { padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.sidebar-brand .brand-logo { width: 36px; height: 36px; background: var(--sm-emerald); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 1rem; }
.sidebar-brand .brand-name { color: #fff; font-weight: 700; font-size: 1.1rem; }
.sidebar-brand .brand-tagline { color: rgba(255,255,255,.5); font-size: .7rem; }
.sidebar-nav { padding: 1rem 0; flex: 1; }
.sidebar-section { padding: .5rem 1.5rem .25rem; font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.35); }
.sidebar-link { display: flex; align-items: center; gap: .75rem; padding: .65rem 1.5rem; color: rgba(255,255,255,.65); text-decoration: none; font-size: .875rem; font-weight: 500; transition: var(--transition); border-left: 3px solid transparent; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-link.active { color: #fff; background: rgba(16,185,129,.15); border-left-color: var(--sm-emerald); }
.sidebar-link i { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-link .badge { margin-left: auto; font-size: .65rem; }
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: .75rem; }
.sidebar-user .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--sm-emerald); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: .875rem; flex-shrink: 0; }
.sidebar-user .user-name { color: #fff; font-size: .875rem; font-weight: 500; }
.sidebar-user .user-status { color: rgba(255,255,255,.45); font-size: .7rem; }

/* ===== MAIN CONTENT ===== */
.main-wrapper { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: var(--header-height); background: #fff; border-bottom: 1px solid var(--sm-gray-200); display: flex; align-items: center; padding: 0 1.5rem; gap: 1rem; position: sticky; top: 0; z-index: 100; }
.topbar-title { font-weight: 600; font-size: 1.1rem; color: var(--sm-charcoal); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.notification-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--sm-gray-200); background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); color: var(--sm-gray-600); }
.notification-btn:hover { background: var(--sm-gray-50); }
.notification-badge { position: absolute; top: -4px; right: -4px; background: var(--sm-red); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: .65rem; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.page-content { padding: 1.5rem; flex: 1; }

/* ===== TABLES ===== */
.table { font-size: .875rem; }
.table th { font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--sm-gray-600); border-bottom: 2px solid var(--sm-gray-200); padding: .875rem 1rem; }
.table td { padding: .875rem 1rem; vertical-align: middle; border-bottom: 1px solid var(--sm-gray-100); }
.table tbody tr:hover { background: var(--sm-gray-50); }
.table-card { border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow-sm); }

/* ===== BADGES ===== */
.badge-status { padding: .3rem .75rem; border-radius: 20px; font-size: .75rem; font-weight: 500; }
.badge-active { background: var(--sm-emerald-light); color: var(--sm-emerald-dark); }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: var(--sm-emerald-light); color: var(--sm-emerald-dark); }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-inactive { background: var(--sm-gray-100); color: var(--sm-gray-600); }

/* ===== FORMS ===== */
.form-control, .form-select { border: 1px solid var(--sm-gray-200); border-radius: var(--border-radius-sm); padding: .625rem 1rem; font-size: .875rem; transition: var(--transition); }
.form-control:focus, .form-select:focus { border-color: var(--sm-emerald); box-shadow: 0 0 0 3px rgba(16,185,129,.1); outline: none; }
.form-label { font-weight: 500; font-size: .875rem; color: var(--sm-gray-800); margin-bottom: .375rem; }
.input-group-text { background: var(--sm-gray-50); border-color: var(--sm-gray-200); color: var(--sm-gray-600); }

/* ===== ALERTS ===== */
.alert { border-radius: var(--border-radius-sm); border: none; font-size: .875rem; }
.alert-success { background: var(--sm-emerald-light); color: var(--sm-emerald-dark); }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* ===== PROGRESS ===== */
.progress { height: 6px; border-radius: 3px; background: var(--sm-gray-200); }
.progress-bar { background: var(--sm-emerald); border-radius: 3px; }

/* ===== CHARTS ===== */
.chart-container { position: relative; }

/* ===== TRANSACTION LIST ===== */
.tx-item { display: flex; align-items: center; gap: 1rem; padding: .875rem 0; border-bottom: 1px solid var(--sm-gray-100); }
.tx-item:last-child { border-bottom: none; }
.tx-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.tx-icon-credit { background: var(--sm-emerald-light); color: var(--sm-emerald-dark); }
.tx-icon-debit { background: #fee2e2; color: #991b1b; }
.tx-info { flex: 1; }
.tx-desc { font-size: .875rem; font-weight: 500; color: var(--sm-charcoal); }
.tx-date { font-size: .75rem; color: var(--sm-gray-400); }
.tx-amount { font-weight: 600; font-size: .9rem; }
.tx-amount.credit { color: var(--sm-emerald); }
.tx-amount.debit { color: var(--sm-red); }

/* ===== QUIZ ===== */
.quiz-card { border-radius: var(--border-radius); overflow: hidden; transition: var(--transition); }
.quiz-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.quiz-category { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.quiz-timer { font-size: 1.5rem; font-weight: 700; color: var(--sm-emerald); font-variant-numeric: tabular-nums; }
.quiz-option { border: 2px solid var(--sm-gray-200); border-radius: var(--border-radius-sm); padding: .875rem 1.25rem; cursor: pointer; transition: var(--transition); font-size: .9rem; }
.quiz-option:hover { border-color: var(--sm-emerald); background: var(--sm-emerald-light); }
.quiz-option.selected { border-color: var(--sm-emerald); background: var(--sm-emerald-light); color: var(--sm-emerald-dark); font-weight: 500; }
.quiz-option.correct { border-color: var(--sm-emerald); background: var(--sm-emerald-light); }
.quiz-option.wrong { border-color: var(--sm-red); background: #fee2e2; }

/* ===== AI CHAT ===== */
.chat-container { height: 500px; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.chat-bubble { max-width: 75%; padding: .875rem 1.125rem; border-radius: 16px; font-size: .875rem; line-height: 1.5; }
.chat-bubble.user { background: var(--sm-emerald); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.chat-bubble.assistant { background: var(--sm-gray-100); color: var(--sm-charcoal); border-bottom-left-radius: 4px; align-self: flex-start; }
.chat-bubble.typing { background: var(--sm-gray-100); }
.typing-dots span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--sm-gray-400); animation: typing 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
.ai-badge { background: linear-gradient(135deg, var(--sm-navy) 0%, var(--sm-navy-light) 100%); color: #fff; padding: .2rem .6rem; border-radius: 20px; font-size: .65rem; font-weight: 600; letter-spacing: .05em; }

/* ===== REFERRAL TREE ===== */
.referral-node { background: #fff; border: 1px solid var(--sm-gray-200); border-radius: var(--border-radius-sm); padding: .875rem 1rem; display: flex; align-items: center; gap: .75rem; }
.referral-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--sm-emerald); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: .8rem; flex-shrink: 0; }
.referral-level-badge { font-size: .65rem; font-weight: 600; padding: .15rem .5rem; border-radius: 20px; }
.level-1 { background: #dbeafe; color: #1e40af; }
.level-2 { background: #fef3c7; color: #92400e; }
.level-3 { background: var(--sm-emerald-light); color: var(--sm-emerald-dark); }

/* ===== LEADERBOARD ===== */
.rank-1 { color: #f59e0b; }
.rank-2 { color: #94a3b8; }
.rank-3 { color: #cd7c2f; }
.rank-badge { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.rank-badge-1 { background: #fef3c7; color: #92400e; }
.rank-badge-2 { background: var(--sm-gray-100); color: var(--sm-gray-600); }
.rank-badge-3 { background: #fde8d8; color: #9a3412; }

/* ===== MARKETPLACE ===== */
.listing-card { border-radius: var(--border-radius); overflow: hidden; transition: var(--transition); }
.listing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.listing-img { height: 180px; object-fit: cover; width: 100%; background: var(--sm-gray-100); }
.listing-price { font-size: 1.25rem; font-weight: 700; color: var(--sm-emerald); }
.listing-type-badge { font-size: .7rem; font-weight: 600; padding: .2rem .6rem; border-radius: 20px; }
.listing-type-auction { background: #fef3c7; color: #92400e; }
.listing-type-fixed { background: var(--sm-emerald-light); color: var(--sm-emerald-dark); }

/* ===== NOTIFICATIONS ===== */
.notification-item { padding: .875rem 1rem; border-bottom: 1px solid var(--sm-gray-100); display: flex; gap: .75rem; transition: var(--transition); }
.notification-item:hover { background: var(--sm-gray-50); }
.notification-item.unread { background: #f0fdf4; border-left: 3px solid var(--sm-emerald); }
.notification-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sm-emerald); flex-shrink: 0; margin-top: .4rem; }

/* ===== MOBILE TOGGLE ===== */
.sidebar-toggle { display: none; background: none; border: none; font-size: 1.25rem; color: var(--sm-gray-600); cursor: pointer; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; }

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .stat-card .stat-value { font-size: 1.15rem; }
}
@media (max-width: 575.98px) {
  .page-content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
  .card-body { padding: 1rem; }
}

/* ===== UTILITIES ===== */
.rounded-xl { border-radius: var(--border-radius) !important; }
.rounded-2xl { border-radius: 16px !important; }
.bg-emerald { background-color: var(--sm-emerald) !important; }
.bg-navy { background-color: var(--sm-navy) !important; }
.bg-navy-light { background-color: var(--sm-navy-light) !important; }
.border-emerald { border-color: var(--sm-emerald) !important; }
.shadow-emerald { box-shadow: 0 4px 14px rgba(16,185,129,.25) !important; }
.cursor-pointer { cursor: pointer; }
.gap-3 { gap: .75rem; }

/* ===== ANIMATIONS ===== */
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.slide-in { animation: slideIn .3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--sm-gray-100); }
::-webkit-scrollbar-thumb { background: var(--sm-gray-400); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--sm-gray-600); }

/* ===== DARK MODE ===== */
@media (prefers-color-scheme: dark) {
  body.dark-mode { background: #0f172a; color: #e2e8f0; }
  body.dark-mode .card { background: #1e293b; border-color: #334155; }
  body.dark-mode .topbar { background: #1e293b; border-color: #334155; }
  body.dark-mode .table td, body.dark-mode .table th { border-color: #334155; }
}
