:root {
  /* ---- azul de ação (inspirado na clareza do ChatGPT, sem copiar sua UI) ---- */
  --green-50:  rgba(59, 130, 246, 0.08);
  --green-100: rgba(59, 130, 246, 0.16);
  --green-200: rgba(96, 165, 250, 0.24);
  --green-300: #2563eb;
  --green-400: #3b82f6;
  --green-500: #60a5fa;
  --green-600: #3b82f6;
  --green-700: #93c5fd;
  --green-800: #dbeafe;
  --green-900: #07152f;

  /* ---- neutros: base quase monocromática preto profundo + branco quente
     (relatório seção 3) — o app inteiro roda escuro, não só um tema alternável. ---- */
  --bg: #090a0c;
  --card: #111318;
  --elevated: #191c24;
  --white: #f8fafc;
  --black: #07080a;
  --text: #f5f7fb;
  --text-secondary: #9aa4b2;
  --text-tertiary: #64748b;
  --gray: #697386;
  --border: rgba(148, 163, 184, 0.16);
  --border-hairline: rgba(148, 163, 184, 0.09);
  --border-strong: rgba(148, 163, 184, 0.28);
  --surface-2: #151922;
  --mint: #7dd3fc;

  /* ---- papéis (usam a escala acima — trocar aqui muda o app inteiro) ---- */
  --green: var(--green-500);
  --green-ink: var(--green-700);
  --green-wash: var(--green-100);
  --green-glow: var(--green-300);
  --danger: #fb7185;
  --danger-wash: rgba(255, 107, 107, 0.14);
  --amber: #fbbf24;
  --amber-wash: rgba(255, 194, 75, 0.14);
  --neutral-wash: rgba(255, 255, 255, 0.06);

  /* aliases (mantém compatibilidade com seletores já escritos) */
  --surface: var(--card);
  --muted: var(--text-secondary);
  --muted-2: var(--gray);
  --green-dim: var(--green-ink);

  /* ---- tipografia ----
     Fonte principal: PP Neue Montreal (licença comercial pendente de compra —
     ver @font-face abaixo). Até lá, Inter é a fonte real (já era o fallback
     especificado), não um placeholder — mesma família em todo lugar. Inter já
     lê como sans-serif neo-grotesca (relatório seção 4); a hierarquia vem de
     escala/tracking/cor, quase nunca de peso — regra que este arquivo já seguia. */
  --font-primary: "PP Neue Montreal", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: var(--font-primary);
  --font-body: var(--font-primary);

  --font-weight-light: 200;
  --font-weight-regular: 400;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* tracking — nunca um valor solto, sempre um destes */
  --tracking-display: -0.04em;
  --tracking-heading: -0.03em;
  --tracking-title: -0.02em;
  --tracking-body: 0em;
  --tracking-label: 0.025em;

  /* line-height — por categoria, não um valor único */
  --lh-display: 0.9;
  --lh-heading: 1.08;
  --lh-ui: 1.4;
  --lh-body: 1.5;

  /* escala tipográfica */
  --fs-display-xl: clamp(48px, 8vw, 113px);
  --fs-display-l: clamp(42px, 7vw, 96px);
  --fs-display-m: clamp(36px, 6vw, 78px);
  --fs-h1: clamp(32px, 4vw, 48px);
  --fs-h2: clamp(24px, 2.4vw, 32px);
  --fs-h3: 22px;
  --fs-body-lg: 18px;
  --fs-body: 15px;
  --fs-ui: 14px;
  --fs-ui-sm: 13px;
  --fs-small: 12px;
  --fs-metric: clamp(32px, 4vw, 48px);

  /* ---- espaçamento (4/8/12/16/20/24/32/40/48/64) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ---- raio (sistema, não um valor único pra tudo) — cantos grandes e
     botões em formato pill, como o relatório descreve (seção 8). ---- */
  --radius-badge: 999px;
  --radius-sm: 10px;
  --radius-input: 12px;
  --radius-btn: 999px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-card: 20px;
  --radius-modal: 26px;
  --radius-pill: 999px;

  /* ---- sombra: quase inexistente (relatório seção 8) — separação vem de
     borda discreta e contraste tonal, não de elevação tradicional. As
     sombras que sobram são só pra elementos flutuantes (modal/dropdown/toast)
     se destacarem de um fundo já escuro. ---- */
  --shadow-xs: 0 1px 0 rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.48);
  --shadow-inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.04);

  /* ---- motion ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 160ms;
  --duration-base: 220ms;

  /* ---- topbar: mesma base escura do resto do app agora — não é mais a
     única região escura de uma interface clara, então reusa os tokens
     principais em vez de manter uma identidade paralela. ---- */
  --header-bg: var(--bg);
  --header-bg-raised: var(--elevated);
  --header-border: var(--border);
  --header-text: var(--text-secondary);
  --header-text-active: var(--text);
  --header-active-bg: rgba(59, 130, 246, 0.16);
  --header-active-fg: #bfdbfe;

  font-family: var(--font-body);
  color-scheme: dark;
}

