.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.topbar--home {
  min-height: 112px;
  padding: 25px var(--space-5) 19px;
}

.greeting {
  margin-bottom: 9px;
  color: var(--color-text-secondary);
  font-size: 15px;
}

.topbar__actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.icon-button {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(231, 233, 239, 0.75);
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: 0 6px 20px rgba(32, 39, 66, 0.07);
  transition: transform var(--motion-fast), background var(--motion-fast);
}

.icon-button:not(:disabled):active {
  transform: scale(0.96);
  background: var(--color-surface-secondary);
}

.icon-button:disabled {
  opacity: 1;
  cursor: default;
}

.icon-button svg {
  width: 23px;
  height: 23px;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--color-surface);
  border-radius: 50%;
  background: var(--color-primary);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 0 4px 4px;
  border-radius: 50%;
  background: #5bc65b;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.section-header h2 {
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.section-header > span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.section-header svg,
.row-chevron svg {
  width: 17px;
  height: 17px;
}

.balance-card,
.shortcut-card,
.content-card {
  border: 1px solid rgba(231, 233, 239, 0.78);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.balance-card {
  display: block;
  min-height: 194px;
  padding: var(--space-5);
}

.balance-card__main {
  min-width: 0;
}

.balance-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.balance-card__main > p:first-child {
  color: var(--color-text-secondary);
  font-size: 14px;
}

.balance-card__actions {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 8px;
}

.balance-card__privacy-button {
  width: 42px;
  height: 42px;
  border-color: rgba(91, 115, 232, 0.12);
  background: linear-gradient(145deg, var(--color-primary-faint), var(--color-primary-soft));
  color: var(--color-primary);
  box-shadow: none;
}

.balance-card__privacy-button svg {
  width: 20px;
  height: 20px;
}

.balance-card__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 8px 11px;
  border: 1px solid rgba(91, 115, 232, 0.12);
  border-radius: var(--radius-round);
  background: rgba(255, 255, 255, 0.68);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.balance-card__amount {
  margin-top: 8px;
  font-size: clamp(29px, 8vw, 36px);
  font-weight: 680;
  letter-spacing: -0.04em;
  line-height: 1.15;
  white-space: nowrap;
}

.empty-hint {
  min-height: 19px;
  margin-top: var(--space-1);
  color: var(--color-text-subtle);
  font-size: 12px;
}

.balance-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.balance-chip {
  display: flex;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--color-surface-secondary);
}

.balance-chip__arrow {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 20px;
}

.balance-chip span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.balance-chip small {
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 1.15;
}

.balance-chip strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.balance-chip--income strong {
  color: var(--color-success);
}

.balance-chip--expense strong {
  color: var(--color-danger);
}



.shortcut-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 94px;
  padding: 13px 8px 11px;
}

.shortcut {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: 0 2px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}

.shortcut__icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  transition: transform var(--motion-fast), background var(--motion-fast);
}

.shortcut:active .shortcut__icon {
  transform: scale(0.95);
  background: #e2e7ff;
}

.shortcut__icon svg {
  width: 23px;
  height: 23px;
}

.content-card {
  padding: 14px 15px 9px;
}

.financial-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 16px;
  min-height: 55px;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--color-border);
}

.financial-row:first-child {
  border-top: 0;
}

.row-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
}

.row-icon--soft {
  background: var(--color-primary-faint);
  color: var(--color-primary);
}

.row-icon svg {
  width: 20px;
  height: 20px;
}

.row-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.row-copy small,
.credit-card-preview small {
  color: var(--color-text-secondary);
  font-size: 11px;
}

.row-chevron {
  color: var(--color-text-secondary);
}

.due-row {
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
}

.date-chip {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--color-primary-faint);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 650;
}

.skeleton {
  display: block;
  overflow: hidden;
  background: #edf0f6;
}

.skeleton:not(.row-icon, .card-brand)::after,
.skeleton.row-icon::after,
.skeleton.card-brand::after {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.8s infinite;
}

.skeleton--text {
  width: min(100%, 88px);
  height: 10px;
  border-radius: 5px;
}

.skeleton--amount {
  width: 58px;
  height: 11px;
  border-radius: 5px;
}

.skeleton--short {
  display: block;
  width: 42px;
  height: 11px;
  border-radius: 5px;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.credit-card-preview {
  display: grid;
  grid-template-columns: 47px minmax(72px, 1fr) minmax(75px, 0.9fr) minmax(58px, 0.65fr) 16px;
  gap: 9px;
  align-items: center;
  padding: 11px;
  border-radius: var(--radius-md);
  background: var(--color-primary-faint);
}

.card-brand {
  width: 45px;
  height: 45px;
  border-radius: 12px;
}

.credit-card-preview__name,
.credit-card-preview__metric {
  display: grid;
  gap: 3px;
}

.progress-track {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: var(--radius-round);
  background: #dfe4f7;
}

.progress-track span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--color-primary);
}

.credit-card-preview__limit {
  grid-column: 1 / -1;
}

.credit-card-preview__metric--positive strong,
.credit-card-preview__metric--positive .credit-card-preview__hint {
  color: var(--color-success);
}

