/* ==========================================================================
   MCASH :: mcash.css — sistema visual único
   Identidade: PRETO ABSOLUTO (#000) + BRANCO e escala de CINZA.
   A hierarquia nasce de luminância, peso e espaço — não de cor. Cor semântica
   (verde/âmbar/vermelho) aparece SÓ em status, em dose mínima e dessaturada.
   Movimento: só transform/opacity (GPU), 140–420ms, desligado com
   prefers-reduced-motion. Substitui as antigas app.css + motion.css.
   ========================================================================== */

:root {
  --bg: #000000;
  --s1: #0a0a0a;
  --s2: #101010;
  --s3: #161616;
  --s4: #1e1e1e;
  --s5: #262626;

  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.2);

  --fg: #fafafa;
  --fg-2: #a3a3a3;
  --fg-3: #737373;
  --fg-4: #4d4d4d;

  --pos: #5fd39a;
  --pos-bg: rgba(95, 211, 154, 0.1);
  --warn: #e8b55a;
  --warn-bg: rgba(232, 181, 90, 0.1);
  --neg: #f07a7a;
  --neg-bg: rgba(240, 122, 122, 0.1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-base: 0.9375rem;
  --t-field: 16px; /* iOS: abaixo de 16px o Safari aplica zoom ao focar. Não reduza. */
  --t-md: 1.0625rem;
  --t-lg: 1.25rem;
  --t-xl: 1.625rem;
  --t-hero: clamp(2.25rem, 9vw, 3.5rem);

  --r-lg: 20px;
  --r-full: 999px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 140ms;
  --base: 220ms;
  --slow: 420ms;

  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -24px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 40px 80px -30px rgba(0, 0, 0, 0.95);

  --sidebar-w: 256px;
  --tabbar-h: 64px;
  --topbar-h: 60px;
  --z-drawer: 40;
  --z-modal: 60;
  --z-toast: 80;
  --z-loading: 90;

  --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);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  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;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
/* iOS: campo com fonte < 16px faz o Safari dar zoom na página ao focar (inclusive
   no PWA). Regra GLOBAL de elemento: cobre campos criados dinamicamente e sem classe. */
input, select, textarea { font-size: var(--t-field); }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--fg); }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: rgba(255, 255, 255, 0.85); color: #000; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 6px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------------------- tipografia */
.h1 { font-family: var(--font-display); font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.h2 { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.h3 { font-size: var(--t-md); font-weight: 600; letter-spacing: -0.01em; }
.body { color: var(--fg-2); }
.muted { color: var(--fg-2); }
.tiny { font-size: var(--t-xs); color: var(--fg-3); }
.strong { font-weight: 600; color: var(--fg); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: -0.01em; }
.hero { font-family: var(--font-display); font-size: var(--t-hero); font-weight: 700; letter-spacing: -0.04em; line-height: 1.02; }
.center { text-align: center; }
.break { overflow-wrap: anywhere; word-break: break-word; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nowrap { white-space: nowrap; }
/* Ícone dentro de texto corrido: sem isto o SVG ocupava a largura inteira. */
.tiny > svg, .muted > svg, p > svg, .chip svg { display: inline-block; flex: none; width: 14px; height: 14px; vertical-align: -2px; }
.tiny > svg, .muted > svg, p > svg { margin-right: 4px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }

/* ------------------------------------------------------------------ layout */
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack--sm { gap: 10px; }
.stack--lg { gap: 24px; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.row--actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.grid { display: grid; gap: 14px; min-width: 0; }
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.only-sm { display: inline-flex; }
@media (min-width: 1024px) { .only-sm { display: none !important; } }

/* ----------------------------------------------------------------- shell */
.shell { min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 20;
  display: none; flex-direction: column; gap: 6px;
  padding: calc(20px + var(--safe-t)) 14px 16px calc(14px + var(--safe-l));
  background: var(--bg); border-right: 1px solid var(--line); overflow-y: auto;
}
.sidebar__brand { padding: 4px 10px 18px; }
.sidebar__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.main { min-width: 0; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 28px); outline: none; }
.view { width: 100%; max-width: 1240px; margin: 0 auto; padding: 18px calc(16px + var(--safe-r)) 0 calc(16px + var(--safe-l)); }
@media (min-width: 640px) { .view { padding: 24px 24px 0; } }
@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .main { margin-left: var(--sidebar-w); padding-bottom: 48px; }
  .view { padding: 28px 36px 0; }
  .tabbar { display: none !important; }
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; letter-spacing: 0.22em; font-size: 15px; color: var(--fg); }
.brand__mark { width: 28px; height: 28px; border-radius: 8px; }
.brand__name { letter-spacing: 0.22em; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 8px;
  min-height: calc(var(--topbar-h) + var(--safe-t));
  padding: var(--safe-t) calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l));
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--base) var(--ease);
}
.topbar--scrolled { border-bottom-color: var(--line); }
.topbar__title { flex: 1; min-width: 0; font-family: var(--font-display); font-size: 17px; font-weight: 650; letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__actions { display: flex; gap: 4px; align-items: center; }
@media (min-width: 1024px) { .topbar { padding-left: 36px; padding-right: 28px; } .topbar__title { font-size: 19px; } }

.icon-btn {
  position: relative; width: 42px; height: 42px; flex: none;
  display: inline-grid; place-items: center; border-radius: 12px; color: var(--fg-2);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn:hover { background: var(--s3); color: var(--fg); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn--spin svg { animation: spin 0.7s linear infinite; }
.badge {
  position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-full); background: var(--fg); color: #000;
  font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #000;
}

/* ------------------------------------------------------------------ nav */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 42px; padding: 0 12px; border-radius: 12px;
  color: var(--fg-2); font-size: 14.5px; font-weight: 500; text-align: left;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav__item:hover { background: var(--s2); color: var(--fg); }
.nav__item[aria-current="page"] { background: var(--s3); color: var(--fg); }
.nav__item[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--fg); }
.nav__icon { display: grid; place-items: center; width: 20px; }
.nav__icon svg { width: 19px; height: 19px; }
.nav__label { flex: 1; min-width: 0; }
.nav__count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full); background: var(--fg); color: #000; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.nav__group { margin: 14px 12px 6px; }
.nav__group:first-child { margin-top: 0; }

