/* stiweb: design system da casa (padrão aprovado em 12/11/2026, artifact KuYtLVzq71cU7wqFBSnJ86).
   Tokens em :root, tema escuro automático pelo sistema operacional. */
:root {
  --bg: #f3f6f6;
  --surface: #ffffff;
  --surface-2: #eaf0ef;
  --line: #d5dfdd;
  --fg: #16201f;
  --muted: #5b6b69;
  --accent: #0d7a68;
  --accent-ink: #ffffff;
  --accent-soft: #dcefeb;
  --danger: #c2412d;
  --danger-soft: #fbe7e3;
  --ok: #1f8a4c;
  --ok-soft: #e0f3e7;
  --warn: #b7791f;
  --warn-soft: #fbf0dc;
  --side-bg: #12302c;
  --side-fg: #cfe3df;
  --side-active: #1d4a43;
  --shadow: 0 1px 2px rgba(16, 40, 36, .06), 0 8px 24px rgba(16, 40, 36, .06);
  --f-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --f-body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", Consolas, monospace;
  --r: 10px;
  --side-w: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1716; --surface: #16211f; --surface-2: #1c2a28; --line: #2a3b38;
    --fg: #e4eeec; --muted: #93a7a3; --accent: #3cc2a6; --accent-ink: #062520; --accent-soft: #173a34;
    --danger: #f08470; --danger-soft: #3a1d18; --ok: #5fd08f; --ok-soft: #173325; --warn: #e5b45a; --warn-soft: #3a2c12;
    --side-bg: #0b1211; --side-fg: #a9c2bd; --side-active: #17302c;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1716; --surface: #16211f; --surface-2: #1c2a28; --line: #2a3b38;
  --fg: #e4eeec; --muted: #93a7a3; --accent: #3cc2a6; --accent-ink: #062520; --accent-soft: #173a34;
  --danger: #f08470; --danger-soft: #3a1d18; --ok: #5fd08f; --ok-soft: #173325; --warn: #e5b45a; --warn-soft: #3a2c12;
  --side-bg: #0b1211; --side-fg: #a9c2bd; --side-active: #17302c;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 var(--f-body); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.ico { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100%; }

/* ---------- menu lateral ---------- */
.side { background: var(--side-bg); color: var(--side-fg); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 17px var(--f-display); color: #fff; padding: 0 8px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-size: 14px; }
.side-empresa { padding: 0 4px; }
.side-empresa label { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; padding: 0 6px 4px; }
.side-empresa select, .side-empresa .nome { width: 100%; background: var(--side-active); color: #fff; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; padding: 8px 10px; font-weight: 600; font-size: 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; padding: 12px 10px 4px; }
.nav-label .ico { width: 13px; height: 13px; }
.nav-grupo { display: flex; flex-direction: column; }
.nav-modulo { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; margin-top: 2px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; font-size: 14.5px; font-weight: 600; text-align: left; cursor: pointer; }
.nav-modulo:hover { background: var(--side-active); }
.nav-modulo span { flex: 1; }
.nav-modulo .seta { width: 14px; height: 14px; opacity: .6; transition: transform .15s; }
.nav-modulo[aria-expanded="true"] .seta { transform: rotate(90deg); }
.nav-itens { display: none; flex-direction: column; gap: 2px; padding: 2px 0 6px 14px; }
.nav-modulo[aria-expanded="true"] + .nav-itens { display: flex; }
.nav .nav-itens a { font-size: 14px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 14.5px; }
.nav a:hover { background: var(--side-active); }
.nav a.atual { background: var(--side-active); color: #fff; font-weight: 600; }
.nav .ico { opacity: .85; }
.side-user { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 12px 6px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.side-user .quem { min-width: 0; flex: 1; line-height: 1.3; }
.side-user .quem strong { display: block; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .quem span { opacity: .65; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--side-active); display: grid; place-items: center; font-weight: 600; color: #fff; flex: none; }
.side-acoes { display: flex; gap: 2px; }
.side-acoes a { color: var(--side-fg); padding: 6px; border-radius: 6px; display: grid; place-items: center; }
.side-acoes a:hover { background: var(--side-active); color: #fff; }

/* ---------- área principal ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; gap: 12px; padding: 12px 16px; background: var(--side-bg); color: #fff; }
.faixa-suporte { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 24px; background: var(--warn-soft); border-bottom: 1px solid var(--line); font-size: 14px; }
.faixa-suporte .btn { margin-left: auto; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; color: inherit; }
.icon-btn .ico { width: 20px; height: 20px; }
.content { padding: 28px 16px 120px; width: 100%; max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 900px) { .content { padding-left: 40px; padding-right: 40px; } }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.crumbs span + span::before { content: "/"; margin-right: 6px; opacity: .6; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.page-head h1 { margin: 4px 0 0; font: 600 clamp(22px, 3vw, 28px)/1.2 var(--f-display); text-wrap: balance; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.code { font-family: var(--f-mono); font-size: 12.5px; background: var(--surface-2); padding: 2px 8px; border-radius: 6px; color: var(--fg); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.on { background: var(--ok-soft); color: var(--ok); }
.pill.off { background: var(--surface-2); color: var(--muted); }
.pill.adm { background: var(--accent-soft); color: var(--accent); }
.pill.cancelada { background: var(--danger-soft); color: var(--danger); }

/* ---------- abas ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab .badge { background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; }
.tab .count { background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 0 7px; }

/* ---------- cartões e formulário ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; }
.card.flush { padding: 0; overflow: hidden; }
.section + .section { margin-top: 28px; padding-top: 24px; border-top: 1px dashed var(--line); }
.section h2 { margin: 0 0 4px; font: 600 16px var(--f-display); }
.section p.hint, p.hint { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 18px; }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; }
.c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c9 { grid-column: span 9; } .c12 { grid-column: span 12; }
@media (max-width: 720px) { .grid > * { grid-column: span 12; } .grid > .half-m { grid-column: span 6; } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: 13px; font-weight: 600; }
.req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; transition: border-color .15s, box-shadow .15s; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.mono { font-family: var(--f-mono); font-size: 14px; letter-spacing: .01em; }
.textarea { resize: vertical; min-height: 88px; }
.input.num, .grade .num .input { text-align: right; font-variant-numeric: tabular-nums; }
.input-prefixo { position: relative; }
.input-prefixo > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.input-prefixo > .input { padding-left: 38px; }
.grade .input { padding: 6px 8px; min-width: 90px; }
.grade td.leitura { color: var(--muted); }
.grade tr.pendente td { background: var(--warn-soft); }
.grade td .field { gap: 4px; }
.help { font-size: 12.5px; color: var(--muted); }
/* h:message só é renderizado quando há erro: o :has destaca o campo */
.err { font-size: 12.5px; color: var(--danger); display: block; }
.field:has(.err) .input, .field:has(.err) .select, .field:has(.err) .combo-btn { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* combo com busca (stiweb.js transforma <select data-busca>) */
.combo { position: relative; }
.combo-btn { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 36px 9px 12px; cursor: pointer; position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 42px; }
.combo-btn::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); }
.combo-btn.vazio { color: var(--muted); }
.combo-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.combo-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 8px; }
.combo-pop .input { margin-bottom: 6px; }
.combo-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.combo-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.combo-list li.ativo { background: var(--accent-soft); }
.combo-list li[aria-selected="true"] { font-weight: 600; color: var(--accent); }
.combo-vazio { padding: 10px; color: var(--muted); font-size: 13px; }

/* switch e checkbox */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.switch-row strong { display: block; font-size: 14px; }
.switch-row span { font-size: 12.5px; color: var(--muted); }
.switch { position: relative; width: 42px; height: 24px; flex: none; display: inline-block; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; width: 100%; height: 100%; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

/* ---------- botões ---------- */
.btn { border: 1px solid transparent; border-radius: 8px; padding: 9px 18px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; line-height: 1.4; }
.btn .ico { width: 16px; height: 16px; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--fg); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-acao { background: none; border: 0; padding: 6px; border-radius: 6px; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.link-acao:hover { background: var(--surface-2); color: var(--accent); }
.link-acao.perigo:hover { color: var(--danger); background: var(--danger-soft); }

/* ---------- listagem ---------- */
.filtros { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.filtros .field { flex: 1 1 220px; }
.filtros .field.estreito { flex: 0 1 180px; }
.busca { position: relative; }
.busca .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.busca .input { padding-left: 38px; }
.tabela-wrap { overflow-x: auto; }
table.grade { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.grade th { text-align: left; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 18px; background: var(--surface-2); white-space: nowrap; }
.grade td { padding: 11px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.grade tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.grade .acoes { text-align: right; white-space: nowrap; width: 1%; }
.grade .num { text-align: right; font-variant-numeric: tabular-nums; }
.grade .sub { display: block; font-size: 12.5px; color: var(--muted); }
.vazio-lista { padding: 40px 18px; text-align: center; color: var(--muted); }
.paginacao { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.paginacao .btns { display: flex; gap: 6px; align-items: center; }

/* ---------- barra de ações fixa ---------- */
.actions { position: fixed; left: var(--side-w); right: 0; bottom: 0; z-index: 15; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 16px; }
.actions-in { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.actions .btns { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.dirty { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dirty::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dirty.is-dirty { color: var(--fg); }
.dirty.is-dirty::before { background: #d99a1e; }

/* ---------- telas liberadas (usuário) ---------- */
.grupo-telas + .grupo-telas { margin-top: 20px; }
.grupo-telas header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.grupo-telas h3 { margin: 0; font: 600 14px var(--f-display); }
.telas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.tela { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.tela:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.tela input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.tela small { display: block; color: var(--muted); font-family: var(--f-mono); font-size: 11.5px; }
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; background: var(--accent-soft); font-size: 14px; }
.aviso.alerta { background: var(--warn-soft); }
.aviso.erro { background: var(--danger-soft); color: var(--danger); }

/* ---------- toast ---------- */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 8px; box-shadow: var(--shadow); padding: 12px 14px; font-size: 14px; animation: entrar .2s ease-out; }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast strong { display: block; margin-bottom: 2px; }
@keyframes entrar { from { transform: translateY(-6px); opacity: 0; } }
.msg-dados { display: none; }

/* ---------- diálogo de confirmação ---------- */
dialog.confirmar { border: 1px solid var(--line); border-radius: 12px; padding: 0; background: var(--surface); color: var(--fg); box-shadow: var(--shadow); width: min(420px, calc(100vw - 32px)); }
dialog.confirmar::backdrop { background: rgba(10, 20, 18, .45); }
dialog.confirmar .corpo { padding: 22px 22px 6px; }
dialog.confirmar h2 { margin: 0 0 6px; font: 600 17px var(--f-display); }
dialog.confirmar p { margin: 0; color: var(--muted); }
dialog.confirmar .rodape { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 22px 20px; }

/* ---------- início ---------- */
.atalhos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.atalho { display: flex; gap: 12px; align-items: center; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: var(--fg); text-decoration: none; }
.atalho:hover { border-color: var(--accent); }
.atalho .ico-box { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.atalho .ico-box .ico { width: 20px; height: 20px; }
.atalho small { display: block; color: var(--muted); font-size: 12.5px; }

/* ---------- login ---------- */
.login-page { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.login-lado { background: var(--side-bg); color: var(--side-fg); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-lado h1 { font: 600 clamp(26px, 3.2vw, 36px)/1.2 var(--f-display); color: #fff; margin: 0 0 12px; max-width: 16ch; }
.login-lado p { margin: 0; max-width: 40ch; opacity: .8; }
.login-form { display: grid; place-items: center; padding: 32px 16px; }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 18px; }
.login-card h2 { font: 600 24px var(--f-display); margin: 0; }
@media (max-width: 820px) { .login-page { grid-template-columns: 1fr; } .login-lado { padding: 28px 20px; gap: 24px; } .login-lado h1 { font-size: 24px; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- celular ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .topbar { display: flex; }
  .actions { left: 0; }
}

/* ---------- DRE (financeiro/dre.xhtml) ---------- */
.dre th, .dre td { padding: 8px 12px; }
.dre th:first-child, .dre td:first-child { position: sticky; left: 0; z-index: 1; min-width: 240px; background: var(--surface); }
.dre th:first-child { background: var(--surface-2); }
.dre tr.secao td { font-weight: 700; background: var(--surface-2); }
.dre tr.conta td:first-child { padding-left: 30px; }
.dre tr.resultado td { font-weight: 700; border-top: 2px solid var(--fg); }
.dre tr.fora td { color: var(--muted); }
.dre tr.fora td:first-child { padding-left: 30px; }
.dre tr.separador td { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); padding-top: 18px; }
.dre td.total { font-weight: 600; }
.dre td.muted { color: var(--muted); font-size: 13px; }
.dre td.neg { color: var(--danger); }
/* Telas com tabela larga (DRE): usam toda a largura disponível */
.content.largo { max-width: none; }
/* DRE com mais de 6 meses: compacta para caber 12 meses + total sem rolar */
.dre.compacto { font-size: 13px; }
.dre.compacto th, .dre.compacto td { padding: 6px 7px; white-space: nowrap; }
.dre.compacto th:first-child, .dre.compacto td:first-child { min-width: 180px; white-space: normal; }
.dre.compacto tr.conta td:first-child, .dre.compacto tr.fora td:first-child { padding-left: 18px; }

/* ---------- Fluxo de caixa (financeiro/fluxoCaixa.xhtml) ---------- */
.pill.warn { background: var(--warn-soft); color: var(--warn, #9a6700); }
.fluxo-alerta { background: var(--danger-soft); color: var(--danger); }
.fluxo td.ent { color: var(--ok); }
.fluxo td.sai { color: var(--danger); }
.fluxo td.neg { color: var(--danger); }
.fluxo td.saldo { font-weight: 600; }
.fluxo tr.inicio td { color: var(--muted); background: var(--surface-2); }
.fluxo tr.previsto td:not(.acoes) { font-style: italic; }
.fluxo tr.atrasado td { background: var(--warn-soft); }
.fluxo tr.negativo td.saldo { background: var(--danger-soft); }
.fluxo tr.aberto td { background: var(--accent-soft); }
.fluxo a.periodo { color: var(--fg); text-decoration: none; font-weight: 600; margin-right: 8px; }
.fluxo a.periodo:hover { text-decoration: underline; }
.fluxo tr.detalhe > td { background: var(--surface-2); padding: 10px 18px 14px 30px; }
.fluxo table.categorias { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.fluxo table.categorias th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 4px 8px; border-bottom: 1px solid var(--line); }
.fluxo table.categorias th.num { text-align: right; }
.fluxo table.categorias td { padding: 5px 8px; border-bottom: 1px solid var(--line); background: transparent; font-style: normal; }


/* ---------- Ajuda: botão "?" (layout), painel lateral (dialog) e central (ajuda.xhtml) ---------- */
.main { position: relative; }
.ajuda-btn { position: absolute; top: 18px; right: 20px; z-index: 5; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted);
  font: 600 13px var(--f-body, inherit); cursor: pointer; box-shadow: var(--shadow); }
.ajuda-btn:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 900px) { .ajuda-btn { display: none; } }
dialog.ajuda-painel { margin: 0 0 0 auto; padding: 0; border: 0; border-left: 1px solid var(--line); width: min(480px, 100vw);
  height: 100vh; max-height: 100vh; background: var(--surface); color: var(--fg); display: none; flex-direction: column;
  box-shadow: -12px 0 32px rgba(0,0,0,.18); }
dialog.ajuda-painel[open] { display: flex; animation: ajudaEntrar .18s ease-out; }
dialog.ajuda-painel::backdrop { background: rgba(10, 20, 18, .35); }
@keyframes ajudaEntrar { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.ajuda-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.ajuda-topo h2 { margin: 2px 0 0; font: 600 19px var(--f-display); }
.ajuda-rotulo { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.ajuda-corpo { flex: 1; overflow-y: auto; padding: 16px 22px 24px; }
.ajuda-rodape { padding: 12px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }
.ajuda-texto { font-size: 14.5px; line-height: 1.6; }
.ajuda-texto h3 { font: 600 15.5px var(--f-display); margin: 20px 0 6px; }
.ajuda-texto h3:first-child { margin-top: 4px; }
.ajuda-texto p { margin: 6px 0 10px; }
.ajuda-texto ul, .ajuda-texto ol { margin: 6px 0 12px; padding-left: 22px; }
.ajuda-texto li { margin: 3px 0; }
.ajuda-texto .dica, .ajuda-texto .atencao { padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: 14px; }
.ajuda-texto .dica { background: var(--accent-soft); }
.ajuda-texto .atencao { background: var(--warn-soft); }
.ajuda-texto .dica strong:first-child, .ajuda-texto .atencao strong:first-child { display: block; margin-bottom: 2px; }
.ajuda-texto dl { margin: 8px 0 12px; }
.ajuda-texto dt { font-weight: 600; margin-top: 8px; }
.ajuda-texto dd { margin: 2px 0 0 0; color: var(--muted); }
.ajuda-texto kbd { font-family: var(--f-mono); font-size: 12.5px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); }
.central-ajuda { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.central-ajuda .indice { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.central-ajuda .indice strong { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.central-ajuda .indice a { color: var(--fg); text-decoration: none; padding: 4px 8px; border-radius: 6px; }
.central-ajuda .indice a:hover { background: var(--surface-2); color: var(--accent); }
.central-ajuda .topico { scroll-margin-top: 16px; }
.central-ajuda .topico + .topico { margin-top: 16px; }
.central-ajuda .topico h2 { margin: 0 0 4px; font: 600 20px var(--f-display); }
.central-ajuda .topico .modulo { font-size: 12.5px; color: var(--muted); }
.central-ajuda .topico:target { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 900px) { .central-ajuda { grid-template-columns: 1fr; } .central-ajuda .indice { position: static; } }
.faixa-suporte + .ajuda-btn { top: 72px; }

/* ---------- Logo no login (painel escuro: versão de letras claras, img/logo-claro.png) ---------- */
.login-logo { display: block; width: min(300px, 100%); height: auto; }
@media (max-width: 820px) { .login-logo { width: 200px; } }