/* PP Neue Montreal — licença comercial ainda não comprada (fonts.pangrampangram.com).
   Arquivos recebidos até agora vinham marcados "Personal Use Only" de uma fonte
   não-oficial — não usamos fonte sem licença comercial válida num produto real,
   então este bloco fica inerte (sem @font-face) até os arquivos legítimos
   chegarem em public/fonts/. --font-primary já cai pro Inter automaticamente.
   Pesos esperados quando a licença existir: 200 (Thin), 400 (Book), 600 (SemiBold),
   700 (Bold) — os arquivos recebidos não tinham SemiBold, só Thin/Book/Medium/Bold,
   então confirmar o peso 600 com a foundry antes de ativar.
@font-face {
  font-family: "PP Neue Montreal";
  src: url("/fonts/PPNeueMontreal-Thin.woff2") format("woff2");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PP Neue Montreal";
  src: url("/fonts/PPNeueMontreal-Book.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PP Neue Montreal";
  src: url("/fonts/PPNeueMontreal-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PP Neue Montreal";
  src: url("/fonts/PPNeueMontreal-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
*/

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* tipografia de impacto: headings e métricas — hierarquia vem de escala/espaço/
   tracking, não de peso. Peso regular (400) é o padrão; 600 só onde marcado. */
h1, h2, h3, h4,
.dash-title, .kpi-value, .login-card h1, .modal-header h3, .view-header h2,
.activity-amount {
  font-family: var(--font-display);
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--tracking-heading);
}

:focus-visible {
  outline: 2px solid var(--green-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* noise extremamente sutil — só em superfícies de "comando"/IA, nunca no corpo do app */
.noise {
  position: relative;
}
.noise::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  border-radius: inherit;
}

/* spotlight que acompanha o cursor — só nos cards de destaque (.spotlight), intensidade baixa */
.spotlight { position: relative; }
.spotlight::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), var(--green-100) 0%, transparent 68%);
  transition: opacity var(--duration-base) ease;
}
.spotlight:hover::after { opacity: 0.55; }

/* entrada em cascata pros grids de card — rápida, sem atrasar o uso */
.stagger-in > * { animation: card-in 260ms var(--ease-out) both; }
.stagger-in > *:nth-child(1) { animation-delay: 0ms; }
.stagger-in > *:nth-child(2) { animation-delay: 30ms; }
.stagger-in > *:nth-child(3) { animation-delay: 60ms; }
.stagger-in > *:nth-child(4) { animation-delay: 90ms; }
.stagger-in > *:nth-child(5) { animation-delay: 120ms; }
.stagger-in > *:nth-child(6) { animation-delay: 150ms; }
.stagger-in > *:nth-child(n+7) { animation-delay: 180ms; }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- tooltip utilitário (data-tooltip="texto") ---------- */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--elevated);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: var(--font-weight-regular);
  letter-spacing: -0.005em;
  padding: 6px 10px;
  border-radius: 7px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease;
  box-shadow: var(--shadow-md);
  z-index: 60;
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- empty states ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 52px 20px; text-align: center; }
.empty-state-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray);
}
.empty-state-icon svg { width: 20px; height: 20px; }
.empty-state-title { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.empty-state-sub { font-size: 0.8rem; color: var(--text-secondary); max-width: 280px; line-height: 1.5; }

/* ---------- skeleton loading ---------- */
@keyframes skel-shimmer { 0% { background-position: -140% 0; } 100% { background-position: 140% 0; } }
.skel {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border-hairline) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skel-kpi { height: 118px; border-radius: var(--radius-card); }
.skel-row { height: 44px; margin-bottom: 1px; border-radius: 0; }
.skel-line { height: 12px; border-radius: 4px; }

/* ---------- login ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 18% 20%, rgba(59, 130, 246, 0.16), transparent 30%),
    var(--bg);
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 40px;
  width: min(420px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-md), var(--shadow-inset-highlight);
}
.login-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1rem; letter-spacing: -.025em; }
.login-kicker { margin: 18px 0 -6px; color: var(--green-700); font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.login-card h1 { margin: 0; max-width: 310px; font-size: 30px; line-height: 1.05; font-weight: var(--font-weight-regular); letter-spacing: -.045em; }
.login-card input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 13px;
  border-radius: var(--radius-input);
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.login-card input:focus, .inline-form input:focus, .fees-form input:focus,
.modal-form input:focus, .modal-form select:focus,
.comments-input:focus, select:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px var(--green-wash);
}

button { font-family: inherit; }

/* ---------- botões: hierarquia primary / secondary(ghost) / destructive ----------
   Azul sólido sobre fundo escuro é o ponto de maior contraste da página. */
.btn-primary, .login-card button, .inline-form button, .fees-form button, .filters button {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #3b82f6;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform var(--duration-fast) ease, opacity var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.btn-primary:hover, .login-card button:hover, .inline-form button:hover, .fees-form button:hover {
  background: #3b82f6;
  border-color: #60a5fa;
  opacity: 1;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.28);
}
.btn-primary:active, .login-card button:active { transform: translateY(1px); }
.btn-primary:disabled, .login-card button:disabled {
  opacity: 0.45; cursor: default; transform: none; box-shadow: none;
}

