/* ==========================================================================
   MCASH :: app.css
   Identidade "BLACK & ELECTRIC": PRETO ABSOLUTO (#000000) dominante e VERDE
   ELÉTRICO (#C8FF00) como cor de destaque — ação principal, valores positivos,
   seleção, foco, indicadores e detalhes.

   Como a hierarquia é construída:
   - PRETO como base: fundo #000000, superfícies #0D0D0D, cards #181818
   - OPACIDADE do texto claro (100% = destaque, 60% = corpo, 45% = apoio)
   - PESO tipográfico (600/700 para números e títulos, 400 para texto)
   - ESPAÇAMENTO e BORDAS (#252525 separa sem precisar de cor)
   - VERDE em dose controlada: nunca como fundo de tela, só em destaque
   - MOVIMENTO discreto (120-260ms, apenas para dar resposta ao toque)

   Semântica: positivo/sucesso = verde; pendente = #FFCF33; erro = #FF4D5F.
   O preto continua sendo, de longe, a cor dominante da interface.
   ========================================================================== */

/* --------------------------------------------------------------- tokens */
:root {
  /* As duas cores da identidade */
  --bg: #000000;
  --fg: #F5F5F2;

  /* Texto claro em camadas (composição sobre o preto, não cores novas).
     --fg-45 é o texto secundário da paleta (#8B8B8B) — as demais camadas são
     o mesmo claro em opacidades diferentes, para a hierarquia não virar cinza. */
  --fg-100: #F5F5F2;
  --fg-80: rgba(245, 245, 242, 0.80);
  --fg-60: rgba(245, 245, 242, 0.60);
  --fg-45: #8B8B8B;
  --fg-30: rgba(245, 245, 242, 0.26);
  --fg-14: rgba(245, 245, 242, 0.13);
  --fg-08: rgba(245, 245, 242, 0.07);
  --fg-04: rgba(245, 245, 242, 0.04);

  /* ------------------------------------------------------------------------
     Identidade "BLACK & ELECTRIC" — ÚNICO :root do arquivo.
     Antes existia um segundo :root na camada do fim do arquivo que redeclarava
     --bg/--accent/--line com a paleta antiga (azul/ciano/violeta) e, por vir
     depois na cascata, sobrescrevia tudo o que estava aqui. Era essa duplicação
     que fazia o site continuar azul mesmo com os tokens do topo já trocados.
     Agora todos os tokens vivem AQUI e não há mais sobrescrita.
     ------------------------------------------------------------------------ */

  /* Superfícies (elevação sobre o preto) */
  --surface: #0D0D0D;
  --elev: #181818;
  --elev-2: #202020;

  /* Verde elétrico — exclusivamente para DESTAQUE (nunca como fundo de tela) */
  --accent: #C8FF00;
  --accent-hover: #A8DC00;
  --accent-soft: rgba(200, 255, 0, 0.08);
  --accent-dim: rgba(200, 255, 0, 0.14);
  --accent-line: rgba(200, 255, 0, 0.32);
  --accent-glow: rgba(200, 255, 0, 0.22);
  --on-accent: #0A0A0A;

  /* Estados */
  --success: #C8FF00;
  --warning: #FFCF33;
  --danger: #FF4D5F;

  /* Texto de apoio, linhas e sombras */
  --ink-2: #8B8B8B;
  --line: #252525;
  --line-soft: rgba(245, 245, 242, 0.06);
  --shadow-soft: 0 18px 48px rgba(0, 0, 0, 0.62);
  --shadow-accent: 0 12px 34px rgba(200, 255, 0, 0.10);

  /* Tipografia */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-base: 0.9375rem;

  /* ------------------------------------------------------------------------
     Piso OBRIGATÓRIO dos controles de formulário: 16px EXATOS.
     Causa raiz do zoom relatado no iPhone: o Safari do iOS (no navegador E no
     modo PWA / "Adicionar à Tela de Início") dá auto-zoom na página inteira
     quando um input, select ou textarea com fonte MENOR que 16px recebe foco.
     Os campos usavam --t-base (15px), então tocar em qualquer campo — ou só
     abrir um modal, que foca o primeiro campo automaticamente — aplicava o
     zoom, e ele só voltava com gesto de dois dedos.
     Não reduza este valor: 16px é o limite exato do gatilho do iOS.
     ------------------------------------------------------------------------ */
  --t-field: 16px;

  --t-md: 1.0625rem;
  --t-lg: 1.375rem;
  --t-xl: 1.75rem;
  --t-2xl: 2.25rem;
  --t-hero: clamp(2rem, 8vw, 3rem);

  /* Espaçamento */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;

  /* Formas */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  /* Movimento */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --fast: 120ms;
  --base: 180ms;
  --slow: 260ms;

  /* Camadas */
  --z-drawer: 40;
  --z-modal: 60;
  --z-toast: 80;
  --z-loading: 90;

  --sidebar-w: 244px;
  --tabbar-h: 62px;

  /* Safe areas (iOS notch) */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prefixo -webkit-: o Safari do iOS só respeita a versão prefixada e, sem
     ela, pode inflar o texto ao girar a tela/mudar de app. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html { height: 100%; }

/*
 * O DOCUMENTO NÃO ROLA. Quem rola é .main (logo abaixo).
 *
 * Motivo concreto do bug relatado no celular: com a rolagem no <body>, cada
 * quadro precisava repintar a barra fixa inferior E a barra superior "sticky"
 * que usava desfoque (backdrop-filter). Ao arrastar rápido para baixo, o
 * navegador recalculava a altura com a barra de endereço entrando/saindo, o
 * "rubber band" brigava com o layout e a tela ficava presa/bugada.
 * Com um único contêiner de rolagem, o compositor trabalha em uma camada só e
 * o arrasto fica fluido, sem travar a interface.
 */
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Piso global de 16px em TODO controle de formulário.
   O `font: inherit` acima faria o campo herdar a fonte do contexto (15px, ou
   menos dentro de tabelas do admin) e reativar o auto-zoom do iOS. Esta regra
   cobre também os campos criados dinamicamente pelo JS e qualquer campo futuro
   que não use .input/.select/.textarea. Campos maiores (ex.: valor monetário)
   continuam sobrescrevendo por classe, que tem precedência. */
input, select, textarea { font-size: var(--t-field); }

a { color: var(--fg); text-decoration: none; }
svg { display: block; }
img { max-width: 100%; display: block; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 4px rgba(200, 255, 0, 0.18);
}

/* Seleção de texto: verde com texto preto — o destaque mais barato que existe. */
::selection { background: var(--accent); color: #0A0A0A; }

/* Scrollbar discreta: o verde aparece só na barra, nunca como faixa de cor. */
* { scrollbar-width: thin; scrollbar-color: rgba(200, 255, 0, 0.28) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(200, 255, 0, 0.26); border-radius: var(--r-full); }
*::-webkit-scrollbar-thumb:hover { background: rgba(200, 255, 0, 0.42); }

/* ------------------------------------------------------------- tipografia */
.hero {
  font-size: var(--t-hero);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.h1 { font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.02em; }
.h2 { font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.015em; }
.h3 { font-size: var(--t-md); font-weight: 600; }
.body { font-size: var(--t-base); color: var(--fg-80); }
.muted { color: var(--fg-60); font-size: var(--t-sm); }
.dim { color: var(--fg-45); font-size: var(--t-sm); }
.tiny { font-size: var(--t-xs); color: var(--fg-45); }
.mono { font-family: var(--font-num); font-size: var(--t-sm); letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
.upper { text-transform: uppercase; letter-spacing: 0.12em; font-size: var(--t-xs); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break { overflow-wrap: anywhere; }

/* ================================================================ SPLASH */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: grid;
  place-content: center;
  gap: var(--s-6);
  justify-items: center;
  transition: opacity var(--slow) var(--ease);
}
.splash--out { opacity: 0; pointer-events: none; }
.splash__mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-5);
  animation: fadeUp 560ms var(--ease) both;
}
.splash__badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
}
.splash__badge::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: var(--r-full);
  background: radial-gradient(circle, rgba(200, 255, 0, 0.16), transparent 68%);
  animation: glowPulse 2.8s var(--ease) infinite;
}
.splash__ring {
  position: absolute;
  inset: 0;
  border-radius: var(--r-full);
  background: conic-gradient(from 0deg, transparent 0%, rgba(200, 255, 0, 0.75) 10%, transparent 24%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  animation: spin 2.6s linear infinite;
}
.splash__logo {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 41px;
  filter: drop-shadow(0 0 14px rgba(200, 255, 0, 0.35));
  animation: logoIn 900ms var(--ease) both;
}
.splash__name {
  font-size: var(--t-lg);
  font-weight: 700;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
}
.splash__bar {
  width: 108px;
  height: 1px;
  background: var(--fg-14);
  overflow: hidden;
}
.splash__bar span {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(200, 255, 0, 0.55);
  animation: slideBar 1.15s var(--ease) infinite;
}

@keyframes slideBar {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
/* As duas animações abaixo eram REFERENCIADAS sem existir: .splash__badge pedia
   glowPulse e .splash__logo pedia logoIn. O navegador ignora em silêncio uma
   animação sem @keyframes correspondente, então a abertura do app ficava
   parada. Definidas aqui, o splash volta a ter vida. */
@keyframes glowPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.94); }
  50%      { opacity: 1;    transform: scale(1.05); }
}
@keyframes logoIn {
  from { opacity: 0; transform: scale(0.82) translateY(6px); }
  to   { opacity: 1; transform: none; }
}
/* Brilho que atravessa o esqueleto de carregamento e a onda do toque. */
@keyframes shimmer {
  from { background-position: 150% 0; }
  to   { background-position: -50% 0; }
}
@keyframes rippleOut {
  from { opacity: 0.3; transform: scale(0); }
  to   { opacity: 0;   transform: scale(1); }
}

