:root {
  --bg-global: #0b1220;
  --bg-panel: rgba(13, 22, 39, 0.86);
  --bg-card: rgba(17, 28, 48, 0.94);
  --bg-soft: rgba(255, 255, 255, 0.06);
  --text-primary: #f4f7ff;
  --text-secondary: #8da0c8;
  --accent-color: #6c7cff;
  --accent-primary: #6c7cff;
  --accent-vick: #ff7fb3;
  --accent-success: #24c38b;
  --accent-danger: #ff6b6b;
  --accent-warning: #ffb454;
  --accent-info: #2196f3;
  --accent-gradient: linear-gradient(135deg, #6c7cff, #24c38b);
  --button-bg: rgba(255, 255, 255, 0.06);
  --border-color: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 10px 28px rgba(4, 10, 24, 0.24);
  --shadow-lg: 0 24px 60px rgba(4, 10, 24, 0.32);
  --border-radius-xl: 28px;
  --border-radius-lg: 22px;
  --border-radius-md: 16px;
  --font-display: 'Fraunces', serif;
}

body.light-theme {
  --bg-global: #f4f6fb;
  --bg-panel: rgba(255, 255, 255, 0.9);
  --bg-card: #ffffff;
  --bg-soft: rgba(15, 24, 40, 0.05);
  --text-primary: #19233b;
  --text-secondary: #64708a;
  --accent-color: #4f6cf5;
  --accent-primary: #4f6cf5;
  --accent-vick: #d95f8d;
  --accent-success: #2da778;
  --accent-danger: #d65353;
  --accent-warning: #d98c1f;
  --accent-info: #1976d2;
  --button-bg: rgba(15, 24, 40, 0.06);
  --border-color: rgba(15, 24, 40, 0.1);
  --shadow-sm: 0 10px 22px rgba(15, 24, 40, 0.08);
  --shadow-lg: 0 24px 45px rgba(15, 24, 40, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(143, 124, 255, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(78, 203, 159, 0.08) 0%, transparent 35%),
    linear-gradient(180deg, #0a0e27 0%, #101830 40%, var(--bg-global) 100%);
  color: var(--text-primary);
  transition: background 0.5s ease, color 0.3s ease;
  padding-bottom: 60px;
}

body.light-theme {
  background:
    radial-gradient(circle at 20% 0%, rgba(135, 206, 235, 0.3) 0%, transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(255, 200, 100, 0.15) 0%, transparent 35%),
    linear-gradient(180deg, #87CEEB 0%, #B0E0E6 30%, #f5f0e8 70%, #faf6f0 100%);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.background-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
}

.glow-one {
  width: 260px;
  height: 260px;
  background: var(--accent-color);
  top: -80px;
  right: -40px;
}

.glow-two {
  width: 240px;
  height: 240px;
  background: var(--accent-success);
  bottom: 80px;
  left: -80px;
}

.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 72px 1fr;
}

.sidebar {
  background: rgba(7, 17, 31, 0.5);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 28px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, background 0.3s ease;
  width: 72px;
  overflow: hidden;
  position: relative;
  z-index: 10;
}

.sidebar.sidebar-mobile-open {
  width: 280px;
  padding: 20px 16px;
  z-index: 100;
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(143, 124, 255, 0.04) 0%, rgba(78, 203, 159, 0.02) 100%);
  pointer-events: none;
}

.sidebar:hover {
  width: 240px;
  background: rgba(7, 17, 31, 0.82);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

body.light-theme .sidebar {
  background: rgba(255, 255, 255, 0.6);
  border-right-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .sidebar:hover {
  background: rgba(255, 255, 255, 0.88);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex: 1;
}

.sidebar-header {
  padding: 0 4px;
}

.profile-stack {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-success));
  color: white;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255,255,255,0.2);
}

.brand-text {
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.25s ease 0.05s, transform 0.25s ease 0.05s;
  pointer-events: none;
}

.sidebar:hover .brand-text {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.brand-text .eyebrow {
  margin: 0;
}

.brand-name {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand span {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: 0.2s ease;
  overflow: hidden;
}

.nav-link i {
  width: 20px;
  min-width: 20px;
  text-align: center;
  font-size: 1.05rem;
}

.nav-link .nav-label {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.sidebar:hover .nav-link .nav-label {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  transition-delay: 0.05s;
}

.sidebar:hover .nav-link {
  padding: 12px 14px;
}

.nav-link.active {
  background: rgba(143, 124, 255, 0.16);
  color: var(--accent-color);
}

.nav-link:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  transform: translateX(2px);
}

body.light-theme .nav-link:hover:not(.active) {
  background: rgba(0, 0, 0, 0.04);
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
  color: var(--accent-danger);
  background: rgba(255, 107, 107, 0.12);
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-logout:hover {
  transform: translateY(-1px);
  background: var(--accent-danger);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 8px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  overflow: hidden;
}
.sidebar:hover .sidebar-footer {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0.1s;
}
.kofi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,107,107,0.18), rgba(255,107,107,0.08));
  color: #FF6B6B;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(255,107,107,0.2);
}
.kofi-btn:hover {
  background: #FF6B6B;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,107,107,0.3);
}
.kofi-btn i { font-size: 13px; }
.sidebar-credit {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  text-align: center;
  line-height: 1.4;
  letter-spacing: 0.01em;
}
.sidebar-credit strong {
  color: rgba(255,255,255,0.5);
  font-weight: 600;
}
.sidebar-credit .fa-heart {
  animation: heartbeat 1.5s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.light-theme .sidebar-footer {
  border-top-color: rgba(0,0,0,0.06);
}
.light-theme .kofi-btn {
  background: rgba(255,107,107,0.08);
  border-color: rgba(255,107,107,0.15);
}
.light-theme .kofi-btn:hover {
  background: #FF6B6B;
  color: #fff;
}
.light-theme .sidebar-credit {
  color: rgba(0,0,0,0.3);
}
.light-theme .sidebar-credit strong {
  color: rgba(0,0,0,0.5);
}

.sidebar-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.sidebar-social a {
  color: rgba(255,255,255,0.4);
  font-size: 15px;
  transition: color 0.2s, transform 0.2s;
}
.sidebar-social a:hover {
  color: var(--accent-color);
  transform: translateY(-1px);
}
.light-theme .sidebar-social a {
  color: rgba(0,0,0,0.35);
}
.light-theme .sidebar-social a:hover {
  color: var(--accent-color);
}

.sidebar-thanks {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  text-align: center;
  line-height: 1.3;
}
.light-theme .sidebar-thanks {
  color: rgba(0,0,0,0.3);
}

.sidebar-version {
  font-size: 10px;
  color: rgba(255,255,255,0.2);
  text-align: center;
  font-family: monospace;
}
.light-theme .sidebar-version {
  color: rgba(0,0,0,0.2);
}

.sidebar-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sidebar-legal a {
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  transition: color 0.2s;
}
.sidebar-legal a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}
.sidebar-legal-sep {
  font-size: 9px;
  color: rgba(255,255,255,0.15);
}
.light-theme .sidebar-legal a {
  color: rgba(0,0,0,0.3);
}
.light-theme .sidebar-legal-sep {
  color: rgba(0,0,0,0.15);
}

.main-content {
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 0;
  padding: 12px 16px;
  position: relative;
  overflow: hidden;
  transition: background 0.5s ease;
  background: transparent;
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.greeting-topbar h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

.greeting-user-topbar {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

/* === NUBANK-STYLE: DASH TOP ROW (KPIs + atalhos) === */
.dash-top-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.dash-kpi-grid {
  display: flex;
  gap: 12px;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 150px;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.kpi-receitas .kpi-icon {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.kpi-despesas .kpi-icon {
  background: rgba(255, 107, 107, 0.15);
  color: #ff6b6b;
}

.kpi-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 0.95rem;
  font-weight: 700;
  display: block;
}

.kpi-value.positive { color: #2ecc71; }
.kpi-value.negative { color: #ff6b6b; }

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-primary);
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: block;
  }
  
  .user-avatar-header {
    display: none;
  }
}

.users-badge {
  background: var(--button-bg);
  border: 1px solid var(--border-color);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.theme-toggle,
.topbar-logout {
  border: 1px solid var(--border-color);
  background: var(--button-bg);
  min-height: 42px;
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-logout {
  padding: 0 12px;
  color: var(--accent-danger);
}

.theme-toggle {
  width: 42px;
  font-size: 1rem;
}

/* === THEME PILL (topbar) — Visual Sky/Moon === */
.theme-pill {
  position: relative;
  width: 170px;
  height: 52px;
  border-radius: 26px;
  cursor: pointer;
  overflow: hidden;
  border: none;
  outline: none;
  transition: box-shadow 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.theme-pill:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-color);
}
.theme-pill-bg {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  overflow: hidden;
  transition: background 0.5s ease;
}
.theme-pill[data-theme="light"] .theme-pill-bg {
  background: linear-gradient(135deg, #7ec8e3 0%, #a8d8ea 40%, #c9e8f5 100%);
}
.theme-pill[data-theme="dark"] .theme-pill-bg {
  background: linear-gradient(135deg, #0a0e27 0%, #141852 50%, #0d1137 100%);
}
.theme-pill-stars {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.theme-pill[data-theme="dark"] .theme-pill-stars { opacity: 1; }
.theme-pill-stars::before,
.theme-pill-stars::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow:
    12px 8px 0 0 rgba(255,255,255,0.6),
    28px 14px 0 0 rgba(255,255,255,0.4),
    45px 6px 0 0 rgba(255,255,255,0.7),
    60px 20px 0 0 rgba(255,255,255,0.3),
    80px 10px 0 0 rgba(255,255,255,0.5),
    100px 22px 0 0 rgba(255,255,255,0.4),
    120px 8px 0 0 rgba(255,255,255,0.6),
    140px 18px 0 0 rgba(255,255,255,0.3),
    18px 24px 0 0 rgba(255,255,255,0.5),
    55px 30px 0 0 rgba(255,255,255,0.4),
    90px 28px 0 0 rgba(255,255,255,0.6),
    130px 26px 0 0 rgba(255,255,255,0.3);
}
.theme-pill-stars::after {
  box-shadow:
    8px 18px 0 0 rgba(255,255,255,0.3),
    35px 4px 0 0 rgba(255,255,255,0.5),
    72px 26px 0 0 rgba(255,255,255,0.4),
    105px 6px 0 0 rgba(255,255,255,0.6),
    148px 14px 0 0 rgba(255,255,255,0.3);
}
.theme-pill-clouds {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.theme-pill[data-theme="light"] .theme-pill-clouds { opacity: 1; }
.cloud {
  position: absolute;
  background: rgba(255,255,255,0.85);
  border-radius: 50px;
}
.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud-1 { width: 32px; height: 10px; top: 12px; left: 10px; }
.cloud-1::before { width: 14px; height: 14px; top: -8px; left: 6px; }
.cloud-1::after { width: 10px; height: 10px; top: -5px; left: 17px; }
.cloud-2 { width: 24px; height: 8px; top: 28px; left: 22px; }
.cloud-2::before { width: 10px; height: 10px; top: -6px; left: 4px; }
.cloud-2::after { width: 8px; height: 8px; top: -4px; left: 12px; }
.cloud-3 { width: 20px; height: 7px; top: 18px; left: 50px; opacity: 0.7; }
.cloud-3::before { width: 8px; height: 8px; top: -5px; left: 3px; }
.cloud-3::after { width: 6px; height: 6px; top: -3px; left: 9px; }
.theme-pill-disc {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  z-index: 3;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.4s ease,
              box-shadow 0.4s ease;
  pointer-events: none;
}
.theme-pill[data-theme="light"] .theme-pill-disc {
  transform: translateX(118px);
  background: radial-gradient(circle at 40% 40%, #fff9e6, #ffe066, #ffb347);
  box-shadow: 0 0 16px rgba(255,200,50,0.5), 0 0 32px rgba(255,170,50,0.2);
}
.theme-pill[data-theme="dark"] .theme-pill-disc {
  transform: translateX(0);
  background: radial-gradient(circle at 35% 35%, #e8e8e8, #c0c0c0, #a0a0a0);
  box-shadow: inset -4px -2px 4px rgba(0,0,0,0.15), 0 0 12px rgba(200,200,220,0.3);
}
.theme-pill-disc::before {
  content: '';
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  top: 12px; left: 14px;
}
.theme-pill-disc::after {
  content: '';
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  top: 24px; left: 22px;
}
.theme-pill-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  z-index: 2;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.theme-pill-label-day {
  right: 14px;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.theme-pill[data-theme="light"] .theme-pill-label-day { opacity: 1; }
.theme-pill[data-theme="dark"] .theme-pill-label-day { opacity: 0; }
.theme-pill-label-night {
  left: 14px;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.theme-pill[data-theme="dark"] .theme-pill-label-night { opacity: 1; }
.theme-pill[data-theme="light"] .theme-pill-label-night { opacity: 0; }

/* Compact theme-pill for topbar */
.theme-pill-sm {
  width: 52px;
  height: 28px;
  border-radius: 14px;
  flex-shrink: 0;
}
.theme-pill-sm .theme-pill-disc {
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
}
.theme-pill-sm[data-theme="light"] .theme-pill-disc {
  transform: translateX(24px);
}
.theme-pill-sm .theme-pill-stars {
  transform: scale(0.35);
  transform-origin: top left;
}
.theme-pill-sm .theme-pill-clouds {
  transform: scale(0.35);
  transform-origin: top left;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .theme-pill { width: 150px; height: 46px; }
  .theme-pill-disc { width: 38px; height: 38px; }
  .theme-pill[data-theme="light"] .theme-pill-disc { transform: translateX(104px); }
}
@media (prefers-reduced-motion: reduce) {
  .theme-pill-disc,
  .theme-pill-stars,
  .theme-pill-clouds,
  .theme-pill-bg { transition-duration: 0.01ms; }
}

.hero-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  margin-bottom: 0;
}

.hero-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.5rem);
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero-text {
  color: var(--text-secondary);
  max-width: 620px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-chips span {
  background: var(--bg-soft);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
}

.hero-balance-card {
  background: linear-gradient(135deg, rgba(143, 124, 255, 0.2), rgba(78, 203, 159, 0.2));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.hero-balance-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.hero-balance-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}

.hero-balance-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 14px;
}

.dashboard-grid > * {
  min-width: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 0;
}

.panel,
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.panel:hover,
.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-header.compact {
  margin-bottom: 10px;
}

.panel-header h3 {
  font-size: 1.05rem;
}

.status-pill {
  background: rgba(78, 203, 159, 0.14);
  color: var(--accent-success);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.card {
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent-color), var(--accent-success));
}

.card.success::before { background: linear-gradient(180deg, var(--accent-success), #7ae7c6); }
.card.danger::before { background: linear-gradient(180deg, var(--accent-danger), #ffa18e); }

.card-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 8px;
}

.card-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.card-caption {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  background: var(--button-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  padding: 13px 14px;
  font-size: 0.95rem;
}

.form-control:focus {
  border-color: var(--accent-color);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2392a1b7' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.btn-submit {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-success));
  box-shadow: var(--shadow-sm);
}

.btn-submit:hover {
  transform: translateY(-1px);
}

.insights-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-inline {
  padding: 20px;
}

.info-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.info-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.info-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-list strong {
  color: var(--text-primary);
}

.info-list .positive {
  color: var(--accent-success);
}

.panel-text {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.danger-panel {
  background: linear-gradient(145deg, rgba(255, 107, 107, 0.16), rgba(15, 24, 40, 0.95));
}

.middle-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.emergencia-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.progress-bar-bg {
  background: var(--button-bg);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-success));
  transition: width 1s ease-out;
}

.meta-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.invest-value {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.invest-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.invest-sub span {
  color: var(--accent-success);
  font-weight: 700;
}

.mini-chart {
  width: 100%;
  height: 40px;
}

.donut-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.donut-chart {
  width: 110px;
  height: 110px;
  transform: rotate(-90deg);
}

.donut-chart circle {
  fill: none;
  stroke-width: 4.5;
}

.donut-bg {
  stroke: var(--button-bg);
}

.donut-segment {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-out;
}

.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-center-text .pago {
  font-size: 0.6rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
  display: block;
}

.donut-center-text .valor {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-warning);
}

.donut-info {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 12px;
  text-align: center;
}

.movimentacoes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mov-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 8px;
}

.mov-item:last-child {
  border: none;
  padding-bottom: 0;
}

.mov-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mov-date {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.mov-title {
  font-weight: 600;
}

.mov-value {
  font-weight: 700;
}

.mov-value.positive {
  color: var(--accent-success);
}

.mov-value.negative {
  color: var(--accent-warning);
}

.bar-chart-container {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 100px;
  padding-top: 12px;
}

.bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 60px;
}

.bar-wrapper {
  background-color: var(--button-bg);
  width: 45px;
  height: 72px;
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  border-radius: 8px;
  transition: height 1s ease-in-out;
}

.bar-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.patrimonio-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.patrimonio-actions .btn-submit,
.patrimonio-actions .btn-secondary {
  width: auto;
  padding: 12px 24px;
}

.btn-secondary {
  width: 100%;
  border: 1px solid var(--border-color);
  background: var(--button-bg);
  color: var(--text-primary);
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--bg-soft);
  border-color: var(--accent-color);
}

.panel-top {
  margin-top: 20px;
}

.import-log {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  white-space: pre-line;
}

.history-controls {
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--button-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.filter-btn.active {
  background: var(--accent-color);
  color: white;
}

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

.transaction-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--button-bg);
  border: 1px solid var(--border-color);
}

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

.t-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.t-icon.entrada {
  background: rgba(78, 203, 159, 0.14);
  color: var(--accent-success);
}

.t-icon.saida {
  background: rgba(255, 107, 107, 0.14);
  color: var(--accent-danger);
}

.t-details h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.t-details p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.t-user-tag {
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  margin-left: 8px;
}

.t-amount {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.btn-delete {
  background: transparent;
  border: none;
  color: var(--accent-danger);
  cursor: pointer;
  font-size: 1rem;
}

.chart-panel {
  min-height: 100%;
}

.category-row {
  margin-bottom: 14px;
}

.category-info {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 7px;
}

.category-bar-bg {
  height: 8px;
  background: var(--button-bg);
  border-radius: 999px;
  overflow: hidden;
}

.category-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-success));
  border-radius: 999px;
}

/* Category bars collapse/expand */
.category-bars-collapsed .category-row:nth-child(n+4) {
  display: none;
}

.category-bars-expanded .category-row {
  display: block;
}

.category-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  background: transparent;
  color: var(--accent-color);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.category-toggle-btn:hover {
  background: rgba(143, 124, 255, 0.08);
}

.category-toggle-btn i {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
}

.category-bars-expanded .category-toggle-btn i {
  transform: rotate(180deg);
}

/* ============================================================
   LIMITES DE GASTOS POR CATEGORIA
   ============================================================ */
.limites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.limite-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--button-bg);
  border: 1px solid var(--border-color);
  transition: border-color 0.2s ease;
}

.limite-item:hover {
  border-color: var(--accent-color);
}

.limite-cat-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limite-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 130px;
}

.limite-input-wrap span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.limite-input {
  width: 80px;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  outline: none;
  font-family: var(--font-display);
}

.limite-pct {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  min-width: 42px;
  text-align: center;
}

.limite-pct.ok {
  background: rgba(76, 175, 80, 0.12);
  color: var(--accent-success);
}

.limite-pct.warn {
  background: rgba(255, 193, 7, 0.12);
  color: var(--accent-warning);
}

.limite-pct.over {
  background: rgba(244, 67, 54, 0.12);
  color: var(--accent-danger);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.invest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.progress-container {
  margin-top: 12px;
}

.progress-bar-bg {
  background: var(--button-bg);
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-success));
}

.progress-info {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

@media (max-width: 960px) {
  .app-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100% !important;
    flex-direction: row;
    border-right: 0;
    border-top: 1px solid var(--border-color);
    padding: 8px 12px;
    z-index: 100;
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
  }

  .sidebar::before { display: none; }

  .sidebar:hover {
    width: 100% !important;
    background: rgba(7, 17, 31, 0.9);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
  }

  body.light-theme .sidebar:hover {
    background: rgba(255, 255, 255, 0.95);
  }

  .sidebar-top {
    flex-direction: row;
    gap: 0;
    width: 100%;
    justify-content: space-around;
    align-items: center;
  }

  .sidebar-header { display: none; }

  .brand-text { display: none !important; }

  .nav-menu {
    flex-direction: row;
    gap: 4px;
    width: 100%;
    justify-content: space-around;
  }

  .nav-link {
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    min-height: 48px;
    font-size: 0.7rem;
    border-radius: 10px;
  }

  .nav-link i { font-size: 1.1rem; }

  .nav-link .nav-label {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    font-size: 0.68rem;
  }

  .main-content {
    padding-bottom: 80px;
  }

  .hero-card,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  .middle-grid {
    grid-template-columns: 1fr;
  }

  .bar-chart-container {
    flex-wrap: wrap;
    height: auto;
    justify-content: center;
    gap: 20px;
    padding-bottom: 20px;
  }

  .bar-group {
    width: 80px;
  }
}

@media (max-width: 640px) {
  .app-shell,
  .auth-shell {
    padding: 0;
  }

  .main-content {
    padding: 18px 14px 32px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
  }

  .hero-card,
  .panel,
  .card {
    padding: 18px;
  }

  .hero-balance-meta {
    flex-direction: column;
  }

  .transaction-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .t-amount {
    width: 100%;
    justify-content: space-between;
  }
}

/* ============================================================
   LOGIN / AUTH ESTILOS
   ============================================================ */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top left, rgba(143, 124, 255, 0.2), transparent 24%),
    linear-gradient(140deg, var(--bg-global), color-mix(in srgb, var(--bg-global) 70%, #0d1424 30%) 100%);
}
body.light-theme .auth-shell {
  background: radial-gradient(circle at top left, rgba(79, 108, 245, 0.16), transparent 24%),
    linear-gradient(140deg, var(--bg-global), #f1e8dc 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-success));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.4rem;
  color: white;
  box-shadow: var(--shadow-sm);
}
.brand-block h1 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }
.eyebrow {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 2px;
}

.auth-copy {
  margin-bottom: 24px;
}
.auth-copy h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.auth-copy p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }

.auth-message, .auth-msg {
  display: none;
  font-size: 0.85rem;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  line-height: 1.4;
}
.auth-message.info, .auth-msg.info { background: rgba(108, 124, 255, 0.15); color: var(--accent-color); }
.auth-message.error, .auth-msg.error { background: rgba(255, 107, 107, 0.15); color: var(--accent-danger); }
.auth-message.success, .auth-msg.success { background: rgba(36, 195, 139, 0.15); color: var(--accent-success); }

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form .form-group { margin-bottom: 0; }
.auth-form .form-control { width: 100%; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }

.btn-secondary {
  width: 100%;
  border: 1px solid var(--border-color);
  background: var(--button-bg);
  color: var(--text-primary);
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--bg-soft); border-color: var(--accent-color); }
.btn-secondary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--border-color);
  background: var(--button-bg);
  color: var(--text-primary);
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 0.95rem;
}
.btn-google:hover { background: var(--bg-soft); border-color: var(--accent-color); }

