/* FinanceiroVF — componentes (CSS puro, sem build).
   Carregar DEPOIS de tokens.css. Todas as classes com prefixo fv-.
   Fonte: IBM Plex Sans / IBM Plex Mono (Google Fonts); cai para as fontes do sistema. */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

/* ---------- base ---------- */
.fv, .fv-app { font-family: var(--font-sans); font-size: 13px; line-height: 20px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
.fv *, .fv-app * { box-sizing: border-box; }
.fv :focus-visible, .fv-app :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.fv a, .fv-app a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.fv h1, .fv h2, .fv h3, .fv p, .fv-app h1, .fv-app h2, .fv-app h3, .fv-app p { margin: 0; }
.fv-muted { color: var(--ink-muted); }
.fv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fv [data-lucide], .fv-app [data-lucide], .fv svg.lucide, .fv-app svg.lucide { width: 16px; height: 16px; stroke-width: 1.75; flex: none; }

/* ---------- números ---------- */
.fv-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.fv-neg { color: var(--danger); }
.fv-pos { color: var(--positive); }
.fv-cap { color: var(--capital); }
.fv-delta { font-family: var(--font-mono); font-size: 11px; line-height: 16px; white-space: nowrap; color: var(--ink-muted); }
.fv-delta.is-up::before { content: "▲ "; font-size: 9px; }
.fv-delta.is-down::before { content: "▼ "; font-size: 9px; }
.fv-delta.is-good { color: var(--positive); }
.fv-delta.is-bad { color: var(--danger); }

/* ---------- layout do app ---------- */
.fv-app { display: grid; grid-template-columns: var(--size-sidebar) 1fr; grid-template-rows: var(--size-topbar) 1fr; min-height: 100vh; }
.fv-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.fv-brand { display: flex; align-items: center; gap: 8px; width: calc(var(--size-sidebar) - 16px); font-weight: 600; font-size: 14px; }
.fv-brand b { font-family: var(--font-mono); font-weight: 600; font-size: 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 5px; }
.fv-side { background: var(--surface); border-right: 1px solid var(--border); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.fv-side h4 { margin: 14px 8px 4px; font-size: 11px; line-height: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); font-weight: 600; }
.fv-nav { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border-radius: var(--radius-md); color: var(--ink-muted); text-decoration: none !important; font-weight: 500; }
.fv-nav:hover { background: var(--surface-3); color: var(--ink); }
.fv-nav.is-active { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border); }
.fv-nav .fv-count { margin-left: auto; }
.fv-main { padding: 20px 24px 40px; min-width: 0; }
.fv-page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.fv-page-head h1 { font-size: 20px; line-height: 28px; font-weight: 600; }
.fv-page-head .fv-sub { color: var(--ink-muted); }
.fv-page-head .fv-actions { margin-left: auto; display: flex; gap: 8px; }
.fv-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.fv-col-3 { grid-column: span 3; } .fv-col-4 { grid-column: span 4; } .fv-col-5 { grid-column: span 5; } .fv-col-6 { grid-column: span 6; } .fv-col-7 { grid-column: span 7; } .fv-col-8 { grid-column: span 8; } .fv-col-12 { grid-column: 1 / -1; }
.fv-row { display: flex; align-items: center; gap: 8px; }
.fv-stack { display: flex; flex-direction: column; gap: 12px; }
.fv-spacer { flex: 1; }

/* ---------- cartão ---------- */
.fv-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); min-width: 0; }
.fv-card-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.fv-card-head h2, .fv-card-head h3 { font-size: 14px; line-height: 20px; font-weight: 600; }
.fv-card-head .fv-spacer + * { margin-left: 0; }
.fv-card-body { padding: 12px; }
.fv-card-foot { padding: 8px 12px; border-top: 1px solid var(--border); color: var(--ink-muted); font-size: 12px; display: flex; gap: 8px; align-items: center; }

