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

:root {
  /* Luxury Palette */
  --accent-cyan: #00e5ff;
  --accent-gold: #ffd700;
  --accent-emerald: #34d399;
  --accent-rose: #fb7185;
  --accent-violet: #a78bfa;
  --accent-sky: #38bdf8;

  /* Foundations */
  --bg-deep: #060a13;
  --bg-surface: rgba(12, 18, 32, 0.65);
  --bg-elevated: rgba(18, 26, 46, 0.55);
  --card-glass: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.06);

  /* Text */
  --text-primary: #f0f4f8;
  --text-secondary: #8899a6;
  --text-dim: #4a5568;

  /* Glow */
  --glow-cyan: rgba(0, 229, 255, 0.15);
  --glow-gold: rgba(255, 215, 0, 0.12);
  --glow-rose: rgba(251, 113, 133, 0.15);
  --danger-glow: #fb7185;
  --warning-glow: #fbbf24;
  --success-glow: #34d399;
  --primary-neon: #00e5ff;
  --primary-glow: rgba(0, 229, 255, 0.4);

  /* Structure */
  --sidebar-width: 290px;
  --border-light: rgba(255, 255, 255, 0.06);
  --whatsapp-green: #34d399;
  --chat-bg: rgba(6, 10, 19, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* === AURORA AMBIENT BACKGROUND === */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0, 229, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(120, 80, 255, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, rgba(52, 211, 153, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(251, 113, 133, 0.03) 0%, transparent 40%);
  animation: auroraShift 25s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

@keyframes auroraShift {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, -3%) rotate(1deg); }
  66% { transform: translate(-1%, 2%) rotate(-0.5deg); }
  100% { transform: translate(3%, 1%) rotate(0.5deg); }
}

/* Grain texture overlay */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* === UTILITY CLASSES === */
.success { color: var(--accent-emerald) !important; text-shadow: 0 0 20px rgba(52, 211, 153, 0.3); }
.warning { color: var(--accent-gold) !important; text-shadow: 0 0 20px rgba(255, 215, 0, 0.2); }
.danger  { color: var(--accent-rose) !important; text-shadow: 0 0 20px rgba(251, 113, 133, 0.3); }

/* === SCROLL REVEAL SYSTEM === */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* === LAYOUT === */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* === SIDEBAR === */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(8, 12, 24, 0.85);
  backdrop-filter: blur(40px) saturate(1.2);
  -webkit-backdrop-filter: blur(40px) saturate(1.2);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  z-index: 10;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  padding: 32px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--card-border);
}
.brand .brand-logo {
  height: 34px;
  width: auto;
  border-radius: 8px;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.35));
}
.brand h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 21px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  gap: 4px;
}
.sidebar nav a {
  padding: 13px 28px;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid transparent;
  letter-spacing: 0.2px;
}
.sidebar nav a i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  transition: all 0.3s;
}
.sidebar nav a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}
.sidebar nav a:hover i {
  color: var(--accent-cyan);
  transform: scale(1.15);
}
.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.06) 0%, transparent 100%);
  color: var(--accent-cyan);
  border-left-color: var(--accent-cyan);
}

/* Sidebar Panels */
.dev-tools {
  margin: 0 20px 16px;
  padding: 18px;
  background: var(--card-glass);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
}
.dev-tools h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
}
.dev-tools p {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.5;
}
.dev-tools textarea {
  width: 100%;
  height: 80px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  resize: none;
  transition: border-color 0.3s;
}
.dev-tools textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--glow-cyan);
}
.dev-tools button {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(167, 139, 250, 0.15));
  color: var(--text-primary);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
  letter-spacing: 0.3px;
}
.dev-tools button:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(167, 139, 250, 0.25));
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.15);
}

/* === MAIN CONTENT === */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 0;
  overflow-y: auto;
  position: relative;
}

/* === HERO SECTION === */
.hero-section {
  padding: 60px 56px 40px;
  position: relative;
}
.hero-caption {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent-cyan);
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-caption::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent-cyan);
}
.hero-greeting {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 42px;
  font-weight: 300;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -1px;
}
.hero-greeting strong {
  font-weight: 700;
  background: linear-gradient(135deg, #fff 30%, var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.2px;
}

/* === METRICS ROW === */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 0 56px 40px;
}