.auth-note {
  margin-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.brand-text { display: flex; flex-direction: column; }
.brand-text span { font-weight: 800; font-size: 1.05rem; }

/* ============================================================
   STATUS CHIP (Online / Offline / Local)
   ============================================================ */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-chip.online { color: var(--accent-success); }
.status-chip.offline { color: var(--accent-warning); }
.status-chip.local { color: var(--text-secondary); }

/* ============================================================
   DASHBOARD ORGANIZZE-STYLE
   ============================================================ */

/* --- Header do Dashboard --- */
.dash-header {
  display: none;
}

.dash-greeting {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.greeting-text h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

.greeting-user {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-top: 1px;
}

.greeting-emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.dash-month-summary {
  display: none;
}

.month-receitas,
.month-despesas {
  display: none;
}

.month-label {
  display: none;
}

.month-value {
  display: none;
}

.month-value.positive { color: var(--accent-success); }
.month-value.negative { color: var(--accent-danger); }

.month-chart-icon {
  opacity: 0.5;
}

.dash-quick-access h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.quick-buttons {
  display: flex;
  gap: 10px;
}

.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--button-bg);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 70px;
  font-family: inherit;
}

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

.quick-btn i {
  font-size: 1.3rem;
}

.quick-btn span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quick-despesa i { color: var(--accent-danger); }
.quick-receita i { color: var(--accent-success); }
.quick-fixo i { color: var(--accent-primary); }
.quick-relatorio i { color: var(--accent-warning); }