/* ================================================================= SHELL */
.shell {
  height: 100vh;   /* fallback para navegadores sem dvh */
  height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden; /* a rolagem acontece dentro de .main, não aqui */
  animation: fadeIn var(--base) var(--ease);
}

/* ------------------------------------------------------------ sidebar */
.sidebar {
  display: none;
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: var(--s-6) var(--s-4);
  border-right: 1px solid var(--fg-08);
  flex-direction: column;
  gap: var(--s-6);
}
.sidebar__brand { padding: var(--s-2) var(--s-3); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 700;
  letter-spacing: 0.34em;
  font-size: var(--t-sm);
}
/*
 * O monograma MC acompanha o nome onde quer que ele apareça.
 * O tamanho é relativo à altura das letras (em), nunca fixo em pixels: assim
 * o logo fica sempre do mesmo tamanho do texto, em qualquer tela.
 */
.brand__mark {
  width: 1.28em;
  height: 0.9em;
  flex: none;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.22));
  transition: transform var(--base) var(--ease), filter var(--base) var(--ease);
}
.brand__name { padding-left: 0.34em; }
.brand:hover .brand__mark {
  transform: rotate(-8deg) scale(1.06);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.45));
}
.sidebar__foot { margin-top: auto; }

/* ------------------------------------------------------------- nav */
.nav { display: flex; flex-direction: column; gap: var(--s-1); }
.nav--stack { gap: var(--s-1); }

.nav__item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-md);
  color: var(--fg-60);
  font-size: var(--t-base);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.nav__item:hover { color: var(--fg); background: var(--fg-04); }
.nav__item[aria-current="page"] {
  color: var(--fg);
  background: var(--fg-08);
  border-color: var(--fg-14);
  font-weight: 600;
}
.nav__icon { width: 18px; height: 18px; flex: none; }
.nav__icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav__label { flex: 1; }
.nav__count {
  font-size: var(--t-xs);
  font-variant-numeric: tabular-nums;
  padding: 0 var(--s-2);
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
}

/* --------------------------------------------------------------- main */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* inércia nativa no iOS */
  overscroll-behavior-y: contain;    /* não repassa o gesto para o documento */
  scroll-padding-top: calc(64px + var(--safe-t));
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: calc(var(--s-3) + var(--safe-t)) var(--s-4) var(--s-3);
  background: rgba(0, 0, 0, 0.94);
  border-bottom: 1px solid var(--fg-08);
}
.topbar__title {
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar__actions { display: flex; gap: var(--s-1); }

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  background: none;
  color: var(--fg-60);
  cursor: pointer;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease), transform var(--fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { color: var(--fg); background: var(--fg-08); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn--spin svg { animation: spin 700ms linear infinite; }

.badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--fg);
  color: var(--bg);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.view {
  flex: 1;
  padding: var(--s-5) var(--s-4) var(--s-10);
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  outline: none;
}
.view > * { animation: riseIn var(--slow) var(--ease) both; }

/* ------------------------------------------------------------- tabbar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: center;
  background: rgba(0, 0, 0, 0.96);
  border-top: 1px solid var(--fg-08);
}
.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  border: none;
  background: none;
  color: var(--fg-45);
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  transition: color var(--fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.tabbar__item[aria-current="page"] { color: var(--fg); }
.tabbar__item svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar__item .badge { top: 6px; right: calc(50% - 18px); }
.tabbar__item[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  width: 26px;
  height: 2px;
  border-radius: var(--r-full);
  background: var(--fg);
  animation: popIn var(--base) var(--ease);
}

/* ------------------------------------------------------------- drawer */
.drawer { position: fixed; inset: 0; z-index: var(--z-drawer); }
.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  animation: fadeIn var(--base) var(--ease);
}
.drawer__panel {
  position: absolute;
  inset: 0 auto 0 0;
  width: min(300px, 84vw);
  background: var(--bg);
  border-right: 1px solid var(--fg-14);
  padding: calc(var(--s-5) + var(--safe-t)) var(--s-4) calc(var(--s-5) + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  animation: drawerIn var(--slow) var(--ease);
  overflow-y: auto;
}
@keyframes drawerIn {
  from { transform: translateX(-100%); }
  to   { transform: none; }
}
.drawer__head { display: flex; align-items: center; justify-content: space-between; }
.drawer__foot { margin-top: auto; padding-top: var(--s-4); border-top: 1px solid var(--fg-08); }

.who { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2); }
.who__avatar {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--r-full);
  border: 1px solid var(--fg-30);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: var(--t-sm);
}
.who__meta { min-width: 0; }

