/* ============================================================
   Painel de Contas — UI
   Sidebar recolhível, tema claro/escuro, modais HTMX.
   Moderno, simples, destaques coerentes e contidos.
   ============================================================ */

:root {
    --bg: #f4f5f8;
    --surface: #ffffff;
    --surface-2: #f7f8fa;
    --sidebar-bg: #14161d;
    --sidebar-fg: #c7cbd4;
    --sidebar-muted: #8a90a0;
    --border: #e6e8ec;
    --border-strong: #d7dae1;
    --text: #1b2330;
    --muted: #6b7280;
    --muted-2: #98a0ad;

    --primary: #5b53f0;
    --primary-hover: #4a42e0;
    --primary-soft: #ecebfe;
    --on-primary: #ffffff;
    --ring: rgba(91, 83, 240, .32);

    --danger: #dc2626;
    --danger-soft: #fee2e2;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .05);
    --shadow-lg: 0 16px 40px rgba(16, 24, 40, .18), 0 4px 12px rgba(16, 24, 40, .08);

    --sidebar-w: 248px;
    --sidebar-cw: 76px;
}

html[data-theme="dark"] {
    --bg: #0e1014;
    --surface: #171a21;
    --surface-2: #1d212a;
    --sidebar-bg: #0a0b0f;
    --sidebar-fg: #c2c7d2;
    --sidebar-muted: #767d8d;
    --border: #272b34;
    --border-strong: #333845;
    --text: #e7e9ee;
    --muted: #9aa1ad;
    --muted-2: #767d8d;
    --primary-soft: #221f4a;
    --ring: rgba(124, 116, 255, .4);
    --danger-soft: #3a1414;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 16px rgba(0, 0, 0, .35);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .12s ease; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

h1 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 20px; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 26px 0 12px; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    display: flex;
    flex-direction: column;
    padding: 14px 12px;
    z-index: 40;
    transition: width .18s ease, transform .2s ease;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 14px;
}
.sidebar-head .brand {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
}
.collapse-btn,
.icon-btn {
    background: transparent;
    color: var(--sidebar-muted);
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 9px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}
.collapse-btn:hover,
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.side-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-fg);
    font-weight: 500;
    font-size: .94rem;
    white-space: nowrap;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-item.ativo { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(91, 83, 240, .4); }
.nav-item .ic { width: 20px; text-align: center; font-size: 1.05rem; flex: none; }

.nav-sub {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 1px 0 5px 0;
    padding-left: 30px;
}
.nav-sub a {
    color: var(--sidebar-muted);
    font-size: .86rem;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.nav-sub a:hover { background: rgba(255, 255, 255, .06); color: var(--sidebar-fg); text-decoration: none; }
.nav-sub a.ativo { color: #fff; background: rgba(91, 83, 240, .22); }

.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; margin-top: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 10px; overflow: hidden; }
.avatar {
    width: 34px; height: 34px; flex: none;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff; font-weight: 700; font-size: .9rem;
    text-transform: uppercase;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.user-meta strong { color: #fff; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: var(--sidebar-muted); font-size: .76rem; text-transform: capitalize; }
.foot-actions { display: flex; gap: 6px; padding: 0 4px; }
.foot-actions form { margin: 0; }

/* Recolhida: só ícones */
html.nav-collapsed .sidebar { width: var(--sidebar-cw); padding: 14px 10px; }
html.nav-collapsed .sidebar .lb,
html.nav-collapsed .sidebar .brand,
html.nav-collapsed .sidebar .nav-sub,
html.nav-collapsed .sidebar .user-meta { display: none; }
html.nav-collapsed .sidebar .nav-item { justify-content: center; padding: 11px 0; gap: 0; }
html.nav-collapsed .sidebar-head { justify-content: center; }
html.nav-collapsed .collapse-btn { transform: rotate(180deg); }
html.nav-collapsed .user-chip { justify-content: center; }
html.nav-collapsed .foot-actions { justify-content: center; flex-wrap: wrap; }

/* Botão hamburguer + backdrop (mobile) */
.menu-btn {
    display: none;
    position: fixed; top: 12px; left: 12px; z-index: 50;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 8px 12px; font-size: 1.1rem; box-shadow: var(--shadow-sm);
}
.nav-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(10, 12, 18, .5);
    z-index: 35;
}

/* ── Conteúdo ───────────────────────────────────────────── */
main.container {
    margin-left: var(--sidebar-w);
    padding: 30px clamp(18px, 3vw, 40px) 72px;
    transition: margin-left .18s ease;
}
html.nav-collapsed main.container { margin-left: var(--sidebar-cw); }

/* ── Botões ─────────────────────────────────────────────── */
button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    background: var(--primary); color: var(--on-primary);
    border: 1px solid transparent; border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: .9rem; font-weight: 600; font-family: inherit; line-height: 1.2;
    cursor: pointer; box-shadow: var(--shadow-sm);
    transition: background .12s ease, box-shadow .12s ease, transform .04s ease, border-color .12s ease;
}
button:hover, .btn:hover { background: var(--primary-hover); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }

.btn-secundario, button.btn-secundario {
    background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
}
.btn-secundario:hover, button.btn-secundario:hover { background: var(--surface-2); }

.link-btn, button.link-btn {
    background: none; border: none; color: var(--primary); padding: 0;
    font: inherit; font-weight: 500; box-shadow: none; cursor: pointer;
}
.link-btn:hover { background: none; text-decoration: underline; }
.link-suave { color: var(--muted); font-size: .9rem; }

/* ── Cabeçalho de página ────────────────────────────────── */
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 22px;
}
.page-head h1 { margin: 0; }

