:root { --bg:#f3f7f4; --card:#fff; --txt:#183425; --mut:#5b6f61; --pri:#074321; --err:#b42332; --bd:#d9e3dd; --soft:#edf5ef; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--txt); font:14px/1.5 'Segoe UI',Arial,sans-serif; }
button,input,select { font:inherit; }
button { border:1px solid transparent; padding:10px 17px; border-radius:7px; font-weight:600; cursor:pointer; white-space:nowrap; }
button:disabled { cursor:wait; opacity:.55; }
button:focus-visible,input:focus-visible,select:focus-visible,.table-scroll:focus-visible { outline:3px solid #91b89f; outline-offset:2px; }
input,select { width:100%; min-width:0; border:1px solid #becfc3; border-radius:7px; background:#fff; color:var(--txt); padding:10px 11px; height:43px; }
input::placeholder { color:#73877a; }
select:disabled { background:#f3f7f4; color:#344e3f; opacity:1; }
label { display:block; font-size:13px; font-weight:600; margin:0 0 7px; }
.primary { background:var(--pri); color:#fff; }
.primary:hover:not(:disabled) { background:#053219; }
.secondary { border-color:var(--bd); background:#fff; color:#35523e; }
.secondary:hover:not(:disabled) { background:#eff5f0; }
.full { display:block; width:100%; margin-top:12px; }
.text-button { background:transparent; color:var(--mut); padding:6px 8px; }
.auth-shell { min-height:100vh; display:grid; place-items:center; padding:24px 16px; }
.auth-card { width:100%; max-width:408px; background:var(--card); border:1px solid var(--bd); border-radius:12px; padding:32px; box-shadow:0 8px 30px #0743210a; }
.brand { display:flex; align-items:center; gap:10px; font-weight:700; font-size:16px; letter-spacing:-.2px; }
.brand-icon { display:grid; place-items:center; width:32px; height:32px; border-radius:8px; background:#074321; color:white; font-size:20px; }
.brand-light { color:var(--mut); font-weight:400; }
.auth-card .brand { margin-bottom:30px; }
h1 { font-size:28px; line-height:1.25; letter-spacing:-.6px; margin:0 0 10px; font-weight:650; }
.auth-card h1 { font-size:24px; }
.sub { color:var(--mut); margin:0; }
.auth-card .sub { margin-bottom:24px; }
.auth-card form label:not(:first-child) { margin-top:17px; }
.auth-note { font-size:12px; color:var(--mut); text-align:center; margin:22px 0 0; }
.erro { color:var(--err); font-size:13px; }
.auth-card .erro { margin-top:12px; min-height:20px; }
.app-shell { min-height:100vh; }
.topbar { min-height:72px; display:flex; justify-content:space-between; align-items:center; gap:20px; padding:16px 36px; border-bottom:1px solid var(--bd); background:white; }
.account { display:flex; align-items:center; gap:15px; font-size:13px; }
.branch-badge { background:var(--soft); color:#074321; border-radius:5px; padding:4px 9px; font-weight:600; }
.branch-badge:not(:disabled):hover { background:#e1eee4; border-color:#9fc1aa; }
.branch-badge:disabled { cursor:default; opacity:1; }
.workspace { max-width:1440px; margin:auto; padding:36px; }
.page-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:28px; }
.eyebrow { font-size:11px; letter-spacing:1px; font-weight:700; color:#627968; margin-bottom:12px; }
.readonly-badge { font-size:12px; color:#536b5b; padding:5px 10px; border:1px solid var(--bd); border-radius:20px; white-space:nowrap; }
.filters-panel,.results-panel { background:var(--card); border:1px solid var(--bd); border-radius:10px; }
.filters-panel { padding:24px; margin-bottom:24px; }
.filter-grid { display:grid; grid-template-columns:160px 160px minmax(180px,1fr) minmax(220px,1.5fr); gap:20px; }
.field-help { display:block; color:var(--mut); font-size:11px; margin-top:6px; }
.filter-actions { display:flex; justify-content:space-between; align-items:center; gap:20px; padding-top:20px; margin-top:20px; border-top:1px solid #e7eee9; }
.check-label { display:flex; gap:9px; align-items:center; margin:0; font-weight:400; }
.check-label input { width:16px; height:16px; min-height:16px; flex-shrink:0; margin:0; accent-color:var(--pri); }
.button-group { display:flex; align-items:center; gap:10px; }
.results-heading { padding:18px 24px; border-bottom:1px solid #e7eee9; display:flex; justify-content:space-between; align-items:center; gap:16px; }
h2 { font-size:16px; font-weight:650; margin:0; }
.results-heading span { font-size:12px; color:var(--mut); }
.empty-state { padding:54px 24px 62px; text-align:center; color:var(--mut); }
.empty-symbol { display:block; color:#71987c; font-size:40px; line-height:1.2; margin-bottom:16px; }
.empty-state h3 { font-size:16px; color:#34573e; font-weight:600; margin:0 0 8px; }
.empty-state p { font-size:13px; margin:0; }
.table-scroll { width:100%; overflow:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; text-align:left; }
th { padding:12px 16px; color:#536e5c; background:#f7faf8; font-size:11px; font-weight:700; white-space:nowrap; }
td { padding:14px 16px; border-top:1px solid #e7eee9; vertical-align:top; }
td:nth-child(3) { font-weight:600; min-width:130px; }
td:nth-child(4) { min-width:240px; max-width:460px; }
tbody tr:hover { background:#f5f9f6; }
.numeric { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.negative { color:var(--err); font-weight:600; }
.pagination { display:flex; justify-content:space-between; align-items:center; padding:16px 24px; border-top:1px solid var(--bd); color:var(--mut); font-size:12px; }
.pagination button { padding:7px 12px; font-size:12px; }
.pagination button:disabled { cursor:default; }
.footer-note { font-size:12px; color:#637b6a; margin:18px 0; }
.query-error { margin:0 0 18px; }
.client-filters { grid-template-columns:1.2fr 1fr 1fr 1fr; }
.client-summary { position:relative; display:grid; grid-template-columns:minmax(0,1fr) minmax(180px,.55fr) 20px; align-items:center; gap:24px; width:100%; text-align:left; white-space:normal; padding:22px 24px; border-radius:0; background:white; border:0; border-bottom:1px solid #e7eee9; color:var(--txt); font-weight:400; }
.client-summary:last-child { border-bottom:0; border-radius:0 0 10px 10px; }
.client-summary:hover { background:#eff6f0; }
.client-summary strong { font-size:14px; overflow-wrap:anywhere; }
.client-cnpj { color:var(--mut); font-size:13px; }
.client-arrow { font-size:27px; color:#73977f; }
dialog { width:calc(100% - 32px); max-width:720px; max-height:calc(100dvh - 40px); padding:28px; background:white; color:var(--txt); border:1px solid var(--bd); border-radius:12px; overflow:auto; box-shadow:0 24px 90px #163c2530; }
dialog::backdrop { background:#102b1b80; }
.dialog-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; border-bottom:1px solid var(--bd); padding-bottom:22px; }
.dialog-heading h2 { font-size:22px; line-height:1.4; overflow-wrap:anywhere; margin-bottom:8px; }
.dialog-heading button { min-height:44px; }
.client-details { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:22px 30px; margin:24px 0 0; }
.client-details dt { color:var(--mut); font-size:12px; margin-bottom:5px; }
.client-details dd { margin:0; overflow-wrap:anywhere; white-space:pre-wrap; }
.detail-wide { grid-column:1 / -1; }
.purchase-summary { display:grid; gap:4px; margin-top:22px; padding-bottom:22px; border-bottom:1px solid var(--bd); }
.purchase-label { color:var(--mut); font-size:12px; }
.purchase-summary strong { font-size:30px; line-height:1.3; }
.purchase-status { margin-top:8px; font-size:13px; font-weight:600; }
.purchase-summary[data-status="verde"] strong,.purchase-summary[data-status="verde"] .purchase-status { color:#166534; }
.purchase-summary[data-status="amarelo"] strong,.purchase-summary[data-status="amarelo"] .purchase-status { color:#92400e; }
.purchase-summary[data-status="vermelho"] strong,.purchase-summary[data-status="vermelho"] .purchase-status { color:#b42332; }
.purchase-summary[data-status="sem-historico"] strong,.purchase-summary[data-status="sem-historico"] .purchase-status { color:#5b6f61; }
[hidden] { display:none !important; }
@media(max-width:1000px) { .filter-grid { grid-template-columns:1fr 1fr; } }
@media(max-width:600px) {
  input,select { font-size:16px; min-height:46px; }
  button { min-height:44px; touch-action:manipulation; }
  .topbar { padding:15px 18px; flex-wrap:wrap; gap:12px; }
  .account { width:100%; justify-content:space-between; gap:8px; }
  .account #nomeUsuario { flex:1; min-width:0; overflow-wrap:anywhere; }
  .branch-badge { padding:8px 12px; }
  .workspace { padding:24px 16px; }
  h1 { font-size:25px; }
  .page-heading { align-items:flex-start; }
  .readonly-badge { display:none; }
  .filters-panel { padding:18px; }
  .filter-grid { grid-template-columns:1fr; gap:16px; }
  .filter-actions { align-items:stretch; flex-direction:column; }
  .filter-actions .button-group button { flex:1; padding:10px; }
  .results-heading { padding:16px; align-items:flex-start; flex-direction:column; gap:6px; }
  .pagination { padding:14px; gap:10px; flex-wrap:wrap; }
  .auth-card { padding:27px; }
  .client-filters { grid-template-columns:1fr; }
  .client-summary { grid-template-columns:minmax(0,1fr) 20px; gap:7px 15px; padding:20px 16px; }
  .client-summary strong { font-size:15px; }
  .client-cnpj { grid-row:2; grid-column:1; }
  .client-arrow { grid-column:2; grid-row:1 / 3; }
  dialog { padding:20px; max-height:calc(100dvh - 24px); }
  .dialog-heading { gap:12px; }
  .dialog-heading h2 { font-size:18px; }
  .client-details { gap:20px 18px; }
  .table-scroll { overflow:visible; }
  table,tbody { display:block; width:100%; }
  thead { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  tbody tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:14px 20px; padding:20px 16px; border-top:1px solid var(--bd); }
  tbody tr:first-child { border-top:0; }
  tbody tr:nth-child(even) { background:#f8faf8; }
  tbody td,tbody td:nth-child(3),tbody td:nth-child(4) { display:block; padding:0; border:0; min-width:0; max-width:none; white-space:normal; text-align:left; overflow-wrap:anywhere; }
  tbody td::before { content:attr(data-label); display:block; margin-bottom:4px; font-size:11px; font-weight:500; color:var(--mut); }
  tbody td:nth-child(3) { grid-column:1 / -1; grid-row:1; font-size:16px; }
  tbody td:nth-child(4) { grid-column:1 / -1; grid-row:2; }
  tbody td:nth-child(5) { grid-column:1 / -1; }
  tbody td.numeric { font-size:16px; }
  .empty-state { padding:32px 18px; }
}
@media(max-width:380px) {
  .filter-actions .button-group { display:grid; grid-template-columns:1fr; }
  .auth-card { padding:23px; }
}

#tabelaReceber table { min-width:1450px; }
@media(max-width:600px) { #tabelaReceber table { min-width:0; } }
#formReceber .filter-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
#formReceber .filter-grid > div:nth-child(4) { grid-column:span 2; }
@media(max-width:1000px) {
  #formReceber .filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #formReceber .filter-grid > div:nth-child(4) { grid-column:auto; }
}
@media(max-width:600px) {
  #formReceber .filter-grid { grid-template-columns:1fr; }
  #tabelaReceber tbody td:nth-child(3),#tabelaReceber tbody td:nth-child(4) { grid-row:auto; grid-column:auto; font-size:inherit; }
  #tabelaReceber tbody td:nth-child(3) { grid-column:1 / -1; }
  #tabelaReceber tbody td:nth-child(5) { grid-row:1; font-size:16px; }
}
/* Resumo financeiro por cliente. */
.receivable-totals { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin:0 0 22px; }
.receivable-total { padding:20px; border:1px solid var(--bd); border-radius:12px; background:white; min-width:0; display:flex; flex-direction:column; gap:10px; }
.receivable-total > span { font-size:13px; color:var(--mut); }
.receivable-total strong { font-size:24px; line-height:1.3; overflow-wrap:anywhere; }
.receivable-total small { color:var(--mut); font-size:12px; line-height:1.5; }
.receivable-total.overdue { background:#fff7f7; border-color:#f4cbd0; }
.receivable-total.overdue strong { color:#bd2439; }
.receivable-total.upcoming strong,.receivable-total.paid strong { color:#074321; }
.receivable-total.average { background:#f1f6f2; }
.receivable-scope { color:var(--mut); font-size:13px; line-height:1.6; margin:18px 0; }
.totals-scope { grid-column:1 / -1; margin:0; color:var(--mut); font-size:12px; }
#tabelaReceber table { min-width:0; width:100%; table-layout:fixed; }
#tabelaReceber th:first-child { width:80px; }
#tabelaReceber th:nth-child(3) { width:220px; }
#tabelaReceber th:last-child { width:100px; }
#tabelaReceber td { max-width:none; white-space:normal; overflow-wrap:anywhere; vertical-align:middle; }
#tabelaReceber td:nth-child(2) { font-weight:600; }
.status-column { text-align:center; }
.receivable-client { cursor:pointer; }
.receivable-client:hover { background:#f1f6f2; }
.receivable-client:focus-visible { outline:3px solid #91b89f; outline-offset:-3px; }
.receivable-inspect { border:0; background:transparent; padding:6px; width:54px; height:54px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; }
.receivable-inspect svg { width:42px; height:42px; }
.receivable-inspect.ok { color:#2b548d; }
.receivable-inspect.overdue { color:#c52d41; }
.receivable-inspect:hover { background:#e6f1e9; }
#detalhesReceber { max-width:1050px; }
.client-totals { grid-template-columns:repeat(3,minmax(0,1fr)); margin-top:16px; }
#regraMediaReceber { margin:10px 0 20px; line-height:1.6; }
.receivable-title-card { border:1px solid var(--bd); border-radius:12px; padding:20px; margin:16px 0; }
.receivable-title-card header { display:flex; gap:14px; align-items:center; justify-content:space-between; }
.receivable-title-card h3 { margin:0; font-size:16px; overflow-wrap:anywhere; }
.receivable-title-card dl { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin:20px 0 0; }
.receivable-title-card dt { font-size:12px; color:var(--mut); margin:0 0 5px; }
.receivable-title-card dd { margin:0; font-size:14px; overflow-wrap:anywhere; white-space:pre-wrap; }
.receivable-title-card .title-history { grid-column:1 / -1; }
.title-state { font-size:12px; font-weight:600; border-radius:20px; padding:6px 10px; color:#586d60; background:#f0f4f1; white-space:nowrap; }
.title-state.atrasado { color:#b42339; background:#fff0f1; }
.title-state.a_vencer,.title-state.pago { color:#074321; background:#edf5ef; }
@media(max-width:1000px) { .receivable-totals { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) {
  #tabelaReceber tbody tr { grid-template-columns:minmax(0,1fr) 58px; gap:12px; }
  #tabelaReceber tbody td:nth-child(1) { grid-column:1; grid-row:3; font-size:13px; }
  #tabelaReceber tbody td:nth-child(2) { grid-column:1; grid-row:1; font-size:16px; }
  #tabelaReceber tbody td:nth-child(3) { grid-column:1; grid-row:2; font-size:14px; }
  #tabelaReceber tbody td:nth-child(4) { grid-column:2; grid-row:1 / 4; align-self:center; }
  #tabelaReceber tbody td:nth-child(4)::before { display:none; }
  .receivable-total { padding:14px; }
  .receivable-total strong { font-size:21px; }
  .receivable-title-card { padding:16px; }
  .receivable-title-card header { align-items:flex-start; flex-direction:column; }
  .receivable-title-card dl { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
  #detalhesReceber { padding:18px; }
}
.order-total { display:flex; justify-content:space-between; align-items:center; gap:24px; padding:22px 24px; margin:0 0 22px; background:#f0f7f2; border:1px solid #d1e3d7; border-radius:12px; }
.order-total > div { display:flex; flex-direction:column; gap:8px; }
.order-total span { color:var(--mut); font-size:13px; }
.order-total strong { color:#074321; font-size:28px; }
.order-total p { color:var(--mut); font-size:13px; max-width:560px; line-height:1.7; margin:0; }
.order-row { cursor:pointer; }
.order-row:focus-visible { outline:3px solid #91b89f; outline-offset:-3px; }
.order-row:hover { background:#f1f6f2; }
.order-open { border:0; padding:4px 0; background:transparent; color:#074321; text-decoration:underline; font:inherit; font-weight:600; }
#detalhesPedido { max-width:1050px; }
#conteudoDetalhesPedido { margin-top:22px; }
.order-header-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; margin:24px 0; }
.order-header-fields dt { color:var(--mut); font-size:12px; margin:0 0 6px; }
.order-header-fields dd { margin:0; font-size:14px; overflow-wrap:anywhere; }
#tabelaItensPedido table { width:100%; table-layout:fixed; }
#tabelaItensPedido th:first-child { width:105px; }
#tabelaItensPedido th:nth-child(2) { width:40%; }
#tabelaItensPedido td { white-space:normal; max-width:none; overflow-wrap:anywhere; }
@media(max-width:600px) {
  .order-total { flex-direction:column; align-items:flex-start; padding:18px; gap:14px; }
  .order-total strong { font-size:25px; }
  #detalhesPedido { padding:18px; }
  .order-header-fields { grid-template-columns:1fr; gap:16px; }
  #tabelaItensPedido tbody td:nth-child(1) { grid-column:1; grid-row:2; }
  #tabelaItensPedido tbody td:nth-child(2) { grid-column:1 / -1; grid-row:1; font-size:16px; }
  #tabelaItensPedido tbody td:nth-child(3) { grid-column:2; grid-row:2; font-size:14px; }
  #tabelaItensPedido tbody td:nth-child(4) { grid-column:1; grid-row:3; }
  #tabelaItensPedido tbody td:nth-child(5) { grid-column:2; grid-row:3; }
}

/* Contas a pagar */
#totaisPagar { grid-template-columns:repeat(6,minmax(0,1fr)); }
#totaisPagar .receivable-total { grid-column:span 2; }
#totaisPagar .overdue,#totaisPagar .upcoming { grid-column:span 3; }
#totaisPagar .payable-open { border-color:#91b89f; background:#f0f7f2; }
#formPagar .filter-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
#tabelaPagar table { table-layout:fixed; min-width:1280px; }
#tabelaPagar th:first-child { width:13%; }
#tabelaPagar th:nth-child(2) { width:20%; }
#tabelaPagar th:nth-child(3) { width:14%; }
#tabelaPagar th:nth-child(4) { width:17%; }
#tabelaPagar th:nth-child(5) { width:10%; }
#tabelaPagar th:nth-child(6) { width:6%; }
#tabelaPagar th:nth-child(7),#tabelaPagar th:nth-child(8) { width:10%; }
#tabelaPagar td { min-width:0; max-width:none; overflow-wrap:anywhere; white-space:normal; }
#tabelaPagar .order-open { display:inline-block; min-width:0; max-width:100%; white-space:normal; overflow-wrap:anywhere; word-break:normal; text-align:left; line-height:1.5; vertical-align:top; }
#tabelaPagar td:nth-child(5) { white-space:nowrap; }
#tabelaPagar td.numeric { white-space:nowrap; }
#detalhesPagar { max-width:950px; }
.payable-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:22px; }
.payable-fields dt { color:var(--mut); font-size:12px; margin:0 0 6px; }
.payable-fields dd { margin:0; font-size:14px; overflow-wrap:anywhere; white-space:pre-wrap; }
.payable-fields > div:nth-child(5) { grid-column:1 / -1; }
@media(max-width:1000px) {
  #formPagar .filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #totaisPagar { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #totaisPagar .receivable-total { grid-column:span 1; }
  #totaisPagar .payable-open { grid-column:span 2; }
}
@media(max-width:600px) {
  #formPagar .filter-grid { grid-template-columns:1fr; }
  #tabelaPagar table { min-width:0; }
  #tabelaPagar tbody td { grid-column:auto; grid-row:auto; font-size:14px; }
  #tabelaPagar tbody td:nth-child(2) { grid-column:1 / -1; grid-row:1; font-size:16px; }
  #tabelaPagar tbody td:nth-child(1) { grid-column:1 / -1; grid-row:2; }
  .payable-fields { grid-template-columns:1fr; gap:18px; }
  #detalhesPagar { padding:18px; }
}
/* Identidade do Grupo Cardan Norte: verde #074321, vermelho #FF202B e branco. */
:root { --brand-green:#074321; --brand-red:#FF202B; --brand-red-text:#b71927; }
.access-notice { max-width:1368px; margin:20px auto 0; padding:14px 20px; background:#fff6f6; border:1px solid #f2ccd1; border-radius:8px; }
.branch-badge { white-space:normal; text-align:left; max-width:340px; }
#formPedidos .filter-grid,#formEstoque .filter-grid { grid-template-columns:minmax(280px,1.5fr) minmax(150px,.8fr) minmax(150px,.8fr) minmax(180px,1fr); }
@media(max-width:1000px) { #formPedidos .filter-grid,#formEstoque .filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { #formPedidos .filter-grid,#formEstoque .filter-grid { grid-template-columns:1fr; } }
#tabelaReceber th:first-child { width:180px; }
.brand { min-width:0; gap:14px; color:var(--brand-green); letter-spacing:0; }
.brand-logo { width:76px; height:auto; flex:0 0 auto; object-fit:contain; display:block; }
.brand-copy { display:flex; flex-direction:column; min-width:0; gap:3px; }
.brand-copy strong { font-size:18px; line-height:1.3; font-weight:700; overflow-wrap:normal; }
.brand-copy .brand-light { font-size:12px; line-height:1.4; color:var(--mut); }
.brand-header { padding-bottom:20px; border-bottom:1px solid var(--bd); }
.auth-card { border-top:3px solid var(--brand-red); }
.auth-card .brand { margin-bottom:24px; }
.auth-card .brand-copy strong { font-size:17px; }
.topbar { position:sticky; top:0; z-index:20; border-top:3px solid var(--brand-red); box-shadow:0 2px 14px #07432108; }
.dialog-brand { padding-bottom:16px; margin-bottom:20px; border-bottom:1px solid var(--bd); }
.dialog-brand .brand-logo { width:54px; }
.dialog-brand .brand-copy strong { font-size:16px; }
.dialog-brand .brand-light { font-size:11px; }
dialog { border-top:3px solid var(--brand-red); }
.primary:disabled { cursor:wait; }
@media(max-width:600px) {
  .brand { gap:12px; }
  .brand-logo { width:66px; }
  .brand-copy strong { font-size:17px; }
  .auth-card .brand-copy strong { font-size:16px; }
  .topbar { padding:12px 18px; gap:12px; }
  .topbar .brand { width:100%; }
  .dialog-brand .brand-copy strong { font-size:15px; }
}

/* Navegacao de consultas: atalhos no computador, seletor compacto no celular. */
.module-nav { padding:12px 36px; background:#fff; border-bottom:1px solid var(--bd); }
.module-options { display:flex; flex-wrap:wrap; gap:8px; }
.module-options button { display:flex; align-items:center; justify-content:center; gap:9px; min-height:46px; padding:11px 17px; color:var(--mut); background:transparent; border:1px solid transparent; border-radius:9px; line-height:1.35; white-space:normal; text-align:left; }
.module-options button svg { flex:0 0 auto; width:21px; height:21px; }
.module-options button:hover { background:#f0f6f2; color:var(--brand-green); }
.module-options button[aria-current="page"] { background:#eaf4ed; color:var(--brand-green); border-color:#b9d3c1; box-shadow:inset 0 -3px 0 var(--brand-red); }
.module-toggle { display:none; }
@media(max-width:760px) {
  .module-nav { padding:10px 16px; }
  .module-toggle { width:100%; display:flex; align-items:center; gap:12px; min-height:60px; padding:10px 13px; border:1px solid #b9d3c1; border-radius:10px; background:#f2f8f4; color:var(--brand-green); white-space:normal; text-align:left; }
  .nav-current-icon { display:flex; flex:0 0 auto; align-items:center; justify-content:center; width:36px; height:36px; background:#e2efe6; border-radius:9px; }
  .nav-current-copy { display:flex; min-width:0; flex:1; flex-direction:column; gap:1px; }
  .nav-current-copy > span { color:var(--mut); font-size:10px; font-weight:400; }
  .nav-current-copy strong { font-size:14px; font-weight:650; line-height:1.4; }
  .nav-toggle-action { display:flex; align-items:center; gap:4px; font-size:12px; font-weight:600; flex:0 0 auto; }
  .nav-toggle-action svg { width:16px; height:16px; }
  .module-toggle[aria-expanded="true"] .nav-toggle-action svg { transform:rotate(180deg); }
  .module-options { display:none; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:10px; padding-top:10px; border-top:1px solid var(--bd); }
  .module-nav.is-open .module-options { display:grid; }
  .module-options button { justify-content:flex-start; min-height:54px; padding:11px 10px; gap:8px; background:#f7faf8; border-color:#e1e9e4; font-size:12px; }
  .module-options button svg { width:19px; height:19px; }
}

/* Assinatura em lote e privilegios por origem. */
.signature-toolbar { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:16px; padding:18px 20px; margin:0 0 20px; border:1px solid var(--bd); border-radius:10px; background:white; }
.signature-select-page { display:flex; align-items:center; gap:10px; margin:0; }
.signature-select-page input { width:20px; height:20px; margin:0; accent-color:var(--brand-green); }
.supplier-selection { display:flex; align-items:flex-start; gap:10px; }
.supplier-selection > div { min-width:0; }
.signature-check { display:flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; margin:-8px 0 0 -8px; }
.signature-check input { width:20px; height:20px; margin:0; accent-color:var(--brand-green); cursor:pointer; }
.signature-status { display:block; color:var(--mut); font-size:11px; margin-top:5px; }
.signature-status.signed { color:#166534; font-weight:600; }
.signature-notice { color:var(--mut); font-size:13px; line-height:1.7; }
.signature-message { padding:16px 20px; margin:0 0 20px; border:1px solid #b5d4be; border-radius:8px; background:#f0f8f2; color:#074321; }
.signature-message[data-tone="erro"] { color:#9b1c2e; border-color:#ecc2c9; background:#fff6f6; }
.signature-message[data-tone="aviso"] { color:#7c4c10; border-color:#e8d6b1; background:#fffaf0; }
#confirmacaoAssinatura,#permissoesAssinatura { max-width:960px; }
.signature-review { list-style:none; padding:0; margin:20px 0; max-height:40vh; overflow:auto; border:1px solid var(--bd); border-radius:8px; }
.signature-review li { display:flex; flex-direction:column; gap:6px; padding:14px 16px; border-bottom:1px solid var(--bd); }
.signature-review li:last-child { border-bottom:0; }
.signature-review span { font-size:12px; color:var(--mut); }
.signature-dialog-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:12px; margin-top:22px; }
.signature-permissions-search { display:grid; grid-template-columns:1.3fr 1fr auto; gap:14px; align-items:end; margin:24px 0 16px; }
.signature-user { display:flex; justify-content:space-between; gap:20px; align-items:center; padding:16px 0; border-top:1px solid var(--bd); }
.signature-user > div { display:flex; flex-direction:column; gap:5px; }
.signature-user span { color:var(--mut); font-size:12px; }
.signature-toolbar select { min-width:190px; }
.signature-user > .signature-privileges { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.signature-privileges > div { display:flex; flex-direction:column; gap:7px; }
.signature-privileges button { white-space:normal; min-height:44px; }
#tabelaHistorico table { min-width:1040px; table-layout:fixed; }
#formHistorico .filter-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media(max-width:1000px) { #formHistorico .filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { #formHistorico .filter-grid { grid-template-columns:1fr; } }
#tabelaHistorico th:nth-child(1) { width:19%; }
#tabelaHistorico th:nth-child(2) { width:20%; }
#tabelaHistorico th:nth-child(3) { width:12%; }
#tabelaHistorico th:nth-child(4) { width:13%; }
#tabelaHistorico th:nth-child(5) { width:18%; }
#tabelaHistorico th:nth-child(6) { width:18%; }
#linhasHistorico td { overflow-wrap:anywhere; }
#linhasHistorico small { display:block; color:var(--mut); font-size:12px; margin-top:5px; }
.history-action { display:inline-block; border-radius:6px; padding:5px 8px; background:#edf4f0; color:var(--brand-green); font-weight:600; }
.history-action.removed { color:#a32030; background:#fff0f1; }
.history-action.initial { color:#5a6470; background:#f0f2f4; }
@media(max-width:600px) {
 #tabelaHistorico { overflow:visible; padding:12px; }
 #tabelaHistorico table,#tabelaHistorico tbody { display:block; min-width:0; width:100%; }
 #tabelaHistorico thead { display:none; }
 #linhasHistorico tr { display:block; border:1px solid var(--bd); border-radius:9px; padding:12px; margin-bottom:12px; }
 #linhasHistorico td { display:grid; grid-template-columns:110px minmax(0,1fr); column-gap:10px; padding:9px 0; border:0; }
 #linhasHistorico td::before { content:attr(data-label); color:var(--mut); font-size:12px; grid-column:1; }
 #linhasHistorico td>span,#linhasHistorico td>small { grid-column:2; }
 .history-action { justify-self:start; }
}
@media(max-width:600px) { .signature-user > .signature-privileges { grid-template-columns:1fr; } }
@media(max-width:600px) {
 .signature-toolbar { padding:16px; }
 .signature-toolbar > div,.signature-toolbar .button-group { width:100%; }
 .signature-toolbar .button-group { flex-wrap:wrap; }
 .signature-toolbar button { min-height:44px; flex:1; white-space:normal; }
 .signature-permissions-search { grid-template-columns:1fr; }
 .signature-user { flex-direction:column; align-items:stretch; gap:12px; }
 .signature-user button { min-height:44px; }
 #confirmacaoAssinatura,#permissoesAssinatura { padding:18px; }
 .signature-dialog-actions button { flex:1; min-height:44px; white-space:normal; }
}


/* Fluxo de caixa v19: somente gráfico com valores em cada ponto. */
.cash-dashboard { background:#fff; border:1px solid var(--bd); border-radius:12px; padding:24px; margin-bottom:22px; min-width:0; }
.dashboard-heading,.dashboard-chart-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; }
.dashboard-heading h2 { margin:0 0 8px; font-size:23px; }
.dashboard-chart-heading select { min-width:145px; }
.graph-scroll { width:100%; max-width:100%; height:362px; overflow:auto; margin:16px 0; }
.graph-scroll svg { display:block; max-width:none; }
.graph-scroll:focus-visible { outline:3px solid #91b89f; outline-offset:2px; }
@media(max-width:760px) {
 .cash-dashboard { padding:18px 14px; }
 .dashboard-heading,.dashboard-chart-heading { flex-direction:column; gap:12px; }
 .dashboard-heading button,.dashboard-chart-heading > div:last-child { width:100%; }
}

.permissions-entry { display:flex; align-items:center; gap:7px; color:var(--pri); background:var(--soft); border:1px solid var(--bd); padding:9px; flex:0 0 auto; }
.module-permissions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 18px; margin:12px 0; }
.module-permissions label { display:flex; align-items:center; gap:8px; font-weight:400; margin:0; }
.module-permissions input { width:18px; height:18px; flex:0 0 auto; }
.permission-user { background:white; border:1px solid var(--bd); border-radius:10px; padding:18px; margin-bottom:16px; }
.permission-user .signature-privileges { margin-top:15px; }
@media(max-width:760px){.permissions-entry .nav-label{display:none}.module-permissions{grid-template-columns:1fr}.topbar{flex-wrap:wrap}.topbar .brand{flex:1;min-width:0}}

/* Estrutura comum para as consultas financeiras, preservando seus campos. */
#tabelaReceber td,#tabelaReceber th { white-space:normal; overflow-wrap:anywhere; }
#tabelaPagar table { min-width:1360px; }
#tabelaPagar th:last-child { width:70px; }
@media(max-width:600px) {
 #tabelaReceber table,#tabelaPagar table { min-width:0; }
 #tabelaReceber tbody tr,#tabelaPagar tbody tr { grid-template-columns:minmax(0,1fr) minmax(0,1fr) 54px; gap:16px 12px; padding:20px 16px; }
 #tabelaReceber tbody td,#tabelaPagar tbody td { grid-column:auto; grid-row:auto; font-size:14px; text-align:left; }
 #tabelaReceber tbody td:nth-child(2),#tabelaPagar tbody td:nth-child(2) { grid-column:1 / 3; grid-row:1; font-weight:600; font-size:16px; }
 #tabelaReceber tbody td:nth-child(1),#tabelaPagar tbody td:nth-child(1) { grid-column:1 / -1; grid-row:2; }
 #tabelaReceber tbody td:nth-child(3),#tabelaPagar tbody td:nth-child(3) { grid-column:1 / 3; grid-row:3; font-weight:600; }
 #tabelaReceber tbody td:nth-child(4) { grid-column:1 / 3; grid-row:4; font-weight:600; }
 #tabelaReceber tbody td:nth-child(4)::before { display:block; }
 #tabelaReceber tbody td:nth-child(5) { grid-column:1 / 3; grid-row:5; font-weight:600; }
 #tabelaPagar tbody td:nth-child(4) { grid-column:1 / -1; grid-row:4; }
 #tabelaPagar tbody td:nth-child(5) { grid-column:1; grid-row:5; }
 #tabelaPagar tbody td:nth-child(6) { grid-column:2 / -1; grid-row:5; }
 #tabelaPagar tbody td:nth-child(7) { grid-column:1; grid-row:6; }
 #tabelaPagar tbody td:nth-child(8) { grid-column:2 / -1; grid-row:6; }
 #tabelaReceber tbody td:last-child,#tabelaPagar tbody td:last-child { grid-column:3; grid-row:1; align-self:start; }
 #tabelaReceber tbody td:last-child::before,#tabelaPagar tbody td:last-child::before { display:none; }
 .financial-row td.numeric { white-space:normal!important; overflow-wrap:anywhere; }
 .financial-row .receivable-inspect { width:48px; height:48px; padding:4px; }
}

/* Fluxo diário, totais e gráfico: o PDF usa a mesma consulta concluída. */
.cash-summary { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; margin:20px 0; }
.cash-summary>div { border:1px solid var(--bd); border-radius:10px; padding:16px; background:#f5faf6; min-width:0; }
.cash-summary span { display:block; color:var(--mut); font-size:13px; margin-bottom:8px; }
.cash-summary strong { font-size:19px; overflow-wrap:anywhere; }
.negative { color:#bd2439!important; }
.cash-table-scroll { overflow-x:auto; max-width:100%; margin-bottom:24px; border:1px solid var(--bd); border-radius:8px; }
#tabelaFluxo table { width:100%; min-width:1050px; border-collapse:collapse; table-layout:auto; }
#tabelaFluxo td,#tabelaFluxo th { white-space:nowrap; padding:12px 10px; text-align:right; font-size:13px; }
#tabelaFluxo td:first-child,#tabelaFluxo th:first-child { text-align:left; }
#tabelaFluxo tfoot { font-weight:700; background:#edf5ef; }
@media(max-width:1000px) { .cash-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) {
 #tabelaFluxo table { display:table; }
 #tabelaFluxo thead { position:static; display:table-header-group; width:auto; height:auto; clip-path:none; overflow:visible; white-space:normal; }
 #tabelaFluxo tbody { display:table-row-group; width:auto; }
 #tabelaFluxo tr { display:table-row; padding:0; }
 #tabelaFluxo td,#tabelaFluxo th { display:table-cell; padding:10px; max-width:none; white-space:nowrap; text-align:right; font-size:12px; }
 #tabelaFluxo td::before { display:none; }
 .cash-summary>div { padding:12px; } .cash-summary strong { font-size:16px; }
}

#cobrancaConfig textarea { display:block; width:100%; border:1px solid var(--bd); border-radius:8px; padding:12px; font:inherit; resize:vertical; margin:8px 0 18px; }
#cobrancaConfig>form>label { display:block; margin-top:16px; }
#cobrancaConfig input[type=checkbox] { width:18px; height:18px; vertical-align:middle; }
#moduloCobranca .results-panel { margin-top:22px; }
#moduloCobranca td { max-width:240px; white-space:normal; overflow-wrap:anywhere; }
#moduloCobranca .pagination { flex-wrap:wrap; }

@media(max-width:600px){#moduloCobranca tbody tr{grid-template-columns:minmax(0,1fr);gap:12px;}#moduloCobranca tbody td{grid-column:1!important;grid-row:auto!important;max-width:none;white-space:normal!important;}}
#moduloCobranca>.button-group,#cobrancaConfig .button-group { flex-wrap:wrap; }
#moduloCobranca>.button-group button,#cobrancaConfig .button-group button { max-width:100%; white-space:normal; }
#cobrancaConfig .filter-grid,#formCobranca .filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
@media(max-width:600px){#cobrancaConfig .filter-grid,#formCobranca .filter-grid{grid-template-columns:minmax(0,1fr);}}

#linhasCobranca td:nth-child(5) { white-space:pre-line; overflow-wrap:anywhere; }

.modelo-cobranca{margin:20px 0 12px}.modelo-cobranca select{flex:1;min-width:0;max-width:100%}.modelo-cobranca .button-group{display:flex;gap:12px;flex-wrap:wrap}

#detalheAutorizacoes{width:min(720px,calc(100vw - 32px));max-height:85vh;overflow:auto;border:1px solid var(--bd);border-radius:14px;padding:24px;color:var(--text);box-sizing:border-box}#detalheAutorizacoes::backdrop{background:#0007}#camposAutorizacoes p{white-space:pre-wrap;overflow-wrap:anywhere}#motivoAutorizacoes{width:100%;box-sizing:border-box;font:inherit;padding:12px;border:1px solid var(--bd);border-radius:8px}#detalheAutorizacoes .button-group{flex-wrap:wrap}#linhasAutorizacoes td{white-space:normal;overflow-wrap:anywhere}
@media(max-width:760px){#moduloAutorizacoes table,#moduloAutorizacoes tbody,#moduloAutorizacoes tr,#moduloAutorizacoes td{display:block}#moduloAutorizacoes thead{display:none}#moduloAutorizacoes tr{padding:16px;border-bottom:1px solid var(--bd)}#moduloAutorizacoes td{border:0;padding:8px 0;width:auto;min-width:0}#moduloAutorizacoes td::before{content:attr(data-label);display:block;font-size:12px;color:var(--muted);margin-bottom:5px}}

#desfazerNegativaDialog{width:min(640px,calc(100vw - 32px));max-height:85vh;overflow:auto;border:1px solid var(--bd);border-radius:14px;padding:24px;box-sizing:border-box;color:var(--text)}#desfazerNegativaDialog::backdrop{background:#0007}#resumoDesfazerNegativa{white-space:pre-wrap;overflow-wrap:anywhere}#motivoDesfazerNegativa{width:100%;box-sizing:border-box;font:inherit;padding:12px;border:1px solid var(--bd);border-radius:8px}#desfazerNegativaDialog .button-group{flex-wrap:wrap}

/* Identidade GestorWeb: quebra natural nos cabecalhos compactos. */
.brand-copy strong{overflow-wrap:anywhere;white-space:normal}.brand-copy{max-width:100%}.topbar .brand{min-width:0}.brand-logo{flex-shrink:0}
.movimentacao-negativo{color:#b51f36!important;font-weight:700}
#moduloMovimentacao .cash-summary{padding:16px;gap:16px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
#moduloMovimentacao .cash-summary strong{display:block;font-size:22px;margin-top:8px;overflow-wrap:anywhere}
@media(max-width:760px){#moduloMovimentacao .cash-summary{grid-template-columns:1fr}#linhasMovimentacao tr{display:block;padding:14px;border-bottom:1px solid var(--bd)}#linhasMovimentacao td{display:grid;grid-template-columns:100px minmax(0,1fr);gap:12px;border:0;padding:7px 0;min-width:0;text-align:left;overflow-wrap:anywhere}#linhasMovimentacao td::before{content:attr(data-label);font-weight:600;color:var(--muted)}#moduloMovimentacao thead{display:none}}

.auth-row-actions{display:flex;flex-wrap:wrap;gap:8px}
#confirmarAutorizacaoERP{width:min(620px,calc(100vw - 32px));max-height:85vh;overflow:auto;border:1px solid var(--bd);border-radius:14px;padding:24px;color:var(--text)}
#confirmarAutorizacaoERP::backdrop{background:#0007}#observacaoAutorizarERP{display:block;width:100%;box-sizing:border-box;font:inherit;padding:12px;border:1px solid var(--bd);border-radius:8px;margin:8px 0}#resumoAutorizarERP{white-space:pre-wrap;overflow-wrap:anywhere}#formAutorizarERP .button-group{flex-wrap:wrap}

#camposAutorizacoes p{white-space:pre-wrap;overflow-wrap:anywhere}