/* ============================================================ COMPONENTES */
.card {
  background: var(--bg);
  border: 1px solid var(--fg-08);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.card--flush { padding: 0; overflow: hidden; }
.card--pad-sm { padding: var(--s-4); }
.card + .card { margin-top: var(--s-4); }
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.card__title { font-size: var(--t-base); font-weight: 600; }

.grid { display: grid; gap: var(--s-4); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
/* Em telas estreitas duas colunas viram duas colunas apertadas (cartões de
   saque, pagador/recebedor do comprovante). Abaixo de 560px o conteúdo passa
   a ocupar a largura toda. */
@media (max-width: 560px) {
  .grid--2 { grid-template-columns: minmax(0, 1fr); }
}
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.stack--sm { gap: var(--s-2); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
/* Linha de ações: os botões dividem a largura igualmente e quebram para a
   linha de baixo em telas estreitas, em vez de espremer o rótulo. */
.row--actions { flex-wrap: wrap; }
.row--actions > .btn { flex: 1 1 150px; width: auto; }
.spacer { flex: 1; }

/* ------------------------------------------------------------ saldo */
.balance {
  border: 1px solid var(--fg-14);
  border-radius: var(--r-xl);
  padding: var(--s-6) var(--s-5);
  background:
    radial-gradient(120% 100% at 0% 0%, var(--fg-08) 0%, transparent 58%);
}
.balance__label { color: var(--fg-60); font-size: var(--t-sm); }
.balance__value { margin-top: var(--s-2); }
.balance__meta {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--fg-08);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--s-4);
}
.metric__label { color: var(--fg-45); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.08em; }
.metric__value { margin-top: 3px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0 var(--s-5);
  height: 46px;
  /* O botão é o bloco de referência da onda do toque (ripple) e do spinner de
     carregamento. Sem position:relative a onda escapava do botão e o spinner
     do estado "carregando" ficava sem âncora; sem overflow:hidden a onda
     vazava para fora dos cantos arredondados. */
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  border: 1px solid var(--fg-30);
  background: none;
  color: var(--fg);
  font-size: var(--t-base);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
              border-color var(--fast) var(--ease), transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn:hover { border-color: var(--fg); background: var(--fg-08); }
.btn:active { transform: scale(0.985); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.btn--primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn--primary:hover { background: var(--fg-80); border-color: var(--fg-80); color: var(--bg); }

.btn--ghost { border-color: transparent; color: var(--fg-60); }
.btn--ghost:hover { color: var(--fg); background: var(--fg-08); }

.btn--danger { border-color: var(--fg); }
.btn--block { width: 100%; }
.btn--sm { height: 36px; padding: 0 var(--s-4); font-size: var(--t-sm); }
.btn--lg { height: 54px; font-size: var(--t-md); }
.btn--icon { width: 46px; padding: 0; flex: none; }

.btn--loading { color: transparent !important; position: relative; pointer-events: none; }
.btn--loading::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  border-radius: var(--r-full);
  border: 2px solid currentColor;
  border-top-color: transparent;
  color: var(--fg);
  animation: spin 640ms linear infinite;
}
.btn--primary.btn--loading::after { color: var(--bg); }

/* ------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field__label { font-size: var(--t-sm); font-weight: 500; color: var(--fg-80); }
.field__hint { font-size: var(--t-xs); color: var(--fg-45); }
.field__error { font-size: var(--t-sm); color: var(--fg); font-weight: 500; }

.input, .select, .textarea {
  width: 100%;
  height: 48px;
  padding: 0 var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--fg-14);
  background: var(--bg);
  color: var(--fg);
  /* 16px (--t-field): abaixo disso o iOS dá auto-zoom ao focar o campo. */
  font-size: var(--t-field);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.textarea { height: auto; min-height: 88px; padding: var(--s-3) var(--s-4); resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--fg-30); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--fg); background: var(--fg-04); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--fg); border-width: 2px; }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--s-4) center;
  background-size: 16px;
  padding-right: var(--s-10);
  cursor: pointer;
}
.select option { background: var(--bg); color: var(--fg); }

/* Campo de valor monetário: grande e centralizado */
.amount-field { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); padding: var(--s-5) 0; }
.amount-field__prefix { font-size: var(--t-sm); color: var(--fg-45); letter-spacing: 0.1em; }
.amount-field__input {
  width: 100%;
  border: none;
  background: none;
  color: var(--fg);
  font-size: clamp(2rem, 9vw, 2.75rem);
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  padding: 0;
}
.amount-field__input:focus { outline: none; }
.amount-field__input::placeholder { color: var(--fg-14); }

/* Chips de valor rápido */
.chips { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.chip {
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-full);
  border: 1px solid var(--fg-14);
  background: none;
  color: var(--fg-60);
  font-size: var(--t-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { color: var(--fg); border-color: var(--fg-45); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* Segmentado (tipo de chave PIX etc.) */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--fg-14);
  border-radius: var(--r-md);
}
.segmented__btn {
  padding: var(--s-2) var(--s-1);
  border: none;
  background: none;
  color: var(--fg-60);
  font-size: var(--t-sm);
  font-weight: 500;
  border-radius: calc(var(--r-md) - 3px);
  cursor: pointer;
  transition: all var(--fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.segmented__btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); font-weight: 600; }

/* ------------------------------------------------------------- listas */
.list { display: flex; flex-direction: column; }
.list__item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  border-bottom: 1px solid var(--fg-08);
  cursor: pointer;
  transition: background var(--fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.list__item:last-child { border-bottom: none; }
.list__item:hover { background: var(--fg-04); }
.list__item--static { cursor: default; }
.list__item--static:hover { background: none; }
.list__icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--r-full);
  border: 1px solid var(--fg-14);
  display: grid;
  place-items: center;
  color: var(--fg-80);
}
.list__icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.list__body { flex: 1; min-width: 0; }
.list__title { font-size: var(--t-base); font-weight: 500; }
.list__sub { font-size: var(--t-xs); color: var(--fg-45); margin-top: 2px; }
.list__value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list__value--out { color: var(--fg-80); }

/* Selo de status: distinção por rótulo e preenchimento, nunca por cor */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px var(--s-3);
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--fg-30);
  color: var(--fg-80);
  white-space: nowrap;
}
.status--done { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.status--pending { border-style: dashed; }
.status--failed { border-color: var(--fg); color: var(--fg); font-weight: 700; }
.status--canceled { border-color: var(--fg-14); color: var(--fg-45); }

/* --------------------------------------------------------- QR / copiar */
.qr {
  display: grid;
  place-items: center;
  padding: var(--s-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--fg-14);
  background: var(--bg);
}
.qr img, .qr canvas { width: min(230px, 62vw); height: auto; border-radius: var(--s-2); background: var(--fg); }
.qr__placeholder {
  width: min(230px, 62vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px dashed var(--fg-30);
  border-radius: var(--s-2);
  color: var(--fg-45);
  font-size: var(--t-xs);
  text-align: center;
  padding: var(--s-4);
}

.copy-box {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
  border: 1px solid var(--fg-14);
  border-radius: var(--r-md);
}
.copy-box__text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-num);
  font-size: var(--t-xs);
  color: var(--fg-80);
  /* O texto do comprovante é multilinha e o código PIX é uma linha muito
     longa: em vez de cortar com reticências, quebra e rola dentro da caixa. */
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  max-height: 7.5em;
  overflow-y: auto;
}

/* --------------------------------------------------------- comprovante */
.receipt {
  border: 1px solid var(--fg-14);
  border-radius: var(--r-lg);
  overflow: hidden;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
.receipt__head {
  padding: var(--s-6) var(--s-5);
  text-align: center;
  border-bottom: 1px dashed var(--fg-14);
}
.receipt__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 700;
  letter-spacing: 0.34em;
  font-size: var(--t-sm);
}
.receipt__mark {
  width: 1.45em;
  height: 1.02em;
  flex: none;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.22));
}
.receipt__brand > span { padding-left: 0.34em; }
.receipt__doc { margin-top: var(--s-2); }
.receipt__amount-label { margin-top: var(--s-5); }
/* O valor nunca pode estourar a largura: o tamanho acompanha a tela e o
   texto quebra em vez de sair do cartão. */
.receipt__amount {
  margin-top: var(--s-1);
  font-size: clamp(1.6rem, 7vw, 2.5rem);
  overflow-wrap: anywhere;
}
.receipt__status { margin-top: var(--s-3); }
.receipt__number { margin-top: var(--s-2); }
.receipt__section { border-top: 1px dashed var(--fg-14); }
.receipt__head + .receipt__section { border-top: none; }
.receipt__section-title {
  padding: var(--s-4) var(--s-5) 0;
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-45);
}
.receipt__rows { padding: var(--s-2) var(--s-5); }
.receipt__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--fg-08);
  font-size: var(--t-sm);
  min-width: 0;
}
.receipt__row:last-child { border-bottom: none; }
/* O rótulo encolhe e o valor ocupa o espaço restante: IDs longos (UUID) e
   números grandes quebram dentro do cartão em vez de vazar para fora. */