/* ---------- cartão de número ---------- */
.fv-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fv-stat__label { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); display: flex; align-items: center; gap: 6px; }
.fv-stat__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 22px; line-height: 28px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.fv-stat__foot { display: flex; align-items: baseline; gap: 8px; }
.fv-stat__note { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.fv-stat--hero { background: var(--surface-2); border-color: var(--border-strong); }
.fv-stat--hero .fv-stat__value { font-size: 34px; line-height: 40px; letter-spacing: -.02em; }
.fv-stat--neg .fv-stat__value { color: var(--danger); }
.fv-stat--capital { background: var(--capital-soft); border-style: dashed; border-color: var(--capital); }

/* ---------- chips e semáforo ---------- */
.fv-chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: var(--radius-sm); font-size: 11px; line-height: 16px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--ink-muted); border: 1px solid transparent; }
.fv-chip svg, .fv-chip [data-lucide] { width: 12px !important; height: 12px !important; stroke-width: 2.25 !important; }
.fv-chip--ok { background: var(--positive-soft); color: var(--positive); }
.fv-chip--warn { background: var(--warning-soft); color: var(--warning); }
.fv-chip--err { background: var(--danger-soft); color: var(--danger); }
.fv-chip--scope { background: var(--scope-soft); color: var(--scope); }
.fv-chip--capital { background: var(--capital-soft); color: var(--capital); }
.fv-chip--line { background: transparent; border-color: var(--border-strong); color: var(--ink-muted); }
.fv-light { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.fv-light::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); }
.fv-light--ok::before { background: var(--positive); } .fv-light--ok { color: var(--positive); }
.fv-light--warn::before { background: var(--warning); border-radius: 1px; transform: rotate(45deg); } .fv-light--warn { color: var(--warning); }
.fv-light--err::before { background: var(--danger); border-radius: 1px; } .fv-light--err { color: var(--danger); }
.fv-light--off::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-muted); } .fv-light--off { color: var(--ink-muted); }
.fv-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: var(--bg); font: 600 11px/1 var(--font-mono); }
.fv-kbd { font: 500 11px/16px var(--font-mono); padding: 0 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--radius-sm); color: var(--ink-muted); background: var(--surface-2); }

/* ---------- botões e campos ---------- */
.fv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--size-control); padding: 0 12px; border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--ink); font: 500 13px/1 var(--font-sans); cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.fv-btn:hover { background: var(--surface-3); }
.fv-btn--primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); font-weight: 600; }
.fv-btn--primary:hover { background: var(--primary); opacity: .9; }
.fv-btn--ghost { background: transparent; border-color: transparent; color: var(--ink-muted); }
.fv-btn--ghost:hover { color: var(--ink); }
.fv-btn--danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.fv-btn--sm { height: 26px; padding: 0 8px; font-size: 12px; }
.fv-btn--touch { height: var(--size-touch); padding: 0 16px; font-size: 15px; }
.fv-btn[disabled], .fv-btn.is-disabled { opacity: .45; cursor: not-allowed; }
.fv-icon-btn { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-md); border: 1px solid transparent; background: transparent; color: var(--ink-muted); cursor: pointer; }
.fv-icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.fv-icon-btn .fv-count { position: absolute; top: -3px; right: -5px; }
.fv-field { display: flex; flex-direction: column; gap: 4px; }
.fv-field > span { font-size: 12px; color: var(--ink-muted); font-weight: 500; }
.fv-input, .fv-select { height: var(--size-control); padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--ink); font: 400 13px var(--font-sans); width: 100%; }
.fv-input.fv-num { font-family: var(--font-mono); }
.fv-hint { font-size: 12px; color: var(--ink-muted); }
.fv-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-md); overflow: hidden; }
.fv-seg > * { height: 28px; padding: 0 10px; display: inline-flex; align-items: center; gap: 4px; background: transparent; border: 0; color: var(--ink-muted); font: 500 12px var(--font-sans); cursor: pointer; }
.fv-seg > * + * { border-left: 1px solid var(--border-strong); }
.fv-seg > .is-on { background: var(--surface-3); color: var(--ink); }

