/* Sistema Financeiro — identidade LXP EAD: barra lateral preta, conteúdo off-white, amarelo da marca nas ações principais.
   Faixa colorida sob o topo identifica a empresa ativa. */
@font-face { font-family: "Nippo"; font-weight: 400; font-display: swap; src: url(/static/brand/nippo-400.woff2) format("woff2"); }
@font-face { font-family: "Nippo"; font-weight: 500; font-display: swap; src: url(/static/brand/nippo-500.woff2) format("woff2"); }
@font-face { font-family: "Nippo"; font-weight: 700; font-display: swap; src: url(/static/brand/nippo-700.woff2) format("woff2"); }
:root {
  --bg: #F0EFEC; --surface: #FFFFFF; --fg: #111211; --muted: #5C5D57; --faint: #8E8F89;
  --line: #DCDBD5; --line-strong: #C9C8C1; --hover: #E7E6E0;
  --emp: #6E6C24; --emp-soft: #EEEDCB;            /* acento da marca (oliva) */
  --brand-yellow: #EEE757; --brand-olive: #9D9B32; --btn: #EEE757; --btn-ink: #111211;
  --side: #111211; --side-ink: #D8D7D1; --side-muted: #8E8F89; --side-active: #23241F; --side-line: #262721;
  --empresa: #EEE757;                              /* cor da empresa ativa */
  --ok: #2E7D4F; --ok-soft: #E2F1E7; --warn: #8A5A00; --warn-soft: #FBF0D6; --bad: #B3261E; --bad-soft: #FBE6E4;
  --info: #3D5A99; --info-soft: #E5EBF6;
  --display: "Nippo", "Archivo", system-ui, sans-serif;
  --sans: "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Noto Sans", system-ui, sans-serif;
  --radius: 12px;
  --control-h: 38px;
  --shadow: 0 1px 2px rgba(17, 18, 17, .04), 0 1px 1px rgba(17, 18, 17, .03);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--sans); background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; }
a { color: var(--emp); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font: 700 26px/1.15 var(--display); letter-spacing: .01em; }
h2 { font: 600 16px/1.3 "Archivo", var(--sans); }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
.num, td.num, th.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pos { color: var(--ok); } .neg { color: var(--bad); }