.receipt__key {
  color: var(--fg-45);
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.receipt__val {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.receipt__val--num { font-variant-numeric: tabular-nums; }
.receipt__row--total {
  border-top: 1px solid var(--fg-14);
  margin-top: var(--s-1);
  padding-top: var(--s-4);
}
.receipt__row--total .receipt__key { color: var(--fg); font-weight: 600; }
.receipt__row--total .receipt__val { font-weight: 700; }
.receipt__foot {
  padding: var(--s-4) var(--s-5);
  border-top: 1px dashed var(--fg-14);
  background: var(--fg-04);
}

/* Envolvidos (pagador/recebedor) lado a lado, separados por um fio vertical.
   Em telas estreitas as duas colunas empilham — antes este bloco não existia e
   os nomes ficavam misturados no meio dos IDs da transação. */
.receipt__parties {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.receipt__party { min-width: 0; }
.receipt__party + .receipt__party {
  padding-left: var(--s-4);
  border-left: 1px solid var(--fg-08);
}
.receipt__party-role {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-45);
}
.receipt__party-name {
  margin-top: var(--s-2);
  font-weight: 600;
  font-size: var(--t-sm);
}
.receipt__party-extra {
  margin-top: 2px;
  font-size: var(--t-xs);
  color: var(--fg-45);
}
@media (max-width: 460px) {
  .receipt__parties { grid-template-columns: minmax(0, 1fr); }
  .receipt__party + .receipt__party {
    padding-left: 0;
    padding-top: var(--s-3);
    border-left: none;
    border-top: 1px solid var(--fg-08);
  }
}

/* --------------------------------------------------------------- vazio */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-10) var(--s-5);
  text-align: center;
  color: var(--fg-45);
}
.empty__icon {
  width: 46px;
  height: 46px;
  border-radius: var(--r-full);
  border: 1px dashed var(--fg-30);
  display: grid;
  place-items: center;
}
.empty__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty__title { color: var(--fg-80); font-weight: 600; font-size: var(--t-base); }

/* ------------------------------------------------------------- skeleton */
.sk { background: var(--fg-08); border-radius: var(--r-sm); animation: pulse 1.4s ease-in-out infinite; }
.sk--text { height: 12px; }
.sk--title { height: 20px; }
.sk--hero { height: 44px; }
.sk--circle { border-radius: var(--r-full); }

/* ------------------------------------------------------------- avisos */
.notice {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--fg-30);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  color: var(--fg-80);
  background: var(--fg-04);
}
.notice svg { width: 17px; height: 17px; flex: none; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notice--solid { background: var(--fg); color: var(--bg); border-color: var(--fg); font-weight: 600; }

/* ------------------------------------------------------------- toasts */
.toasts {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--s-4));
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  width: min(440px, calc(100vw - var(--s-8)));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--fg-30);
  background: var(--fg);
  color: var(--bg);
  font-size: var(--t-sm);
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  animation: riseIn var(--base) var(--ease);
  pointer-events: auto;
}
.toast--out { animation: fadeIn var(--base) var(--ease) reverse both; }
.toast svg { width: 17px; height: 17px; flex: none; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------ suporte (WhatsApp) */
/* Botão flutuante de atendimento: fixo no canto inferior direito e presente em
   todas as telas. A camada 35 fica ACIMA do conteúdo e da barra inferior, mas
   ABAIXO do drawer (40), dos modais (60) e dos toasts (80) — assim ele nunca
   disputa espaço com menus e sobreposições de navegação. */
.support-fab {
  position: fixed;
  right: calc(var(--s-4) + var(--safe-r));
  bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--s-4));
  z-index: 35;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  border: 1px solid var(--accent-line);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55), var(--shadow-accent);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--base) var(--ease), transform var(--base) var(--ease),
              box-shadow var(--base) var(--ease);
}
.support-fab:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.6), 0 12px 30px rgba(200, 255, 0, 0.22);
}
.support-fab:active { transform: scale(0.94); }
.support-fab:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.support-fab svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Halo discreto que chama atenção sem poluir a interface (desligado para quem
   pediu menos movimento — a regra global de prefers-reduced-motion cobre isto). */
.support-fab::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-full);
  border: 1px solid var(--accent-line);
  animation: supportPulse 2.8s var(--ease) infinite;
  pointer-events: none;
}
@keyframes supportPulse {
  0% { transform: scale(1); opacity: 0.7; }
  70%, 100% { transform: scale(1.5); opacity: 0; }
}
/* Rótulo de apoio: só em mouse (ponteiro fino), nunca no toque. */
.support-fab__label {
  position: absolute;
  right: calc(100% + var(--s-3));
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--fg-14);
  background: var(--elev-2);
  color: var(--fg);
  font-size: var(--t-xs);
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--base) var(--ease), visibility var(--base) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .support-fab:hover .support-fab__label,
  .support-fab:focus-visible .support-fab__label { opacity: 1; visibility: visible; }
}

/* ------------------------------------------------------------- modais */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: var(--s-4); }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn var(--base) var(--ease);
}
.modal__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(86dvh, 780px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--fg-14);
  border-radius: var(--r-xl);
  animation: popIn var(--slow) var(--ease);
  overflow: hidden;
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-4) var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--fg-08);
}
.modal__title { font-size: var(--t-md); font-weight: 600; }
.modal__body { padding: var(--s-5); overflow-y: auto; }
.modal__foot {
  padding: var(--s-4) var(--s-5) var(--s-5);
  border-top: 1px solid var(--fg-08);
  display: flex;
  gap: var(--s-3);
}
.modal__foot:empty { display: none; }
.modal__foot .btn { flex: 1; }

/* Folha inferior para o PIN */
@media (max-width: 639px) {
  .modal--sheet { place-items: end center; padding: 0; }
  .modal--sheet .modal__panel {
    width: 100%;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-bottom: none;
    padding-bottom: var(--safe-b);
    animation: sheetIn var(--slow) var(--ease);
  }
}
@keyframes sheetIn {
  from { transform: translateY(100%); }
  to   { transform: none; }
}

/* --------------------------------------------------------------- PIN */
.pin__hint { font-size: var(--t-sm); color: var(--fg-60); text-align: center; }
.pin__dots { display: flex; justify-content: center; gap: var(--s-4); margin: var(--s-6) 0; }
.pin__dot {
  width: 13px;
  height: 13px;
  border-radius: var(--r-full);
  border: 1px solid var(--fg-30);
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.pin__dot--on { background: var(--fg); border-color: var(--fg); transform: scale(1.08); }
.pin__dot--err { animation: shake 340ms var(--ease); border-color: var(--fg); border-width: 2px; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.pin__pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.pin__key {
  height: 58px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--fg-04);
  color: var(--fg);
  font-size: var(--t-lg);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--fast) var(--ease), transform var(--fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
.pin__key:hover { background: var(--fg-14); }
.pin__key:active { transform: scale(0.95); }
.pin__key--blank { visibility: hidden; }
.pin__key svg { width: 21px; height: 21px; margin: 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pin__error { margin-top: var(--s-4); text-align: center; font-size: var(--t-sm); font-weight: 500; }

/* ------------------------------------------------------------ loading */
.loading {
  position: fixed;
  inset: 0;
  z-index: var(--z-loading);
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  animation: fadeIn var(--fast) var(--ease);
}
.loading__spinner {
  width: 30px;
  height: 30px;
  border-radius: var(--r-full);
  border: 2px solid var(--fg-30);
  border-top-color: var(--fg);
  animation: spin 680ms linear infinite;
}

/* --------------------------------------------------------------- filtros */
.filters {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-top: var(--s-4);
  border-top: 1px solid var(--fg-08);
  margin-top: var(--s-4);
}

/* ------------------------------------------------------------ timeline */
.timeline { position: relative; padding-left: var(--s-5); }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--fg-14);
}
.timeline__item { position: relative; padding-bottom: var(--s-4); }
.timeline__item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--s-5) + 2px);
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  background: var(--fg);
}
.timeline__item--muted::before { background: var(--fg-30); }

