/* ============================================================
   Card: Finanças (página completa)
   ============================================================ */

.finances-card {
  position: relative;
  padding: 1.25rem 0.75rem 2rem;
  font-family: 'Manrope', sans-serif;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

.finances-card::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -30%;
  width: 80%;
  height: 60%;
  background: radial-gradient(
    ellipse at 70% 30%,
    rgba(212, 175, 55, 0.10) 0%,
    rgba(212, 175, 55, 0) 65%
  );
  pointer-events: none;
  z-index: 0;
}

.finances-card > * { position: relative; z-index: 1; }

/* Header */
.finances-card__header {
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.finances-card__title {
  font-family: 'Cinzel', serif;
  font-size: 1.7rem;
  font-weight: 400;
  color: #d4af37;
  margin: 0 0 0.25rem;
  letter-spacing: 0.02em;
}

.finances-card__sub {
  font-size: 0.82rem;
  color: #b8b0a4;
  margin: 0;
}

/* Hero card */
.finances-card__hero {
  position: relative;
  border-radius: 1rem;
  background: linear-gradient(135deg, #0d0a07 0%, #15100a 45%, #1f1508 100%);
  border: 1px solid rgba(212, 175, 55, 0.22);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
  isolation: isolate;
}

.finances-card__hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: -30%;
  width: 90%;
  height: 100%;
  background: radial-gradient(
    ellipse at 70% 50%,
    rgba(212, 175, 55, 0.28) 0%,
    rgba(212, 175, 55, 0.10) 35%,
    rgba(212, 175, 55, 0) 70%
  );
  pointer-events: none;
  z-index: -1;
}

.finances-card__hero-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.finances-card__hero-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d4af37;
  flex-shrink: 0;
}

.finances-card__hero-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  display: block;
}

.finances-card__hero-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #d4af37;
}

/* Pill */
.finances-card__pill {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  color: #d4af37;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  white-space: nowrap;
  max-width: calc(100% - 2rem);
}

.finances-card__pill--up {
  color: #9ecc8f;
  border-color: rgba(158, 204, 143, 0.4);
  background: rgba(158, 204, 143, 0.1);
}

.finances-card__pill--down {
  color: #d4665a;
  border-color: rgba(212, 102, 90, 0.4);
  background: rgba(212, 102, 90, 0.1);
}

.finances-card__pill--empty {
  color: #b8b0a4;
  border-color: rgba(184, 176, 164, 0.25);
  background: rgba(120, 112, 105, 0.15);
}