/* ---------- barra global: recorte, busca, lançar, sino ---------- */
.fv-scope { display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--scope); border-radius: var(--radius-md); background: var(--scope-soft); color: var(--ink); font-weight: 500; white-space: nowrap; }
.fv-scope > * { display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 10px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.fv-scope > * + * { border-left: 1px solid var(--scope); }
.fv-scope .fv-scope__k { color: var(--scope); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.fv-scope .fv-scope__sep { color: var(--scope); padding: 0 2px; }
.fv-scope .fv-scope__month { font-family: var(--font-mono); gap: 10px; }
.fv-scope .fv-scope__arrow { color: var(--scope); padding: 0 8px; }
.fv-search { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; flex: 1; max-width: 420px; border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--ink-muted); }
.fv-search input { flex: 1; background: none; border: 0; color: var(--ink); font: inherit; outline: none; min-width: 0; }
.fv-launch { position: relative; }
.fv-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay); padding: 4px; z-index: 40; }
.fv-menu a, .fv-menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: var(--radius-sm); background: none; border: 0; color: var(--ink); font: 400 13px var(--font-sans); text-align: left; text-decoration: none !important; cursor: pointer; }
.fv-menu a:hover, .fv-menu button:hover, .fv-menu .is-hover { background: var(--surface-3); }
.fv-menu .fv-kbd { margin-left: auto; }
.fv-lens { display: flex; align-items: center; gap: 8px; padding: 6px 12px; margin: -20px -24px 16px; background: var(--scope-soft); border-bottom: 1px solid var(--scope); font-size: 12px; }
.fv-lens b { color: var(--scope); font-weight: 600; }

/* ---------- abas ---------- */
.fv-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.fv-tabs > * { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; color: var(--ink-muted); font-weight: 500; text-decoration: none !important; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit; font-size: 13px; cursor: pointer; }
.fv-tabs > .is-active { color: var(--ink); border-bottom-color: var(--ink); }
.fv-tabs .fv-chip { height: 18px; }

/* ---------- tabela densa ---------- */
.fv-table-wrap { overflow: auto; border-radius: var(--radius-md); }
.fv-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.fv-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--ink-muted); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.fv-table td { padding: 6px 8px; height: var(--size-row); border-bottom: 1px solid var(--border); vertical-align: middle; }
.fv-table th.fv-num, .fv-table td.fv-num { text-align: right; }
.fv-table tbody tr:hover td { background: var(--surface-3); }
.fv-table tr.is-selected td { background: var(--surface-2); }
.fv-table tr.is-focus td { background: var(--surface-2); box-shadow: inset 0 1px 0 var(--focus), inset 0 -1px 0 var(--focus); }
.fv-table tr.is-focus td:first-child { box-shadow: inset 2px 0 0 var(--focus), inset 0 1px 0 var(--focus), inset 0 -1px 0 var(--focus); }
.fv-table tr.is-neutral td { color: var(--ink-muted); }
.fv-table tr.is-reversed td { color: var(--ink-muted); text-decoration: line-through; text-decoration-color: var(--ink-faint); }
.fv-table tr.is-reversed td .fv-chip { text-decoration: none; }
.fv-table tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--border-strong); border-bottom: 0; }
.fv-table .fv-group td { background: var(--bg); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); height: 28px; }
.fv-table .fv-sub td:first-child { padding-left: 24px; }
.fv-table .fv-strong td { font-weight: 600; }
.fv-table input[type=checkbox] { accent-color: var(--ink); width: 14px; height: 14px; }
.fv-cell-sub { display: block; font-size: 11px; line-height: 14px; color: var(--ink-muted); }
.fv-conf { display: inline-flex; gap: 2px; vertical-align: middle; }
.fv-conf i { width: 4px; height: 10px; border-radius: 1px; background: var(--surface-3); }
.fv-conf--strong i { background: var(--positive); }
.fv-conf--weak i:first-child { background: var(--warning); }
.fv-conf--none i { background: transparent; box-shadow: inset 0 0 0 1px var(--ink-faint); }