.who { display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%; }
.who__avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--s4); border: 1px solid var(--line-2); font-size: 13px; font-weight: 650; letter-spacing: 0.02em; }
.who__meta { flex: 1; min-width: 0; line-height: 1.3; }

/* ---------------------------------------------------------------- tabbar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
  background: rgba(0, 0, 0, 0.82);
  -webkit-backdrop-filter: saturate(160%) blur(20px); backdrop-filter: saturate(160%) blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--fg-3); font-size: 10.5px; font-weight: 550; letter-spacing: 0.01em; transition: color var(--fast) var(--ease); }
.tabbar__item svg { width: 22px; height: 22px; transition: transform var(--base) var(--ease-out); }
.tabbar__item[aria-current="page"] { color: var(--fg); }
.tabbar__item[aria-current="page"] svg { transform: translateY(-1px); stroke-width: 2; }
.tabbar__item:active svg { transform: scale(0.9); }

/* ---------------------------------------------------------------- drawer */
.drawer { position: fixed; inset: 0; z-index: var(--z-drawer); }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade-in var(--base) var(--ease); }
.drawer__panel {
  position: absolute; inset: 0 auto 0 0; width: min(86vw, 320px);
  display: flex; flex-direction: column; gap: 10px;
  padding: calc(16px + var(--safe-t)) 14px calc(16px + var(--safe-b)) calc(14px + var(--safe-l));
  background: var(--s1); border-right: 1px solid var(--line-2);
  animation: drawer-in var(--slow) var(--ease-out); overflow-y: auto;
}
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 12px; }
.drawer__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.nav--stack .nav__item { min-height: 46px; font-size: 15px; }

/* ---------------------------------------------------- layouts sem sessão */
body[data-layout="auth"] .sidebar,
body[data-layout="auth"] .topbar,
body[data-layout="auth"] .tabbar,
body[data-layout="open"] .sidebar,
body[data-layout="open"] .tabbar,
body[data-layout="open"] #btn-menu,
body[data-layout="open"] #btn-notifications,
body[data-layout="open"] #btn-refresh { display: none !important; }
body[data-layout="auth"] .main,
body[data-layout="open"] .main { margin-left: 0; padding-bottom: 40px; }
.topbar__guest { display: none !important; }
body[data-layout="open"] .topbar__guest { display: inline-flex !important; }

/* ---------------------------------------------------------------- botões */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 14px;
  background: var(--s3); color: var(--fg); border: 1px solid var(--line-2);
  font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; text-decoration: none;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease), opacity var(--fast) var(--ease), box-shadow var(--base) var(--ease);
  overflow: hidden; isolation: isolate; user-select: none; -webkit-user-select: none;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { background: var(--s4); border-color: var(--line-3); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; transform: none; }
.btn--primary { background: var(--fg); color: #000; border-color: var(--fg); }
.btn--primary:hover { background: #fff; border-color: #fff; box-shadow: 0 8px 28px -10px rgba(255, 255, 255, 0.35); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn--ghost:hover { background: var(--s3); border-color: transparent; color: var(--fg); }
.btn--danger { background: transparent; color: var(--neg); border-color: rgba(240, 122, 122, 0.35); }
.btn--danger:hover { background: var(--neg-bg); border-color: rgba(240, 122, 122, 0.6); }
.btn--sm { min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13px; }
.btn--sm svg { width: 16px; height: 16px; }
.btn--block { width: 100%; }
.btn--loading { color: transparent !important; pointer-events: none; }
.btn--loading > * { opacity: 0; }
.btn--loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid; border-color: var(--fg-2) transparent var(--fg-2) transparent; animation: spin 0.7s linear infinite; }
.btn--primary.btn--loading::after { border-color: #000 transparent #000 transparent; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: 0.18; transform: scale(0); animation: ripple 560ms var(--ease-out) forwards; pointer-events: none; z-index: -1; }
.btn--primary .ripple { background: #000; opacity: 0.12; }

/* ------------------------------------------------------------------ cards */
.card {
  position: relative; min-width: 0;
  background: linear-gradient(180deg, #0d0d0d 0%, #090909 100%);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--shadow);
  transition: border-color var(--base) var(--ease), transform var(--base) var(--ease);
}
@media (min-width: 640px) { .card { padding: 22px; } }
.card--flush { padding: 0; overflow: hidden; }
.card--pad-sm { padding: 14px; }
.card[role="button"]:hover { border-color: var(--line-2); transform: translateY(-1px); }
.card__head, .section__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card--flush > .card__head, .card--flush > .section__head { padding: 18px 18px 0; }
.card__title, .section__title { font-family: var(--font-display); font-size: 16px; font-weight: 650; letter-spacing: -0.015em; }
.section__sub { margin-top: 2px; font-size: var(--t-sm); color: var(--fg-3); }
.metric__label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--fg-3); text-transform: uppercase; }
.metric__value { margin-top: 4px; font-size: var(--t-md); font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- campos */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field__label { font-size: 13px; font-weight: 550; color: var(--fg-2); }
.field__hint { font-size: 12px; color: var(--fg-3); }
.field__error { font-size: 12.5px; color: var(--neg); }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 0 15px;
  background: var(--s2); border: 1px solid var(--line-2); border-radius: 14px;
  font-size: var(--t-field); color: var(--fg);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
  -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 96px; padding: 12px 15px; resize: vertical; line-height: 1.45; }
.input::placeholder, .textarea::placeholder { color: var(--fg-4); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--fg-2); background: var(--s3); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06); }
.select { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; text-overflow: ellipsis; }
.select option { background: #111; color: var(--fg); }
input[type="checkbox"].check { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: #fff; }

.amount-field { display: flex; align-items: baseline; gap: 8px; padding: 18px 18px 14px; border: 1px solid var(--line-2); border-radius: 18px; background: var(--s2); transition: border-color var(--fast) var(--ease); min-width: 0; }
.amount-field:focus-within { border-color: var(--fg-2); }
.amount-field__prefix { font-size: 20px; font-weight: 600; color: var(--fg-3); }
.amount-field__input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font-family: var(--font-display); font-size: clamp(30px, 8vw, 40px); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; outline: none; }
.amount-field__input::placeholder { color: var(--fg-4); }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 10px; }

