/* MyFinance — gastos por categoria (usa os tokens de style.css) */

.rel .topbar { justify-content: space-between; }
.rel-titulo { flex: 1; font-size: 20px; font-weight: 600; }
.rel-link { color: var(--gold); font-size: 15px; font-weight: 600; padding: 8px 4px; text-decoration: none; }

/* filtros */
.rel-filtros { padding: 14px 16px 6px; display: flex; flex-direction: column; gap: 12px; }
.rel-abas { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; }
.rel-abas button { padding: 10px; border-radius: 10px; font-weight: 700; color: var(--text-2); }
.rel-abas button.ativo { background: var(--surface-3); color: var(--gold); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex-shrink: 0; padding: 8px 14px; border-radius: 20px;
  background: var(--surface-2); color: var(--text-2); font-size: 14px; font-weight: 600;
}
.chips button.ativo { background: var(--text); color: #000; }

.periodo-nav { display: flex; align-items: center; justify-content: space-between; }
.periodo-nav[hidden] { display: none; }
.periodo-nav span { font-size: 16px; font-weight: 600; text-align: center; }
.periodo-nav button { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--text-2); background: var(--surface-2); }
.periodo-nav button:hover { color: var(--text); }
.periodo-nav svg { width: 18px; height: 18px; }

.custom { display: flex; align-items: center; gap: 8px; }
.custom[hidden] { display: none; }
.custom span { color: var(--muted); font-size: 14px; flex-shrink: 0; }
.custom input {
  flex: 1; min-width: 0; -webkit-appearance: none; appearance: none;
  height: 44px; padding: 0 10px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--surface-3); color: var(--text);
  font: inherit; font-size: 15px; color-scheme: dark; outline: none;
}
.custom input:focus { border-color: var(--gold); }
.custom input::-webkit-date-and-time-value { text-align: left; }

/* número principal */
.rel-hero { padding: 18px 16px 20px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.rh-label { font-size: 13px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--text-2); }
.rh-valor { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.rh-valor small { font-size: 20px; color: var(--muted); font-weight: 600; }
.rh-sub { font-size: 14px; color: var(--muted); }
.rh-sub .delta { font-weight: 600; }

/* variação: cor + seta + texto (nunca só cor) */
.delta.ruim { color: var(--red); }
.delta.bom { color: var(--green); }
.delta.neutro { color: var(--muted); }

/* lista de categorias com barras */
.rel-lista { list-style: none; padding: 6px 0 40px; }
.cat-row { border-bottom: 1px solid var(--line); }
.cat-head {
  width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: baseline;
  column-gap: 12px; row-gap: 8px; padding: 14px 16px; text-align: left;
}
.cat-head:hover { background: rgba(255,255,255,.025); }
.cr-nome { font-size: 16px; font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-nome small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.cr-valor { font-size: 16px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* barra fina, ponta arredondada de 4px ancorada à esquerda, sem trilho */
.cr-bar { grid-column: 1 / -1; height: 8px; }
.cr-bar i { display: block; height: 100%; min-width: 3px; background: var(--gold); border-radius: 0 4px 4px 0; transition: width .4s ease; }
.cat-row.sem-cat .cr-bar i { background: var(--muted); }
.cr-meta { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* itens da categoria */
.cr-itens { list-style: none; padding: 0 16px 12px; display: none; }
.cat-row.aberta .cr-itens { display: block; }
.cr-itens li {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-top: 6px;
  background: var(--surface-2); border-radius: 12px; cursor: pointer;
}
.cr-itens li:hover { background: var(--surface-3); }
.cr-itens .ci-data { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; width: 44px; }
.cr-itens .ci-desc { flex: 1; min-width: 0; font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-itens .ci-val { font-size: 15px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.rel-vazio { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 15px; }
.rel-vazio p { margin-bottom: 14px; }
.rel-vazio button { padding: 10px 18px; border-radius: 12px; background: var(--surface-3); color: var(--text); font-weight: 600; }