.btn-ghost, #refresh-withdrawals, #refresh-payouts, #refresh-webhook {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.btn-ghost:hover, #refresh-withdrawals:hover,
#refresh-payouts:hover, #refresh-webhook:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:active { transform: translateY(1px); }

/* ---------- app layout: topbar (não mais sidebar) ---------- */
.app { display: flex; flex-direction: column; min-height: 100vh; }

/* Console desktop: a navegação vira uma coluna de trabalho estável e o
   conteúdo ganha uma área própria. Os mesmos elementos continuam no DOM para
   preservar o comportamento da SPA e os atalhos já existentes. */
@media (min-width: 1101px) {
  .app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
  .topbar {
    grid-column: 1;
    grid-row: 1;
    width: 248px;
    height: 100vh;
    min-height: 640px;
    padding: 24px 16px 18px;
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    position: sticky;
    top: 0;
    border-right: 1px solid var(--header-border);
    border-bottom: 0;
  }
  .topbar-left { width: 100%; flex-direction: column; align-items: stretch; gap: 34px; }
  .brand { padding: 0 10px; gap: 10px; }
  .brand-word { font-size: 1.06rem; }
  .topnav { width: 100%; flex-direction: column; align-items: stretch; gap: 5px; }
  .nav-btn { width: 100%; justify-content: flex-start; padding: 0 12px; border-radius: 10px; }
  .nav-btn.active .nav-icon { transform: none; }
  .nav-more { width: 100%; }
  .nav-more-trigger { width: 100%; justify-content: space-between; padding: 0 12px; border-radius: 10px; }
  .nav-more-trigger span:not(.nav-more-chevron) { display: inline; }
  .nav-more-menu { top: 0; left: calc(100% + 9px); }
  .topbar-right { width: 100%; flex-direction: column; align-items: stretch; gap: 14px; margin-top: auto; }
  .cmdk-search { width: 100%; min-width: 0; }
  .user-menu, .user-menu-trigger { width: 100%; }
  .user-menu-trigger { justify-content: flex-start; padding-left: 7px; }
  .user-menu-dropdown { left: 0; right: auto; bottom: calc(100% + 8px); top: auto; width: 100%; }
  .content { grid-column: 2; grid-row: 1; width: 100%; min-width: 0; max-width: 1540px; padding: 48px clamp(32px, 5vw, 76px); }
}

.topbar {
  height: 72px;
  flex-shrink: 0;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 28px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(155deg, var(--header-bg-raised), var(--header-bg));
  border: 1px solid var(--header-border);
  color: var(--green-500);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 16px; height: 16px; }
.ai-mark {
  width: 34px; height: 34px; border-radius: 10px; position: relative;
  display: inline-grid; place-items: center; flex: 0 0 auto;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.16);
}
.brand-mark.ai-mark { width: 30px; height: 30px; color: initial; }
.ai-mark-large { width: 52px; height: 52px; border-radius: 15px; }
.ai-mark img { width: 100%; height: 100%; display: block; }
.brand-word {
  font-family: var(--font-display);
  font-weight: var(--font-weight-semibold);
  font-size: 1rem;
  letter-spacing: var(--tracking-label);
  color: var(--header-text-active);
}

.topnav { display: flex; align-items: center; gap: 2px; }
.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--header-text);
  text-align: left;
  height: 38px;
  padding: 0 12px;
  cursor: pointer;
  font-size: var(--fs-ui);
  font-weight: var(--font-weight-regular);
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-btn);
  transition: color var(--duration-fast) ease, background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}
.nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.78;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity var(--duration-fast) ease, color var(--duration-fast) ease,
    background var(--duration-fast) ease, transform var(--duration-fast) var(--ease-out);
}
/* tooltip do nav só faz sentido quando o label some (menu compacto no mobile) */
.nav-btn[data-tooltip]::after { content: none; }
.nav-btn:hover { color: var(--header-text-active); background: rgba(255, 255, 255, 0.06); }
.nav-btn.active {
  background: var(--header-active-bg);
  color: var(--header-active-fg);
  font-weight: var(--font-weight-semibold);
}
.nav-btn:hover .nav-icon { opacity: 1; transform: translateY(-1px); }
.nav-btn.active .nav-icon {
  opacity: 1;
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.30);
  border-radius: 6px;
  padding: 3px;
  width: 23px;
  height: 23px;
  transform: translateX(-1px);
}

.nav-more { position: relative; }
.nav-more-trigger {
  background: transparent;
  border: 1px solid transparent;
  color: var(--header-text);
  height: 38px;
  padding: 0 10px;
  cursor: pointer;
  font-size: var(--fs-ui);
  font-weight: var(--font-weight-regular);
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-btn);
  transition: color var(--duration-fast) ease, background var(--duration-fast) ease;
}
.nav-more-trigger:hover { color: var(--header-text-active); background: rgba(255, 255, 255, 0.06); }
.nav-more-chevron { width: 9px; height: 9px; transition: transform var(--duration-fast) var(--ease-out); }
.nav-more.open .nav-more-chevron { transform: rotate(180deg); }
.nav-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  animation: dropdown-in var(--duration-fast) var(--ease-out);
}
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.nav-more-item {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 9px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: var(--font-weight-regular);
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast) ease;
}
.nav-more-item:hover { background: var(--surface-2); color: #bfdbfe; }
.nav-more-item.active { color: var(--green-ink); background: var(--green-50); }
.nav-more-item .nav-icon { color: var(--text-secondary); }
.nav-more-item:hover .nav-icon, .nav-more-item.active .nav-icon { color: #60a5fa; opacity: 1; }

.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--header-border);
  color: var(--header-text-active);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-btn);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.mobile-nav-toggle svg { width: 17px; height: 17px; }

