/* ============================================================
   O PRIMEIRO NEGÓCIO — Premium Design System
   ============================================================ */

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

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Paleta principal */
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-900: #14532d;

  /* Neutros */
  --black: #0a0a0a;
  --dark-900: #111111;
  --dark-800: #1a1a1a;
  --dark-700: #242424;
  --dark-600: #2e2e2e;
  --dark-500: #3a3a3a;
  --gray-400: #6b7280;
  --gray-300: #9ca3af;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --white: #ffffff;

  /* Dourado */
  --gold-400: #fbbf24;
  --gold-500: #f59e0b;
  --gold-300: #fcd34d;

  /* Semânticas */
  --bg: #0d0d0d;
  --bg-card: #161616;
  --bg-card-hover: #1e1e1e;
  --bg-input: #1a1a1a;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --text-primary: #f0f0f0;
  --text-secondary: #888888;
  --text-muted: #555555;
  --accent: #22c55e;
  --accent-glow: rgba(34, 197, 94, 0.15);
  --accent-dim: rgba(34, 197, 94, 0.08);
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --warning: #f97316;
  --info: #3b82f6;

  /* Tipografia */
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  /* Espaçamento */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Bordas */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.5);
  --shadow-green: 0 0 32px rgba(34,197,94,0.2);
  --shadow-gold: 0 0 32px rgba(245,158,11,0.2);

  /* Transições */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ============================================================
   LOADING SCREEN
   ============================================================ */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--black);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loading-logo {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 32px;
  letter-spacing: -0.5px;
}

.loading-logo span { color: var(--accent); }

.loading-bar-wrap {
  width: 200px; height: 3px;
  background: var(--dark-700);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: var(--radius-full);
  animation: loadBar 1.6s ease forwards;
}

@keyframes loadBar {
  from { width: 0; }
  to { width: 100%; }
}

/* ============================================================
   AUTH SCREENS
   ============================================================ */
#auth-screen {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: var(--black);
  position: relative;
  overflow: hidden;
}

#auth-screen::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(34,197,94,0.08) 0%, transparent 70%);
  top: -200px; left: -200px;
  pointer-events: none;
}

#auth-screen::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(245,158,11,0.06) 0%, transparent 70%);
  bottom: -100px; right: -100px;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-xl);
  position: relative;
  z-index: 1;
  animation: fadeUp 0.5s ease;
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
}

.auth-logo-text span { color: var(--accent); }

.auth-logo-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  background: var(--dark-800);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: var(--space-xl);
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  text-align: center;
}

.auth-tab.active {
  background: var(--accent);
  color: var(--black);
  font-weight: 600;
}

.form-group { margin-bottom: var(--space-md); }

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

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 15px;
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition-spring);
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: var(--black);
  width: 100%;
}

.btn-primary:hover {
  background: var(--green-400);
  transform: translateY(-1px);
  box-shadow: var(--shadow-green);
}

.btn-primary:active { transform: translateY(0); }

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

.btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  color: var(--black);
}

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

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn-full { width: 100%; }

.auth-footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
}

/* ============================================================
   MAIN APP LAYOUT
   ============================================================ */
#app {
  display: none;
  min-height: 100vh;
  background: var(--bg);
}

/* Mobile Nav Bottom */
.mobile-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(17, 17, 17, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px 8px;
  gap: 4px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.nav-item .nav-icon {
  font-size: 20px;
  line-height: 1;
  transition: var(--transition-spring);
}

.nav-item .nav-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  letter-spacing: 0.2px;
}

.nav-item.active .nav-icon { transform: translateY(-2px); }
.nav-item.active .nav-label { color: var(--accent); }

.nav-item .nav-dot {
  position: absolute;
  top: 6px; right: calc(50% - 14px);
  width: 6px; height: 6px;
  background: var(--danger);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-card);
}

/* Desktop Sidebar */
.sidebar {
  display: none;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 240px;
  background: var(--dark-900);
  border-right: 1px solid var(--border);
  flex-direction: column;
  padding: var(--space-lg);
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--white);
  padding: var(--space-sm) 0 var(--space-xl);
  letter-spacing: -0.3px;
}

