/* ---------- Financeiro (prefixo fin-) ---------- */
.fin-grid { grid-auto-flow: dense; }

/* KPI: divisão do saldo por conta */
.fin-split { display: flex; gap: 3px; height: 8px; margin-top: 10px; border-radius: 8px; overflow: hidden; }
.fin-split i { display: block; height: 100%; width: var(--w); border-radius: 3px; transform-origin: left; animation: grow-x 1.1s var(--ease) both; animation-delay: calc(var(--d) + 300ms); transition: width var(--t-slow) var(--ease); }
.fin-split-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-2xs); color: var(--tx-3); margin: 4px 0 6px; }
.fin-split-leg span { display: inline-flex; align-items: center; gap: 6px; }
.fin-split-leg i { width: 8px; height: 8px; border-radius: 2px; }
.fin-split-leg b { color: var(--tx-2); font-weight: 500; }
.fin-bump { animation: fin-bump .9s var(--ease); }
@keyframes fin-bump { 0% { color: var(--tx); } 25% { color: var(--ok); text-shadow: 0 0 18px rgba(52, 209, 127, .55); } 100% { color: inherit; text-shadow: none; } }

/* Fluxo de caixa */
.fin-proj-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px 0; margin-top: 6px; border-top: 1px dashed var(--line-2); }
.fin-proj-head > div:first-child { display: grid; gap: 1px; }
.fin-proj-head b { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 500; }
.fin-proj-head b svg { width: 15px; height: 15px; color: var(--tx-3); }
.fin-proj-head span.muted { font-size: var(--fs-2xs); }
.fin-foot { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.fin-foot > div { padding: 12px 20px; display: grid; gap: 2px; font-size: var(--fs-xs); min-width: 0; }
.fin-foot > div + div { border-left: 1px solid var(--line); }
.fin-foot b { font-size: var(--fs-md); font-weight: 600; white-space: nowrap; }
.fin-foot b small { font-size: var(--fs-2xs); font-weight: 400; }

/* Contas bancárias */
.fin-banks { padding: 14px 20px 6px; display: grid; gap: 16px; }
.fin-bank { display: flex; gap: 12px; align-items: center; }
.fin-bank__logo {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: -.02em; color: #fff; text-transform: lowercase;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 100%, #fff 10%), color-mix(in srgb, var(--c) 70%, #000 30%));
  box-shadow: 0 8px 20px -10px var(--c), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.fin-bank__logo svg { width: 18px; height: 18px; }
.fin-bank__main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.fin-bank__top { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); }
.fin-bank__top b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-bank__top span { font-weight: 600; white-space: nowrap; }
.fin-bank small { font-size: var(--fs-2xs); }
.fin-bank .bar-thin i { transition: width var(--t-slow) var(--ease); }
.fin-banks-tot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 12px 20px 0; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: var(--fs-xs); }
.fin-banks-tot b { font-size: var(--fs-lg); font-weight: 600; }
.fin-note { display: flex; gap: 10px; align-items: flex-start; margin: 14px 20px 20px; padding: 10px 12px; border-radius: var(--r-md); background: var(--ok-soft); border: 1px solid rgba(52, 209, 127, .2); font-size: var(--fs-xs); color: var(--tx-2); }
.fin-note svg { width: 16px; height: 16px; color: var(--ok); flex: none; margin-top: 1px; }
.fin-spin { animation: spin .8s linear infinite; }