/* --- Saldo Geral + Faturas --- */
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.dash-two-col > * {
  min-width: 0;
}

.dash-saldo-panel,
.dash-faturas-panel {
  position: relative;
}

.saldo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.saldo-header::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--accent-color), var(--accent-success));
  border-radius: 2px;
}

.saldo-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ============================================================
   COMPARATIVO MENSAL + ANUAL
   ============================================================ */
.comparativo-panel {
  margin-bottom: 0;
}

.comparativo-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  margin-bottom: 0;
}

.comp-card {
  background: var(--button-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
}

.comp-card-variation {
  background: rgba(108, 124, 255, 0.06);
  border-color: rgba(108, 124, 255, 0.2);
  min-width: 160px;
}

.comp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.comp-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.comp-card-header i {
  color: var(--accent-color);
  font-size: 0.9rem;
}

.comp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}

.comp-row-total {
  border-top: 1px solid var(--border-color);
  margin-top: 6px;
  padding-top: 8px;
}

.comp-row-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.comp-row-value {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
}

.comp-row-value.positive {
  color: var(--accent-success);
}

.comp-row-value.negative {
  color: var(--accent-danger);
}

.comp-row-delta {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
}

.comp-row-delta.up {
  color: var(--accent-danger);
}

.comp-row-delta.down {
  color: var(--accent-success);
}