.sidebar-logo span { color: var(--accent); }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px var(--space-md);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-item:hover {
  background: var(--dark-700);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(34,197,94,0.15);
}

.sidebar-item .s-icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-md) 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-md);
  background: var(--dark-800);
  border-radius: var(--radius-md);
  margin-top: auto;
}

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

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; truncate; }
.sidebar-user-plan { font-size: 11px; color: var(--text-muted); }

/* Main Content Area */
.main-content {
  padding: 0 0 80px;
  min-height: 100vh;
}

/* Top Header */
.top-header {
  background: rgba(13,13,13,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0;
  z-index: 50;
}

.header-logo {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.header-logo span { color: var(--accent); }

.header-right { display: flex; align-items: center; gap: var(--space-sm); }

.header-xp {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--dark-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 12px 5px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}

.header-xp-icon { font-size: 15px; }

.header-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--green-700));
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  color: var(--black);
  cursor: pointer;
  transition: var(--transition-spring);
}

.header-avatar:hover { transform: scale(1.05); }

/* Screens */
.screen { display: none; }
.screen.active { display: block; animation: fadeUp 0.3s ease; }

.screen-pad { padding: var(--space-md); }

/* ============================================================
   DASHBOARD SCREEN
   ============================================================ */
.dashboard-greeting {
  margin-bottom: var(--space-lg);
}

.greeting-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.greeting-main {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.greeting-main span { color: var(--accent); }

/* Level Card */
.level-card {
  background: linear-gradient(135deg, var(--dark-800) 0%, rgba(34,197,94,0.08) 100%);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  position: relative;
  overflow: hidden;
}

.level-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(34,197,94,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.level-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.level-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.level-icon {
  font-size: 32px;
  line-height: 1;
}

.level-info {}
.level-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
}

.level-num {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

.level-xp-text {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: right;
}

.level-xp-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  display: block;
}

.xp-bar-wrap {
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}

.xp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold-400));
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

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

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

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 22px;
  margin-bottom: var(--space-sm);
}

.stat-val {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Streak card */
.streak-card {
  background: linear-gradient(135deg, var(--dark-800), rgba(245,158,11,0.08));
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  cursor: pointer;
  transition: var(--transition);
}

.streak-card:hover { border-color: rgba(245,158,11,0.4); }

.streak-flame { font-size: 40px; animation: flicker 1.5s ease-in-out infinite; }

@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.05) rotate(-2deg); }
  75% { transform: scale(0.97) rotate(2deg); }
}

.streak-info { flex: 1; }

.streak-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.streak-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.streak-days {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.streak-day {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--dark-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}

.streak-day.done {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  color: var(--black);
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.section-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
}

.section-action {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
}

/* Mission cards */
.missions-list { display: flex; flex-direction: column; gap: var(--space-sm); }

.mission-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
  transition: var(--transition);
}

.mission-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.mission-card.done {
  opacity: 0.6;
  border-color: var(--accent);
}

.mission-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--dark-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.mission-info { flex: 1; }

.mission-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.mission-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.mission-xp {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.mission-check {
  width: 24px; height: 24px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  transition: var(--transition);
  flex-shrink: 0;
}

.mission-card.done .mission-check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--black);
}

/* ============================================================
   PROFILE TEST SCREEN
   ============================================================ */
.profile-test {
  max-width: 600px;
  margin: 0 auto;
}

.profile-header {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-lg);
}

.profile-header-icon { font-size: 48px; margin-bottom: var(--space-md); }

.profile-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
  margin-bottom: var(--space-sm);
}

.profile-subtitle { font-size: 14px; color: var(--text-secondary); }

.profile-progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.profile-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--dark-700);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.profile-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.profile-step-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.profile-question {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-md);
  animation: fadeUp 0.3s ease;
}

.question-label {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-sm);
}

