/* =========================================================
   Componentes
   ========================================================= */

/* ----- Botões ----- */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform .12s var(--ease);
}
.btn:active{ transform: scale(.97); }
.btn:disabled{ opacity: .5; cursor: default; transform: none; }
.btn svg.i{ width: 16px; height: 16px; stroke-width: 2.1; }
.btn-primary{ background: var(--ink); color: var(--bg); }
.btn-primary:hover:not(:disabled){ background: var(--sage-dark); color: #fff; }
[data-theme="dark"] .btn-primary:hover:not(:disabled){ color: var(--bg); }
.btn-sage{ background: var(--sage-dark); color: #fff; }
[data-theme="dark"] .btn-sage{ color: #0F110F; }
.btn-ghost{ background: transparent; border-color: var(--line-2); color: var(--ink-2); }
.btn-ghost:hover{ border-color: var(--ink); color: var(--ink); }
.btn-soft{ background: var(--surface-3); color: var(--ink); }
.btn-soft:hover{ background: var(--line-2); }
.btn-danger{ background: var(--expense); color: #fff; }
[data-theme="dark"] .btn-danger{ color: #1a0f0a; }
.btn-text-danger{ background: none; color: var(--expense); padding: 0 12px; }
.btn-text-danger:hover{ background: var(--expense-soft); }
.btn-light{ background: #fff; color: #1C1E1B; }
.btn-sm{ height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-block{ width: 100%; height: 48px; font-size: 14.5px; }
.btn-row{ display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row.spread{ justify-content: space-between; }

.icon-btn{
  width: 36px; height: 36px; border-radius: 50%; border: none; background: transparent; color: var(--ink-2);
  display: inline-grid; place-items: center; cursor: pointer; flex: 0 0 auto; padding: 0;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover{ background: var(--surface-3); color: var(--ink); }
.icon-btn.danger:hover{ background: var(--expense-soft); color: var(--expense); }
.icon-btn.bordered{ border: 1px solid var(--line-2); background: var(--surface); }
.icon-btn.active{ background: var(--sage-soft); color: var(--sage-dark); }
.icon-btn:disabled{ opacity: .45; cursor: default; }
.icon-btn svg.i{ width: 17px; height: 17px; }

.link{ background: none; border: none; padding: 4px 0; color: var(--ink-2); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.link:hover{ color: var(--sage-dark); }
.link.danger:hover{ color: var(--expense); }
.link svg.i{ width: 15px; height: 15px; }

.kbd{ font-size: 11px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 0 5px; line-height: 17px; }
.btn-primary .kbd{ color: inherit; opacity: .6; border-color: currentColor; }
.avatar{ width: 34px; height: 34px; border-radius: 50%; background: var(--sage-soft); color: var(--sage-dark); flex: 0 0 auto; display: grid; place-items: center; font-weight: 700; font-size: 14px; border: none; cursor: pointer; padding: 0; }
.tag{ font-size: 11px; padding: 3px 9px; border-radius: var(--r-pill); background: rgba(255,255,255,.16); white-space: nowrap; }
.dot{ width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: 1px; flex: 0 0 auto; }

/* ----- Chips e segmentos ----- */
.chips{ display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips::-webkit-scrollbar{ display: none; }
.chip{
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: all var(--t-fast) var(--ease);
}
.chip:hover{ color: var(--ink); border-color: var(--line-2); }
.chip.active{ background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .dot{ margin: 0; width: 7px; height: 7px; }

.seg{ display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; background: var(--surface-3); padding: 3px; border-radius: 13px; }
.seg button{
  height: 36px; border: none; background: transparent; border-radius: 10px; font-weight: 600; font-size: 13px; padding: 0 10px;
  color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.seg button svg.i{ width: 15px; height: 15px; }
.seg button:hover{ color: var(--ink); }
.seg button.active{ background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px -2px rgba(0,0,0,.08); }
.seg button.active[data-type="despesa"]{ color: var(--expense); }
.seg button.active[data-type="receita"]{ color: var(--income); }
.seg button.active[data-type="poupanca"]{ color: var(--savings); }
.seg button.active[data-type="transferencia"]{ color: var(--withdraw); }
.seg.sm button{ height: 30px; font-size: 12px; padding: 0 12px; }
.seg.on-dark{ background: rgba(255,255,255,.09); }
.seg.on-dark button{ color: var(--on-hero-2); }
.seg.on-dark button.active{ background: rgba(255,255,255,.18); color: #fff; box-shadow: none; }

/* ----- Campos ----- */
.stack{ display: flex; flex-direction: column; gap: 14px; }
.field{ display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.grow{ flex: 1; }
.field > .label{ font-size: 12px; font-weight: 600; color: var(--ink-2); }
.opt{ font-weight: 400; color: var(--ink-3); }
.input, .field input:not(.cs-search):not(.cs-native), .input-money{
  width: 100%; height: 44px; font-size: 15px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input:focus, .field input:focus{ outline: none; border-color: var(--sage); box-shadow: var(--ring); }
.input-money{ display: flex; align-items: center; gap: 6px; padding: 0 14px 0 0; }
.input-money:focus-within{ border-color: var(--sage); box-shadow: var(--ring); }
.field .input-money input{ border: none !important; box-shadow: none !important; height: 42px; background: transparent; text-align: right; padding-right: 0; }
.input-money span{ color: var(--ink-3); }
input::placeholder{ color: var(--ink-3); opacity: .8; }
.field-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline-form{ display: flex; gap: 10px; align-items: flex-end; }
.hint{ font-size: 12.5px; color: var(--ink-3); line-height: 1.45; margin: 0; }
.hint b{ color: var(--ink-2); font-weight: 600; }
input[type=search]::-webkit-search-cancel-button{ -webkit-appearance: none; }

/* ----- Cartões ----- */
.card{ background: var(--surface); border-radius: var(--r-xl); padding: 20px; box-shadow: var(--shadow); min-width: 0; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.card + .card, .card + section, section + .card, .grid-2 + .card, .card + .grid-2{ margin-top: 16px; }
.card-head{ display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title{ font-size: 15px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card-sub{ font-size: 12.5px; color: var(--ink-3); }
.section-head{ display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 2px 12px; flex-wrap: wrap; }
.section-head h2{ font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: -.01em; }
.section-head .sub{ color: var(--ink-3); font-size: 13px; font-weight: 600; }
.sub-title{ font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; margin: 18px 0 6px; }
.count{ font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); padding: 1px 8px; border-radius: var(--r-pill); margin-left: 6px; }

/* ----- Estado vazio ----- */
.empty{ text-align: center; color: var(--ink-3); padding: 28px 16px; font-size: 13.5px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty b{ color: var(--ink); font-size: 15px; font-weight: 600; }
.empty p{ margin: 0; max-width: 38ch; line-height: 1.5; }
.empty .btn{ margin-top: 10px; }
.empty-ic{ width: 44px; height: 44px; border-radius: 50%; background: var(--sage-soft); color: var(--sage-dark); display: grid; place-items: center; margin-bottom: 4px; }
.empty-line{ color: var(--ink-3); padding: 14px; margin: 0; }

/* ----- Barras de progresso ----- */
.bar{ display: block; height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.bar > i{ display: block; height: 100%; border-radius: var(--r-pill); background: var(--sage); transition: width .5s var(--ease); }
.bar.done > i{ background: var(--income); }
.bar.warn > i{ background: var(--warn) !important; }
.bar.over > i{ background: var(--expense) !important; }
.bar.big{ height: 10px; }
.bar.nometa{ background: repeating-linear-gradient(90deg, var(--surface-3) 0 6px, transparent 6px 10px); }

/* ----- Skeleton ----- */
.skel-wrap{ display: flex; flex-direction: column; gap: 14px; }
.skel{ border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel-hero{ height: 220px; border-radius: var(--r-2xl); }
.skel-line{ height: 58px; }
@keyframes shimmer{ to{ background-position: -200% 0; } }

/* ----- Avisos ----- */
.toasts{ position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 1100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast{
  pointer-events: auto; max-width: 460px; background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 500;
  line-height: 1.4; padding: 10px 10px 10px 16px; border-radius: 18px; box-shadow: var(--shadow-lg);
  display: flex; gap: 10px; align-items: center; opacity: 0; transform: translateY(10px) scale(.98); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.toast .tdot{ width: 8px; height: 8px; border-radius: 50%; background: var(--sage); flex: 0 0 auto; }
.toast.error .tdot{ background: #F0A58F; }
.toast.show{ opacity: 1; transform: none; }
.toast-text{ flex: 1; padding: 2px 0; }
.toast-action{ border: none; background: color-mix(in srgb, var(--bg) 18%, transparent); color: inherit; font: inherit; font-size: 12.5px; font-weight: 700; padding: 7px 12px; border-radius: var(--r-pill); cursor: pointer; flex: 0 0 auto; }
.toast-action:hover{ background: var(--bg); color: var(--ink); }

/* ----- Painéis ----- */
.modal{ position: fixed; inset: 0; z-index: 1001; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-bg{ position: absolute; inset: 0; background: rgba(15,17,15,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .2s var(--ease); }
.sheet{
  position: relative; width: 100%; max-width: 480px; background: var(--surface); border-radius: var(--r-2xl); padding: 20px 22px;
  box-shadow: var(--shadow-lg); animation: sheetIn .26s var(--ease); display: flex; flex-direction: column; gap: 14px;
  max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain;
}
.sheet.sm{ max-width: 420px; }
.sheet-grip{ display: none; }
.sheet-head{ display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head h2, .gd-top h2{ font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: -.01em; line-height: 1.1; }
.sheet-body{ display: flex; flex-direction: column; gap: 14px; }
.sheet-body > form{ display: flex; flex-direction: column; gap: 14px; }
.sheet-foot{ display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding-top: 2px; }
.sheet-foot .spacer{ flex: 1; }
.choice-row{ display: flex; flex-direction: column-reverse; gap: 8px; width: 100%; }
.choice-row .btn{ width: 100%; height: 46px; white-space: normal; text-align: center; line-height: 1.2; }
.confirm-msg{ margin: 4px 0 0; font-size: 16px; line-height: 1.45; font-weight: 600; }
@keyframes fadeIn{ from{ opacity: 0; } }
@keyframes sheetIn{ from{ opacity: 0; transform: translateY(14px) scale(.98); } }

/* ----- Registo de movimento ----- */
.amount-field{ display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 10px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.amount-field:focus-within{ border-color: var(--sage); box-shadow: var(--ring); }
.amount-row{ display: flex; align-items: center; justify-content: center; gap: 6px; }
.amount-row input{ border: none; background: transparent; outline: none; text-align: center; width: 100%; min-width: 0; font-family: var(--serif); font-size: 52px; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); padding: 0; }
.amount-field.expr .amount-row input{ font-size: 32px; }
.amount-row > span{ font-family: var(--serif); font-size: 30px; color: var(--ink-3); }
.amount-field.despesa input{ color: var(--expense); }
.amount-field.receita input{ color: var(--income); }
.amount-field.poupanca input{ color: var(--savings); }
.amount-field.transferencia input{ color: var(--withdraw); }
.calc{ display: flex; align-items: center; gap: 6px; min-height: 32px; }
.calc button{ width: 40px; height: 32px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); font-size: 18px; font-weight: 600; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; line-height: 1; }
.calc button:hover{ border-color: var(--ink-3); color: var(--ink); }
.calc .tip, .calc .res{ margin-left: auto; font-size: 12.5px; color: var(--ink-3); text-align: right; }
.calc .res b{ font-size: 16px; color: var(--ink); font-weight: 600; }
.calc .res.err{ color: var(--expense); }
.select-with-btn{ display: flex; gap: 8px; }
.select-with-btn .cs{ flex: 1; }
.select-with-btn .icon-btn{ width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); }
.select-with-btn .icon-btn.active{ border-color: var(--sage); color: var(--sage-dark); background: var(--sage-soft); }
.cat-manager{ padding: 12px; background: var(--surface-2); border-radius: 14px; margin-top: 4px; }
.cat-chips{ display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; max-height: 132px; overflow-y: auto; }
.cat-chip{ display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border-radius: var(--r-pill); padding: 3px 3px 3px 10px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); }
.cat-chip i{ width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.cat-chip button{ background: none; border: none; cursor: pointer; color: var(--ink-3); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.cat-chip button:hover{ background: var(--surface-3); color: var(--ink); }
.cat-chip button.del:hover{ color: var(--expense); }
.cat-chip button svg.i{ width: 13px; height: 13px; }
.cat-add{ display: flex; gap: 6px; }
.cat-add input{ flex: 1; height: 36px !important; border-radius: 10px !important; font-size: 13.5px !important; }
.goal-hint{ display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--savings-soft); color: var(--savings); font-size: 12.5px; }
.goal-hint b{ font-weight: 700; }
.goal-hint button{ margin-left: auto; border: none; background: var(--surface); color: var(--savings); font-weight: 700; font-size: 12px; padding: 6px 10px; border-radius: var(--r-pill); cursor: pointer; white-space: nowrap; }

/* ----- Seletor e calendário ----- */
.cs-native{ position: absolute !important; opacity: 0 !important; pointer-events: none !important; width: 1px !important; height: 1px !important; min-width: 0 !important; padding: 0 !important; border: 0 !important; left: 0; top: 0; }
.cs{ position: relative; min-width: 0; }
.cs-trigger{
  width: 100%; height: 44px; display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--ink);
  text-align: left; padding: 0 12px 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.cs-trigger:hover{ border-color: var(--ink-3); }
.cs.open .cs-trigger, .cs-trigger:focus-visible{ outline: none; border-color: var(--sage); box-shadow: var(--ring); }
.cs-trigger.placeholder .cs-label{ color: var(--ink-3); }
.cs-label{ flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-chev{ width: 16px !important; height: 16px !important; color: var(--ink-3); transition: transform .2s var(--ease); }
.cs.open .cs-chev{ transform: rotate(180deg); color: var(--sage-dark); }
.cs-ico{ width: 16px !important; height: 16px !important; color: var(--sage-dark); }
.cs-pop{
  z-index: 1200; background: var(--surface); border-radius: 14px; padding: 6px; border: 1px solid var(--line);
  box-shadow: 0 18px 40px -12px rgba(0,0,0,.28); animation: popIn .14s var(--ease); display: flex; flex-direction: column; overflow: hidden;
}
@keyframes popIn{ from{ opacity: 0; transform: translateY(-4px) scale(.98); } }
.cs-search-wrap{ position: relative; margin-bottom: 4px; flex: 0 0 auto; }
.cs-search-wrap svg{ position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px !important; height: 15px !important; color: var(--ink-3); pointer-events: none; }
.cs-search{ width: 100%; font-size: 16px; padding: 9px 10px 9px 34px; border-radius: 9px; border: none; background: var(--surface-2); color: var(--ink); }
.cs-search:focus{ outline: none; box-shadow: inset 0 0 0 1.5px var(--sage-tint); }
.cs-list{ list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; min-height: 0; flex: 1; }
.cs-opt{ display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; border-radius: 9px; font-size: 14px; cursor: pointer; color: var(--ink); user-select: none; }
.cs-opt.active{ background: var(--surface-2); }
.cs-opt.selected{ color: var(--sage-dark); font-weight: 600; }
.cs-opt.selected.active{ background: var(--sage-soft); }
.cs-check{ width: 15px !important; height: 15px !important; opacity: 0; }
.cs-opt.selected .cs-check{ opacity: 1; }
.cs-opt.info{ color: var(--ink-3); cursor: default; }
.cs-empty{ padding: 12px 10px; color: var(--ink-3); font-size: 13px; text-align: center; list-style: none; }
.cd-pop{ padding: 14px; }
.cd-head{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cd-title{ font-size: 14.5px; font-weight: 600; }
.cd-nav{ width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--surface-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; }
.cd-nav:hover{ background: var(--ink); color: var(--bg); }
.cd-nav svg{ width: 15px !important; height: 15px !important; stroke-width: 2.2; }
.cd-week, .cd-grid{ display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cd-week span{ font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 4px 0 6px; }
.cd-day{ height: 36px; border: none; background: none; border-radius: 50%; font-size: 13px; padding: 0; cursor: pointer; color: var(--ink); }
.cd-day:hover{ background: var(--surface-2); }
.cd-day.other{ color: var(--ink-3); opacity: .6; }
.cd-day.today{ box-shadow: inset 0 0 0 1.5px var(--sage); font-weight: 600; }
.cd-day.focus{ background: var(--surface-2); }
.cd-day.selected{ background: var(--sage-dark); color: #fff; font-weight: 700; box-shadow: none; opacity: 1; }
[data-theme="dark"] .cd-day.selected{ color: #0F110F; }
.cd-foot{ display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.cd-foot button{ flex: 1; border: none; background: var(--surface-2); border-radius: 9px; padding: 9px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.cd-foot button:hover{ background: var(--sage-soft); color: var(--sage-dark); }

/* ----- Linhas de movimento ----- */
.tx-list{ list-style: none; margin: 0; padding: 0; }
.tx-day{
  display: flex; justify-content: space-between; align-items: center; padding: 16px 8px 6px; position: sticky; top: 0; z-index: 2;
  font-size: 12px; font-weight: 600; color: var(--ink-3); background: linear-gradient(var(--surface) 75%, transparent);
}
.tx-day:first-child{ padding-top: 4px; }
.tx-day > span:first-child::first-letter{ text-transform: uppercase; }
.tx{
  display: grid; grid-template-columns: 40px minmax(0,1fr) auto 72px; gap: 14px; align-items: center;
  padding: 9px 8px; border-radius: 14px; cursor: pointer; transition: background var(--t-fast) var(--ease);
}
.tx:hover{ background: var(--surface-2); }
.tx-ic{ width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; position: relative; }
.tx-ic svg.i{ width: 17px; height: 17px; stroke-width: 2; }
.tx-ic.despesa{ background: var(--expense-soft); color: var(--expense); }
.tx-ic.receita{ background: var(--income-soft); color: var(--income); }
.tx-ic.poupanca{ background: var(--savings-soft); color: var(--savings); }
.tx-ic.levantamento, .tx-ic.transferencia{ background: var(--withdraw-soft); color: var(--withdraw); }
.tx-ic .cdot{ position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--surface); }
.tx-main{ min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tx-title{ font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-desc{ font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-amt{ font-weight: 600; text-align: right; white-space: nowrap; font-size: 14.5px; letter-spacing: -.01em; }
.tx-amt.pos{ color: var(--income); }
.tx-amt.neg{ color: var(--ink); }
.tx-amt.neutral{ color: var(--savings); }
.tx-amt.muted{ color: var(--ink-3); }
.tx-act{ display: flex; justify-content: flex-end; gap: 2px; opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.tx:hover .tx-act, .tx:focus-within .tx-act, .tx-act.always{ opacity: 1; }
.tx-act .icon-btn{ width: 32px; height: 32px; }
.tx-act .icon-btn svg.i{ width: 15px; height: 15px; }
.done-btn.on{ color: var(--income); }
.tx.compact{ grid-template-columns: 36px minmax(0,1fr) auto; gap: 12px; padding: 8px 6px; }
.tx.compact .tx-ic{ width: 36px; height: 36px; border-radius: 12px; }
.tx-group{ border-radius: 16px; transition: background var(--t-fast) var(--ease); }
.tx-group.open{ background: var(--surface-2); margin: 4px 0; }
.tx-group.open > .tx:hover{ background: transparent; }
.tx-group-rows{ list-style: none; margin: 0; padding: 0 6px 6px 24px; }
.tx-group-rows .tx{ grid-template-columns: 32px minmax(0,1fr) auto 40px; padding: 6px 8px; }
.tx-group-rows .tx-ic{ width: 32px; height: 32px; border-radius: 10px; }
.tx-group-rows .tx:hover{ background: var(--surface); }
.tx-count{ font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-pill); background: var(--savings-soft); color: var(--savings); margin-left: 6px; vertical-align: 1px; }
.tx-count.done{ background: var(--income-soft); color: var(--income); }
.chev svg.i{ transition: transform .2s var(--ease); }
.tx-group.open .chev svg.i{ transform: rotate(180deg); }
.more-row{ text-align: center; padding: 14px 0 4px; list-style: none; }

/* ----- Gráficos ----- */
.chart{ position: relative; touch-action: pan-y; }
.chart svg{ display: block; width: 100%; overflow: visible; }
.chart-dark .cg-line{ stroke: #DDE9DF; }
.chart-dark .cg-a{ stop-color: rgba(221,233,223,.32); }
.chart-dark .cg-b{ stop-color: rgba(221,233,223,0); }
.chart-light .cg-line{ stroke: var(--sage-dark); }
.chart-light .cg-a{ stop-color: color-mix(in srgb, var(--sage) 30%, transparent); }
.chart-light .cg-b{ stop-color: transparent; }
.chart-dot{ position: absolute; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; background: var(--hero-b); border: 2.5px solid #DDE9DF; box-shadow: 0 0 0 6px rgba(221,233,223,.16); }
.chart-tip{
  position: absolute; pointer-events: none; white-space: nowrap; background: #fff; color: #1C1E1B; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 9px;
  opacity: 0; transition: opacity var(--t-fast) var(--ease); z-index: 3;
}
.chart-tip small{ display: block; font-weight: 500; opacity: .65; font-size: 11px; }
.chart.hover .chart-tip, .chart:hover .chart-tip{ opacity: 1; }
.chart-x{ display: flex; justify-content: space-between; font-size: 11px; margin-top: 8px; font-weight: 500; color: var(--on-hero-2); }
.spark{ width: 100%; height: 28px; display: block; }
.legend{ display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.legend span{ display: inline-flex; align-items: center; gap: 6px; }
.legend i{ width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
