/* ===== SinDeudas — style.css ===== */

:root {
  --primary: #10b981;
  --primary-2: #059669;
  --primary-light: rgba(16, 185, 129, 0.1);
  --primary-glow: rgba(16, 185, 129, 0.2);
  --accent: #0ea5e9;
  --danger: #ef4444;
  --warning: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-gold: #facc15;
  --ok: #10b981;
  --bg-color: #0B1120;      /* Deep modern navy background */
  --bg-2: #111827;
  --card-bg: rgba(30, 41, 59, 0.7); /* Glassmorphism base */
  --card-bg-2: rgba(51, 65, 85, 0.5);
  --bg-gradient: radial-gradient(ellipse at top, #111827 0%, #0B1120 100%);
  --card-gradient: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.8) 100%);
  --border-light: rgba(255, 255, 255, 0.04);
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --border: rgba(255, 255, 255, 0.08); 
  --border-primary: rgba(16, 185, 129, 0.25);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 60px -15px rgba(0,0,0,0.7);
  --font: 'Outfit', 'Inter', -apple-system, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="light"] {
  --bg-color: #F8FAFC;
  --bg-2: #F1F5F9;
  --card-bg: rgba(255, 255, 255, 0.8);
  --card-bg-2: rgba(226, 232, 240, 0.6);
  --bg-gradient: linear-gradient(to bottom right, #FFFFFF 0%, #F1F5F9 100%);
  --card-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
  --border-light: rgba(15, 23, 42, 0.03);
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border: rgba(15, 23, 42, 0.06);
  --border-primary: rgba(16, 185, 129, 0.25);
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 16px 50px rgba(15, 23, 42, 0.08);
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: #0f172a; /* Dark border for desktop view */
  color: var(--text-main);
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ===== AUTH SCREEN ===== */
.auth-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #0f2318 0%, #0a130e 60%);
}
.auth-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 60% 30%, rgba(16,185,129,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.auth-content {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  padding: 32px 24px;
  text-align: center;
}
.auth-subtitle {
  font-size: 15px; color: var(--text-muted); font-weight: 600;
  margin-bottom: 28px; line-height: 1.5;
}
.title-serif {
  font-size: 32px; font-weight: 900; letter-spacing: -1px;
  color: var(--text-main);
}

/* ===== APP CONTAINER ===== */
.app-container {
  display: flex; flex-direction: column; height: 100vh; height: 100dvh;
  overflow: hidden;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-gradient);
  position: relative;
  box-shadow: 0 0 30px rgba(0,0,0,0.4);
}

/* ===== HEADER ===== */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 10px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  background: rgba(11, 17, 32, 0.85); /* Matches deep navy */
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
  position: sticky; top: 0;
}
.header-left { display: flex; flex-direction: column; }
.header-saudacao { font-size: 14px; font-weight: 800; color: var(--primary); }
.header-data { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: capitalize; }
.header-logo { font-size: 26px; }
.header-actions { display: flex; gap: 8px; }

/* ===== MAIN / SCROLL ===== */
main {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 16px 16px calc(24px + var(--safe-bottom));
  scroll-behavior: smooth;
}
main::-webkit-scrollbar { display: none; }

.vista { display: none; }
.vista.active { display: block; }



/* ===== CARDS ===== */
.hub-card {
  position: relative;
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  border-radius: 20px;
  overflow: hidden;
  border: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hub-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  border-radius: 0 0 20px 20px;
  z-index: 1;
  pointer-events: none;
}
.hub-card span {
  position: relative;
  z-index: 2;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  letter-spacing: 0.5px;
}
.hub-card:active {
  transform: scale(0.96);
}
.card {
  background: var(--card-gradient, var(--card-bg));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  position: relative;
}
.card-glass {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 14px;
}

/* ===== DASH HERO ===== */
.dash-hero {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
  border-radius: 24px;
  padding: 28px 20px 24px;
  margin-bottom: 16px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.2) 0%, transparent 50%);
  pointer-events: none;
}
.dash-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; opacity: .85; margin-bottom: 4px;
}
.dash-value {
  font-size: 42px; font-weight: 900; letter-spacing: -1px;
  margin-bottom: 16px; line-height: 1.1;
}
.font-number { font-variant-numeric: tabular-nums; }

/* ===== INPUTS ===== */
.input-group { margin-bottom: 16px; }
.input-group label {
  display: block; font-size: 13px; font-weight: 800;
  color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px;
}
.input-group input, .input-group select, .input-group textarea {
  width: 100%; padding: 14px 16px;
  background: var(--bg-color); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-main);
  font-family: var(--font); font-size: 16px; font-weight: 600;
  outline: none; transition: border-color .15s;
  -webkit-appearance: none; appearance: none;
}
.input-group input:focus, .input-group select:focus {
  border-color: var(--primary);
}