/* --------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 0 2px 2px; margin: 0 -2px; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 13px;
  border-radius: var(--r-full); border: 1px solid var(--line-2); background: transparent;
  color: var(--fg-2); font-size: 13px; font-weight: 550; white-space: nowrap;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.chip:hover { border-color: var(--line-3); color: var(--fg); }
.chip[aria-pressed="true"], .chip.is-active, .chip[aria-selected="true"], .chip[aria-current="true"] { background: var(--fg); color: #000; border-color: var(--fg); }
.chip--static { cursor: default; font-size: 11.5px; min-height: 24px !important; padding: 0 9px; background: var(--s3); border-color: var(--line); color: var(--fg-2); }
@media (pointer: coarse), (max-width: 480px) { .chip { min-height: 40px; } }

/* --------------------------------------------------------------- status */
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 8px; border-radius: var(--r-full); font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; background: var(--s4); color: var(--fg-2); flex: none; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--done { background: var(--pos-bg); color: var(--pos); }
.status--pending { background: var(--warn-bg); color: var(--warn); }
.status--pending::before { animation: blink 1.6s ease-in-out infinite; }
.status--failed { background: var(--neg-bg); color: var(--neg); }
.status--canceled { background: var(--s4); color: var(--fg-3); }

/* ---------------------------------------------------------------- listas */
.list { display: flex; flex-direction: column; }
.list__item { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 14px 18px; border-top: 1px solid var(--line); cursor: pointer; transition: background var(--fast) var(--ease); outline-offset: -2px; }
.list__item:first-child { border-top: 0; }
.list__item:hover { background: rgba(255, 255, 255, 0.025); }
.list__item:active { background: rgba(255, 255, 255, 0.04); }
.list__item--static { cursor: default; }
.list__item--static:hover { background: transparent; }
.card:not(.card--flush) .list__item { padding-left: 0; padding-right: 0; }
.list__icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 13px; background: var(--s3); border: 1px solid var(--line); color: var(--fg); }
.list__icon svg { width: 18px; height: 18px; }
.list__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list__title { font-size: 14.5px; font-weight: 550; color: var(--fg); }
.list__sub { font-size: 12.5px; color: var(--fg-3); }
.list__value { flex: none; font-size: 14.5px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---------------------------------------------------------- notice/empty */
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--s2); color: var(--fg-2); font-size: 13.5px; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--fg); }
.notice--solid { background: var(--s3); color: var(--fg); border-color: var(--line-3); }
.notice--warn { border-color: rgba(232, 181, 90, 0.35); background: var(--warn-bg); color: #f3d9a6; }
.notice--warn svg { color: var(--warn); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 16px; text-align: center; }
.empty__icon { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 18px; background: var(--s3); border: 1px solid var(--line); color: var(--fg-2); }
.empty__icon svg { width: 24px; height: 24px; }
.empty__title { font-size: 15px; font-weight: 600; }
.empty .muted { max-width: 360px; font-size: 13.5px; }
.empty .btn { margin-top: 8px; }

/* ------------------------------------------------------------- skeleton */
.sk { position: relative; overflow: hidden; border-radius: 8px; background: var(--s3); }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent); animation: shimmer 1.4s ease-in-out infinite; }
.sk--hero { height: 34px; }
.sk--text { height: 12px; }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; z-index: var(--z-toast); left: 50%; transform: translateX(-50%); top: calc(12px + var(--safe-t)); width: min(94vw, 420px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border-radius: 16px; background: rgba(22, 22, 22, 0.94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 13.5px; color: var(--fg); animation: toast-in var(--slow) var(--ease-out); cursor: pointer; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast--success svg { color: var(--pos); }
.toast--error svg { color: var(--neg); }
.toast--out { animation: toast-out 200ms var(--ease) forwards; }
@media (min-width: 1024px) { .toasts { left: auto; right: 24px; transform: none; top: 20px; } }

/* ---------------------------------------------------------------- modais */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade-in var(--base) var(--ease); }
.modal__panel { position: relative; width: min(100%, 540px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--s1); border: 1px solid var(--line-2); border-radius: 24px; box-shadow: var(--shadow-lg); animation: modal-in var(--slow) var(--ease-out); overflow: hidden; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 8px 22px; }
.modal__title { font-family: var(--font-display); font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.modal__body { padding: 8px 22px 18px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; }
.modal__foot { display: flex; gap: 10px; padding: 14px 22px calc(18px + var(--safe-b)); border-top: 1px solid var(--line); }
.modal__foot:empty { display: none; }
.modal__foot .btn { flex: 1; }
@media (max-width: 639px) {
  .modal { place-items: end center; padding: 0; }
  .modal__panel { width: 100%; max-height: 92dvh; border-radius: 24px 24px 0 0; animation: sheet-in var(--slow) var(--ease-out); }
}
.modal--sheet .modal__body { align-items: center; }

/* ------------------------------------------------------------------ PIN */
.pin__hint { color: var(--fg-2); text-align: center; font-size: 14px; }
.pin__dots { display: flex; justify-content: center; gap: 12px; margin: 10px 0 6px; }
.pin__dot { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--fg-3); transition: background var(--fast) var(--ease), transform var(--fast) var(--ease), border-color var(--fast); }
.pin__dot--on { background: var(--fg); border-color: var(--fg); transform: scale(1.08); }
.pin__dot--err { border-color: var(--neg); background: var(--neg); animation: shake 0.35s var(--ease); }
.pin__pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; justify-content: center; margin-top: 6px; }
.pin__key { height: 64px; border-radius: 20px; background: var(--s3); border: 1px solid var(--line); font-size: 24px; font-weight: 550; display: grid; place-items: center; transition: background var(--fast), transform var(--fast) var(--ease); }
.pin__key:active { transform: scale(0.94); background: var(--s5); }
.pin__key svg { width: 22px; height: 22px; }
.pin__key--blank { visibility: hidden; }
.pin__error { color: var(--neg); text-align: center; font-size: 13.5px; }