/* topo */
.topbar { background: var(--side); color: var(--side-ink); display: flex; align-items: center; gap: 16px; border-bottom: 3px solid var(--empresa);
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(20px, env(safe-area-inset-left, 0px)); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--side-muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.brand img { height: 22px; width: auto; display: block; }
.brand span { border-left: 1px solid var(--side-line); padding-left: 10px; }
.switcher { display: flex; align-items: center; gap: 10px; margin-left: 8px; }
.switcher select { font: 600 14px var(--sans); color: var(--fg); background: var(--empresa); border: 0; border-radius: 6px; padding: 7px 30px 7px 12px; }
.switcher .regime { font-size: 12px; color: var(--side-muted); white-space: nowrap; }
.topbar .spacer { flex: 1; }
.topbar .user { font-size: 13px; color: var(--side-ink); white-space: nowrap; }
.topbar button.link { background: var(--side-active); color: var(--side-ink); border: 1px solid var(--side-line); border-radius: 6px; padding: 6px 12px; font: inherit; cursor: pointer; }
.topbar button.link:hover { color: #fff; border-color: var(--side-muted); }

.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: calc(100vh - 56px); }
nav.side { background: var(--side); border-right: 1px solid var(--side-line); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
nav.side a { color: var(--side-ink); font-weight: 400; padding: 9px 12px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; }
nav.side a:hover { background: var(--side-active); color: #fff; text-decoration: none; }
nav.side a.on { background: var(--side-active); color: var(--brand-yellow); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand-yellow); }
nav.side .sep { height: 1px; background: var(--side-line); margin: 10px 4px; }
nav.side .badge { background: var(--warn-soft); color: var(--warn); }

main { padding: 24px max(16px, env(safe-area-inset-right, 0px)) 48px max(24px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* blocos */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel > .body { padding: 16px; }
.grid { display: grid; gap: 16px; }
.grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.grid.h2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi .value { font: 700 22px var(--display); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.alerta { border-color: #f3c9c4; }
.kpi.alerta .value { color: var(--bad); }

/* tabelas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-family: "Archivo", var(--sans); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: #fafbfa; white-space: nowrap; }
tbody tr:hover { background: var(--hover); }
tfoot td { font-weight: 600; border-bottom: 0; background: #fafbfa; }
td .sub { display: block; font-size: 12px; color: var(--muted); }
td.acoes { white-space: nowrap; text-align: right; }
td.acoes form { display: inline; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* estados */
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.aberto { background: var(--info-soft); color: var(--info); }
.pill.atrasado { background: var(--bad-soft); color: var(--bad); }
.pill.pago { background: var(--ok-soft); color: var(--ok); }
.pill.neutro { background: var(--hover); color: var(--muted); }
.pill.aviso { background: var(--warn-soft); color: var(--warn); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; font-size: 11px; font-weight: 700; text-align: center; }

/* formulários */
form.stack { display: flex; flex-direction: column; gap: 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
label, .label { font-size: 12px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=file], input[type=search], select, textarea {
  font: 14px var(--sans); color: var(--fg); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 11px; width: 100%; min-width: 0;
  height: var(--control-h); }
input[type=file] { padding: 6px 10px; }
select { padding-right: 28px; }
textarea { height: auto; padding: 9px 11px; line-height: 1.5; }
input.money { font-family: var(--mono); text-align: right; }
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--emp); outline-offset: -1px; border-color: transparent; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fg); font-weight: 400; }
.hint { font-size: 12px; color: var(--faint); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.filters .field { width: auto; }
.filters input[type=text] { width: 220px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 13px var(--sans); border-radius: 8px; padding: 0 14px; height: var(--control-h); border: 1px solid var(--line-strong); background: #fff; color: var(--fg); cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.btn.primary:hover { filter: brightness(.95); }
.btn.danger { color: var(--bad); border-color: #f0c4bf; }
.btn.sm { padding: 0 10px; font-size: 12px; height: 30px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--emp); }
.btn:focus-visible, a:focus-visible, nav.side a:focus-visible { outline: 2px solid var(--brand-olive); outline-offset: 2px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.flash { padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.erro { background: var(--bad-soft); color: var(--bad); }
.flash.aviso { background: var(--warn-soft); color: var(--warn); }

/* gráfico */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .area { fill: var(--emp-soft); }
.chart .line { fill: none; stroke: var(--emp); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .zero { stroke: var(--bad); stroke-dasharray: 4 4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .tick { font: 11px var(--sans); fill: var(--muted); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* listas de chave/valor */
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* DRE */
table.dre td, table.dre th { padding: 7px 10px; }
table.dre tr.total td { font-weight: 700; background: #fafbfa; border-top: 1px solid var(--line-strong); }
table.dre tr.grupo td:first-child { font-weight: 600; }
table.dre tr.det td { font-size: 12px; color: var(--muted); }
table.dre tr.det td:first-child { padding-left: 28px; }
table.dre td:first-child, table.dre th:first-child { position: sticky; left: 0; background: var(--surface); min-width: 220px; }
table.dre tr.total td:first-child { background: #fafbfa; }

/* login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth { background: var(--side); }
.auth .card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.auth .marca { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 22px; color: var(--side-muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.auth .marca img { height: 40px; width: auto; }
.auth .wrap { width: 100%; max-width: 400px; }
.auth h1 { font-size: 22px; }

details.box { border: 1px solid var(--line); border-radius: 6px; }
details.box summary { cursor: pointer; padding: 8px 12px; font-weight: 600; font-size: 13px; }
details.box > div { padding: 8px 12px 12px; }

@media (max-width: 1100px) { .grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.c2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  nav.side { flex-direction: row; align-items: center; align-self: start; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--side-line); position: sticky; top: 52px; z-index: 10; }
  nav.side a { white-space: nowrap; }
  nav.side a.on { box-shadow: inset 0 -3px 0 var(--brand-yellow); }
  .brand span { display: none; }
  nav.side .sep { display: none; }
  main { padding: 16px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topbar .user { display: none; }
  .switcher .regime { display: none; }
  .grid.k4, .grid.h2 { grid-template-columns: 1fr; }
  .filters input[type=text] { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* seletor de período */
.periodo { position: relative; }
.periodo-btn { color: var(--fg); border-color: var(--brand-olive); }
.periodo-btn svg { color: var(--emp); }
.periodo-btn svg { flex: none; }
.pp { position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(20, 30, 25, .16); display: grid;
  grid-template-columns: 300px 190px; grid-template-areas: "cal atalhos" "rodape rodape"; width: max-content; max-width: calc(100vw - 16px); }
.pp-cal { grid-area: cal; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pp-info { display: flex; flex-direction: column; gap: 4px; }
.pp-faixa { border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 10px; text-align: center; font-family: var(--mono); font-size: 13px; }
.pp-nav { display: flex; align-items: center; justify-content: space-between; }
.pp-nav strong { font-size: 14px; }
.pp-nav button { border: 0; background: none; font-size: 18px; color: var(--fg); cursor: pointer; width: 32px; height: 32px; border-radius: 6px; }
.pp-nav button:hover { background: var(--hover); }
.pp-dias { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 3px; }
.pp-sem { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.pp-dias button { border: 0; background: none; height: 34px; font: 13px var(--sans); color: var(--fg); cursor: pointer; border-radius: 0; font-variant-numeric: tabular-nums; }
.pp-dias button:hover { background: var(--hover); border-radius: 6px; }
.pp-dias button.fora { color: var(--faint); }
.pp-dias button.hoje { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.pp-dias button.faixa { background: var(--emp-soft); }
.pp-dias button.ini, .pp-dias button.fim { background: var(--fg); color: var(--brand-yellow); font-weight: 600; }
.pp-dias button.ini { border-radius: 6px 0 0 6px; }
.pp-dias button.fim { border-radius: 0 6px 6px 0; }
.pp-dias button.ini.fim { border-radius: 6px; }
.pp-dias button:nth-child(7n + 1).faixa { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.pp-dias button:nth-child(7n).faixa { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.pp-meses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pp-meses button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 10px 0; font: 13px var(--sans); cursor: pointer; text-transform: capitalize; }
.pp-meses button:hover { background: var(--hover); }
.pp-meses button.sel { background: var(--fg); border-color: var(--fg); color: var(--brand-yellow); font-weight: 600; }
.pp-atalhos { grid-area: atalhos; border-left: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.pp-atalhos button { text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: 6px; font: 600 13px var(--sans); color: var(--fg); cursor: pointer; }
.pp-atalhos button:hover { background: var(--hover); }
.pp-atalhos button.on { background: var(--emp-soft); color: var(--emp); }
.pp-rodape { grid-area: rodape; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.pp button:focus-visible { outline: 2px solid var(--emp); outline-offset: 1px; }
@media (max-width: 560px) {
  .pp { grid-template-columns: minmax(0, 1fr); grid-template-areas: "atalhos" "cal" "rodape"; width: calc(100vw - 16px); }
  .pp-atalhos { border-left: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .pp-atalhos button { padding: 6px 10px; background: var(--hover); }
}

/* login com Google */
.ou { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; }
.ou::before, .ou::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.google { justify-content: center; padding: 9px 14px; font-weight: 600; }
a.kpi, a.panel { color: inherit; font-weight: inherit; }
a.kpi:hover, a.panel:hover { text-decoration: none; border-color: var(--brand-olive); }

/* visão geral: período, calendário de saídas, categorias, histórico, metas */
.grid.t3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.periodo-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.periodo-nav strong { font: 700 18px var(--display); min-width: 150px; text-align: center; }
.periodo-nav .btn.sm { font-size: 16px; padding: 2px 12px; }
.kpi-inline { font: 700 22px var(--display); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; padding: 3px; gap: 2px; background: var(--surface); }
.seg a { padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.seg a:hover { text-decoration: none; color: var(--fg); }
.seg a.on { background: var(--btn); color: var(--btn-ink); }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-sem { font: 600 11px "Archivo", var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-dia { display: flex; flex-direction: column; justify-content: space-between; min-height: 54px; padding: 6px 7px; border-radius: 7px;
  background: var(--bg); color: var(--fg); font-weight: 400; border: 1px solid transparent; min-width: 0; }
.cal-dia:hover { text-decoration: none; border-color: var(--brand-olive); }
.cal-dia.futuro { opacity: .45; }
.cal-n { font-size: 11px; color: var(--muted); }
.cal-v { font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-dia.n1, .cal-legenda .n1 { background: #F4F0B8; }
.cal-dia.n2, .cal-legenda .n2 { background: #EEE757; }
.cal-dia.n3, .cal-legenda .n3 { background: #C9C53F; }
.cal-dia.n4, .cal-legenda .n4 { background: #9D9B32; }
.cal-dia.n4 .cal-n, .cal-dia.n4 .cal-v { color: #fff; }
.cal-dia.n3 .cal-n, .cal-dia.n2 .cal-n { color: var(--fg); }
.cal-resumo { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-end; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.cal-resumo > div { display: flex; flex-direction: column; gap: 2px; }
.cal-resumo .label { text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }
.cal-legenda { margin-left: auto; display: flex; align-items: center; gap: 3px; }
.cal-legenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.rosca { position: relative; width: 190px; margin: 4px auto 18px; }
.rosca svg { width: 100%; height: auto; display: block; transform: none; }
.rosca-centro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.rosca-centro strong { font: 700 15px var(--display); }
.cat-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.cat-lista li { display: grid; grid-template-columns: minmax(110px, 1.2fr) minmax(60px, 2fr) auto 52px; align-items: center; gap: 12px; font-size: 13px; }
.cat-nome { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-nome i, .meta-nome i { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.cat-barra { height: 6px; background: var(--hover); border-radius: 99px; overflow: hidden; }
.cat-barra span { display: block; height: 100%; border-radius: 99px; }
.link-acao { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-weight: 600; }
.link-acao .badge { background: var(--hover); color: var(--fg); }

.chart .bar-in, .legenda i.bar-in { fill: #2E7D4F; background: #2E7D4F; }
.chart .bar-out, .legenda i.bar-out { fill: #C0504D; background: #C0504D; }
.legenda { display: flex; justify-content: center; gap: 18px; margin-top: 6px; color: var(--muted); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.metas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 28px; }
.meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.meta-topo { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.meta-nome { display: flex; align-items: center; gap: 7px; font-weight: 600; min-width: 0; }
.meta-pct { font-weight: 600; font-variant-numeric: tabular-nums; }
.meta-barra { height: 8px; background: var(--hover); border-radius: 99px; overflow: hidden; }
.meta-barra span { display: block; height: 100%; background: var(--brand-olive); border-radius: 99px; }
.meta.estourou .meta-barra span { background: var(--bad); }
.meta.estourou .meta-pct { color: var(--bad); }
.meta.atencao .meta-barra span { background: #D9822B; }
.meta.atencao .meta-pct { color: #A65F14; }
.meta.ok .meta-barra span { background: var(--brand-olive); }
.meta-rodape { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.ponto { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ocultar valores */
.topbar .olho { display: inline-flex; align-items: center; gap: 6px; }
body.oculto .num, body.oculto .value, body.oculto .valor, body.oculto .kpi-inline, body.oculto dl.kv dd,
body.oculto .rosca-centro strong, body.oculto .cal-v { filter: blur(7px); user-select: none; }
body.oculto .chart svg rect, body.oculto .chart svg .tick { filter: blur(3px); }

@media (max-width: 1100px) { .grid.t3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .cal-dia { min-height: 40px; padding: 4px; }
  .cal-v { display: none; }
  .cat-lista li { grid-template-columns: minmax(0, 1fr) auto 44px; }
  .cat-barra { display: none; }
  .topbar .olho span { display: none; }
}

/* ---------- listas de títulos: abas, barra de filtros, menu de ações ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.kpi.destaque { border-color: var(--brand-olive); }
.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 12px 11px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--fg); text-decoration: none; }
.tabs a.on { color: var(--fg); border-bottom-color: var(--fg); }
.tab-n { font-size: 11px; background: var(--hover); color: var(--muted); border-radius: 99px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.tabs a.on .tab-n { background: var(--brand-yellow); color: var(--fg); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.toolbar select { width: auto; max-width: 220px; }
.toolbar-info { margin-left: auto; }
.busca { position: relative; flex: 1 1 280px; max-width: 420px; }
.busca svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.busca input { padding-left: 34px; }
.filters select, .filters input { height: var(--control-h); }

table.titulos td { padding-top: 11px; padding-bottom: 11px; }
table.titulos .col-contato { min-width: 160px; max-width: 240px; font-weight: 600; }
table.titulos .col-hist { min-width: 220px; max-width: 420px; }
table.titulos .col-cat { max-width: 200px; color: var(--muted); font-size: 13px; }
table.titulos .col-sit { white-space: nowrap; }
a.hist { color: var(--fg); font-weight: 400; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a.hist:hover { color: var(--emp); }
a.linha-link { color: var(--fg); font-weight: 500; }
tr.linha-nf td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
tr.linha-paga td { color: var(--muted); }
tr.linha-paga .col-contato { color: var(--fg); }
.chip { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--line-strong); color: var(--muted); background: #fff; white-space: nowrap; }
a.chip:hover { text-decoration: none; border-color: var(--fg); }
.chip.nf-autorizada { background: var(--ok-soft); border-color: #bfe0cb; color: var(--ok); }
.chip.nf-rejeitada { background: var(--bad-soft); border-color: #f0c4bf; color: var(--bad); }
.chip.nf-rascunho, .chip.nf-processando, .chip.nf-verificar { background: var(--warn-soft); border-color: #ecd59f; color: var(--warn); }
.chip.nf-cancelada { text-decoration: line-through; }
td.acoes { width: 1%; }
td.acoes > * { vertical-align: middle; }
.btn.icone { width: 30px; padding: 0; }
.menu { position: relative; display: inline-block; margin-left: 4px; }
.menu-lista { position: fixed; z-index: 60; min-width: 230px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(20, 30, 25, .16); padding: 6px; text-align: left; }
.menu-lista a, .menu-lista button, .menu-lista .desativado { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px;
  background: none; font: 500 13px var(--sans); color: var(--fg); cursor: pointer; text-align: left; white-space: nowrap; }
.menu-lista a:hover, .menu-lista button:hover { background: var(--hover); text-decoration: none; }
.menu-lista form { display: block; margin: 0; }
.menu-lista hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.menu-lista .desativado { color: var(--faint); cursor: not-allowed; }
.menu-lista .desativado em { margin-left: auto; font-style: normal; font-size: 11px; background: var(--hover); border-radius: 99px; padding: 1px 7px; }
.menu-lista .perigo { color: var(--bad); }

/* ---------- formulário de título ---------- */
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
h1 .pill { vertical-align: middle; font: 600 12px var(--sans); margin-left: 6px; position: relative; top: -3px; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.form-layout.sem-lado { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
.fgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.fgrid .c4 { grid-column: span 4; } .fgrid .c6 { grid-column: span 6; } .fgrid .c8 { grid-column: span 8; } .fgrid .c12 { grid-column: 1 / -1; }
.hint.linha { display: flex; justify-content: space-between; gap: 12px; }
.abas { border-top: 1px solid var(--line); padding-top: 4px; }
.abas-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.abas-nav button { border: 0; background: none; padding: 10px 12px 9px; font: 600 13px var(--sans); color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.abas-nav button[aria-selected=true] { color: var(--fg); border-bottom-color: var(--fg); }
.abas-nav button:hover { color: var(--fg); }
.switch { display: inline-flex; align-items: center; gap: 10px; font: 400 14px var(--sans); color: var(--fg); cursor: pointer; min-height: var(--control-h); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 36px; height: 20px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--emp); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand-olive); outline-offset: 2px; }
.previa-lista { display: flex; flex-wrap: wrap; gap: 6px; }
.previa-lista span { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.info-box { background: var(--bg); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.form-actions.rodape { border-top: 1px solid var(--line); padding-top: 16px; }
.form-actions .spacer { flex: 1; }
.lado { display: flex; flex-direction: column; gap: 16px; }
.lado .panel > header { padding: 12px 16px; }
.lado .body { display: flex; flex-direction: column; gap: 10px; }
.btn.bloco { width: 100%; }
.lado-acoes { display: flex; gap: 8px; justify-content: flex-end; }
.lado-acoes form { margin: 0; }
dl.kv dd.txt { font-family: var(--sans); }
.hist-curto { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; border-top: 1px solid var(--line); padding-top: 10px; }
.periodo-btn { height: var(--control-h); }

@media (max-width: 1100px) { .form-layout { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .fgrid .c4, .fgrid .c6, .fgrid .c8 { grid-column: 1 / -1; }
  .toolbar select, .busca { max-width: none; flex: 1 1 100%; }
  .toolbar-info { margin-left: 0; }
  table.titulos .col-cat, table.titulos th:nth-child(4) { display: none; }
}
.periodo-nav .btn.icone { width: var(--control-h); font-size: 18px; }

/* janela de confirmação (conta recorrente) */
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(17, 18, 17, .28); }
dialog.modal::backdrop { background: rgba(17, 18, 17, .45); }
.modal-corpo { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
fieldset.opcoes { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
fieldset.opcoes legend { margin-bottom: 6px; }
.opcao { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; font-weight: 400; color: var(--fg); }
.opcao:has(input:checked) { border-color: var(--fg); background: var(--emp-soft); }
.opcao:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.opcao input { margin-top: 3px; }
.opcao > span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }

/* integrações e conferência */
.toolbar.sem-borda { border: 0; padding: 0; }
form.sugestao { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 3px 0; }
form.sugestao + form.sugestao { border-top: 1px dashed var(--line); }
.chip.cob-a_receber { background: var(--info-soft); border-color: #c9d4ec; color: var(--info); }
.chip.cob-recebido { background: var(--ok-soft); border-color: #bfe0cb; color: var(--ok); }
.chip.cob-atrasado, .chip.cob-erro { background: var(--bad-soft); border-color: #f0c4bf; color: var(--bad); }
.chip.cob-cancelado, .chip.cob-expirado { text-decoration: line-through; }
.copiar { display: flex; gap: 8px; align-items: stretch; }
.copiar input, .copiar textarea { font-family: var(--mono); font-size: 13px; }
.copiar textarea { min-height: 64px; }
.opcoes-banco { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