.comp-row-delta.neutral {
  color: var(--text-secondary);
}

/* --- Visão Anual --- */
.annual-section {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.annual-header {
  margin-bottom: 14px;
}

.annual-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding: 0 4px;
}

.annual-month {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
  justify-content: flex-end;
}

.annual-bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  width: 100%;
  height: calc(100% - 22px);
}

.annual-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.6s ease;
}

.annual-bar.income {
  background: linear-gradient(180deg, var(--accent-success), rgba(36, 195, 139, 0.5));
}

.annual-bar.expense {
  background: linear-gradient(180deg, var(--accent-danger), rgba(255, 107, 107, 0.5));
}

.annual-month-label {
  font-size: 0.6rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.annual-month.current .annual-month-label {
  color: var(--accent-color);
  font-weight: 800;
}

.annual-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 10px;
}

.annual-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.annual-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.annual-dot.income {
  background: var(--accent-success);
}

.annual-dot.expense {
  background: var(--accent-danger);
}

@media (max-width: 768px) {
  .comparativo-grid {
    grid-template-columns: 1fr;
  }
  .comp-card-variation {
    min-width: 0;
  }
}

/* ============================================================
   GLOBAL EYE BUTTON — Ocultar/mostrar todos os valores
   ============================================================ */
.global-eye-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-panel);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  margin-left: 8px;
}

.global-eye-btn:hover {
  background: rgba(143, 124, 255, 0.15);
  color: var(--accent-color);
  border-color: var(--accent-color);
}

body.values-hidden .global-eye-btn {
  color: var(--accent-danger);
}

/* Quando valores estão ocultos */
body.values-hidden .mask-value,
body.values-hidden .month-value,
body.values-hidden .saldo-valor,
body.values-hidden .td-preco,
body.values-hidden .card-value,
body.values-hidden .card-value-lg,
body.values-hidden .dash-card-value-lg,
body.values-hidden .patrimonio-card-value,
body.values-hidden .invest-total,
body.values-hidden .faturas-valor,
body.values-hidden .category-info span:last-child,
body.values-hidden #emergencia-atual,
body.values-hidden #emergencia-meta,
body.values-hidden .progress-info span,
body.values-hidden .t-amount,
body.values-hidden .gasto-valor,
body.values-hidden .comp-row-value,
body.values-hidden .comp-row-delta,
body.values-hidden .hero-saldo-valor,
body.values-hidden .hero-meta-item span:first-of-type {
  color: transparent !important;
  text-shadow: none;
  position: relative;
  display: inline-block;
}

body.values-hidden .mask-value::after,
body.values-hidden .month-value::after,
body.values-hidden .saldo-valor::after,
body.values-hidden .td-preco::after,
body.values-hidden .card-value::after,
body.values-hidden .card-value-lg::after,
body.values-hidden .dash-card-value-lg::after,
body.values-hidden .patrimonio-card-value::after,
body.values-hidden .invest-total::after,
body.values-hidden .faturas-valor::after,
body.values-hidden .category-info span:last-child::after,
body.values-hidden #emergencia-atual::after,
body.values-hidden #emergencia-meta::after,
body.values-hidden .progress-info span::after,
body.values-hidden .t-amount::after,
body.values-hidden .gasto-valor::after,
body.values-hidden .comp-row-value::after,
body.values-hidden .comp-row-delta::after,
body.values-hidden .hero-saldo-valor::after,
body.values-hidden .hero-meta-item span:first-of-type::after {
  content: '••••••';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--text-secondary);
  font-family: monospace;
  letter-spacing: 2px;
}

body.values-hidden .category-info span:last-child::after,
body.values-hidden #emergencia-meta::after,
body.values-hidden .progress-info span::after {
  left: auto;
  right: 0;
}

.saldo-valor {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 20px;
  padding-left: 14px;
}

.faturas-valor {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-warning);
  margin-left: auto;
}

.dash-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* --- Contas --- */
.contas-list,
.cartoes-list,
.bills-list,
.maiores-gastos-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
  margin-bottom: 12px;
}

.empty-state-small {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  color: var(--text-secondary);
  text-align: center;
}

.empty-state-small i {
  font-size: 1.5rem;
  opacity: 0.4;
}

.empty-state-small p {
  font-size: 0.85rem;
}

.conta-item,
.cartao-item,
.bill-item,
.gasto-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--button-bg);
  border: 1px solid var(--border-color);
  transition: border-color 0.2s;
}

.conta-item:hover,
.cartao-item:hover,
.bill-item:hover,
.gasto-item:hover {
  border-color: var(--accent-color);
}

.conta-info,
.cartao-info,
.bill-info,
.gasto-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.conta-icon,
.cartao-icon,
.bill-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.conta-icon {
  background: linear-gradient(135deg, var(--accent-info), rgba(33, 150, 243, 0.2));
  color: var(--accent-info);
}

.cartao-icon {
  background: linear-gradient(135deg, var(--accent-warning), rgba(255, 180, 84, 0.2));
  color: var(--accent-warning);
}

.bill-icon.pagar {
  background: linear-gradient(135deg, var(--accent-danger), rgba(255, 107, 107, 0.2));
  color: var(--accent-danger);
}

.bill-icon.receber {
  background: linear-gradient(135deg, var(--accent-success), rgba(36, 195, 139, 0.2));
  color: var(--accent-success);
}

.conta-nome,
.cartao-nome,
.bill-nome {
  font-size: 0.9rem;
  font-weight: 600;
}

.bill-badge-rec {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  vertical-align: middle;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.conta-tipo,
.cartao-tipo,
.bill-venc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.conta-saldo,
.cartao-fatura,
.bill-valor {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.btn-manage {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-manage:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(108, 124, 255, 0.06);
}

.btn-delete-inline {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 0.75rem;
  opacity: 0.5;
  transition: all 0.2s;
}

.btn-delete-inline:hover {
  opacity: 1;
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.1);
}

/* --- Maiores gastos --- */
.gasto-rank {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-secondary);
  background: var(--bg-soft);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.gasto-valor {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent-danger);
}

/* --- Cartão badge --- */
.cartao-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--button-bg);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  margin-left: 8px;
}

/* --- Limite info --- */
.cartao-limite-row {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--button-bg);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.cartao-limite-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.cartao-limite-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 700;
}

.cartao-limite-valor {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-success);
}

.cartao-fatura-valor {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-warning);
}

/* --- Mini chart --- */
.mini-chart {
  width: 100%;
  height: 40px;
}

/* ============================================================
   MODAL: Novo Lançamento (Slide-up Sheet)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.modal-open,
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
  padding: 12px 28px 32px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-overlay.modal-open .modal-sheet,
.modal-overlay.active .modal-sheet {
  transform: translateY(0);
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--button-bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1rem;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--accent-danger);
  color: white;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-field label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.modal-input {
  width: 100%;
  background: var(--button-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.modal-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.modal-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.modal-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.modal-input-prefix {
  position: absolute;
  left: 16px;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.9rem;
  pointer-events: none;
}

.modal-input-currency {
  padding-left: 42px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-row .modal-field:only-child {
  grid-column: 1 / -1;
}

select.modal-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2392a1b7' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.modal-row .parcela-info {
  display: flex;
  align-items: center;
  color: var(--accent-color);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.modal-submit {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  transition: all 0.2s;
}

.modal-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.modal-submit.tipo-despesa {
  background: linear-gradient(135deg, var(--accent-danger), #ff8a65);
}

.modal-submit.tipo-receita {
  background: linear-gradient(135deg, var(--accent-success), #66bb6a);
}

/* Modal scroll */
@media (max-width: 560px) {
  .modal-sheet {
    padding: 12px 18px 28px;
    max-height: 95vh;
  }
  .modal-row {
    grid-template-columns: 1fr;
  }
  .modal-row .parcela-info {
    grid-column: 1 / -1;
  }
}