/* ---------- faixa de capital ---------- */
.fv-capital { border: 1px dashed var(--capital); background: var(--capital-soft); border-radius: var(--radius-md); padding: 10px 12px; display: flex; align-items: center; gap: 12px; }
.fv-capital__tag { display: inline-flex; align-items: center; gap: 6px; color: var(--capital); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.fv-capital__tag::before { content: ""; width: 10px; height: 10px; border: 2px solid var(--capital); border-radius: 2px; background: repeating-linear-gradient(135deg, var(--capital) 0 1.5px, transparent 1.5px 4px); }
.fv-table tr.is-capital td { background: var(--capital-soft); }
.fv-table tr.is-capital td:first-child { box-shadow: inset 3px 0 0 var(--capital); }

/* ---------- barras de consumo / progresso ---------- */
.fv-meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.fv-meter > i { display: block; height: 100%; background: var(--ink-muted); border-radius: 3px; }
.fv-meter--ok > i { background: var(--positive); } .fv-meter--warn > i { background: var(--warning); } .fv-meter--err > i { background: var(--danger); }

/* ---------- linha "atenção" ---------- */
.fv-alert-list { display: flex; flex-direction: column; }
.fv-alert { display: grid; grid-template-columns: 20px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.fv-alert:last-child { border-bottom: 0; }
.fv-alert__icon { color: var(--ink-muted); display: grid; place-items: center; }
.fv-alert--err .fv-alert__icon { color: var(--danger); } .fv-alert--warn .fv-alert__icon { color: var(--warning); } .fv-alert--ok .fv-alert__icon { color: var(--positive); }
.fv-alert__title { font-weight: 500; }
.fv-alert__meta { font-size: 12px; color: var(--ink-muted); }

/* ---------- matriz de intensidade ---------- */
.fv-heat { border-collapse: separate; border-spacing: 3px; width: 100%; }
.fv-heat th { font-size: 11px; font-weight: 600; color: var(--ink-muted); text-align: left; padding: 0 8px 0 0; white-space: nowrap; }
.fv-heat thead th { text-align: center; letter-spacing: .06em; text-transform: uppercase; }
.fv-heat td { height: 34px; border-radius: var(--radius-sm); text-align: center; font: 400 11px/1 var(--font-mono); color: var(--ink); cursor: pointer; position: relative; }
.fv-heat td:hover { outline: 2px solid var(--focus); outline-offset: -2px; }
.fv-heat .h0 { background: var(--heat-0); box-shadow: inset 0 0 0 1px var(--border); color: var(--ink-muted); }
.fv-heat .h1 { background: var(--heat-1); } .fv-heat .h2 { background: var(--heat-2); } .fv-heat .h3 { background: var(--heat-3); }
.fv-heat .h4 { background: var(--heat-4); } .fv-heat .h5 { background: var(--heat-5); color: var(--bg); font-weight: 600; }
[data-theme="light"] .fv-heat .h4, [data-theme="light"] .fv-heat .h5 { color: var(--on-primary); }
.fv-heat td.is-late::after { content: "!"; position: absolute; top: 2px; right: 4px; color: var(--danger); font-weight: 700; }
.fv-heat-legend { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--ink-muted); }
.fv-heat-legend i { width: 14px; height: 10px; border-radius: 2px; }

/* ---------- gaveta lateral (desktop) e folha inferior (celular) ---------- */
.fv-scrim { position: absolute; inset: 0; background: #01040999; z-index: 30; }
[data-theme="light"] .fv-scrim { background: #1f232840; }
.fv-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: var(--size-drawer); max-width: 100%; background: var(--surface-2); border-left: 1px solid var(--border-strong); box-shadow: var(--shadow-overlay); z-index: 31; display: flex; flex-direction: column; }
.fv-drawer--inline { position: relative; box-shadow: none; border: 1px solid var(--border-strong); border-radius: var(--radius-md); }
.fv-drawer__head { display: flex; align-items: flex-start; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.fv-drawer__body { padding: 14px 16px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 16px; }
.fv-drawer__foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.fv-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface-2); border-top: 1px solid var(--border-strong); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-overlay); z-index: 31; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
.fv-sheet::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 0 auto 12px; }
.fv-legs { width: 100%; border-collapse: collapse; font-size: 12px; }
.fv-legs td { padding: 5px 0; border-bottom: 1px dashed var(--border); }
.fv-legs td.fv-num { font-family: var(--font-mono); }
.fv-dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 12px; }
.fv-dl dt { color: var(--ink-muted); }
.fv-dl dd { margin: 0; }
.fv-trail { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--border-strong); display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.fv-trail li { position: relative; }
.fv-trail li::before { content: ""; position: absolute; left: -18px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--ink-muted); }
.fv-section-label { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 6px; }

