/* NDB Finanças — tema visual (sobre Bootstrap 5.3). Mesmo sistema visual do
   projeto Os Profissa de Terça, com o verde #00B37E como cor-mãe. */

:root,
[data-bs-theme="light"] {
  --brand: #00875f;         /* verde principal (botões, links) */
  --brand-strong: #015f43;  /* verde-escuro */
  --brand-soft: #dcf5ea;
  --brand-ink: #014d37;
  --accent: #00b37e;        /* verde-mãe da marca */

  --surface-0: #f3f6f5;
  --surface-1: #ffffff;
  --surface-2: #f5f8f7;
  --line: #e1e8e5;
  --ink: #0f1a17;
  --ink-2: #475a54;
  --ink-3: #7a8a85;

  --ok: #047857;   --ok-soft: #dcfce7;
  --warn: #b45309; --warn-soft: #fef3c7;
  --bad: #c2410c;  --bad-soft: #ffedd5;
  --neg: #b91c1c;  --neg-soft: #fee2e2;

  /* gráficos (validados com a skill de dataviz — ver ROADMAP) */
  --series-1: #0f9d6b; /* receitas */
  --series-2: #eb6834; /* despesas */
  --series-3: #2a78d6; /* projetado / comparação */
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100; --cat-5: #e87ba4; --cat-outros: #94a3a0;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .04), 0 4px 16px rgba(16, 24, 20, .04);

  --bs-body-bg: var(--surface-0);
  --bs-body-color: var(--ink);
  --bs-secondary-color: var(--ink-2);
  --bs-border-color: var(--line);
  --bs-primary: var(--brand);
  --bs-primary-rgb: 0, 135, 95;
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: 0, 135, 95;
  --bs-link-hover-color: var(--brand-strong);
  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-border-radius: 12px;
  --bs-border-radius-lg: 16px;
  --bs-tertiary-bg: var(--surface-2);
  color-scheme: light;
}

[data-bs-theme="dark"] {
  --brand: #2fd39a;
  --brand-strong: #7ee6bf;
  --brand-soft: rgba(0, 179, 126, .15);
  --brand-ink: #b6f0d8;
  --accent: #00b37e;

  --surface-0: #0a1210;
  --surface-1: #111b18;
  --surface-2: #172420;
  --line: #243530;
  --ink: #eef5f2;
  --ink-2: #a9bbb4;
  --ink-3: #7b8d87;

  --ok: #34d399;   --ok-soft: rgba(52, 211, 153, .14);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .14);
  --bad: #fb923c;  --bad-soft: rgba(251, 146, 60, .15);
  --neg: #f87171;  --neg-soft: rgba(248, 113, 113, .14);

  --series-1: #199e70;
  --series-2: #d95926;
  --series-3: #3987e5;
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; --cat-outros: #5f716b;

  --shadow: 0 1px 2px rgba(0, 0, 0, .3);

  --bs-body-bg: var(--surface-0);
  --bs-body-color: var(--ink);
  --bs-secondary-color: var(--ink-2);
  --bs-border-color: var(--line);
  --bs-primary-rgb: 47, 211, 154;
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: 47, 211, 154;
  --bs-link-hover-color: var(--brand-strong);
  --bs-tertiary-bg: var(--surface-2);
  color-scheme: dark;
}

html, body { background: var(--surface-0); }
body {
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
.min-w-0 { min-width: 0; }
.flex-none { flex: none; }
.num, .kpi-value, td.money, .money, .amount { font-variant-numeric: tabular-nums; }
a { text-decoration: none; }
[hidden] { display: none !important; }

/* ---------- botões ---------- */
.btn { font-weight: 600; border-radius: 12px; }
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-strong); --bs-btn-hover-border-color: var(--brand-strong);
  --bs-btn-active-bg: var(--brand-strong); --bs-btn-active-border-color: var(--brand-strong);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #03281c; --bs-btn-hover-color: #03281c; --bs-btn-active-color: #03281c; --bs-btn-disabled-color: #03281c; }