body.light-theme .modal-sheet {
  background: var(--bg-panel);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   LANÇAMENTOS — Extrato Bancário
   ============================================================ */
.lanc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 24px 28px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  margin-bottom: 20px;
}

.lanc-month-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lanc-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--button-bg);
  color: var(--text-primary);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.lanc-nav-btn:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.lanc-month-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 180px;
  text-align: center;
  color: var(--text-primary);
}

.lanc-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.lanc-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  transition: border-color 0.2s ease;
}

.lanc-stat:hover {
  border-color: var(--accent-color);
}

.lanc-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  font-weight: 700;
}

.lanc-stat-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.lanc-stat-income .lanc-stat-value {
  color: var(--accent-success);
}

.lanc-stat-expense .lanc-stat-value {
  color: var(--accent-danger);
}

.lanc-stat-balance .lanc-stat-value {
  color: var(--accent-color);
}

.lanc-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.lanc-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  transition: border-color 0.2s ease;
}

.lanc-search:focus-within {
  border-color: var(--accent-color);
}

.lanc-search i {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.lanc-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.lanc-search input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.lanc-chips {
  display: flex;
  gap: 6px;
}

.lanc-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--button-bg);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.lanc-chip:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.lanc-chip.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.lanc-cat-filter {
  position: relative;
}

.lanc-cat-dropdown {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 8px 36px 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--button-bg);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2392a1b7' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s ease;
}

.lanc-cat-dropdown:focus {
  outline: none;
  border-color: var(--accent-color);
}

.lanc-list {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  overflow: hidden;
  margin-bottom: 20px;
}

.lanc-date-group {
  padding: 0;
}

.lanc-date-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.lanc-date-header i {
  font-size: 0.7rem;
  opacity: 0.6;
}

.lanc-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}

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

.lanc-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.lanc-item-date {
  flex-shrink: 0;
  width: 48px;
  text-align: center;
}

.lanc-item-day {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.lanc-item-weekday {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.lanc-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.lanc-item-icon.entrada {
  background: rgba(36, 195, 139, 0.14);
  color: var(--accent-success);
}

.lanc-item-icon.saida {
  background: rgba(255, 107, 107, 0.14);
  color: var(--accent-danger);
}

.lanc-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lanc-item-desc {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lanc-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.lanc-item-amount {
  flex-shrink: 0;
  text-align: right;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.lanc-item-amount.entrada {
  color: var(--accent-success);
}

.lanc-item-amount.saida {
  color: var(--accent-danger);
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.cat-badge i {
  font-size: 0.6rem;
}

.lanc-quick-actions {
  display: flex;
  gap: 12px;
}

.lanc-quick-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(14px);
}

.lanc-quick-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.lanc-quick-despesa {
  border-color: rgba(255, 107, 107, 0.3);
}

.lanc-quick-despesa i {
  color: var(--accent-danger);
}

.lanc-quick-despesa:hover {
  border-color: var(--accent-danger);
  background: rgba(255, 107, 107, 0.08);
}

.lanc-quick-receita {
  border-color: rgba(36, 195, 139, 0.3);
}

.lanc-quick-receita i {
  color: var(--accent-success);
}

.lanc-quick-receita:hover {
  border-color: var(--accent-success);
  background: rgba(36, 195, 139, 0.08);
}

.lanc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 20px;
  color: var(--text-secondary);
  text-align: center;
}

.lanc-empty i {
  font-size: 2rem;
  opacity: 0.3;
}

.lanc-empty p {
  font-size: 0.9rem;
}

.lanc-total-bar {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
  font-weight: 700;
}

.lanc-total-bar span {
  color: var(--text-secondary);
}

/* Responsive - Lançamentos */
@media (max-width: 768px) {
  .lanc-summary {
    grid-template-columns: 1fr;
  }

  .lanc-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .lanc-search {
    min-width: auto;
  }

  .lanc-chips {
    justify-content: center;
  }

  .lanc-cat-filter {
    width: 100%;
  }

  .lanc-cat-dropdown {
    width: 100%;
    box-sizing: border-box;
  }

  .lanc-header {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }

  .lanc-item {
    padding: 12px 16px;
    gap: 12px;
  }

  .lanc-item-date {
    width: 40px;
  }

  .lanc-item-day {
    font-size: 1.1rem;
  }

  .lanc-item-icon {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }

  .lanc-quick-actions {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .lanc-item-weekday {
    display: none;
  }

  .lanc-item-date {
    width: auto;
    text-align: left;
  }

  .lanc-total-bar {
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
  }

  .lanc-stat-value {
    font-size: 1.15rem;
  }
}

body.values-hidden .lanc-stat-value,
body.values-hidden .lanc-item-amount {
  color: transparent !important;
  text-shadow: none;
  position: relative;
  display: inline-block;
}

body.values-hidden .lanc-stat-value::after,
body.values-hidden .lanc-item-amount::after {
  content: '••••••';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--text-secondary);
  font-family: monospace;
  letter-spacing: 2px;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  white-space: nowrap;
}

.toast-notification.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.toast-success {
  background: rgba(36, 195, 139, 0.18);
  color: var(--accent-success);
}
.toast-success .toast-icon {
  background: rgba(36, 195, 139, 0.25);
}

.toast-error {
  background: rgba(255, 107, 107, 0.18);
  color: var(--accent-danger);
}
.toast-error .toast-icon {
  background: rgba(255, 107, 107, 0.25);
}

.toast-warning {
  background: rgba(255, 180, 84, 0.18);
  color: var(--accent-warning);
}
.toast-warning .toast-icon {
  background: rgba(255, 180, 84, 0.25);
}

.toast-info {
  background: rgba(108, 124, 255, 0.18);
  color: var(--accent-color);
}
.toast-info .toast-icon {
  background: rgba(108, 124, 255, 0.25);
}

.toast-msg {
  line-height: 1.3;
}

body.light-theme .toast-notification {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   RESUMO MENSAL
   ============================================================ */
.hero-monthly-summary {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.monthly-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.monthly-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.monthly-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  background: var(--button-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.monthly-stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-weight: 700;
}

.monthly-stat-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.monthly-stat-value.positive { color: var(--accent-success); }
.monthly-stat-value.negative { color: var(--accent-danger); }

.monthly-cats h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.monthly-cat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.monthly-cat-row:last-child {
  border-bottom: none;
}

.monthly-cat-name {
  color: var(--text-primary);
  font-weight: 600;
}

.monthly-cat-value {
  color: var(--text-secondary);
  font-weight: 600;
}

.monthly-cat-value small {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ============================================================
   PATRIMÔNIO CARD (move from inline styles)
   ============================================================ */
.patrimonio-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 30px;
}

.patrimonio-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.patrimonio-card-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-success);
  text-shadow: 0 0 20px rgba(36, 195, 139, 0.3);
}

.patrimonio-card .patrimonio-input-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.patrimonio-card .patrimonio-input-row .form-control {
  width: 150px;
  background: var(--button-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.patrimonio-card .patrimonio-input-row .btn-submit {
  padding: 10px 20px;
  font-size: 0.9rem;
  width: auto;
}

/* ============================================================
   DASHBOARD INLINE CARD STYLES (from HTML inline styles)
   ============================================================ */
.dash-card-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.dash-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.dash-card-value-lg {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.dash-card-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.dash-card-sub span {
  color: var(--accent-success);
  font-weight: 700;
}

/* ============================================================
   PROGRESS BAR (refined)
   ============================================================ */
.progress-bar-bg {
  background: var(--button-bg);
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-success));
  transition: width 1s ease-out;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ============================================================
   INVEST GRID (improved responsive)
   ============================================================ */
.invest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.invest-grid-margin {
  margin-bottom: 30px;
}

.invest-grid-title {
  grid-column: 1 / -1;
  margin: 0 0 15px 0;
  color: var(--text-primary);
}

.card-value-sm {
  font-size: 1.2rem;
}

.card-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.card-gradient-success {
  background: linear-gradient(135deg, var(--accent-success) 0%, rgba(76, 175, 80, 0.1) 100%);
}

.card-gradient-info {
  background: linear-gradient(135deg, var(--accent-info) 0%, rgba(33, 150, 243, 0.1) 100%);
}

.card-value-success {
  color: var(--accent-success);
}

.card-value-info {
  color: var(--accent-info);
}

.metas-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
}

@media (max-width: 768px) {
  .metas-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   MONTH TREND BUTTON
   ============================================================ */
.month-trend-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-panel);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.month-trend-btn:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  transform: scale(1.1);
}

/* ============================================================
   INVEST TABLES
   ============================================================ */
.invest-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 4px;
}

.invest-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.invest-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.invest-table th {
  background: var(--bg-panel);
  color: var(--text-secondary);
  padding: 10px 12px;
  text-align: left;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.invest-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  white-space: nowrap;
}

.invest-table tbody tr {
  transition: background 0.15s ease;
}

.invest-table tbody tr:hover {
  background: rgba(52, 152, 219, 0.06);
}

.invest-table .td-codigo {
  font-weight: 700;
  color: var(--accent-color);
}

.invest-table .td-preco {
  font-family: var(--font-display);
  font-weight: 600;
}

.invest-table .td-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.invest-table .td-status.comprar {
  background: rgba(76, 175, 80, 0.12);
  color: var(--accent-success);
}

.invest-table .td-status.neutro {
  background: rgba(255, 193, 7, 0.12);
  color: var(--accent-warning);
}

.invest-table .td-status.evitar {
  background: rgba(244, 67, 54, 0.12);
  color: var(--accent-danger);
}

/* Portfolio Chart */
.portfolio-chart-wrap {
  display: flex;
  justify-content: center;
  padding: 12px 0;
  max-height: 220px;
}

.portfolio-chart-wrap canvas {
  max-width: 280px;
  max-height: 200px;
  width: 100%;
}

/* ============================================================
   FORM MODAL — Substitui prompt() nativo
   ============================================================ */
.form-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.form-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.form-modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.25s ease;
}

.form-modal h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.form-modal-field {
  margin-bottom: 16px;
}

.form-modal-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-modal-field input,
.form-modal-field select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-soft);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-modal-field input:focus,
.form-modal-field select:focus {
  border-color: var(--accent-color);
}