/* Abas de contas */
.fin-tabs-head { padding: 6px 12px 0; }
.fin-tabs-head .tabs button { display: inline-flex; align-items: center; gap: 8px; }
.fin-tabs-head .tabs button svg { width: 15px; height: 15px; }
.fin-swap { animation: rise .45s var(--ease) both; }
.fin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px 6px; }
.fin-filt button svg { width: 14px; height: 14px; }
.fin-filt .fin-chip-vencido svg { color: var(--crit); }
.fin-filt .fin-chip-hoje svg { color: var(--warn); }
.fin-filt .fin-chip-pago svg { color: var(--ok); }
.fin-chip-n { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--r-pill); background: var(--s4); font-size: 10.5px; font-weight: 600; color: var(--tx-2); }
.fin-search { width: min(320px, 100%); }
.fin-tbl { min-width: 980px; }
.fin-tbl td { padding-top: 11px; padding-bottom: 11px; }
.fin-tbl th:first-child, .fin-tbl td:first-child { padding-left: 20px; }
.fin-tbl th:last-child, .fin-tbl td:last-child { padding-right: 20px; }
.fin-tbl .os-id, .fin-tbl td.r .num, .fin-tbl td.r > b { white-space: nowrap; }
.fin-parc { color: var(--tx-2); font-family: var(--mono); font-size: 12.5px; }
.fin-tag { height: 20px; font-size: 10px; padding: 0 8px; margin-left: 6px; vertical-align: 1px; }
.fin-tag svg { width: 11px; height: 11px; }
.fin-row-new td { background: linear-gradient(90deg, rgba(225, 6, 0, .1), rgba(225, 6, 0, .02) 60%, transparent); }
.fin-row-new td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.fin-forma { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-xs); color: var(--tx-2); white-space: nowrap; }
.fin-forma svg { width: 15px; height: 15px; color: var(--tx-3); }
.fin-sit { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; max-width: 230px; }
.fin-sit small { flex-basis: 100%; font-size: var(--fs-2xs); }
.fin-when { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--ok); white-space: nowrap; }
.fin-when svg { width: 14px; height: 14px; }
.fin-act { min-width: 98px; }
.fin-part { display: grid; gap: 3px; justify-items: end; margin-top: 4px; }
.fin-part__bar { width: 120px; height: 4px; border-radius: 4px; background: var(--s4); overflow: hidden; }
.fin-part__bar i { display: block; height: 100%; width: var(--w); background: var(--info); border-radius: 4px; transform-origin: left; animation: grow-x .9s var(--ease) both; }
.fin-part small { font-size: 10.5px; color: var(--tx-3); white-space: nowrap; }
.fin-forn { display: flex; gap: 10px; align-items: flex-start; min-width: 240px; }
.fin-forn__ic { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--tx-2); background: var(--s3); border: 1px solid var(--line-2); }
.fin-forn b { font-weight: 500; display: block; }
.fin-forn small { color: var(--tx-3); font-size: var(--fs-2xs); display: block; }
.fin-flash td { animation: fin-flash 1.8s var(--ease); }
@keyframes fin-flash { 0% { background: rgba(52, 209, 127, .28); } 100% { background: transparent; } }
.fin-tfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 12px 20px 16px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--tx-3); }
.fin-tfoot span { display: inline-flex; align-items: center; gap: 6px; }
.fin-tfoot b { color: var(--tx); font-weight: 600; }
.fin-tfoot svg { width: 14px; height: 14px; }
.fin-tfoot__hint { margin-left: auto; }

/* Fluxo por categoria */
.fin-cat-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px 20px 6px; }
.fin-cat-sum > div { padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--line); display: grid; gap: 2px; font-size: var(--fs-xs); }
.fin-cat-sum b { font-size: var(--fs-lg); font-weight: 600; }
.fin-cat-tbl { min-width: 820px; }
.fin-cat-h td { padding-top: 18px; border-bottom-color: var(--line-2); }
.fin-cat-h__t { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-2xs); letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.fin-cat-h__t svg { width: 15px; height: 15px; }
.fin-cat { display: flex; gap: 10px; align-items: center; }
.fin-cat b { font-weight: 500; }
.fin-cat small { font-size: var(--fs-2xs); }
.fin-cat__ic { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--s3); color: var(--tx-2); }
.fin-cat__ic svg { width: 15px; height: 15px; }
.fin-cat-bar { width: 160px; height: 6px; border-radius: 6px; background: var(--s4); overflow: hidden; margin-bottom: 3px; }
.fin-cat-bar i { display: block; height: 100%; width: var(--w); border-radius: 6px; background: var(--grad-red); transform-origin: left; animation: grow-x 1s var(--ease) both; animation-delay: calc(var(--d) + 150ms); }
.fin-cat-bar i.ok { background: var(--ok); }
.fin-cat-tbl td small.muted { font-size: 10.5px; }
.fin-cat-t td { font-weight: 600; font-size: var(--fs-sm); background: rgba(255, 255, 255, .02); }

/* Despesas por categoria */
.fin-donut-wrap { display: flex; align-items: center; gap: 20px; padding: 16px 20px 8px; flex-wrap: wrap; }
.fin-donut-wrap .donut-c b { font-size: var(--fs-xl); line-height: 1.1; }
.fin-donut-wrap .donut-c small { max-width: 70px; line-height: 1.2; }
.fin-leg { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; flex: 1; min-width: 220px; font-size: var(--fs-xs); }
.fin-leg li { display: grid; grid-template-columns: 10px 1fr auto 44px; align-items: center; gap: 8px; color: var(--tx-2); animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 50ms + 300ms); }
.fin-leg i { width: 9px; height: 9px; border-radius: 3px; }
.fin-leg b { font-weight: 500; color: var(--tx); text-align: right; }
.fin-leg small { color: var(--tx-4); text-align: right; font-size: var(--fs-2xs); }
.fin-insight { display: flex; gap: 10px; margin: 8px 20px 20px; padding: 12px 14px; border-radius: var(--r-md); background: linear-gradient(90deg, rgba(225, 6, 0, .12), rgba(225, 6, 0, .02)); border: 1px solid rgba(255, 60, 40, .22); font-size: var(--fs-xs); color: var(--tx-2); line-height: 1.5; }
.fin-insight svg { width: 16px; height: 16px; color: var(--red-tx); flex: none; margin-top: 2px; }
.fin-insight b { color: var(--tx); font-weight: 600; }

