/* ═══════════════════════════════════════════════════════════════════
   VOLTZ / iMAKE — DESIGN SYSTEM (Colors + Type Foundation)
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100;200;300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg:          #070B10;
  --surface:     #0B121A;
  --surface-2:   #131C27;
  --surface-3:   #17212C;
  --card:        rgba(255,255,255,.032);
  --card-hover:  rgba(255,255,255,.058);
  --border:      rgba(255,255,255,0.09);
  --border-hi:   rgba(29,111,165,0.35);

  --volt:         #FFFFFF;
  --volt-lite:    #DCEEF5;
  --indigo-light: #4FB3D9;
  --indigo:       #1D6FA5;
  --indigo-dark:  #0B3D5C;

  --amber:        #C08A2E;
  --emerald:      #17A673;
  --cyan:         #2FA9B8;
  --rose:         #C24B5C;
  --sky:          #4FA8C9;
  --orange:       #C1702E;

  --fg-1:         #EDF4F7;
  --fg-2:         rgba(237,244,247,0.65);
  --fg-3:         rgba(237,244,247,0.38);
  --text:         var(--fg-1);
  --text-2:       var(--fg-2);
  --text-3:       var(--fg-3);

  --success:      #17A673;
  --warning:      #C08A2E;
  --danger:       #E14360;
  --info:         #2D8FC4;
  --success-hi:   #6FD9AE;
  --warning-hi:   #E8C468;
  --danger-hi:    #F4A6AE;
  --info-hi:      #8FCBEA;

  --g-brand: linear-gradient(135deg, #4FB3D9 0%, #1D6FA5 50%, #0B3D5C 100%);
  --g-text:  linear-gradient(135deg, #BFE3F0 0%, #7FC4DE 55%, #4FB3D9 100%);

  --font-display: 'Outfit', system-ui, sans-serif;
  --font-sans:    'Outfit', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Mono', monospace;

  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-2xl: 36px;

  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: .2s;
  --dur:      .25s;
  --dur-slow: .55s;

  --nav-h: 70px;
}

/* ═══════════════════════════════════════════════════════════════════
   SURFACE PRIMITIVES
   ═══════════════════════════════════════════════════════════════════ */

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

html, body {
  height: 100%;
  height: -webkit-fill-available;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--fg-1);
  background: var(--bg);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  /* App-like feel: no long-press text selection / copy callout / tap flash */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Campos de texto continuam selecionáveis para digitar/editar normalmente */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

button { font-family: inherit; }

/* ─── Tap feedback global — todo elemento clicável reage ao toque ───────── */
button, a, select, .row, .chip, label {
  transition: transform .13s var(--ease-pop), opacity .13s var(--ease-pop);
}
button:active:not(:disabled),
a:active,
select:active,
.row:active,
.chip:active,
label:active {
  transform: scale(.96);
}
button:disabled { transform: none !important; }

/* ─── Ambient wallpaper ───────────────────────────────────────────── */
.app-root {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}

.wallpaper {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(29,111,165,.10), transparent 60%),
    var(--bg);
}
.wallpaper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.06) 0%, rgba(0,0,0,.22) 100%);
  pointer-events: none;
}

.wallpaper::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .35 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.4'/></svg>");
  opacity: .06;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ─── Viewport ────────────────────────────────────────────────────── */
.viewport {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  /* .app-root (pai direto) é position:fixed;inset:0 — já bate certinho com
     a tela real (inclusive em modo standalone/PWA instalado, onde vh/dvh/
     -webkit-fill-available têm histórico de bug no iOS e sobra espaço preto
     embaixo). 100% do pai fixo é mais confiável que recalcular por unidade
     de viewport de novo aqui. */
  height: 100%;
  max-width: 440px;
  margin: 0 auto;
  overflow: hidden;
}

/* ─── GLASS PRIMITIVE (agora superfícies sólidas, sem blur) ─────────── */
.glass {
  position: relative;
  background: var(--surface-2);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  overflow: hidden;
}
.glass.soft {
  background: var(--surface);
  border-color: rgba(255,255,255,.06);
}
.glass.heavy {
  background: var(--surface-3);
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 14px 34px rgba(0,0,0,.4);
}
.glass.indigo {
  background: #0E2536;
  border-color: rgba(79,179,217,.32);
  box-shadow: 0 14px 34px rgba(11,61,92,.3);
}