.question-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-lg);
  line-height: 1.3;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.option-btn {
  padding: var(--space-md);
  background: var(--dark-800);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-spring);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.option-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-2px);
}

.option-btn.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.option-btn .opt-icon { font-size: 20px; }

.profile-nav {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

/* ============================================================
   FINANCIAL SCREEN
   ============================================================ */
.financial-header {
  background: linear-gradient(135deg, var(--dark-800), rgba(34,197,94,0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.balance-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.balance-val {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -1px;
  margin-bottom: var(--space-md);
}

.balance-val.positive { color: var(--accent); }
.balance-val.negative { color: var(--danger); }

.balance-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.balance-item {
  background: var(--dark-900);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}

.balance-item-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.balance-item-val {
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
}

.balance-item-val.in { color: var(--accent); }
.balance-item-val.out { color: var(--danger); }

.fin-tabs {
  display: flex;
  gap: 4px;
  background: var(--dark-800);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: var(--space-md);
}

.fin-tab {
  flex: 1;
  padding: 9px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.fin-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.transaction-list { display: flex; flex-direction: column; gap: 8px; }

.transaction-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  animation: fadeUp 0.3s ease;
}

.transaction-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.transaction-icon.in { background: rgba(34,197,94,0.12); }
.transaction-icon.out { background: rgba(239,68,68,0.12); }

.transaction-info { flex: 1; }
.transaction-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.transaction-cat { font-size: 12px; color: var(--text-muted); }

.transaction-val {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.transaction-val.in { color: var(--accent); }
.transaction-val.out { color: var(--danger); }

/* Chart mini */
.chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 80px;
}

.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 4px;
}

.chart-bar.in-bar { background: linear-gradient(180deg, var(--accent), var(--green-700)); }
.chart-bar.out-bar { background: linear-gradient(180deg, var(--danger), #991b1b); opacity: 0.7; }

.chart-bar-label { font-size: 9px; color: var(--text-muted); }

/* FAB */
.fab {
  position: fixed;
  bottom: 90px; right: 20px;
  width: 56px; height: 56px;
  background: var(--accent);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-green);
  cursor: pointer;
  transition: var(--transition-spring);
  z-index: 90;
}

.fab:hover { transform: scale(1.1) rotate(90deg); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  padding: 0 0 0;
}

.modal-overlay.open { display: flex; }

.modal-sheet {
  background: var(--dark-800);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-lg) var(--space-md) calc(var(--space-xl) + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 600px;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-handle {
  width: 40px; height: 4px;
  background: var(--dark-500);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-lg);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

.type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: var(--space-md);
}

.type-btn {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: var(--dark-700);
  color: var(--text-secondary);
}

.type-btn[data-type="in"].selected { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.type-btn[data-type="out"].selected { border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,0.08); }

/* ============================================================
   CALCULATORS SCREEN
   ============================================================ */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  cursor: pointer;
  transition: var(--transition-spring);
  text-align: center;
}

.calc-card:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-3px);
}

.calc-card-icon { font-size: 28px; margin-bottom: var(--space-sm); }
.calc-card-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.calc-card-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.calculator-active {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  animation: fadeUp 0.3s ease;
}

.calc-active-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.calc-result-box {
  background: linear-gradient(135deg, var(--dark-900), rgba(34,197,94,0.06));
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  margin-top: var(--space-lg);
}

.calc-result-label { font-size: 13px; color: var(--text-muted); }
.calc-result-val {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
  margin: 4px 0;
}

.calc-result-sub { font-size: 13px; color: var(--text-secondary); }

/* ============================================================
   AI CHAT SCREEN
   ============================================================ */
.ai-chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  scrollbar-width: none;
}

.ai-messages::-webkit-scrollbar { display: none; }

.ai-msg {
  display: flex;
  gap: var(--space-sm);
  animation: fadeUp 0.3s ease;
}

.ai-msg.user { flex-direction: row-reverse; }

.ai-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--green-700));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  font-weight: 700;
  color: var(--black);
}

