/* ============================================================
   MeuCash Premium Design System
   Inspired by: Stripe, Nubank, Vercel, Apple, Linear
   ============================================================ */

/* ---- CSS Variables / Tokens ---- */
:root {
  --mc-green: #16a34a;
  --mc-green-light: #22c55e;
  --mc-green-dark: #15803d;
  --mc-green-100: #dcfce7;
  --mc-gold: #d4a017;
  --mc-gold-light: #f5c842;
  --mc-white: #ffffff;
  --mc-gray-50: #f9fafb;
  --mc-gray-100: #f3f4f6;
  --mc-gray-200: #e5e7eb;
  --mc-gray-300: #d1d5db;
  --mc-gray-400: #9ca3af;
  --mc-gray-500: #6b7280;
  --mc-gray-600: #4b5563;
  --mc-gray-700: #374151;
  --mc-gray-800: #1f2937;
  --mc-gray-900: #111827;
  --mc-graphite: #1a1f2e;
  --mc-graphite-light: #252d3d;

  /* Semantic */
  --mc-bg: var(--mc-white);
  --mc-bg-secondary: var(--mc-gray-50);
  --mc-surface: var(--mc-white);
  --mc-surface-elevated: var(--mc-white);
  --mc-border: var(--mc-gray-200);
  --mc-text: var(--mc-gray-900);
  --mc-text-secondary: var(--mc-gray-500);
  --mc-text-muted: var(--mc-gray-400);

  /* Effects */
  --mc-radius: 12px;
  --mc-radius-lg: 20px;
  --mc-radius-xl: 28px;
  --mc-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --mc-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --mc-shadow-lg: 0 16px 48px rgba(0,0,0,0.12), 0 6px 20px rgba(0,0,0,0.06);
  --mc-shadow-green: 0 8px 24px rgba(22,163,74,0.25);

  /* Transitions */
  --mc-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --mc-transition-fast: all 0.15s ease;

  /* Sidebar */
  --sidebar-width: 260px;
  --topbar-height: 64px;

  /* Font */
  --mc-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Dark Mode ---- */
[data-theme="dark"] {
  --mc-bg: var(--mc-graphite);
  --mc-bg-secondary: var(--mc-graphite-light);
  --mc-surface: #1e2637;
  --mc-surface-elevated: #252d3d;
  --mc-border: rgba(255,255,255,0.08);
  --mc-text: #f1f5f9;
  --mc-text-secondary: #94a3b8;
  --mc-text-muted: #64748b;
  --mc-shadow: 0 4px 16px rgba(0,0,0,0.4);
  --mc-shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
}

/* ---- Base Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--mc-font);
  background: var(--mc-bg);
  color: var(--mc-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--mc-text);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }

.text-gradient {
  background: linear-gradient(135deg, var(--mc-green-light) 0%, var(--mc-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.mc-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--mc-surface);
  border-right: 1px solid var(--mc-border);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), var(--mc-transition);
  overflow: hidden;
}

.mc-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--mc-bg);
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mc-topbar {
  height: var(--topbar-height);
  background: var(--mc-surface);
  border-bottom: 1px solid var(--mc-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mc-content {
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ---- Sidebar Logo ---- */
.mc-sidebar-logo {
  padding: 1.5rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  border-bottom: 1px solid var(--mc-border);
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.mc-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--mc-green) 0%, var(--mc-green-light) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 900;
  color: white;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
  flex-shrink: 0;
}

.mc-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--mc-text);
  letter-spacing: -0.03em;
}

.mc-logo-text span { color: var(--mc-green); }

/* ---- Navigation ---- */
.mc-nav {
  padding: 0.5rem 0.75rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.mc-nav-section {
  margin-bottom: 0.25rem;
}

.mc-nav-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mc-text-muted);
  padding: 0.75rem 0.5rem 0.25rem;
}

.mc-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 10px;
  color: var(--mc-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--mc-transition-fast);
  margin-bottom: 2px;
  position: relative;
}

.mc-nav-item:hover {
  background: var(--mc-gray-100);
  color: var(--mc-text);
  transform: translateX(2px);
}

[data-theme="dark"] .mc-nav-item:hover {
  background: rgba(255,255,255,0.06);
}

.mc-nav-item.active {
  background: var(--mc-green-100);
  color: var(--mc-green);
  font-weight: 600;
}

[data-theme="dark"] .mc-nav-item.active {
  background: rgba(22, 163, 74, 0.15);
  color: var(--mc-green-light);
}

.mc-nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.mc-nav-item.active .nav-icon { opacity: 1; }