/* ===== BUTTONS ===== */
.btn {
  width: 100%; min-height: 52px;
  padding: 14px 20px;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 16px; font-weight: 800;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:active { transform: scale(.97); opacity: .9; }
.btn-secondary {
  background: var(--bg-color); color: var(--text-main);
  border: 1.5px solid var(--border);
}
.btn-secondary:active { transform: scale(.97); }
.btn-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg-color); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); transition: all .15s;
}
.btn-icon:active { transform: scale(.9); }

/* ===== CHIPS ===== */
.chips-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip {
  padding: 6px 14px; border-radius: 99px;
  border: 1.5px solid var(--border); background: var(--bg-color);
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; transition: all .12s; white-space: nowrap;
}
.chip.selected {
  background: var(--primary); border-color: var(--primary); color: #fff;
}

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== MOV ROW ===== */
.mov-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.mov-row:last-child { border-bottom: none; }
.mov-icon {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--primary-light); display: flex; align-items: center;
  justify-content: center; font-size: 18px; flex-shrink: 0;
}
.mov-info { flex: 1; min-width: 0; }
.mov-desc { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov-cat { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.mov-amount { font-size: 15px; font-weight: 800; }
.mov-amount.ingreso { color: var(--ok); }
.mov-amount.gasto { color: var(--danger); }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-sheet {
  background: var(--card-bg);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px calc(20px + var(--safe-bottom));
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.32,.72,0,1);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-sheet h3 { font-size: 18px; font-weight: 800; margin-bottom: 18px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1a2e20; color: #fff;
  padding: 12px 22px; border-radius: 99px;
  font-size: 14px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: all .25s;
  white-space: nowrap; z-index: 1000; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== CHECK ITEMS (iOS PWA) ===== */
.check-item { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.check-item .box {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--primary-light); border: 1.5px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: var(--primary); flex-shrink: 0;
}
.check-item span { font-size: 14px; font-weight: 600; }

/* ===== SALDO HERO ===== */
.saldo-positivo { color: #10b981; }
.saldo-negativo { color: var(--danger); }

/* ===== ENVELOPE BARS ===== */
.sobre-item { margin-bottom: 12px; }
.sobre-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.sobre-nombre { font-size: 13px; font-weight: 700; }
.sobre-valores { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.sobre-bar-wrap { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.sobre-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .5s ease; }
.sobre-bar.over { background: linear-gradient(90deg, var(--danger), #f87171); }

/* ===== DEBT CARDS ===== */
.deuda-card {
  background: var(--card-gradient, var(--card-bg)); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); padding: 18px; margin-bottom: 12px;
  position: relative; overflow: hidden;
}
.deuda-card.foco { border-color: var(--primary); }
[data-theme="dark"] .deuda-card.foco { background: linear-gradient(135deg, #0f2318 0%, #0a130e 100%); }
.deuda-foco-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 800; padding: 3px 10px;
  border-radius: 99px; background: var(--primary); color: #fff;
  margin-bottom: 6px;
}
.deuda-nombre { font-size: 17px; font-weight: 800; margin-bottom: 2px; }
.deuda-saldo { font-size: 28px; font-weight: 800; margin-bottom: 8px; line-height: 1.1; }
.deuda-meta-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.deuda-progress-wrap { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.deuda-progress-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .6s; }
.deuda-progress-bar.pagada { background: linear-gradient(90deg, #10b981, #34d399); }
.deuda-libre-en { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 10px; }

/* ===== LIBERTAD HERO ===== */
.libertad-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
  border-radius: var(--radius-lg); padding: 22px; margin-bottom: 16px;
  color: #fff; text-align: center;
}
.libertad-fecha { font-size: 28px; font-weight: 800; margin: 4px 0; }
.libertad-sub { font-size: 13px; opacity: .85; font-weight: 600; }

/* ===== RETO 52 GRID ===== */
.reto-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px; margin: 14px 0;
}
.reto-semana {
  aspect-ratio: 1; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--card-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; transition: all .12s;
}
.reto-semana.done { background: var(--primary); border-color: var(--primary); color: #fff; }
.reto-semana:active { transform: scale(.88); }

/* ===== META CARD ===== */
.meta-card { padding: 16px; margin-bottom: 10px; }
.meta-nombre { font-size: 16px; font-weight: 800; margin-bottom: 2px; }
.meta-valores { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); font-weight: 600; margin: 8px 0 6px; }
.meta-progress-wrap { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.meta-progress-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #38bdf8); transition: width .5s; }
.meta-progress-bar.lograda { background: linear-gradient(90deg, var(--primary), var(--primary-2)); }

/* ===== ONBOARDING ===== */
.onboarding-screen {
  position: fixed; inset: 0; z-index: 900;
  background: var(--bg-color); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 28px 24px;
  overflow-y: auto;
}
[data-theme="dark"] .onboarding-screen { background: radial-gradient(ellipse at 50% 0%, #0f2318 0%, #0a130e 60%); }
.onb-step { width: 100%; max-width: 420px; text-align: center; }
.onb-emoji {
  width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 46px;
  background: radial-gradient(circle at 50% 35%, rgba(16,185,129,.22), rgba(16,185,129,.05));
  border: 1px solid rgba(16,185,129,.35);
  box-shadow: 0 10px 30px rgba(16,185,129,.18), inset 0 0 0 6px rgba(16,185,129,.04);
}
.onb-step img { display: block; margin-left: auto; margin-right: auto; }
.onb-step .input-group { text-align: left; }
.onb-progress { display: flex; gap: 6px; margin-bottom: 32px; }
.onb-dot { flex: 1; height: 4px; border-radius: 99px; background: var(--border); transition: background .3s; }
.onb-dot.active { background: var(--primary); }
.onb-titulo { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.onb-sub { font-size: 15px; color: var(--text-muted); margin-bottom: 28px; font-weight: 500; }

/* ===== TIPO TOGGLE ===== */
.tipo-toggle { display: flex; gap: 0; background: var(--bg-color); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 18px; }
.tipo-btn {
  flex: 1; padding: 10px; border: none; border-radius: 10px; font-family: var(--font);
  font-size: 15px; font-weight: 800; cursor: pointer; transition: all .15s;
  background: none; color: var(--text-muted);
}
.tipo-btn.active-i { background: #10b981; color: #fff; }
.tipo-btn.active-g { background: var(--danger); color: #fff; }

/* ===== SOBRES CONFIG ===== */
.sobre-config-item { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.sobre-config-item label { flex: 1; font-size: 14px; font-weight: 700; }
.sobre-config-item input { width: 100px; padding: 8px 10px; font-size: 14px; font-weight: 700; background: var(--bg-color); border: 1.5px solid var(--border); border-radius: 10px; color: var(--text-main); text-align: right; }

/* ===== DEBT TIMELINE GRAPHICS (SNOWBALL VISUAL PATH) ===== */
.deuda-timeline {
  position: relative;
  padding-left: 20px;
  margin-top: 14px;
}
.deuda-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border);
}
.deuda-timeline-item {
  position: relative;
  margin-bottom: 20px;
}
.deuda-timeline-node {
  position: absolute;
  left: -20px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 3px solid var(--border);
  z-index: 2;
  transition: all 0.3s ease;
}
.deuda-timeline-item.foco .deuda-timeline-node {
  background: var(--primary);
  border-color: var(--primary-glow);
  box-shadow: 0 0 10px var(--primary);
  animation: pulse-glow 1.8s infinite;
}
.deuda-timeline-item.pagada .deuda-timeline-node {
  background: #10b981;
  border-color: #10b981;
}
@keyframes pulse-glow {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ===== TRANSITIONS & ACTIVE SCALES ===== */
.nav-item {
  transition: transform 0.15s ease, color 0.15s ease;
}
.nav-item:active {
  transform: scale(0.92);
}
.btn {
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active {
  transform: scale(0.97);
}

/* ===== BUDGET CARD SYSTEM (SOBRES REDESIGN) ===== */
.sobres-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 8px;
}
.sobre-card {
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease;
}
.sobre-card:active {
  transform: scale(0.98);
}
.sobre-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sobre-card-icon-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sobre-card-emoji {
  font-size: 20px;
}
.sobre-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}
.sobre-card-pct {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--primary-light);
  color: var(--primary);
}
.sobre-card-pct.over {
  background: rgba(255, 72, 66, 0.12);
  color: var(--danger);
}
.sobre-card-amounts {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 4px;
}
.sobre-card-leftover {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}
.sobre-card-total {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ===== PILL TABS ===== */
.pill-tab {
  display: flex;
  background: var(--bg-2) !important;
  border-radius: var(--radius-sm);
  padding: 4px;
  border: 1.5px solid var(--border);
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font);
}
.tab-btn.active {
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* ===== DREAM BOARD GALLERY ===== */
#dreams-gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 480px) {
  #dreams-gallery-grid {
    grid-template-columns: 1fr 1fr; /* 2 columns on mobile is perfect for gallery cards */
  }
}
.dream-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dream-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.dream-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-color);
}
.dream-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  height: 34px; /* fixed height for alignment */
}
.dream-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.dream-card-btn-delete {
  background: none;
  border: none;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--danger);
  font-weight: 800;
  border-radius: 6px;
  transition: background 0.15s;
}
.dream-card-btn-delete:hover {
  background: rgba(239, 68, 68, 0.08);
}
.premium-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error Console */
.error-console {
  background: rgba(239, 68, 68, 0.08);
  border: 1.5px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: monospace;
  font-size: 12px;
  color: #fca5a5;
  display: none;
  white-space: pre-wrap;
  word-break: break-all;
}

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

/* ===== CUSTOM CALCULATOR KEYPAD (ONE-THUMB OPERATION) ===== */
.calc-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 14px;
  gap: 16px;
}
.calc-display-wrap {
  position: relative;
  background: rgba(0,0,0,0.2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.calc-display-currency {
  position: absolute;
  left: 18px;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}
.calc-display-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  width: 100%;
  padding-left: 24px;
}
.calc-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.calc-key {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 20px;
  font-weight: 700;
  padding: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
  user-select: none;
}
.calc-key:active {
  transform: scale(0.92);
  background: var(--primary-glow);
  border-color: var(--primary);
}
.calc-key.action {
  color: var(--danger);
  font-size: 16px;
}
.calc-key.submit {
  background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
  color: #fff;
  font-size: 18px;
}
.calc-key.submit:active {
  background: #059669;
}

/* ===== SVG ANIMATED CHARTS ===== */
.chart-container {
  position: relative;
  width: 100%;
  margin-top: 14px;
}
.chart-svg {
  width: 100%;
  height: 200px;
  overflow: visible;
}
.chart-axis-line {
  stroke: var(--border);
  stroke-width: 1.5;
  stroke-linecap: round;
}
.chart-grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4, 4;
}
.chart-axis-text {
  fill: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font);
}
.chart-line-path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw-chart 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.chart-area-path {
  fill: url(#area-grad);
  opacity: 0.12;
  stroke: none;
}
.chart-bar-rect {
  fill: var(--primary);
  rx: 4px;
  transition: height 0.5s ease, y 0.5s ease, fill 0.3s;
}
.chart-bar-rect.income {
  fill: var(--primary);
}
.chart-bar-rect.expense {
  fill: var(--danger);
}
.chart-bar-rect:hover {
  filter: brightness(1.2);
}
.chart-donut-circle {
  fill: none;
  stroke-width: 12px;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dasharray 0.8s ease;
}
@keyframes draw-chart {
  to { stroke-dashoffset: 0; }
}

/* ===== SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(90deg, var(--card-bg) 25%, var(--card-bg-2) 50%, var(--card-bg) 75%);
  background-size: 200% 100%;
  animation: loading-pulse 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-title {
  height: 20px;
  width: 50%;
  margin-bottom: 12px;
}
.skeleton-text {
  height: 14px;
  width: 90%;
  margin-bottom: 8px;
}
.skeleton-chart {
  height: 150px;
  width: 100%;
  margin-top: 14px;
}
@keyframes loading-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== PRINT OVERLAYS (EXPORTS: PDF FINANCIAL REPORT) ===== */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12px;
  }
  .app-container, header, .bottom-nav, .btn, .btn-icon, .modal-overlay, #screen-onboarding {
    display: none !important;
  }
  #print-report-view {
    display: block !important;
    width: 100%;
    padding: 24px;
  }
}
#print-report-view {
  display: none;
}