.ai-avatar.ai-bot {
  background: linear-gradient(135deg, var(--dark-700), var(--dark-600));
  font-size: 16px;
}

.ai-bubble {
  max-width: 75%;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.6;
}

.ai-msg.bot .ai-bubble {
  background: var(--dark-800);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-top-left-radius: 4px;
}

.ai-msg.user .ai-bubble {
  background: var(--accent);
  color: var(--black);
  font-weight: 500;
  border-top-right-radius: 4px;
}

.ai-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
}

.ai-typing span {
  width: 6px; height: 6px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
  animation: typingBounce 1.2s infinite;
}

.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

.ai-input-area {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
}

.ai-input {
  flex: 1;
  background: var(--dark-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px var(--space-md);
  font-size: 14px;
  color: var(--text-primary);
  resize: none;
  outline: none;
  max-height: 120px;
  min-height: 44px;
  transition: var(--transition);
  line-height: 1.5;
}

.ai-input:focus { border-color: var(--accent); }
.ai-input::placeholder { color: var(--text-muted); }

.ai-send-btn {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition-spring);
  flex-shrink: 0;
  border: none;
}

.ai-send-btn:hover { transform: scale(1.1); background: var(--green-400); }

.ai-suggestions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: var(--space-sm) var(--space-md);
  scrollbar-width: none;
}

.ai-suggestions::-webkit-scrollbar { display: none; }

.ai-suggest-pill {
  background: var(--dark-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.ai-suggest-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Premium lock */
.premium-lock {
  background: linear-gradient(135deg, var(--dark-800), rgba(245,158,11,0.08));
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  margin: var(--space-md);
}

.premium-lock-icon { font-size: 40px; margin-bottom: var(--space-md); }

.premium-lock-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-sm);
}

.premium-lock-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

/* ============================================================
   COMMUNITY SCREEN
   ============================================================ */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin-bottom: var(--space-sm);
  transition: var(--transition);
}

.post-card:hover { border-color: var(--border-hover); }

.post-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.post-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--green-600), var(--green-800));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: var(--white);
  flex-shrink: 0;
}

.post-user-name { font-size: 14px; font-weight: 600; }
.post-time { font-size: 12px; color: var(--text-muted); }
.post-badge {
  background: var(--gold-glow);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 10px;
  color: var(--gold);
  font-weight: 600;
  margin-left: auto;
}

.post-text { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: var(--space-md); }

.post-actions {
  display: flex;
  gap: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

.post-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  padding: 4px;
}

.post-action-btn:hover { color: var(--accent); }
.post-action-btn.liked { color: var(--danger); }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 80px; right: var(--space-md);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: var(--dark-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 14px;
  max-width: 320px;
  pointer-events: all;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-md);
}

.toast.success { border-color: var(--accent); }
.toast.error { border-color: var(--danger); }
.toast.gold { border-color: var(--gold); }

.toast-icon { font-size: 18px; }
.toast-msg { flex: 1; }

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

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

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

/* ============================================================
   RESPONSIVE — DESKTOP
   ============================================================ */
@media (min-width: 768px) {
  .mobile-nav { display: none; }
  .sidebar { display: flex; }

  .main-content {
    margin-left: 240px;
    padding: 0;
  }

  .fab { bottom: 32px; }

  .screen-pad {
    padding: var(--space-xl);
    max-width: 720px;
    margin: 0 auto;
  }

  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .calc-grid { grid-template-columns: repeat(3, 1fr); }

  .options-grid { grid-template-columns: repeat(2, 1fr); }

  .modal-overlay { align-items: center; }
  .modal-sheet {
    border-radius: var(--radius-xl);
    max-width: 480px;
    padding-bottom: var(--space-xl);
  }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-accent { color: var(--accent); }
.text-gold { color: var(--gold); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-display { font-family: var(--font-display); }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.mt-md { margin-top: var(--space-md); }
.mb-md { margin-bottom: var(--space-md); }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.text-center { text-align: center; }
.w-full { width: 100%; }
