/* =====================================================================================================================
   App do cliente Lendpay - camada premium (carregada DEPOIS de /css/theme.css, só nas páginas do cliente).
   Identidade do site oficial (lendpay.com.br): verde esmeralda #009447, verde profundo #004427, brilho #3fc168, Sora nos
   títulos e valores, Inter no texto, cantos generosos, sombras verdes suaves e o degradê profundo -> esmeralda.
   Mobile-first (menu inferior com o Pix exatamente no centro, topo com o logo oficial); no computador vira menu lateral.
   Tudo usa os tokens do tema (claro e escuro) - nada aqui fixa cor de texto ou de fundo "na mão".
   ===================================================================================================================== */

:root {
  --ap-nav-h: 64px;
  --ap-top-h: 64px;
  --ap-pad: clamp(16px, 4vw, 28px);
  --ap-card-shadow: 0 1px 2px rgba(0, 48, 28, 0.04), 0 10px 30px -14px rgba(0, 48, 28, 0.2);
  --ap-field: rgba(0, 68, 39, 0.16);
  --heading: #004427;
  --ap-info: #1d63b8;
  --ap-info-bg: rgba(29, 99, 184, 0.1);
}

:root[data-theme="dark"] {
  --heading: #eaf5ee;
  --ap-field: rgba(255, 255, 255, 0.16);
  --ap-info: #6ea8f0;
  --ap-info-bg: rgba(110, 168, 240, 0.14);
  --ap-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.65);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 148, 71, 0.28);
  border-radius: 12px;
}

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

/* ------------------------------------------------------------------------------------------------ casca */
.shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  width: auto;
  padding: 22px 16px 16px;
  gap: 8px;
  overflow: hidden;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.main {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  min-width: 0;
  padding: clamp(20px, 3vw, 40px) var(--ap-pad) 72px;
  /* "backwards" e NÃO "both": com "both" o navegador mantém um transform (matrix identidade) no .main depois da animação, e isso vira o
     "dono" de tudo que é position:fixed lá dentro - os pop-ups (modais) passam a se posicionar na página inteira e saem da tela. */
  animation: ap-in 0.45s var(--ease) backwards;
}

@keyframes ap-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------------------------------------------ menu lateral (computador) */
.ap-brand {
  display: flex;
  align-items: center;
  padding: 6px 8px 14px;
}

.ap-brand img {
  display: block;
  height: 34px;
  width: auto;
}

.ap-brand .ap-brand-custom {
  height: 38px;
  width: 38px;
  border-radius: 11px;
  object-fit: cover;
}

.ap-brand .ap-brand-name {
  margin-left: 10px;
  font: 700 1.15rem/1 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text);
}