/* ----------------------------------------------------------- utilitários */
.only-sm { display: grid; }
.only-lg { display: none; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.fatal { display: grid; place-content: center; gap: var(--s-3); text-align: center; height: 100dvh; padding: var(--s-6); }

/* ========================================================= RESPONSIVO */
@media (min-width: 640px) {
  .view { padding: var(--s-6) var(--s-6) var(--s-12); }
  .only-sm { display: none; }
  .only-lg { display: initial; }
  /* 72px extras à esquerda mantêm os avisos afastados do botão de suporte. */
  .toasts { bottom: var(--s-6); left: auto; right: calc(var(--s-6) + 72px); transform: none; }
}

@media (min-width: 1024px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar { display: flex; }
  .tabbar { display: none; }
  .main { padding-bottom: 0; }
  .view { padding: var(--s-8) var(--s-8) var(--s-12); }
  .topbar { padding: var(--s-5) var(--s-8); }
  .topbar__title { font-size: var(--t-lg); }
  .balance { padding: var(--s-8) var(--s-6); }
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal__panel { width: min(560px, 100%); }
  .toasts { width: 400px; }
  /* Sem barra inferior nesta largura: o botão de suporte desce para o canto. */
  .support-fab { right: calc(var(--s-5) + var(--safe-r)); bottom: calc(var(--s-5) + var(--safe-b)); }
}

@media (min-width: 1440px) {
  .view { max-width: 1280px; }
}

/* ================================================= ACESSIBILIDADE */
/* Respeita quem pediu menos movimento no sistema operacional. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Impressão: o comprovante sai como documento em papel — fundo branco e todo o
   texto em preto/cinza. Sem isto, rótulos em ciano claro sumiriam no papel. */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; color: #000; }
  .sidebar, .tabbar, .topbar, .toasts, .modal, .loading, .splash, .no-print { display: none !important; }
  .view { padding: 0; max-width: none; }
  .receipt { border: 1px solid #000; max-width: none; }
  .receipt__head { border-bottom-color: #000; }
  /* Toda a tipografia do comprovante vira preto/cinza legível. */
  .receipt, .receipt * { color: #000 !important; }
  .receipt__brand, .receipt__amount, .receipt__val,
  .receipt__row--total .receipt__key, .receipt__row--total .receipt__val { color: #000 !important; }
  .receipt__key, .receipt__section-title, .receipt__doc,
  .receipt__amount-label, .receipt__number { color: #333 !important; }
  .receipt__section, .receipt__head, .receipt__foot { border-color: #999 !important; }
  .receipt__row { border-bottom-color: #ddd !important; }
  .receipt__foot { background: #fff !important; }
  /* Status: no papel não há cor de fundo confiável, então vira texto com moldura. */
  .receipt__status .status { border: 1px solid #000 !important; color: #000 !important; background: #fff !important; }
}

/* ==========================================================================
   TELAS DE AUTENTICAÇÃO
   Entrar, criar conta, recuperar e redefinir senha. Centralizadas, com o
   cartão ocupando a largura toda no celular e uma coluna confortável no
   desktop — formulário longo em tela grande fica ilegível se esticar demais.
   ========================================================================== */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(var(--s-6) + var(--safe-t)) var(--s-4) calc(var(--s-6) + var(--safe-b));
}
.auth__card {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  animation: riseIn var(--slow) var(--ease) both;
}
.auth__brand {
  display: flex;
  justify-content: center;
  margin-bottom: var(--s-8);
}
.auth__brand .brand {
  font-size: var(--t-base);
  letter-spacing: 0.42em;
}
.auth__brand .brand__mark { width: 1.7em; height: 1.2em; }
.auth__brand .brand__name { padding-left: 0.42em; }
.auth__card > .h1 { text-align: center; }
.auth__card > .muted { text-align: center; }
.auth__card > .notice { margin-bottom: var(--s-5); }
.auth__foot {
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--fg-08);
}

/* O shell fica escondido enquanto a tela de login está ativa. */
body:has(.auth) .topbar { display: none; }

@media (min-width: 1024px) {
  .auth { padding: var(--s-12) var(--s-6); }
  .auth__card { width: min(460px, 100%); }
}

/* ==========================================================================
   TABELAS DO PAINEL ADMINISTRATIVO
   Muitas colunas numéricas: alinhamento à direita e dígitos tabulares para
   que os valores fiquem empilhados na vertical e possam ser comparados.
   ========================================================================== */
.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-sm);
  min-width: 620px;
}
.adm-table th {
  text-align: left;
  padding: var(--s-3) var(--s-4);
  font-size: var(--t-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-45);
  border-bottom: 1px solid var(--fg-14);
  white-space: nowrap;
  background: var(--bg);
}
.adm-table td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--fg-08);
  vertical-align: middle;
  color: var(--fg-80);
}
.adm-table tbody tr:last-child td { border-bottom: none; }
.adm-table tbody tr:hover td { background: var(--fg-04); }
.adm-table td.num,
.adm-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.adm-table .status { font-size: 9px; }

/* Em telas pequenas a tabela rola na horizontal em vez de espremer colunas. */
@media (max-width: 639px) {
  .adm-table { min-width: 560px; }
  .adm-table th, .adm-table td { padding: var(--s-3); }
}

/* Rótulo do campo de busca/filtro dentro dos cartões do admin. */
.adm-filter-label {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-45);
  margin-bottom: var(--s-2);
  display: block;
}

/* ==========================================================================
   AJUSTES DE POLIMENTO
   ========================================================================== */

/* O bloco de valor no cabeçalho do comprovante precisa de respiro próprio. */
.receipt__amount { font-variant-numeric: tabular-nums; }

/* Estado de carregamento em botões pequenos não deve deslocar o texto. */
.btn--sm.btn--loading::after { width: 14px; height: 14px; border-width: 2px; }

/* O pre do payload do webhook: fonte monoespaçada legível e quebra de linha. */
pre.mono {
  font-family: var(--font-num);
  line-height: 1.55;
  tab-size: 2;
}

/* Chips em linha dentro dos cartões do admin precisam de respiro inferior. */
.card > .chips { margin-bottom: var(--s-1); }

/* O grid de métricas do admin: valores grandes não devem quebrar feio. */
.grid--auto .h1,
.grid--auto .h2 { letter-spacing: -0.02em; }

/* ---------------------------------------------------------------------------
   TEXTO LONGO NUNCA ULTRAPASSA O CAMPO
   Em telas estreitas, valores altos, IDs e mensagens longas precisam quebrar
   dentro do próprio componente. Sem isto, o texto vaza do cartão e o layout
   fica desalinhado no celular.
   --------------------------------------------------------------------------- */
.hero,
.metric__value,
.balance__value,
.list__value,
.field__error,
.toast,
.timeline__item,
.empty__title { overflow-wrap: anywhere; }

/* A lista mantém o valor alinhado à direita sem empurrar o título para fora. */
.list__value { min-width: 0; }
.list__sub { overflow-wrap: anywhere; }

/* ==========================================================================
   REVISÃO FINAL — RESPONSIVIDADE, EFEITOS E ACABAMENTO
   Este bloco fica no FIM do arquivo de propósito: pela cascata do CSS, regras
   de mesma especificidade declaradas depois vencem as anteriores. Assim as
   correções abaixo têm efeito sem precisar reescrever cada regra na origem.
   ========================================================================== */

/* ---------------------------------------------------------------- animações
   glowPulse e logoIn eram REFERENCIADAS sem existir (.splash__badge pedia
   glowPulse; .splash__logo pedia logoIn). O navegador ignora em SILÊNCIO uma
   animação sem @keyframes correspondente — por isso a abertura do app ficava
   parada. Definidas aqui, o splash volta a se mover. */
@keyframes glowPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.94); }
  50%      { opacity: 1;    transform: scale(1.05); }
}
@keyframes logoIn {
  from { opacity: 0; transform: scale(0.82) translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes shimmer {
  from { background-position: 150% 0; }
  to   { background-position: -50% 0; }
}
@keyframes rippleOut {
  from { opacity: 0.3; transform: scale(0); }
  to   { opacity: 0;   transform: scale(1); }
}

/* ------------------------------------------------- safe areas (notch / ilha)
   As barras e o conteúdo ignoravam --safe-l/--safe-r. Em MODO PAISAGEM o
   conteúdo entrava debaixo do recorte da câmera. Agora todos respeitam. */
.topbar {
  padding: calc(var(--s-3) + var(--safe-t)) calc(var(--s-4) + var(--safe-r)) var(--s-3) calc(var(--s-4) + var(--safe-l));
}
.view {
  padding: var(--s-5) calc(var(--s-4) + var(--safe-r)) var(--s-10) calc(var(--s-4) + var(--safe-l));
}
.tabbar {
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}
.modal {
  padding: calc(var(--s-4) + var(--safe-t)) calc(var(--s-4) + var(--safe-r)) calc(var(--s-4) + var(--safe-b)) calc(var(--s-4) + var(--safe-l));
}

/* ------------------------------------------------- grids que não estouram
   minmax(210px, 1fr) força coluna de no MÍNIMO 210px: em tela estreita (ou com
   zoom alto) isso empurra o layout para fora e cria rolagem lateral. O
   min(210px, 100%) permite a coluna encolher até caber. */
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }
.filters { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.balance__meta { grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); }

/* ------------------------------------------------------- botões e onda (ripple)
   O effects.js JÁ criava <span class="ripple">, mas a classe não existia no
   CSS: a onda ao toque nunca apareceu. */
.btn {
  position: relative;   /* âncora da onda e do spinner de carregamento */
  overflow: hidden;     /* a onda não vaza dos cantos arredondados */
}
.ripple {
  position: absolute;
  border-radius: var(--r-full);
  background: currentColor;
  opacity: 0.3;
  transform: scale(0);
  pointer-events: none; /* a onda NUNCA intercepta o clique */
  animation: rippleOut 620ms var(--ease) forwards;
}

/* ------------------------------------- realce que segue o ponteiro (mouse)
   O effects.js grava --mx/--my em .card/.balance/.auth__card, mas nenhuma
   regra usava essas variáveis — o efeito não existia. Restrito a ponteiro
   fino para não acender a tela ao tocar no celular. */
@media (hover: hover) and (pointer: fine) {
  .card, .balance, .auth__card { position: relative; }
  .card::after,
  .balance::after,
  .auth__card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--base) var(--ease);
    background: radial-gradient(
      240px circle at var(--mx, 50%) var(--my, 50%),
      rgba(255, 255, 255, 0.07),
      transparent 62%
    );
  }
  .card:hover::after,
  .balance:hover::after,
  .auth__card:hover::after { opacity: 1; }
}