/* command bar: parece busca, não um botão */
.cmdk-search {
  background: var(--header-bg-raised);
  border: 1px solid var(--header-border);
  color: var(--header-text);
  height: 38px;
  padding: 0 10px 0 11px;
  border-radius: var(--radius-input);
  cursor: pointer;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 168px;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}
.cmdk-search:hover, .cmdk-search:focus-visible { border-color: var(--mint); background: var(--header-bg); }
.cmdk-search-icon-inline { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.85; }
.cmdk-search span:not(.cmdk-kbd) { flex: 1; text-align: left; color: var(--header-text); }
.cmdk-kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.68rem;
  font-family: var(--font-body);
  color: var(--header-text);
  flex-shrink: 0;
}

/* menu do usuário (avatar + nome + chevron) — Sair mora aqui dentro agora */
.user-menu { position: relative; }
.user-menu-trigger {
  background: transparent;
  border: 1px solid transparent;
  color: var(--header-text-active);
  height: 38px;
  padding: 0 8px 0 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-btn);
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}
.user-menu-trigger:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--header-border); }
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--green-400), var(--green-600));
  color: var(--green-900);
  font-family: var(--font-display);
  font-weight: var(--font-weight-semibold);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-name { font-size: 0.82rem; font-weight: var(--font-weight-regular); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chevron { width: 9px; height: 9px; color: var(--header-text); transition: transform var(--duration-fast) var(--ease-out); flex-shrink: 0; }
.user-menu.open .user-chevron { transform: rotate(180deg); }
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  animation: dropdown-in var(--duration-fast) var(--ease-out);
}
.user-menu-header { padding: 10px 10px 11px; border-bottom: 1px solid var(--border-hairline); margin-bottom: 6px; }
.user-menu-email { font-size: 0.84rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-role { font-size: 0.72rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.user-menu-action {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text);
  font: inherit; font-size: 0.82rem; font-weight: 600; text-align: left; cursor: pointer;
}
.user-menu-action:hover { background: var(--surface-2); }
.push-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); box-shadow: 0 0 0 3px rgba(127,127,127,.10); }
.user-menu-action.is-active .push-status-dot { background: var(--green-500); box-shadow: 0 0 0 3px var(--green-100); }
.user-menu-action:disabled { opacity: .55; cursor: default; }
.user-menu-logout {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--danger);
  text-align: left;
  padding: 9px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: var(--font-weight-regular);
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast) ease;
}
.user-menu-logout:hover { background: var(--danger-wash); }

.content { flex: 1; padding: 44px 36px; overflow-x: auto; }
.view { display: none; }
.view.active { display: block; animation: view-in var(--duration-base) var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.view-header h2 { margin: 0; font-size: var(--fs-h2); letter-spacing: var(--tracking-heading); font-weight: var(--font-weight-regular); line-height: 1.05; }
.view-header h2::after { content: ''; display: block; width: 26px; height: 3px; margin-top: 12px; border-radius: 99px; background: #3b82f6; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  height: 38px;
  padding: 0 11px;
  border-radius: var(--radius-input);
  font-size: 0.85rem;
  font-family: inherit;
}

.search-input {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-input);
  font-size: 0.85rem;
  font-family: inherit;
  min-width: 220px;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.search-input:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px var(--green-wash); }

/* ---------- dashboard ---------- */
.dash-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.dash-actions { display: flex; align-items: flex-end; gap: 10px; }
.period-control { display: flex; flex-direction: column; gap: 5px; color: var(--text-secondary); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.period-control select { min-width: 132px; height: 38px; padding: 0 34px 0 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-btn); color: var(--text); font: 600 13px var(--font-body); letter-spacing: 0; text-transform: none; cursor: pointer; }
.dash-eyebrow { margin: 0 0 6px; font-size: 0.92rem; font-weight: var(--font-weight-regular); color: var(--text-secondary); letter-spacing: -0.005em; }
.dash-title { margin: 0; font-size: var(--fs-h1); font-weight: var(--font-weight-regular); letter-spacing: var(--tracking-display); line-height: 1; color: var(--text); }

.dash-status { margin: 14px 0 0; display: flex; align-items: center; gap: 9px; font-size: 0.84rem; color: var(--text-secondary); }
.ant-trail { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; }
.ant-trail span { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.ant-trail span:last-child { width: 5px; height: 5px; background: var(--green-500); }
.ant-trail.updating span { animation: ant-trail-pulse 900ms ease-in-out infinite; }
.ant-trail.updating span:nth-child(1) { animation-delay: 0ms; }
.ant-trail.updating span:nth-child(2) { animation-delay: 120ms; }
.ant-trail.updating span:nth-child(3) { animation-delay: 240ms; }
@keyframes ant-trail-pulse { 0%, 100% { opacity: 0.4; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.2); } }