/* ─── STATUS BAR ──────────────────────────────────────────────────── */
.status-bar {
  position: relative;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px 6px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -.2px;
  height: 54px;
  flex-shrink: 0;
}
.status-bar .time { font-weight: 700; }
.status-bar .sys { display: inline-flex; gap: 6px; align-items: center; }
.status-bar svg { display: block; }

/* ─── Home indicator ──────────────────────────────────────────────── */
.home-indicator {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  z-index: 100;
  pointer-events: none;
}

/* ─── SCROLL AREA ─────────────────────────────────────────────────── */
/* Tela cheia de verdade: a área rolável ocupa 100% do viewport (sem
   reservar faixa fixa pro header/tab bar) — o respiro do topo/base vira
   padding em vez de inset, então o conteúdo rola por baixo da status bar
   e da tab bar flutuante, em vez de parar antes delas. */
.scroll-area {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px calc(env(safe-area-inset-bottom, 0px) + 100px);
}
.scroll-area::-webkit-scrollbar { display: none; }
.scroll-area { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* ─── BUTTONS ─────────────────────────────────────────────────────── */
.gbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  cursor: pointer;
  border: 1.5px solid rgba(79,179,217,.5);
  background: #16293C;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
  transition: transform .18s var(--ease), background .18s, border-color .18s;
  user-select: none;
}
.gbtn:active { transform: scale(.97); background: #1C3348; border-color: rgba(79,179,217,.7); }
.gbtn.primary {
  background: linear-gradient(135deg, #4FB3D9, #1D6FA5 50%, #0B3D5C);
  border-color: rgba(191,227,240,.4);
  box-shadow: 0 10px 26px rgba(29,111,165,.45);
}
.gbtn.primary:active { background: linear-gradient(135deg, #4FB3D9, #1D6FA5 50%, #0B3D5C); border-color: rgba(191,227,240,.4); }

/* ─── CHIP / PILL ─────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
}
.chip.up { background: rgba(79,168,201,.16); border-color: rgba(79,168,201,.35); color: #4FA8C9; }
.chip.dn { background: rgba(232,151,74,.16); border-color: rgba(232,151,74,.35); color: #E8974A; }
.chip.indigo { background: rgba(79,179,217,.18); border-color: rgba(79,179,217,.35); color: #BFE3F0; }
.chip.amber { background: rgba(192,138,46,.14); border-color: rgba(192,138,46,.3); color: #E8C468; }

/* ─── Casa: teclado numérico só aparece no web (mobile já tem o teclado do SO) ── */
.casa-desktop-only { display: none; }
.casa-confirm-btn { padding: 14px 0; font-size: 15px; }

/* ─── TAB BAR ─────────────────────────────────────────────────────── */
.tab-bar {
  position: absolute;
  left: 16px; right: 16px; bottom: 22px;
  z-index: 40;
  padding: 6px;
  border-radius: 26px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 14px 36px rgba(0,0,0,.4);
}
.tab-bar .tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  transition: color .2s, background .3s var(--ease);
  border: none;
  background: transparent;
  position: relative;
}
.tab-bar .tab svg { width: 22px; height: 22px; }
.tab-bar .tab.active {
  color: #fff;
  background: linear-gradient(145deg, rgba(79,179,217,.35), rgba(29,111,165,.18));
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 20px rgba(29,111,165,.35);
}
.tab-bar .tab.fab-slot { color: #fff; }
.tab-bar .tab.fab-slot .fab {
  width: 46px; height: 46px; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #4FB3D9, #1D6FA5 60%, #0B3D5C);
  box-shadow:
    0 1px 0 rgba(255,255,255,.35) inset,
    0 10px 26px rgba(29,111,165,.6),
    0 0 36px rgba(79,179,217,.45);
  margin-bottom: 2px;
}
.tab-bar .tab.fab-slot .fab svg { width: 24px; height: 24px; color: #fff; }

/* ─── MODAL SHEET ─────────────────────────────────────────────────── */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(0,0,0,.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute;
  left: 8px; right: 8px; bottom: 8px;
  z-index: 61;
  max-height: 86%;
  border-radius: 32px;
  padding: 10px 20px 28px;
  transform: translateY(110%);
  transition: transform .42s var(--ease-pop);
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 -24px 60px rgba(0,0,0,.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sheet.open { transform: translateY(0); }

/* Variante que entra do topo pra baixo (ex: novo lançamento) */
.sheet.from-top {
  top: 8px; bottom: auto;
  border-radius: 32px;
  transform: translateY(-110%);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.sheet.from-top.open { transform: translateY(0); }

.sheet .grabber {
  width: 40px; height: 5px; border-radius: 999px;
  background: rgba(255,255,255,.3);
  margin: 4px auto 14px;
  flex-shrink: 0;
}

/* ─── LIST ROW ────────────────────────────────────────────────────── */
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,.06);
  transition: background .2s;
}
.row:active { background: var(--surface-3); }
.row .icon {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset;
}
.row .body { flex: 1; min-width: 0; }
.row .title { font-size: 15px; font-weight: 600; color: #fff; letter-spacing: -.1px; }
.row .meta { font-size: 11.5px; color: rgba(255,255,255,.5); margin-top: 2px; }
.row .amount {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.2px;
  color: #fff;
  white-space: nowrap;
}
.row .amount.in { color: #2D8FC4; }
.row .amount.out { color: #E14360; }

/* Icon color variants */
.icon { display: grid; place-items: center; }
.icon.ix-indigo { background: linear-gradient(145deg, rgba(79,179,217,.35), rgba(29,111,165,.15)); border-color: rgba(79,179,217,.4); }
.icon.ix-amber  { background: linear-gradient(145deg, rgba(192,138,46,.3), rgba(192,138,46,.1)); border-color: rgba(192,138,46,.4); }
.icon.ix-emerald{ background: linear-gradient(145deg, rgba(23,166,115,.3), rgba(23,166,115,.1)); border-color: rgba(23,166,115,.4); }
.icon.ix-rose   { background: linear-gradient(145deg, rgba(194,75,92,.3), rgba(194,75,92,.1)); border-color: rgba(194,75,92,.4); }
.icon.ix-sky    { background: linear-gradient(145deg, rgba(79,168,201,.3), rgba(79,168,201,.1)); border-color: rgba(79,168,201,.4); }
.icon.ix-violet { background: linear-gradient(145deg, rgba(107,111,166,.3), rgba(74,90,140,.1)); border-color: rgba(107,111,166,.4); }
.icon.ix-cyan   { background: linear-gradient(145deg, rgba(47,169,184,.3), rgba(47,169,184,.1)); border-color: rgba(47,169,184,.4); }
.icon.ix-orange { background: linear-gradient(145deg, rgba(193,112,46,.3),  rgba(193,112,46,.1));  border-color: rgba(193,112,46,.4); }
.icon.ix-pink   { background: linear-gradient(145deg, rgba(177,75,114,.3),  rgba(177,75,114,.1));  border-color: rgba(177,75,114,.4); }
.icon.ix-lime   { background: linear-gradient(145deg, rgba(122,155,62,.3),  rgba(122,155,62,.1));  border-color: rgba(122,155,62,.4); }
/* Vermelho/azul fortes — padrão do app (ver CLAUDE.md), usado nos pares
   entrada/saída (ex: Fluxo do mês) em vez das cores acima. */
.icon.ix-strongblue { background: linear-gradient(145deg, rgba(45,143,196,.3), rgba(45,143,196,.1)); border-color: rgba(45,143,196,.4); }
.icon.ix-strongred  { background: linear-gradient(145deg, rgba(225,67,96,.3), rgba(225,67,96,.1)); border-color: rgba(225,67,96,.4); }

/* ─── SECTION HEADERS ─────────────────────────────────────────────── */
.sect-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
  margin: 22px 0 12px;
}
.sect-h h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: #fff;
}
.sect-h .action {
  font-size: 13px;
  color: rgba(191,227,240,.85);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 4px 2px;
}

/* ─── Animations ──────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes slideInLeft {
  from { transform: translateX(-40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
/* fill-mode "backwards" (not "both") — "forwards" would leave a non-"none"
   transform permanently applied to the screen container after the entrance
   animation ends, turning it into a containing block for any position:fixed
   modal nested inside (backdrops/sheets get clipped to the scroll area
   instead of covering the real viewport). */
.screen-anim-in  { animation: fadeUp .44s var(--ease) backwards; }
.screen-anim-right { animation: slideInRight .38s var(--ease) backwards; }
.screen-anim-left  { animation: slideInLeft  .38s var(--ease) backwards; }

.stagger > * { animation: fadeUp .5s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .10s; }
.stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; }
.stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(7) { animation-delay: .26s; }
.stagger > *:nth-child(8) { animation-delay: .30s; }
.stagger > *:nth-child(9) { animation-delay: .34s; }
.stagger > *:nth-child(10){ animation-delay: .38s; }

.money { font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.hidden { display: none !important; }

@keyframes chartReveal {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes barRise {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}
@keyframes donutSliceIn {
  from { transform: scale(0.25); opacity: 0; }
  to   { transform: scale(1); opacity: 0.95; }
}
@keyframes spinOnce {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.spin-once { animation: spinOnce .6s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Landing screen animations ───────────────────────────── */
@keyframes logoFloat {
  0%, 100% { transform: translateY(0px);  }
  50%       { transform: translateY(-9px); }
}
@keyframes logoGlow {
  0%, 100% { box-shadow: 0 0 40px rgba(29,111,165,.3), 0 1px 0 rgba(255,255,255,.2) inset; }
  50%       { box-shadow: 0 0 70px rgba(29,111,165,.65), 0 0 120px rgba(29,111,165,.2), 0 1px 0 rgba(255,255,255,.25) inset; }
}
@keyframes iconPulse {
  0%, 100% { box-shadow: 0 0 24px var(--glow); }
  50%       { box-shadow: 0 0 48px var(--glow), 0 0 80px var(--glow); }
}
@keyframes badgeShimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(28px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
@keyframes brandLetters {
  from { opacity: 0; letter-spacing: 8px; }
  to   { opacity: 1; letter-spacing: 4px; }
}
@keyframes particle1 {
  0%,100% { transform: translate(0,0)    scale(1);    opacity: .45; }
  33%      { transform: translate(18px,-22px) scale(1.3); opacity: .7; }
  66%      { transform: translate(-12px,14px) scale(.8); opacity: .3; }
}
@keyframes particle2 {
  0%,100% { transform: translate(0,0)    scale(1);    opacity: .3;  }
  40%      { transform: translate(-20px,16px) scale(1.4); opacity: .6; }
  70%      { transform: translate(14px,-10px) scale(.9); opacity: .2; }
}
@keyframes particle3 {
  0%,100% { transform: translate(0,0)    scale(1);    opacity: .5;  }
  50%      { transform: translate(10px,20px) scale(1.2);  opacity: .8; }
}
@keyframes arrowBounce {
  0%,100% { transform: translateX(0);  }
  50%      { transform: translateX(4px); }
}
@keyframes authShake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}

.landing-logo {
  animation: logoFloat 3.2s ease-in-out infinite, logoGlow 3.2s ease-in-out infinite;
}
.landing-badge {
  background-size: 200% auto;
  animation: badgeShimmer 2.4s linear infinite;
}
.landing-arrow {
  animation: arrowBounce 1.4s ease-in-out infinite;
}

/* Color swatch picker */
.tint-swatch {
  width: 44px; height: 44px; border-radius: 14px; border: none;
  cursor: pointer; position: relative; display: grid; place-items: center;
  transition: transform .18s var(--ease-pop), box-shadow .18s;
}
.tint-swatch:active { transform: scale(.92) !important; }

/* ─── Auth screen extras ─────────────────────────────────────────── */
input {
  font-family: var(--font-sans);
  color: #fff;
}
input::placeholder { color: rgba(255,255,255,.4); }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0px 1000px rgba(12,24,36,.7) inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* ═══════════════════════════════════════════════════════════════════
   LIGHT THEME
   ═══════════════════════════════════════════════════════════════════ */

[data-theme="light"] {
  --fg-1:  #14161A;
  --fg-2:  rgba(20,22,26,.5);
  --fg-3:  rgba(20,22,26,.34);
  --text:  var(--fg-1);
  --text-2: var(--fg-2);
  --text-3: var(--fg-3);
  --text-c: #14161A;
  --bg:    #EFF0F2;
  --page:  #EFF0F2;
  --card-fill: #FFFFFF;
  --hero-fill: #141416;
  --border: rgba(20,22,26,.08);
  --card:   rgba(20,22,26,.04);
  --surface:   #FFFFFF;
  --surface-2: #FFFFFF;
  --surface-3: #F1F2F4;
}

/* Wallpaper — plano, sem gradiente decorativo */
[data-theme="light"] .wallpaper {
  background: var(--page);
}
[data-theme="light"] .wallpaper .orb { display: none; }
[data-theme="light"] .wallpaper::after { background: none; }
[data-theme="light"] .wallpaper::before { opacity: .012; }

/* Glass → cards sólidos brancos; .glass.indigo → hero card preto */
[data-theme="light"] .glass {
  background: var(--card-fill);
  border: none;
  box-shadow: 0 1px 2px rgba(20,22,26,.04), 0 8px 20px rgba(20,22,26,.05);
}
[data-theme="light"] .glass.soft {
  background: var(--card-fill);
  border: none;
  box-shadow: 0 1px 2px rgba(20,22,26,.03), 0 6px 16px rgba(20,22,26,.04);
}
[data-theme="light"] .glass.heavy {
  background: var(--card-fill);
  border: none;
  box-shadow: 0 4px 10px rgba(20,22,26,.05), 0 14px 32px rgba(20,22,26,.07);
}
[data-theme="light"] .glass.indigo {
  background: var(--hero-fill);
  border: none;
  box-shadow: 0 16px 40px rgba(20,22,26,.28);
  color: #fff;
}
[data-theme="light"] .glass.indigo .action { color: rgba(255,255,255,.6); }

/* Status bar */
[data-theme="light"] .status-bar { color: #14161A; }

/* Home indicator */
[data-theme="light"] .home-indicator { background: rgba(20,22,26,.22); }

/* Scroll area text cascade */
[data-theme="light"] .scroll-area { color: #14161A; }

/* Tab bar — barra cinza clara flutuante, aba ativa em pill branco */
[data-theme="light"] .tab-bar {
  background: #E4E5E9;
  border: none;
  box-shadow: 0 10px 28px rgba(20,22,26,.1);
}
[data-theme="light"] .tab-bar .tab { color: rgba(20,22,26,.42); }
[data-theme="light"] .tab-bar .tab.active {
  color: #14161A;
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(20,22,26,.1);
}
[data-theme="light"] .tab-bar .tab.fab-slot .fab {
  background: var(--hero-fill);
  box-shadow: 0 8px 20px rgba(20,22,26,.35);
}

/* Rows — valores monocromáticos, só o sinal indica entrada/saída */
[data-theme="light"] .row {
  background: var(--card-fill);
  border: none;
  box-shadow: 0 1px 2px rgba(20,22,26,.04), 0 4px 12px rgba(20,22,26,.06);
}
[data-theme="light"] .row:active { background: #F5F5F7; }
[data-theme="light"] .row .title { color: #14161A; font-weight: 700; }
[data-theme="light"] .row .meta  { color: rgba(20,22,26,.45); }
[data-theme="light"] .row .amount { color: #14161A; }
[data-theme="light"] .row .amount.in,
[data-theme="light"] .row .amount.out { color: #14161A; }
[data-theme="light"] .row .icon {
  background: #F1F2F4;
  border: none;
}

/* Section headers */
[data-theme="light"] .sect-h h2 { color: #14161A; font-weight: 800; }
[data-theme="light"] .sect-h .action { color: rgba(20,22,26,.4); font-weight: 600; }

/* Buttons */
[data-theme="light"] .gbtn {
  color: #14161A;
  border: 1px solid rgba(20,22,26,.06);
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(20,22,26,.06);
}
[data-theme="light"] .gbtn:active { background: #F1F2F4; }
[data-theme="light"] .gbtn.primary:active { background: var(--hero-fill); }
[data-theme="light"] .gbtn.primary {
  color: #fff;
  background: var(--hero-fill);
  border: none;
  box-shadow: 0 10px 24px rgba(20,22,26,.25);
}

/* Chips */
[data-theme="light"] .chip {
  background: rgba(20,22,26,.06);
  border-color: transparent;
  color: #14161A;
}
[data-theme="light"] .chip.up    { background: rgba(29,111,165,.1);  border-color: transparent; color: #1D6FA5; }
[data-theme="light"] .chip.dn    { background: rgba(192,138,46,.12); border-color: transparent; color: #8F6A22; }
[data-theme="light"] .chip.indigo { background: rgba(20,22,26,.08);  border-color: transparent; color: #14161A; }
[data-theme="light"] .chip.amber  { background: rgba(192,138,46,.12); border-color: transparent; color: #8F6A22; }

/* Sheet */
[data-theme="light"] .sheet {
  background: #FAFAFB;
  border: none;
  box-shadow: 0 -12px 40px rgba(20,22,26,.12);
}
[data-theme="light"] .sheet .grabber { background: rgba(20,22,26,.15); }
[data-theme="light"] .sheet-backdrop { background: rgba(20,22,26,.35); }

/* Inputs */
[data-theme="light"] input { color: #14161A; }
[data-theme="light"] input::placeholder { color: rgba(20,22,26,.34); }
[data-theme="light"] input:-webkit-autofill,
[data-theme="light"] input:-webkit-autofill:hover,
[data-theme="light"] input:-webkit-autofill:focus {
  -webkit-text-fill-color: #14161A;
  -webkit-box-shadow: 0 0 0px 1000px #F1F2F4 inset;
}

/* FlowZ ticker scroll */
@keyframes flowzScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ═══════════════════════════════════════════════════════════════════
   WEB / DESKTOP LAYOUT
   ═══════════════════════════════════════════════════════════════════ */

/* Mobile default: sidebar hidden, web-main fills viewport */
.web-sidebar { display: none; }
.web-main {
  position: absolute;
  inset: 0;
}

/* Auth card: sem estilo no mobile */
.auth-card {
  padding: 0;
}

/* No mobile a tela de login tem fundo sempre escuro e o card não tem fundo
   próprio (regra acima) — força as variáveis de texto pro tom claro aqui
   dentro, senão no tema claro o texto escuro fica ilegível sobre esse
   fundo. A partir do desktop o card ganha fundo (ver @media abaixo), que já
   acompanha o tema corretamente, então não faz sentido aqui. */
@media (max-width: 767px) {
  .auth-screen {
    --text-c: #F5F6F8;
    --text-2: rgba(245,246,248,.56);
    --text-3: rgba(245,246,248,.34);
  }
}

@media (min-width: 768px) {
  html, body { overflow: hidden; }

  /* Full-width flex layout: sidebar + main */
  .viewport {
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: row;
  }

  /* Auth screen — card layout no desktop */
  .auth-card {
    background: var(--surface-2);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(0,0,0,.4);
    padding: 40px 44px !important;
  }

  /* Hide mobile-only chrome */
  .status-bar,
  .home-indicator,
  .tab-bar {
    display: none !important;
  }

  /* ─── Sidebar ──────────────────────────────────────────────────── */
  .web-sidebar {
    display: flex;
    flex-direction: column;
    width: 230px;
    min-width: 230px;
    height: 100%;
    padding: 18px 10px 20px;
    border-right: 1px solid var(--border);
    background: var(--surface);
    gap: 4px;
    z-index: 10;
    position: relative;
    flex-shrink: 0;
  }

  .web-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
  }

  .web-sidebar-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.5px;
    background: var(--g-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .web-sidebar-add {
    width: 100%;
    justify-content: center !important;
    margin-bottom: 6px;
    border-radius: 13px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    padding: 11px 14px !important;
  }

  .web-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .web-sidebar-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--fg-2);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    text-align: left;
    width: 100%;
  }

  .web-sidebar-item:hover {
    background: rgba(255,255,255,.07);
    color: var(--fg-1);
  }

  .web-sidebar-item.active {
    background: linear-gradient(135deg, rgba(79,179,217,.22), rgba(29,111,165,.11));
    border-color: rgba(79,179,217,.28);
    color: var(--fg-1);
  }

  .web-sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 6px;
  }

  .web-sidebar-section-label {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--fg-3);
    padding: 2px 12px 6px;
  }

  .web-sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .web-sidebar-status {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 9px;
  }

  .web-sidebar-status.offline  { color: #F4A6AE; background: rgba(194,75,92,.08); }
  .web-sidebar-status.syncing  { color: #E8C468; background: rgba(232,196,104,.08); }

  /* ─── Main content area ─────────────────────────────────────────── */
  .web-main {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-width: 0;
  }

  /* Scroll area: remove mobile status-bar / tab-bar offsets */
  .scroll-area {
    top: 0 !important;
    bottom: 0 !important;
    padding-top: 32px !important;
    padding-bottom: 40px !important;
    padding-left: 40px !important;
    padding-right: 40px !important;
  }

  /* Sheet: centered dialog on desktop instead of full-width bottom sheet */
  .sheet {
    left: 50%;
    right: auto;
    bottom: 28px;
    width: 480px;
    transform: translateX(-50%) translateY(120%);
    border-radius: 28px;
  }
  .sheet.open {
    transform: translateX(-50%) translateY(0);
  }

  .sheet.from-top {
    top: 28px;
    bottom: auto;
    left: 50%;
    right: auto;
    width: 480px;
    transform: translateX(-50%) translateY(-120%);
  }
  .sheet.from-top.open {
    transform: translateX(-50%) translateY(0);
  }

  /* Sync banner: shift right to clear sidebar */
  .sync-banner-desktop {
    left: calc(50% + 115px);
  }

  /* Casa: duas colunas lado a lado em vez de empilhar esticado */
  .casa-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    max-width: 980px;
  }
  .casa-col-left {
    flex: 0 0 340px;
  }
  .casa-col-right {
    flex: 1;
    min-width: 0;
    max-width: 460px;
  }

  /* Web tem teclado físico, mas um teclado numérico na tela + categoria +
     botão grande deixam o lançamento de despesa mais rápido que digitar
     num campo de texto solto. */
  .casa-mobile-only { display: none; }
  .casa-desktop-only { display: block; }
  .casa-confirm-btn { padding: 18px 0; font-size: 17px; }
}

/* ─── Light theme sidebar ───────────────────────────────────────── */
[data-theme="light"] .web-sidebar {
  border-right-color: rgba(20,22,26,.08);
  background: #FFFFFF;
}

@media (min-width: 768px) {
  [data-theme="light"] .auth-card {
    background: #FFFFFF;
    border-color: rgba(20,22,26,.08);
    box-shadow: 0 24px 60px rgba(20,22,26,.1);
  }
}

[data-theme="light"] .web-sidebar-item:hover {
  background: rgba(20,22,26,.06);
  color: #14161A;
}

[data-theme="light"] .web-sidebar-item.active {
  background: #14161A;
  border-color: transparent;
  color: #fff;
}

[data-theme="light"] .web-sidebar-status.offline { color: #C43854; background: rgba(196,56,84,.08); }
[data-theme="light"] .web-sidebar-status.syncing  { color: #8F6A22; background: rgba(192,138,46,.1); }

/* ═══════════════════════════════════════════════════════════════════
   DARK THEME — carvão neutro (mesma identidade monocromática do claro)
   ═══════════════════════════════════════════════════════════════════ */

[data-theme="dark"] {
  --fg-1:  #F5F6F8;
  --fg-2:  rgba(245,246,248,.56);
  --fg-3:  rgba(245,246,248,.34);
  --text:  var(--fg-1);
  --text-2: var(--fg-2);
  --text-3: var(--fg-3);
  --text-c: #F5F6F8;
  --bg:    #0E0E10;
  --page:  #0E0E10;
  --card-fill: #1A1A1C;
  --hero-fill: #2E2E33;
  --border: rgba(255,255,255,.16);
  --card:   rgba(255,255,255,.04);
  --surface:   #1A1A1C;
  --surface-2: #1A1A1C;
  --surface-3: #242427;
  /* "pop" de seleção (aba ativa etc.) — branco, como no claro */
  --seg-active: #F5F6F8;
  --seg-active-text: #14161A;
  /* toggles — trilho branco + botão escuro quando ligado */
  --toggle-on: #F5F6F8;
  --toggle-knob-on: #17171A;
  --toggle-off: #3A3A3F;
  --toggle-knob-off: #F5F6F8;
}

/* Wallpaper — fundo plano escuro */
[data-theme="dark"] .wallpaper { background: var(--page); }
[data-theme="dark"] .wallpaper .orb { display: none; }
[data-theme="dark"] .wallpaper::after { background: none; }
[data-theme="dark"] .wallpaper::before { opacity: .02; }

/* Glass → cards carvão; .glass.indigo → card elevado (hero) */
[data-theme="dark"] .glass {
  background: var(--card-fill);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.35);
}
[data-theme="dark"] .glass.soft {
  background: var(--card-fill);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 16px rgba(0,0,0,.3);
}
[data-theme="dark"] .glass.heavy {
  background: #201F22;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
[data-theme="dark"] .glass.indigo {
  background: var(--hero-fill);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 14px 36px rgba(0,0,0,.5);
  color: #fff;
}
[data-theme="dark"] .glass.indigo .action { color: rgba(255,255,255,.6); }

/* Status bar / home indicator / scroll */
[data-theme="dark"] .status-bar { color: #F5F6F8; }
[data-theme="dark"] .home-indicator { background: rgba(255,255,255,.28); }
[data-theme="dark"] .scroll-area { color: #F5F6F8; }

/* Tab bar — barra flutuante escura, aba ativa em pill elevado */
[data-theme="dark"] .tab-bar {
  background: #17171A;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
}
[data-theme="dark"] .tab-bar .tab { color: rgba(255,255,255,.5); }
[data-theme="dark"] .tab-bar .tab.active {
  color: #fff;
  background: #2E2E33;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
[data-theme="dark"] .tab-bar .tab.fab-slot .fab {
  background: #F5F6F8;
  box-shadow: 0 8px 20px rgba(0,0,0,.5);
}
[data-theme="dark"] .tab-bar .tab.fab-slot .fab svg { color: #14161A; }

/* Rows */
[data-theme="dark"] .row {
  background: var(--card-fill);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 2px 10px rgba(0,0,0,.32);
}
[data-theme="dark"] .row:active { background: #232326; }
[data-theme="dark"] .row .title { color: #F5F6F8; }
[data-theme="dark"] .row .meta  { color: rgba(255,255,255,.45); }
[data-theme="dark"] .row .amount { color: #F5F6F8; }
[data-theme="dark"] .row .amount.in,
[data-theme="dark"] .row .amount.out { color: #F5F6F8; }
[data-theme="dark"] .row .icon { background: #29292D; border: 1px solid rgba(255,255,255,.12); }

/* Section headers */
[data-theme="dark"] .sect-h h2 { color: #F5F6F8; }
[data-theme="dark"] .sect-h .action { color: rgba(255,255,255,.5); }

/* Buttons */
[data-theme="dark"] .gbtn {
  color: #F5F6F8;
  border: 1px solid rgba(255,255,255,.08);
  background: #242427;
  box-shadow: none;
}
[data-theme="dark"] .gbtn:active { background: #2C2C30; }
[data-theme="dark"] .gbtn.primary {
  color: #fff;
  background: var(--hero-fill);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 8px 22px rgba(0,0,0,.4);
}
[data-theme="dark"] .gbtn.primary:active { background: #34343A; }

/* Chips */
[data-theme="dark"] .chip { background: rgba(255,255,255,.07); border-color: transparent; color: #F5F6F8; }
[data-theme="dark"] .chip.up     { background: rgba(79,168,201,.16); border-color: transparent; color: #4FA8C9; }
[data-theme="dark"] .chip.dn     { background: rgba(232,196,104,.14); border-color: transparent; color: #E8C468; }
[data-theme="dark"] .chip.indigo { background: rgba(255,255,255,.08); border-color: transparent; color: #F5F6F8; }
[data-theme="dark"] .chip.amber  { background: rgba(232,196,104,.14); border-color: transparent; color: #E8C468; }

/* Sheet */
[data-theme="dark"] .sheet {
  background: #161618;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 -12px 44px rgba(0,0,0,.6);
}
[data-theme="dark"] .sheet.from-top { box-shadow: 0 12px 44px rgba(0,0,0,.6); }
[data-theme="dark"] .sheet .grabber { background: rgba(255,255,255,.2); }
[data-theme="dark"] .sheet-backdrop { background: rgba(0,0,0,.6); }

/* Inputs */
[data-theme="dark"] input { color: #F5F6F8; }
[data-theme="dark"] input::placeholder { color: rgba(255,255,255,.38); }
[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus {
  -webkit-text-fill-color: #F5F6F8;
  -webkit-box-shadow: 0 0 0px 1000px #242427 inset;
}

/* Sidebar (desktop) */
[data-theme="dark"] .web-sidebar { border-right-color: rgba(255,255,255,.06); background: #141416; }
[data-theme="dark"] .web-sidebar-item:hover { background: rgba(255,255,255,.06); color: #F5F6F8; }
[data-theme="dark"] .web-sidebar-item.active { background: #2E2E33; border-color: transparent; color: #fff; }
[data-theme="dark"] .web-sidebar-status.offline { color: #F4A6AE; background: rgba(225,67,96,.1); }
[data-theme="dark"] .web-sidebar-status.syncing  { color: #E8C468; background: rgba(232,196,104,.1); }

/* ─── Entrada de modais/sheets com bounce ───────────────────────────── */
@keyframes modalPop {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-pop { animation: modalPop .36s var(--ease-pop) both; }

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