/* -------------------------------------- transições explícitas (não "all")
   transition: all anima TODA propriedade, inclusive as que o navegador
   recalcula a cada quadro — custo desnecessário em listas e chips. */
.chip {
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease),
              background var(--fast) var(--ease);
}
.segmented__btn {
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

/* ------------------------------------------------------- cascata de entrada
   Os blocos da tela sobem em sequência curta. Só os 6 primeiros recebem
   atraso: uma lista longa não deve ficar "pingando" na tela. A animação vive
   no item do stack, então atualizar os dados DENTRO dele não reanima a tela. */
.view > .stack > * { animation: riseIn var(--slow) var(--ease) both; }
.view > .stack > *:nth-child(2) { animation-delay: 45ms; }
.view > .stack > *:nth-child(3) { animation-delay: 90ms; }
.view > .stack > *:nth-child(4) { animation-delay: 135ms; }
.view > .stack > *:nth-child(5) { animation-delay: 180ms; }
.view > .stack > *:nth-child(6) { animation-delay: 225ms; }

/* ----------------------------------------- tabelas do admin SEM cortar coluna
   O wrapper antigo usava margens negativas (-20px), presumindo um cartão COM
   padding. Como a tabela vive dentro de .card--flush (padding 0 + overflow
   hidden), o resultado era a PRIMEIRA coluna cortada e a última empurrada
   para fora — em todas as telas. Aqui só há rolagem, sem deslocamento. */
.adm-table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;   /* arrastar a tabela não puxa a página */
  -webkit-overflow-scrolling: touch;
}

/* ------------------------------------------- abas do admin em linha única
   Eram 10 abas quebrando em ~4 linhas no celular. Agora rolam na horizontal. */
.chips--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  padding-bottom: 2px;   /* o anel de foco não pode ser cortado */
}
.chips--scroll::-webkit-scrollbar { display: none; }
.chips--scroll > .chip { flex: none; scroll-snap-align: start; }

/* ------------------------------------ feedback dos avisos SEM usar cor
   A identidade é preto e branco: a distinção vem de borda e marca lateral. */
.toast { position: relative; overflow: hidden; }
.toast--error { border-width: 2px; }
.toast--error::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--bg);
}
.toast--success { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.28); }

/* ----------------------------------------------- esqueleto de carregamento
   Um brilho atravessando o bloco comunica "carregando" melhor do que um piscar
   de opacidade — e não custa layout (só background-position). O gradiente é
   simétrico, então repete sem emenda. */
.sk {
  border-radius: var(--r-sm);
  background-image: linear-gradient(90deg, var(--fg-08) 0%, var(--fg-14) 42%, var(--fg-08) 84%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}

/* --------------------------------------------------- telas muito estreitas */
@media (max-width: 400px) {
  .balance { padding: var(--s-5) var(--s-4); }
  /* :not(.card--flush) preserva os cartões "sem padding" (tabelas do admin). */
  .card:not(.card--flush):not(.card--pad-sm) { padding: var(--s-4); }
  .view {
    padding-left: calc(var(--s-3) + var(--safe-l));
    padding-right: calc(var(--s-3) + var(--safe-r));
  }
}

/* ------------------------------------------------------- acabamento fino */
.btn--sm svg { width: 16px; height: 16px; }

/* ============================================================================
   MCASH — IDENTIDADE "BLACK & ELECTRIC" (camada visual final)
   PRETO ABSOLUTO (#000000) dominante, superfícies em #0D0D0D e cards #181818,
   com o VERDE ELÉTRICO (#C8FF00) reservado para DESTAQUE: ação principal,
   valores positivos, seleção, foco, indicadores e detalhes.
   O verde nunca vira fundo de tela — no máximo um véu de 6% a 16% sobre o preto.
   Nenhum token azul/ciano/violeta da identidade anterior permanece aqui: os
   tokens agora vivem SÓ no :root do topo deste arquivo (sem :root duplicado).
   ============================================================================ */

html, body { background: var(--bg); }
/* Preto contínuo com dois brilhos quase imperceptíveis: um verde muito suave
   no topo e um cinza frio no canto inferior. O verde NÃO vira faixa de fundo —
   serve só para dar profundidade ao preto. */
body {
  background:
    radial-gradient(860px 500px at 50% -16%, rgba(200, 255, 0, 0.055), transparent 66%),
    radial-gradient(700px 520px at 100% 104%, rgba(245, 245, 242, 0.022), transparent 62%),
    var(--bg);
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes softPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 255, 0, 0); }
  50% { box-shadow: 0 0 0 7px rgba(200, 255, 0, 0.10); }
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
/* O verde "respira" devagar: usado no brilho do login e no indicador ao vivo.
   É opacidade pura, então não custa layout nem repintura da tela toda. */