/* ---------- paleta de comandos ---------- */
.fv-cmdk { width: 600px; max-width: 100%; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay); overflow: hidden; }
.fv-cmdk__input { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 48px; border-bottom: 1px solid var(--border); font-size: 15px; }
.fv-cmdk__input input { flex: 1; background: none; border: 0; outline: none; color: var(--ink); font: inherit; }
.fv-cmdk__group { padding: 6px; }
.fv-cmdk__group + .fv-cmdk__group { border-top: 1px solid var(--border); }
.fv-cmdk__label { padding: 4px 8px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.fv-cmdk__item { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 10px; height: 36px; padding: 0 8px; border-radius: var(--radius-sm); }
.fv-cmdk__item.is-hover { background: var(--surface-3); }
.fv-cmdk__foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--ink-muted); }

/* ---------- estados: vazio, carregando, erro ---------- */
.fv-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 32px 16px; color: var(--ink-muted); }
.fv-empty__icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px dashed var(--border-strong); color: var(--ink-muted); }
.fv-empty h3 { color: var(--ink); font-size: 14px; font-weight: 600; }
.fv-empty p { max-width: 360px; }
.fv-skel { display: block; height: 12px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: fv-shimmer 1.4s linear infinite; }
@keyframes fv-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .fv-skel { animation: none; } }
.fv-error { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--danger); background: var(--danger-soft); border-radius: var(--radius-md); }
.fv-error__icon { color: var(--danger); padding-top: 2px; }
.fv-error h3 { font-size: 14px; font-weight: 600; color: var(--ink); }
.fv-error p { color: var(--ink); }
.fv-error .fv-row { margin-top: 8px; }

/* ---------- checklist de fechamento ---------- */
.fv-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.fv-step { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.fv-step__n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--font-mono); box-shadow: inset 0 0 0 1.5px var(--ink-muted); color: var(--ink-muted); }
.fv-step.is-done .fv-step__n { background: var(--positive); box-shadow: none; color: var(--bg); }
.fv-step.is-block .fv-step__n { box-shadow: inset 0 0 0 1.5px var(--danger); color: var(--danger); }
.fv-step.is-warn .fv-step__n { box-shadow: inset 0 0 0 1.5px var(--warning); color: var(--warning); }