/* -------------------------------------------------------------- loading */
.loading { position: fixed; inset: 0; z-index: var(--z-loading); display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); }
.loading__spinner { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--fg); animation: spin 0.8s linear infinite; }
.top-progress { position: fixed; top: 0; left: 0; height: 2px; z-index: 100; background: var(--fg); box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); transform-origin: left; pointer-events: none; transition: opacity 300ms var(--ease); }

/* --------------------------------------------------------------- splash */
.splash { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; background: #000; transition: opacity 300ms var(--ease); }
.splash--out { opacity: 0; pointer-events: none; }
.splash__mark { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.splash__badge { position: relative; width: 72px; height: 72px; display: grid; place-items: center; }
.splash__ring { position: absolute; inset: 0; border-radius: 22px; border: 1px solid var(--line-3); animation: pulse-ring 1.8s var(--ease) infinite; }
.splash__logo { width: 52px; height: 52px; border-radius: 15px; }
.splash__name { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.4em; font-size: 15px; padding-left: 0.4em; }
.splash__bar { width: 120px; height: 2px; border-radius: 2px; background: var(--s4); overflow: hidden; }
.splash__bar span { display: block; width: 40%; height: 100%; background: var(--fg); animation: bar 1.1s var(--ease) infinite; }

/* ----------------------------------------------------------- suporte FAB */
.support-fab { position: fixed; z-index: 30; right: calc(16px + var(--safe-r)); bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); height: 50px; min-width: 50px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r-full); background: var(--fg); color: #000; text-decoration: none; box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.1); transition: transform var(--base) var(--ease-out); }
.support-fab:hover { transform: translateY(-2px); }
.support-fab svg { width: 21px; height: 21px; stroke-width: 2; }
.support-fab__label { display: none; font-size: 14px; font-weight: 650; }
@media (min-width: 1024px) { .support-fab { bottom: 24px; right: 24px; } .support-fab__label { display: inline; } }
body[data-layout="auth"] .support-fab, body[data-layout="open"] .support-fab { bottom: calc(18px + var(--safe-b)); }

.fatal { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
.fatal__mark { width: 56px; height: 56px; border-radius: 16px; }

/* ------------------------------------------------------------- copiar */
.copy-box { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border: 1px dashed var(--line-3); border-radius: 14px; background: var(--s2); min-width: 0; }
.copy-box__text { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; color: var(--fg-2); overflow-wrap: anywhere; max-height: 86px; overflow-y: auto; }
.qr { display: grid; place-items: center; padding: 14px; border-radius: 20px; background: #fff; width: min(100%, 260px); margin: 0 auto; }
.qr img { width: 100%; height: auto; image-rendering: pixelated; }
.qr__placeholder { width: min(100%, 260px); aspect-ratio: 1; margin: 0 auto; display: grid; place-items: center; border-radius: 20px; border: 1px dashed var(--line-3); color: var(--fg-3); text-align: center; padding: 20px; font-size: 13px; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ----------------------------------------------------------------- live */
.live { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: var(--r-full); border: 1px solid var(--line-2); font-size: 11.5px; font-weight: 600; color: var(--fg-2); white-space: nowrap; }
.live__dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--pos); }
.live__dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid var(--pos); animation: live 1.8s var(--ease) infinite; }
.live--idle .live__dot { background: var(--fg-3); }
.live--idle .live__dot::after { display: none; }

/* ================================================================ DASHBOARD */
.dash { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "quick" "goal" "flow" "chart" "recent" "side"; }
.dash > * { min-width: 0; }
.dash__hero { grid-area: hero; } .dash__quick { grid-area: quick; } .dash__goal { grid-area: goal; }
.dash__flow { grid-area: flow; } .dash__chart { grid-area: chart; } .dash__recent { grid-area: recent; } .dash__side { grid-area: side; }
@media (min-width: 900px) {
  .dash { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); grid-template-areas: "hero flow" "quick quick" "chart goal" "recent side"; gap: 18px; align-items: start; }
  .dash__flow, .dash__hero { align-self: stretch; }
}