@keyframes accentBreathe {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* ------------------------------------------------------------ barras fixas */
.topbar, .tabbar {
  background: rgba(0, 0, 0, 0.82);
  border-color: var(--line);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
}
.topbar { box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55); }
.tabbar { box-shadow: 0 -14px 34px rgba(0, 0, 0, 0.55); }
.sidebar {
  background: linear-gradient(180deg, #0D0D0D 0%, #050505 100%);
  border-color: var(--line);
}
/* A marca participa da identidade com um halo verde discreto. */
.brand__mark, .splash__logo, .receipt__mark { filter: drop-shadow(0 0 12px rgba(200, 255, 0, 0.28)); }

/* -------------------------------------------------------------------- menu */
.nav__item { color: rgba(245, 245, 242, 0.62); }
.nav__item:hover { color: var(--fg); background: rgba(245, 245, 242, 0.05); }
.nav__item[aria-current="page"] {
  color: var(--fg);
  background: linear-gradient(100deg, rgba(200, 255, 0, 0.12), rgba(200, 255, 0, 0.02));
  border-color: rgba(200, 255, 0, 0.22);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav__icon { transition: color var(--base) var(--ease), transform var(--base) var(--ease); }
.nav__item[aria-current="page"] .nav__icon { color: var(--accent); }
.nav__count, .badge { background: var(--accent); color: var(--on-accent); }

/* Aba ativa no celular: verde no ícone e no traço superior. */
.tabbar__item[aria-current="page"] { color: var(--accent); }
.tabbar__item[aria-current="page"]::before { background: var(--accent); box-shadow: 0 0 12px rgba(200, 255, 0, 0.5); }

/* ---------------------------------------------------- cards e superfícies */
.card, .modal__panel {
  background: linear-gradient(160deg, #1B1B1B 0%, #151515 55%, #121212 100%);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}
.card { transition: transform var(--base) var(--ease), border-color var(--base) var(--ease), box-shadow var(--base) var(--ease); }
/* Hover: o card sobe 2px e a borda acende em verde — microinteração, não cor. */
.card:hover { border-color: rgba(200, 255, 0, 0.26); box-shadow: var(--shadow-soft), var(--shadow-accent); transform: translateY(-2px); }
.view > * { animation: floatIn 420ms var(--ease) both; }

/* ------------------------------------------------------------------ saldo */
.balance {
  border-color: rgba(200, 255, 0, 0.24);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(200, 255, 0, 0.14), transparent 52%),
    radial-gradient(90% 130% at 100% 100%, rgba(245, 245, 242, 0.05), transparent 60%),
    linear-gradient(150deg, #161616, #0A0A0A 58%, #101010);
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(200, 255, 0, 0.06), var(--shadow-accent);
  overflow: hidden;
  position: relative;
}
.balance::after {
  content: ""; position: absolute; width: 180px; height: 180px; right: -70px; top: -90px;
  border-radius: 50%; border: 1px solid rgba(200, 255, 0, 0.18); box-shadow: 0 0 0 18px rgba(200, 255, 0, 0.03), 0 0 0 36px rgba(245, 245, 242, 0.02);
  pointer-events: none;
}
.balance__label { color: var(--ink-2); }
.balance__value { color: var(--fg); text-shadow: 0 0 30px rgba(200, 255, 0, 0.16); }
.metric__label { color: var(--ink-2); }
.metric__value { color: var(--fg); }

.btn {
  border-color: #2E2E2E;
  background: rgba(245, 245, 242, 0.03);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.btn:hover { border-color: rgba(200, 255, 0, 0.45); background: rgba(200, 255, 0, 0.07); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.985); }
/* Ação principal: o verde na forma mais forte — fundo verde e texto preto. */
.btn--primary {
  color: var(--on-accent); border-color: transparent;
  background: linear-gradient(100deg, var(--accent), #E4FF6A 50%, var(--accent));
  background-size: 200% 100%;
  box-shadow: 0 10px 26px rgba(200, 255, 0, 0.16);
}
.btn--primary:hover {
  color: var(--on-accent); border-color: transparent;
  background: linear-gradient(100deg, var(--accent-hover), var(--accent) 50%, var(--accent-hover));
  background-position: 100% 50%;
  box-shadow: 0 14px 34px rgba(200, 255, 0, 0.24);
}
.btn--ghost:hover { color: var(--accent); background: rgba(200, 255, 0, 0.07); }
.btn--danger { border-color: rgba(255, 77, 95, 0.50); color: #FF8A97; }
.btn--danger:hover { border-color: var(--danger); background: rgba(255, 77, 95, 0.08); color: #FFB3BC; }

/* -------------------------------------------------------------- formulários */
.input, .select, .textarea {
  background: var(--surface);
  border-color: var(--line);
  color: var(--fg);
}
.input:hover, .select:hover, .textarea:hover { border-color: #333333; }
/* Foco: borda verde + anel suave. É o indicador mais visível do formulário. */
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent); background: #111111;
  box-shadow: 0 0 0 4px rgba(200, 255, 0, 0.12), 0 8px 22px rgba(0, 0, 0, 0.35);
}
.field__label { color: var(--fg-80); }
.field__hint, .muted { color: var(--ink-2); }
.field__error { color: var(--danger); }

/* ------------------------------------------------------------------ chips */
.chip { border-color: var(--line); background: rgba(245, 245, 242, 0.02); color: var(--fg-60); }
.chip:hover { border-color: #3A3A3A; color: var(--fg); background: rgba(245, 245, 242, 0.05); }
/* Selecionado = verde: é o "estado ativo" da identidade. */
.chip[aria-pressed="true"], .chip[aria-pressed="true"]:hover {
  border-color: var(--accent-line);
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(200, 255, 0, 0.10);
}
.segmented { border-color: var(--line); background: var(--surface); }
.segmented__btn:not([aria-pressed="true"]):hover { color: var(--fg); background: rgba(245, 245, 242, 0.05); }
.segmented__btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* ------------------------------------------------------------------ listas */
.list__item:hover { background: rgba(200, 255, 0, 0.045); }
.list__icon { color: var(--accent); background: var(--accent-soft); border-color: rgba(200, 255, 0, 0.18); }
/* Valor de ENTRADA é o "positivo" da identidade: verde. A saída fica neutra. */
.list__value--in { color: var(--accent); }
.list__value--out { color: var(--fg-80); }

/* ------------------------------------------------------------------ estados */
.status { border-color: #2E2E2E; color: var(--fg-80); background: rgba(245, 245, 242, 0.03); }
.status--done { background: rgba(200, 255, 0, 0.14); border-color: rgba(200, 255, 0, 0.48); color: var(--accent); }
.status--pending { border-color: rgba(255, 207, 51, 0.55); color: var(--warning); background: rgba(255, 207, 51, 0.08); }
.status--failed { border-color: rgba(255, 77, 95, 0.55); color: var(--danger); background: rgba(255, 77, 95, 0.08); }
.status--canceled { color: var(--ink-2); border-color: var(--line); }

/* ---------------------------------------------------------------- gráficos
   O SVG do gráfico não tinha NENHUM estilo de grade nem de rótulo: como o
   preenchimento padrão de <text> é PRETO, os valores dos eixos ficavam
   invisíveis no tema escuro, e o tooltip não tinha fundo nem âncora de
   posição. Aqui eixo, grade, cursor, tooltip e barras ganham a identidade. */
.chart, .receipt, .qr, .copy-box { border-color: var(--line); background: rgba(13, 13, 13, 0.75); }
.chart__canvas { position: relative; }          /* âncora do tooltip */
.chart__svg { display: block; width: 100%; height: auto; }
.chart__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.chart__title { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.chart__live { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-xs); color: var(--accent); }
.chart__controls { display: flex; flex-direction: column; gap: var(--s-2); margin: var(--s-4) 0 var(--s-3); }
.chart__grid line { stroke: rgba(245, 245, 242, 0.07); stroke-width: 1; }
.chart__grid line.chart__zero { stroke: rgba(245, 245, 242, 0.22); stroke-dasharray: 4 4; }
.chart__ylabels text, .chart__xlabels text { fill: var(--ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart__line { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 10px rgba(200, 255, 0, 0.28)); }
.chart__line--dashed { stroke: var(--ink-2); stroke-width: 1.75; stroke-dasharray: 5 5; filter: none; }
.chart__area { fill: rgba(200, 255, 0, 0.10); }
.chart__dot { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.chart__dot--live { fill: var(--accent); stroke: rgba(200, 255, 0, 0.35); stroke-width: 4; }
.chart__crosshair { stroke: rgba(200, 255, 0, 0.35); stroke-width: 1; stroke-dasharray: 3 3; }
.chart__pulse {
  width: 8px; height: 8px; flex: none;
  border-radius: var(--r-full);
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(200, 255, 0, 0.10);
  animation: softPulse 2.2s ease-in-out infinite;
}
.chart__pulse--beat { animation: softPulse 900ms ease-out; }
.chart__empty { padding: var(--s-6) 0; text-align: center; color: var(--ink-2); font-size: var(--t-sm); }
.chart__tip {
  position: absolute; z-index: 2; transform: translateX(-50%);
  min-width: 148px;
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(24, 24, 24, 0.97);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}
.chart__tip-date { margin-bottom: 6px; font-size: var(--t-xs); color: var(--ink-2); }
.chart__tip-row { display: flex; justify-content: space-between; gap: var(--s-4); font-size: var(--t-sm); }
.chart__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: var(--s-3); margin-top: var(--s-4); }
.chart__stat { padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.chart__facts { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line-soft); }
.chart__fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chart__fact .tiny { color: var(--ink-2); }
.chart__breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: var(--s-5); margin-top: var(--s-5); }
.chart__bars-title { margin-bottom: var(--s-3); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.chart__bar + .chart__bar { margin-top: var(--s-3); }
.chart__bar-head { display: flex; justify-content: space-between; gap: var(--s-3); margin-bottom: 6px; font-size: var(--t-sm); }
.chart__bar-track { height: 6px; border-radius: var(--r-full); background: rgba(245, 245, 242, 0.06); overflow: hidden; }
.chart__bar-fill {
  height: 100%; border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--accent-hover), var(--accent));
  box-shadow: 0 0 12px rgba(200, 255, 0, 0.25);
  transition: width var(--slow) var(--ease);
}

/* ------------------------------------------------------------ comprovante */
.receipt { box-shadow: var(--shadow-soft); }
.receipt__head { background: linear-gradient(160deg, rgba(200, 255, 0, 0.10), rgba(245, 245, 242, 0.03)); border-color: rgba(200, 255, 0, 0.22); }
.receipt__brand { color: var(--fg); }
.receipt__amount { color: var(--accent); text-shadow: 0 0 24px rgba(200, 255, 0, 0.20); }
.receipt__foot { background: rgba(245, 245, 242, 0.03); }
.receipt__section { border-color: var(--line-soft); }
/* O QR precisa de branco puro por baixo para qualquer leitor conseguir ler. */
.qr img, .qr canvas { background: #FFFFFF; }

/* ---------------------------------------------------------------- avisos */
.notice { border-color: rgba(200, 255, 0, 0.26); background: rgba(200, 255, 0, 0.06); color: var(--fg-80); }
.notice svg { color: var(--accent); }
.notice--solid { color: var(--on-accent); background: linear-gradient(100deg, var(--accent), #DDFF5C); border-color: transparent; }

/* ---------------------------------------------------------------- toasts */
.toast {
  background: rgba(24, 24, 24, 0.96);
  color: var(--fg);
  border-color: var(--line);
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(245, 245, 242, 0.04);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.toast--success { border-color: rgba(200, 255, 0, 0.45); color: var(--fg); }
.toast--success svg { color: var(--accent); }
.toast--error { border-color: rgba(255, 77, 95, 0.55); color: var(--fg); }
.toast--error svg { color: var(--danger); }

/* -------------------------------------------- carregamento e esqueleto */
.loading { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.loading__spinner { border-color: rgba(200, 255, 0, 0.22); border-top-color: var(--accent); box-shadow: 0 0 18px rgba(200, 255, 0, 0.18); }
.skeleton, .sk {
  background-image: linear-gradient(100deg, rgba(245,245,242,.05) 25%, rgba(200,255,0,.13) 40%, rgba(245,245,242,.05) 55%);
  background-size: 220% 100%;
  animation: shimmer 1.35s linear infinite;
}

/* ------------------------------------------------------------- login / auth */
.auth {
  position: relative; isolation: isolate; overflow: hidden;
  background:
    radial-gradient(70% 70% at 50% 0%, rgba(200, 255, 0, 0.07), transparent 70%),
    radial-gradient(70% 80% at 50% 100%, rgba(245, 245, 242, 0.03), transparent 72%);
}
.auth::before, .auth::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.auth::before { width: 420px; height: 420px; left: -170px; top: -150px; background: radial-gradient(circle, rgba(200,255,0,.10), transparent 68%); animation: accentBreathe 6s ease-in-out infinite; }
.auth::after { width: 460px; height: 460px; right: -210px; bottom: -220px; background: radial-gradient(circle, rgba(245,245,242,.05), transparent 68%); }
.auth__card {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(24, 24, 24, 0.92), rgba(10, 10, 10, 0.96));
  box-shadow: 0 28px 90px rgba(0,0,0,.60), 0 0 0 1px rgba(200,255,0,.05);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.auth__brand { margin-bottom: var(--s-6); }
.auth__brand .brand { color: var(--fg); text-shadow: 0 0 24px rgba(200,255,0,.22); }
.auth__card > .h1 { letter-spacing: -0.035em; font-size: clamp(1.65rem, 4vw, 2rem); }
.auth__card > .muted { max-width: 34ch; margin-left: auto; margin-right: auto; }
.auth__foot { border-color: var(--line-soft); }
.auth__feedback { min-height: 0; }

/* ------------------------------------------------ tabelas do painel (admin) */
.adm-table-wrap, .table-wrap { border-color: var(--line); border-radius: var(--r-lg); background: rgba(13, 13, 13, .5); }
.adm-table th { color: var(--accent); }
.adm-table tbody tr:hover td { background: rgba(200,255,0,.045); }

@media (max-width: 639px) {
  .view { padding-top: var(--s-4); }
  .card { border-radius: 15px; padding: var(--s-4); }
  .balance { padding: var(--s-5) var(--s-4); }
  .balance__meta { gap: var(--s-3); }
  .btn { min-height: 46px; }
  .auth { align-items: start; padding-top: max(1.5rem, calc(var(--s-6) + var(--safe-t))); }
  .auth__card { border-radius: 22px; padding: 1.25rem; }
  .receipt { border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth::before, .chart__pulse, .chart__dot--live, .skeleton, .sk { animation: none !important; }
  .card:hover, .btn:hover { transform: none !important; }
}

/* ============================================================================
   IDENTIDADE — FECHAMENTO DOS COMPONENTES DA CAMADA BASE
   Os componentes abaixo são declarados ANTES da camada visual no arquivo, e
   alguns ainda usavam o CLARO PURO (--fg) onde a identidade pede o VERDE
   ELÉTRICO (indicador de seleção, marcador de sucesso) ou a cor de estado
   (erro). Como este bloco fica no fim do arquivo, ele vence a cascata e
   garante que nenhum resquício da identidade anterior apareça.
   ============================================================================ */

/* ------------------------------------------------------------------- PIN */
.pin__dot { border-color: #333333; }
.pin__dot--on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px rgba(200, 255, 0, 0.35); }
.pin__dot--err { border-color: var(--danger); border-width: 2px; }
.pin__key { background: var(--surface); border-color: var(--line); color: var(--fg); }
.pin__key:hover { background: var(--elev-2); border-color: #333333; }
.pin__key:active { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent); }
.pin__error { color: var(--danger); }

/* --------------------------------------------------------------- timeline */
.timeline::before { background: var(--line); }
.timeline__item::before { background: var(--accent); box-shadow: 0 0 10px rgba(200, 255, 0, 0.35); }
.timeline__item--muted::before { background: #3A3A3A; box-shadow: none; }

/* --------------------------- marcadores laterais dos avisos (toast) --------
   A marca lateral agora usa a COR DE ESTADO: verde no sucesso, #FF4D5F no
   erro. Antes ela era preta sobre o toast claro da identidade antiga. */
.toast--error { border-width: 1px; }
.toast--error::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--danger);
}
.toast--success::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
}
.toast--success { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(200, 255, 0, 0.20); }

/* ------------------------------------------------------ QR e estados vazios
   O QR mantém BRANCO PURO por baixo: é exigência de leitura dos leitores de
   código, não uma escolha estética. */
.qr img, .qr canvas { background: #FFFFFF; }
.qr__placeholder { border-color: var(--line); color: var(--ink-2); }
.empty, .empty__icon { color: var(--ink-2); }
.empty__icon { border-color: var(--line); }
.who__avatar { border-color: var(--line); background: var(--surface); color: var(--fg); }
.pagination { border-color: var(--line-soft); }
.adm-filter-label { color: var(--ink-2); }