.form-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.form-modal-actions button {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.form-modal-cancel {
  background: var(--button-bg);
  color: var(--text-secondary);
}

.form-modal-cancel:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.form-modal-submit {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-success));
  color: white;
}

.form-modal-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(143, 124, 255, 0.3);
}

/* ============================================================
   USER MENU — Avatar + Dropdown no header
   ============================================================ */
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-menu-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg, rgba(255,255,255,0.05));
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.user-menu-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(143, 124, 255, 0.1);
}

.user-avatar-header {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: white;
  font-size: 1.2rem;
  flex-shrink: 0;
  position: relative;
}

.user-avatar-header::after {
  content '';
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  background: #4caf50;
  border: 3px solid var(--background-color);
  border-radius: 50%;
}

.user-avatar-header:hover {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(143, 124, 255, 0.2), 0 8px 20px rgba(0,0,0,0.15);
}

.user-avatar-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 12px 16px;
  min-width: 180px;
  max-width: 260px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2000;
  box-sizing: border-box;
}

.user-dropdown.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.user-dropdown .dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.user-dropdown .dropdown-name {
  font-weight: 500;
  font-size: 0.875rem;
}

.user-dropdown .dropdown-email {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-left: 4px;
}

.user-dropdown .divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 0;
}

.user-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: color 0.2s;
}

.user-dropdown .dropdown-item:hover {
  color: var(--accent-color);
}

.user-dropdown .dropdown-item.danger {
  color: #ff5252;
}

.user-dropdown .dropdown-item.danger:hover {
  color: #ff1744;
}

.user-dropdown .dropdown-item i {
  width: 16px;
  text-align: center;
}
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}

.dropdown-header .dropdown-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.dropdown-header .dropdown-email {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.dropdown-item.danger {
  color: var(--accent-danger);
}

.dropdown-item.danger:hover {
  background: rgba(255, 77, 77, 0.1);
}

.dropdown-item i {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
}

/* ============================================================
   PROFILE MODAL — Editar perfil
   ============================================================ */
.profile-modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.profile-avatar-upload {
  position: relative;
  width: 90px;
  height: 90px;
}

.profile-avatar-upload .avatar-preview {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: white;
  font-size: 2.2rem;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
}

.profile-avatar-upload .avatar-preview:hover {
  border-color: var(--accent-color);
}

.profile-avatar-upload .avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-upload .avatar-edit-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  border: 2px solid var(--bg-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.profile-avatar-upload .avatar-edit-btn:hover {
  transform: scale(1.1);
}

.profile-avatar-upload input[type="file"] {
  display: none;
}

.avatar-email-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.avatar-email-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(143, 124, 255, 0.06);
}

.avatar-email-btn i {
  margin-right: 4px;
}

.profile-field {
  width: 100%;
}

.profile-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-field input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-soft);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.profile-field input:focus {
  border-color: var(--accent-color);
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.profile-actions .btn-save-profile {
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-success));
  color: white;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-actions .btn-save-profile:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(143, 124, 255, 0.3);
}

.profile-actions .btn-delete-account {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--accent-danger);
  background: transparent;
  color: var(--accent-danger);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-actions .btn-delete-account:hover {
  background: rgba(255, 77, 77, 0.1);
}

/* Avatar Simple Grid */
.avatar-grid-simple {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 4px 0;
}

.avatar-opt {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  background: var(--bg-soft);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.avatar-opt:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: translateY(-2px);
}

.avatar-opt.selected {
  border-color: var(--accent-color);
  background: var(--accent-color);
  color: white;
  box-shadow: 0 2px 10px rgba(143, 124, 255, 0.35);
}

.avatar-email-btn {
  display: block;
  width: 100%;
  padding: 8px;
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.avatar-email-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(143, 124, 255, 0.06);
}

.avatar-email-btn i {
  margin-right: 4px;
}

.profile-modal-lg {
  max-width: 440px;
}

/* Categories Manager */
.cat-section {
  margin-bottom: 16px;
}

.cat-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-primary);
  transition: all 0.15s;
}

.cat-tag.default {
  opacity: 0.7;
}

.cat-tag .cat-remove {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  font-size: 0.7rem;
  line-height: 1;
  transition: color 0.15s;
}

.cat-tag .cat-remove:hover {
  color: var(--accent-danger);
}

.cat-add-row {
  display: flex;
  gap: 6px;
}

.cat-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-soft);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}

.cat-input:focus {
  border-color: var(--accent-color);
}

.cat-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--accent-color);
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-add-btn:hover {
  transform: scale(1.05);
}

.categories-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.cat-mini-tag {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-soft);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.avatar-preview-lg {
  width: 80px;
  height: 80px;
  font-size: 2rem;
}

/* ============================================================
   RECEITAS CHART — Doughnut
   ============================================================ */
.receitas-chart-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  max-height: 220px;
}

.receitas-chart-wrap canvas {
  max-width: 200px;
  max-height: 200px;
  width: 100%;
}

/* ============================================================
   DONUT SPLIT — Divisão de Gastos (anel com legenda)
   ============================================================ */
.donut-split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 8px 0;
}

.donut-split-chart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 200px;
  margin: 0 auto;
}

.donut-split-chart canvas {
  width: 100% !important;
  height: auto !important;
}

.donut-split-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-split-total-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-weight: 700;
}

.donut-split-total-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.donut-split-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--button-bg);
  border: 1px solid var(--border-color);
  transition: border-color 0.2s;
}

.donut-legend-item:hover {
  border-color: var(--accent-color);
}

.donut-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.donut-legend-info {
  flex: 1;
  min-width: 0;
}

.donut-legend-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donut-legend-meta {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.donut-legend-pct {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

.donut-legend-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .donut-split-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .donut-split-chart {
    max-width: 180px;
  }
  .donut-split-legend {
    width: 100%;
  }
}

/* ============================================================
   UPLOAD ZONE — Importação de planilhas
   ============================================================ */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}

