:root {
  --ground: #eef2f0;
  --surface: #ffffff;
  --surface-2: #f6f8f7;
  --ink: #132420;
  --muted: #5a6b66;
  --faint: #8a9994;
  --line: #dbe3e0;
  --accent: #0a6b5e;
  --accent-ink: #ffffff;
  --accent-soft: #dcefeb;
  --money: #9a6414;
  --money-soft: #f6ead6;
  --ok: #1f7a45; --ok-soft: #dff1e5;
  --warn: #9a6200; --warn-soft: #fbeccd;
  --bad: #b3261e; --bad-soft: #fbe2df;
  --info: #3d5a80; --info-soft: #e2e9f3;
  --shadow: 0 1px 2px rgba(19, 36, 32, .06), 0 8px 24px rgba(19, 36, 32, .08);
  --radius: 10px;
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0e1513; --surface: #151f1c; --surface-2: #1a2522; --ink: #e3ebe8; --muted: #9aaba5; --faint: #6f807a;
    --line: #26332f; --accent: #43b9a4; --accent-ink: #06201b; --accent-soft: #173a33;
    --money: #e2ab52; --money-soft: #3a2c14;
    --ok: #5fcf8a; --ok-soft: #143222; --warn: #e8b04a; --warn-soft: #3a2c10; --bad: #f08a80; --bad-soft: #3d1a17;
    --info: #9bb7de; --info-soft: #1b2738; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0e1513; --surface: #151f1c; --surface-2: #1a2522; --ink: #e3ebe8; --muted: #9aaba5; --faint: #6f807a;
  --line: #26332f; --accent: #43b9a4; --accent-ink: #06201b; --accent-soft: #173a33;
  --money: #e2ab52; --money-soft: #3a2c14;
  --ok: #5fcf8a; --ok-soft: #143222; --warn: #e8b04a; --warn-soft: #3a2c10; --bad: #f08a80; --bad-soft: #3d1a17;
  --info: #9bb7de; --info-soft: #1b2738; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 650; letter-spacing: -.01em; text-wrap: balance; margin: 0; }
h1 { font-size: 26px; line-height: 1.15; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-size: .92em; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.money { color: var(--money); }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* ---------- Estrutura ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 20px; height: 20px; }
.brand b { font-family: var(--f-display); font-size: 17px; display: block; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav .sep { height: 1px; background: var(--line); margin: 8px 6px; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 8px; display: flex; flex-direction: column; gap: 8px; }
.demo-flag { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.4; }

.main { min-width: 0; padding: 26px 32px 60px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Superfícies ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-body { padding: 16px 18px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi .v { font-family: var(--f-display); font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.kpi .d { font-size: 12px; color: var(--muted); }
.up { color: var(--ok); } .down { color: var(--bad); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
td.r, th.r { text-align: right; }
td { font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface-2); }
tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 0; }
tr.sub td { background: var(--surface-2); font-size: 13px; }
tr.sub td:first-child { padding-left: 34px; }
.cell-2 { display: flex; flex-direction: column; line-height: 1.3; }
.cell-2 small { color: var(--muted); font-size: 12px; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }

/* ---------- Controles ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); padding: 7px 13px; border-radius: 8px;
  cursor: pointer; font-weight: 550; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--faint); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .label { font-size: 12px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.search .input { padding-left: 32px; min-width: 220px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 9px; padding: 3px; background: var(--surface-2); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 550; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- Estados ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.vencendo, .chip.aviso { background: var(--warn-soft); color: var(--warn); }
.chip.vencido, .chip.critico, .chip.erro { background: var(--bad-soft); color: var(--bad); }
.chip.pendente, .chip.info { background: var(--info-soft); color: var(--info); }
.chip.neutro { background: var(--surface-2); color: var(--muted); }
.pct { display: inline-block; background: var(--money-soft); color: var(--money); font-weight: 650; border-radius: 6px; padding: 1px 7px; font-size: 13px; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 5px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* ---------- Gráfico ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font: 11px var(--f-body); }
.chart .bar { fill: var(--accent); }
.chart .bar.cur { fill: var(--accent); }
.chart .bar.past { fill: var(--accent); opacity: .45; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .lbl { fill: var(--ink); font-weight: 600; }
.chart .com { fill: var(--money); font-weight: 600; }

/* ---------- Alertas ---------- */
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.alerts li:last-child { border-bottom: 0; }
.alerts .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; }
.dot.critico { background: var(--bad); } .dot.aviso { background: var(--warn); } .dot.info { background: var(--info); }

/* ---------- Gaveta lateral ---------- */
.scrim { position: fixed; inset: 0; background: rgba(8, 18, 15, .38); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); z-index: 41; box-shadow: var(--shadow);
  display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-body { padding: 18px 22px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; flex: 1; }
.drawer-foot { padding: 14px 22px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.section { display: flex; flex-direction: column; gap: 12px; }
.section > h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 7px 14px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.box { border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); padding: 12px 14px; }
.list-rows { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.list-rows > div { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list-rows > div:last-child { border-bottom: 0; }
.list-rows .grow { flex: 1; min-width: 140px; }
.chave { font-family: var(--f-mono); font-size: 12.5px; word-spacing: -2px; overflow-wrap: anywhere; }

/* ---------- Relatórios ---------- */
.rel-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.filters { display: flex; flex-direction: column; gap: 18px; padding: 16px; position: sticky; top: 16px; }
.pick { border: 1px solid var(--line); border-radius: 9px; max-height: 210px; overflow-y: auto; background: var(--surface); }
.pick label { display: flex; gap: 8px; align-items: center; padding: 6px 10px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--line); }
.pick label:last-child { border-bottom: 0; }
.pick label:hover { background: var(--surface-2); }
.pick input { accent-color: var(--accent); }
.pick-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.linkbtn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 12px; font-weight: 600; }
.sumstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.sumstrip > div { padding: 14px 18px; }
.sumstrip > div + div { border-left: 1px solid var(--line); }
.sumstrip .v { font-family: var(--f-display); font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rel-title { padding: 16px 18px 0; }
.rel-title h2 { font-size: 17px; }

/* ---------- Toast / login ---------- */
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--surface);
  padding: 10px 16px; border-radius: 9px; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); font-weight: 500; }
.toast.erro { background: var(--bad); color: #fff; }
.center-page { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login { width: min(380px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Adesão (visão do associado) ---------- */
.adesao-wrap { width: min(680px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.adesao-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.adesao-top { padding: 22px 26px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.steps { display: flex; list-style: none; margin: 0; padding: 0 26px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.steps li { padding: 12px 0; margin-right: 22px; font-size: 13px; color: var(--faint); font-weight: 600; white-space: nowrap; display: flex; gap: 7px; align-items: center; border-bottom: 2px solid transparent; }
.steps li b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.steps li.on { color: var(--ink); border-bottom-color: var(--accent); }
.steps li.on b { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.steps li.done { color: var(--muted); }
.steps li.done b { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.adesao-body { padding: 24px 26px; display: flex; flex-direction: column; gap: 18px; }
.adesao-body h2 { font-size: 21px; }
.adesao-body p { margin: 0; max-width: 64ch; }
.adesao-foot { padding: 16px 26px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; background: var(--surface-2); flex-wrap: wrap; }
.dados { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dados > div { padding: 11px 14px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); margin: 0 -1px -1px 0; min-width: 0; }
.dados > div.full { grid-column: 1 / -1; }
.dados b { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.dados span { overflow-wrap: anywhere; }
.drop { border: 1.5px dashed var(--faint); border-radius: 12px; padding: 26px 18px; text-align: center; cursor: pointer; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop svg { width: 30px; height: 30px; color: var(--accent); }
.drop.has { border-style: solid; border-color: var(--accent); }
.pw { position: relative; }
.pw .input { padding-right: 70px; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.note { display: flex; gap: 10px; font-size: 13px; color: var(--muted); align-items: flex-start; }
.note svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--accent); }
.termo { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--surface-2); font-size: 13px; line-height: 1.6; }
.termo p + p { margin-top: 8px; }
.sucesso { text-align: center; align-items: center; }
.sucesso .big { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.sucesso .big svg { width: 28px; height: 28px; }
.err-msg { background: var(--bad-soft); color: var(--bad); border-radius: 9px; padding: 10px 12px; font-size: 13px; font-weight: 500; }
.preview-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .grid-2, .rel-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; top: env(safe-area-inset-top, 0px); height: auto; z-index: 30; flex-direction: row; align-items: center; padding: 10px 16px; gap: 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand small, .side-foot, .nav .sep { display: none; }
  .nav { flex-direction: row; }
  .nav a { padding: 7px 9px; white-space: nowrap; }
  .nav a span { display: none; }
  .nav a[aria-current="page"] span { display: inline; }
  .main { padding: 20px 16px 50px; }
  .kpis, .sumstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3), .sumstrip > div:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3), .sumstrip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .form-grid, .dados { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .search .input { min-width: 0; }
  .adesao-body, .adesao-top, .adesao-foot { padding-left: 18px; padding-right: 18px; }
  .steps { padding: 0 18px; }
  h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: no-preference) {
  .drawer { animation: slidein .18s ease-out; }
  @keyframes slidein { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}
.grid-2 > *, .rel-layout > *, .filters > * { min-width: 0; }
input[type="date"].input { min-width: 0; }
@media (max-width: 860px) { .side { max-width: 100vw; } }

/* ---------- Usuários e perfis ---------- */
.user-box { display: flex; gap: 10px; align-items: center; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.chip.perfil-admin { background: var(--accent); color: var(--accent-ink); }
.chip.perfil-gestor { background: var(--accent-soft); color: var(--accent); }
.chip.perfil-consulta { background: var(--info-soft); color: var(--info); }
.chip.perfil-associado { background: var(--money-soft); color: var(--money); }
.chip[class*="perfil-"]::before { display: none; }
.perfis-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.perfil-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.perfil-card p { margin: 0; font-size: 13px; color: var(--muted); }
.senha-box { border-color: var(--accent); background: var(--accent-soft); display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 1100px) { .perfis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .side .user-box, .side .toolbar { display: none; } }
@media (max-width: 520px) { .perfis-grid { grid-template-columns: 1fr; } }
.so-mobile { display: none; }
@media (max-width: 860px) { .so-mobile { display: inline-flex; margin-left: auto; padding: 2px; flex: none; } }
.drawer .user-box, .drawer .toolbar { display: flex; }

/* ---------- Relatório: tipo e impressão ---------- */
.seg-col { display: flex; flex-direction: column; align-items: stretch; }
.seg-col button { text-align: left; }
tr.grupo td { font-weight: 600; }
@media print {
  :root { --ground: #fff; --surface: #fff; --surface-2: #f4f6f5; }
  body { background: #fff; }
  .side, .filters, .nao-imprimir, .page-head, #drawer-host, .toast { display: none !important; }
  .app, .rel-layout { display: block; }
  .main { padding: 0; }
  .panel { border: 0; }
  tr { break-inside: avoid; }
}
tr.cab-notas td { font-weight: 600; padding-top: 12px; }
tr.sub.cab-notas td { padding-left: 34px; }
tr.nota-linha td { font-size: 13px; padding-top: 6px; padding-bottom: 6px; border-bottom-style: dashed; }
tr.nota-linha.nv1 td:first-child { padding-left: 34px; }
tr.nota-linha.nv2 td:first-child { padding-left: 58px; }
tr.subtotal td { font-weight: 650; background: var(--surface-2); }
tr.subtotal.nv1 td:first-child { padding-left: 34px; }
tr.subtotal.nv2 td:first-child { padding-left: 58px; }
tr.subtotal.forn td { background: var(--accent-soft); color: var(--ink); }

/* ---------- Filtro tipo funil ---------- */
.ms { position: relative; }
.ms-btn { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; cursor: pointer; text-align: left; font-weight: 550; }
.ms-btn svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.ms-btn.ativo { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ms-btn.ativo svg { color: var(--accent); }
.ms-resumo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-seta { color: var(--faint); font-size: 12px; }
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ms-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12px; max-width: 100%; }
.ms-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 5px; border-radius: 50%; }
.ms-chip button:hover { color: var(--bad); background: var(--bad-soft); }
.ms-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 25; width: max(100%, 340px); max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ms-pop .search .input { min-width: 0; }
.ms-acts { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; flex-wrap: wrap; }
.ms-lista { max-height: min(52vh, 420px); }
.ms-lista label { padding: 8px 10px; font-size: 14px; }
.ms-vazio { padding: 12px; margin: 0; font-size: 13px; }
.ms-rodape { display: flex; justify-content: flex-end; }
.ms.aberto { z-index: 26; }
/* O painel de filtros rola junto com a página, para a janela do funil nunca ficar fora da tela. */
.filters { position: static; }
.dot.ok-dot { background: var(--ok); }