.finances-card__pill-arrow {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

/* Resultado grande */
.finances-card__hero-result {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 1.15rem;
}

.finances-card__hero-result-label {
  font-size: 0.7rem;
  color: #b8b0a4;
  line-height: 1.2;
}

.finances-card__hero-result-value {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  font-weight: 500;
  color: #d4af37;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.finances-card__hero-result-sub {
  font-size: 0.7rem;
  color: #b8b0a4;
  line-height: 1.2;
}

/* 2 colunas receitas/despesas */
.finances-card__hero-cols {
  display: flex;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid rgba(212, 175, 55, 0.12);
  margin-bottom: 0.6rem;
}

.finances-card__hero-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.finances-card__hero-col-label {
  font-size: 0.68rem;
  color: #b8b0a4;
  line-height: 1.2;
}

.finances-card__hero-col-value {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.finances-card__hero-col-value--income { color: #9ecc8f; }
.finances-card__hero-col-value--expense { color: #d4665a; }

/* Barra de proporção */
.finances-card__hero-bar-wrap {
  display: flex;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(120, 112, 105, 0.15);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.finances-card__hero-bar {
  height: 100%;
  transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.finances-card__hero-bar--income {
  background: #9ecc8f;
}

.finances-card__hero-bar--expense {
  background: #d4665a;
}

.finances-card__hero-legend {
  font-size: 0.68rem;
  color: #b8b0a4;
  margin: 0;
}

/* Loading */
.finances-card__loading {
  text-align: center;
  padding: 3rem 1rem;
  color: #b8b0a4;
  font-family: 'Manrope', sans-serif;
}

/* Mobile */
@media (max-width: 479px) {
  .finances-card__title { font-size: 1.4rem; }
  .finances-card__hero { padding: 1rem; }
  .finances-card__hero-result-value { font-size: 1.9rem; }
  .finances-card__hero-col-value { font-size: 1.05rem; }
  .finances-card__pill {
    font-size: 0.55rem;
    padding: 0.28rem 0.55rem;
  }
}

/* ============================================================
   Secção genérica — cabeçalhos
   ============================================================ */

.finances-card__section {
  padding: 0 0.25rem;
  margin-bottom: 1.5rem;
}

.finances-card__section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.25rem 0.75rem;
}

.finances-card__section-title {
  flex: 1;
  min-width: 0;
}

.finances-card__section-see-all {
  flex-shrink: 0;
  white-space: nowrap;
}

.finances-card__section-title {
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #d4af37;
  margin: 0;
}

.finances-card__section-see-all {
  background: transparent;
  border: 0;
  padding: 0.25rem 0;
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  color: #b8b0a4;
  cursor: pointer;
  transition: color 150ms ease;
}

.finances-card__section-see-all:hover {
  color: #d4af37;
}

.finances-card__section-empty {
  font-family: 'Manrope', sans-serif;
  font-size: 0.78rem;
  color: #b8b0a4;
  text-align: center;
  padding: 1.25rem 0.5rem;
  margin: 0;
}

/* ============================================================
   Saldo em contas
   ============================================================ */

.finances-card__accounts-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(212, 175, 55, 0.12);
}

.finances-card__account {
  display: grid;
  grid-template-columns: 32px 1fr auto 16px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.5rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.08);
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  width: 100%;
  text-align: left;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  transition: background 150ms ease;
}

.finances-card__account:last-child { border-bottom: 0; }

.finances-card__account:hover {
  background: rgba(212, 175, 55, 0.04);
}

.finances-card__account-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.1);
  color: #d4af37;
  flex-shrink: 0;
}

.finances-card__account-icon svg {
  width: 55%;
  height: 55%;
  stroke: currentColor;
  fill: none;
  display: block;
}

.finances-card__account-text { min-width: 0; }

.finances-card__account-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: #f0e6d2;
  line-height: 1.2;
  margin-bottom: 0.12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finances-card__account-type {
  font-size: 0.66rem;
  color: #b8b0a4;
  line-height: 1.2;
}

.finances-card__account-value {
  font-family: 'Manrope', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: #f0e6d2;
  white-space: nowrap;
  flex-shrink: 0;
}

.finances-card__account-chevron {
  color: #b8b0a4;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.6;
}

.finances-card__accounts-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.5rem 0.25rem;
  border-top: 1px solid rgba(212, 175, 55, 0.12);
  margin-top: 0.25rem;
}

.finances-card__accounts-total-label {
  font-size: 0.72rem;
  color: #b8b0a4;
  letter-spacing: 0.05em;
}

.finances-card__accounts-total-value {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #d4af37;
  letter-spacing: -0.01em;
}

/* ============================================================
   Top categorias de despesa
   ============================================================ */

.finances-card__top-cats-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.25rem 0;
}

.finances-card__top-cat {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
}

.finances-card__top-cat-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.finances-card__top-cat-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: #f0e6d2;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finances-card__top-cat-bar-wrap {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.1);
  overflow: hidden;
}