/* ── Avisos / erros ─────────────────────────────────────── */
.aviso, .erro {
    border-radius: var(--radius-sm); padding: 11px 14px;
    font-size: .9rem; margin-bottom: 18px; border: 1px solid transparent;
}
.aviso { background: var(--primary-soft); color: var(--primary-hover); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.erro { background: var(--danger-soft); color: #c2410c; border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
html[data-theme="dark"] .aviso { color: #c8c4ff; }
html[data-theme="dark"] .erro { color: #fca5a5; }

/* ── Formulários ────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 16px; }
.form > label, .campos label {
    display: flex; flex-direction: column; gap: 6px;
    font-size: .78rem; font-weight: 600; letter-spacing: .01em; color: var(--muted);
}

input, select, textarea {
    width: 100%; padding: 9px 11px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    font-size: .92rem; font-family: inherit;
    transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring);
}
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

/* Fieldsets dos formulários */
.form fieldset {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; margin: 0; background: var(--surface-2);
}
.form fieldset legend {
    padding: 0 6px; font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}
.form fieldset > label { margin-bottom: 12px; }
.form fieldset > label:last-child { margin-bottom: 0; }

/* ── Checkboxes / radios (maiores e com destaque) ───────── */
input[type="checkbox"], input[type="radio"] {
    appearance: none; -webkit-appearance: none;
    width: 20px; height: 20px; flex: none; margin: 0;
    border: 1.5px solid var(--border-strong); border-radius: 6px;
    background: var(--surface); cursor: pointer; position: relative;
    transition: background .12s ease, border-color .12s ease;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--primary); }
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--primary); border-color: var(--primary); }
input[type="checkbox"]:checked::after {
    content: ""; position: absolute; left: 6px; top: 2px;
    width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
input[type="radio"]:checked::after {
    content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff;
}
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible {
    outline: none; box-shadow: 0 0 0 3px var(--ring);
}

label.check {
    flex-direction: row; align-items: center; gap: 10px;
    font-size: .9rem; font-weight: 500; color: var(--text);
    padding: 9px 12px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface);
    cursor: pointer; transition: border-color .12s ease, background .12s ease;
}
label.check:hover { border-color: var(--border-strong); }
label.check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

.checkgrid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px; margin-top: 8px;
}

.acoes { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 8px; }

.inline-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.inline-form select { width: auto; padding: 6px 9px; font-size: .85rem; }
.inline-form button { padding: 6px 12px; font-size: .82rem; }

/* ── Filtros ────────────────────────────────────────────── */
.filtros {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 22px;
}
.filtros > fieldset { border: none; margin: 0; padding: 0; background: transparent; }
.filtros legend {
    font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); padding: 0; margin-bottom: 14px;
}
.filtros fieldset fieldset {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px 14px; margin-bottom: 14px; background: var(--surface-2);
}
.filtros fieldset fieldset legend { margin-bottom: 8px; padding: 0 4px; }

.campos {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px; align-items: end;
}
.campos select, .campos input { font-size: .9rem; padding: 8px 10px; }
.campos label.check { align-self: center; }