/* ===== PILL TABS ===== */
.pill-tab {
  display: flex;
  background: var(--bg-2) !important;
  border-radius: var(--radius-sm);
  padding: 4px;
  border: 1.5px solid var(--border);
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font);
}
.tab-btn.active {
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* ===== DREAM BOARD GALLERY ===== */
#dreams-gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 480px) {
  #dreams-gallery-grid {
    grid-template-columns: 1fr 1fr; /* 2 columns on mobile is perfect for gallery cards */
  }
}
.dream-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dream-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.dream-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-color);
}
.dream-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  height: 34px; /* fixed height for alignment */
}
.dream-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.dream-card-btn-delete {
  background: none;
  border: none;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--danger);
  font-weight: 800;
  border-radius: 6px;
  transition: background 0.15s;
}
.dream-card-btn-delete:hover {
  background: rgba(239, 68, 68, 0.08);
}
.premium-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error Console */
.error-console {
  background: rgba(239, 68, 68, 0.08);
  border: 1.5px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: monospace;
  font-size: 12px;
  color: #fca5a5;
  display: none;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===== AUTH SCREEN ===== */
.auth-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url('assets/auth_bg.png');
  background-size: cover;
  background-position: center;
  padding: 20px;
}
.auth-screen.hidden {
  display: none !important;
}
.auth-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 14, 23, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.auth-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.onboarding-screen .card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.onboarding-screen .input-group input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.onboarding-screen .btn {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--primary);
  font-weight: 800;
  transition: all 0.2s;
}

.onboarding-screen .btn:active {
  transform: scale(0.98);
  background: rgba(16, 185, 129, 0.2);
}
