/* MinhasFinanças — mobile-first (paleta própria, estética app financeiro limpo) */
:root {
  --purple: #5d5fef;
  --purple-dark: #4547c9;
  --green: #00c897;
  --blue: #3b82f6;
  --orange: #ff8a00;
  --bg: #eef0f6;
  --card: #fff;
  --text: #1a1d26;
  --muted: #6b7280;
  --radius: 18px;
  --border-card: rgba(26, 29, 38, 0.07);
  --shadow: 0 1px 2px rgba(26, 29, 38, 0.04), 0 8px 24px rgba(26, 29, 38, 0.07);
  --shadow-header: 0 16px 48px -12px rgba(93, 95, 239, 0.38);
  --content-max: 1200px;
  --content-pad: clamp(0.75rem, 3vw, 1.75rem);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

input,
select,
textarea,
button {
  font-family: inherit;
  font-size: inherit;
}

a {
  color: var(--purple);
  text-decoration: none;
}

.app-body {
  min-height: 100dvh;
  padding-bottom: 88px;
}

.app-shell {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  min-height: 100dvh;
  padding-left: var(--content-pad);
  padding-right: var(--content-pad);
  box-sizing: border-box;
}

.offline-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 calc(-1 * var(--content-pad)) 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.35;
  background: #e0e7ff;
  color: #312e81;
  border: 1px solid rgba(93, 95, 239, 0.25);
}

.offline-banner[hidden] {
  display: none !important;
}

.offline-banner--offline {
  background: #fef3c7;
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.35);
}

.offline-banner__icon {
  flex-shrink: 0;
  line-height: 1.2;
}

.offline-banner__text {
  flex: 1;
  min-width: 0;
}

/* Header: roxo da marca + faixa de acento verde (como destaque “fintech”) */
.app-top {
  background: linear-gradient(155deg, #787cf8 0%, var(--purple) 38%, #4b4ed6 72%, #3d42c4 100%);
  color: #fff;
  padding: 1rem 1rem 1.25rem;
  border-radius: 0 0 24px 24px;
  box-shadow: var(--shadow-header);
  border-bottom: 3px solid rgba(0, 200, 151, 0.45);
}

.app-top-inner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.has-balance-hero .user-row {
  margin-bottom: 0.6rem;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar.lg {
  width: 72px;
  height: 72px;
  background: #e8e9f5;
  color: var(--purple);
}

.user-text {
  flex: 1;
  min-width: 0;
}

.user-label {
  font-size: 0.7rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-name {
  display: block;
  font-size: 1.05rem;
}

.user-email {
  font-size: 0.8rem;
  opacity: 0.9;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-actions {
  display: flex;
  gap: 0.35rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
}

.logout-inline-form {
  display: inline;
  margin: 0;
  padding: 0;
}

button.icon-btn {
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.profile-switch-form {
  display: inline;
  margin: 0;
  padding: 0;
}

.profile-switch-form button.link-sm {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

.month-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
  display: block;
  margin-bottom: 0.35rem;
}

.month-wrap {
  position: relative;
}

.month-input {
  width: 100%;
  padding: 0.85rem 2.5rem 0.85rem 1rem;
  border: 0;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
  min-height: 3rem;
}

.month-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Painel: saldo em destaque (estilo banco) */
.balance-hero {
  text-align: center;
  padding: 0.15rem 0 0.85rem;
  margin: 0 -0.25rem 0.35rem;
}

.balance-hero__eyebrow {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.88;
  margin: 0 0 0.4rem;
  font-weight: 600;
}

.balance-hero__toggle {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  margin: 0 0 0.25rem;
}

.balance-hero__toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 4px;
  border-radius: 10px;
}

.balance-hero__amount {
  margin: 0 0 0.4rem;
  font-size: clamp(1.85rem, 8vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.14);
}

.balance-hero__amount.is-negative {
  color: #fecaca;
}

.balance-hero__hint {
  font-size: 0.72rem;
  opacity: 0.86;
  margin: 0 auto 1rem;
  line-height: 1.4;
  max-width: 22rem;
}

.rem-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  align-items: center;
}

.rem-quick-row .search-input {
  flex: 1;
  min-width: 140px;
}

.input-narrow-date {
  max-width: 11rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border, #e5e7eb);
  font: inherit;
}

.btn-rem-add {
  white-space: nowrap;
}

.balance-hero__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  text-align: left;
}

.balance-stat {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
}

.balance-stat__label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.88;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.balance-stat__val {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.balance-stat--income .balance-stat__val {
  color: #a7f3d0;
}

.balance-stat--prospeccao .balance-stat__val {
  color: #e0e7ff;
}

.balance-stat__val.is-negative {
  color: #fecaca !important;
}

.balance-stat__sub {
  display: block;
  font-size: 0.58rem;
  opacity: 0.82;
  margin-top: 0.35rem;
  line-height: 1.3;
}

.app-main {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 1rem 0 1.5rem;
  box-sizing: border-box;
}

.app-main--dashboard .summary-grid--secondary:first-of-type {
  margin-top: 0.85rem;
  margin-bottom: 1.9rem;
}

/* Summary */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.5rem, 2vw, 1rem);
  margin-top: -0.5rem;
  position: relative;
  z-index: 1;
}

.summary-grid--secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.7rem, 2.5vw, 1.15rem);
}

@media (max-width: 900px) {
  .summary-grid--secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .summary-grid--secondary {
    grid-template-columns: 1fr;
  }
}

.sum-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 0.95rem 0.65rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-card);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sum-card:hover {
  box-shadow: 0 2px 4px rgba(26, 29, 38, 0.05), 0 12px 32px rgba(26, 29, 38, 0.09);
}