.upload-zone:hover {
  border-color: var(--accent-color);
  background: rgba(143, 124, 255, 0.04);
}

.upload-zone.drag-over {
  border-color: var(--accent-color);
  background: rgba(143, 124, 255, 0.08);
  transform: scale(1.01);
}

.upload-zone i {
  font-size: 2rem;
  color: var(--accent-color);
  margin-bottom: 10px;
  display: block;
}

.upload-zone p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 4px 0;
}

.upload-link {
  color: var(--accent-color);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.upload-hint {
  font-size: 0.78rem !important;
  opacity: 0.6;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 12px;
}

.file-preview i {
  font-size: 1.2rem;
  color: var(--accent-success);
}

.file-preview span {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-remove {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s;
}

.file-remove:hover {
  background: rgba(255, 77, 77, 0.1);
  color: var(--accent-danger);
}

.import-log {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .metas-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   RESPONSIVO COMPLETO
   ============================================================ */

/* Tablets e telas médias */
@media (max-width: 1100px) {
  .middle-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .dash-header {
    grid-template-columns: 1fr 1fr;
  }

  .dash-quick-access {
    grid-column: 1 / -1;
  }

  .quick-buttons {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .middle-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .invest-grid {
    grid-template-columns: 1fr;
  }

  .monthly-stats {
    grid-template-columns: 1fr;
  }

  .bar-chart-container {
    flex-wrap: wrap;
    height: auto;
    justify-content: center;
    gap: 20px;
    padding-bottom: 20px;
  }

  .bar-group {
    width: 80px;
  }

  .dash-two-col {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .dash-two-col > * {
    padding: 14px;
  }

  .dash-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .dash-month-summary {
    flex-wrap: wrap;
    gap: 16px;
  }

  .quick-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .app-shell,
  .auth-shell {
    padding: 0;
  }

  .main-content {
    padding: 18px 14px 32px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
  }

  .user-dropdown {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    transform: translateX(-50%) translateY(-6px);
  }

  .user-dropdown.active {
    transform: translateX(-50%) translateY(0);
  }

  .hero-card,
  .panel,
  .card {
    padding: 18px;
  }

  .hero-balance-meta {
    flex-direction: column;
  }

  .middle-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .transaction-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .t-amount {
    width: 100%;
    justify-content: space-between;
  }

  .auth-card {
    padding: 24px 18px;
  }

  .users-badge {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .status-chip {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .invest-grid {
    grid-template-columns: 1fr;
  }

  .monthly-stats {
    grid-template-columns: 1fr;
  }

  .monthly-cat-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .monthly-cat-value {
    font-size: 0.85rem;
  }
}

@media (max-width: 420px) {
  .hero-card {
    padding: 16px;
    border-radius: var(--border-radius-lg);
  }

  .hero-copy h2 {
    font-size: 1.3rem;
  }

  .hero-balance-value {
    font-size: 1.6rem;
  }

  .card-value {
    font-size: 1.4rem;
  }

  .patrimonio-card-value {
    font-size: 2rem;
  }
}

/* ============================================================
   ONBOARDING MODAL
   ============================================================ */
.onboarding-modal {
  max-width: 680px;
  text-align: center;
  position: relative;
}

.onboarding-skip {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
  z-index: 1;
}

.onboarding-skip:hover {
  color: var(--text-primary);
  background: var(--button-bg);
}

.onboarding-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.onboarding-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 28px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.template-card {
  background: var(--button-bg);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 24px 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  font-family: inherit;
  color: var(--text-primary);
}

.template-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(108, 124, 255, 0.2);
}

.template-card.selected {
  border-color: var(--accent-color);
  background: rgba(108, 124, 255, 0.12);
}

.template-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.template-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.template-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 14px;
}

.template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.template-tags span {
  background: rgba(108, 124, 255, 0.1);
  color: var(--accent-color);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .template-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   COMPARTILHAR CONTA
   ============================================================ */
.share-invite-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.share-invite-row .form-control {
  flex: 1;
}

.share-role-select {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.share-role-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--button-bg);
  cursor: pointer;
  transition: border-color 0.2s;
}

.share-role-option:has(input:checked) {
  border-color: var(--accent-color);
  background: rgba(108, 124, 255, 0.08);
}

.share-role-option input[type="radio"] {
  accent-color: var(--accent-color);
}

.share-role-option strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.share-role-option p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0;
}

.share-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.share-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--button-bg);
  border: 1px solid var(--border-color);
}

.share-member-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-gradient);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
}