.mc-nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 20px;
  background: var(--mc-green);
  color: white;
  min-width: 20px;
  text-align: center;
}

/* ---- Cards ---- */
.mc-card {
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  padding: 1.25rem;
  box-shadow: var(--mc-shadow-sm);
  transition: var(--mc-transition);
}

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

.mc-card-elevated {
  box-shadow: var(--mc-shadow);
}

.mc-card-glass {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.5);
}

[data-theme="dark"] .mc-card-glass {
  background: rgba(30,38,55,0.8);
  border: 1px solid rgba(255,255,255,0.1);
}

/* ---- Stat Cards ---- */
.mc-stat {
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--mc-shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--mc-transition);
}

.mc-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--mc-green) 0%, var(--mc-gold) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mc-stat:hover::before { opacity: 1; }
.mc-stat:hover { box-shadow: var(--mc-shadow); transform: translateY(-2px); }

.mc-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.mc-stat-icon.green { background: var(--mc-green-100); color: var(--mc-green); }
.mc-stat-icon.blue { background: #dbeafe; color: #2563eb; }
.mc-stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.mc-stat-icon.orange { background: #ffedd5; color: #ea580c; }
.mc-stat-icon.gold { background: #fef3c7; color: #d97706; }

[data-theme="dark"] .mc-stat-icon.green { background: rgba(22,163,74,0.15); }
[data-theme="dark"] .mc-stat-icon.blue { background: rgba(37,99,235,0.15); }
[data-theme="dark"] .mc-stat-icon.purple { background: rgba(124,58,237,0.15); }
[data-theme="dark"] .mc-stat-icon.orange { background: rgba(234,88,12,0.15); }

.mc-stat-value {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--mc-text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.mc-stat-label {
  font-size: 0.8125rem;
  color: var(--mc-text-secondary);
  font-weight: 500;
}

.mc-stat-change {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.5rem;
}

.mc-stat-change.up { color: var(--mc-green); }
.mc-stat-change.down { color: #ef4444; }

/* ---- Buttons ---- */
.btn-mc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--mc-font);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: var(--mc-transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.btn-mc:focus-visible {
  outline: 2px solid var(--mc-green);
  outline-offset: 2px;
}

.btn-mc-primary {
  background: linear-gradient(135deg, var(--mc-green) 0%, var(--mc-green-light) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.btn-mc-primary:hover {
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.5);
  transform: translateY(-1px);
  color: white;
}

.btn-mc-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.btn-mc-secondary {
  background: var(--mc-gray-100);
  color: var(--mc-text);
  border: 1px solid var(--mc-border);
}

.btn-mc-secondary:hover {
  background: var(--mc-gray-200);
  color: var(--mc-text);
}

[data-theme="dark"] .btn-mc-secondary {
  background: var(--mc-surface-elevated);
  border-color: var(--mc-border);
  color: var(--mc-text);
}

.btn-mc-outline {
  background: transparent;
  color: var(--mc-green);
  border: 1.5px solid var(--mc-green);
}

.btn-mc-outline:hover {
  background: var(--mc-green-100);
  color: var(--mc-green-dark);
}

.btn-mc-ghost {
  background: transparent;
  color: var(--mc-text-secondary);
  border: none;
}

.btn-mc-ghost:hover {
  background: var(--mc-gray-100);
  color: var(--mc-text);
}

.btn-mc-gold {
  background: linear-gradient(135deg, var(--mc-gold) 0%, var(--mc-gold-light) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(212, 160, 23, 0.35);
}

.btn-mc-gold:hover {
  box-shadow: 0 6px 20px rgba(212, 160, 23, 0.5);
  transform: translateY(-1px);
  color: white;
}

.btn-mc-danger {
  background: #ef4444;
  color: white;
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

.btn-mc-danger:hover { background: #dc2626; transform: translateY(-1px); color: white; }

.btn-mc-sm { padding: 0.4rem 0.875rem; font-size: 0.8125rem; border-radius: 8px; }
.btn-mc-lg { padding: 0.875rem 1.75rem; font-size: 1rem; border-radius: 12px; }
.btn-mc-xl { padding: 1rem 2rem; font-size: 1.0625rem; border-radius: 14px; }

/* ---- Forms ---- */
.mc-form-group {
  margin-bottom: 1.25rem;
}

.mc-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--mc-text);
  margin-bottom: 0.375rem;
  letter-spacing: -0.01em;
}

.mc-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: var(--mc-font);
  font-size: 0.9375rem;
  color: var(--mc-text);
  background: var(--mc-bg);
  border: 1.5px solid var(--mc-border);
  border-radius: 10px;
  transition: var(--mc-transition-fast);
  outline: none;
  -webkit-appearance: none;
}

.mc-input:focus {
  border-color: var(--mc-green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.mc-input::placeholder { color: var(--mc-text-muted); }

[data-theme="dark"] .mc-input {
  background: var(--mc-surface);
  border-color: var(--mc-border);
  color: var(--mc-text);
}

.mc-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.mc-input-icon {
  position: absolute;
  left: 0.875rem;
  color: var(--mc-text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.mc-input-group .mc-input { padding-left: 2.75rem; }

/* ---- Badges ---- */
.mc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.mc-badge-green { background: var(--mc-green-100); color: var(--mc-green-dark); }
.mc-badge-blue { background: #dbeafe; color: #1d4ed8; }
.mc-badge-purple { background: #ede9fe; color: #6d28d9; }
.mc-badge-orange { background: #ffedd5; color: #c2410c; }
.mc-badge-yellow { background: #fef9c3; color: #a16207; }
.mc-badge-red { background: #fee2e2; color: #b91c1c; }
.mc-badge-gray { background: var(--mc-gray-100); color: var(--mc-gray-600); }
.mc-badge-gold { background: #fef3c7; color: #92400e; }

[data-theme="dark"] .mc-badge-green { background: rgba(22,163,74,0.15); color: var(--mc-green-light); }
[data-theme="dark"] .mc-badge-blue { background: rgba(37,99,235,0.15); color: #60a5fa; }
[data-theme="dark"] .mc-badge-gray { background: rgba(255,255,255,0.08); color: var(--mc-text-secondary); }

/* ---- Progress Bar ---- */
.mc-progress {
  background: var(--mc-gray-100);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
}

[data-theme="dark"] .mc-progress { background: rgba(255,255,255,0.08); }

.mc-progress-bar {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--mc-green) 0%, var(--mc-green-light) 100%);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.mc-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.mc-progress-gold .mc-progress-bar {
  background: linear-gradient(90deg, var(--mc-gold) 0%, var(--mc-gold-light) 100%);
}

/* ---- Avatar ---- */
.mc-avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.mc-avatar-sm { width: 32px; height: 32px; }
.mc-avatar-md { width: 40px; height: 40px; }
.mc-avatar-lg { width: 56px; height: 56px; }
.mc-avatar-xl { width: 80px; height: 80px; }

/* ---- Tables ---- */
.mc-table-wrapper {
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  overflow: hidden;
  box-shadow: var(--mc-shadow-sm);
}

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

.mc-table thead {
  background: var(--mc-bg-secondary);
  border-bottom: 1px solid var(--mc-border);
}

.mc-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mc-text-secondary);
}

.mc-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--mc-border);
  color: var(--mc-text);
  vertical-align: middle;
}

.mc-table tbody tr:last-child td { border-bottom: none; }

.mc-table tbody tr:hover td { background: var(--mc-gray-50); }
[data-theme="dark"] .mc-table tbody tr:hover td { background: rgba(255,255,255,0.03); }

/* ---- Wallet Card ---- */
.mc-wallet-card {
  background: linear-gradient(135deg, var(--mc-green-dark) 0%, var(--mc-green) 50%, var(--mc-green-light) 100%);
  border-radius: 20px;
  padding: 2rem;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--mc-shadow-green);
}

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

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

.mc-wallet-balance {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0.5rem 0;
}

.mc-wallet-label {
  font-size: 0.8125rem;
  opacity: 0.75;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Level / XP ---- */
.mc-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.8rem;
}

.mc-level-badge.bronze { background: linear-gradient(135deg, #cd7f32, #e8a87c); color: white; }
.mc-level-badge.silver { background: linear-gradient(135deg, #a8a9ad, #d4d5d9); color: white; }
.mc-level-badge.gold { background: linear-gradient(135deg, var(--mc-gold), var(--mc-gold-light)); color: white; }
.mc-level-badge.platinum { background: linear-gradient(135deg, #b0c4de, #e0e8f0); color: #374151; }
.mc-level-badge.diamond { background: linear-gradient(135deg, #4fc3f7, #b9f2ff); color: #1565c0; }

/* ---- Auth Layout ---- */
.mc-auth-layout {
  min-height: 100vh;
  display: flex;
}

.mc-auth-panel {
  width: 480px;
  background: var(--mc-surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 3.5rem;
  position: relative;
  z-index: 10;
}

.mc-auth-bg {
  flex: 1;
  background: linear-gradient(135deg, var(--mc-green-dark) 0%, var(--mc-green) 40%, #15803d 70%, #166534 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-auth-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 40%),
    radial-gradient(circle at 60% 80%, rgba(212,160,23,0.1) 0%, transparent 40%);
}

/* ---- Toasts / Alerts ---- */
.mc-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--mc-radius);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.mc-alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.mc-alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.mc-alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.mc-alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

[data-theme="dark"] .mc-alert-success { background: rgba(22,163,74,0.1); border-color: rgba(22,163,74,0.3); color: #4ade80; }
[data-theme="dark"] .mc-alert-error { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #f87171; }
[data-theme="dark"] .mc-alert-warning { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: #fbbf24; }
[data-theme="dark"] .mc-alert-info { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); color: #60a5fa; }

/* ---- Cashback Receipt Upload ---- */
.mc-upload-zone {
  border: 2px dashed var(--mc-border);
  border-radius: var(--mc-radius);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--mc-transition);
  background: var(--mc-bg-secondary);
}

.mc-upload-zone:hover, .mc-upload-zone.dragover {
  border-color: var(--mc-green);
  background: var(--mc-green-100);
}

[data-theme="dark"] .mc-upload-zone:hover { background: rgba(22,163,74,0.08); }

/* ---- Micro Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
}

.animate-fadein { animation: fadeIn 0.4s ease; }
.animate-fadeInUp { animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-scaleIn { animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

.mc-anim-delay-1 { animation-delay: 0.1s; animation-fill-mode: both; }
.mc-anim-delay-2 { animation-delay: 0.2s; animation-fill-mode: both; }
.mc-anim-delay-3 { animation-delay: 0.3s; animation-fill-mode: both; }
.mc-anim-delay-4 { animation-delay: 0.4s; animation-fill-mode: both; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--mc-gray-300);
  border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover { background: var(--mc-gray-400); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* ---- Sidebar Collapsed ---- */
.mc-layout.sidebar-collapsed .mc-sidebar {
  width: 64px;
}

.mc-layout.sidebar-collapsed .mc-main {
  margin-left: 64px;
}

.mc-layout.sidebar-collapsed .mc-sidebar .mc-logo-text,
.mc-layout.sidebar-collapsed .mc-sidebar .mc-nav-label,
.mc-layout.sidebar-collapsed .mc-sidebar .nav-text,
.mc-layout.sidebar-collapsed .mc-sidebar .mc-nav-badge,
.mc-layout.sidebar-collapsed .mc-sidebar .mc-sidebar-user-info {
  display: none;
}

.mc-layout.sidebar-collapsed .mc-sidebar .mc-nav-item {
  justify-content: center;
  padding: 0.625rem;
}

.mc-layout.sidebar-collapsed .mc-sidebar .mc-sidebar-logo {
  justify-content: center;
  padding: 1rem 0.75rem;
}

/* ---- Responsivo ---- */
@media (max-width: 1024px) {
  .mc-sidebar {
    transform: translateX(-100%);
    box-shadow: var(--mc-shadow-lg);
  }

  .mc-sidebar.open { transform: translateX(0); }

  .mc-main { margin-left: 0 !important; }

  .mc-auth-bg { display: none; }
  .mc-auth-panel { width: 100%; padding: 2rem 1.5rem; }
}

@media (max-width: 768px) {
  .mc-content { padding: 1rem; }
  .mc-wallet-balance { font-size: 2rem; }
  .mc-auth-panel { padding: 1.5rem 1.25rem; }
}

/* ---- Sidebar Footer / User ---- */
.mc-sidebar > div.mt-auto { flex-shrink: 0; }

.mc-sidebar-user {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--mc-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: var(--mc-transition-fast);
  border-radius: 10px;
  margin: 0.5rem 0.75rem;
}

.mc-sidebar-user:hover { background: var(--mc-gray-100); }
[data-theme="dark"] .mc-sidebar-user:hover { background: rgba(255,255,255,0.06); }

.mc-sidebar-user-info { overflow: hidden; }
.mc-sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--mc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-sidebar-user-type {
  font-size: 0.7rem;
  color: var(--mc-text-muted);
}

/* ---- Topbar Elements ---- */
.mc-topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--mc-text);
  letter-spacing: -0.02em;
}

.mc-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mc-topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mc-text-secondary);
  cursor: pointer;
  transition: var(--mc-transition-fast);
  background: transparent;
  border: none;
  position: relative;
}

.mc-topbar-btn:hover {
  background: var(--mc-gray-100);
  color: var(--mc-text);
}

[data-theme="dark"] .mc-topbar-btn:hover { background: rgba(255,255,255,0.08); }

.mc-notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--mc-surface);
  animation: pulse-green 2s infinite;
}

/* ---- Charts override ---- */
canvas { max-width: 100%; }

/* ---- Glassmorphism Card ---- */
.mc-glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--mc-radius);
}

/* ---- Marketplace Grid ---- */
.mc-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.mc-product-card {
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  overflow: hidden;
  transition: var(--mc-transition);
  cursor: pointer;
}

.mc-product-card:hover {
  box-shadow: var(--mc-shadow);
  transform: translateY(-3px);
}

.mc-product-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--mc-gray-100);
}

.mc-product-info { padding: 1rem; }
.mc-product-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--mc-text);
  line-height: 1.4;
  margin-bottom: 0.375rem;
}

.mc-product-price {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--mc-green);
}

.mc-product-cashback {
  font-size: 0.75rem;
  color: var(--mc-text-secondary);
  margin-top: 0.25rem;
}

/* ---- Utility Classes ---- */
.mc-divider { border: none; border-top: 1px solid var(--mc-border); margin: 1.25rem 0; }
.mc-text-green { color: var(--mc-green) !important; }
.mc-text-gold { color: var(--mc-gold) !important; }
.mc-bg-green { background: var(--mc-green-100) !important; }
.mc-gap-sm { gap: 0.5rem !important; }
.mc-gap-md { gap: 1rem !important; }
.mc-gap-lg { gap: 1.5rem !important; }
.mc-rounded { border-radius: var(--mc-radius) !important; }
.mc-shadow { box-shadow: var(--mc-shadow) !important; }

/* Bootstrap Override Fixes */
.card { border: 1px solid var(--mc-border); border-radius: var(--mc-radius); background: var(--mc-surface); }
.card-body { color: var(--mc-text); }
.modal-content { background: var(--mc-surface); border: 1px solid var(--mc-border); border-radius: var(--mc-radius-lg); }
.modal-header { border-bottom: 1px solid var(--mc-border); }
.modal-footer { border-top: 1px solid var(--mc-border); }
.dropdown-menu { background: var(--mc-surface); border: 1px solid var(--mc-border); border-radius: var(--mc-radius); box-shadow: var(--mc-shadow-lg); }
.dropdown-item { color: var(--mc-text); font-size: 0.875rem; padding: 0.5rem 1rem; border-radius: 8px; }
.dropdown-item:hover { background: var(--mc-gray-100); color: var(--mc-text); }
[data-theme="dark"] .dropdown-item:hover { background: rgba(255,255,255,0.06); }

/* PWA install banner */
.mc-pwa-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 400px;
  background: var(--mc-graphite);
  color: white;
  border-radius: var(--mc-radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--mc-shadow-lg);
  z-index: 9999;
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   MeuCash PWA Enterprise — Componentes Adicionais v3.0
   Bottom Nav · Skeleton · Toast · Bottom Sheet · FAB
   Pull-to-Refresh · Offline · Safe Areas · Microinterações
   ============================================================ */

/* ---- Safe Area Insets (iPhone notch/home bar) ---- */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --bottom-nav-height: 64px;
}

/* ---- Tap Highlight & Selection ---- */
* { -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(22,163,74,.2); }

/* ============================================================
   BOTTOM NAVIGATION — Mobile PWA
   ============================================================ */
.mc-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  background: var(--mc-surface);
  border-top: 1px solid var(--mc-border);
  z-index: 200;
  padding-bottom: var(--safe-bottom);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

@media (max-width: 1023px) {
  .mc-bottom-nav { display: flex; }
  .mc-main { padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 0.5rem); }
}

.mc-bottom-nav-items {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: var(--bottom-nav-height);
}

.mc-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--mc-text-muted);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.5rem 0.25rem;
  transition: color 0.15s ease;
  position: relative;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mc-bottom-nav-item svg,
.mc-bottom-nav-item .bi {
  font-size: 1.375rem;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mc-bottom-nav-item.active {
  color: var(--mc-green);
}

.mc-bottom-nav-item.active svg,
.mc-bottom-nav-item.active .bi {
  transform: scale(1.15);
}

.mc-bottom-nav-item:active svg,
.mc-bottom-nav-item:active .bi {
  transform: scale(0.88);
}

/* Pill indicator */
.mc-bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: 100px;
  background: var(--mc-green);
  opacity: 0;
  animation: none;
}

/* Center FAB slot */
.mc-bottom-nav-item.mc-bottom-nav-fab {
  flex: 0 0 72px;
}

.mc-bottom-nav-fab-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mc-green) 0%, var(--mc-green-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.375rem;
  box-shadow: 0 4px 16px rgba(22,163,74,.45);
  margin-top: -16px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 3px solid var(--mc-surface);
}

.mc-bottom-nav-fab-btn:active {
  transform: scale(0.9);
  box-shadow: 0 2px 8px rgba(22,163,74,.3);
}

.mc-bottom-nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 20px);
  min-width: 16px;
  height: 16px;
  background: #ef4444;
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--mc-surface);
}

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.mc-skeleton {
  background: linear-gradient(90deg,
    var(--mc-gray-100) 25%,
    var(--mc-gray-200) 50%,
    var(--mc-gray-100) 75%
  );
  background-size: 200% 100%;
  animation: mc-skeleton-wave 1.5s infinite;
  border-radius: 8px;
}

[data-theme="dark"] .mc-skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,.04) 25%,
    rgba(255,255,255,.08) 50%,
    rgba(255,255,255,.04) 75%
  );
  background-size: 200% 100%;
}