/* ---------- celular ---------- */
.fv-phone { width: 390px; height: 844px; position: relative; overflow: hidden; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 36px; font-size: 15px; line-height: 22px; }
.fv-phone__status { height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; font: 600 14px var(--font-sans); }
.fv-mtop { display: flex; align-items: center; gap: 8px; padding: 4px 16px 10px; }
.fv-mtop .fv-scope { height: 36px; font-size: 13px; flex: 1; min-width: 0; }
.fv-mtop .fv-scope > * { padding: 0 8px; }
.fv-mtop .fv-icon-btn { width: 44px; height: 44px; }
.fv-mbody { padding: 0 16px 100px; display: flex; flex-direction: column; gap: 12px; }
.fv-tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: 84px; padding: 6px 8px 28px; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--border); z-index: 25; }
.fv-tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; font-size: 11px; font-weight: 500; color: var(--ink-muted); text-decoration: none !important; position: relative; }
.fv-tabbar a.is-active { color: var(--ink); }
.fv-tabbar a [data-lucide], .fv-tabbar a svg { width: 22px !important; height: 22px !important; }
.fv-tabbar .fv-plus { align-self: center; justify-self: center; width: 52px; height: 52px; border-radius: 26px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; border: 0; }
.fv-tabbar .fv-count { position: absolute; top: 2px; left: calc(50% + 4px); }
.fv-mrow { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.fv-mrow:last-child { border-bottom: 0; }

/* ---------- impressão (relatório) ---------- */
.fv-print { background: #ffffff; color: #1f2328; font-family: var(--font-sans); font-size: 10.5pt; line-height: 1.45; width: 794px; min-height: 1123px; padding: 56px 60px; box-sizing: border-box; }
.fv-print h1 { font-size: 18pt; line-height: 1.2; margin: 0; font-weight: 600; }
.fv-print .fv-print__meta { display: flex; justify-content: space-between; border-bottom: 2px solid #1f2328; padding-bottom: 10px; margin-bottom: 18px; font-size: 9pt; color: #59636e; }
.fv-print table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.fv-print th { text-align: left; font-size: 8pt; letter-spacing: .06em; text-transform: uppercase; color: #59636e; border-bottom: 1px solid #1f2328; padding: 5px 4px; }
.fv-print td { padding: 4px; border-bottom: 1px solid #d0d7de; }
.fv-print .fv-num { font-family: var(--font-mono); }
.fv-print .fv-neg { color: #cf222e; }
.fv-print .fv-print__total td { font-weight: 600; border-top: 1px solid #1f2328; border-bottom: 2px solid #1f2328; }
.fv-print .fv-print__cap td { background: #0969da12; }
.fv-print footer { margin-top: 28px; padding-top: 8px; border-top: 1px solid #d0d7de; font-size: 8pt; color: #59636e; display: flex; justify-content: space-between; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #ffffff !important; }
  .fv-top, .fv-side, .fv-tabbar, .fv-no-print { display: none !important; }
  .fv-print { width: auto; min-height: 0; padding: 0; }
  .fv-print tr { break-inside: avoid; }
}

/* ---------- responsivo (templates reais) ---------- */
@media (max-width: 760px) {
  .fv-app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .fv-side, .fv-brand, .fv-search input, .fv-launch .fv-btn span { display: none; }
  .fv-main { padding: 12px 16px 100px; }
  .fv-grid { grid-template-columns: 1fr; }
  .fv-grid > * { grid-column: 1 / -1 !important; }
  .fv-btn, .fv-icon-btn, .fv-tabs > * { min-height: var(--size-touch); }
  .fv-drawer { width: 100%; top: auto; height: 88vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-left: 0; border-top: 1px solid var(--border-strong); }
}

/* ---------- gráfico de fluxo (barras que descem abaixo de zero + linha de saldo) ---------- */
.fv-flow { display: block; font-family: var(--font-mono); }
.fv-flow .grid { stroke: var(--border); stroke-width: 1; }
.fv-flow .zero { stroke: var(--ink-muted); stroke-width: 1; }
.fv-flow .neg-zone { fill: var(--danger-soft); }
.fv-flow .ax { fill: var(--ink-muted); font-size: 10px; }
.fv-flow .ax-neg { fill: var(--danger); }
.fv-flow .bar-in { fill: var(--positive); cursor: pointer; }
.fv-flow .bar-out { fill: var(--flow-out); cursor: pointer; }
.fv-flow .bar-in:hover, .fv-flow .bar-out:hover { stroke: var(--focus); stroke-width: 1.5; }
.fv-flow .bal { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.fv-flow .dot { fill: var(--ink); }
.fv-flow .dot-neg { fill: var(--danger); stroke: var(--surface); stroke-width: 1.5; }
.fv-flow .mark { stroke: var(--danger); stroke-dasharray: 3 3; }
.fv-flow .ann-neg { fill: var(--danger); font-size: 10px; font-weight: 600; }
.fv-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-muted); flex-wrap: wrap; }
.fv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fv-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.fv-legend .l-in { background: var(--positive); } .fv-legend .l-out { background: var(--flow-out); }
.fv-legend .l-bal { height: 2px; width: 14px; background: var(--ink); } .fv-legend .l-neg { background: var(--danger-soft); box-shadow: inset 0 0 0 1px var(--danger); }
/* barras horizontais simples (categorias, comparação) */
.fv-hbar { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; }
.fv-hbar .fv-meter { grid-column: 1 / -1; }
.fv-scope button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; height: 100%; }
.fv-scope .fv-scope__arrow { font-size: 16px; }

/* ---------- complementos (pedidos durante o desenho das telas) ---------- */
[data-theme="light"] .fv-heat .h4 { color: var(--ink); }
.fv-heat-legend .h0 { background: var(--heat-0); box-shadow: inset 0 0 0 1px var(--border); } .fv-heat-legend .h1 { background: var(--heat-1); } .fv-heat-legend .h2 { background: var(--heat-2); } .fv-heat-legend .h3 { background: var(--heat-3); } .fv-heat-legend .h4 { background: var(--heat-4); } .fv-heat-legend .h5 { background: var(--heat-5); }
.fv-search { min-width: 0; }
.fv-drawer--inline { width: auto; }
textarea.fv-input { height: auto; min-height: 72px; padding: 8px 10px; line-height: 20px; resize: vertical; }
.fv-field.is-err .fv-input, .fv-field.is-err .fv-select { border-color: var(--danger); }
.fv-field.is-warn .fv-input { border-color: var(--warning); }
.fv-field__msg { font-size: 12px; display: flex; gap: 4px; align-items: center; }
.fv-field.is-err .fv-field__msg { color: var(--danger); } .fv-field.is-warn .fv-field__msg { color: var(--warning); }
.fv-icon-btn--touch { width: var(--size-touch); height: var(--size-touch); }
.fv-seg--touch > * { height: var(--size-touch); padding: 0 14px; font-size: 14px; }
.fv-table tr.is-total td { font-weight: 600; border-top: 1px solid var(--border-strong); background: var(--surface-2); }
.fv-table .fv-group.is-capital td { color: var(--capital); background: var(--capital-soft); }
.fv-table td.is-cur, .fv-table th.is-cur { background: var(--surface-2); }
.fv-table--compact td { padding: 4px 6px; height: 28px; font-size: 12px; }
.fv-table--compact th { padding: 6px; }
.fv-flow .bar-neg { fill: var(--danger); }
.fv-bulkbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay); }
.fv-bulkbar b { font-family: var(--font-mono); }
.fv-chip--planned { background: transparent; border: 1px dashed var(--border-strong); color: var(--ink-muted); }
.fv-legs thead td { color: var(--ink-muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.fv-legs tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--border-strong); }
.fv-trail li.is-current::before { background: var(--ink); box-shadow: none; }
.fv-cmdk mark { background: var(--warning-soft); color: var(--ink); border-radius: 2px; padding: 0 1px; }
/* marca VF: só identidade */
.fv-brand b { background: var(--vf-laranja); color: var(--vf-blue1); border-color: var(--vf-laranja); }
.fv-print .fv-print__meta { border-bottom-color: var(--vf-blue1); }
.fv-print h1 { color: var(--vf-blue1); }

/* ---------- recorte: seletor de 3 níveis, consolidado × lado a lado ---------- */
.fv-scope .fv-scope__mode { gap: 6px; font-weight: 600; }
.fv-scope .fv-scope__mode svg { color: var(--scope); }
.fv-scope-pop { position: absolute; z-index: 40; width: 760px; background: var(--surface-2); border: 1px solid var(--scope); border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay); overflow: hidden; }
.fv-scope-pop__cols { display: grid; grid-template-columns: 200px 1fr 1fr; }
.fv-scope-pop__col { padding: 10px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.fv-scope-pop__col:last-child { border-right: 0; }
.fv-scope-pop__col h5 { margin: 2px 6px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--scope); }
.fv-opt { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.fv-opt:hover { background: var(--surface-3); }
.fv-opt.is-on { background: var(--scope-soft); }
.fv-opt__box { width: 14px; height: 14px; border-radius: 3px; box-shadow: inset 0 0 0 1.5px var(--border-strong); display: grid; place-items: center; color: var(--on-primary); font-size: 10px; line-height: 1; }
.fv-opt__box.is-radio { border-radius: 50%; }
.fv-opt.is-on .fv-opt__box { background: var(--scope); box-shadow: none; }
.fv-opt.is-part .fv-opt__box { box-shadow: inset 0 0 0 1.5px var(--scope); }
.fv-opt.is-part .fv-opt__box::after { content: ""; width: 8px; height: 2px; background: var(--scope); }
.fv-opt__sub { display: block; font-size: 11px; line-height: 14px; color: var(--ink-muted); }
.fv-opt.is-indent { margin-left: 18px; }
.fv-scope-pop__foot { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.fv-scope-pop__foot .fv-seg > .is-on { background: var(--scope-soft); color: var(--ink); }
.fv-scope-pop__saved { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--ink-muted); align-items: center; }
.fv-scope-pop__saved button { height: 24px; padding: 0 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: transparent; color: var(--ink); font: 500 12px var(--font-sans); cursor: pointer; }
/* equação de consolidação: Pessoal + Empresas − eliminações = Tudo */
.fv-consol { display: flex; align-items: stretch; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.fv-consol > div { padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fv-consol > .op { display: grid; place-items: center; padding: 0 4px; color: var(--ink-muted); font: 500 18px var(--font-mono); background: var(--bg); }
.fv-consol .k { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.fv-consol .v { font: 500 18px/24px var(--font-mono); white-space: nowrap; }
.fv-consol .n { font-size: 12px; color: var(--ink-muted); }
.fv-consol .is-total { background: var(--surface-2); margin-left: auto; }
.fv-consol .is-elim .k { color: var(--ink-muted); }
/* coluna de eliminações e de consolidado numa tabela lado a lado */
.fv-table td.is-elim, .fv-table th.is-elim { background: var(--bg); color: var(--ink-muted); border-left: 1px dashed var(--border-strong); }
.fv-table td.is-consol, .fv-table th.is-consol { background: var(--surface-2); font-weight: 600; border-left: 1px solid var(--border-strong); }
.fv-table th.is-biz { text-align: right; }
.fv-table th.is-biz a { text-decoration: none; }
/* dono do dinheiro × conta onde caiu */
.fv-owner { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-muted); white-space: nowrap; }
.fv-owner b { color: var(--ink); font-weight: 600; }
.fv-seg > * { white-space: nowrap; flex-shrink: 0; }
.fv-page-head .fv-actions { flex-shrink: 0; }
.fv-scope-pop__foot .fv-hint { flex: 1; min-width: 0; }
.fv-scope-pop__foot .fv-seg { flex-shrink: 0; }