.sum-hint {
  display: block;
  font-size: 0.58rem;
  color: var(--muted);
  line-height: 1.38;
  margin-top: 0.5rem;
  min-height: 1.65em;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.sum-card::before {
  content: "";
  display: block;
  height: 3px;
  border-radius: 3px;
  margin-bottom: 0.65rem;
}

.sum-saldo::before {
  background: var(--green);
}
.sum-fixo::before {
  background: var(--blue);
}
.sum-variavel::before {
  background: var(--orange);
}
.sum-investimento::before {
  background: #10b981;
}

.sum-prospeccao::before {
  background: #6366f1;
}

.sum-pendente::before {
  background: #f59e0b;
}

.sum-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 0.4rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.sum-val {
  font-weight: 700;
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  word-break: break-word;
  display: block;
  line-height: 1.25;
  margin: 0.1rem 0 0;
}

.sum-saldo .sum-val {
  color: var(--green);
}

.sum-saldo .sum-val.is-negative {
  color: #dc2626;
}

.sum-prospeccao .sum-val {
  color: #4f46e5;
}

.sum-prospeccao .sum-val.is-negative {
  color: #dc2626;
}

.sum-pendente .sum-val {
  color: #d97706;
}

.sum-fixo .sum-val {
  color: var(--blue);
}
.sum-variavel .sum-val {
  color: var(--orange);
}
.sum-investimento .sum-val {
  color: #059669;
}

.pay-strip {
  display: flex;
  margin-top: 0.75rem;
  padding: 0.9rem 0.7rem;
  justify-content: stretch;
  align-items: stretch;
  gap: 0;
  background: linear-gradient(180deg, #fff 0%, #fafbff 100%);
  border: 1px solid var(--border-card);
  border-radius: 999px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pay-cell {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.3rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #334155;
  overflow: hidden;
}

/* Separador por baixo do texto/ícones (::after é o último “filho” e pintava por cima) */
.pay-cell:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(93, 95, 239, 0.12), transparent);
  z-index: 0;
  pointer-events: none;
}

.pay-ic,
.pay-line {
  position: relative;
  z-index: 1;
}

.pay-line {
  display: inline;
  white-space: nowrap;
  line-height: 1.3;
}

.pay-name {
  font-weight: 500;
}

.pay-colon {
  margin-right: 0.15em;
}

.pay-amt {
  font-variant-numeric: tabular-nums;
}

.pay-ic {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  overflow: hidden;
}

.pay-ic svg {
  display: block;
  width: 22px;
  height: 22px;
  shape-rendering: geometricPrecision;
}

.pay-ic--pix {
  color: var(--blue);
}

.pay-ic--card {
  color: var(--purple);
}

.pay-ic--cash {
  color: var(--green);
}

@media (max-width: 420px) {
  .pay-strip {
    font-size: 0.8125rem;
    padding: 0.7rem 0.35rem;
  }

  .pay-cell {
    gap: 0.35rem;
    padding: 0.15rem 0.2rem;
  }

  .pay-ic,
  .pay-ic svg {
    width: 19px;
    height: 19px;
  }
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-card);
}

.filters-block {
  margin-top: 1rem;
}

.historico-section--rel .filters-block {
  margin-top: 0.65rem;
}

.search-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}

.search-ic {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.45;
}

.search-input {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 2.5rem;
  border: 1px solid rgba(26, 29, 38, 0.08);
  border-radius: 14px;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  outline: none;
  border-color: rgba(93, 95, 239, 0.45);
  box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.12);
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  border: 0;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: #e8e9f5;
  color: var(--muted);
}

.pill.is-active {
  background: var(--purple);
  color: #fff;
}

.pill-outline {
  background: #fff;
  border: 1px solid var(--blue);
  color: var(--blue);
}

.pill-outline.is-active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

.historico-section {
  margin-top: 1.25rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.historico-head {
  align-items: flex-start;
}

.historico-head__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.historico-head .badge-count {
  text-transform: none;
  letter-spacing: 0.01em;
}

.btn-csv {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-csv:hover {
  border-color: var(--purple);
  color: var(--purple);
  background: #f8f9ff;
}

.btn-csv:disabled {
  opacity: 0.65;
  cursor: wait;
}

.badge-count {
  font-size: 0.7rem;
  background: #eef0ff;
  color: var(--purple);
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
}

.historico-active-filters {
  margin: 0.4rem 0 0;
  padding: 0 0.1rem;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.4;
}

.historico-active-filters[hidden] {
  display: none;
}

.tx-painel-meta {
  margin: 0.5rem 0 0.75rem;
  padding: 0 0.05rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.tx-painel-meta[hidden] {
  display: none !important;
}

.tx-more-wrap {
  margin-top: 0.85rem;
  padding-bottom: 0.15rem;
}

.tx-more-wrap[hidden] {
  display: none !important;
}

.btn-tx-more {
  width: 100%;
  max-width: 100%;
}

.historico-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin: 0.45rem 0 0.85rem;
  padding: 0.65rem 0 0;
  border-top: 1px solid var(--border-card);
}

.historico-section--rel .sort-row {
  margin-bottom: 0;
}

.sort-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.sort-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--muted);
}

.sort-btn.is-active {
  border-color: var(--purple);
  color: var(--purple);
  background: #f5f6ff;
}

.tx-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Agrupamento por dia (extrato): cabeçalho + sublista de movimentos */
.tx-day-group {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tx-day-group__head {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 0.45rem 0.2rem 0.1rem;
}

.tx-day-group:first-child .tx-day-group__head {
  padding-top: 0.1rem;
}

.tx-day-group__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tx-meta--amt-only {
  justify-content: flex-start;
}

.tx-item {
  list-style: none;
  padding: 0;
  margin: 0;
  user-select: none;
  -webkit-user-select: none;
}

.tx-item__shell {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-card);
  touch-action: pan-y;
}

.tx-item__underlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  pointer-events: none;
}

.tx-item__underlay-fill {
  flex: 1;
  min-width: 0;
}

.tx-item__action {
  flex: 0 0 var(--tx-swipe-action-w, 88px);
  border: none;
  padding: 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  color: #fff;
}

.tx-item__action--delete {
  background: #dc2626;
  border-radius: var(--radius) 0 0 var(--radius);
}