.hero-card {
  position: relative; overflow: hidden; padding: 22px; border-radius: 26px; height: 100%;
  background: radial-gradient(120% 140% at 0% 0%, #1b1b1b 0%, #0b0b0b 46%, #050505 100%);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
}
.hero-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(120deg, rgba(255, 255, 255, 0.07), transparent 38%); }
.hero-card::after { content: ""; position: absolute; width: 340px; height: 340px; right: -120px; top: -170px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.05); box-shadow: 0 0 0 46px rgba(255, 255, 255, 0.018), 0 0 0 92px rgba(255, 255, 255, 0.012); pointer-events: none; }
@media (min-width: 640px) { .hero-card { padding: 28px; } }
.hero-card > * { position: relative; z-index: 1; }
.hero-card__top { display: flex; align-items: center; gap: 8px; }
.hero-card__label { flex: 1; font-size: 13.5px; color: var(--fg-2); font-weight: 500; }
.hero-card__eye { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--fg-2); transition: background var(--fast); }
.hero-card__eye:hover { background: rgba(255, 255, 255, 0.06); color: var(--fg); }
.hero-card__eye svg { width: 18px; height: 18px; }
.hero-card__value { margin-top: 14px; overflow-wrap: anywhere; }
.hero-card__stamp { margin-top: 8px; font-size: 12px; color: var(--fg-3); }
.hero-card__split { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hero-card__split .metric__value { font-size: 15px; }
.hero-card__actions { margin-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hero-card__actions .btn { min-height: 50px; padding: 0 10px; }
@media (max-width: 380px) { .hero-card__actions .btn svg { display: none; } .hero-card__split { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.money { transition: filter var(--base) var(--ease); }
.is-masked .money { filter: blur(9px); user-select: none; -webkit-user-select: none; }

/* O cartão é coluna flexível e o corpo ocupa o resto: com height:100% o corpo
   somava a altura do cabeçalho e o saldo do período escapava do cartão. */
.dash__flow { display: flex; flex-direction: column; }
.flow { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.flow__row { display: flex; flex-direction: column; gap: 8px; }
.flow__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.flow__label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); }
.flow__label svg { width: 15px; height: 15px; }
.flow__value { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.flow__net { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }

.progress { position: relative; height: 8px; border-radius: var(--r-full); background: var(--s4); overflow: hidden; }
.progress__bar { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--fg); transition: width 900ms var(--ease-out); }
.progress__bar--dim { background: var(--fg-3); }
.progress--lg { height: 12px; }

.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .quick-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.quick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-height: 92px; padding: 14px 8px; border-radius: 18px; background: var(--s1); border: 1px solid var(--line); text-align: center; transition: background var(--fast), border-color var(--fast), transform var(--base) var(--ease-out); min-width: 0; }
.quick:hover { background: var(--s2); border-color: var(--line-2); transform: translateY(-2px); }
.quick:active { transform: scale(0.97); }
.quick__icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: var(--s3); border: 1px solid var(--line-2); color: var(--fg); }
.quick__icon svg { width: 19px; height: 19px; }
.quick__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 100%; }
.quick__title { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.quick__sub { display: none; }

.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { min-width: 0; padding: 14px; border-radius: 16px; background: var(--s2); border: 1px solid var(--line); }
.kpi__label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-3); font-weight: 500; }
.kpi__label svg { width: 14px; height: 14px; }
.kpi__value { margin-top: 6px; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.kpi__value--pos, .kpi__value--neg, .kpi__value--warn { color: var(--fg); }
.kpi__foot { margin-top: 4px; font-size: 11.5px; color: var(--fg-3); }
.dash-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.dash-grid > * { min-width: 0; }

.goal-card__pct { font-family: var(--font-display); font-size: 40px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; margin: 14px 0 12px; }
.goal-card__pct small { font-size: 18px; color: var(--fg-3); font-weight: 600; margin-left: 2px; }
.goal-card__vals { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--fg-2); flex-wrap: wrap; }
.goal-card__vals strong { color: var(--fg); font-weight: 600; }
.goal-card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.side-stack { display: flex; flex-direction: column; gap: 16px; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.mini-row:first-child { border-top: 0; padding-top: 2px; }
.mini-row__k { display: inline-flex; align-items: center; gap: 9px; color: var(--fg-2); min-width: 0; }
.mini-row__k svg { width: 16px; height: 16px; flex: none; }
.mini-row__v { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* compat: blocos antigos ainda usados em outras telas */
.balance { padding: 22px; border-radius: 24px; background: var(--s1); border: 1px solid var(--line-2); }
.balance__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.balance__label { color: var(--fg-2); font-size: 13.5px; }
.balance__value { margin-top: 10px; }
.balance__meta { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.balance__actions { margin-top: 18px; }
.balance__stamp { margin-top: 12px; }
.sheen { position: relative; }

/* ---------------------------------------------------------------- gráfico */
.chart { display: flex; flex-direction: column; gap: 14px; }
.chart__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chart__title { font-family: var(--font-display); font-size: 16px; font-weight: 650; letter-spacing: -0.015em; }
.chart__live { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--fg-3); }
.chart__pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); }
.chart__pulse--beat { animation: beat 0.9s var(--ease-out); }
.chart__updated { color: var(--fg-3); }
.chart__controls { display: flex; flex-direction: column; gap: 10px; }
.chart__ranges, .chart__metrics { gap: 6px; }
.chart__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .chart__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.chart__stat { padding: 12px; border-radius: 14px; background: var(--s2); border: 1px solid var(--line); min-width: 0; }
.chart__canvas { position: relative; width: 100%; height: 220px; }
@media (min-width: 640px) { .chart__canvas { height: 260px; } }
.chart__svg { width: 100%; height: 100%; overflow: visible; }
.chart__grid line { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.chart__ylabels text, .chart__xlabels text { fill: var(--fg-3); stroke: none; font-size: 10.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart__area { stroke: none; }
.chart__lines path, .chart__line { fill: none; stroke: var(--fg); stroke-width: 2; }
.chart__lines path.chart__line--dashed, .chart__line--dashed { stroke: var(--fg-3); stroke-dasharray: 4 5; stroke-width: 1.6; }
.chart__zero { stroke: rgba(255, 255, 255, 0.18); stroke-dasharray: 2 4; }
.chart__dots circle, .chart__dot { fill: #000; stroke: var(--fg); stroke-width: 2; }
.chart__dot--live { fill: var(--fg); }
.chart__crosshair { stroke: rgba(255, 255, 255, 0.25); stroke-width: 1; stroke-dasharray: 3 3; }
.chart__hit { fill: transparent; stroke: none; cursor: crosshair; }
.chart__tip { position: absolute; z-index: 3; min-width: 150px; padding: 10px 12px; border-radius: 12px; background: rgba(18, 18, 18, 0.96); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 12px; pointer-events: none; }
.chart__tip-date { color: var(--fg-3); margin-bottom: 6px; font-size: 11px; }
.chart__tip-row { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; }
.chart__empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--fg-3); font-size: 13px; text-align: center; padding: 20px; }
.chart__breakdown { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .chart__breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chart__bars { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.chart__bars-title { font-size: 11px; color: var(--fg-3); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.chart__bar { display: flex; flex-direction: column; gap: 6px; }
.chart__bar-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; min-width: 0; }
.chart__bar-track { height: 6px; border-radius: 6px; background: var(--s4); overflow: hidden; }
.chart__bar-fill { height: 100%; border-radius: inherit; background: var(--fg); transition: width 700ms var(--ease-out); }
.chart__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.chart__fact { display: flex; flex-direction: column; gap: 3px; padding: 11px 12px; border-radius: 13px; background: var(--s2); border: 1px solid var(--line); min-width: 0; }

/* --------------------------------------------------------------- timeline */
.timeline { position: relative; display: flex; flex-direction: column; }
.timeline__item { position: relative; padding: 0 0 18px 26px; }
.timeline__item::before { content: ""; position: absolute; left: 6px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--fg); box-shadow: 0 0 0 4px #0a0a0a; }
.timeline__item::after { content: ""; position: absolute; left: 10px; top: 18px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline__item:last-child::after { display: none; }
.timeline__item--muted::before { background: var(--fg-4); }

/* --------------------------------------------------------- tabela admin */
.adm-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 14px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.adm-table th { text-align: left; font-weight: 600; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); padding: 11px 14px; background: var(--s2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.adm-table tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------- auth */
.auth { min-height: calc(100dvh - 40px); display: grid; place-items: center; padding: calc(24px + var(--safe-t)) 4px 24px; position: relative; }
.auth::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(60% 50% at 50% 0%, rgba(255, 255, 255, 0.07), transparent 70%); }
.auth__card { position: relative; width: min(100%, 420px); padding: 32px 24px; border-radius: 28px; background: linear-gradient(180deg, #0f0f0f, #080808); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); animation: rise var(--slow) var(--ease-out); }
@media (min-width: 640px) { .auth__card { padding: 40px 36px; } }
.auth__brand { display: flex; justify-content: center; margin-bottom: 24px; }
.auth__card > .h1, .auth__card > .muted { text-align: center; }
.auth__foot { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; color: var(--fg-2); font-size: 14px; }
.auth__feedback { padding: 12px 14px; border-radius: 12px; background: var(--neg-bg); border: 1px solid rgba(240, 122, 122, 0.3); color: #f6b4b4; font-size: 13.5px; }

/* ============================================================ COMPROVANTE */
.rcpt { width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.rcpt__paper { position: relative; border-radius: 28px; background: linear-gradient(180deg, #0f0f0f 0%, #0a0a0a 100%); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); overflow: hidden; }
.rcpt__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 22px 0; }
.rcpt__brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 700; letter-spacing: 0.22em; font-size: 13px; }
.rcpt__brand img { width: 24px; height: 24px; border-radius: 7px; }
.rcpt__doc { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); font-weight: 650; }
.rcpt__hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 22px 26px; }
.rcpt__icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--fg); color: #000; margin-bottom: 16px; animation: pop 520ms var(--ease-out) both; }
.rcpt__icon svg { width: 28px; height: 28px; stroke-width: 2.4; }
.rcpt__icon--bad { background: var(--neg-bg); color: var(--neg); border: 1px solid rgba(240, 122, 122, 0.3); }
.rcpt__title { font-size: 14px; color: var(--fg-2); font-weight: 500; }
.rcpt__amount { margin-top: 6px; font-family: var(--font-display); font-size: clamp(34px, 10vw, 46px); font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1.05; overflow-wrap: anywhere; }
.rcpt__when { margin-top: 10px; font-size: 13px; color: var(--fg-3); }
.rcpt__tear { position: relative; height: 22px; }
.rcpt__tear::before { content: ""; position: absolute; left: 22px; right: 22px; top: 50%; border-top: 1.5px dashed var(--line-3); }
.rcpt__tear::after { content: ""; position: absolute; inset: 0 -1px; background: radial-gradient(circle at 0 50%, #000 0 11px, transparent 11.5px), radial-gradient(circle at 100% 50%, #000 0 11px, transparent 11.5px); }
.rcpt__section { padding: 16px 22px; }
.rcpt__section + .rcpt__section { border-top: 1px solid var(--line); }
.rcpt__section-title { font-size: 10.5px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 8px; }
.rcpt__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: 14px; }
.rcpt__key { color: var(--fg-2); flex: none; max-width: 48%; }
.rcpt__val { text-align: right; font-weight: 550; min-width: 0; overflow-wrap: anywhere; display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.rcpt__val--num { font-variant-numeric: tabular-nums; }
.rcpt__val--mono { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--fg-2); }
.rcpt__row--total { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 16px; }
.rcpt__row--total .rcpt__key { color: var(--fg); font-weight: 600; }
.rcpt__row--total .rcpt__val { font-weight: 700; }
.rcpt__copy { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; color: var(--fg-3); transition: background var(--fast), color var(--fast); }
.rcpt__copy:hover { background: var(--s4); color: var(--fg); }
.rcpt__copy svg { width: 15px; height: 15px; }
.rcpt__parties { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 480px) { .rcpt__parties { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rcpt__party { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--s2); border: 1px solid var(--line); min-width: 0; }
.rcpt__avatar { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--s4); border: 1px solid var(--line-2); font-size: 13px; font-weight: 650; }
.rcpt__avatar svg { width: 17px; height: 17px; }
.rcpt__party-body { min-width: 0; }
.rcpt__party-role { font-size: 10.5px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); }
.rcpt__party-name { margin-top: 3px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.rcpt__party-extra { margin-top: 2px; font-size: 12.5px; color: var(--fg-3); overflow-wrap: anywhere; }
.rcpt__auth { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 16px; align-items: center; padding: 18px 22px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.015); }
.rcpt__qr { width: 104px; height: 104px; padding: 5px; border-radius: 12px; background: #fff; }
.rcpt__qr svg { width: 100%; height: 100%; }
.rcpt__qr svg path, .rcpt__qr svg rect { stroke: none; }
.rcpt__auth-code { font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; margin-top: 4px; overflow-wrap: anywhere; }
.rcpt__foot { padding: 14px 22px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.rcpt-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rcpt-actions .btn--primary { grid-column: 1 / -1; }
@media (min-width: 560px) { .rcpt-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); } .rcpt-actions .btn--primary { grid-column: auto; } }
.verify-card { max-width: 480px; margin: 12px auto 0; text-align: center; }
.verify-card .rcpt__icon { margin: 4px auto 14px; }

/* compat: classes do comprovante antigo (UI.receiptRow etc.) */
.receipt { display: flex; flex-direction: column; }
.receipt__row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: 14px; }
.receipt__row--total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-weight: 650; }
.receipt__key { color: var(--fg-2); }
.receipt__val { text-align: right; font-weight: 550; overflow-wrap: anywhere; }
.receipt__val--num { font-variant-numeric: tabular-nums; }
.receipt__head, .receipt__section, .receipt__foot { padding: 14px 0; }
.receipt__section-title, .receipt__party-role { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); font-weight: 650; }
.receipt__brand { font-weight: 700; letter-spacing: 0.2em; }
.receipt__rows, .receipt__parties { display: flex; flex-direction: column; gap: 4px; }
.receipt__amount, .receipt__amount-label, .receipt__doc, .receipt__number, .receipt__status, .receipt__party, .receipt__party-name, .receipt__party-extra { overflow-wrap: anywhere; }

/* ===================================================================== METAS */
.goal-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.goal-item { display: flex; flex-direction: column; gap: 12px; cursor: pointer; }
.goal-item:hover { border-color: var(--line-2); transform: translateY(-2px); }
.goal-item__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.goal-item__pct { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.goal-hero { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .goal-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); } }
.goal-ring { position: relative; width: 176px; height: 176px; margin: 8px auto; }
.goal-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.goal-ring__track { stroke: var(--s4); }
.goal-ring__bar { stroke: var(--fg); transition: stroke-dashoffset 1100ms var(--ease-out); }
.goal-ring__label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.goal-ring__pct { font-family: var(--font-display); font-size: 36px; font-weight: 700; letter-spacing: -0.04em; }
.goal-chart { width: 100%; height: 190px; overflow: visible; }
.goal-chart .area { stroke: none; }
.goal-chart .line { stroke: var(--fg); stroke-width: 2; fill: none; }
.goal-chart .target { stroke: var(--fg-3); stroke-dasharray: 4 5; stroke-width: 1.2; }
.goal-chart text { fill: var(--fg-3); stroke: none; font-size: 10.5px; font-family: var(--font); }
.metric-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.metric-pick__opt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--s2); text-align: left; transition: border-color var(--fast), background var(--fast); min-width: 0; }
.metric-pick__opt[aria-pressed="true"] { border-color: var(--fg); background: var(--s3); box-shadow: inset 0 0 0 1px var(--fg); }
.metric-pick__opt strong { font-size: 13.5px; }
.metric-pick__opt span { font-size: 11.5px; color: var(--fg-3); line-height: 1.3; }
@media (max-width: 420px) { .metric-pick { grid-template-columns: minmax(0, 1fr); } }