/* Conciliação */
.fin-cc { padding: 14px 16px 4px; display: grid; gap: 10px; }
.fin-cc__row {
  position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 8px 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--bg-2); border: 1px solid var(--line); transition: background var(--t-med), border-color var(--t-med), opacity var(--t-med), transform var(--t-med) var(--ease);
}
.fin-cc__ext { grid-column: 1 / -1; display: grid; gap: 2px; min-width: 0; padding-bottom: 8px; border-bottom: 1px dashed var(--line-2); }
.fin-cc__ext > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.fin-cc__sis { display: grid; gap: 1px; min-width: 0; }
.fin-cc__ext small, .fin-cc__sis small { font-size: 10.5px; color: var(--tx-4); display: inline-flex; align-items: center; gap: 5px; }
.fin-cc__ext small svg { width: 11px; height: 11px; }
.fin-cc__sis small svg { width: 11px; height: 11px; color: var(--red-tx); }
.fin-cc__ext b { font-size: 11px; font-weight: 500; color: var(--tx-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fin-cc__ext span { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.fin-cc__sis b { font-size: var(--fs-xs); font-weight: 500; line-height: 1.35; }
.fin-cc__sis span { font-size: 10.5px; }
.fin-cc__link { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--s3); color: var(--tx-3); border: 1px dashed var(--line-3); transition: all var(--t-med) var(--ease); }
.fin-cc__link svg { width: 13px; height: 13px; }
.fin-cc__ok { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #06240F; transform: scale(0); transition: transform .45s var(--ease); box-shadow: 0 0 0 3px var(--s1); }
.fin-cc__ok svg { width: 13px; height: 13px; stroke-width: 3; }
.fin-cc__row.linking .fin-cc__link { background: var(--red); color: #fff; border-style: solid; border-color: var(--red-hot); box-shadow: 0 0 0 5px rgba(225, 6, 0, .2); transform: rotate(-45deg) scale(1.1); }
.fin-cc__row.linking::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background-image: linear-gradient(90deg, var(--red-tx) 0 7px, transparent 7px 12px); background-size: 12px 2px; animation: fin-sew .45s linear both; transform-origin: left; }
@keyframes fin-sew { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.fin-cc__row.done { background: var(--ok-soft); border-color: rgba(52, 209, 127, .3); }
.fin-cc__row.done::after { background-image: linear-gradient(90deg, var(--ok) 0 7px, transparent 7px 12px); }
.fin-cc__row.done .fin-cc__link { background: var(--ok); border-color: var(--ok); color: #06240F; transform: none; box-shadow: none; }
.fin-cc__row.done .fin-cc__ok { transform: scale(1); }
.fin-cc__row.out { opacity: 0; transform: translateX(24px) scale(.97); transition-delay: calc(var(--k) * 70ms); }
.fin-cc-foot { padding: 12px 16px 18px; display: grid; gap: 8px; }
.fin-cc-foot small { font-size: var(--fs-2xs); text-align: center; }
.fin-cc-done { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 16px 12px 22px; animation: rise .6s var(--ease) both; }
.fin-cc-done b { font-weight: 500; font-size: var(--fs-md); }
.fin-cc-done small { font-size: var(--fs-xs); max-width: 32ch; }
.fin-check { width: 92px; height: 92px; margin-bottom: 8px; }
.fin-check .c1 { fill: none; stroke: var(--ok); stroke-width: 2.5; stroke-dasharray: 7 6; transform-origin: center; animation: spin 14s linear infinite; opacity: .6; }
.fin-check .c2 { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 2; stroke-dasharray: 220; stroke-dashoffset: 220; animation: fin-dash .8s var(--ease) forwards; }
.fin-check .ck { fill: none; stroke: var(--ok); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: fin-dash .5s var(--ease) .55s forwards; }
@keyframes fin-dash { to { stroke-dashoffset: 0; } }

/* Vencidos por atraso */
.fin-age { padding: 14px 20px 6px; display: grid; gap: 14px; }
.fin-age__row { display: grid; gap: 5px; }
.fin-age__top { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); color: var(--tx-2); }
.fin-age__top b { font-weight: 600; color: var(--tx); font-size: var(--fs-sm); }
.fin-age__bar { height: 6px; border-radius: 6px; background: var(--s4); overflow: hidden; }
.fin-age__bar i { display: block; height: 100%; width: var(--w); border-radius: 6px; transform-origin: left; animation: grow-x 1s var(--ease) both; animation-delay: calc(var(--d) + 300ms); transition: width var(--t-slow) var(--ease); }
.fin-age__bar i.warn { background: var(--warn); }
.fin-age__bar i.crit { background: repeating-linear-gradient(135deg, var(--crit) 0 6px, color-mix(in srgb, var(--crit) 80%, #000) 6px 12px); }
.fin-age__row small { font-size: var(--fs-2xs); line-height: 1.35; }
.fin-age-foot { padding: 10px 20px 20px; }
.fin-age-foot .btn { width: 100%; }

/* Modais */
.modal.fin-modal { width: min(600px, calc(100vw - 32px)); }
.fin-modal .modal__head h3 { font-size: var(--fs-lg); }
.fin-msum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.fin-msum > div { padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--line); display: grid; gap: 2px; min-width: 0; }
.fin-msum small { font-size: var(--fs-2xs); }
.fin-msum b { font-size: var(--fs-md); font-weight: 600; white-space: nowrap; }
.fin-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.fin-form > div { min-width: 0; }
.fin-span2 { grid-column: 1 / -1; }
.fin-form .input-icon .input, .fin-full, .fin-select { width: 100%; }
.fin-form .segmented { display: flex; width: 100%; }
.fin-form .segmented button { flex: 1; padding: 0 8px; }
.fin-money { position: relative; }
.fin-money span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: var(--fs-md); color: var(--tx-3); font-weight: 500; pointer-events: none; }
.fin-money .input { width: 100%; height: 52px; padding-left: 46px; font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.01em; }
.fin-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fin-prev { margin-top: 18px; }
.fin-prev__bar { position: relative; height: 10px; border-radius: 10px; background: var(--s4); overflow: hidden; }
.fin-prev__bar i { position: absolute; top: 0; bottom: 0; left: 0; }
.fin-prev__bar i.old { width: var(--w); background: var(--info); }
.fin-prev__bar i.new { background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 70%, #fff)); box-shadow: 0 0 14px rgba(52, 209, 127, .6); transition: width var(--t-med) var(--ease), left var(--t-med) var(--ease); }
.fin-prev__leg { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: var(--fs-2xs); color: var(--tx-3); }
.fin-prev__leg span { display: inline-flex; align-items: center; gap: 6px; }
.fin-prev__leg i { width: 9px; height: 9px; border-radius: 3px; background: var(--s4); }
.fin-prev__leg i.old { background: var(--info); } .fin-prev__leg i.new { background: var(--ok); }
.fin-malert { margin: 16px 0 0; }
.fin-malert b.num { font-weight: 600; color: var(--tx); }
.fin-audit { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-2xs); }
.fin-audit svg { width: 14px; height: 14px; }
.fin-parcs { display: grid; gap: 6px; margin-top: 18px; }
.fin-parcs__i { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line); font-size: var(--fs-sm); animation: rise .4s var(--ease) both; animation-delay: calc(var(--i) * 50ms); }
.fin-parcs__i .mono { color: var(--tx-3); font-size: 12px; }
.fin-parcs__i b { font-weight: 600; }

/* ---------- Responsivo ---------- */
@media (max-width: 1380px) {
  .fin-foot { grid-template-columns: repeat(2, 1fr); }
  .fin-foot > div:nth-child(3) { border-left: 0; }
  .fin-foot > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .fin-cat-sum { grid-template-columns: 1fr 1fr; }
  .fin-tfoot__hint { display: none; }
  .fin-search { width: 100%; }
  .fin-toolbar { padding-inline: 16px; }
  .fin-filt { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .fin-filt button { flex: none; }
}
@media (max-width: 560px) {
  .fin-msum { gap: 6px; margin-bottom: 14px; }
  .fin-msum > div { padding: 8px 10px; }
  .fin-msum b { font-size: var(--fs-xs); }
  .fin-modal .fin-audit { display: none; }
  .fin-modal .modal__foot .btn { flex: 1; padding: 0 10px; }
  .fin-modal .modal__foot .spacer { display: none; }
  .fin-modal .modal__body { padding: 18px 16px; }
  .fin-modal .modal__head { padding: 16px; }
  .fin-modal .modal__foot { padding: 12px 16px; }
  .fin-modal .segmented button { padding: 0 4px; font-size: 11px; }
  .fin-form { grid-template-columns: 1fr; }
  .fin-proj-head .legend { flex-wrap: wrap; }
  .fin-leg { min-width: 0; width: 100%; }
  .fin-donut-wrap { justify-content: center; }
}
.fin-grid .card-head { flex-wrap: wrap; }
