/* ===== Tokens ===== */
:root {
  color-scheme: light;
  --bg: #f3f4f1;
  --surface: #ffffff;
  --surface-2: #f8f8f6;
  --surface-3: #eef0ec;
  --border: #e3e4df;
  --border-strong: #cdd0c8;
  --text: #15171a;
  --text-2: #4c4f55;
  --muted: #74777e;
  --accent: #0e7c7b;
  --accent-hover: #0b6766;
  --accent-soft: #e2f1f0;
  --accent-text: #0a5f5e;
  --on-accent: #ffffff;
  --sidebar: #11201f;
  --sidebar-text: #c6d4d2;
  --sidebar-muted: #7f9592;
  --sidebar-active: #1c3432;
  --sidebar-accent: #3cc4c2;
  --good: #0ca30c;
  --good-text: #006300;
  --good-soft: #e5f4e5;
  --warn: #fab219;
  --warn-text: #7a5300;
  --warn-soft: #fff3d6;
  --crit: #d03b3b;
  --crit-text: #b02a2a;
  --crit-soft: #fdeaea;
  --neutral-soft: #eef0ec;
  /* gráficos (paleta validada) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --grid: #e9e9e4;
  --axis: #c3c2b7;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111213;
    --surface: #1c1d1f;
    --surface-2: #222326;
    --surface-3: #2a2b2e;
    --border: #2f3033;
    --border-strong: #3e3f43;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --muted: #918f88;
    --accent: #2bb3b1;
    --accent-hover: #45c6c4;
    --accent-soft: #15302f;
    --accent-text: #6fd6d4;
    --on-accent: #052120;
    --sidebar: #0b0c0d;
    --sidebar-active: #1b2a29;
    --good-text: #4cc94c;
    --good-soft: #15301a;
    --warn-text: #fab219;
    --warn-soft: #382c10;
    --crit-text: #f07a7a;
    --crit-soft: #3a1b1b;
    --neutral-soft: #2a2b2e;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --grid: #2c2c2a;
    --axis: #3e3e3b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111213;
  --surface: #1c1d1f;
  --surface-2: #222326;
  --surface-3: #2a2b2e;
  --border: #2f3033;
  --border-strong: #3e3f43;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --muted: #918f88;
  --accent: #2bb3b1;
  --accent-hover: #45c6c4;
  --accent-soft: #15302f;
  --accent-text: #6fd6d4;
  --on-accent: #052120;
  --sidebar: #0b0c0d;
  --sidebar-active: #1b2a29;
  --good-text: #4cc94c;
  --good-soft: #15301a;
  --warn-text: #fab219;
  --warn-soft: #382c10;
  --crit-text: #f07a7a;
  --crit-soft: #3a1b1b;
  --neutral-soft: #2a2b2e;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --grid: #2c2c2a;
  --axis: #3e3e3b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent-text); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.25; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
small { font-size: 12px; }
.ico { flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== Estrutura ===== */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 8px;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: #0e7c7b; color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; letter-spacing: .02em;
}
.brand-mark.grande { width: 52px; height: 52px; font-size: 19px; border-radius: 14px; }
.brand-text strong { display: block; font-size: 14px; line-height: 1.2; }
.brand-text small { color: var(--sidebar-muted); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a, .nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: 8px; border: 0; background: none;
  color: var(--sidebar-text); text-decoration: none; font: inherit; font-weight: 500; cursor: pointer; text-align: left;
}
.nav a:hover, .nav-btn:hover { background: var(--sidebar-active); color: #fff; }
.nav a.ativo { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--sidebar-accent); }
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.user-chip { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--sidebar-text); text-decoration: none; }
.user-chip:hover, .user-chip.ativo { background: var(--sidebar-active); color: #fff; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #29504d; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.user-text { min-width: 0; }
.user-text strong { display: block; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-text small { color: var(--sidebar-muted); font-size: 11px; }
.backdrop { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 28px; min-height: 62px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 20px; font-weight: 650; margin: 0; flex: 1; min-width: 0; }
.topbar-acoes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topbar .menu-btn { display: none; }
.content { padding: 22px 28px 36px; display: flex; flex-direction: column; gap: 18px; flex: 1; }
.rodape { padding: 14px 28px 20px; color: var(--muted); font-size: 12px; }

/* ===== Componentes ===== */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); min-width: 0;
}
.card-tabela { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-tabela .card-head { padding: 16px 20px 12px; margin: 0; }
.card-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid-larga { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primario { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primario:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-perigo { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn-perigo:hover { background: #b62f2f; color: #fff; }
.btn-perigo-leve { color: var(--crit-text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-bloco { width: 100%; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none;
  border-radius: 8px; border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 7px;
  border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.chip-ok { background: var(--good-soft); color: var(--good-text); }
.chip-aviso { background: var(--warn-soft); color: var(--warn-text); }
.chip-critico { background: var(--crit-soft); color: var(--crit-text); }
.chip-neutro { background: var(--neutral-soft); color: var(--text-2); padding-left: 9px; }

.flash {
  display: flex; gap: 10px; align-items: center; padding: 10px 12px 10px 14px;
  border-radius: 8px; font-weight: 500;
}
.flash > span { flex: 1; }
.flash-ok { background: var(--good-soft); color: var(--good-text); }
.flash-erro { background: var(--crit-soft); color: var(--crit-text); }
.flash-info { background: var(--accent-soft); color: var(--accent-text); }
.flash-x { background: none; border: 0; color: inherit; cursor: pointer; padding: 4px; border-radius: 6px; display: grid; }
.flash-x:hover { background: rgba(0, 0, 0, .06); }

.muted { color: var(--muted); }
.bloco { display: block; }
.negativo { color: var(--crit-text); }
.vazio { color: var(--muted); padding: 22px 16px; text-align: center; display: flex; gap: 8px; justify-content: center; align-items: center; margin: 0; }
.dica { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.pad { padding: 4px 20px 16px; }
.voltar { margin: 0; }
.voltar a { text-decoration: none; font-weight: 500; }
.espaco { flex: 1; }

/* ===== Formulários ===== */
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--text-2); }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 10px;
  min-height: 38px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled, input[readonly] { background: var(--surface-2); color: var(--text-2); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--text); cursor: pointer; }
label.check input { width: 16px; height: 16px; min-height: 0; accent-color: var(--accent); }
.check-campo { align-self: end; min-height: 38px; }
fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
legend { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; padding: 0; display: flex; align-items: center; gap: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col-2 { grid-column: span 2; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-acoes { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.form-estreito { max-width: 560px; }
.sep { font-size: 14px; margin: 10px 0 0; padding-top: 14px; border-top: 1px solid var(--border); }
.sep small { font-weight: 400; color: var(--muted); }
.campo-senha { display: flex; gap: 6px; }

.filtros { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filtros label { min-width: 130px; }
.filtros .busca { flex: 1 1 220px; max-width: 340px; }
.filtros label.check { min-width: 0; min-height: 38px; }

.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.abas a {
  padding: 9px 14px; color: var(--text-2); text-decoration: none; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: inline-flex; gap: 6px; align-items: center; white-space: nowrap;
}
.abas a:hover { color: var(--text); }
.abas a.ativa { color: var(--accent-text); border-bottom-color: var(--accent); }
.abas-rolagem { overflow-x: auto; }

/* ===== KPIs ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi h3 { font-size: 13px; font-weight: 500; color: var(--text-2); margin: 0 0 6px; }
.kpi-valor { font-size: 24px; font-weight: 650; margin: 0; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-valor small { font-size: 14px; font-weight: 500; color: var(--muted); }
.kpi-sub { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.delta-ruim { color: var(--crit-text); }
.delta-bom { color: var(--good-text); }

/* ===== Gráficos ===== */
.chart-box { position: relative; width: 100%; }
.chart-tabela { margin-top: 12px; max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.chart-tabela .tbl thead th { top: 0; }

/* ===== Pendências ===== */
.lista-pend { list-style: none; margin: 0 0 12px; padding: 0; }
.lista-pend li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.lista-pend li:last-child { border-bottom: 0; }
.dia {
  width: 34px; height: 34px; border-radius: 8px; background: var(--surface-3); flex: none;
  display: grid; place-items: center; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums;
}
.pend-nome { flex: 1; min-width: 0; }
.pend-nome strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pend-nome small { color: var(--muted); }
.mais { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

/* ===== Tabelas ===== */
.tbl-wrap { overflow: auto; }
.card-tabela .tbl-wrap { max-height: 72vh; border-top: 1px solid var(--border); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.tbl thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2);
  font-weight: 600; color: var(--text-2); font-size: 12px; white-space: nowrap;
}
.tbl tbody tr:hover > * { background: var(--surface-2); }
.tbl tfoot td, .tbl tfoot th { background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--border-strong); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl-compacta th, .tbl-compacta td { padding: 7px 6px; }
.tbl-compacta { border-top: 1px solid var(--border); }
.col-acao { text-align: right; white-space: nowrap; width: 1%; }
.dia-cel { font-weight: 600; font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; color: var(--text-2); }

/* grade conta x mês */
.grade .col-conta {
  position: sticky; left: 0; z-index: 1; background: var(--surface);
  min-width: 200px; max-width: 250px; border-right: 1px solid var(--border);
}
.grade thead .col-conta { z-index: 3; background: var(--surface-2); }
.grade tfoot .col-conta { background: var(--surface-2); }
.grade[data-grade] tfoot td, .grade[data-grade] tfoot th { position: sticky; bottom: 0; z-index: 2; }
.grade[data-grade] tfoot .col-conta { z-index: 3; }
.grade tbody .col-conta { font-weight: 500; }
.conta-nome { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grade .col-conta small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.grade .col-dia { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; width: 1%; }
.grade th.mes-atual { color: var(--accent-text); box-shadow: inset 0 -2px 0 var(--accent); }
.grade .cel { padding: 2px; }
.cel-btn {
  position: relative; width: 100%; min-width: 78px; min-height: 34px; padding: 6px 8px;
  text-align: right; background: transparent; border: 0; border-radius: 5px;
  font: inherit; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.cel-btn:hover { background: var(--accent-soft); }
.cel-btn:empty::after { content: "+"; color: transparent; font-weight: 600; }
.cel-btn:empty:hover::after, .cel-btn:empty:focus-visible::after { color: var(--accent-text); }
.cel-btn.pend::before {
  content: ""; position: absolute; left: 6px; top: 50%; width: 7px; height: 7px;
  border-radius: 50%; background: var(--warn); transform: translateY(-50%);
}
.cel-btn.atualizado { animation: piscar 1.4s ease-out; }
@keyframes piscar { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.legenda-mini { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.ponto-pend { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); display: inline-block; }

.grade-ind .cel-input { padding: 2px 3px; }
.grade-ind .cel-input input {
  min-height: 32px; padding: 4px 6px; text-align: right; min-width: 104px;
  border-color: transparent; background: transparent; font-variant-numeric: tabular-nums;
}
.grade-ind .cel-input input:hover { border-color: var(--border-strong); }
.grade-ind .cel-input input:focus { background: var(--surface); border-color: var(--accent); }
.grade-ind .cel-input input[readonly] { background: transparent; }
.linha-calc > * { background: var(--surface-2); color: var(--text-2); font-weight: 500 !important; }
.tbl-rel td { white-space: nowrap; }

/* fechamento do mês */
.resumo-mes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.resumo-mes > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.resumo-mes span { display: block; font-size: 12.5px; color: var(--text-2); }
.resumo-mes strong { font-size: 20px; font-weight: 650; }
.resumo-mes strong small { font-size: 13px; color: var(--muted); font-weight: 500; }
.tbl-mes td { vertical-align: top; }
.tbl-mes td.col-acao, .tbl-mes td:nth-child(7) { vertical-align: middle; }
.lanc-rapido { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.lanc-rapido input { width: 118px; min-height: 32px; padding: 4px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.lanc-rapido select { width: auto; min-height: 32px; padding: 4px 6px; font-size: 13px; }

/* ===== Modal ===== */
dialog.modal {
  border: 0; border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px); background: var(--surface); color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal-sm { width: min(460px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 14, 20, .5); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; margin: 0; }
.modal-corpo { padding: 16px 20px 20px; overflow: auto; }
.modal-acoes { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
#confirmar form { padding: 20px; }
#confirmar h2 { font-size: 17px; margin: 0 0 8px; }
#confirmar p { margin: 0 0 18px; color: var(--text-2); }
.escolha { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 90px; gap: 12px; }

.itens { list-style: none; margin: 0 0 18px; padding: 0; border: 1px solid var(--border); border-radius: 10px; }
.itens li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.itens li:last-child { border-bottom: 0; }
.itens li.editando { background: var(--accent-soft); }
.item-info { flex: 1; min-width: 0; }
.item-info strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.item-info small { display: block; color: var(--muted); }
.itens-total { display: flex; justify-content: space-between; padding: 10px 12px; background: var(--surface-2); border-radius: 0 0 10px 10px; font-weight: 600; }
.sugestao { background: none; border: 0; padding: 0; color: var(--accent-text); text-decoration: underline; cursor: pointer; font: inherit; }

.dl-acesso { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px 12px; margin: 0; align-items: center; }
.dl-acesso dt { color: var(--muted); font-size: 13px; }
.dl-acesso dd { margin: 0; display: flex; align-items: center; gap: 4px; word-break: break-word; }
.dl-acesso code { word-break: break-all; }

.centros-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px 18px; }
.centro-item { display: flex; gap: 8px; align-items: center; }
.centro-item input { max-width: 170px; min-height: 32px; padding: 4px 8px; }
.centro-item .muted { font-size: 12px; white-space: nowrap; flex: 1; }
.centro-novo { display: flex; gap: 10px; align-items: flex-end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.centro-novo label { width: 280px; max-width: 100%; }

.info-lista { list-style: none; padding: 0; margin: 0 0 6px; }
.info-lista li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.info-lista span { color: var(--text-2); }

/* ===== Avisos flutuantes ===== */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; max-width: calc(100vw - 32px); }
.toast {
  background: var(--text); color: var(--surface); padding: 10px 14px; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2); display: flex; gap: 8px; align-items: center; font-weight: 500;
  animation: entra .2s ease-out;
}
.toast-erro { background: var(--crit); color: #fff; }
@keyframes entra { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== Login ===== */
.tela-login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-box {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px; box-shadow: 0 10px 30px rgba(16, 24, 40, .08);
  display: flex; flex-direction: column; gap: 16px;
}
.login-marca { display: flex; gap: 14px; align-items: center; }
.login-marca h1 { font-size: 19px; margin: 0; }
.login-marca p { margin: 2px 0 0; color: var(--muted); }

/* ===== Responsivo ===== */
@media (max-width: 1180px) {
  .grid-2, .grid-larga { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 50;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .menu-aberto .sidebar { transform: none; }
  .menu-aberto .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  .content { padding: 16px; }
  .rodape { padding: 12px 16px 18px; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .col-2 { grid-column: auto; }
  .resumo-mes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .escolha { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .escolha label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .topbar h1 { font-size: 18px; }
  .topbar-acoes .btn span { display: none; }
  .topbar-acoes .btn { padding: 0 10px; }
  .filtros label { min-width: 0; flex: 1 1 140px; }
  .filtros .busca { max-width: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi-valor { font-size: 18px; }
  .card { padding: 14px; }
  .card-tabela { padding: 0; }
  .card-tabela .card-head { padding: 14px; }
  .card-head { flex-wrap: wrap; }
  .centro-item input { max-width: none; }
  .dl-acesso { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl-acesso dd { margin-bottom: 8px; }
}

/* ===== Impressão ===== */
@media print {
  .sidebar, .topbar, .filtros, .abas, .rodape, .btn, .toasts, .flash, .backdrop { display: none !important; }
  body { background: #fff; color: #000; }
  .app { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 0; }
  .card-tabela .tbl-wrap, .tbl-wrap { max-height: none; overflow: visible; border: 0; }
  .tbl { font-size: 9.5px; }
  .tbl th, .tbl td { padding: 3px 5px; }
  .tbl thead th, .tbl tfoot td, .tbl tfoot th, .grade .col-conta { position: static; }
  @page { size: landscape; margin: 10mm; }
}