@keyframes mc-skeleton-wave {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.mc-skeleton-text { height: 1em; width: 100%; display: block; }
.mc-skeleton-text.w-75 { width: 75%; }
.mc-skeleton-text.w-50 { width: 50%; }
.mc-skeleton-text.sm { height: 0.75em; }
.mc-skeleton-text.lg { height: 1.5em; }
.mc-skeleton-circle { border-radius: 50% !important; }
.mc-skeleton-card { height: 160px; width: 100%; display: block; border-radius: var(--mc-radius); }

/* ============================================================
   TOAST / SNACKBAR SYSTEM
   ============================================================ */
#mc-toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
  width: calc(100% - 2rem);
  pointer-events: none;
}

@media (max-width: 640px) {
  #mc-toast-container {
    top: auto;
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 0.75rem);
    left: 0.75rem;
    right: 0.75rem;
    max-width: none;
    width: auto;
  }
}

.mc-toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08);
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: all;
  animation: mc-toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.mc-toast.removing {
  animation: mc-toast-out 0.25s ease forwards;
}

@keyframes mc-toast-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes mc-toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); max-height: 100px; }
  to { opacity: 0; transform: translateY(-8px) scale(0.95); max-height: 0; padding: 0; margin: 0; }
}

@media (max-width: 640px) {
  @keyframes mc-toast-in {
    from { opacity: 0; transform: translateY(16px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

.mc-toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.mc-toast-body { flex: 1; min-width: 0; }
.mc-toast-title { font-weight: 700; font-size: 0.875rem; line-height: 1.3; }
.mc-toast-msg { font-size: 0.8125rem; opacity: 0.8; margin-top: 1px; line-height: 1.4; }

.mc-toast-close {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.5;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  transition: opacity 0.15s;
}
.mc-toast-close:hover { opacity: 1; }

/* Progress bar */
.mc-toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255,255,255,.4);
  border-radius: 0 0 14px 14px;
  animation: mc-toast-progress var(--duration, 4s) linear forwards;
}

@keyframes mc-toast-progress {
  from { width: 100%; }
  to { width: 0%; }
}

.mc-toast.mc-toast-success {
  background: #166534;
  color: white;
}
.mc-toast.mc-toast-error {
  background: #991b1b;
  color: white;
}
.mc-toast.mc-toast-warning {
  background: #92400e;
  color: white;
}
.mc-toast.mc-toast-info {
  background: var(--mc-graphite);
  color: white;
}
.mc-toast.mc-toast-cashback {
  background: linear-gradient(135deg, var(--mc-green-dark) 0%, var(--mc-green) 100%);
  color: white;
}
.mc-toast.mc-toast-coin {
  background: linear-gradient(135deg, #92400e 0%, #d97706 100%);
  color: white;
}

/* ============================================================
   BOTTOM SHEET
   ============================================================ */
.mc-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.mc-sheet-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.mc-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 501;
  background: var(--mc-surface);
  border-radius: 24px 24px 0 0;
  padding: 0 1.25rem calc(1.5rem + var(--safe-bottom));
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overscroll-behavior: contain;
}

.mc-sheet.open {
  transform: translateY(0);
}

.mc-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--mc-gray-300);
  border-radius: 100px;
  margin: 0.875rem auto 1.25rem;
}

