/* Dinheiro v3 - estilos novos por cima da familia app-v2 */

:root {
  --muted-deep: #5C6961; /* salvia AA pra texto pequeno */
}

/* o display dos componentes nao pode vencer o atributo hidden */
[hidden] { display: none !important; }

/* ============================================================
   HERO CADERNINHO - a conta como numa caderneta
   ============================================================ */
.cad-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 18px 20px 16px;
}

.cad-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
}
.cad-line .lbl {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.cad-line .lbl i { font-size: 16px; }
.cad-line.in .lbl i { color: var(--ok); }
.cad-line.out .lbl i { color: var(--danger); }
.cad-line .val {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.cad-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 2px dashed var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.cad-total .lbl {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.cad-total .val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: var(--brand-strong);
  font-variant-numeric: tabular-nums;
}
.cad-hero.neg .cad-total .val { color: var(--danger); }

.cad-hint { font-size: 13px; color: var(--muted-deep); margin-top: 6px; line-height: 1.45; }

.cad-conta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  margin-top: 2px;
  border: none;
  background: none;
  color: var(--brand-strong);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.cad-conta i { font-size: 15px; }

/* estado vazio do mes */
.cad-empty { text-align: center; padding: 10px 4px 6px; }
.cad-empty .big { font-size: 30px; display: block; margin-bottom: 6px; }
.cad-empty p { font-size: 14px; color: var(--muted-deep); line-height: 1.5; }

/* ============================================================
   ANOTAR - a acao do dia, grande e colorida
   ============================================================ */
.anota-row { display: flex; gap: 10px; margin-top: 12px; }

.anota {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 10px 14px;
  border-radius: var(--r-card);
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
  transition: transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.anota:active { transform: scale(.97); }
.anota .ic {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex: 0 0 auto;
  background: var(--surface);
}
.anota b { display: block; font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.anota small { display: block; font-size: 12px; margin-top: 1px; white-space: nowrap; }

.anota b { white-space: nowrap; }

.anota.gasto { background: var(--danger-soft); border-color: #F2D4CE; color: #8C2E22; }
.anota.gasto .ic { color: var(--danger); }
.anota.gasto small { color: #93493E; }

.anota.entrada { background: var(--ok-soft); border-color: #C9E5D4; color: #2A6842; }
.anota.entrada .ic { color: var(--ok); }
.anota.entrada small { color: #3D6F52; }

/* ============================================================
   ESPERANDO PAGAMENTO - com nomes, um cobrar por pessoa
   ============================================================ */
.receber-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.receber-head .lbl {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.receber-head .tot { font-family: var(--font-display); font-weight: 700; font-size: 16px; }

.receber-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid #EDF3F0;
}
.receber-row:last-of-type { border-bottom: none; }
.receber-row .grow { flex: 1; min-width: 0; }
.receber-row .who { font-weight: 600; font-size: 14.5px; }
.receber-row .det { font-size: 12.5px; color: var(--muted-deep); margin-top: 1px; }
.receber-row .valor { font-family: var(--font-display); font-weight: 700; font-size: 15.5px; flex: 0 0 auto; }

.btn-cobrar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: none;
  background: var(--whats);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
}
.btn-cobrar i { font-size: 17px; }
.btn-cobrar:active { transform: scale(.96); }

.receber-nota { font-size: 12.5px; color: var(--muted-deep); margin-top: 8px; }

/* ============================================================
   ULTIMAS ANOTACOES - lista visivel, sem tabela
   ============================================================ */
.anot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 0;
  border: none;
  border-bottom: 1px solid #EDF3F0;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}
.anot-row:last-of-type { border-bottom: none; }
.anot-row .dir {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex: 0 0 auto;
}
.anot-row.saiu .dir { background: var(--danger-soft); color: var(--danger); }
.anot-row.entrou .dir { background: var(--ok-soft); color: var(--ok); }
.anot-row .grow { flex: 1; min-width: 0; display: block; }
.anot-row .desc { display: block; font-weight: 600; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anot-row .sub { display: block; font-size: 12.5px; color: var(--muted-deep); margin-top: 1px; }
.anot-row .valor {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.anot-row.saiu .valor { color: var(--danger); }
.anot-row.entrou .valor { color: #2F7A4A; }

.ver-todas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 46px;
  margin-top: 6px;
  border: none;
  background: none;
  color: var(--brand-strong);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

/* ============================================================
   CARD-LABEL padrao (era estilo inline no v2)
   ============================================================ */
.cardlbl {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

/* barras com valor em cima */
.bar .num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  color: var(--muted-deep);
  font-variant-numeric: tabular-nums;
}
.bar.now .num { color: var(--brand-strong); font-weight: 700; }
.bar .fill.neg { background: #F0C5BA; border-bottom: 3px solid var(--danger); }
.bar.negbar .num { color: var(--danger); font-weight: 700; }
.bars.grande { height: 128px; }

/* kv um pouco maior que o v2 (piso tipografico) */
.kv { font-size: 14px; }
.kv .k { color: var(--muted-deep); }

/* ============================================================
   SHEETS DA V3
   ============================================================ */
.sheet-sub { font-size: 13px; color: var(--muted-deep); margin: 2px 0 12px; line-height: 1.5; }

/* valor gigante no anotar */
.valor-input {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 12px 0 4px;
  font-family: var(--font-display);
}
.valor-input .rs { font-size: 20px; font-weight: 600; color: var(--muted); }
.valor-input .num {
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--ink);
  border: none;
  background: none;
  width: 190px;
  text-align: center;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  border-bottom: 2.5px solid var(--brand);
  padding-bottom: 2px;
  outline: none;
}

.chips-cat { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.chips-cat .chip { min-height: 44px; font-size: 14px; }
.chips-cat .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.quando { display: flex; gap: 8px; margin-top: 4px; }
.quando .chip { min-height: 44px; font-size: 14px; }
.quando .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* dica dentro de sheet */
.dica {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted-deep);
  background: var(--paper);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 2px;
}
.dica i { font-size: 15px; color: var(--brand-strong); flex: 0 0 auto; margin-top: 1px; }

/* preview da mensagem de cobranca */
.wa-preview {
  background: #E8F7EE;
  border: 1.5px solid #BFE5CD;
  border-radius: 16px 16px 16px 4px;
  padding: 13px 15px;
  font-size: 14px;
  line-height: 1.55;
  color: #1D4B33;
}
.wa-preview-nota {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted-deep);
  margin-top: 10px;
}
.wa-preview-nota i { color: var(--ok); font-size: 16px; }

/* conferir pix - resultado */
.pix-match {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid #EDF3F0;
}
.pix-match:last-of-type { border-bottom: none; }
.pix-match .chk {
  width: 26px; height: 26px;
  border-radius: 8px;
  border: 2px solid var(--brand);
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex: 0 0 auto;
  cursor: pointer;
  position: relative;
}
/* area de toque 44px mantendo o visual de 26px */
.pix-match .chk::before { content: ""; position: absolute; inset: -9px; }
.pix-match.off .chk { background: var(--surface); color: transparent; }
.pix-match .grow { flex: 1; min-width: 0; display: block; }
.pix-match .t1 { display: block; font-weight: 600; font-size: 14px; }
.pix-match .t2 { display: block; font-size: 12.5px; color: var(--muted-deep); margin-top: 1px; }
.pix-match .valor { font-family: var(--font-display); font-weight: 700; font-size: 15px; }

.como-pego { margin-top: 12px; }
.como-pego summary {
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-strong);
  font-size: 13.5px;
  font-weight: 600;
}
.como-pego summary::-webkit-details-marker { display: none; }
.como-pego ol { margin: 4px 0 0 20px; font-size: 13.5px; color: var(--muted-deep); line-height: 1.7; }

/* lista "todas as anotacoes" agrupada por dia */
.dia-grupo { margin-top: 14px; }
.dia-grupo:first-child { margin-top: 2px; }
.dia-grupo .dia {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 2px;
}

/* toast proprio (pilula escura) */
.toast {
  position: absolute;
  left: 50%;
  bottom: 104px;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 99px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 60;
  white-space: nowrap;
  max-width: 88%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* gastos fixos */
.fixo-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 10px;
  margin-top: 2px;
  border-top: 2px dashed var(--line);
  font-size: 13.5px;
  font-weight: 700;
}
.fixo-total .v { font-family: var(--font-display); font-size: 15px; }

/* secao do mes */
.section-title.mes { margin-top: 24px; }

/* desktop: primeira linha do grid estica (bases alinhadas) */
.dgrid.stretch { align-items: stretch; }

/* desktop: mes vazio re-flui a 2a linha (sem buraco no grid) */
body.mes-vazio .dgrid.linha2 { grid-template-columns: 1fr; }
body.mes-vazio .dgrid.linha2 .dcol:last-child { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
body.mes-vazio .dgrid.linha2 .dcol:last-child > * + * { margin-top: 0; }

/* desktop: sheets viram dialogo centrado dentro do frame */
.browser { position: relative; }
.browser .sheet {
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: 480px;
  max-height: 82%;
  border-radius: 22px;
  animation: none;
}
.browser .sheet-grab { display: none; }
.browser .sheet-head { padding-top: 16px; }
.browser .sheet-foot { padding-bottom: 16px; border-radius: 0 0 22px 22px; }
.browser .toast { bottom: 40px; }

/* desktop: heroi caderninho maior */
.dmain .cad-hero.big { padding: 26px 30px 22px; height: 100%; display: flex; flex-direction: column; justify-content: center; }
.dmain .cad-hero.big .cad-line .val { font-size: 24px; }
.dmain .cad-hero.big .cad-total .val { font-size: 58px; }
.dmain .cad-hero.big .cad-hint { font-size: 14px; }
