:root {
  --bg-dark: #05060a;
  --glass-panel: rgba(20, 25, 40, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.03);
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --secondary: #06b6d4;
  --accent: #d946ef;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --success: #22c55e;
  --danger: #ef4444;
  
  --nav-height: 80px;
  --font-family: 'Plus Jakarta Sans', sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background-color: var(--bg-dark);
  font-family: var(--font-family);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.center-text { text-align: center; }

/* BACKGROUND FX */
.background-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 10s infinite ease-in-out;
}

.blob-1 { width: 300px; height: 300px; background: var(--primary); top: -50px; left: -50px; }
.blob-2 { width: 250px; height: 250px; background: var(--secondary); bottom: 100px; right: -50px; animation-delay: -2s; }
.blob-3 { width: 200px; height: 200px; background: var(--accent); top: 40%; left: 30%; opacity: 0.2; animation-delay: -5s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, 30px); }
}

/* APP SHELL */
.app-shell {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.mobile-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(5,6,10,0.9) 0%, rgba(5,6,10,0) 100%);
  z-index: 10;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-ring {
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: #1e293b;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  border: 2px solid var(--bg-dark);
}

.texts { display: flex; flex-direction: column; }
.greeting { font-size: 0.9rem; color: var(--text-muted); }
.greeting strong { color: var(--text-main); font-weight: 700; }

.status-badge {
  font-size: 0.7rem;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: 10px;
  width: fit-content;
  margin-top: 2px;
}

.icon-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  cursor: pointer;
}

/* CONTENT AREA */
.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 24px 120px;
  scroll-behavior: smooth;
}