.btn-refresh {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.btn-refresh:hover { border-color: var(--border-strong); background: var(--surface-2); box-shadow: var(--shadow-xs); }
.btn-refresh .refresh-icon { width: 14px; height: 14px; color: var(--text-secondary); }
.btn-refresh.is-loading .refresh-icon { animation: refresh-spin 700ms linear infinite; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-section-label { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 5px 2px 0; }
.kpi-section-label span { color: var(--text); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.kpi-section-label small { color: var(--gray); font-size: 11px; }
.kpi-financial { border-color: var(--border-strong); background-image: linear-gradient(155deg, rgba(127,224,238,.08), transparent 48%); }
.kpi-financial.kpi-revenue { background-image: linear-gradient(155deg, rgba(75,196,130,.13), transparent 48%); }
.kpi-financial.is-negative .kpi-value { color: var(--danger); }
.kpi-card {
  background: var(--card);
  background-image: linear-gradient(155deg, var(--green-50) 0%, transparent 40%);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm), var(--shadow-inset-highlight);
  transition: transform var(--duration-base) ease, box-shadow var(--duration-base) ease, border-color var(--duration-base) ease;
  overflow: hidden;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md), var(--shadow-inset-highlight); border-color: var(--green-300); }
.kpi-digitopay { background-image: radial-gradient(circle at 100% 0%, rgba(102,215,232,.14), transparent 50%), linear-gradient(155deg, var(--green-50) 0%, transparent 40%); }
.live-source-dot { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 4px var(--green-100); vertical-align: 1px; animation: live-source-pulse 2.4s ease-in-out infinite; }
@keyframes live-source-pulse { 50% { box-shadow: 0 0 0 7px rgba(75,196,130,0); } }
.kpi-label { font-size: var(--fs-ui-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: var(--tracking-label); font-weight: var(--font-weight-semibold); margin-bottom: 12px; }
.kpi-value { font-size: var(--fs-metric); font-weight: var(--font-weight-regular); letter-spacing: -0.03em; line-height: 1; }
.kpi-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.kpi-delta { font-size: var(--fs-small); font-weight: var(--font-weight-semibold); padding: 3px 8px; border-radius: var(--radius-pill); white-space: nowrap; }
.kpi-delta.up { background: var(--green-100); color: var(--green-700); }
.kpi-delta.down { background: var(--danger-wash); color: var(--danger); }
.kpi-delta.flat { background: var(--neutral-wash); color: var(--text-secondary); }
.kpi-sub { font-size: 0.78rem; color: var(--gray); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub .kpi-spark { vertical-align: middle; margin-left: 6px; }

.dash-columns { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 14px; align-items: stretch; }
@media (max-width: 980px) { .dash-columns { grid-template-columns: 1fr; } }

.chart-card, .ask-card, .today-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px 24px 18px;
  box-shadow: var(--shadow-sm), var(--shadow-inset-highlight);
  transition: border-color var(--duration-base) ease, box-shadow var(--duration-base) ease;
}
.chart-card:hover, .ask-card:hover, .today-card:hover { border-color: var(--border-strong); }
.chart-card h3, .ask-card h3, .today-card h3 {
  margin: 0 0 4px; font-size: var(--fs-ui); font-weight: var(--font-weight-semibold); color: var(--text); letter-spacing: var(--tracking-title);
}
.chart-card h3 { margin-bottom: 18px; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-empty { color: var(--text-secondary); font-size: 0.85rem; padding: 40px 0; text-align: center; }

/* ---------- gráfico de barras 3D (extrusão sutil, luz cima-esquerda) ---------- */
.chart-3d-wrap { position: relative; }
.chart-grid { stroke: var(--border-hairline); stroke-width: 1; }
.chart-baseline { stroke: var(--border); stroke-width: 1; }
.chart-crosshair { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; transition: opacity 120ms ease; }
.bar-group { cursor: pointer; }
.bar-face-front, .bar-face-top, .bar-face-side {
  transition: transform 180ms var(--ease-out), filter 180ms ease;
}
.bar-group:hover .bar-face-front,
.bar-group:hover .bar-face-top,
.bar-group:hover .bar-face-side {
  transform: translateY(-3px);
  filter: brightness(1.06);
}
.chart-tooltip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 12px));
  background: var(--elevated);
  color: var(--white);
  padding: 8px 12px;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  z-index: 5;
  animation: tooltip-in 140ms var(--ease-out);
}
@keyframes tooltip-in { from { opacity: 0; transform: translate(-50%, calc(-100% - 6px)); } to { opacity: 1; transform: translate(-50%, calc(-100% - 12px)); } }
.chart-tooltip .tt-date { color: var(--text-secondary); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.chart-tooltip .tt-value { font-family: var(--font-display); font-weight: var(--font-weight-regular); font-size: 0.86rem; letter-spacing: -0.02em; }
.chart-tooltip .tt-unit { font-family: var(--font-body); font-weight: var(--font-weight-regular); font-size: 0.68rem; color: var(--text-secondary); }
.chart-tooltip .tt-delta { margin-top: 4px; font-size: 0.68rem; font-weight: var(--font-weight-semibold); }
.chart-tooltip .tt-delta.up { color: var(--green-400); }
.chart-tooltip .tt-delta.down { color: var(--danger); }

/* ---------- donut 3D (anel-sombra por baixo do anel real) ---------- */
.kpi-donut-wrap { position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-donut-label {
  position: absolute; font-size: 0.68rem; font-weight: var(--font-weight-semibold); font-family: var(--font-display);
  color: var(--text); letter-spacing: -0.01em;
}
.kpi-row.with-visual { align-items: center; }

.chart-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.chart-sub { position: relative; }
.chart-sub + .chart-sub { padding-left: 24px; }
.chart-sub + .chart-sub::before {
  content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border) 20%, var(--border) 80%, transparent);
}
@media (max-width: 640px) {
  .chart-card-grid { grid-template-columns: 1fr; gap: 28px; }
  .chart-sub + .chart-sub { padding-left: 0; }
  .chart-sub + .chart-sub::before { display: none; }
}