/* ======================================================================= API */
.api-head { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: end; }
@media (min-width: 900px) { .api-head { grid-template-columns: minmax(0, 1fr) auto; } }
.api-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .api-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.key-item { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-top: 1px solid var(--line); min-width: 0; }
.key-item:first-child { border-top: 0; }
.key-item--revoked { opacity: 0.55; }
.key-item__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.key-item__name { font-size: 15px; font-weight: 650; }
.key-item__key { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 6px 5px 10px; border-radius: 10px; background: var(--s2); border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--fg-2); align-self: flex-start; min-width: 0; }
.key-item__key span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.key-item__meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; font-size: 12.5px; }
@media (min-width: 720px) { .key-item__meta { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.key-item__meta div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.key-item__meta span:first-child { color: var(--fg-3); font-size: 11.5px; }
.scope-list { display: flex; flex-direction: column; gap: 8px; }
.scope-opt { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--s2); cursor: pointer; transition: border-color var(--fast), background var(--fast); }
.scope-opt:has(input:checked) { border-color: var(--fg-2); background: var(--s3); }
.scope-opt__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.scope-opt__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.scope-opt__desc { font-size: 12.5px; color: var(--fg-3); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; background: var(--s4); color: var(--fg-2); white-space: nowrap; }
.tag--risk { background: var(--warn-bg); color: var(--warn); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--fg-2); cursor: pointer; }
.secret-box { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: #050505; border: 1px solid var(--line-3); }
.secret-box__value { font-family: var(--mono); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.log-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--line); font-size: 13px; }
.log-row:first-child { border-top: 0; }
.log-row__path { font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-row__sub { grid-column: 2 / -1; font-size: 11.5px; color: var(--fg-3); }
.method { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 22px; padding: 0 6px; border-radius: 6px; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; background: var(--s4); color: var(--fg); }
.method--post { background: var(--fg); color: #000; }
.code-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; font-family: var(--mono); font-size: 11.5px; font-weight: 600; background: var(--pos-bg); color: var(--pos); white-space: nowrap; }
.code-pill--warn { background: var(--warn-bg); color: var(--warn); }
.code-pill--err { background: var(--neg-bg); color: var(--neg); }

/* ===================================================================== DOCS */
.docs { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .docs { grid-template-columns: 236px minmax(0, 1fr); gap: 40px; } }
.docs__nav { display: none; position: sticky; top: calc(var(--topbar-h) + 20px); flex-direction: column; gap: 2px; max-height: calc(100vh - 110px); overflow-y: auto; }
@media (min-width: 1024px) { .docs__nav { display: flex; } .docs__mnav { display: none !important; } }
.docs__link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; color: var(--fg-2); text-align: left; transition: background var(--fast), color var(--fast); }
.docs__link:hover { background: var(--s2); color: var(--fg); }
.docs__link[aria-current="page"] { background: var(--s3); color: var(--fg); font-weight: 600; }
.docs__link-n { width: 20px; flex: none; font-family: var(--mono); font-size: 11px; color: var(--fg-4); }
.docs__article { min-width: 0; max-width: 820px; display: flex; flex-direction: column; gap: 16px; }
.docs__article h2 { font-family: var(--font-display); font-size: clamp(26px, 5vw, 34px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.docs__article h3 { font-size: 17px; font-weight: 650; letter-spacing: -0.015em; margin-top: 12px; }
.docs__article p, .docs__article li { color: var(--fg-2); font-size: 15px; line-height: 1.65; }
.docs__article ul, .docs__article ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.docs__article code.inline { font-family: var(--mono); font-size: 0.86em; padding: 2px 6px; border-radius: 6px; background: var(--s3); border: 1px solid var(--line); color: var(--fg); overflow-wrap: anywhere; }
.docs__lead { font-size: 16.5px !important; }
.endpoint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--s2); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 13.5px; min-width: 0; }
.endpoint__path { overflow-wrap: anywhere; min-width: 0; }
.code { border-radius: 16px; background: #050505; border: 1px solid var(--line-2); overflow: hidden; min-width: 0; }
.code__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 14px; border-bottom: 1px solid var(--line); background: var(--s1); }
.code__lang { font-size: 11.5px; font-weight: 600; color: var(--fg-3); letter-spacing: 0.04em; }
.code__pre { margin: 0; padding: 14px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; color: #d4d4d4; white-space: pre; tab-size: 2; }
.params { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.param { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 14px; border-top: 1px solid var(--line); }
.param:first-child { border-top: 0; }
@media (min-width: 640px) { .param { grid-template-columns: 210px minmax(0, 1fr); gap: 16px; } }
.param__name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.param__name code { font-family: var(--mono); font-size: 13px; color: var(--fg); overflow-wrap: anywhere; }
.param__type { font-size: 11.5px; color: var(--fg-3); font-family: var(--mono); }
.param__req { color: var(--warn); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.param__opt { color: var(--fg-4); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.param__desc { font-size: 13.5px; color: var(--fg-2); line-height: 1.55; }
.docs__pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.docs__pager .btn { min-height: 66px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 10px 16px; white-space: normal; text-align: left; }
.docs__pager .btn.is-next { align-items: flex-end; text-align: right; grid-column: 2; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--s2); }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 3px; }
.callout p { font-size: 14px !important; }
.callout--warn { border-color: rgba(232, 181, 90, 0.35); background: var(--warn-bg); }
.callout--warn svg { color: var(--warn); }
.err-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.err-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--fg-2); }
.err-row:first-child { border-top: 0; }
.err-row code { font-family: var(--mono); font-size: 12.5px; color: var(--fg); overflow-wrap: anywhere; }
.err-row b { color: var(--fg); font-family: var(--mono); font-weight: 600; }