.finances-card__top-cat-bar {
  height: 100%;
  border-radius: 999px;
  background: #d4af37;
  transition: width 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.finances-card__top-cat-pct {
  font-size: 0.68rem;
  color: #b8b0a4;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 32px;
  text-align: right;
}

.finances-card__top-cat-value {
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: #f0e6d2;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 70px;
  text-align: right;
}

/* FIX tema claro */
.finances-card__account-name,
.finances-card__account-value,
.finances-card__top-cat-name,
.finances-card__top-cat-value { color: #f0e6d2; }

.finances-card__account-type,
.finances-card__top-cat-pct,
.finances-card__accounts-total-label,
.finances-card__account-chevron,
.finances-card__section-see-all,
.finances-card__section-empty { color: #b8b0a4; }

/* Mobile */
@media (max-width: 479px) {
  .finances-card__account {
    grid-template-columns: 28px 1fr auto 14px;
    gap: 0.6rem;
    padding: 0.7rem 0.35rem;
  }

  .finances-card__account-icon {
    width: 28px;
    height: 28px;
  }

  .finances-card__account-name,
  .finances-card__account-value { font-size: 0.78rem; }

  .finances-card__account-type { font-size: 0.6rem; }

  .finances-card__top-cat {
    gap: 0.5rem;
  }

  .finances-card__top-cat-name { font-size: 0.78rem; }
  .finances-card__top-cat-value { font-size: 0.68rem; min-width: 60px; }
  .finances-card__top-cat-pct { font-size: 0.62rem; min-width: 28px; }
}

/* ============================================================
   Movimentos recentes
   ============================================================ */

.finances-card__movements-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(212, 175, 55, 0.12);
}

.finances-card__movement {
  display: grid;
  grid-template-columns: 26px 1fr auto auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.4rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.08);
}

.finances-card__movement:last-child { border-bottom: 0; }

.finances-card__movement-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.finances-card__movement.is-income .finances-card__movement-icon {
  background: rgba(158, 204, 143, 0.15);
  color: #9ecc8f;
}

.finances-card__movement.is-expense .finances-card__movement-icon {
  background: rgba(212, 102, 90, 0.15);
  color: #d4665a;
}

.finances-card__movement-icon svg {
  width: 55%;
  height: 55%;
  stroke: currentColor;
  fill: none;
  display: block;
}

.finances-card__movement-text { min-width: 0; }

.finances-card__movement-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: #f0e6d2;
  line-height: 1.2;
  margin-bottom: 0.12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finances-card__movement-date {
  font-size: 0.66rem;
  color: #b8b0a4;
  line-height: 1.2;
}

.finances-card__movement-value {
  font-family: 'Manrope', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.finances-card__movement.is-income .finances-card__movement-value {
  color: #9ecc8f;
}

.finances-card__movement.is-expense .finances-card__movement-value {
  color: #d4665a;
}

.finances-card__movement-badge {
  font-family: 'Manrope', sans-serif;
  font-size: 0.58rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.finances-card__movement-badge--income {
  background: rgba(158, 204, 143, 0.18);
  color: #9ecc8f;
}

.finances-card__movement-badge--expense {
  background: rgba(212, 102, 90, 0.18);
  color: #d4665a;
}

.finances-card__movement-badge--transfer {
  background: rgba(184, 176, 164, 0.15);
  color: #b8b0a4;
}

/* ============================================================
   Tip no fundo
   ============================================================ */

.finances-card__tip {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, #0d0a07 0%, #0a0806 100%);
  border: 1px solid rgba(212, 175, 55, 0.14);
  padding: 1rem 1.1rem;
  margin: 0 0.25rem 1rem;
}

.finances-card__tip-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #d4af37;
  margin-top: 1px;
}

.finances-card__tip-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  display: block;
}

.finances-card__tip-text {
  font-size: 0.78rem;
  line-height: 1.4;
  color: #b8b0a4;
  margin: 0;
  font-style: italic;
}

/* FIX tema claro */
.finances-card__movement-name { color: #f0e6d2; }
.finances-card__movement-date,
.finances-card__tip-text { color: #b8b0a4; }

/* Mobile */
@media (max-width: 479px) {
  .finances-card__movement {
    grid-template-columns: 22px 1fr auto;
    gap: 0.55rem;
    padding: 0.7rem 0.3rem;
  }

  .finances-card__movement-badge { display: none; }
  .finances-card__movement-name  { font-size: 0.78rem; }
  .finances-card__movement-value { font-size: 0.78rem; }
  .finances-card__tip { padding: 0.9rem 1rem; }
}

/* ============================================================
   Estado vazio
   ============================================================ */

.finances-card__empty-card {
  border-radius: 1rem;
  background: linear-gradient(135deg, #0d0a07 0%, #15100a 45%, #1f1508 100%);
  border: 1px solid rgba(212, 175, 55, 0.22);
  padding: 2rem 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.finances-card__empty-icon {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d4af37;
  margin-bottom: 0.25rem;
}

.finances-card__empty-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  display: block;
  stroke-width: 1.4;
}

.finances-card__empty-title {
  font-family: 'Manrope', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #f0e6d2;
  margin: 0;
  line-height: 1.3;
  max-width: 300px;
}

.finances-card__empty-text {
  font-size: 0.8rem;
  line-height: 1.45;
  color: #b8b0a4;
  margin: 0;
  max-width: 300px;
}

.finances-card__empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.55);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
  color: #d4af37;
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 0.4rem;
  transition: background 150ms ease, transform 150ms ease;
}

.finances-card__empty-cta:hover {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.25) 0%, rgba(212, 175, 55, 0.1) 100%);
  transform: translateY(-1px);
}