.ask-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.ask-header .muted { margin: 2px 0 0; }
.ask-orb {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%;
  background: var(--elevated);
  border: 1px solid var(--border);
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.ask-orb span {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green-500);
  animation: ask-pulse 1.6s ease-in-out infinite;
}
.ask-orb span:nth-child(1) { animation-delay: 0s; }
.ask-orb span:nth-child(2) { transform: translate(6px, -3px); animation-delay: 0.2s; }
.ask-orb span:nth-child(3) { transform: translate(-5px, 4px); animation-delay: 0.4s; }
@keyframes ask-pulse { 0%, 100% { opacity: 0.35; transform: scale(0.8) translate(var(--tx, 0), var(--ty, 0)); } 50% { opacity: 1; transform: scale(1.15); } }

.ask-list { display: flex; flex-direction: column; gap: 10px; }
.ask-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease, transform var(--duration-fast) ease;
}
.ask-item:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateX(1px); }
.ask-item .dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.ask-item.warn .dot { background: var(--amber); }
.ask-item.bad .dot { background: var(--danger); }
.ask-item.good .dot { background: var(--green-500); }
.ask-item.neutral .dot { background: var(--gray); }
.ask-empty { color: var(--text-secondary); font-size: 0.82rem; padding: 8px 0; }

.today-card { margin-bottom: 4px; }
.today-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.today-list li { display: flex; align-items: center; gap: 10px; font-size: 0.86rem; color: var(--text); }
.today-list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green-500); flex-shrink: 0; }
.today-list .today-empty::before { display: none; }
.today-list .today-empty { color: var(--text-secondary); }

.bulk-send-status {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; padding: 10px 14px;
  background: var(--amber-wash); color: var(--amber);
  border-radius: var(--radius-md); font-size: 0.9rem;
}
.bulk-send-status button { flex-shrink: 0; }

/* ---------- activity feed (histórico de saques) ---------- */
.activity-list { display: flex; flex-direction: column; }
.activity-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-fast) ease;
}
.activity-row:hover { background: var(--surface-2); margin: 0 -12px; padding-left: 16px; padding-right: 16px; border-radius: var(--radius-md); }
.activity-row:last-child { border-bottom: none; }
.activity-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-display);
  color: var(--text-secondary);
  flex-shrink: 0;
}
.activity-main { flex: 1; min-width: 0; }
.activity-name { font-size: 0.92rem; font-weight: var(--font-weight-semibold); color: var(--text); }
.activity-meta { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.activity-right { text-align: right; flex-shrink: 0; }
.activity-amount { font-size: 1rem; font-weight: var(--font-weight-regular); letter-spacing: -0.02em; }
.activity-status { margin-top: 5px; }
.activity-empty { color: var(--text-secondary); font-size: 0.85rem; padding: 30px 4px; }
.send-pix-btn {
  display: block;
  margin-top: 8px;
  background: var(--green-500);
  color: var(--black);
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-btn);
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.send-pix-btn:hover { box-shadow: 0 4px 12px rgba(191, 255, 60, 0.35); transform: translateY(-1px); }
.send-pix-btn:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }

.daily-phone { display: block; margin-top: 2px; font-size: var(--fs-ui-sm); color: var(--text-secondary); }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; overflow-y: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border-hairline); white-space: nowrap; }
th {
  position: sticky; top: 0; z-index: 1;
  color: var(--text-secondary); font-weight: var(--font-weight-semibold); font-size: var(--fs-ui-sm); text-transform: uppercase; letter-spacing: var(--tracking-label);
  background: var(--surface-2);
  box-shadow: inset 0 -1px 0 var(--border);
}
tbody tr { transition: background var(--duration-fast) ease; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr .link-btn { opacity: 0; transition: opacity var(--duration-fast) ease; }
tbody tr:hover .link-btn, tbody tr:focus-within .link-btn { opacity: 1; }

.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 9px; border-radius: var(--radius-pill);
  font-size: var(--fs-small); font-weight: var(--font-weight-semibold); letter-spacing: 0.01em;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-paid { background: var(--green-100); color: var(--green-700); }
.status-pending { background: var(--amber-wash); color: var(--amber); }
.status-failed { background: var(--danger-wash); color: var(--danger); }
.status-unknown { background: var(--neutral-wash); color: var(--text-secondary); }

.inline-form { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.inline-form input {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  height: 38px;
  padding: 0 13px;
  border-radius: var(--radius-input);
  font-size: 0.86rem;
  flex: 1;
  min-width: 160px;
  font-family: inherit;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.fees-form { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 12px; flex-wrap: wrap; }
.fees-form label { display: flex; flex-direction: column; gap: 7px; font-size: 0.82rem; color: var(--text-secondary); }
.fees-form-group-label {
  flex-basis: 100%;
  margin: 4px 0 -4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}
.fees-form-group-label:first-child { margin-top: 0; }
.fees-form input {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  height: 38px;
  padding: 0 13px;
  border-radius: var(--radius-input);
  width: 160px;
  font-family: inherit;
}

.muted { color: var(--text-secondary); font-size: 0.85rem; }
.error-msg { color: var(--danger); font-size: 0.85rem; min-height: 1em; margin: 4px 0 0; }
.success-msg { color: var(--green-ink); font-size: 0.85rem; min-height: 1em; margin: 4px 0 0; }

.link-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 11px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-size: 0.76rem;
  transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease, opacity var(--duration-fast) ease;
}
.link-btn:hover { color: var(--danger); border-color: var(--danger); }

.person-name-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0;
  text-align: left;
  transition: color var(--duration-fast) ease;
}
.person-name-link:hover, .person-name-link:focus-visible { color: var(--green-ink); text-decoration: underline; }
.person-name-link:disabled { cursor: wait; opacity: 0.65; }
.activity-person-link::after { content: ' ↗'; color: var(--text-tertiary); font-size: 0.78em; text-decoration: none; }

.comments-form { display: inline-flex; gap: 6px; align-items: center; }
.comments-input {
  width: 68px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: inherit;
  transition: border-color var(--duration-fast) ease;
}
.comments-save {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}
.comments-save:hover { color: var(--green-ink); border-color: var(--green-500); background: var(--green-50); }

.approve-btn, .reject-btn {
  border: none;
  border-radius: var(--radius-btn);
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--duration-fast) ease, opacity var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.approve-btn { background: var(--green-500); color: var(--black); }
.approve-btn:hover { opacity: 0.88; box-shadow: 0 4px 12px rgba(191, 255, 60, 0.3); }
.reject-btn { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.reject-btn:hover { color: var(--danger); border-color: var(--danger); }

.webhook-list { display: flex; flex-direction: column; gap: 10px; }
.webhook-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.webhook-item .meta { color: var(--text-secondary); font-size: 0.78rem; margin-bottom: 8px; }
.webhook-item pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  font-family: ui-monospace, monospace;
  color: var(--text);
  background: var(--surface-2);
  padding: 10px 12px;
  border-radius: 7px;
}
code { background: var(--surface-2); padding: 2px 7px; border-radius: 5px; font-size: 0.85em; font-family: ui-monospace, monospace; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 18, 18, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
  overflow-y: auto;
  z-index: 100;
  animation: backdrop-in var(--duration-fast) ease;
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-modal);
  width: 100%;
  max-width: 480px;
  padding: 26px 28px 30px;
  box-shadow: var(--shadow-lg), var(--shadow-inset-highlight);
  animation: modal-in var(--duration-base) var(--ease-out);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border-hairline); }
.modal-header h3 { margin: 0; font-size: var(--fs-h3); font-weight: var(--font-weight-semibold); letter-spacing: var(--tracking-title); }
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color var(--duration-fast) ease;
}
.modal-close:hover { color: var(--text); }
.modal-form { display: flex; flex-direction: column; gap: 12px; }
.modal-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.78rem; color: var(--text-secondary); }
.modal-form input, .modal-form select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-input);
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  height: 38px;
  padding: 0 18px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-size: 0.88rem;
  transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}