/* ================================================================ MOVIMENTO */
/* O estado inicial "escondido" só existe com JS ativo (classe motion-ready). */
.motion-ready .view > .stack > *,
.motion-ready .view > .dash > *,
.motion-ready .view > .docs,
.motion-ready .view > .rcpt { animation: rise 520ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
.motion-ready .reveal { opacity: 0; transform: translateY(10px); transition: opacity 560ms var(--ease-out), transform 560ms var(--ease-out); }
.motion-ready .reveal.is-in { opacity: 1; transform: none; }
.num-flip { animation: num-flip 420ms var(--ease-out); }
.pulse { animation: pulse 480ms var(--ease-out); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) scale(0.97); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes live { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(2); opacity: 0; } }
@keyframes beat { 0% { transform: scale(1); } 40% { transform: scale(1.8); } 100% { transform: scale(1); } }
@keyframes num-flip { 0% { opacity: 0.35; transform: translateY(6px); } 100% { opacity: 1; transform: none; } }
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes pop { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes pulse-ring { 0% { transform: scale(0.92); opacity: 0.9; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes bar { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .motion-ready .reveal { opacity: 1; transform: none; }
}

/* ================================================================ IMPRESSÃO */
@media print {
  @page { margin: 12mm; }
  html, body { background: #fff !important; color: #111 !important; }
  .sidebar, .topbar, .tabbar, .drawer, .toasts, .support-fab, .no-print, .rcpt-actions, .splash { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .view { padding: 0 !important; max-width: none; }
  .rcpt__paper, .card { background: #fff !important; border-color: #ddd !important; box-shadow: none !important; color: #111 !important; }
  .rcpt__tear::after { display: none; }
  .rcpt__key, .rcpt__title, .rcpt__when, .tiny, .muted, .rcpt__party-extra, .rcpt__val--mono, .rcpt__section-title, .rcpt__party-role { color: #555 !important; }
  .rcpt__icon { background: #111 !important; color: #fff !important; }
  .rcpt__party, .rcpt__avatar { background: #f5f5f5 !important; border-color: #e5e5e5 !important; }
  .rcpt__section + .rcpt__section, .rcpt__auth, .rcpt__foot, .rcpt__row--total { border-color: #e5e5e5 !important; }
  .rcpt__copy { display: none !important; }
}