.tx-item__action--edit {
  background: var(--purple);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.tx-item__action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tx-item__surface {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  padding: 0.75rem;
  background: var(--card);
  width: 100%;
  box-sizing: border-box;
  transform: translateX(0);
  will-change: transform;
  cursor: grab;
  touch-action: pan-y;
}

.tx-item__surface.is-dragging {
  cursor: grabbing;
  transition: none !important;
  touch-action: none;
}

.tx-item__surface:not(.is-dragging) {
  transition: transform 0.22s cubic-bezier(0.33, 1, 0.68, 1);
}

.tx-ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tx-ic.income {
  background: #e6faf4;
}
.tx-ic.expense {
  background: #fff4e6;
}

.tx-body {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.tx-title {
  font-weight: 600;
  margin: 0 0 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: #f3f4f6;
  color: var(--muted);
  text-transform: uppercase;
}

.tag-pago {
  background: #e6faf4;
  color: var(--green);
}

.tag-aberto {
  background: #fff7ed;
  color: #c2410c;
}

.tag-pix {
  background: #e8f2ff;
  color: var(--blue);
}

.tx-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  flex-shrink: 0;
  margin-left: 0.5rem;
  min-width: fit-content;
}

.tx-amt {
  font-weight: 700;
  font-size: 0.95rem;
}

.tx-amt.income {
  color: var(--green);
}

.tx-amt.expense-open {
  color: #d97706;
  font-weight: 700;
}

.tx-date {
  font-size: 0.75rem;
  color: var(--muted);
}

.fab {
  position: fixed;
  right: max(
    1rem,
    calc((100vw - min(var(--content-max), 100vw)) / 2 + 0.75rem),
    env(safe-area-inset-right)
  );
  bottom: calc(88px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(145deg, #6f72f5, var(--purple));
  color: #fff;
  font-size: 1.75rem;
  line-height: 52px;
  text-align: center;
  box-shadow:
    0 8px 28px rgba(93, 95, 239, 0.48),
    0 0 0 3px rgba(0, 200, 151, 0.22);
  z-index: 50;
}

.is-perfil .fab {
  display: none;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-card);
  box-shadow: 0 -4px 24px rgba(26, 29, 38, 0.06);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem var(--content-pad) calc(0.5rem + env(safe-area-inset-bottom));
  z-index: 40;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  box-sizing: border-box;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.62rem;
  line-height: 1.15;
  text-align: center;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}

.bottom-nav-item.is-active {
  color: var(--purple);
  font-weight: 600;
}

.bn-ic {
  font-size: 1.25rem;
}

/* Investimentos */
.inv-intro-card {
  padding: 1rem;
  margin-top: -0.5rem;
}

.inv-page-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.inv-intro-hint {
  margin: 0 0 1rem;
  font-size: 0.84rem;
  color: #64748b;
  line-height: 1.45;
}

.inv-total-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0f4ff 0%, #eef2ff 100%);
  border: 1px solid #e0e7ff;
}

.inv-total-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.inv-total-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.inv-total-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--purple);
  cursor: pointer;
}