.modal-secondary:hover { color: var(--text); border-color: var(--border-strong); }
.modal-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-hairline); }
.modal-section h4 { margin: 0 0 10px; font-size: var(--fs-ui-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: var(--tracking-label); font-weight: var(--font-weight-semibold); }

/* ---------- confirm dialog (substitui confirm() nativo por algo bonito) ---------- */
.confirm-backdrop { z-index: 300; align-items: center; }
.confirm-backdrop.confirm-closing { animation: backdrop-out var(--duration-fast) ease forwards; }
.confirm-backdrop.confirm-closing .confirm-card { animation: modal-out var(--duration-fast) ease forwards; }
@keyframes backdrop-out { to { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(6px) scale(0.98); } }
.confirm-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-modal);
  width: 100%;
  max-width: 380px;
  margin: 0 20px;
  padding: 30px 26px 24px;
  box-shadow: var(--shadow-lg), var(--shadow-inset-highlight);
  animation: modal-in var(--duration-base) var(--ease-out);
  text-align: center;
}
.confirm-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-icon svg { width: 24px; height: 24px; }
.confirm-default .confirm-icon { background: var(--green-100); color: var(--green-700); }
.confirm-warn .confirm-icon { background: var(--amber-wash); color: var(--amber); }
.confirm-title { margin: 0 0 8px; font-size: var(--fs-h3); font-weight: var(--font-weight-semibold); letter-spacing: var(--tracking-title); }
.confirm-message { margin: 0 0 22px; color: var(--text-secondary); font-size: var(--fs-ui); line-height: var(--lh-body); }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions button { flex: 1; justify-content: center; }
.confirm-warn .confirm-ok { background: var(--amber); border-color: var(--amber); color: #fff; }
.confirm-warn .confirm-ok:hover { background: #d9a638; border-color: #d9a638; }

/* ---------- toast (feedback pós-ação, empilha no canto inferior direito) ---------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), var(--shadow-inset-highlight);
  padding: 13px 14px;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}
.toast-in { opacity: 1; transform: none; }
.toast-out { opacity: 0; transform: translateX(24px); }
.toast-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast-success .toast-icon { background: var(--green-100); color: var(--green-700); }
.toast-error .toast-icon { background: var(--danger-wash); color: var(--danger); }
.toast-icon svg { width: 13px; height: 13px; }
.toast-msg { flex: 1; font-size: var(--fs-ui-sm); color: var(--text); line-height: var(--lh-ui); }
.toast-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--text); }
@media (max-width: 520px) {
  .toast-container { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

/* ---------- command bar ---------- */
.cmdk-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 18, 18, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  z-index: 200;
  animation: backdrop-in var(--duration-fast) ease;
}
.cmdk-card {
  width: 100%;
  max-width: 560px;
  margin: 0 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in var(--duration-base) var(--ease-out);
  position: relative;
}
.cmdk-input-wrap { display: flex; align-items: center; gap: 10px; padding: 17px 20px; border-bottom: 1px solid var(--border-hairline); }
.cmdk-search-icon { width: 17px; height: 17px; color: var(--text-secondary); flex-shrink: 0; }
.cmdk-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.cmdk-input::placeholder { color: var(--gray); font-family: var(--font-body); }
.cmdk-input-wrap .cmdk-kbd { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary); }
.cmdk-results { max-height: 340px; overflow-y: auto; padding: 8px; }
.cmdk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.87rem;
  color: var(--text);
  transition: background 100ms ease;
}
.cmdk-item .cmdk-item-hint { font-size: 0.74rem; color: var(--gray); }
.cmdk-item.active, .cmdk-item:hover { background: var(--surface-2); }
.cmdk-empty { padding: 20px 12px; color: var(--text-secondary); font-size: 0.85rem; text-align: center; }

/* ---------- responsivo ---------- */
@media (max-width: 980px) {
  .nav-label { display: none; }
  .nav-more-trigger span:not(.nav-more-chevron) { display: none; }
  .topbar-left { gap: 16px; }
}
@media (max-width: 860px) {
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar-left { gap: 10px; }
  .mobile-nav-toggle { display: flex; }
  .topnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    padding: 8px 12px 14px;
    box-shadow: var(--shadow-lg);
  }
  .topnav.mobile-open { display: flex; }
  .nav-btn { padding: 10px 12px; }
  .nav-label { display: inline; }
  .nav-icon { width: 18px; height: 18px; }
  .nav-more { position: static; }
  .nav-more-trigger { display: none; }
  .nav-more-menu, .nav-more-menu.hidden {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0;
    background: transparent;
    display: flex !important;
    flex-direction: column;
    animation: none;
  }
  .nav-more-item { color: var(--header-text); padding: 10px 12px; }
  .nav-more-item:hover { background: rgba(255, 255, 255, 0.06); }
  .nav-more-item.active { background: var(--header-active-bg); color: var(--header-active-fg); }
  .nav-more-item .nav-icon { color: inherit; }

  .cmdk-search { min-width: 0; padding: 0 9px; }
  .cmdk-search span:not(.cmdk-kbd), .cmdk-kbd { display: none; }
  .user-name { display: none; }

  .content { padding: 24px 18px; }
  .dash-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dash-columns { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }

  .view-header { flex-wrap: wrap; row-gap: 12px; }
  .filters { width: 100%; }
  .filters .search-input { flex: 1 1 100%; min-width: 0; }
  .filters button { flex: 1 1 auto; }
}

@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .dash-title { font-size: 1.7rem; }
  .view-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dash-actions { width: 100%; align-items: flex-end; }
  .period-control { flex: 1; }
  .period-control select { width: 100%; }

  .filters select { flex: 1 1 auto; min-width: 0; }
  .filters button { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* valor editável em Histórico de Saques (só saques ainda não enviados) */
.amount-edit-btn { background: none; border: 0; padding: 2px 6px; margin: -2px -6px; border-radius: 6px; color: inherit; cursor: pointer; border-bottom: 1px dashed var(--gray); }
.amount-edit-btn:hover { background: var(--bg); border-bottom-color: var(--green-ink); }
.amount-edit-input { width: 7.5rem; padding: 4px 8px; border: 1px solid var(--green-ink); border-radius: 6px; font: inherit; text-align: right; background: var(--card); color: var(--black); }
