/*
 * Lolu: design system laranja aprovado em 26/10/2026 (docs/redesign-laranja-aprovado.md).
 * Os tokens normativos vêm de /assets/design-laranja/tokens.css (carregado antes deste arquivo).
 * Aqui ficam os componentes. Tema escuro automático usa os mesmos tokens com valores escuros.
 */

/* Tema escuro automático (mesmos valores do bloco [data-lolu-theme="dark"] de tokens.css). */
@media (prefers-color-scheme: dark) {
    :root:not([data-lolu-theme="light"]) {
        --lolu-background: #111827;
        --lolu-surface: #1F2937;
        --lolu-text: #F9FAFB;
        --lolu-muted: #CBD5E1;
        --lolu-border: #475569;
        --lolu-primary-text: #FDBA74;
        --lolu-primary-soft: #431407;
        --lolu-success: #86EFAC;
        --lolu-success-soft: #052E16;
        --lolu-danger: #FCA5A5;
        --lolu-danger-soft: #450A0A;
        --lolu-warning: #FDE68A;
        --lolu-warning-soft: #451A03;
        --lolu-focus: #FDBA74;
        --lolu-shadow: none;
        --lolu-surface-2: #273244;
        color-scheme: dark;
    }
}
:root {
    --lolu-surface-2: #F9FAFB;
    --lolu-info: #1D4ED8;
    --lolu-info-soft: #EFF6FF;
    color-scheme: light dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--lolu-background);
    color: var(--lolu-text);
    font: 400 14px/21px var(--lolu-font);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--lolu-primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--lolu-focus); outline-offset: 2px; box-shadow: var(--lolu-focus-ring); border-radius: 4px; }
h1, h2, h3 { margin: 0; color: var(--lolu-text); }
h1 { font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 18px; line-height: 26px; font-weight: 600; }
h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
p { margin: 0 0 12px; }
small, .muted { color: var(--lolu-muted); }
.help { font-size: 12px; line-height: 18px; color: var(--lolu-muted); }
.num, .money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.num { text-align: right; }
.pos { color: var(--lolu-success); }
.neg { color: var(--lolu-danger); }
.warn { color: var(--lolu-warning); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--lolu-surface); padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip-link:focus { top: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- Estrutura: sidebar + conteúdo ---------- */
.app { display: flex; min-height: 100vh; }
@media (min-width: 768px) {
    /* Fundo branco da sidebar até o fim de páginas longas (a sidebar é sticky e tem a altura da tela). */
    .app { background: linear-gradient(to right, var(--lolu-surface) calc(var(--lolu-sidebar) - 1px), var(--lolu-border) calc(var(--lolu-sidebar) - 1px), var(--lolu-border) var(--lolu-sidebar), var(--lolu-background) var(--lolu-sidebar)); }
}
.sidebar {
    width: var(--lolu-sidebar); flex: 0 0 var(--lolu-sidebar); background: var(--lolu-surface);
    border-right: 1px solid var(--lolu-border); position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; padding: 24px 16px 16px;
}
.sidebar__logo { display: inline-flex; align-items: center; padding: 4px 8px 20px; }
.sidebar__logo img { display: block; width: 84px; height: auto; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav__group { font-size: 13px; line-height: 18px; color: var(--lolu-muted); padding: 20px 12px 6px; }
.nav__link {
    display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; border-radius: var(--lolu-radius-control);
    color: var(--lolu-text); font-weight: 500; font-size: 14px;
}
.nav__link .icon { color: var(--lolu-muted); }
.nav__link:hover { background: var(--lolu-surface-2); text-decoration: none; }
.nav__link[aria-current="page"] { background: var(--lolu-primary-soft); color: var(--lolu-primary-text); font-weight: 600; }
.nav__link[aria-current="page"] .icon { color: var(--lolu-primary-text); }
.nav__badge {
    margin-left: auto; min-width: 24px; height: 20px; padding: 0 7px; border-radius: var(--lolu-radius-pill);
    background: var(--lolu-primary-button); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.sidebar__foot { margin-top: auto; padding-top: 16px; }
.ws-chip { position: relative; display: block; }
.ws-chip > summary > .icon:last-child { transform: rotate(-90deg); color: var(--lolu-muted); }
.ws-chip > summary {
    list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--lolu-border);
    border-radius: var(--lolu-radius-card); cursor: pointer; background: var(--lolu-surface);
}
.ws-chip > summary::-webkit-details-marker { display: none; }
.ws-chip__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ws-chip__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-chip__role { font-size: 12px; line-height: 16px; color: var(--lolu-muted); }
.ws-chip .menu__list { bottom: calc(100% + 6px); top: auto; left: 0; right: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mobilebar { display: none; }
.page { padding: 32px; width: 100%; max-width: var(--lolu-content-max); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head__text { min-width: 0; flex: 1 1 320px; }
.page-head__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head__sub { margin: 4px 0 0; color: var(--lolu-muted); font-size: 14px; line-height: 21px; }
.page-head__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.back-btn {
    width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--lolu-border); background: var(--lolu-surface);
    display: inline-flex; align-items: center; justify-content: center; color: var(--lolu-text); flex: 0 0 auto;
}
.back-btn:hover { background: var(--lolu-surface-2); text-decoration: none; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--lolu-muted); margin: 0 0 12px; flex-wrap: wrap; }
.breadcrumb a { color: var(--lolu-muted); }
.breadcrumb [aria-current] { color: var(--lolu-text); font-weight: 500; }
.breadcrumb .icon { width: 16px; height: 16px; }

/* Configurações: submenu em coluna */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.subnav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 24px; }
.subnav a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--lolu-radius-control); color: var(--lolu-text);
    border-left: 3px solid transparent; font-weight: 500;
}
.subnav a .icon { color: var(--lolu-muted); width: 18px; height: 18px; }
.subnav a:hover { background: var(--lolu-surface-2); text-decoration: none; }
.subnav a[aria-current="page"] { background: var(--lolu-primary-soft); color: var(--lolu-primary-text); border-left-color: var(--lolu-primary); font-weight: 600; }
.subnav a[aria-current="page"] .icon { color: var(--lolu-primary-text); }