.finances-card__empty-cta-plus {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1;
}

/* Secção CONFIGURAR */
.finances-card__setup {
  padding: 0 0.25rem;
  margin-bottom: 1.5rem;
}

.finances-card__setup-header {
  padding: 0 0.25rem 0.85rem;
}

.finances-card__setup-header-title {
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #d4af37;
  margin: 0;
}

.finances-card__setup-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.finances-card__setup-tile {
  display: grid;
  grid-template-columns: 32px 1fr 16px;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1rem;
  border-radius: 0.85rem;
  background: linear-gradient(160deg, #131008 0%, #0c0906 100%);
  border: 1px solid rgba(212, 175, 55, 0.16);
  cursor: pointer;
  text-align: left;
  font-family: 'Manrope', sans-serif;
  transition: border-color 150ms ease, transform 150ms ease;
}

.finances-card__setup-tile:hover {
  border-color: rgba(212, 175, 55, 0.4);
  transform: translateY(-1px);
}

.finances-card__setup-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.1);
  color: #d4af37;
  flex-shrink: 0;
}

.finances-card__setup-icon svg {
  width: 55%;
  height: 55%;
  stroke: currentColor;
  fill: none;
  display: block;
}

.finances-card__setup-text { min-width: 0; }

.finances-card__setup-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: #f0e6d2;
  line-height: 1.2;
  margin-bottom: 0.15rem;
}

.finances-card__setup-sub {
  font-size: 0.7rem;
  color: #b8b0a4;
  line-height: 1.2;
}

.finances-card__setup-chevron {
  color: #b8b0a4;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.6;
}

/* FIX tema claro */
.finances-card__empty-card,
.finances-card__empty-card *,
.finances-card__setup-tile,
.finances-card__setup-tile * {
  color: #f0e6d2;
}

.finances-card__empty-icon,
.finances-card__empty-cta,
.finances-card__empty-cta-plus,
.finances-card__setup-header-title,
.finances-card__setup-icon {
  color: #d4af37;
}

.finances-card__empty-text,
.finances-card__setup-sub,
.finances-card__setup-chevron {
  color: #b8b0a4;
}

/* Mobile */
@media (max-width: 479px) {
  .finances-card__empty-icon { width: 56px; height: 56px; }
  .finances-card__empty-title { font-size: 0.98rem; }
  .finances-card__empty-text { font-size: 0.76rem; }
  .finances-card__empty-cta {
    font-size: 0.66rem;
    padding: 0.7rem 1.2rem;
  }
  .finances-card__setup-title { font-size: 0.82rem; }
}