.bottom-nav {
  z-index: 5;
  display: grid;
  min-height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  padding: 9px 8px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(231, 233, 239, 0.85);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -8px 24px rgba(38, 45, 74, 0.045);
}

.nav-item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 3px 1px;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 10.5px;
  transition: color var(--motion-fast), transform var(--motion-fast);
}

.nav-item svg {
  width: 25px;
  height: 25px;
}

.nav-item.is-active {
  color: var(--color-primary);
}

.nav-item:not(:disabled):active {
  transform: translateY(1px);
}

.nav-item:disabled {
  opacity: 0.85;
}

.sheet-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  background: rgba(20, 24, 36, 0.32);
  animation: fade-in var(--motion-default);
}

.more-sheet {
  position: fixed;
  z-index: 21;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 520px);
  margin: auto;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  border: 1px solid var(--color-border);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: var(--color-surface);
  box-shadow: 0 -18px 50px rgba(20, 24, 36, 0.16);
  animation: sheet-in var(--motion-default);
}

.sheet-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 20px;
  border-radius: var(--radius-round);
  background: var(--color-border);
}

.sheet-heading {
  margin-bottom: var(--space-5);
}

.sheet-heading h2 {
  font-size: 20px;
}

.sheet-heading p {
  margin-top: var(--space-1);
  color: var(--color-text-secondary);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 50px;
  border-radius: var(--radius-md);
  font-weight: 650;
}

.primary-button {
  border: 1px solid var(--color-primary);
  background: var(--color-primary);
  color: white;
}

.secondary-button {
  margin-top: var(--space-2);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-primary);
}

.app-notice {
  position: absolute;
  z-index: 30;
  top: 12px;
  right: 14px;
  left: 14px;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: 13px;
  background: var(--color-surface);
  box-shadow: var(--shadow-floating);
  font-size: 13px;
  text-align: center;
}

.app-notice[data-tone="error"] {
  border-color: rgba(228, 91, 104, 0.25);
  color: var(--color-danger);
}

.app-notice[data-tone="warning"] {
  border-color: rgba(232, 162, 58, 0.25);
  color: #9a681c;
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes sheet-in {
  from { transform: translateY(22px); opacity: 0; }
}

.cards-stack {
  display: grid;
  gap: 10px;
}

.row-icon--label {
  background: var(--color-primary-faint);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.row-title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-amount,
.credit-card-preview__metric strong {
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.row-amount--negative {
  color: var(--color-danger);
}

.credit-card-preview__name strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-state {
  padding: 18px 0 14px;
  color: var(--color-text-secondary);
  font-size: 13px;
  text-align: center;
}
.brand-badge {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(91, 115, 232, 0.14);
  border-radius: 12px;
  background: linear-gradient(145deg, #ffffff, #eef1ff);
  color: var(--color-primary);
}

.brand-badge--large {
  width: 45px;
  height: 45px;
  flex-basis: 45px;
  border-radius: 14px;
}

.brand-badge__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-badge__fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-badge--large .brand-badge__fallback {
  font-size: 12px;
}

.brand-badge--generic {
  background: linear-gradient(145deg, #ffffff, #eef1ff);
}

.brand-badge--mercado-pago,
.brand-badge--inter,
.brand-badge--nubank,
.brand-badge--santander,
.brand-badge--sicredi,
.brand-badge--cea,
.brand-badge--renner {
  background: linear-gradient(145deg, #ffffff, #eef1ff);
}

.profile-button {
  overflow: hidden;
}

.profile-avatar,
.profile-avatar__fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.profile-avatar {
  display: block;
  object-fit: cover;
}

.profile-avatar__fallback {
  display: grid;
  place-items: center;
}

.profile-avatar__fallback svg {
  width: 20px;
  height: 20px;
}

.icon-button--refresh.is-loading svg {
  animation: spin 0.9s linear infinite;
}

.home-sync-banner {
  margin: 0 var(--space-5) var(--space-3);
  padding: 10px 12px;
  border: 1px solid rgba(232, 162, 58, 0.2);
  border-radius: 12px;
  background: rgba(255, 249, 236, 0.92);
  color: #9a681c;
  font-size: 12px;
  text-align: center;
}

.pull-refresh-indicator {
  display: grid;
  align-items: end;
  justify-items: center;
  height: var(--pull-refresh-height, 0px);
  margin: 0 var(--space-5);
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 12px;
  transition: height var(--motion-fast), opacity var(--motion-fast);
}

.pull-refresh-indicator__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-round);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(231, 233, 239, 0.85);
  box-shadow: 0 8px 24px rgba(32, 39, 66, 0.06);
}

.pull-refresh-indicator--armed .pull-refresh-indicator__label {
  color: var(--color-primary);
}

.pull-refresh-indicator--loading .pull-refresh-indicator__label {
  color: var(--color-primary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.bottom-nav {
  transition: opacity var(--motion-fast), transform var(--motion-fast);
}

.app-shell[data-chat-keyboard-open="true"] .bottom-nav {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}