.share-member-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.share-member-email {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.share-member-role {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(108, 124, 255, 0.12);
  color: var(--accent-color);
}

.share-member-remove {
  background: none;
  border: none;
  color: var(--accent-danger);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
}

@media (max-width: 640px) {
  .share-role-select {
    flex-direction: column;
  }
  .share-invite-row {
    flex-direction: column;
  }
}

/* ============================================================
   LIGHT THEME IMPROVEMENTS
   ============================================================ */
body.light-theme .panel,
body.light-theme .card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

body.light-theme .btn-submit {
  background: linear-gradient(135deg, var(--accent-color), #3b82f6);
  box-shadow: 0 4px 14px rgba(79, 108, 245, 0.3);
}

body.light-theme .btn-submit:hover {
  box-shadow: 0 6px 20px rgba(79, 108, 245, 0.4);
}

body.light-theme .category-bar-fill {
  background: linear-gradient(90deg, var(--accent-color), #3b82f6);
}

body.light-theme .progress-bar-fill {
  background: linear-gradient(90deg, var(--accent-color), #3b82f6);
}

body.light-theme .quick-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

body.light-theme .quick-btn:hover {
  background: var(--bg-soft);
  border-color: var(--accent-color);
}

body.light-theme .dash-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

body.light-theme .profile-avatar,
body.light-theme .user-avatar-header,
body.light-theme .share-member-avatar {
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
}

body.light-theme .comp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

body.light-theme .comp-card-variation {
  background: var(--bg-soft);
}

body.light-theme .bill-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

body.light-theme .bill-item:hover {
  background: var(--bg-soft);
}

body.light-theme .lanc-list .bill-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

body.light-theme .lanc-chip {
  background: var(--button-bg);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

body.light-theme .lanc-chip.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

body.light-theme .filter-btn {
  background: var(--button-bg);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

body.light-theme .filter-btn.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

body.light-theme .template-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
}

body.light-theme .template-card:hover {
  border-color: var(--accent-color);
  background: var(--bg-soft);
}

body.light-theme .cat-list .cat-item {
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
}

body.light-theme .invest-table {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

body.light-theme .invest-table th {
  background: var(--bg-soft);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

body.light-theme .invest-table td {
  border-bottom: 1px solid var(--border-color);
}

body.light-theme .empty-state-small {
  color: var(--text-secondary);
}

body.light-theme .form-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

body.light-theme .modal-sheet {
  background: var(--bg-card);
}

body.light-theme .limites-grid .limite-row {
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
}

body.light-theme .annual-chart .bar-income {
  opacity: 0.85;
}

body.light-theme .annual-chart .bar-expense {
  opacity: 0.85;
}

body.light-theme .category-bars-collapsed .category-row:nth-child(n+4) {
  display: none;
}

body.light-theme .nav-link.active {
  background: rgba(79, 108, 245, 0.12);
}

body.light-theme .saldo-valor {
  color: var(--text-primary);
}

body.light-theme .faturas-valor {
  color: var(--accent-danger);
}

body.light-theme .bill-valor {
  font-weight: 700;
}

body.light-theme .lanc-stat-value {
  color: var(--text-primary);
}

body.light-theme .global-eye-btn {
  background: var(--button-bg);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

body.light-theme .global-eye-btn:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* ============================================================
   MOBILE OTIMIZATIONS — Consolidated fixes
   ============================================================ */

/* --- Auth/Login --- */
@media (max-width: 640px) {
  .auth-shell {
    padding: 16px;
  }
  .auth-card {
    padding: 24px 18px;
    border-radius: var(--border-radius-lg);
  }
}

/* --- Global touch targets --- */
@media (max-width: 640px) {
  .global-eye-btn {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
  .modal-close {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
  .theme-toggle {
    width: 44px;
    min-height: 44px;
  }
  .btn-delete-inline {
    padding: 8px 10px;
    min-width: 36px;
    min-height: 36px;
  }
  .file-remove {
    padding: 8px;
    min-width: 40px;
    min-height: 40px;
    display: grid;
    place-items: center;
  }
  .share-member-remove {
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
  }
  .onboarding-skip {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}

/* --- Panels & Cards --- */
@media (max-width: 640px) {
  .panel, .card {
    border-radius: var(--border-radius-md);
    padding: 16px;
  }
  .hero-card, .panel, .card {
    padding: 16px;
  }
}

/* --- Main content padding --- */
@media (max-width: 640px) {
  .main-content {
    padding: 14px 16px 90px;
  }
  body {
    padding-bottom: 0;
  }
}

/* --- Dashboard header --- */
@media (max-width: 640px) {
  .dash-header {
    padding: 18px 16px;
    border-radius: var(--border-radius-lg);
    gap: 14px;
  }
  .dash-month-summary {
    gap: 12px;
    padding: 10px 14px;
  }
  .month-value {
    font-size: 1.15rem;
  }
}

/* --- Dashboard grids --- */
@media (max-width: 640px) {
  .dashboard-grid,
  .middle-grid,
  .dash-two-col {
    gap: 14px;
  }
  .dash-two-col {
    grid-template-columns: 1fr;
  }
}

/* --- Quick buttons --- */
@media (max-width: 640px) {
  .quick-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .quick-btn {
    min-width: 0;
    padding: 14px 12px;
  }
}

/* --- Patrimonio card --- */
@media (max-width: 640px) {
  .patrimonio-card {
    padding: 20px 16px;
  }
  .patrimonio-card-value {
    font-size: 1.8rem;
  }
}

/* --- Toast notification --- */
@media (max-width: 640px) {
  .toast-notification {
    left: 16px;
    right: 16px;
    transform: translateX(0) translateY(20px);
    width: auto;
    max-width: calc(100% - 32px);
    white-space: normal;
    text-align: center;
  }
  .toast-notification.toast-visible {
    transform: translateX(0) translateY(0);
  }
}

/* --- Modal sheet mobile --- */
@media (max-width: 560px) {
  .modal-sheet {
    padding: 12px 16px 28px;
    margin: 0 8px;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  }
}

/* --- Form modal mobile --- */
@media (max-width: 420px) {
  .form-modal {
    padding: 20px 16px;
    border-radius: 16px;
  }
}

/* --- Filter buttons / chips --- */
@media (max-width: 640px) {
  .filter-btn,
  .lanc-chip {
    padding: 10px 16px;
    min-height: 40px;
    font-size: 0.82rem;
  }
  .lanc-chips {
    flex-wrap: wrap;
    justify-content: center;
  }
  .category-toggle-btn {
    padding: 12px;
    min-height: 44px;
    font-size: 0.85rem;
  }
}

/* --- Lancamentos header --- */
@media (max-width: 640px) {
  .lanc-header {
    padding: 16px;
    border-radius: var(--border-radius-lg);
  }
  .lanc-month-name {
    min-width: auto;
    font-size: 1rem;
  }
  .lanc-stat {
    padding: 14px 16px;
  }
  .lanc-item {
    padding: 12px 14px;
    gap: 10px;
  }
}

/* --- Share modal mobile --- */
@media (max-width: 640px) {
  .share-invite-row .btn-submit,
  .share-invite-row .btn-secondary {
    min-height: 48px;
  }
}

/* --- Annual chart --- */
@media (max-width: 640px) {
  .annual-chart {
    gap: 3px;
    height: 100px;
  }
  .annual-month-label {
    font-size: 0.55rem;
    letter-spacing: 0;
  }
}

/* --- Template tags --- */
@media (max-width: 640px) {
  .template-tags span {
    font-size: 0.72rem;
    padding: 5px 12px;
  }
}

/* --- Sidebar hover disable on touch --- */
@media (hover: none) and (pointer: coarse) {
  .sidebar:hover {
    width: 68px !important;
    background: var(--bg-panel);
    box-shadow: none;
  }
  body.light-theme .sidebar:hover {
    background: var(--bg-panel);
    box-shadow: none;
  }
}

/* --- User dropdown --- */
@media (max-width: 640px) {
  .user-dropdown {
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
  }
  .user-dropdown.active {
    transform: translateX(-50%) translateY(0);
  }
}

/* ============================================================
   HERO SALDO CARD (Nubank-style)
   ============================================================ */
.hero-saldo-card {
  background: linear-gradient(160deg, #FF6B6B 0%, #ee5a24 50%, #FF8E53 100%);
  border-radius: var(--border-radius-xl);
  padding: 20px 22px 18px;
  margin-bottom: 0;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(238, 90, 36, 0.3);
}
body.light-theme .hero-saldo-card {
  box-shadow: 0 8px 32px rgba(238, 90, 36, 0.2);
}
.hero-saldo-card::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-saldo-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.hero-saldo-label {
  font-size: 0.8rem;
  opacity: 0.8;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.hero-eye {
  color: #fff !important;
  opacity: 0.7;
  background: rgba(255,255,255,0.12);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity 0.2s;
}
.hero-eye:hover { opacity: 1; background: rgba(255,255,255,0.2); }
.hero-saldo-valor {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.1;
}
.hero-saldo-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}
.hero-meta-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.hero-meta-item i {
  font-size: 0.75rem;
  margin-bottom: 2px;
}
.hero-meta-income i { color: #2ecc71; }
.hero-meta-expense i { color: #e74c3c; }
.hero-meta-item span:first-of-type {
  font-size: 0.95rem;
  font-weight: 600;
}
.hero-meta-label {
  font-size: 0.7rem;
  opacity: 0.7;
  font-weight: 400;
}
.hero-meta-divider {
  width: 1px;
  background: rgba(255,255,255,0.2);
  align-self: stretch;
}
.hero-quick-actions {
  display: flex;
  gap: 10px;
}
.hero-quick-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  border-radius: var(--border-radius-lg);
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.hero-quick-btn:hover { background: rgba(255,255,255,0.34); transform: translateY(-1px); }
.hero-quick-receita {
  background: rgba(46,204,113,0.3);
  border-color: rgba(46,204,113,0.45);
}
.hero-quick-receita:hover { background: rgba(46,204,113,0.45); }

/* ============================================================
   MOBILE BOTTOM NAV (Nubank/Revolut pattern)
   ============================================================ */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-color);
  padding: 6px 0 env(safe-area-inset-bottom, 8px);
  z-index: 900;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
body.light-theme .mobile-bottom-nav {
  background: rgba(255,255,255,0.92);
}
.mbn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.mbn-item i { font-size: 1.15rem; }
.mbn-item.active { color: var(--accent-primary); }
.mbn-item.active i { color: var(--accent-primary); }

/* FAB in bottom nav */
.mbn-fab {
  position: relative;
  margin-top: -18px;
}
.mbn-fab-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), #6c5ce7);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 16px rgba(108,124,255,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.mbn-fab:active .mbn-fab-icon {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(108,124,255,0.3);
}
.mbn-fab span { display: none; }

/* Mobile FAB (standalone, desktop-hidden) */
.mobile-fab {
  display: none;
  position: fixed;
  bottom: 88px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), #6c5ce7);
  color: #fff;
  place-items: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 20px rgba(108,124,255,0.45);
  cursor: pointer;
  z-index: 800;
  transition: transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.mobile-fab:active { transform: scale(0.9); }

/* ============================================================
   MOBILE RESPONSIVE (bottom nav replaces sidebar)
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { display: none !important; }
  .mobile-bottom-nav { display: flex; }
  .mobile-fab { display: grid; }

  .main-content {
    padding-bottom: 90px;
  }

  .hero-saldo-card {
    margin-left: 0;
    margin-right: 0;
  }

  .topbar {
    padding-bottom: 0;
  }

  /* Reduce dashboard padding on mobile */
  .dash-header { gap: 12px; }
}

@media (max-width: 480px) {
  .hero-saldo-valor { font-size: 1.7rem; }
  .hero-saldo-meta { gap: 12px; }
  .hero-quick-btn { padding: 8px 0; font-size: 0.8rem; }
  .hero-saldo-card { padding: 20px 18px 16px; }
}

/* ============================================================
   TRUST BADGE (subtle security indicator)
   ============================================================ */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(46,204,113,0.08);
  border: 1px solid rgba(46,204,113,0.15);
  color: var(--accent-success);
  font-size: 0.72rem;
  font-weight: 500;
  margin-bottom: 16px;
}
.trust-badge i { font-size: 0.7rem; }