[data-theme="dark"] .mc-sheet-handle { background: rgba(255,255,255,.15); }

.mc-sheet-title {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--mc-text);
  margin-bottom: 1.25rem;
}

/* ============================================================
   FLOATING ACTION BUTTON (FAB)
   ============================================================ */
.mc-fab {
  position: fixed;
  z-index: 199;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 1rem);
  right: 1.25rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mc-green) 0%, var(--mc-green-light) 100%);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  box-shadow: 0 6px 24px rgba(22,163,74,.45);
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}

.mc-fab:active {
  transform: scale(0.88);
}

@media (max-width: 1023px) {
  .mc-fab { display: flex; }
}

/* ============================================================
   PULL TO REFRESH
   ============================================================ */
.mc-ptr {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, -80px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--mc-surface);
  box-shadow: var(--mc-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.mc-ptr.visible { transform: translate(-50%, 16px); }
.mc-ptr.refreshing { transform: translate(-50%, 16px); }

.mc-ptr-icon {
  color: var(--mc-green);
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.mc-ptr.refreshing .mc-ptr-icon {
  animation: mc-ptr-spin 0.8s linear infinite;
}

@keyframes mc-ptr-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============================================================
   OFFLINE BANNER
   ============================================================ */
.mc-offline-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: #92400e;
  color: white;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: calc(0.5rem + var(--safe-top)) 1rem 0.5rem;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.mc-offline-bar.show {
  transform: translateY(0);
}

/* ============================================================
   ENHANCED ANIMATIONS
   ============================================================ */
@keyframes mc-bounce-in {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes mc-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes mc-slide-down {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes mc-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes mc-coin-pop {
  0% { transform: scale(0) rotate(-15deg); opacity: 0; }
  60% { transform: scale(1.3) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes mc-ripple {
  to { transform: scale(4); opacity: 0; }
}

.mc-spin { animation: mc-spin 1s linear infinite; }
.animate-bounce-in { animation: mc-bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.animate-slide-up { animation: mc-slide-up 0.35s cubic-bezier(0.32, 0.72, 0, 1); }

/* Ripple effect */
.mc-ripple-container {
  position: relative;
  overflow: hidden;
}

.mc-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  transform: scale(0);
  animation: mc-ripple 0.6s linear;
  pointer-events: none;
}

/* ============================================================
   CARD SWIPE / HORIZONTAL SCROLL
   ============================================================ */
.mc-h-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 1rem;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mc-h-scroll::-webkit-scrollbar { display: none; }

.mc-h-scroll > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* ============================================================
   QUICK ACTION GRID
   ============================================================ */
.mc-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.875rem;
}

@media (max-width: 480px) {
  .mc-quick-actions { grid-template-columns: repeat(4, 1fr); gap: 0.625rem; }
}

.mc-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.mc-quick-action-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: var(--mc-gray-100);
  color: var(--mc-text-secondary);
}

[data-theme="dark"] .mc-quick-action-icon {
  background: rgba(255,255,255,.07);
}

.mc-quick-action:active .mc-quick-action-icon {
  transform: scale(0.88);
}

.mc-quick-action-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--mc-text-secondary);
  text-align: center;
  line-height: 1.3;
  max-width: 60px;
}

/* Quick action color variants */
.mc-quick-action.green .mc-quick-action-icon { background: var(--mc-green-100); color: var(--mc-green); }
.mc-quick-action.blue .mc-quick-action-icon { background: #dbeafe; color: #2563eb; }
.mc-quick-action.purple .mc-quick-action-icon { background: #ede9fe; color: #7c3aed; }
.mc-quick-action.orange .mc-quick-action-icon { background: #ffedd5; color: #ea580c; }
.mc-quick-action.gold .mc-quick-action-icon { background: #fef3c7; color: #d97706; }
.mc-quick-action.red .mc-quick-action-icon { background: #fee2e2; color: #dc2626; }

[data-theme="dark"] .mc-quick-action.green .mc-quick-action-icon { background: rgba(22,163,74,.15); color: var(--mc-green-light); }
[data-theme="dark"] .mc-quick-action.blue .mc-quick-action-icon { background: rgba(37,99,235,.15); color: #60a5fa; }
[data-theme="dark"] .mc-quick-action.purple .mc-quick-action-icon { background: rgba(124,58,237,.15); color: #a78bfa; }
[data-theme="dark"] .mc-quick-action.orange .mc-quick-action-icon { background: rgba(234,88,12,.15); color: #fb923c; }
[data-theme="dark"] .mc-quick-action.gold .mc-quick-action-icon { background: rgba(217,119,6,.15); color: #fbbf24; }

/* ============================================================
   ENHANCED WALLET CARD
   ============================================================ */
.mc-wallet-card-v2 {
  background: linear-gradient(135deg, #0f4c29 0%, var(--mc-green-dark) 35%, var(--mc-green) 70%, var(--mc-green-light) 100%);
  border-radius: 24px;
  padding: 1.75rem;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(22,163,74,.35), 0 4px 16px rgba(0,0,0,.1);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mc-wallet-card-v2::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 280px;
  height: 280px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}

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

.mc-wallet-card-v2-inner { position: relative; z-index: 1; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.mc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
}

.mc-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--mc-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.25rem;
}

[data-theme="dark"] .mc-empty-icon { background: rgba(255,255,255,.06); }

.mc-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--mc-text);
  margin-bottom: 0.5rem;
}

.mc-empty-text {
  font-size: 0.875rem;
  color: var(--mc-text-secondary);
  line-height: 1.6;
  max-width: 280px;
  margin-bottom: 1.5rem;
}

/* ============================================================
   ACTIVITY ITEM
   ============================================================ */
.mc-activity-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--mc-border);
  transition: background 0.15s;
}

.mc-activity-item:last-child { border-bottom: none; }

.mc-activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.mc-activity-body { flex: 1; min-width: 0; }
.mc-activity-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--mc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-activity-date {
  font-size: 0.75rem;
  color: var(--mc-text-secondary);
  margin-top: 2px;
}

.mc-activity-amount {
  text-align: right;
  flex-shrink: 0;
}

.mc-activity-value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--mc-green);
}

.mc-activity-value.negative { color: #ef4444; }

/* ============================================================
   MISSION CARD — Enhanced
   ============================================================ */
.mc-mission-card {
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius-lg);
  padding: 1.125rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.mc-mission-card:active { transform: scale(0.97); }
.mc-mission-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--mc-green) 0%, var(--mc-gold) 100%);
  border-radius: 4px 0 0 4px;
}

/* ============================================================
   SCORE RING
   ============================================================ */
.mc-score-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mc-score-ring svg {
  transform: rotate(-90deg);
}

.mc-score-ring-value {
  position: absolute;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--mc-text);
  letter-spacing: -0.03em;
}

/* ============================================================
   PULSE / ACTIVE DOT
   ============================================================ */
.mc-pulse {
  position: relative;
  display: inline-block;
}

.mc-pulse::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: var(--mc-green);
  border-radius: 50%;
  border: 2px solid var(--mc-surface);
  animation: mc-pulse-anim 2s ease infinite;
}

@keyframes mc-pulse-anim {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

/* ============================================================
   MOBILE FIRST RESPONSIVE TWEAKS
   ============================================================ */
@media (max-width: 1023px) {
  /* Hide sidebar nav labels on mobile (sidebar hidden anyway) */
  .mc-sidebar { display: none !important; }

  /* Topbar simplified on mobile */
  .mc-main { margin-left: 0 !important; }
  .mc-topbar {
    padding-top: calc(0.75rem + var(--safe-top));
    padding-left: calc(1rem + var(--safe-left));
    padding-right: calc(1rem + var(--safe-right));
  }

  /* Content padding on mobile */
  .mc-content { padding: 1rem; }
}

@media (min-width: 1024px) {
  .mc-bottom-nav { display: none !important; }
  .mc-fab { display: none !important; }
  /* Restore sidebar on desktop */
  .mc-sidebar { display: flex !important; }
  .mc-main { margin-left: var(--sidebar-width); }
}

/* ============================================================
   PWA INSTALL BANNER v2
   ============================================================ */
.mc-pwa-banner-v2 {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 0.75rem);
  left: 0.75rem;
  right: 0.75rem;
  background: var(--mc-graphite);
  color: white;
  border-radius: 16px;
  padding: 1rem 1.125rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  z-index: 9999;
  animation: mc-slide-up 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  max-width: 480px;
  margin: 0 auto;
}

@media (min-width: 641px) {
  .mc-pwa-banner-v2 {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
  }
}

/* ============================================================
   HAPTIC BUTTON FEEDBACK
   ============================================================ */
.mc-haptic {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.mc-haptic:active {
  transition: transform 0.05s ease;
}

/* ============================================================
   STAGGER ANIMATION HELPER
   ============================================================ */
.mc-stagger > * {
  opacity: 0;
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.mc-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.mc-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.mc-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.mc-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.mc-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.mc-stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* ============================================================
   DARK MODE CHART OVERRIDES
   ============================================================ */
[data-theme="dark"] canvas { filter: brightness(0.95); }

/* ============================================================
   PRINT — Hide navigation
   ============================================================ */
@media print {
  .mc-sidebar, .mc-topbar, .mc-bottom-nav, .mc-fab, #mc-toast-container { display: none !important; }
  .mc-main { margin: 0 !important; }
  .mc-content { padding: 0 !important; }
}