/* ---------- Cartões e grades ---------- */
.card {
    background: var(--lolu-surface); border: 1px solid var(--lolu-border); border-radius: var(--lolu-radius-card);
    box-shadow: var(--lolu-shadow); padding: 24px; min-width: 0;
}
.card--flush { padding: 0; overflow: hidden; }
.card--tight { padding: 16px 20px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card__head h2 { font-size: 18px; }
.card__head .help { margin-top: 2px; }
.card__link { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.card__link .icon { width: 16px; height: 16px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.grid-side { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); }
.gap-16 { gap: 16px; }
.mt-24 { margin-top: 24px; }
.mt-16 { margin-top: 16px; }
.mt-8 { margin-top: 8px; }
.mb-0 { margin-bottom: 0; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 20px 24px; }
.kpi--row { flex-direction: row; align-items: center; gap: 16px; }
.kpi__top { display: flex; align-items: center; gap: 12px; }
.kpi__label { font-size: 14px; color: var(--lolu-muted); font-weight: 500; }
.kpi__value { font-size: 28px; line-height: 34px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi__value--md { font-size: 22px; line-height: 28px; }
.kpi__sub { font-size: 13px; line-height: 18px; color: var(--lolu-muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.kpi__sub .icon { width: 14px; height: 14px; }
.kpi--danger { background: var(--lolu-danger-soft); border-color: color-mix(in srgb, var(--lolu-danger) 18%, var(--lolu-border)); }
.kpi--success { background: var(--lolu-success-soft); border-color: color-mix(in srgb, var(--lolu-success) 18%, var(--lolu-border)); }
.ico {
    width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    background: var(--lolu-primary-soft); color: var(--lolu-primary-text);
}
.ico .icon { width: 20px; height: 20px; }
.ico--lg { width: 56px; height: 56px; border-radius: 14px; }
.ico--lg .icon { width: 26px; height: 26px; }
.ico--success { background: var(--lolu-success-soft); color: var(--lolu-success); }
.ico--danger { background: var(--lolu-danger-soft); color: var(--lolu-danger); }
.ico--warning { background: var(--lolu-warning-soft); color: var(--lolu-warning); }
.ico--info { background: var(--lolu-info-soft); color: var(--lolu-info); }
.ico--neutral { background: var(--lolu-surface-2); color: var(--lolu-muted); border: 1px solid var(--lolu-border); }
.ico--solid { background: var(--lolu-primary-button); color: #fff; }
.stat-strip { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); }
.stat-strip > div { padding: 4px 24px; border-left: 1px solid var(--lolu-border); }
.stat-strip > div:first-child { border-left: 0; padding-left: 0; }
.stat-strip .big { font-size: 28px; line-height: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-strip .mid { font-size: 22px; line-height: 28px; font-weight: 700; }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--lolu-control-height); padding: 0 18px;
    border-radius: var(--lolu-radius-control); border: 1px solid var(--lolu-border); background: var(--lolu-surface); color: var(--lolu-text);
    font: 600 14px/20px var(--lolu-font); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--lolu-surface-2); text-decoration: none; }
.btn .icon { width: 18px; height: 18px; }
.btn--primary { background: var(--lolu-primary-button); border-color: var(--lolu-primary-button); color: #fff; }
.btn--primary:hover { background: var(--lolu-primary-button-hover); border-color: var(--lolu-primary-button-hover); }
.btn--outline { border-color: var(--lolu-primary); color: var(--lolu-primary-text); background: var(--lolu-surface); }
.btn--outline:hover { background: var(--lolu-primary-soft); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--danger { color: var(--lolu-danger); }
.btn--danger:hover { background: var(--lolu-danger-soft); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn--xs { min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn--icon { padding: 0; width: var(--lolu-control-height); }
.btn--icon.btn--sm { width: 36px; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn.is-loading { pointer-events: none; opacity: .75; }
.link-btn { background: none; border: 0; padding: 0; color: var(--lolu-primary-text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn--muted { color: var(--lolu-muted); font-weight: 500; }
.inline-form { display: inline; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; min-height: 24px; border-radius: var(--lolu-radius-pill);
    font-size: 12px; line-height: 18px; font-weight: 600; white-space: nowrap; background: var(--lolu-surface-2); color: var(--lolu-muted);
}
.badge .icon { width: 14px; height: 14px; }
.badge--success { background: var(--lolu-success-soft); color: var(--lolu-success); }
.badge--danger { background: var(--lolu-danger-soft); color: var(--lolu-danger); }
.badge--warning { background: var(--lolu-warning-soft); color: var(--lolu-warning); }
.badge--primary { background: var(--lolu-primary-soft); color: var(--lolu-primary-text); }
.badge--info { background: var(--lolu-info-soft); color: var(--lolu-info); }
.badge--neutral { background: var(--lolu-surface-2); color: var(--lolu-muted); border: 1px solid var(--lolu-border); }
.dot { width: 10px; height: 10px; border-radius: 99px; display: inline-block; flex: 0 0 auto; background: var(--lolu-muted); }
.dot--success { background: var(--lolu-success); }
.dot--danger { background: var(--lolu-danger); }
.dot--warning { background: #D97706; }

/* ---------- Mensagens ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--lolu-radius-control); margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.flash .icon { margin-top: 1px; }
.flash-success { background: var(--lolu-success-soft); color: var(--lolu-success); border-color: color-mix(in srgb, var(--lolu-success) 25%, transparent); }
.flash-error { background: var(--lolu-danger-soft); color: var(--lolu-danger); border-color: color-mix(in srgb, var(--lolu-danger) 25%, transparent); }
.flash-info { background: var(--lolu-primary-soft); color: var(--lolu-primary-text); border-color: color-mix(in srgb, var(--lolu-primary) 25%, transparent); }
.notice { padding: 12px 16px; border-radius: var(--lolu-radius-control); background: var(--lolu-surface-2); border: 1px solid var(--lolu-border); color: var(--lolu-muted); }
.notice--warning { background: var(--lolu-warning-soft); color: var(--lolu-warning); border-color: transparent; }
.notice--primary { background: var(--lolu-primary-soft); color: var(--lolu-primary-text); border-color: transparent; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 12px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--lolu-border); }
.table th { font-size: 12px; line-height: 18px; font-weight: 600; color: var(--lolu-text); background: var(--lolu-surface-2); white-space: nowrap; }
.table td { height: var(--lolu-row-height); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--lolu-surface-2) 70%, transparent); }
.table .num { text-align: right; }
.table .t-check { width: 44px; padding-right: 0; }
.table .t-actions { width: 1%; white-space: nowrap; text-align: right; }
.table tfoot td { font-weight: 700; border-top: 1px solid var(--lolu-border); border-bottom: 0; background: var(--lolu-surface-2); }
.table--compact td { height: 44px; padding-top: 8px; padding-bottom: 8px; }
.table--plain th { background: transparent; }
.table .desc { min-width: 180px; }
.table .desc small, .cell-sub { display: block; font-size: 12px; line-height: 18px; color: var(--lolu-muted); }
.table tr.is-muted td { color: var(--lolu-muted); }
.card > .table-wrap:first-child .table th:first-child { border-top-left-radius: 0; }
.card--flush .table th:first-child, .card--flush .table td:first-child { padding-left: 24px; }
.card--flush .table th:last-child, .card--flush .table td:last-child { padding-right: 24px; }
.cat { display: inline-flex; align-items: center; gap: 10px; }
.cat .ico { width: 30px; height: 30px; border-radius: 99px; }
.cat .ico .icon { width: 16px; height: 16px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--lolu-primary-button); margin: 0; cursor: pointer; }

/* ---------- Formulários ---------- */
.form { display: flex; flex-direction: column; gap: 20px; max-width: 960px; }
.form--wide { max-width: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
label, .label { font-weight: 600; font-size: 14px; line-height: 20px; color: var(--lolu-text); }
.req { color: var(--lolu-primary-text); margin-left: 2px; }
.hint { font-size: 12px; line-height: 18px; color: var(--lolu-muted); font-weight: 400; }
.input, input[type=text], input[type=email], input[type=password], input[type=date], input[type=month], input[type=number], input[type=search], select, textarea {
    width: 100%; min-height: var(--lolu-control-height); padding: 10px 14px; border: 1px solid var(--lolu-border); border-radius: var(--lolu-radius-control);
    background: var(--lolu-surface); color: var(--lolu-text); font: 400 14px/20px var(--lolu-font);
}
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; }
textarea { min-height: 88px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--lolu-muted) 45%, var(--lolu-border)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lolu-focus); box-shadow: var(--lolu-focus-ring); }
input[disabled], select[disabled], textarea[disabled] { background: var(--lolu-surface-2); color: var(--lolu-muted); cursor: not-allowed; }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--lolu-muted); pointer-events: none; }
.input-prefix > input { padding-left: 42px; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--lolu-muted); pointer-events: none; }
.input-icon > input { padding-left: 44px; }
.input-action { position: relative; }
.input-action > input { padding-right: 48px; }
.input-action > button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 36px; border: 0; background: transparent; color: var(--lolu-muted); cursor: pointer; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.input-action > button:hover { background: var(--lolu-surface-2); }
.field.has-error input, .field.has-error select { border-color: var(--lolu-danger); }
.field-error { color: var(--lolu-danger); font-size: 12px; }
.check { display: inline-flex; gap: 10px; align-items: center; font-weight: 500; cursor: pointer; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-actions--end { justify-content: flex-end; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 600; margin-bottom: 8px; }
.advanced { border-top: 1px solid var(--lolu-border); padding-top: 16px; }
.advanced > summary { cursor: pointer; font-weight: 600; color: var(--lolu-primary-text); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
.advanced[open] > summary::before { transform: rotate(45deg); }
.advanced > .form-grid { margin-top: 20px; }

/* Controle segmentado (tipo de lançamento) */
.typepick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.typepick label { margin: 0; cursor: pointer; }
.typepick input { position: absolute; opacity: 0; pointer-events: none; }
.typepick > label > span {
    display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; border: 1px solid var(--lolu-border);
    border-radius: var(--lolu-radius-control); font-weight: 500; background: var(--lolu-surface);
}
.typepick .ico { width: 32px; height: 32px; border-radius: 99px; }
.typepick input:checked + span { border: 2px solid var(--lolu-primary); background: var(--lolu-primary-soft); color: var(--lolu-primary-text); font-weight: 600; }
.typepick input:focus-visible + span { box-shadow: var(--lolu-focus-ring); outline: 2px solid var(--lolu-focus); }
.typepick input:disabled + span { opacity: .5; cursor: not-allowed; }

/* Segmentado compacto e chips de filtro */
.seg { display: inline-flex; border: 1px solid var(--lolu-border); border-radius: var(--lolu-radius-control); overflow: hidden; background: var(--lolu-surface); }
.seg a, .seg button, .seg label { margin: 0; padding: 0 18px; min-height: 42px; display: inline-flex; align-items: center; font-weight: 600; color: var(--lolu-muted); border: 0; background: transparent; cursor: pointer; font-size: 14px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg a[aria-current="page"], .seg a[aria-pressed="true"], .seg input:checked + span { background: var(--lolu-primary-button); color: #fff; }
.seg label { padding: 0; }
.seg label span { padding: 0 18px; min-height: 42px; display: inline-flex; align-items: center; }
.seg a:hover { text-decoration: none; background: var(--lolu-surface-2); }
.seg a[aria-current="page"]:hover { background: var(--lolu-primary-button-hover); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips__label { font-weight: 600; margin-right: 4px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 18px; border-radius: var(--lolu-radius-control);
    border: 1px solid var(--lolu-border); background: var(--lolu-surface); color: var(--lolu-text); font-weight: 500;
}
.chip:hover { background: var(--lolu-surface-2); text-decoration: none; }
.chip[aria-current="page"] { background: var(--lolu-primary-button); border-color: var(--lolu-primary-button); color: #fff; font-weight: 600; }

/* Abas com indicador */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--lolu-border); margin-bottom: 20px; overflow-x: auto; align-items: flex-end; }
.tabs a, .tabs button {
    padding: 12px 20px; color: var(--lolu-text); font-weight: 500; font-size: 15px; border: 0; border-bottom: 3px solid transparent; background: none;
    white-space: nowrap; cursor: pointer; font-family: inherit; margin-bottom: -1px;
}
.tabs a:hover, .tabs button:hover { text-decoration: none; color: var(--lolu-primary-text); }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { color: var(--lolu-primary-text); border-bottom-color: var(--lolu-primary); font-weight: 600; }
.tabs__end { margin-left: auto; padding-bottom: 6px; }
.tabs--sm a, .tabs--sm button { font-size: 14px; padding: 10px 16px; }

/* Navegação de mês */
.month-nav { display: inline-flex; align-items: stretch; border: 1px solid var(--lolu-border); border-radius: var(--lolu-radius-control); background: var(--lolu-surface); min-height: var(--lolu-control-height); }
.month-nav a { display: inline-flex; align-items: center; justify-content: center; width: 44px; color: var(--lolu-text); }
.month-nav a:hover { background: var(--lolu-surface-2); text-decoration: none; }
.month-nav__label { display: inline-flex; align-items: center; justify-content: center; padding: 0 20px; min-width: 168px; border-left: 1px solid var(--lolu-border); border-right: 1px solid var(--lolu-border); font-weight: 500; }
.month-nav__today { font-size: 13px; margin-left: 8px; align-self: center; }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; margin-bottom: 20px; }
.filters > div { flex: 1 1 170px; min-width: 0; }
.filters > .field:first-of-type { flex: 2.2 1 300px; }
.filters .field { gap: 6px; }

/* Barra de seleção em lote */
.bulkbar {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--lolu-radius-control);
    background: var(--lolu-primary-soft); border: 1px solid color-mix(in srgb, var(--lolu-primary) 30%, transparent); flex-wrap: wrap;
}
.bulkbar select { width: auto; min-width: 200px; min-height: 38px; padding-top: 6px; padding-bottom: 6px; }
.bulkbar .btn { min-height: 38px; }

/* Paginação */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--lolu-border); flex-wrap: wrap; }
.pager__info { color: var(--lolu-muted); }
.pager__pages { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pager__pages a, .pager__pages span {
    min-width: 40px; height: 40px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--lolu-border); border-radius: var(--lolu-radius-control); color: var(--lolu-text); background: var(--lolu-surface);
}
.pager__pages a:hover { background: var(--lolu-surface-2); text-decoration: none; }
.pager__pages [aria-current="page"] { border-color: var(--lolu-primary); color: var(--lolu-primary-text); background: var(--lolu-primary-soft); font-weight: 700; }
.pager__pages .is-disabled { color: var(--lolu-border); }
.pager__per { display: flex; align-items: center; gap: 8px; }
.pager__per select { width: auto; min-height: 40px; padding-top: 6px; padding-bottom: 6px; }

/* Menu suspenso (details) */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__list {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 210px; padding: 6px; margin: 0; list-style: none;
    background: var(--lolu-surface); border: 1px solid var(--lolu-border); border-radius: var(--lolu-radius-control); box-shadow: 0 10px 30px rgba(17,24,39,.12);
}
.menu__list a, .menu__list button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 6px; color: var(--lolu-text); background: none; border: 0;
    font: 500 14px/20px var(--lolu-font); text-align: left; cursor: pointer;
}
.menu__list a:hover, .menu__list button:hover { background: var(--lolu-surface-2); text-decoration: none; }
.menu__list .is-danger { color: var(--lolu-danger); }
.menu__list form { margin: 0; }
.menu__sep { height: 1px; background: var(--lolu-border); margin: 6px 0; }
.kebab { width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--lolu-muted); border: 1px solid transparent; }
.kebab:hover { background: var(--lolu-surface-2); }
.kebab--box { border-color: var(--lolu-border); }

/* Diálogo */
dialog.modal {
    border: 0; padding: 0; border-radius: 16px; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--lolu-surface);
    color: var(--lolu-text); box-shadow: 0 24px 60px rgba(17,24,39,.25);
}
dialog.modal--sm { width: min(480px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(17,24,39,.45); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--lolu-border); }
.modal__body { padding: 24px; overflow-y: auto; max-height: calc(100vh - 200px); }
.modal__foot { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--lolu-border); }
.modal__body .form { max-width: none; }

/* Barra de progresso */
.progress { height: 10px; border-radius: 99px; background: var(--lolu-surface-2); border: 1px solid var(--lolu-border); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--lolu-primary); border-radius: 99px; }
.progress--danger > span { background: var(--lolu-danger); }
.progress--warning > span { background: #D97706; }
.progress--success > span { background: var(--lolu-success); }

/* Avatar */
.avatar {
    width: 40px; height: 40px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    background: var(--lolu-primary-button); color: #fff; font-weight: 700; font-size: 16px;
}
.avatar--sm { width: 32px; height: 32px; font-size: 14px; }
.avatar--lg { width: 64px; height: 64px; font-size: 24px; }
.avatar--xl { width: 104px; height: 104px; font-size: 40px; }
.avatar--soft { background: var(--lolu-primary-soft); color: var(--lolu-primary-text); }
.avatar--c1 { background: #FFEDD5; color: #9A3412; }
.avatar--c2 { background: #FEE2E2; color: #991B1B; }
.avatar--c3 { background: #DCFCE7; color: #166534; }
.avatar--c4 { background: #E0E7FF; color: #3730A3; }
.avatar--c5 { background: #FEF3C7; color: #92400E; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who__name { font-weight: 600; }

/* Estado vazio */
.empty { text-align: center; padding: 40px 24px; color: var(--lolu-muted); }
.empty img { width: 160px; height: 120px; margin: 0 auto 12px; display: block; }
.empty h2, .empty h3 { color: var(--lolu-text); margin-bottom: 6px; }
.empty .btn { margin-top: 12px; }

/* Lista de atenção (Início) */
.alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--lolu-border); border-radius: var(--lolu-radius-control); }
.alert-item .icon { color: var(--lolu-danger); }
.alert-item--warning .icon { color: var(--lolu-warning); }
.alert-item--info .icon { color: var(--lolu-primary-text); }
.alert-item__text { flex: 1; min-width: 0; }
.alert-item__title { font-weight: 600; display: block; color: var(--lolu-text); }
.alert-item__sub { font-size: 12px; color: var(--lolu-muted); }
.alert-item__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; white-space: nowrap; }
.alert-item__act { margin-top: 6px; }
.alert-item form { margin: 0; }

/* Saldos (cartões de conta) */
.acc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.acc-card { border: 1px solid var(--lolu-border); border-radius: var(--lolu-radius-control); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.acc-card__value { font-weight: 700; font-size: 16px; text-align: right; }
.bank { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #fff; background: #475569; flex: 0 0 auto; }
.bank--b1 { background: #7C3AED; } .bank--b2 { background: #EA580C; } .bank--b3 { background: #0F766E; } .bank--b4 { background: #1D4ED8; } .bank--b5 { background: #111827; } .bank--b6 { background: #B91C1C; }

/* Gráficos */
.chart-box { position: relative; height: 300px; }
.chart-box--sm { height: 220px; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--lolu-muted); align-items: center; }
.legend-key { display: inline-flex; align-items: center; gap: 6px; }
.legend-key i { width: 10px; height: 10px; border-radius: 99px; display: inline-block; }
.legend-key i.line { width: 18px; height: 3px; border-radius: 2px; }
.legend-key i.dash { width: 18px; height: 0; border-top: 3px dashed; border-radius: 0; background: none !important; }
.donut-wrap { display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: center; }
.donut { position: relative; width: 180px; height: 180px; }
.donut__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.donut__center strong { font-size: 18px; }
.legend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.legend-list li { display: grid; grid-template-columns: 12px 1fr; gap: 8px; align-items: start; }
.legend-list i { width: 10px; height: 10px; border-radius: 99px; margin-top: 5px; }
.legend-list small { display: block; }
.text-alt summary { cursor: pointer; color: var(--lolu-primary-text); font-weight: 600; font-size: 13px; margin-top: 12px; }

/* DRE */
.dre-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--lolu-border); border-radius: var(--lolu-radius-card); background: var(--lolu-surface); }
.dre { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
.dre th, .dre td { padding: 10px 16px; border-bottom: 1px solid var(--lolu-border); text-align: right; white-space: nowrap; background: var(--lolu-surface); }
.dre thead th { position: sticky; top: 0; z-index: 2; background: var(--lolu-surface-2); font-weight: 700; font-size: 13px; }
.dre th:first-child, .dre td:first-child { position: sticky; left: 0; z-index: 1; text-align: left; min-width: 240px; border-right: 1px solid var(--lolu-border); }
.dre thead th:first-child { z-index: 3; }
.dre tr.is-strong td { font-weight: 700; background: var(--lolu-surface-2); }
.dre tr.is-sub td:first-child { padding-left: 32px; color: var(--lolu-muted); }
.dre tr.is-fund td { color: var(--lolu-primary-text); }
.dre tr.is-result td { color: var(--lolu-success); font-weight: 700; background: var(--lolu-success-soft); }
.dre .is-future { background: color-mix(in srgb, var(--lolu-primary-soft) 70%, var(--lolu-surface)); }
.dre thead .is-future { color: var(--lolu-primary-text); background: var(--lolu-primary-soft); }
.dre tr.is-strong td.is-future { background: color-mix(in srgb, var(--lolu-primary-soft) 85%, var(--lolu-surface-2)); }
.dre .is-current { box-shadow: inset 2px 0 0 var(--lolu-primary), inset -2px 0 0 var(--lolu-primary); }

/* Stepper (importar) */
.stepper { display: flex; align-items: center; gap: 16px; margin: 0 0 24px; padding: 0; list-style: none; }
.stepper li { display: flex; align-items: center; gap: 12px; flex: 1; color: var(--lolu-muted); font-weight: 500; }
.stepper li:last-child { flex: 0 0 auto; }
.stepper li::after { content: ''; flex: 1; height: 1px; background: var(--lolu-border); min-width: 24px; }
.stepper li:last-child::after { display: none; }
.stepper__n { width: 36px; height: 36px; border-radius: 99px; border: 1px solid var(--lolu-border); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: var(--lolu-surface); flex: 0 0 auto; }
.stepper [aria-current="step"] { color: var(--lolu-text); font-weight: 700; }
.stepper [aria-current="step"] .stepper__n { background: var(--lolu-primary-button); color: #fff; border-color: var(--lolu-primary-button); }
.stepper .is-done .stepper__n { background: var(--lolu-success-soft); color: var(--lolu-success); border-color: transparent; }
.dropzone { border: 2px dashed var(--lolu-border); border-radius: var(--lolu-radius-card); padding: 32px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: border-color .15s, background .15s; }
.dropzone.is-over { border-color: var(--lolu-primary); background: var(--lolu-primary-soft); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone__name { font-weight: 600; color: var(--lolu-text); }

/* Linha do tempo */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 20px 32px; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 18px; bottom: -2px; width: 2px; background: var(--lolu-border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ''; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 99px; background: var(--lolu-success); border: 3px solid var(--lolu-surface); box-shadow: 0 0 0 1px var(--lolu-border); }
.timeline li.is-current::after { background: var(--lolu-surface); border: 3px solid var(--lolu-primary); box-shadow: none; }
.timeline li.is-next::after { background: var(--lolu-surface); border: 2px solid var(--lolu-border); box-shadow: none; }
.timeline strong { display: block; }
.timeline span { display: block; color: var(--lolu-muted); font-size: 13px; }

/* Lista de detalhes (chave/valor) */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.kv dt { color: var(--lolu-muted); font-size: 13px; margin-bottom: 4px; }
.kv dd { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.kv-list { list-style: none; margin: 0; padding: 0; }
.kv-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--lolu-border); }
.kv-list li:last-child { border-bottom: 0; }
.kv-list li span:first-child { color: var(--lolu-muted); }
.divider { height: 1px; background: var(--lolu-border); margin: 20px 0; border: 0; }

/* Interruptor */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { width: 48px; height: 28px; border-radius: 99px; background: var(--lolu-border); position: relative; transition: background .15s; flex: 0 0 auto; }
.switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 99px; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .switch__track { background: var(--lolu-primary-button); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--lolu-focus); outline-offset: 2px; }
.switch--green input:checked + .switch__track { background: var(--lolu-success); }

/* Blocos de lista (regras, caixinhas de configuração) */
.block { border: 1px solid var(--lolu-border); border-radius: var(--lolu-radius-card); padding: 20px; background: var(--lolu-surface); }
.block + .block { margin-top: 16px; }
.block__head { display: flex; align-items: flex-start; gap: 16px; }
.block__title { font-weight: 700; }
.block__body { flex: 1; min-width: 0; }
.block__test { margin-top: 16px; padding: 14px 16px; background: var(--lolu-surface-2); border-radius: var(--lolu-radius-control); }
.flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--lolu-muted); font-size: 13px; }
.flow strong { color: var(--lolu-text); font-weight: 500; }

/* Cartões de orçamento, caixinha, conta, espaço */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bcard { display: flex; flex-direction: column; gap: 14px; }
.bcard__head { display: flex; align-items: center; gap: 12px; }
.bcard__title { font-weight: 700; font-size: 16px; flex: 1; min-width: 0; }
.bcard__nums { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bcard__nums strong { font-size: 18px; }
.bcard__foot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--lolu-muted); }
.selcard { display: block; border: 1px solid var(--lolu-border); border-radius: var(--lolu-radius-card); padding: 16px 20px; background: var(--lolu-surface); color: var(--lolu-text); }
.selcard:hover { text-decoration: none; border-color: color-mix(in srgb, var(--lolu-primary) 40%, var(--lolu-border)); }
.selcard[aria-current="true"] { border: 2px solid var(--lolu-primary); background: color-mix(in srgb, var(--lolu-primary-soft) 55%, var(--lolu-surface)); }
.selcard + .selcard { margin-top: 12px; }
.card--current { border: 2px solid var(--lolu-primary); }

/* Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--lolu-surface); }
.auth__brand { background: linear-gradient(160deg, #FFF1E8 0%, #FFE4D2 100%); padding: 72px 10% 48px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.auth__brand img { width: 150px; height: auto; margin-bottom: 72px; }
.auth__brand h1 { font-size: 40px; line-height: 50px; color: #111827; max-width: 460px; }
.auth__brand p { font-size: 18px; line-height: 28px; color: #475569; margin-top: 16px; max-width: 460px; }
.auth__list { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-direction: column; gap: 16px; position: relative; z-index: 1; }
.auth__list li { display: flex; align-items: center; gap: 12px; color: #111827; font-size: 15px; }
.auth__list .ico { width: 28px; height: 28px; border-radius: 99px; background: #EA580C; color: #fff; }
.auth__list .ico .icon { width: 16px; height: 16px; }
.auth__shape { position: absolute; border-radius: 50% 50% 0 0; background: rgba(234, 88, 12, .12); pointer-events: none; }
.auth__shape--1 { width: 320px; height: 320px; left: -80px; bottom: -120px; }
.auth__shape--2 { width: 260px; height: 260px; left: 200px; bottom: -150px; background: rgba(234, 88, 12, .18); }
.auth__form { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth__box { width: 100%; max-width: 440px; }
.auth__box h2 { font-size: 26px; line-height: 34px; font-weight: 700; }
.auth__box .page-head__sub { margin-bottom: 32px; }
.auth--simple { grid-template-columns: 1fr; place-items: center; background: var(--lolu-background); padding: 24px; }
.auth--simple .auth__box { background: var(--lolu-surface); border: 1px solid var(--lolu-border); border-radius: var(--lolu-radius-card); padding: 32px; box-shadow: var(--lolu-shadow); max-width: 520px; }
.auth--simple .auth__logo { width: 96px; margin-bottom: 24px; }

/* Categorizar: painel lateral */
.inbox { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.inbox__panel { position: sticky; top: 24px; }
.inbox tr.is-focus td { background: var(--lolu-primary-soft); }
.suggest { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--lolu-radius-control); background: var(--lolu-surface-2); border: 1px solid var(--lolu-border); max-width: 260px; }
.suggest strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-why { font-size: 12px; line-height: 16px; color: var(--lolu-muted); display: block; margin-top: 4px; max-width: 220px; }
.inbox .table td, .inbox .table th { padding-left: 12px; padding-right: 12px; }
.inbox .desc { min-width: 150px; }
.inbox-edit td { background: var(--lolu-surface-2) !important; }
.inbox-fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; padding: 8px 0; }
.inbox-fields label { font-size: 13px; }
.split-btn { display: inline-flex; gap: 6px; }

/* Dívidas: lista + detalhe */
.debts { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 24px; align-items: start; }

/* Conteúdo das telas integrado aos componentes comuns. */
.page > .card, .page > section, .page > details { margin-bottom: 24px; }
.card > h2, .card > form > h2 { margin-bottom: 16px; }
.kpi > .label { color: var(--lolu-muted); font-weight: 500; }
.inbox-row { padding: 16px; border: 1px solid var(--lolu-border); border-radius: 8px; margin-top: 12px; }
details > summary { cursor: pointer; font-weight: 600; }
details[open] > summary { margin-bottom: 16px; }
.updated { font-size: 12px; color: var(--lolu-muted); max-width: 65ch; }
.alert { padding: 16px; background: var(--lolu-warning-soft); color: var(--lolu-warning); border-radius: 8px; margin-bottom: 16px; }
.progress.over > span { background: var(--lolu-danger); }
.dre-table th:first-child, .dre-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--lolu-surface); min-width: 210px; }
.dre-table th { position: sticky; top: 0; z-index: 2; }
.dre-table .is-future { background: var(--lolu-primary-soft); }
.dre-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.table-wrap:has(.dre-table) { max-height: 600px; }
.account-card .kv { margin-top: 20px; }
.form-grid > div > label { display: block; margin-bottom: 6px; }
.form-grid > div { min-width: 0; }
.btn-link { border: 0; background: transparent; color: var(--lolu-primary-text); font: inherit; cursor: pointer; }
.card:target { outline: 2px solid var(--lolu-focus); outline-offset: 4px; }
@media (max-width:1199px) { .grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:767px) { .form-grid > [style*="grid-column"] { grid-column: auto !important; } .updated { max-width:100%; } }
/* Responsivo */
@media (max-width: 1199px) {
    :root { --lolu-sidebar: 192px; }
    .page { padding: 24px; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-main, .grid-side, .inbox, .debts { grid-template-columns: minmax(0, 1fr); }
    .inbox__panel { position: static; }
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .subnav { position: static; flex-direction: row; overflow-x: auto; }
    .subnav a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
    .subnav a[aria-current="page"] { border-bottom-color: var(--lolu-primary); }
    .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .stat-strip > div { border-left: 0; padding: 0; }
    .auth__brand { padding: 48px 32px; }
}
@media (max-width: 767px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; width: 280px; transform: translateX(-100%); visibility: hidden;
        transition: transform .2s, visibility .2s; box-shadow: none;
    }
    .app.nav-open .sidebar { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(17,24,39,.3); }
    .nav-scrim { display: none; }
    .app.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(17,24,39,.4); z-index: 40; }
    .mobilebar {
        display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--lolu-surface); border-bottom: 1px solid var(--lolu-border);
        position: sticky; top: 0; z-index: 30;
    }
    .mobilebar img { width: 64px; height: auto; }
    .page { padding: 16px; }
    h1 { font-size: 24px; line-height: 32px; }
    .page-head { margin-bottom: 16px; }
    .page-head__actions { width: 100%; }
    .page-head__actions > .btn--primary { flex: 1; }
    .grid-2, .grid-3, .grid-4, .cards, .cards-2, .form-grid, .form-grid-3, .kpis-3, .kpis-2 { grid-template-columns: minmax(0, 1fr); }
    .span-2 { grid-column: auto; }
    .card { padding: 16px; }
    .card--flush { padding: 0; }
    .card--flush .table th:first-child, .card--flush .table td:first-child { padding-left: 16px; }
    .card--flush .table th:last-child, .card--flush .table td:last-child { padding-right: 16px; }
    .kpi { padding: 16px; }
    .kpi__value { font-size: 24px; line-height: 30px; }
    .filters > div { flex: 1 1 140px; }
    .filters > .field:first-of-type { flex-basis: 100%; }
    .typepick { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .month-nav__label { min-width: 0; padding: 0 12px; flex: 1; }
    .month-nav { width: 100%; }
    .page-head__actions .month-nav { width: 100%; }
    .donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
    .stepper li span:not(.stepper__n) { display: none; }
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth__brand { padding: 32px 24px; }
    .auth__brand img { margin-bottom: 24px; width: 110px; }
    .auth__brand h1 { font-size: 28px; line-height: 36px; }
    .auth__brand p, .auth__list, .auth__shape { display: none; }
    .auth__form { padding: 32px 16px; align-items: flex-start; }
    .kv { grid-template-columns: minmax(0, 1fr); }
    .pager { padding: 12px 16px; }
    .stat-strip { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .tabs a, .tabs button { padding: 10px 14px; font-size: 14px; }
}
@media (min-width: 480px) and (max-width: 767px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 479px) {
    .kpis { grid-template-columns: minmax(0, 1fr); }
    .filters > div { flex-basis: 100%; }
}
@media print {
    .sidebar, .mobilebar, .page-head__actions, .filters, .btn, .pager, .bulkbar { display: none !important; }
    .page { padding: 0; }
}

/* DRE: linhas de destaque também na primeira coluna (cabeçalho de linha). */
.dre tbody th { font-size: 14px; }
.dre tr.is-strong th { background: var(--lolu-surface-2); }
.dre tr.is-result th { background: var(--lolu-success-soft); color: var(--lolu-success); }
.dre tr.is-fund th { color: var(--lolu-primary-text); }
.dre tr.is-sub th { padding-left: 32px; color: var(--lolu-muted); }

.cat { white-space: nowrap; }
.table td.nowrap-cell, .table .who { white-space: nowrap; }