.ap-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.ap-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  height: 46px;
  padding: 0 12px 0 8px;
  border-radius: 14px;
  color: var(--text-muted);
  font-size: 0.93rem;
  font-weight: 500;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.ap-nav a .ico {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.ap-nav a .ico svg {
  width: 19px;
  height: 19px;
}

.ap-nav a:hover {
  background: var(--tint-1);
  color: var(--text);
}

.ap-nav a:hover .ico {
  color: var(--brand-text);
}

.ap-nav a.active {
  background: linear-gradient(90deg, rgba(0, 148, 71, 0.13), rgba(0, 148, 71, 0.03));
  color: var(--brand-text);
  font-weight: 600;
}

.ap-nav a.active .ico {
  background: var(--grad-brand, linear-gradient(135deg, #004427 0%, #009447 100%));
  color: #fff;
  box-shadow: 0 8px 16px -8px rgba(0, 148, 71, 0.8);
}

.ap-nav a.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 11px;
  bottom: 11px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--gold);
  box-shadow: 0 0 14px rgba(0, 148, 71, 0.7);
  pointer-events: none;
}

.ap-nav .ap-nav-pix {
  margin: 6px 0;
  background: var(--grad-brand, linear-gradient(135deg, #004427 0%, #009447 100%));
  color: #fff;
  box-shadow: 0 14px 26px -14px rgba(0, 148, 71, 0.9);
}

.ap-nav .ap-nav-pix .ico {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.ap-nav .ap-nav-pix:hover,
.ap-nav .ap-nav-pix.active {
  background: var(--grad-brand, linear-gradient(135deg, #004427 0%, #009447 100%));
  color: #fff;
  filter: brightness(1.06);
}

.ap-nav .ap-nav-pix.active::before {
  display: none;
}

.ap-usercard {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-tier1);
}

.ap-usercard .avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 13px;
  background: var(--grad-brand, linear-gradient(135deg, #004427 0%, #009447 100%));
  color: #fff;
  font: 700 0.95rem var(--font-display);
  display: grid;
  place-items: center;
}

.ap-usercard .who {
  min-width: 0;
  flex: 1;
}

.ap-usercard .who b {
  display: block;
  font-size: 0.86rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-usercard .who small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-faint);
}

.ap-usercard .out {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-faint);
}

.ap-usercard .out:hover {
  color: var(--danger);
  background: rgba(217, 54, 62, 0.08);
}

.ap-usercard .out svg {
  width: 19px;
  height: 19px;
}

/* ------------------------------------------------------------------------------------------------ topo (celular) */
.app-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: calc(var(--ap-top-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--ap-pad) 0;
  background: var(--bg); /* reserva: celulares sem color-mix() */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(18px);
  backdrop-filter: saturate(1.5) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.app-topbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 14px 28px -24px rgba(0, 48, 28, 0.6);
}

.app-topbar img.logo {
  display: block;
  height: 28px;
  width: auto;
}

.app-topbar .logo-custom {
  height: 32px;
  width: 32px;
  border-radius: 10px;
  object-fit: cover;
}

.app-topbar .actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ap-iconbtn {
  position: relative;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  box-shadow: var(--shadow-tier1);
}

.ap-iconbtn svg {
  width: 20px;
  height: 20px;
}

.ap-avatar-btn {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 14px;
  background: var(--grad-brand, linear-gradient(135deg, #004427 0%, #009447 100%));
  color: #fff;
  font: 700 0.9rem var(--font-display);
  box-shadow: 0 10px 20px -10px rgba(0, 148, 71, 0.85);
}

.ap-menu {
  position: absolute;
  right: var(--ap-pad);
  top: calc(100% + 6px);
  min-width: 220px;
  padding: 8px;
  border-radius: 18px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-ambient);
  animation: ap-pop 0.18s var(--ease) both;
}

.ap-menu a,
.ap-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  justify-content: flex-start;
}

.ap-menu a:hover,
.ap-menu button:hover {
  background: var(--tint-1);
}

.ap-menu .danger {
  color: var(--danger);
}

.ap-menu svg {
  width: 19px;
  height: 19px;
}

.ap-menu .who {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.ap-menu .who b {
  display: block;
  font-size: 0.9rem;
}

.ap-menu .who small {
  color: var(--text-faint);
  font-size: 0.76rem;
}

@keyframes ap-pop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------------------------------------------ menu inferior (celular): Pix no centro exato */
.app-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 0 max(8px, env(safe-area-inset-left)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-right));
  background: var(--surface-solid); /* reserva: celulares sem color-mix() */
  background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(20px);
  backdrop-filter: saturate(1.6) blur(20px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -14px 34px -26px rgba(0, 48, 28, 0.6);
}

.app-nav .bn-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  height: var(--ap-nav-h);
  max-width: 560px;
  margin: 0 auto;
}

.app-nav .bn-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 0 0 9px;
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color 0.18s var(--ease);
  -webkit-user-select: none;
  user-select: none;
}

.app-nav .bn-item svg {
  width: 23px;
  height: 23px;
  transition: transform 0.25s var(--ease-spring);
}

.app-nav .bn-item:active svg {
  transform: scale(0.88);
}

.app-nav .bn-item.active {
  color: var(--brand-text);
}

.app-nav .bn-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 26px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--grad-brand, linear-gradient(135deg, #004427 0%, #009447 100%));
  box-shadow: 0 4px 12px rgba(0, 148, 71, 0.55);
  pointer-events: none;
}

.app-nav .bn-pix .bn-fab {
  position: absolute;
  left: 50%;
  top: -26px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  background: var(--grad-brand, linear-gradient(135deg, #004427 0%, #009447 100%));
  color: #fff;
  box-shadow: 0 16px 26px -12px rgba(0, 148, 71, 0.9), 0 0 0 5px var(--bg);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease);
}

.app-nav .bn-pix .bn-fab svg {
  width: 26px;
  height: 26px;
}

.app-nav .bn-pix:active .bn-fab {
  transform: translateX(-50%) scale(0.93);
}

.app-nav .bn-pix.active::before {
  display: none;
}

.app-nav .bn-pix.active .bn-fab {
  box-shadow: 0 16px 30px -10px rgba(0, 148, 71, 1), 0 0 0 5px var(--bg), 0 0 0 7px rgba(0, 148, 71, 0.35);
}

/* ------------------------------------------------------------------------------------------------ cabeçalho da página */
.topline {
  align-items: flex-end;
  margin-bottom: 22px;
}

.topline .eyebrow {
  display: inline-flex;
  padding: 5px 12px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--tint-2);
  border: 1px solid var(--border);
  color: var(--brand-text);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.topline h1 {
  font: 800 clamp(1.7rem, 6vw, 2.3rem) / 1.1 var(--font-display);
  letter-spacing: -0.035em;
  color: var(--heading);
}

.topline p {
  margin-top: 8px;
  max-width: 60ch;
}

/* ------------------------------------------------------------------------------------------------ cartões */
.card {
  border-radius: 26px;
  border-color: var(--border);
  box-shadow: var(--ap-card-shadow);
  padding: clamp(18px, 4.5vw, 28px);
  margin-bottom: 18px;
}

.card h2 {
  font: 700 1.04rem/1.25 var(--font-display);
  letter-spacing: -0.015em;
  color: var(--heading);
}

/* cartão de saldo: o único momento escuro, na assinatura da marca */
.hero-balance {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--grad-hero, radial-gradient(120% 140% at 100% 0%, rgba(63, 193, 104, 0.5), rgba(63, 193, 104, 0) 55%), linear-gradient(140deg, #003a22 0%, #005a31 55%, #009447 130%));
  box-shadow: 0 34px 60px -30px rgba(0, 68, 39, 0.9);
  border-radius: 30px;
  padding: clamp(22px, 5vw, 32px);
}

.hero-balance::before {
  content: "";
  position: absolute;
  right: -46px;
  bottom: -70px;
  width: 320px;
  height: 320px;
  background: url("/img/lendpay-mark-white.png") no-repeat center / contain;
  opacity: 0.08;
  pointer-events: none;
}

.hero-balance::after {
  background: radial-gradient(60% 90% at 0% 100%, rgba(63, 193, 104, 0.22), transparent 60%);
}

.hero-balance h2 {
  font: 600 0.78rem var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.hero-balance .amount {
  font: 800 clamp(2.3rem, 10vw, 3.3rem) / 1.05 var(--font-display);
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  margin: 12px 0 4px;
}

.balance-toggle {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Saldo ao vivo (home): indicador, hora da última conferência e variação do saldo */
.ap-live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.82);
}

.ap-live .dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5df08f;
  box-shadow: 0 0 0 0 rgba(93, 240, 143, 0.55);
  animation: ap-live-pulse 2.2s ease-out infinite;
}

.ap-live.off .dot {
  background: #f6c453;
  box-shadow: none;
  animation: none;
}

.ap-live button {
  margin-left: auto;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  box-shadow: none;
}

.ap-live button:disabled {
  opacity: 0.6;
}

.ap-delta {
  display: none;
  margin: 2px 0 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.ap-delta.show {
  display: inline-block;
  animation: ap-delta-in 0.4s ease-out both;
}

.ap-delta.in {
  background: rgba(93, 240, 143, 0.28);
}

.ap-delta.out {
  background: rgba(255, 255, 255, 0.18);
}

.hero-balance .amount.flash {
  animation: ap-amount-flash 1.1s ease-out;
}

@keyframes ap-live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(93, 240, 143, 0.55);
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px rgba(93, 240, 143, 0);
  }
}

@keyframes ap-delta-in {
  from {
    transform: translateY(4px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes ap-amount-flash {
  0% {
    text-shadow: 0 0 22px rgba(93, 240, 143, 0.9);
  }
  100% {
    text-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ap-live .dot,
  .ap-delta.show,
  .hero-balance .amount.flash {
    animation: none;
  }
}

.copy-chip {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
  min-height: 34px;
}

.copy-chip:hover {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

/* ações rápidas em grade (4 por linha), sem rolagem lateral escondida */
.quick-actions-head {
  margin: 26px 0 12px;
}

.quick-actions-head .hint {
  display: none;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 6px;
  overflow: visible;
  margin-bottom: 22px;
}

.qa-btn {
  width: auto;
  padding: 10px 2px 4px;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 600;
}

.qa-btn .qa-icon {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  background: linear-gradient(150deg, var(--tint-3), var(--tint-2));
  border: 1px solid var(--border);
  color: var(--brand-text);
  box-shadow: var(--shadow-tier1);
}

.qa-btn .qa-icon svg {
  width: 26px;
  height: 26px;
}

.qa-btn.primary-action .qa-icon {
  background: var(--grad-brand, linear-gradient(135deg, #004427 0%, #009447 100%));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 14px 26px -12px rgba(0, 148, 71, 0.9);
}

/* ------------------------------------------------------------------------------------------------ resumo, atividade, metas, dica */
.ap-split {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--tint-2);
  margin: 16px 0 14px;
}

.ap-split i {
  display: block;
  height: 100%;
  transition: width 0.8s var(--ease);
}

.ap-split .in {
  background: linear-gradient(90deg, #3fc168, #009447);
}

.ap-split .out {
  background: linear-gradient(90deg, #004427, #00301c);
}

.ap-sum {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ap-sum .k {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-faint);
  font-weight: 600;
}

.ap-sum .k i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.ap-sum .v {
  margin-top: 4px;
  font: 700 1.2rem var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.activity-day {
  margin: 18px 0 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.activity-day:first-child {
  margin-top: 0;
}

.activity-row {
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

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

.activity-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 16px;
}

.activity-icon.credit {
  background: var(--tint-3);
  color: var(--brand-text);
}

.activity-icon.debit {
  background: var(--tint-1);
  color: var(--text-muted);
}

.activity-info .title {
  font-weight: 600;
  color: var(--text);
}

.activity-value {
  font: 700 0.95rem var(--font-display);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.activity-value.amount-credit {
  color: var(--success);
}

.ap-ring {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
}

.ap-ring svg {
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
}

.ap-ring .pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 0.76rem var(--font-display);
  color: var(--brand-text);
}

.ap-goal {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.ap-goal:last-child {
  border-bottom: none;
}

.ap-goal b {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
}

.ap-tip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--tint-2), var(--surface));
  color: var(--text);
  text-decoration: none;
}

.ap-tip .ico {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--grad-brand, linear-gradient(135deg, #004427 0%, #009447 100%));
  color: #fff;
}

.ap-tip .ico svg {
  width: 22px;
  height: 22px;
}

.ap-tip b {
  display: block;
  font-size: 0.92rem;
}

.ap-tip span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.ap-tip.warn {
  background: linear-gradient(135deg, rgba(217, 138, 11, 0.12), var(--surface));
}

.ap-tip.warn .ico {
  background: linear-gradient(135deg, #d98a0b, #b45309);
}

/* Avisos da equipe na tela inicial (texto simples, para todos ou para um segmento). */
.ap-notices {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}

.ap-notices:empty {
  display: none;
}

.ap-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 16px 20px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--tint-2), var(--surface));
  color: var(--text);
}

.ap-notice-text {
  flex: 1 1 280px;
  min-width: 0;
}

.ap-notice-text b {
  display: block;
  font-size: 0.98rem;
  color: var(--heading, var(--text));
  overflow-wrap: anywhere;
}

.ap-notice-text p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.ap-notice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ap-notice-dismiss {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font: 600 0.84rem var(--font-body, inherit);
  cursor: pointer;
}

.ap-notice-dismiss:hover {
  background: var(--tint-2);
  color: var(--text);
}

.ap-notice.tone-success {
  border-color: rgba(0, 148, 71, 0.35);
  background: linear-gradient(135deg, rgba(0, 148, 71, 0.12), var(--surface));
}

.ap-notice.tone-warning {
  border-color: rgba(217, 138, 11, 0.4);
  background: linear-gradient(135deg, rgba(217, 138, 11, 0.14), var(--surface));
}

.ap-skel {
  display: block;
  border-radius: 12px;
  min-height: 14px;
  background: linear-gradient(90deg, var(--tint-1) 25%, var(--tint-2) 37%, var(--tint-1) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
}

/* ------------------------------------------------------------------------------------------------ botões */
button,
.btn {
  border-radius: 16px;
  min-height: 48px;
}

button.primary,
.btn.primary {
  background: var(--grad-brand, linear-gradient(135deg, #004427 0%, #009447 100%));
  color: var(--gold-ink);
  box-shadow: 0 14px 26px -14px rgba(0, 148, 71, 0.85);
}

button.primary:hover,
.btn.primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 18px 30px -14px rgba(0, 148, 71, 0.95);
}

button.primary.block,
button.secondary.block,
.btn.block {
  min-height: 54px;
  font-size: 0.98rem;
}

button.secondary,
.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--ap-field);
  box-shadow: var(--shadow-tier1);
}

button.secondary:hover,
.btn.secondary:hover {
  background: var(--tint-1);
  border-color: var(--gold);
  color: var(--brand-text);
}

button.ghost {
  color: var(--text-muted);
}

button.sm,
.btn.sm {
  min-height: 38px;
  border-radius: 12px;
}

.btn {
  text-decoration: none;
}

/* ------------------------------------------------------------------------------------------------ formulários */
label {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  margin: 18px 0 8px;
}

input,
select,
textarea {
  min-height: 54px;
  border-radius: 16px;
  background: var(--surface);
  border-color: var(--ap-field);
  font-size: 1rem;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(0, 148, 71, 0.18);
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238b9b90' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

input[type="number"].amount,
input.amount {
  font: 700 1.9rem var(--font-display);
  letter-spacing: -0.03em;
  min-height: 68px;
}

.field-error {
  color: var(--danger);
  font-size: 0.84rem;
}

/* ------------------------------------------------------------------------------------------------ abas (segmentadas) */
.tabs {
  display: flex;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  padding: 5px;
  margin-bottom: 20px;
  border-radius: 20px;
  background: var(--tint-1);
  border: 1px solid var(--border);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs a,
.tabs button {
  flex: 1 0 auto;
  min-height: 42px;
  padding: 0 16px;
  gap: 7px;
  border-radius: 15px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  scroll-snap-align: center;
  box-shadow: none;
}

.tabs a:hover,
.tabs button:hover {
  color: var(--text);
}

.tabs a.active,
.tabs button.active {
  background: var(--surface-solid);
  color: var(--brand-text);
  box-shadow: 0 6px 16px -8px rgba(0, 48, 28, 0.5), 0 0 0 1px var(--border);
}

/* ------------------------------------------------------------------------------------------------ selos, listas, tabelas */
.pill {
  padding: 5px 12px;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
}

.pill.info {
  background: var(--ap-info-bg);
  color: var(--ap-info);
}

.table-wrap {
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

thead th {
  background: var(--tint-1);
  padding: 13px 14px;
}

tbody td {
  padding: 13px 14px;
}

tbody tr:hover {
  background: var(--tint-1);
}

.empty-state {
  padding: 46px 20px;
}

/* ------------------------------------------------------------------------------------------------ janelas: viram "folha" que sobe da base no celular */
.modal-overlay {
  background: rgba(0, 24, 12, 0.55);
}

.modal {
  border-radius: 28px;
}

.toast-stack {
  right: 16px;
  left: 16px;
  bottom: calc(var(--ap-nav-h) + 18px + env(safe-area-inset-bottom, 0px));
  align-items: center;
  pointer-events: none;
}

.toast {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  border-left-width: 4px;
}

.toast.ok {
  border-left-color: var(--gold);
}

.toast.err {
  border-left-color: var(--danger);
}

/* ------------------------------------------------------------------------------------------------ páginas de acesso (login, cadastro, recuperação) */
.auth-shell.ap-auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  justify-items: center;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
}

.ap-auth-brand {
  display: none;
}

.ap-auth-form {
  width: 100%;
  max-width: 460px;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) var(--ap-pad) 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ap-auth-logo {
  display: flex;
  justify-content: center;
  margin: 0 0 26px;
}

.ap-auth-logo img {
  display: block;
  height: 42px;
  width: auto;
}

.ap-auth-logo .custom {
  height: 52px;
  width: 52px;
  border-radius: 15px;
  object-fit: cover;
}

.ap-auth-form .auth-card {
  max-width: none;
  border-radius: 28px;
  box-shadow: var(--ap-card-shadow);
}

@media (min-width: 980px) {
  .auth-shell.ap-auth {
    grid-template-columns: minmax(380px, 1.05fr) minmax(460px, 1fr);
    justify-items: stretch;
  }

  .ap-auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(36px, 5vw, 64px);
    color: #fff;
    background: var(--grad-hero, radial-gradient(120% 140% at 100% 0%, rgba(63, 193, 104, 0.5), rgba(63, 193, 104, 0) 55%), linear-gradient(140deg, #003a22 0%, #005a31 55%, #009447 130%));
  }

  .ap-auth-brand::before {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -110px;
    width: 560px;
    height: 560px;
    background: url("/img/lendpay-mark-white.png") no-repeat center / contain;
    opacity: 0.07;
    pointer-events: none;
  }

  .ap-auth-brand > * {
    position: relative;
  }

  .ap-auth-brand img.logo {
    display: block;
    align-self: flex-start;
    height: 46px;
    width: auto;
    max-width: 100%;
  }

  .ap-auth-brand h2 {
    margin: 0 0 14px;
    font: 800 clamp(2rem, 3.4vw, 3rem) / 1.08 var(--font-display);
    letter-spacing: -0.04em;
    color: #fff;
  }

  .ap-auth-brand p {
    max-width: 44ch;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
  }

  .ap-auth-facts {
    display: grid;
    gap: 12px;
    margin-top: 30px;
  }

  .ap-auth-facts div {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-weight: 600;
    font-size: 0.94rem;
  }

  .ap-auth-facts svg {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    color: #6fe39a;
  }

  .ap-auth-brand small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.78rem;
  }

  .ap-auth-form {
    margin: 0 auto;
    max-width: 500px;
  }

  .ap-auth-logo {
    display: none;
  }
}

/* ------------------------------------------------------------------------------------------------ responsivo */
@media (max-width: 860px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    display: none;
  }

  .app-topbar {
    display: flex;
  }

  .app-nav {
    display: block;
  }

  .main {
    padding: 16px var(--ap-pad) calc(var(--ap-nav-h) + 40px + env(safe-area-inset-bottom, 0px));
    max-width: 100%;
  }

  .topline {
    margin-bottom: 18px;
  }

  .topline .eyebrow {
    display: none;
  }

  .row > * {
    min-width: 100%;
  }
}

@media (min-width: 861px) {
  .toast-stack {
    left: auto;
    right: 24px;
    bottom: 24px;
    align-items: flex-end;
  }

  .toast {
    width: auto;
  }
}

@media print {
  .app-topbar,
  .app-nav,
  .sidebar {
    display: none !important;
  }
}

/* ------------------------------------------------------------------------------------------------ busca, atalhos de filtro e linhas tocáveis */
.ap-filterbar {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.ap-search {
  position: relative;
}

.ap-search svg {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.ap-search input {
  padding-left: 46px;
  box-shadow: var(--shadow-tier1);
}

.ap-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 1px;
}

.ap-chips::-webkit-scrollbar {
  display: none;
}

.ap-chips button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--ap-field);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: none;
}

.ap-chips button.on {
  background: var(--grad-brand, linear-gradient(135deg, #004427 0%, #009447 100%));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 20px -10px rgba(0, 148, 71, 0.85);
}

.ap-more {
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0 18px;
}

.ap-more > summary {
  display: flex;
  align-items: center;
  min-height: 52px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--brand-text);
  list-style: none;
}

.ap-more > summary::-webkit-details-marker {
  display: none;
}

.ap-more > summary::after {
  content: "";
  margin-left: auto;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s var(--ease);
}

.ap-more[open] > summary::after {
  transform: rotate(-135deg);
}

.ap-more[open] {
  padding-bottom: 18px;
}

.activity-row.tappable {
  cursor: pointer;
  border-radius: 14px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  transition: background 0.15s var(--ease);
}

.activity-row.tappable:hover,
.activity-row.tappable:focus-visible {
  background: var(--tint-1);
}

.statement-day-header {
  position: sticky;
  top: calc(var(--ap-top-h) + env(safe-area-inset-top, 0px));
  z-index: 2;
  padding: 12px 0 6px !important;
  background: var(--surface);
  letter-spacing: 0.1em !important;
}

@media (min-width: 861px) {
  .statement-day-header {
    top: 0;
  }
}

/* selos e avatares dentro do cartão escuro de marca: contraste garantido */
.hero-balance .pill {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.hero-balance .pill::before {
  background: #6fe39a;
}

.hero-balance .pill.err::before {
  background: #ff9aa0;
}

.hero-balance .pill.warn::before {
  background: #ffc861;
}

.hero-balance .row-avatar {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
}

/* ------------------------------------------------------------------------------------------------ perfil: tema, limites */
.ap-theme {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ap-theme button {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 12px 8px 12px;
  min-height: 0;
  border-radius: 18px;
  background: var(--surface);
  border: 1.5px solid var(--ap-field);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: none;
}

.ap-theme button.on {
  border-color: var(--gold);
  color: var(--brand-text);
  box-shadow: 0 0 0 3px rgba(0, 148, 71, 0.16);
}

.ap-theme .sw {
  display: block;
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
}

.ap-theme .sw-light {
  background: linear-gradient(135deg, #ffffff 0 62%, #dcf7e1 62%);
}

.ap-theme .sw-dark {
  background: linear-gradient(135deg, #0f1f16 0 62%, #1c3f2b 62%);
}

.ap-theme .sw-auto {
  background: linear-gradient(135deg, #ffffff 0 50%, #0f1f16 50%);
}

.ap-limit-hero {
  display: grid;
  gap: 2px;
  padding: 18px;
  margin-bottom: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--tint-2), var(--surface));
  border: 1px solid var(--border);
}

.ap-limit-hero span,
.ap-limit-hero small {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ap-limit-hero strong {
  font: 800 1.9rem var(--font-display);
  letter-spacing: -0.04em;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}

/* Ajuda com Pix (home) e passo a passo do MED */
.ap-help-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.ap-med-steps ol {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 20px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.ap-med-steps li b {
  color: var(--text);
}

/* Ponto de "resposta nova" no item Ajuda (menu lateral, menu do avatar) e no botão do avatar */
.ap-help-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 8px;
  border-radius: 50%;
  background: #e5484d;
}

.ap-help-dot[hidden] {
  display: none;
}

.ap-avatar-btn.has-news {
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.45);
}

/* Ajuda: aviso de segurança, atalhos, lista de atendimentos e conversa */
.ap-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.ap-card-head h2 {
  margin: 0;
}

.ap-safe {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--tint-2);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.ap-safe b {
  font-size: 0.95rem;
  color: var(--brand-text);
}

.ap-help-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.ap-tile {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-solid);
  text-decoration: none;
}

.ap-tile b {
  font-size: 0.98rem;
  color: var(--heading);
}

.ap-tile span {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.ap-tile:hover {
  border-color: var(--border-strong);
}

@media (max-width: 480px) {
  .ap-help-tiles {
    grid-template-columns: 1fr;
  }
}

.ap-tk {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.ap-tk:last-child {
  border-bottom: 0;
}

.ap-tk .tx {
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
}

.ap-tk .tx b {
  color: var(--text);
  overflow-wrap: anywhere;
}

.ap-tk .tx small {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.ap-tk .dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e5484d;
}

.ap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ap-chips button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
}

.ap-chips button.on {
  border-color: var(--brand-text, #006b35);
  background: var(--tint-2);
  color: var(--brand-text, #006b35);
}

.ap-count {
  margin-top: 4px;
  text-align: right;
  font-size: 0.74rem;
  color: var(--text-faint);
}

.ap-chat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.ap-chat-head .who {
  display: grid;
  flex: 1 1 160px;
  min-width: 0;
}

.ap-chat-head .who b {
  color: var(--heading);
}

.ap-chat-head .who span {
  font-size: 0.84rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.ap-queue {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--tint-2);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ap-thread {
  display: grid;
  gap: 12px;
  max-height: 52vh;
  padding: 16px 2px;
  overflow-y: auto;
}

.ap-msg {
  display: grid;
  gap: 3px;
  max-width: 86%;
}

.ap-msg.customer {
  justify-self: end;
  justify-items: end;
}

.ap-msg .bubble {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ap-msg.customer .bubble {
  border-color: var(--border-strong);
  border-bottom-right-radius: 6px;
  background: var(--tint-2);
}

.ap-msg.staff .bubble {
  border-bottom-left-radius: 6px;
}

.ap-msg.system {
  justify-self: center;
  max-width: 100%;
  text-align: center;
}

.ap-msg.system .bubble {
  border: 0;
  background: none;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ap-msg small {
  font-size: 0.72rem;
  color: var(--text-faint);
}

.ap-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ap-composer textarea {
  flex: 1 1 auto;
  min-height: 48px;
  resize: vertical;
}

.ap-rate {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--tint-2);
  text-align: center;
}

.ap-stars {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.ap-stars button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-solid);
  box-shadow: none;
  font-size: 1.4rem;
  line-height: 1;
  color: #d9a400;
}

/* Devolução de Pix: o cliente escolhe o Pix recebido numa lista */
.ap-dev-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.ap-dev-row:last-child {
  border-bottom: 0;
}

.ap-dev-row .who {
  flex: 1 1 auto;
  min-width: 0;
}

.ap-dev-row .who b {
  display: block;
  color: var(--text);
  overflow-wrap: anywhere;
}

.ap-dev-row .who small {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.ap-dev-row strong {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: var(--heading);
}

.ap-dev-row button {
  flex: 0 0 auto;
}

.ap-dev-row.picked {
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--tint-1);
}

@media (max-width: 480px) {
  .ap-dev-row {
    flex-wrap: wrap;
  }

  .ap-dev-row .who {
    flex-basis: 55%;
  }
}

/* Dados da conta (perfil): agência, conta, instituição, com copiar e compartilhar */
.ap-acct-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ap-acct-head h2 {
  margin: 0 0 4px;
}

.ap-acct {
  display: grid;
  margin: 14px 0 0;
}

.ap-acct > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.ap-acct > div:last-child {
  border-bottom: 0;
}

.ap-acct dt {
  flex: 0 0 92px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.ap-acct dd {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* o .copy-chip padrão é branco sobre o verde do cartão de saldo; em cartão claro precisa das cores da marca */
.ap-acct .copy-chip {
  flex: 0 0 auto;
  background: var(--tint-2, #e9f6eb);
  border-color: var(--border-strong, rgba(0, 68, 39, 0.22));
  color: var(--brand-text, #006b35);
}

.ap-acct .copy-chip:hover {
  background: var(--surface-hover, #d7eedd);
  color: var(--brand-text, #006b35);
}

.ap-acct-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.ap-limit {
  margin-bottom: 16px;
}

.ap-limit .top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.ap-limit .top b {
  color: var(--text);
  font-weight: 700;
}

.ap-limit .top small {
  font-weight: 500;
  color: var(--text-faint);
}

.ap-meter {
  height: 10px;
  border-radius: 999px;
  background: var(--tint-2);
  overflow: hidden;
}

.ap-meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--grad-brand, linear-gradient(135deg, #004427 0%, #009447 100%));
  transition: width 0.8s var(--ease);
}

.ap-meter i.hot {
  background: linear-gradient(90deg, #d98a0b, var(--danger));
}

.pill.brand {
  background: var(--tint-3);
  color: var(--brand-text);
}

/* ------------------------------------------------------------------------------------------------ cofrinhos */
.ap-goalcard {
  padding: 20px;
}

.ap-goalhead {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.ap-goalvals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: var(--tint-1);
}

.ap-goalvals small {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.ap-goalvals b {
  display: block;
  margin-top: 3px;
  font: 700 1.15rem var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.ap-goalactions {
  display: flex;
  gap: 10px;
}

.ap-goalactions input {
  flex: 1;
  min-width: 0;
}

.ap-goalactions button {
  flex: 0 0 auto;
  padding: 0 22px;
}

.ap-del {
  margin-top: 8px;
  color: var(--text-faint);
}

.ap-del:hover {
  color: var(--danger);
}

/* listas com texto longo (histórico, favoritos): o título quebra em vez de virar "Tran..." */
.activity-info {
  min-width: 0;
}

.activity-info .title,
.activity-info .sub {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* formulários e abas do Pix/Pagar não esticam por toda a tela larga: leitura e toque confortáveis */
@media (min-width: 861px) {
  .card.tab-panel,
  .main > .tabs,
  .main > .ap-filterbar {
    max-width: 800px;
  }
}

/* ------------------------------------------------------------------------------------------------ confirmação de sucesso (Pix enviado, boleto pago) */
.modal-overlay.ap-sheet-overlay {
  align-items: flex-end;
  padding: 0;
}

.ap-sheet {
  max-width: 460px;
  padding: 34px 22px calc(22px + env(safe-area-inset-bottom, 0px));
  border-radius: 28px 28px 0 0;
  text-align: center;
  animation: ap-sheet-up 0.42s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

@media (min-width: 640px) {
  .modal-overlay.ap-sheet-overlay {
    align-items: center;
    padding: 20px;
  }

  .ap-sheet {
    padding: 38px 32px 28px;
    border-radius: 28px;
    animation-name: ap-sheet-pop;
  }
}

@keyframes ap-sheet-up {
  from {
    transform: translateY(100%);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes ap-sheet-pop {
  from {
    transform: translateY(14px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.ap-check {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--grad-brand, linear-gradient(135deg, #004427 0%, #009447 100%));
  box-shadow: 0 16px 32px -12px rgba(0, 148, 71, 0.7);
  animation: ap-check-pop 0.5s 0.08s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

.ap-check::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 2px solid rgba(0, 148, 71, 0.38);
  border-radius: 50%;
  animation: ap-halo 1.5s 0.4s ease-out both;
  pointer-events: none;
}

.ap-check svg {
  width: 52px;
  height: 52px;
}

.ap-check .tick {
  stroke: #fff;
  stroke-width: 4.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: ap-tick 0.45s 0.42s ease-out forwards;
}

@keyframes ap-check-pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes ap-tick {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes ap-halo {
  from {
    transform: scale(0.88);
    opacity: 1;
  }
  to {
    transform: scale(1.4);
    opacity: 0;
  }
}

.ap-sheet h2 {
  margin: 0;
  font-size: 1.32rem;
  color: var(--heading);
}

.ap-sheet-amount {
  margin: 8px 0 2px;
  font-family: var(--font-display);
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.ap-sheet-list {
  margin: 20px 0 0;
  padding: 2px 16px;
  text-align: left;
  background: var(--tint-1);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.ap-sheet-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
}

.ap-sheet-list > div + div {
  border-top: 1px dashed var(--border-strong);
}

.ap-sheet-list dt {
  flex: 0 0 auto;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.ap-sheet-list dd {
  min-width: 0;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.ap-sheet-note {
  margin: 14px 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.ap-sheet-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.ap-sheet-actions .primary {
  width: 100%;
  min-height: 52px;
}

.ap-sheet-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--ap-field);
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--brand-text);
  text-decoration: none;
}

.ap-sheet-link:hover {
  background: var(--tint-1);
}

/* ------------------------------------------------------------------------------------------------ atalhos de favoritos (Pix) */
.ap-favstrip {
  margin: 0 0 16px;
}

.ap-favlabel {
  display: block;
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.ap-favlist {
  display: flex;
  gap: 12px;
  margin: 0 -4px;
  padding: 2px 4px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ap-favlist::-webkit-scrollbar {
  display: none;
}

.ap-fav {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 68px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--text);
}

.ap-fav .av {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--tint-2);
  border: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-text);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.ap-fav:hover .av,
.ap-fav:focus-visible .av {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgba(0, 148, 71, 0.8);
}

.ap-fav .nm {
  max-width: 68px;
  overflow: hidden;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* linhas de lista com status/ações à direita (histórico, agendados, chaves, favoritos): coluna própria, o título não quebra no meio da palavra */
.activity-side {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.activity-side .pill {
  margin: 0;
}

.activity-side.stack {
  align-items: stretch;
}

.activity-side.stack button {
  margin: 0;
}

/* camada de seguranca de clique: enfeite nunca intercepta toque (o brilho do fundo das telas de acesso cobria o "Criar conta gratuita" no celular)
   e o formulario fica acima dos enfeites. Fica aqui (alem do theme.css) para valer mesmo com um theme.css antigo no cache do navegador. */
.auth-shell::before,
.auth-shell::after {
  pointer-events: none;
}

.ap-auth-form {
  position: relative;
  z-index: 1;
}

.ap-sheet-actions .ap-sheet-receipt {
  width: 100%;
  min-height: 50px;
}