.privacy-toggle-btn {
  border: 1px solid #d7dbe7;
  background: #f8f9fc;
  color: #475569;
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.privacy-toggle-btn[aria-pressed="false"] {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.privacy-toggle-btn--light {
  background: rgba(255, 255, 255, 0.7);
  border-color: #d6ddf7;
}

.perfil-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.acc-balance-val {
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.inv-list-card {
  padding: 1rem;
  margin-top: 0.75rem;
}

.inv-list-heading {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.inv-empty {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.inv-modal-hint {
  margin: -0.25rem 0 0.85rem;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
}

.inv-detail-wrap[hidden] {
  display: none !important;
}

.inv-debit-check {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.1rem;
  font-size: 0.84rem;
  color: #334155;
}

.inv-debit-check input[type="checkbox"] {
  margin: 0;
}

.tag-reconciled {
  background: #e0f2fe;
  color: #0369a1;
}

.inv-subtotal {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.inv-kpi-card {
  padding: 1rem;
  margin-top: 0.75rem;
}

.inv-kpi-line {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
}

.inv-kpi-bar-wrap {
  height: 8px;
  background: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

.inv-kpi-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #5d5fef, #818cf8);
  border-radius: 6px;
  transition: width 0.25s ease;
}

.inv-kpi-hint {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
}

.inv-redemptions-card {
  padding: 1rem;
  margin-top: 0.75rem;
}

.inv-list-toolbar .inv-redeem-btn {
  white-space: nowrap;
}

.dash-plan-card {
  padding: 1rem;
  margin-top: 0.75rem;
}

.dash-plan-h {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.dash-plan-body {
  font-size: 0.88rem;
  color: #334155;
}

.dash-plan-line {
  margin: 0 0 0.45rem;
}

.dash-plan-line--warn {
  color: #9a3412;
}

.dash-plan-footnote {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

.planejamento-li-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  justify-content: flex-end;
}

.planejamento-li {
  list-style: none;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}

.planejamento-li-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.planejamento-recon {
  list-style: none;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.planejamento-recon-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.45rem;
  font-size: 0.86rem;
}

.recon-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.planejamento-month-label {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.inv-alloc-card {
  padding: 1rem;
  margin-top: 0.75rem;
}

.inv-alloc-title {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.inv-alloc-subtitle {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.inv-alloc-hint {
  margin: 0 0 0.85rem;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
}

.inv-alloc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.inv-product-item {
  list-style: none;
  margin: 0;
}

.inv-product-card {
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f4ff 0%, #eef2ff 55%, #f8f9fc 100%);
  border: 1px solid rgba(93, 95, 239, 0.14);
  box-shadow: 0 1px 0 rgba(93, 95, 239, 0.06);
}

.inv-product-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.inv-product-toggle:hover {
  background: rgba(255, 255, 255, 0.35);
}

.inv-product-toggle:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.inv-product-donut {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inv-donut-svg {
  display: block;
}

.inv-donut-track {
  stroke: rgba(93, 95, 239, 0.12);
}

.inv-donut-arc {
  transition: stroke-dasharray 0.35s ease;
}

.inv-product-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.inv-product-name {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--purple-dark);
  line-height: 1.25;
}

.inv-product-pctline {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
}

.inv-product-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  text-align: right;
}

.inv-product-badge {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.95);
  color: #475569;
  border: 1px solid rgba(93, 95, 239, 0.12);
}

.inv-product-val {
  font-size: 1.02rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--purple);
}

.inv-product-chevron {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.1rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.inv-product-toggle[aria-expanded="true"] .inv-product-chevron {
  transform: rotate(225deg);
  margin-top: 0.25rem;
}

.inv-product-panel {
  padding: 0 0.85rem 0.75rem;
  border-top: 1px solid rgba(93, 95, 239, 0.08);
  background: rgba(255, 255, 255, 0.45);
}

.inv-product-panel-empty {
  margin: 0;
  padding: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.inv-product-sublist {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.inv-product-subitem {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.4rem 0;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.inv-product-subitem:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.inv-product-subname {
  min-width: 0;
  color: var(--text);
  font-weight: 500;
}

.inv-product-subamt {
  flex-shrink: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.inv-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.inv-list-toolbar .inv-list-heading {
  margin: 0;
}

.inv-filter-label {
  margin: 0;
  min-width: min(100%, 220px);
}

.inv-filter-select {
  width: 100%;
  max-width: 260px;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--border-card);
  background: #f8f9fc;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

/* Relatórios */
.report-card {
  padding: 1rem;
  margin-top: -0.5rem;
}

.report-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.report-lead {
  margin: 0 0 1.1rem;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.report-block {
  margin-bottom: 1.25rem;
}

.report-collapsible .due-panel__head {
  margin-bottom: 0.55rem;
}

.report-collapsible.is-collapsed .due-panel__head {
  margin-bottom: 0;
}

.report-collapsible__body[hidden] {
  display: none;
}

.report-collapsible.is-collapsed .due-panel__chev {
  transform: rotate(-90deg);
}

.report-h3 {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-total {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.estrutura-bar {
  display: flex;
  height: 10px;
  border-radius: 8px;
  overflow: hidden;
  background: #eee;
  margin-bottom: 0.5rem;
}

.estr-fix {
  background: var(--purple);
  display: block;
  height: 100%;
}

.estr-var {
  background: var(--orange);
  display: block;
  height: 100%;
}

.estrutura-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.25rem;
}

.dot-fix {
  background: var(--purple);
}
.dot-var {
  background: var(--orange);
}

.cat-report-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cat-report-list li {
  margin-bottom: 0.65rem;
}

.cat-report-list .bar {
  height: 4px;
  background: #eee;
  border-radius: 4px;
  margin-top: 0.25rem;
  overflow: hidden;
}

.cat-report-list .bar > span {
  display: block;
  height: 100%;
  background: var(--purple);
  border-radius: 4px;
}

/* Comparativo mensal — tabela + KPI */
.report-compare-sub {
  margin: 0 0 0.85rem;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .report-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.report-kpi {
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border-card);
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  position: relative;
  overflow: hidden;
}

.report-kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.report-kpi--income::before {
  background: var(--green);
}

.report-kpi--expense::before {
  background: #f87171;
}

.report-kpi--balance::before {
  background: var(--blue);
}

.report-kpi__ic {
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1;
}

.report-kpi--income .report-kpi__ic {
  color: var(--green);
}

.report-kpi--expense .report-kpi__ic {
  color: #ef4444;
}

.report-kpi--balance .report-kpi__ic {
  color: var(--blue);
}

.report-kpi__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--muted);
}

.report-kpi__val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.report-kpi__val.is-negative {
  color: #dc2626;
}

.report-kpi__val.is-positive {
  color: var(--green);
}

.compare-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid var(--border-card);
  background: var(--card);
  box-shadow: var(--shadow);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.compare-table th,
.compare-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #f1f2f6;
}

.compare-table thead th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--muted);
  background: #f8f9fc;
}

.compare-table tbody tr:last-child td {
  border-bottom: none;
}

.compare-tr--alt td {
  background: #fbfcfe;
}

.compare-th-ic {
  margin-right: 0.25rem;
  opacity: 0.85;
}

.compare-th--inc {
  color: #15803d;
  background: rgba(0, 200, 151, 0.1) !important;
}

.compare-th--exp {
  color: #b91c1c;
  background: rgba(248, 113, 113, 0.12) !important;
}

.compare-th--bal {
  color: #475569;
  background: rgba(59, 130, 246, 0.08) !important;
}

.compare-td--inc,
.compare-td--exp {
  min-width: 118px;
}

.compare-td {
  white-space: nowrap;
}

.compare-td--saldo {
  font-variant-numeric: tabular-nums;
}

.compare-amt {
  display: block;
  font-weight: 600;
  font-size: 0.84rem;
  margin-bottom: 0.28rem;
}

.compare-amt--inc {
  color: #15803d;
}

.compare-amt--exp {
  color: #b91c1c;
}

.compare-micro {
  display: block;
  height: 5px;
  border-radius: 4px;
  background: #eef0f4;
  overflow: hidden;
}

.compare-micro i {
  display: block;
  height: 100%;
  border-radius: 4px;
  max-width: 100%;
}

.compare-micro--inc i {
  background: linear-gradient(90deg, #34d399, var(--green));
}

.compare-micro--exp i {
  background: linear-gradient(90deg, #fca5a5, #ef4444);
}

.compare-saldo.is-neg {
  color: #dc2626;
}

.compare-saldo.is-pos {
  color: #15803d;
}

.compare-saldo.is-zero {
  color: var(--muted);
  font-weight: 600;
}

/* Previsão de caixa */
.forecast-callout {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border: 1px solid rgba(93, 95, 239, 0.18);
  margin-bottom: 1rem;
}

.forecast-callout__ic {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-top: 0.05rem;
}

.forecast-callout__text {
  margin: 0;
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.5;
}

.forecast-table-caption {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.forecast-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid var(--border-card);
  background: var(--card);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.forecast-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.forecast-table th,
.forecast-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid #f1f2f6;
}

.forecast-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--muted);
  background: #f8f9fc;
}

.forecast-table tbody tr:last-child td {
  border-bottom: none;
}

.forecast-tr--alt td {
  background: #fbfcfe;
}

.forecast-td-bal {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.forecast-td-bal .is-neg {
  color: #dc2626;
}

.forecast-base-card {
  border-radius: 14px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-card);
  background: linear-gradient(180deg, #fafbfe 0%, #fff 100%);
  box-shadow: var(--shadow);
}

.forecast-base-card__title {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--muted);
}

.forecast-base-dl {
  margin: 0;
}

.forecast-base-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f1f2f6;
  font-size: 0.88rem;
}

.forecast-base-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.forecast-base-row dt {
  margin: 0;
  color: #64748b;
  font-weight: 500;
}

.forecast-base-row dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.forecast-base-row--span dd {
  font-weight: 500;
  font-size: 0.84rem;
  max-width: 65%;
}

.toggle-fake {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.toggle-fake .is-on {
  font-weight: 700;
  color: var(--purple);
}

.pay-report-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pay-report-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.pay-report-list .pr-ic {
  font-size: 1.25rem;
}

.pay-report-list strong {
  margin-left: auto;
}

/* Perfil layout */
.perfil-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #fff;
  border-bottom: 1px solid #e8e9ef;
  position: sticky;
  top: 0;
  z-index: 10;
}

.perfil-back {
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1;
}

.perfil-title {
  margin: 0;
  font-size: 1.15rem;
}

.perfil-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.75rem 0 0;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.perfil-tab {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0.25rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  background: #e8e9ef;
}

.perfil-tab.is-active {
  background: #fff;
  color: var(--purple);
  border: 1px solid var(--purple);
}

.app-main--perfil {
  padding-top: 0.5rem;
}

.perfil-panel {
  padding: 0 0 2rem;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.panel-h {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.panel-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.perfil-card,
.remind-card,
.family-card {
  padding: 1rem;
  margin-bottom: 1rem;
}

.remind-card {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.family-card {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.photo-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.account-line {
  font-size: 0.9rem;
  margin: 0;
}

.hint-mini {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.btn {
  border: 0;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-primary {
  background: linear-gradient(180deg, #6f72f5 0%, var(--purple) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(93, 95, 239, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.04);
}

.btn-primary:active {
  filter: brightness(0.96);
}

.btn-secondary {
  background: #e8e9f5;
  color: var(--purple);
}

.btn-block {
  width: 100%;
}

.btn-warn {
  background: var(--orange);
  color: #fff;
}

.btn-outline-warn {
  background: #fff;
  border: 1px solid var(--orange);
  color: var(--orange);
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.input-full {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-top: 0.35rem;
  font-size: 0.95rem;
}

.profile-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.profile-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.pi-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.pi-name {
  font-weight: 600;
  flex: 1;
}

.tag-device {
  background: #ede9fe;
  color: var(--purple);
}

.pi-actions {
  width: 100%;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-left: 44px;
}

.link-sm {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--purple);
  cursor: pointer;
  text-decoration: underline;
}

.link-danger {
  color: #dc2626;
}

.row-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.row-form .input-full {
  flex: 1;
  min-width: 160px;
}

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.sub-kicker {
  font-size: 0.85rem;
  margin: 1rem 0 0.5rem;
  text-transform: uppercase;
  color: var(--text);
}

.perfil-swipe-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0.5rem;
}

.perfil-swipe-list > .tx-item {
  margin-bottom: 0.45rem;
}

.perfil-swipe-list > .tx-item:last-child {
  margin-bottom: 0;
}

.perfil-cat-ic {
  background: #f3f4f6 !important;
  font-size: 1.35rem;
}

.perfil-cat-meta {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

.card-swipe-body {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: #ede9fe;
  cursor: pointer;
  color: var(--purple);
}

.empty-dashed {
  border: 2px dashed #c4b5fd;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.empty-dashed[hidden] {
  display: none;
}

.new-cat-card {
  padding: 1rem;
  margin-top: 1rem;
}

.new-cat-title {
  margin: 0 0 0.75rem;
  color: var(--purple);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lbl-mini {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.75rem 0 0.35rem;
}

.icon-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, 44px);
  gap: 0.5rem;
  justify-content: start;
  margin-bottom: 1rem;
}

.icon-opt {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 1.25rem;
}

.icon-opt.is-selected {
  border-color: var(--purple);
  background: #f5f6ff;
}

.color-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  padding: 0;
}

.color-swatch.is-selected {
  border-color: #1a1d26;
}

.new-card-box {
  padding: 1rem;
  background: #eff6ff;
  margin-bottom: 1rem;
}

.cards-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cards-list > .tx-item.cards-list__item {
  margin-bottom: 0.75rem;
}

.cards-list > .tx-item.cards-list__item:last-child {
  margin-bottom: 0;
}

.cards-list .tx-item__shell {
  box-shadow: var(--shadow);
}

.cards-list .tx-item__surface {
  align-items: flex-start;
}

/* [hidden] deve ganhar a `display:none` nativa; regra com flex não pode aplicar-se ao mesmo tempo */
.card-view-block:not([hidden]) {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-view-block[hidden] {
  display: none !important;
}

.card-view-head {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.card-view-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.35rem;
  min-width: 0;
  flex: 1;
}

.card-view-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.card-view-last4 {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.card-view-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.card-view-dates strong {
  color: var(--text);
  font-weight: 600;
}

.card-edit-block:not([hidden]) {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-edit-block[hidden] {
  display: none !important;
}

.card-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.cards-list__item--editing .tx-item__surface {
  cursor: default;
}

.card-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.modal-sheet {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
}

.modal-sheet h3 {
  margin: 0 0 1rem;
}

/* Diálogos compactos (substituem alert/confirm/prompt nativos) */
.app-dialog-host {
  z-index: 150;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-sheet--dialog {
  border-radius: 20px;
  padding: 1.35rem 1.15rem;
  max-width: min(400px, 100%);
  max-height: min(80vh, 520px);
  box-shadow: var(--shadow);
}

.app-dialog__message {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.app-dialog__label {
  display: block;
  margin-bottom: 1rem;
}

.app-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.app-dialog__actions--split {
  justify-content: stretch;
}

.app-dialog__actions--split .btn {
  flex: 1 1 calc(50% - 0.25rem);
  min-width: 5.5rem;
}

.modal-sheet--invoice {
  display: flex;
  flex-direction: column;
  max-height: min(85vh, 640px);
}

.invoice-modal-loading {
  margin: 0;
  padding: 1rem 0;
  text-align: center;
  color: var(--muted);
}

.invoice-modal-period {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.invoice-modal-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  background: #fafbfc;
}

.invoice-modal-day {
  list-style: none;
  margin: 0;
  padding: 0.45rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  background: #eef0f4;
  border-bottom: 1px solid #e2e5eb;
  position: sticky;
  top: 0;
  z-index: 1;
}

.invoice-modal-day + .invoice-modal-line {
  border-top: 0;
}

.invoice-modal-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #eef0f4;
  font-size: 0.88rem;
}

.invoice-modal-line:last-child {
  border-bottom: 0;
}

.invoice-modal-line__main {
  flex: 1;
  min-width: 0;
}

.invoice-modal-line__title {
  display: block;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.invoice-modal-line__meta {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.invoice-modal-line__side {
  flex-shrink: 0;
  text-align: right;
}

.invoice-modal-line__amt {
  display: block;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.invoice-modal-line__badge {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.invoice-modal-line__badge.is-paid {
  background: rgba(0, 200, 151, 0.18);
  color: #047857;
}

.invoice-modal-line__badge.is-open {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
}

.invoice-modal-empty {
  padding: 1.25rem 0.75rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  border: none;
}

.invoice-modal-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.85rem;
  background: #f3f4f8;
  border-radius: 12px;
  font-size: 0.82rem;
}

.invoice-modal-totals span {
  display: block;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.invoice-modal-totals strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.invoice-modal-totals--open {
  color: #b45309;
}

.invoice-modal-totals--open.is-clear {
  color: #047857;
}

.invoice-modal-paid-note {
  margin: -0.35rem 0 0.85rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
  color: #047857;
  background: rgba(0, 200, 151, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(0, 200, 151, 0.25);
}

.btn-invoice-paid {
  border: 1px solid rgba(0, 200, 151, 0.45) !important;
  background: rgba(0, 200, 151, 0.12) !important;
  color: #047857 !important;
  cursor: default !important;
  opacity: 1 !important;
}

.btn-invoice-paid:disabled {
  opacity: 1 !important;
}

.invoice-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.invoice-modal-actions .btn {
  flex: 1;
  min-width: 6rem;
}

.form-grid label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.form-grid select,
.form-grid input[type="text"],
.form-grid input[type="number"],
.form-grid input[type="date"] {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 1rem;
}

.type-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.type-toggle button {
  flex: 1;
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.type-toggle button.is-on {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Auth */
.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(160deg, #6b6ff5, #5d5fef);
}

.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: min(420px, 100%);
  box-shadow: var(--shadow);
}

.auth-title {
  margin: 0 0 1.25rem;
  text-align: center;
  color: var(--purple);
}

.auth-error {
  color: #b91c1c;
  font-size: 0.9rem;
}

.auth-form label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.auth-form input {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.captcha-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
}

.captcha-img {
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.captcha-svg-wrap {
  display: inline-flex;
  align-items: center;
  min-width: 150px;
  min-height: 50px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  overflow: hidden;
}

.captcha-svg-wrap svg {
  display: block;
  width: 150px;
  height: 50px;
}

.auth-footer {
  text-align: center;
  margin-top: 1rem;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.extension-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #eef0ff;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.extension-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-series-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.65rem;
  background: #f5f6ff;
  border-radius: 10px;
}

.hint-mini {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.25rem 0 0.75rem;
  line-height: 1.35;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  font-weight: 500;
  cursor: pointer;
}

.series-opts {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e8e9ef;
}

.tag-serie {
  background: #f3e8ff !important;
  color: #7c3aed !important;
  text-transform: none !important;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.due-panel {
  padding: 1.35rem 1.2rem 1.5rem;
  margin-bottom: 1.1rem;
}

.due-panel__head {
  margin-bottom: 1.1rem;
  align-items: flex-start;
  gap: 0.5rem;
}

.due-panel.is-collapsed .due-panel__head {
  margin-bottom: 0.7rem;
}

.due-panel__title {
  margin: 0;
  font-size: 1.05rem;
}

.due-panel__head .due-panel__title {
  flex: 1;
  min-width: 0;
}

.due-panel__toggle {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #f1f2f6;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.due-panel__toggle:hover {
  background: #e8e9ef;
  color: #334155;
}

.due-panel__chev {
  display: block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.2s ease;
  transform-origin: 50% 35%;
}

.due-panel.is-collapsed .due-panel__chev {
  transform: rotate(-90deg);
}

.due-panel__body[hidden] {
  display: none;
}

.due-panel__summary {
  margin: 0 0 1.05rem;
  padding-top: 0.05rem;
  font-size: 0.84rem;
  color: #64748b;
  line-height: 1.5;
}

.due-panel__summary[hidden] {
  display: none;
}

.due-panel.is-collapsed .due-panel__summary {
  margin-bottom: 0;
}

.due-panel__block + .due-panel__block {
  margin-top: 1.3rem;
  padding-top: 1.15rem;
  border-top: 1px solid #eceef2;
}

.due-subtitle {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.65rem;
  font-weight: 600;
}

.due-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.due-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.due-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.due-item:last-child {
  border-bottom: 0;
}

.due-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.due-item__info {
  flex: 1;
  min-width: 0;
}

.due-item__title {
  display: block;
  font-size: 0.95rem;
  line-height: 1.28;
  margin: 0 0 0.2rem;
}

.due-item__cat {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.3;
}

.due-item__side {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.due-item__amt {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.due-item__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.due-item__when {
  font-size: 0.76rem;
  color: var(--muted);
}

.due-badge {
  display: inline-block;
  margin: 0;
  font-size: 0.62rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: #eef0ff;
  color: var(--purple);
}

.due-badge--warn {
  background: #fff7ed;
  color: #c2410c;
}

.due-badge--danger {
  background: #fef2f2;
  color: #b91c1c;
}

.due-paid-btn {
  border: 1px solid var(--purple);
  background: #fff;
  color: var(--purple);
  padding: 0.28rem 0.52rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

.due-paid-btn.is-paid {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.due-paid-btn:disabled {
  cursor: wait;
  opacity: 0.85;
}

.due-paid-btn.is-busy {
  min-width: 4.25rem;
}

/* Cartões no painel de vencimentos — cartão estilo “dashboard” */
.due-list--cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.due-list--cards .due-item--card.due-card-panel {
  display: block;
  padding: 0;
  border-bottom: none;
}

.due-card-panel__surface {
  background: #f0f2f5;
  border-radius: 18px;
  padding: 1rem 1rem 0.95rem;
  box-shadow: 0 1px 3px rgba(26, 29, 38, 0.06);
  border: 1px solid rgba(26, 29, 38, 0.06);
}

.due-card-panel__head {
  margin-bottom: 0.85rem;
}

.due-card-panel__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.due-card-panel__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.due-card-panel__name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.due-card-dates-scroll {
  margin-bottom: 0.85rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.due-card-dates-scroll::-webkit-scrollbar {
  height: 3px;
}

.due-card-dates-scroll::-webkit-scrollbar-thumb {
  background: rgba(26, 29, 38, 0.15);
  border-radius: 3px;
}

.due-card-dates-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  min-width: 270px;
}

.due-card-date-cell {
  background: #fff;
  border-radius: 12px;
  padding: 0.65rem 0.35rem 0.7rem;
  text-align: center;
  border: 1px solid rgba(26, 29, 38, 0.06);
  box-shadow: 0 1px 2px rgba(26, 29, 38, 0.04);
  min-width: 0;
}

.due-card-date-cell__ic {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.35rem;
  color: #94a3b8;
}

.due-card-date-cell__ic--cart {
  color: #94a3b8;
}

.due-card-date-cell__lbl {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.due-card-date-cell__val {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.due-card-cycle {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  background: #fff;
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(26, 29, 38, 0.06);
  box-shadow: 0 1px 2px rgba(26, 29, 38, 0.04);
}

.due-card-cycle__left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  padding-right: 0.25rem;
}

.due-card-cycle__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.due-card-cycle__range {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.due-card-cycle__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.due-card-cycle__pill {
  background: #d1f2eb;
  border: 1px solid rgba(6, 95, 70, 0.12);
  border-radius: 12px;
  padding: 0.35rem 0.6rem;
}

.due-card-cycle__amount {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #065f46;
  line-height: 1.1;
}

.due-card-cycle__sub {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  text-align: right;
}

.due-card-panel__foot {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding-top: 0.15rem;
}

.due-card-panel__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.due-card-panel__status-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.due-card-status-badge {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.due-card-status-badge--paid {
  background: #d1f2eb;
  color: #065f46;
  border: 1px solid rgba(6, 95, 70, 0.15);
}

.due-card-status-badge--open {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid rgba(251, 146, 60, 0.45);
}

.due-card-status-badge--empty {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.btn-view-invoice {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(93, 95, 239, 0.45);
  background: #fff;
  color: var(--purple);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-view-invoice:hover {
  background: #fff;
  border-color: var(--purple);
  box-shadow: 0 2px 8px rgba(93, 95, 239, 0.15);
}

/* Mobile: mesmo layout que desktop (imagem referência); só compacta tipografia */
@media (max-width: 520px) {
  .due-card-panel__surface {
    padding: 0.9rem 0.75rem 0.85rem;
  }

  .due-card-dates-grid {
    gap: 0.35rem;
  }

  .due-card-date-cell {
    padding: 0.5rem 0.22rem 0.55rem;
  }

  .due-card-date-cell__ic svg {
    width: 16px;
    height: 16px;
  }

  .due-card-date-cell__lbl {
    font-size: 0.5rem;
    letter-spacing: 0.04em;
  }

  .due-card-date-cell__val {
    font-size: 0.76rem;
  }

  .due-card-cycle {
    padding: 0.72rem 0.65rem;
    gap: 0.5rem;
  }

  .due-card-cycle__title {
    font-size: 0.84rem;
  }

  .due-card-cycle__range {
    font-size: 0.68rem;
  }

  .due-card-cycle__amount {
    font-size: 0.92rem;
  }

  .due-card-cycle__pill {
    padding: 0.28rem 0.45rem;
  }

  .due-card-cycle__sub {
    font-size: 0.52rem;
  }

  .due-card-panel__status-lbl {
    font-size: 0.65rem;
  }

  .due-card-status-badge {
    font-size: 0.52rem;
    padding: 0.26rem 0.45rem;
  }

  .btn-view-invoice {
    padding: 0.4rem 0.65rem;
    font-size: 0.65rem;
  }
}

.card-edit-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.card-edit-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ——— Responsivo: mobile-first + tablet/desktop ——— */

html {
  overflow-x: clip;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 1.5rem;
  }

  .modal-sheet {
    border-radius: 20px;
    max-height: min(90vh, 720px);
  }
}

@media (min-width: 900px) {
  .app-top {
    padding: 1.25rem 1.25rem 1.5rem;
    border-radius: 0 0 28px 28px;
  }

  .bottom-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(var(--content-max), calc(100vw - 2 * max(0.75rem, var(--content-pad))));
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(26, 29, 38, 0.08);
    border: 1px solid var(--border-card);
    border-bottom: 0;
  }

  .pay-strip {
    padding: 0.95rem 0.75rem;
  }

  .report-card {
    padding: 1.25rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .app-main--relatorios {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
    gap: 1.5rem 2rem;
    align-items: start;
  }

  .app-main--relatorios .report-card {
    margin-top: -0.5rem;
  }

  .app-main--relatorios .historico-section {
    margin-top: 0;
  }

  .dashboard-lower {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem 2rem;
    align-items: start;
  }

  .dashboard-lower .historico-section {
    margin-top: 0;
  }
}

@media (min-width: 1024px) and (min-height: 700px) {
  .app-main--relatorios .historico-section,
  .dashboard-lower .historico-section {
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    padding-right: 0.25rem;
  }
}

@media (min-width: 1280px) {
  :root {
    --content-max: 1280px;
  }

  .user-name {
    font-size: 1.15rem;
  }
}

@media (max-width: 380px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .sum-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 0.75rem 0.95rem;
  }

  .sum-card::before {
    display: none;
  }

  .sum-card .sum-label {
    display: block;
    margin-bottom: 0;
  }

  .sum-card .sum-label::before {
    content: "";
    display: block;
    height: 3px;
    border-radius: 3px;
    margin-bottom: 0.35rem;
    width: 2.5rem;
  }

  .sum-fixo .sum-label::before {
    background: var(--blue);
  }
  .sum-variavel .sum-label::before {
    background: var(--orange);
  }

  .sum-pendente .sum-label::before {
    background: #f59e0b;
  }

  .sum-investimento .sum-label::before {
    background: #10b981;
  }
}

/* ========== Modo escuro (Perfil → Aparência; chave localStorage financas_theme) ========== */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111318;
  --card: #1a1d26;
  --text: #e8eaef;
  --muted: #8b94a8;
  --border-card: rgba(255, 255, 255, 0.085);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 10px 28px rgba(0, 0, 0, 0.5);
  --shadow-header: 0 16px 48px -12px rgba(0, 0, 0, 0.55);
  --purple: #9497ff;
  --purple-dark: #6e72e0;
  --green: #34d399;
  --blue: #60a5fa;
  --orange: #fbbf24;
}

html[data-theme="dark"] a {
  color: #a5b4fc;
}

html[data-theme="dark"] .offline-banner {
  background: rgba(99, 102, 241, 0.25);
  color: #e0e7ff;
  border-color: rgba(165, 180, 252, 0.35);
}

html[data-theme="dark"] .offline-banner--offline {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.35);
}

html[data-theme="dark"] .app-top {
  background: linear-gradient(155deg, #5c5f9a 0%, #454878 38%, #353a68 72%, #2d3158 100%);
  border-bottom-color: rgba(52, 211, 153, 0.35);
  box-shadow: var(--shadow-header);
}

html[data-theme="dark"] .month-input {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

html[data-theme="dark"] .user-avatar.lg {
  background: rgba(255, 255, 255, 0.12);
  color: #c7d2fe;
}

html[data-theme="dark"] .sum-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 14px 36px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .pay-strip {
  background: linear-gradient(180deg, #1f232d 0%, #1a1d26 100%);
}

html[data-theme="dark"] .pay-cell {
  color: #cbd5e1;
}

html[data-theme="dark"] .search-input {
  background: var(--card);
  border-color: var(--border-card);
  color: var(--text);
}

html[data-theme="dark"] .pill {
  background: #2a3040;
  color: #94a3b8;
}

html[data-theme="dark"] .pill-outline {
  background: transparent;
  border-color: var(--blue);
  color: var(--blue);
}

html[data-theme="dark"] .estrutura-bar,
html[data-theme="dark"] .cat-report-list .bar {
  background: #2a3040;
}

html[data-theme="dark"] .inv-filter-select {
  background: #151822;
  border-color: var(--border-card);
  color: var(--text);
}

html[data-theme="dark"] .inv-total-pill {
  background: linear-gradient(135deg, #252a3d 0%, #1e2333 100%);
  border-color: rgba(129, 140, 248, 0.35);
}

html[data-theme="dark"] .inv-intro-hint {
  color: var(--muted);
}

/* Cartões «Produtos na carteira»: fundo claro sobre app escuro — texto do painel não pode usar --text (claro) */
html[data-theme="dark"] .inv-product-panel {
  background: #f1f5f9;
  border-top-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="dark"] .inv-product-panel .inv-product-subname,
html[data-theme="dark"] .inv-product-panel .inv-product-subamt {
  color: #0f172a;
}

html[data-theme="dark"] .inv-product-panel .inv-product-subamt {
  color: #1e293b;
}

html[data-theme="dark"] .inv-product-panel-empty {
  color: #475569;
}

html[data-theme="dark"] .inv-product-subitem {
  border-bottom-color: rgba(15, 23, 42, 0.12);
}

/* Cartão claro: percentagem e chevron com cinza legível, não --muted do tema escuro */
html[data-theme="dark"] .inv-product-card .inv-product-pctline {
  color: #64748b;
}

html[data-theme="dark"] .inv-product-card .inv-product-chevron {
  border-color: #64748b;
  opacity: 0.95;
}

html[data-theme="dark"] .privacy-toggle-btn {
  background: #252a38;
  color: #cbd5e1;
  border-color: var(--border-card);
}

html[data-theme="dark"] .privacy-toggle-btn[aria-pressed="false"] {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(129, 140, 248, 0.45);
  color: #c7d2fe;
}

html[data-theme="dark"] .dash-plan-body {
  color: #cbd5e1;
}

html[data-theme="dark"] .dash-plan-line--warn {
  color: #fdba74;
}

html[data-theme="dark"] .dash-plan-footnote {
  color: var(--muted);
}

html[data-theme="dark"] .planejamento-li,
html[data-theme="dark"] .planejamento-recon {
  border-bottom-color: var(--border-card);
}

html[data-theme="dark"] .perfil-top {
  background: var(--card);
  border-bottom-color: var(--border-card);
}

html[data-theme="dark"] .perfil-tab {
  background: #252a38;
  color: var(--muted);
}

html[data-theme="dark"] .perfil-tab.is-active {
  background: #2e3548;
  color: #c7d2fe;
  border-color: #818cf8;
}

html[data-theme="dark"] .remind-card {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
}

html[data-theme="dark"] .family-card {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(96, 165, 250, 0.35);
}

html[data-theme="dark"] .btn-secondary {
  background: #2a3040;
  color: #c7d2fe;
}

html[data-theme="dark"] .btn-outline-warn {
  background: transparent;
  border-color: var(--orange);
  color: var(--orange);
}

html[data-theme="dark"] .input-full {
  background: #151822;
  border-color: var(--border-card);
  color: var(--text);
}

html[data-theme="dark"] select.input-full {
  background: #151822;
}

html[data-theme="dark"] .bottom-nav {
  background: rgba(22, 24, 32, 0.94);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .modal-sheet {
  background: var(--card);
  color: var(--text);
}

html[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.62);
}

html[data-theme="dark"] .invoice-modal-list {
  background: #141820;
  border-color: var(--border-card);
}

html[data-theme="dark"] .invoice-modal-day {
  background: #1a1f2a;
  border-bottom-color: var(--border-card);
  color: var(--muted);
}

html[data-theme="dark"] .invoice-modal-line {
  border-bottom-color: var(--border-card);
}

html[data-theme="dark"] .invoice-modal-totals {
  background: #141820;
}

html[data-theme="dark"] .invoice-modal-line__badge.is-paid {
  background: rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
}

html[data-theme="dark"] .invoice-modal-line__badge.is-open {
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
}

html[data-theme="dark"] .invoice-modal-totals--open {
  color: #fcd34d;
}

html[data-theme="dark"] .invoice-modal-totals--open.is-clear {
  color: #6ee7b7;
}

html[data-theme="dark"] .invoice-modal-paid-note {
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
}

html[data-theme="dark"] .btn-invoice-paid {
  color: #6ee7b7 !important;
}

html[data-theme="dark"] .tx-ic.income {
  background: rgba(52, 211, 153, 0.15);
}

html[data-theme="dark"] .tx-ic.expense {
  background: rgba(251, 191, 36, 0.12);
}

html[data-theme="dark"] .tag {
  background: #252a38;
}

html[data-theme="dark"] .tag-pago {
  background: rgba(52, 211, 153, 0.15);
}

html[data-theme="dark"] .tag-aberto {
  background: rgba(251, 146, 60, 0.15);
  color: #fdba74;
}

html[data-theme="dark"] .tag-pix {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

html[data-theme="dark"] .perfil-cat-ic {
  background: #252a38 !important;
}

html[data-theme="dark"] .btn-icon {
  background: rgba(99, 102, 241, 0.22);
}

html[data-theme="dark"] .tag-device {
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}

html[data-theme="dark"] .profile-item {
  border-bottom-color: var(--border-card);
}

html[data-theme="dark"] .pay-report-list li {
  border-bottom-color: var(--border-card);
}

html[data-theme="dark"] .forecast-base-row dt {
  color: var(--muted);
}

html[data-theme="dark"] .due-panel__toggle {
  background: #252a38;
  color: #94a3b8;
}

html[data-theme="dark"] .due-panel__toggle:hover {
  background: #2e3548;
  color: #e2e8f0;
}

html[data-theme="dark"] .due-panel__summary {
  color: var(--muted);
}

html[data-theme="dark"] .due-panel__block + .due-panel__block {
  border-top-color: var(--border-card);
}

html[data-theme="dark"] .auth-page {
  background: linear-gradient(160deg, #35396b, #23263d);
}

html[data-theme="dark"] .auth-card {
  background: var(--card);
  border: 1px solid var(--border-card);
}

html[data-theme="dark"] .auth-form input {
  background: #151822;
  border-color: var(--border-card);
  color: var(--text);
}

html[data-theme="dark"] .empty-dashed {
  border-color: rgba(129, 140, 248, 0.45);
}