/* ── Tabelas ────────────────────────────────────────────── */
table {
    width: 100%; border-collapse: collapse; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
}
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: .9rem; }
th {
    background: var(--surface-2); color: var(--muted); font-weight: 600;
    font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
}
tbody tr { transition: background .1s ease; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td.valor, th.valor { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.check, td.check { width: 36px; text-align: center; }
.vazio { color: var(--muted); text-align: center; padding: 28px; }
table.detalhe th { width: 190px; text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--text); }

.resumo { color: var(--muted); font-size: .9rem; margin: 0 0 14px; }
.total-geral { font-size: 1rem; }
.total-geral strong { font-size: 1.25rem; }
.voltar { display: inline-block; margin-top: 20px; color: var(--muted); }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
    display: inline-block; padding: 3px 11px; border-radius: 999px;
    font-size: .74rem; font-weight: 600; text-transform: capitalize;
    background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.badge-pendente  { background: #fef3c7; color: #92400e; }
.badge-agendado  { background: #dbeafe; color: #1e40af; }
.badge-pago      { background: #d1fae5; color: #065f46; }
.badge-vencido   { background: #fee2e2; color: #991b1b; }
.badge-cancelado { background: #e5e7eb; color: #374151; }

/* ── Modal HTMX (criar/editar cadastros + boleto) ───────── */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(10, 12, 18, .55);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 6vh 16px 16px;
    overflow-y: auto;
    animation: modal-fade .14s ease;
}
.modal-card {
    position: relative;
    width: 100%; max-width: 560px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 26px 28px;
    animation: modal-pop .16s ease;
}
.modal-card h1 { font-size: 1.25rem; padding-right: 28px; }
.modal-card .form { max-width: none !important; }
.modal-close {
    position: absolute; top: 16px; right: 16px;
    background: transparent; color: var(--muted); border: none; box-shadow: none;
    font-size: 1.1rem; padding: 2px 8px; border-radius: var(--radius-sm); cursor: pointer; line-height: 1;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(-8px) scale(.99); } }

/* Preview de documento (boleto) dentro do modal: iframe ocupa o card. */
.modal-card:has(.pdf-frame) { max-width: 860px; }
.pdf-frame {
    width: 100%; height: 78vh; margin-top: 4px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2);
}

/* ── Login ──────────────────────────────────────────────── */
.login-box {
    max-width: 380px; margin: 12vh auto 0; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 34px;
}
.login-box h1 { margin-top: 0; }
.login-box button { width: 100%; margin-top: 4px; }

/* ── DRE ────────────────────────────────────────────────── */
.dre-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 16px; margin-bottom: 18px;
}
.dre-head h1 { margin: 0 0 4px; }
.dre-head .link-suave { margin: 0; max-width: 52ch; }
.dre-ano {
    display: flex; align-items: flex-end; gap: 10px; margin: 0;
    background: none; border: none; box-shadow: none; padding: 0;
}
.dre-ano label {
    display: flex; flex-direction: column; gap: 5px;
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted);
}
.dre-ano select { width: auto; min-width: 104px; }
/* Por que o botão de exportar está desabilitado */
.motivo-bloqueio {
    margin-top: 6px; font-size: .74rem; line-height: 1.35;
    color: var(--muted); max-width: 26ch; white-space: normal;
}
/* Lista recolhível dos fornecedores barrados na exportação */
.barrados { margin: 12px 0; }
.barrados summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.barrados table { margin-top: 10px; }
/* Aviso curto dentro de uma célula (ex.: empresa sem CNPJ na exportação) */
.erro-inline { color: var(--erro, #c0392b); font-size: .78rem; }
/* Ações do cabeçalho (link da exportação + filtro de período) alinhadas à base */
.dre-head-acoes { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.dre-head-acoes .link-suave { padding-bottom: 9px; white-space: nowrap; }

/* Empresas e — visualmente — uma barra de abas */
.dre-empresas {
    display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px;
    padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.dre-tab {
    padding: 8px 16px; border: 1px solid var(--border-strong);
    border-radius: 999px; background: var(--surface);
    color: var(--text); font-weight: 600; font-size: .88rem;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.dre-tab:hover { background: var(--surface-2); border-color: var(--primary); text-decoration: none; }
.dre-tab.ativo {
    background: var(--primary); color: var(--on-primary);
    border-color: var(--primary); box-shadow: 0 4px 12px var(--ring);
}

.dre-empresa { margin-bottom: 34px; }
.dre-empresa-head {
    display: flex; align-items: baseline; justify-content: space-between;
    flex-wrap: wrap; gap: 10px; margin-bottom: 10px;
}
.dre-empresa-head h2 { margin: 0; font-size: 1.12rem; }
.dre-total-chip {
    font-size: .82rem; color: var(--muted);
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 999px; padding: 5px 14px;
}
.dre-total-chip strong { color: var(--primary-hover); margin-left: 4px; font-size: .95rem; }
html[data-theme="dark"] .dre-total-chip strong { color: #c8c4ff; }

/* Contêiner com rolagem horizontal; a tabela perde borda/raio próprios. */
.dre-scroll {
    overflow-x: auto; border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
table.dre { border: none; border-radius: 0; box-shadow: none; }
table.dre th, table.dre td { padding: 9px 14px; }

/* Cabeçalho dos meses: link clicável com seta. */
.mes-toggle {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--text); font-weight: 700; font-size: .72rem;
    text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.mes-toggle:hover { color: var(--primary); text-decoration: none; }
.mes-toggle .caret { color: var(--muted-2); font-size: .8rem; }
.mes-toggle:hover .caret { color: var(--primary); }
/* Mês sem lançamento: rótulo apagado, sem ação de clique. */
.mes-vazio { color: var(--muted-2); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }

/* Coluna "Categoria" congelada à esquerda. */
table.dre .col-cat {
    position: sticky; left: 0; z-index: 2; background: var(--surface-2);
    text-align: left; text-transform: none; letter-spacing: 0;
}
table.dre tbody th.col-cat {
    font-size: .85rem; font-weight: 600; color: var(--text); background: var(--surface);
}

/* Coluna "Total" congelada à direita + destaque. */
table.dre .col-total { position: sticky; right: 0; z-index: 2; border-left: 2px solid var(--border-strong); }
table.dre thead .col-total, table.dre tfoot .col-total { background: var(--surface-2); }
table.dre tbody td.col-total { background: var(--surface); font-weight: 600; color: var(--text); }

/* Mês expandido: realça as colunas de dia e o cabeçalho do mês. */
table.dre th.mes-exp { border-bottom: 1px solid var(--border); background: var(--primary-soft); }
table.dre .dia { background: var(--primary-soft); }
table.dre th.dia { font-size: .68rem; padding: 6px 9px; }
html[data-theme="dark"] table.dre th.mes-exp,
html[data-theme="dark"] table.dre .dia { background: rgba(91, 83, 240, .14); }

/* Linha de totais do ano. */
table.dre tfoot th, table.dre tfoot td {
    border-top: 2px solid var(--border-strong); background: var(--surface-2); font-weight: 700;
}
table.dre tfoot .col-cat { background: var(--surface-2); }

/* Hover: mantém as células congeladas coerentes com a linha. */
table.dre tbody tr:hover th.col-cat,
table.dre tbody tr:hover td.col-total { background: var(--surface-2); }

/* Zeros apagados para destacar os valores reais. */
.dre .zero { color: var(--muted-2); }
table.dre tfoot td, table.dre tfoot th { border-top: 2px solid var(--border-strong); }

/* ── Salários: cartões de totais do mês ─────────────────── */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 0 0 22px;
}
.card {
    display: flex; flex-direction: column; gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}
.card .rotulo {
    color: var(--muted); font-size: .74rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
}
.card strong { font-size: 1.28rem; font-variant-numeric: tabular-nums; }
.card.ok      { border-left-color: #10b981; }
.card.alerta  { border-left-color: #f59e0b; }
.card.semana  { border-left-color: var(--primary); }
.card.perigo  { border-left-color: var(--danger); }

/* Linha de quem vence nesta semana e ainda não foi pago. */
tbody tr.linha-semana td { background: var(--primary-soft); }
tbody tr.linha-semana:hover td { background: var(--primary-soft); }
.chip-semana {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: .72rem; font-weight: 600;
    background: var(--primary); color: var(--on-primary);
}
tbody tr.inativo td { opacity: .62; }
/* Campo de valor da baixa: cabe na linha da tabela sem esticar. */
.valor-baixa { width: 108px; text-align: right; font-variant-numeric: tabular-nums; }
.inline-form input { padding: 6px 9px; font-size: .85rem; width: auto; }

/* ── Responsivo ─────────────────────────────────────────── */
@media (max-width: 860px) {
    .menu-btn { display: block; }
    html.nav-open .menu-btn { display: none; }
    .sidebar { transform: translateX(-100%); width: var(--sidebar-w); }
    html.nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
    html.nav-open .nav-backdrop { display: block; }
    html.nav-collapsed .sidebar { width: var(--sidebar-w); padding: 14px 12px; }
    html.nav-collapsed .sidebar .lb,
    html.nav-collapsed .sidebar .brand,
    html.nav-collapsed .sidebar .nav-sub,
    html.nav-collapsed .sidebar .user-meta { display: revert; }
    main.container, html.nav-collapsed main.container {
        margin-left: 0; padding: 64px 16px 48px;
    }
}