.btn-light {
  --bs-btn-bg: var(--surface-2); --bs-btn-border-color: var(--line); --bs-btn-color: var(--ink);
  --bs-btn-hover-bg: var(--line); --bs-btn-hover-border-color: var(--line); --bs-btn-hover-color: var(--ink);
  --bs-btn-active-bg: var(--line); --bs-btn-active-color: var(--ink);
  --bs-btn-disabled-bg: var(--surface-2); --bs-btn-disabled-color: var(--ink-3); --bs-btn-disabled-border-color: var(--line);
}
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid transparent; }
.btn-soft:hover, .btn-soft:focus-visible { background: var(--brand); color: #fff; }
[data-bs-theme="dark"] .btn-soft:hover { color: #03281c; }
.btn-icon {
  width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center;
  border-radius: 12px; color: var(--ink-2); background: transparent; border: 1px solid transparent;
}
.btn-icon:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn-icon.ok:hover { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.btn-icon.danger:hover { color: var(--neg); background: var(--neg-soft); border-color: transparent; }

/* ---------- formulário ---------- */
.form-control, .form-select {
  border-radius: 12px; border-color: var(--line); background-color: var(--surface-1);
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 22%, transparent);
}
.form-label { font-weight: 600; font-size: .85rem; color: var(--ink-2); margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 22%, transparent); border-color: var(--brand); }
.input-money { font-size: 1.35rem; font-weight: 700; }
.form-hint { font-size: .78rem; color: var(--ink-3); margin-top: .3rem; }
.form-switch-x { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.form-switch-x .form-check-input { margin: 0; width: 2.4em; height: 1.3em; flex: none; cursor: pointer; }
.form-switch-x span { font-weight: 600; font-size: .9rem; }

.chip-group { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; padding: .38rem .8rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-1); color: var(--ink-2);
  font-weight: 600; font-size: .85rem; cursor: pointer; user-select: none; white-space: nowrap;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-check:checked + .chip, .chip.active {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
[data-bs-theme="dark"] .btn-check:checked + .chip, [data-bs-theme="dark"] .chip.active { color: #03281c; }
.btn-check:focus-visible + .chip { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn-check:disabled + .chip { opacity: .45; cursor: not-allowed; }
.chip .count { background: rgba(0,0,0,.08); border-radius: 999px; padding: 0 .45rem; font-size: .75rem; }
.chip.active .count { background: rgba(255,255,255,.25); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chip-sm { padding: .22rem .6rem; font-size: .78rem; }

.swatches { display: flex; flex-wrap: wrap; gap: .45rem; }
.swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: #fff; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.swatch i { opacity: 0; font-size: .9rem; }
.btn-check:checked + .swatch { border-color: var(--surface-1); box-shadow: 0 0 0 2px var(--ink); }
.btn-check:checked + .swatch i { opacity: 1; }
.btn-check:focus-visible + .swatch { outline: 2px solid var(--brand); outline-offset: 2px; }
.swatch-none { background: var(--surface-2); color: var(--ink-3); border: 1px dashed var(--ink-3); box-shadow: none; }
.swatch-none i { opacity: 1; }

/* ---------- estrutura ---------- */
.sidebar {
  --bs-offcanvas-width: 280px;
  background: var(--surface-1);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
@media (min-width: 992px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 1030; }
  .app-shell { margin-left: 264px; }
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.25rem .6rem; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); }
.brand span { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
.brand small { color: var(--accent); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.brand:hover { color: var(--ink); }
.brand-sm strong { font-size: 1rem; }
.brand-sm strong span { display: inline; color: var(--accent); }
.brand-mark { width: 36px; height: 36px; flex: none; filter: drop-shadow(0 2px 4px rgba(1, 77, 55, .25)); }
.brand-sm .brand-mark { width: 30px; height: 30px; }

.empresa-switch { margin: 0 .75rem .5rem; }
.empresa-switch > .btn {
  width: 100%; display: flex; align-items: center; gap: .6rem; text-align: left;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .7rem; color: var(--ink);
}
.empresa-switch > .btn:hover { border-color: var(--ink-3); }
.empresa-switch .emp-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.empresa-switch .emp-nome { font-weight: 700; font-size: .88rem; line-height: 1.15; }
.empresa-switch .emp-tipo { font-size: .72rem; color: var(--ink-3); font-weight: 600; }
.dropdown-menu { border-color: var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: .35rem; background: var(--surface-1); }
.dropdown-item { border-radius: 9px; font-weight: 500; padding: .45rem .7rem; }
.dropdown-item.active, .dropdown-item:active { background: var(--brand-soft); color: var(--brand-ink); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .25rem .75rem .75rem; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .75rem; padding: .55rem .8rem; border-radius: 12px;
  color: var(--ink-2); font-weight: 600; font-size: .92rem; transition: background-color .15s, color .15s;
}
.sidebar-nav a i { font-size: 1.1rem; width: 1.2rem; text-align: center; }
.sidebar-nav a:hover { background: var(--surface-2); color: var(--ink); }
.sidebar-nav a.active { background: var(--brand-soft); color: var(--brand-ink); }
.sidebar-nav a .tag { margin-left: auto; }
.sidebar-label { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: .9rem .8rem .3rem; }
.sidebar-foot { border-top: 1px solid var(--line); padding: .9rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sidebar-foot .me { display: flex; align-items: center; gap: .6rem; min-width: 0; font-size: .88rem; }

.topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .6rem 1rem; background: color-mix(in srgb, var(--surface-0) 85%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.app-main { padding: 1.5rem 1rem 6.5rem; max-width: 1320px; margin: 0 auto; }
@media (min-width: 768px) { .app-main { padding: 2rem 1.75rem 3rem; } }
@media (min-width: 992px) { .app-main { padding: 2rem 2.25rem 3rem; } }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1025; display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface-1) 92%, transparent); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
}
.bottom-nav a, .bottom-nav button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .35rem 0; border: 0; background: none;
  color: var(--ink-3); font-size: .7rem; font-weight: 600; border-radius: 12px;
}
.bottom-nav i { font-size: 1.25rem; }
.bottom-nav .active { color: var(--brand); }

/* ---------- cabeçalho de página ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.page-head p { margin: .25rem 0 0; color: var(--ink-2); }
.page-head .back { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--ink-3); margin-bottom: .35rem; }
.page-head .back:hover { color: var(--brand); }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
@media (max-width: 575.98px) {
  .page-head h1 { font-size: 1.35rem; }
  .page-actions { width: 100%; }
  .page-actions > .btn { flex: 1; }
}

.comp-nav { display: inline-flex; align-items: center; gap: .15rem; background: var(--surface-1); border: 1px solid var(--line); border-radius: 14px; padding: 3px; }
.comp-label { position: relative; min-width: 150px; text-align: center; font-weight: 700; cursor: pointer; padding: 0 .5rem; margin: 0; }
.comp-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

/* ---------- cards ---------- */
.card-x {
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem;
}
.card-title-x { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1rem; }
.card-title-x h2, .card-title-x h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.card-title-x .link { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-title-x { padding: 1.1rem 1.25rem 0; }
a.card-x { color: var(--ink); transition: border-color .15s, transform .15s; }
a.card-x:hover { border-color: var(--brand); }

.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
@media (min-width: 992px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; } }
.kpi-grid.kpi-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi-grid.kpi-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 768px) { .kpi-grid.kpi-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi {
  display: flex; gap: .85rem; align-items: flex-start; background: var(--surface-1); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow);
}
.kpi-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); font-size: 1.15rem; }
.kpi-label { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.kpi-value { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; white-space: nowrap; }
.kpi-sub { font-size: .78rem; color: var(--ink-3); margin-top: 2px; }
.kpi.ok .kpi-icon { background: var(--ok-soft); color: var(--ok); }
.kpi.bad .kpi-icon { background: var(--neg-soft); color: var(--neg); }
.kpi.warn .kpi-icon { background: var(--warn-soft); color: var(--warn); }
.kpi.brand .kpi-icon { background: var(--brand-soft); color: var(--brand); }
@media (max-width: 575.98px) {
  .kpi { flex-direction: column; gap: .5rem; padding: .85rem; }
  .kpi-icon { width: 34px; height: 34px; font-size: 1rem; }
  .kpi-value { font-size: 1.12rem; }
}

.hero-saldo {
  position: relative; overflow: hidden; border-radius: 20px; padding: 1.5rem; color: #effbf6;
  background: radial-gradient(120% 140% at 100% 0%, #12c48c 0%, #00875f 42%, #014d37 100%);
  box-shadow: 0 12px 32px -12px rgba(1, 77, 55, .55);
}
[data-bs-theme="dark"] .hero-saldo { background: radial-gradient(120% 140% at 100% 0%, #0c8a62 0%, #0a5c43 45%, #06281e 100%); }
/* linha de tendência decorativa */
.hero-saldo::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70%; opacity: .16; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120' preserveAspectRatio='none'%3E%3Cpath d='M0 110 L50 92 L95 100 L150 70 L205 78 L260 44 L315 52 L400 12' fill='none' stroke='white' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat bottom / 100% 100%;
}
.hero-saldo::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%;
  border: 28px solid rgba(255, 255, 255, .06);
}
.hero-saldo > * { position: relative; z-index: 1; }
.hero-saldo .lbl { font-size: .85rem; font-weight: 600; opacity: .85; }
.hero-saldo .val { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: .25rem 0 .75rem; font-variant-numeric: tabular-nums; }
.hero-saldo .val.neg { color: #fecaca; }
.hero-saldo .row-mini { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .88rem; }
.hero-saldo .row-mini b { font-weight: 700; }
.hero-saldo a { color: #fff; }
.hero-saldo .btn-hero { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); color: #fff; }
.hero-saldo .btn-hero:hover { background: rgba(255,255,255,.24); }
@media (max-width: 575.98px) { .hero-saldo .val { font-size: 2rem; } }

.val-pos { color: var(--ok); font-weight: 700; }
.val-neg { color: var(--neg); font-weight: 700; }
.val-mute { color: var(--ink-3); }

/* ---------- avatar / status ---------- */
.avatar {
  --h: 150; width: 38px; height: 38px; flex: none; border-radius: 50%; display: inline-grid; place-items: center;
  font-weight: 700; font-size: .82rem; letter-spacing: .02em;
  background: hsl(var(--h) 65% 90%); color: hsl(var(--h) 55% 28%);
}
[data-bs-theme="dark"] .avatar { background: hsl(var(--h) 35% 22%); color: hsl(var(--h) 70% 82%); }
.avatar i { font-size: 1.05rem; }
.avatar-sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar-dot { background: color-mix(in srgb, var(--c) 18%, transparent) !important; color: var(--c) !important; }

.status { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; padding: .22rem .6rem; border-radius: 999px; white-space: nowrap; }
.status-ok { background: var(--ok-soft); color: var(--ok); }
.status-warn { background: var(--warn-soft); color: var(--warn); }
.status-bad { background: var(--neg-soft); color: var(--neg); }
.status-brand { background: var(--brand-soft); color: var(--brand-ink); }
.status-muted { background: var(--surface-2); color: var(--ink-3); }
.tag { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.tag-auto { background: transparent; border-style: dashed; }
.tag .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ---------- listas de itens ---------- */
.list-x { list-style: none; margin: 0; padding: 0; }
.list-x > li, .list-row {
  display: flex; align-items: center; gap: .85rem; padding: .8rem 1.25rem; border-top: 1px solid var(--line);
}
.list-x > li:first-child { border-top: 0; }
.list-row .info { flex: 1; min-width: 0; }
.list-row .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .meta { font-size: .8rem; color: var(--ink-3); display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .6rem; }
.list-row .amount { font-weight: 800; white-space: nowrap; text-align: right; }
.list-row .amount small { display: block; font-weight: 600; font-size: .72rem; color: var(--ink-3); }
.list-row .acts { display: flex; gap: .25rem; align-items: center; flex: none; }
.list-row.is-clickable { cursor: pointer; transition: background-color .15s; }
.list-row.is-clickable:hover { background: var(--surface-2); }
.list-row.is-pendente { background: linear-gradient(90deg, var(--warn-soft), transparent 40%); }
.list-row.is-vencido { background: linear-gradient(90deg, var(--neg-soft), transparent 40%); }
.list-row.is-inativo .nm { text-decoration: line-through; color: var(--ink-3); }
.list-row.is-inativo .avatar { opacity: .5; }
.list-row.child { padding-left: 3.25rem; }
.list-group-head { padding: .55rem 1.25rem; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: .5rem; }
.list-x > .list-group-head:first-child { border-top: 0; }
@media (max-width: 575.98px) {
  .list-x > li, .list-row { padding: .75rem 1rem; gap: .65rem; flex-wrap: wrap; }
  .list-row .acts { width: 100%; justify-content: flex-end; padding-left: calc(38px + .65rem); }
  .list-row .acts:empty { display: none; }
  .list-row.child { padding-left: 2rem; }
  .list-group-head { padding: .55rem 1rem; }
}

/* ---------- tabelas ---------- */
.table-x { width: 100%; margin: 0; --bs-table-bg: transparent; }
.table-x th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; border-bottom: 1px solid var(--line); padding: .75rem 1rem; white-space: nowrap; background: var(--surface-2); }
.table-x td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-x tbody tr:last-child td { border-bottom: 0; }
.table-x tbody tr:hover td { background: var(--surface-2); }
.table-x tfoot td { font-weight: 800; background: var(--surface-2); border-top: 1px solid var(--line); padding: .75rem 1rem; }
.table-x .text-end { text-align: right; }
.table-x.compact td, .table-x.compact th { padding: .5rem .75rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* progresso */
.progress-x { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; gap: 2px; }
.progress-x > span { display: block; height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.progress-x .p-ok { background: var(--ok); }
.progress-x .p-warn { background: var(--warn); }
.progress-x .p-bad { background: var(--neg); }
.progress-x .p-brand { background: var(--brand); }
.legend-x { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .8rem; color: var(--ink-2); margin-top: .6rem; }
.legend-x i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.bar-row { display: block; color: var(--ink); margin-bottom: .7rem; }
.bar-row:last-child { margin-bottom: 0; }
a.bar-row:hover .fw-semibold { color: var(--brand); }
.bar-row .top { display: flex; justify-content: space-between; gap: .75rem; font-size: .88rem; margin-bottom: .3rem; }

/* toolbar de filtros */
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.search-box { position: relative; flex: 1 1 220px; max-width: 360px; }
.search-box i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search-box input { padding-left: 2.3rem; }
@media (max-width: 575.98px) { .search-box { max-width: none; flex-basis: 100%; } }

.segmented { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.segmented a, .segmented button { padding: .35rem .85rem; border-radius: 9px; font-weight: 600; font-size: .85rem; color: var(--ink-2); border: 0; background: none; transition: background-color .15s, color .15s; }
.segmented a:hover, .segmented button:hover { color: var(--ink); }
.segmented .active { background: var(--surface-1); color: var(--ink); box-shadow: var(--shadow); }
.tabs-x { margin-bottom: 1.25rem; }
@media (max-width: 575.98px) { .tabs-x { display: flex; width: 100%; } .tabs-x > * { flex: 1; text-align: center; padding-left: .4rem !important; padding-right: .4rem !important; } }

/* estado vazio */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-3); }
.empty i { font-size: 2rem; display: block; margin-bottom: .5rem; }
.empty p { margin: 0; }
.empty .btn { margin-top: 1rem; }

/* cartão de crédito */
.cc-strip { display: flex; gap: .85rem; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 1.25rem; scroll-snap-type: x mandatory; }
.cc {
  --c: #00875f; position: relative; overflow: hidden; flex: 0 0 280px; scroll-snap-align: start; border-radius: 18px; padding: 1.1rem 1.2rem;
  color: #fff; min-height: 158px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; border: 2px solid transparent;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 92%, #fff) 0%, var(--c) 45%, color-mix(in srgb, var(--c) 55%, #000) 100%);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--c) 80%, #000); transition: transform .2s, box-shadow .2s, opacity .2s; opacity: .72;
}
.cc:hover { transform: translateY(-2px); opacity: .9; }
.cc.active { opacity: 1; border-color: var(--surface-1); box-shadow: 0 0 0 2px var(--c), 0 14px 28px -12px color-mix(in srgb, var(--c) 80%, #000); }
.cc::after { content: ""; position: absolute; right: -50px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.08); }
.cc .cc-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; position: relative; z-index: 1; }
.cc .cc-nome { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.cc .cc-band { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.cc .cc-chip { margin: .5rem 0 .4rem; width: 34px; height: 25px; border-radius: 6px; background: linear-gradient(135deg, #f6e27a, #cfa93c); opacity: .9; }
.cc .cc-lbl { font-size: .72rem; opacity: .85; font-weight: 600; }
.cc .cc-val { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cc .cc-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; margin-top: .45rem; }
.cc .cc-bar span { display: block; height: 100%; background: #fff; border-radius: 999px; }
.cc .cc-foot { font-size: .72rem; opacity: .85; margin-top: .3rem; display: flex; justify-content: space-between; }
.cc-add { flex: 0 0 160px; border: 2px dashed var(--line); border-radius: 18px; display: grid; place-items: center; text-align: center; color: var(--ink-3); font-weight: 700; font-size: .88rem; min-height: 158px; }
.cc-add:hover { border-color: var(--brand); color: var(--brand); }
.cc-add i { font-size: 1.5rem; display: block; }

/* metas */
.meta-card { display: flex; flex-direction: column; gap: .75rem; height: 100%; }
.meta-card .top { display: flex; align-items: flex-start; gap: .75rem; }
.meta-card .nm { font-weight: 800; font-size: 1rem; line-height: 1.2; }
.meta-ring { --p: 0; --c: var(--ok); width: 58px; height: 58px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); position: relative; }
.meta-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface-1); }
.meta-ring b { position: relative; font-size: .78rem; font-weight: 800; }

/* gráficos */
.chart-box { min-height: 260px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .82rem; color: var(--ink-2); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.chart-legend i.dash { height: 0; width: 14px; border-top: 2px dashed; border-radius: 0; vertical-align: 3px; }
.apexcharts-tooltip { border-radius: 10px !important; border: 1px solid var(--line) !important; box-shadow: var(--shadow) !important; background: var(--surface-1) !important; color: var(--ink) !important; }
.apexcharts-tooltip-title { background: var(--surface-2) !important; border-bottom: 1px solid var(--line) !important; font-weight: 700 !important; }
.apexcharts-xaxistooltip { display: none; }

/* modais */
.modal-content { border: 1px solid var(--line); border-radius: 20px; background: var(--surface-1); }
.modal-header { border-bottom: 0; padding: 1.25rem 1.5rem .5rem; }
.modal-title { font-weight: 800; font-size: 1.1rem; }
.modal-body { padding: .75rem 1.5rem; }
.modal-footer { border-top: 0; padding: .75rem 1.5rem 1.25rem; }
.modal-footer .me-auto { margin-right: auto; }
@media (max-width: 575.98px) {
  .modal-dialog:not(.modal-sm) { margin: 0; min-height: 100%; display: flex; align-items: flex-end; }
  .modal-dialog:not(.modal-sm) .modal-content { border-radius: 22px 22px 0 0; max-height: 92vh; overflow-y: auto; }
  .modal.fade .modal-dialog:not(.modal-sm) { transform: translateY(40px); }
  .modal.show .modal-dialog:not(.modal-sm) { transform: none; }
  .modal-footer > .btn { flex: 1; }
}
.modal-sub { font-size: .9rem; color: var(--ink-2); margin-top: -.25rem; }
.modal-alert { background: var(--neg-soft); color: var(--neg); border-radius: 12px; padding: .6rem .85rem; font-size: .88rem; font-weight: 600; }
.choice-list { display: grid; gap: .5rem; }
.choice-list .btn { text-align: left; display: flex; align-items: center; gap: .7rem; padding: .75rem 1rem; }
.choice-list .btn small { display: block; font-weight: 500; color: var(--ink-3); }

/* toasts */
.toast-container { top: 0; right: 0; z-index: 2000; }
@media (max-width: 575.98px) { .toast-container { left: 0; right: 0; top: auto; bottom: 70px; } }
.toast-x {
  display: flex; align-items: center; gap: .75rem; background: var(--ink); color: var(--surface-1);
  border-radius: 14px; padding: .8rem 1rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); min-width: 280px; font-weight: 600; margin-bottom: .5rem;
  animation: toast-in .25s ease-out;
}
.toast-x .bi { font-size: 1.2rem; }
.toast-x.success .bi { color: #34d399; }
.toast-x.error .bi { color: #f87171; }
[data-bs-theme="dark"] .toast-x.success .bi { color: #15803d; }
[data-bs-theme="dark"] .toast-x.error .bi { color: #b91c1c; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* animações de página e carregamento */
.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.page-enter > * { animation: page-in .35s cubic-bezier(.2,.8,.2,1) both; }
.page-enter > *:nth-child(2) { animation-delay: .03s; }
.page-enter > *:nth-child(3) { animation-delay: .06s; }
.page-enter > *:nth-child(4) { animation-delay: .09s; }
.page-enter > *:nth-child(n+5) { animation-delay: .12s; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.flash-row { animation: flash 1.2s ease-out; }
@keyframes flash { from { background-color: color-mix(in srgb, var(--brand) 18%, transparent); } to { background-color: transparent; } }
.skel { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: skel 1.2s linear infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .brand-mark { width: 64px; height: 64px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }
@media (prefers-reduced-motion: reduce) {
  .toast-x, .page-enter > *, .skel, .boot .brand-mark { animation: none; }
  .progress-x > span { transition: none; }
}

/* login */
.login-body { min-height: 100vh; background:
  radial-gradient(60% 50% at 85% 100%, rgba(0,179,126,.35) 0%, transparent 70%),
  radial-gradient(100% 80% at 0% 0%, #0b7d59 0%, #014d37 55%, #022a1f 100%); }
.login-body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .12;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 400' preserveAspectRatio='none'%3E%3Cpath d='M0 380 L120 330 L230 350 L360 260 L480 290 L600 190 L720 220 L850 120 L980 150 L1200 30' fill='none' stroke='white' stroke-width='4' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat bottom / 100% 55%; }
.login-wrap { position: relative; min-height: 100vh; display: grid; grid-template-columns: 1fr; align-items: center; justify-items: center; gap: 2rem; padding: 2rem 1rem; max-width: 1000px; margin: 0 auto; }
@media (min-width: 900px) { .login-wrap { grid-template-columns: 1.1fr 1fr; } }
.login-hero { color: #effbf6; max-width: 420px; }
.login-hero .brand-mark { width: 96px; height: 96px; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .35)); }
.login-hero h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.02; margin: 1rem 0; }
.login-hero h1 span { color: #5ee6b4; }
.login-hero p { opacity: .8; font-size: 1.05rem; }
.login-hero ul { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .5rem; opacity: .9; }
.login-hero li { display: flex; gap: .6rem; align-items: center; font-weight: 600; font-size: .95rem; }
.login-hero li i { color: #5ee6b4; }
@media (max-width: 899.98px) { .login-hero { text-align: center; } .login-hero h1 { font-size: 2rem; } .login-hero p, .login-hero ul { display: none; } }
.login-card { width: 100%; max-width: 400px; background: var(--surface-1); border-radius: 24px; padding: 2rem; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); animation: page-in .4s cubic-bezier(.2,.8,.2,1) both; }
.login-card h2 { font-weight: 800; font-size: 1.4rem; margin-bottom: 1.25rem; }

/* impressão */
@media print {
  .sidebar, .bottom-nav, .topbar, .page-actions, .btn, .toolbar { display: none !important; }
  .app-shell { margin: 0 !important; }
}

/* caixinha de data (vencimentos) */
.date-box { width: 50px; flex: none; text-align: center; border-radius: 12px; background: var(--surface-2); padding: .3rem 0; line-height: 1.1; }
.date-box b { display: block; font-size: 1.1rem; font-weight: 800; }
.date-box small { font-size: .68rem; text-transform: uppercase; font-weight: 700; color: var(--ink-3); }
.date-box.today { background: var(--warn-soft); color: var(--warn); }
.date-box.vencido { background: var(--neg-soft); color: var(--neg); }
.date-box.today small, .date-box.vencido small { color: inherit; }
.chart-box.chart-sm { min-height: 200px; }
.table-x td.num, .table-x th.text-end { white-space: nowrap; }
.amount { white-space: nowrap; }
@media (max-width: 575.98px) {
  .page-actions > .comp-nav { flex: 1 1 100%; justify-content: space-between; }
  .page-actions > .btn, .page-actions > .btn-group { white-space: nowrap; }
  .toolbar > .ms-auto { margin-left: 0 !important; width: 100%; }
  .toolbar > .ms-auto .comp-nav { width: 100%; justify-content: space-between; }
}
.col-xl-4 .list-row .amount { font-size: .92rem; }