.screen { display: none; animation: fadeIn 0.3s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* CARDS & WIDGETS */
.glass-card {
  background: var(--glass-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
}

.balance-card {
  text-align: center;
  background: linear-gradient(160deg, rgba(30, 35, 50, 0.7), rgba(10, 12, 18, 0.8));
}

.balance-card .label { color: var(--text-muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }
.balance-card h1 { font-size: 2.5rem; margin: 8px 0 16px; font-weight: 700; background: linear-gradient(to right, #fff, #94a3b8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.mini-chart { height: 60px; width: 100%; opacity: 0.8; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

.widget {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  min-height: 180px;
}

.widget-head { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.widget-title { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.widget-legend { margin-top: 8px; text-align: center; color: var(--text-muted); }

.donut-chart-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
}

.donut-chart {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.donut-hole {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60%; height: 60%;
  background: #151925;
  border-radius: 50%;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.icon-accent { color: var(--primary); }
.icon-accent-2 { color: var(--secondary); }

/* LISTS */
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 12px; }
.section-title h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.section-desc { color: var(--text-muted); font-size: 0.85rem; margin-top: -10px; margin-bottom: 20px; }
.link-btn { color: var(--primary); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.vertical-list { display: flex; flex-direction: column; gap: 12px; }

.list-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-left { display: flex; gap: 12px; align-items: center; }
.item-icon { width: 40px; height: 40px; background: rgba(255,255,255,0.05); border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; }
.item-info h4 { margin: 0; font-size: 0.95rem; }
.item-info p { margin: 4px 0 0; font-size: 0.8rem; color: var(--text-muted); }
.item-value { text-align: right; font-weight: 600; }
.progress-bar { height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; margin-top: 8px; width: 100px; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 2px; }

/* FORMS & INPUTS */
.clean-input, select.clean-input {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px;
  color: white;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}
.clean-input:focus { border-color: var(--primary); background: rgba(0,0,0,0.4); }
.clean-input.big-text { font-size: 1.2rem; }

.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }

.action-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  padding: 16px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px -5px var(--primary-glow);
  transition: transform 0.2s;
}
.action-btn:active { transform: scale(0.98); }
.full { width: 100%; }

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.styled-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0 12px;
}
.styled-input-wrapper i { font-size: 1.2rem; }
.styled-input-wrapper input {
  background: transparent;
  border: none;
  color: white;
  padding: 14px 10px;
  width: 100%;
  font-size: 1rem;
  outline: none;
  font-family: inherit;
}

/* NOVO APORTE DESIGN */
.entry-form-modern { margin-top: 20px; }
.money-input-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
}
.money-input {
  background: transparent;
  border: none;
  font-size: 3rem;
  color: var(--text-main);
  width: 100%;
  text-align: center;
  font-weight: 700;
  outline: none;
  border-bottom: 1px solid transparent;
  font-family: var(--font-family);
  transition: border-color 0.3s;
}
.money-input:focus { border-bottom-color: var(--primary); }
.money-input::placeholder { color: rgba(255,255,255,0.1); }

/* BOTTOM NAV FIX & FAB */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: rgba(10, 12, 18, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: 20px;
  z-index: 100;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  width: 60px;
}
.nav-item i { font-size: 1.5rem; margin-bottom: 2px; }
.nav-item.active { color: var(--primary); }

.nav-fab-wrapper { position: relative; top: -25px; }

.nav-fab {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: 4px solid var(--bg-dark);
  color: white;
  font-size: 2rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
  transition: transform 0.2s;
}
.nav-fab:active { transform: scale(0.9); }

/* ONBOARDING MODAL */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: #05060a;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.onboarding-card { width: 100%; max-width: 400px; text-align: center; }
.step { display: none; animation: slideIn 0.4s ease; }
.step.active { display: block; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.step-icon { font-size: 3rem; margin-bottom: 16px; }
.step h2 { margin: 0 0 8px; font-size: 1.5rem; }
.step p { color: var(--text-muted); margin-bottom: 24px; }

/* UTILS */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.hidden { display: none !important; }
.hidden-panel { display: none; animation: slideDown 0.3s; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.text-btn { background: none; border: none; color: var(--text-muted); margin-top: 16px; width: 100%; cursor: pointer; text-decoration: underline; }

/* AUTH MODAL */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}
.auth-card { width: 100%; max-width: 360px; background: #0f1218; }
.auth-header { text-align: center; margin-bottom: 30px; }
.auth-header h2 { font-size: 1.8rem; margin: 0; background: linear-gradient(to right, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Header Buttons */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  margin-top: 24px;
}

.add-btn-mini {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.add-btn-mini:active {
  transform: scale(0.92);
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
}

.pulse-opacity { animation: pulse-op 1.5s infinite; pointer-events: none; opacity: 0.7; }
@keyframes pulse-op { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

/* DELETE & TOAST STYLES */
.delete-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 10px;
}
.delete-btn:hover { background: #ef4444; color: white; }

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 12px 24px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  z-index: 9999;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast-success { border-color: var(--success); color: var(--success); }
.toast-error { border-color: var(--danger); color: var(--danger); }

/* CUSTOM MODAL STYLES */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-card { width: 100%; max-width: 320px; text-align: center; }
.modal-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  font-size: 2rem;
}
.modal-icon.warning { color: var(--danger); background: rgba(239, 68, 68, 0.1); }
.modal-actions { display: flex; gap: 12px; margin-top: 24px; }
.btn-secondary {
  flex: 1;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}
.btn-danger {
  flex: 1;
  background: var(--danger);
  border: none;
  color: white;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}


/* PRIVACY MODE */
body.privacy-active .money-value,
body.privacy-active .money-mask,
body.privacy-active #totalBalance, 
body.privacy-active .item-value {
  filter: blur(10px);
  cursor: default;
  user-select: none;
  transition: filter 0.2s ease;
}

body.privacy-active .money-value:hover,
body.privacy-active #totalBalance:hover {
  filter: blur(0); /* Espiar ao passar o mouse */
}

/* MONTH SELECTOR (NAV TEMPORAL) */
.month-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
  background: rgba(255,255,255,0.03);
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}

.month-selector button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.month-selector button:hover {
  background: rgba(255,255,255,0.1);
  color: var(--primary);
}

.month-selector span {
  font-weight: 700;
  font-size: 1rem;
  width: 140px;
  text-align: center;
}