/* === PREMIUM GLASS CARD === */
.card {
  background: var(--bg-surface);
  backdrop-filter: blur(24px) saturate(1.1);
  -webkit-backdrop-filter: blur(24px) saturate(1.1);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.4s ease;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 60%);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 229, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
  font-weight: 500;
  color: var(--text-secondary);
}

/* Metric Cards */
.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 28px;
}
.metric-card h3 {
  font-size: 11px;
  color: var(--text-dim);
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.metric-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -1.5px;
  line-height: 1;
}

/* === NARRATIVE SECTIONS === */
.narrative-section {
  padding: 0 56px 48px;
}
.section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-dim);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--card-border), transparent);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* === TRANSACTIONS === */
.txn-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
}
.txn-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.015);
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.txn-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--card-border);
  transform: translateX(6px);
}
.txn-left h4 { font-size: 14px; font-weight: 500; margin-bottom: 3px; letter-spacing: 0.1px; }
.txn-left p { font-size: 11px; color: var(--text-dim); display: flex; align-items: center; gap: 5px; }
.txn-right { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 15px; }

/* === CATEGORIES === */
.cat-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cat-item-container { margin-bottom: 14px !important; }
.cat-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}
.cat-item .bar {
  height: 5px !important;
  border-radius: 6px !important;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 36px 20px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.3px;
}

/* === MISSIONS BANNER === */
.missions-banner {
  display: none;
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.08), rgba(167, 139, 250, 0.05));
  border: 1px solid rgba(251, 113, 133, 0.15);
  border-radius: 16px;
  padding: 20px 28px;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.missions-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--accent-rose);
  border-radius: 4px 0 0 4px;
}
.missions-banner .mission-accept-btn {
  background: rgba(251, 113, 133, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(251, 113, 133, 0.3);
  padding: 8px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  transition: all 0.3s;
}
.missions-banner .mission-accept-btn:hover {
  background: rgba(251, 113, 133, 0.25);
  transform: scale(1.02);
}

/* === CHAT ASSISTANT === */
.chat-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  height: 440px;
}
.chat-header {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.08), rgba(0, 229, 255, 0.05));
  border-bottom: 1px solid rgba(52, 211, 153, 0.12);
  padding: 20px 24px;
}
.chat-header h3 {
  color: var(--accent-emerald) !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px !important;
}
.chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Chat Bubbles */
.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  animation: bubbleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-bubble strong { color: #fff; font-weight: 600; }
.chat-bubble.bot {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  align-self: flex-start;
  border-top-left-radius: 4px;
}
.chat-bubble.user {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(0, 229, 255, 0.08));
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: var(--text-primary);
  align-self: flex-end;
  border-top-right-radius: 4px;
}

/* Chat Footer */
.chat-footer {
  display: flex;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--card-border);
  gap: 10px;
}
.chat-footer input {
  flex: 1;
  padding: 12px 18px;
  border-radius: 30px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  outline: none;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
}
.chat-footer input:focus {
  border-color: var(--accent-emerald);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.08);
}
.chat-footer button {
  background: var(--accent-emerald);
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(52, 211, 153, 0.25);
}
.chat-footer button:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(52, 211, 153, 0.4);
}

/* === RECEIPT SCANNER MODAL === */
.scanner-modal {
  display: flex;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(6, 10, 19, 0.92);
  backdrop-filter: blur(20px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.scanner-box {
  width: 300px;
  height: 420px;
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 60px rgba(52, 211, 153, 0.08);
}
.scanner-laser {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--accent-emerald);
  box-shadow: 0 0 20px var(--accent-emerald), 0 0 60px var(--accent-emerald);
  animation: laserScan 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes laserScan {
  0% { top: 0; opacity: 0.6; }
  50% { top: 100%; opacity: 1; }
  100% { top: 0; opacity: 0.6; }
}
.scanner-content i {
  font-size: 56px;
  color: rgba(255, 255, 255, 0.08);
}
.scanner-text {
  margin-top: 28px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  color: var(--accent-emerald);
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: textPulse 2s ease-in-out infinite;
}
@keyframes textPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; text-shadow: 0 0 20px var(--accent-emerald); }
}

/* === FOOTER DIVIDER === */
.content-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--card-border), transparent);
  margin: 0 56px 40px;
}

/* === SUBSCRIPTIONS CARD === */
#subscriptions-section h3 i {
  color: var(--accent-violet);
}

/* === CHART WRAPPER === */
.chart-wrapper {
  position: relative;
  height: 220px;
  width: 100%;
}

/* ===  Misc Refinements === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}
