/* Estilos comuns dos módulos: kit de telas no estilo Delphi (Erp, modulos/_base.js). Guia: docs/delphi/KIT.md
   Cores tiradas dos DFMs do original (docs/delphi/dfm): TDTM (estilos das grades), TDTMESTILOS (EditeEstilos) e
   o painel "Digite..." (TFCDE136.mens). Delphi grava cor como BGR: 14155735 = $D7FFD7 → #D7FFD7. */
:root {
  --erp-fonte: Tahoma, 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --erp-fonte-campo: 'Arial Narrow', 'Roboto Condensed', Arial, sans-serif;  /* EditeEstilos: Arial Narrow 13px */
  --erp-tam: 12.5px;
  --erp-texto: var(--ink, #191e29);
  --erp-azul: #004566;                           /* cxLabel Style.TextColor 6702336 */
  --erp-titulo-col: #005279;                     /* FonteTituloGrids TextColor 7950848 (Arial negrito) */
  --erp-radio: #006A9F;                          /* radios/checks Font.Color 10447616 */
  --erp-campo-texto: #002D59;                    /* EditeEstilos Font.Color 5844224 */
  --erp-foco-borda: #006595;                     /* StyleFocused.BorderColor 9790720 */
  --erp-foco-texto: #E84B00;                     /* StyleFocused.TextColor 19432 */
  --erp-hot-borda: #0080FF;                      /* StyleHot.BorderColor 16744448 */
  --erp-digite: #006393;                         /* painel mens Color 9659136 */
  --erp-nav: #0070A6;                            /* Navegacao Color 10907648 */
  --erp-acento: var(--orange-600, #ea580c);
  --erp-acento-claro: var(--orange-50, #fff7ed);
  --erp-borda: #c9d2de;
  --erp-borda-campo: var(--field, #b9c3d0);
  --erp-fundo: var(--bg, #eef2f7);
  --erp-janela: #ffffff;
  --erp-titulo-bg: linear-gradient(180deg, #f7f9fc, #e6ecf4);
  --erp-grupo-bg: #f8fafc;
  --erp-zebra-1: #D7FFD7;                        /* ZebraGridPrimeiraLinha 14155735 */
  --erp-zebra-2: #DDF3FF;                        /* ZebraGrid 16774365 */
  --erp-sel: #FFFF80;                            /* linhaselecionada 8454143 (sublinhada) */
  --erp-sel-borda: #d8d860;
  --erp-destaque: #FF0000;                       /* CelulaGridCodigo: clRed negrito */
  --erp-ok: #16a34a;
  --erp-info: #2563eb;
  --erp-erro: #dc2626;
  --erp-aviso: #d97706;
  --erp-leitura: #f1f3f6;
}

/* ═══════════ Tela (janela de lista) ═══════════ */
.erp-tela { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; margin: 8px; background: var(--erp-janela); border: 1px solid var(--erp-borda); border-radius: 6px; box-shadow: 0 2px 10px rgba(16,24,40,.06); overflow: hidden; font-family: var(--erp-fonte); font-size: var(--erp-tam); color: var(--erp-texto); }
#content > .erp-tela { height: auto; }
.erp-tela-titulo, .erp-janela-titulo { display: flex; align-items: center; gap: 7px; padding: 6px 8px 6px 10px; background: var(--erp-titulo-bg); border-bottom: 1px solid var(--erp-borda); font-size: 13px; font-weight: 600; color: var(--erp-texto); user-select: none; }
.erp-tela-titulo .erp-ico, .erp-janela-titulo .erp-ico { width: 15px; height: 15px; color: var(--erp-azul); }
.erp-cresce { flex: 1; }
.erp-modo { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.erp-modo:empty { display: none; }
.erp-modo.leitura { display: none; }
.erp-modo.offline, .erp-modo.sync-error { background: #fef3c7; color: #92400e; }
.erp-x { width: 24px; height: 20px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #6b7280; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.erp-x:hover { background: #e81123; color: #fff; }
.erp-x .erp-ico { width: 13px; height: 13px; color: inherit !important; }

/* Barra de botões: ícone + tecla (Ins, F2, F6...) */
.erp-barra { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--erp-borda); background: #fbfcfe; flex-wrap: wrap; }
.erp-sep { width: 1px; height: 20px; background: var(--erp-borda); margin: 0 3px; }
.erp-barra-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border: 1px solid transparent; border-radius: 4px; background: transparent; font: 700 12.5px var(--erp-fonte); color: var(--erp-texto); cursor: pointer; }
.erp-barra-btn:hover:not(:disabled) { background: var(--erp-acento-claro); border-color: #fcd9bd; }
.erp-barra-btn:disabled { color: #9aa1ac; cursor: default; }
.erp-barra-btn:disabled .erp-ico { filter: grayscale(1); opacity: .45; }
.erp-ico { width: 16px; height: 16px; flex: 0 0 auto; }
.erp-ico-incluir, .erp-ico-localizar, .erp-ico-proximo, .erp-ico-anterior { color: var(--erp-info); }
.erp-ico-alterar { color: #7c3aed; }
.erp-ico-excluir { color: #64748b; }
.erp-ico-imprimir, .erp-ico-etiqueta, .erp-ico-lista { color: #475569; }
.erp-ico-sair, .erp-ico-erro { color: var(--erp-erro); }
.erp-ico-gravar, .erp-ico-mais, .erp-ico-planilha { color: var(--erp-ok); }
.erp-ico-cancelar { color: var(--erp-info); }
.erp-ico-info, .erp-ico-pergunta { color: var(--erp-info); }
.erp-ico-aviso { color: var(--erp-aviso); }
.erp-ico-pdf { color: var(--erp-erro); }

/* Grupos de filtro no alto */
.erp-filtros { display: flex; gap: 8px; padding: 6px 8px 0; }
.erp-filtros .erp-filtro { flex: 1 1 0; }
.erp-filtros .erp-grupo { margin: 0; }
.erp-tela-grade { flex: 1; min-height: 140px; display: flex; flex-direction: column; padding: 6px 8px 0; }
.erp-tela-grade > .erp-grade { flex: 1; min-height: 0; }
.erp-tela-grade .erp-grade-rolagem { flex: 1; }

/* Barra "Digite...." */
.erp-digite { display: flex; align-items: center; gap: 10px; margin: 6px 8px 8px; padding: 0 10px; height: 30px; background: var(--erp-digite); color: #fff; border-radius: 3px; }
.erp-digite > span { font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.erp-digite-input { flex: 1; min-width: 80px; height: 22px; border: none; outline: none; background: rgba(255,255,255,.12); color: #fff; border-radius: 3px; padding: 0 8px; font: 600 12.5px var(--erp-fonte); }
.erp-digite-input:focus { background: #fff; color: var(--erp-texto); }
.erp-digite-opcoes { display: flex; gap: 14px; }
.erp-digite-opcoes label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.erp-digite-opcoes input { accent-color: var(--erp-acento); }
.erp-painel { padding: 0 8px 8px; }
.erp-painel-linha { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 12.5px; }
.erp-painel-linha b { color: var(--erp-azul); font-weight: 600; }

/* ═══════════ Grade ═══════════ */
.erp-grade { display: flex; flex-direction: column; border: 1px solid var(--erp-borda); background: #fff; outline: none; min-height: 0; }
.erp-grade:focus-visible, .erp-grade:focus { border-color: #8fb0dc; }
.erp-grade-rolagem { position: relative; overflow: auto; min-height: 80px; }
.erp-tab { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12.5px; }
.erp-tab th { position: sticky; top: 0; z-index: 1; background: #fff; color: var(--erp-titulo-col); font-family: Arial, Helvetica, sans-serif; font-weight: 700; padding: 5px 6px; border-bottom: 1px solid var(--erp-borda); border-right: 1px solid #e6ebf1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; }
.erp-tab thead tr:nth-child(2) th { top: 26px; }
.erp-tab thead tr:nth-child(3) th { top: 52px; }
.erp-tab th.ordenavel { cursor: pointer; }
.erp-tab th.ordenavel:hover { background: #f4f7fb; }
.erp-tab .erp-ordem { width: 11px; height: 11px; vertical-align: -1px; margin-left: 3px; color: var(--erp-azul); }
.erp-tab-titulo th { font-size: 13.5px; color: var(--erp-texto); background: #fbfcfe; }
.erp-tab-banda th { font-size: 13px; color: var(--erp-texto); }
.erp-tab td { padding: 2px 6px; height: 21px; border-bottom: 1px solid #edf1f6; border-right: 1px solid #f1f4f8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-tab tbody tr { background: var(--erp-zebra-1); cursor: default; }
.erp-tab tbody tr.par { background: var(--erp-zebra-2); }
.erp-tab tbody tr:hover td { background: rgba(37,99,235,.05); }
.erp-tab tbody tr.sel td { text-decoration: underline; background: var(--erp-sel); border-top: 1px solid var(--erp-sel-borda); border-bottom: 1px solid var(--erp-sel-borda); }
.erp-tab tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--erp-nav); }
.erp-tab tbody tr.pendente td { font-style: italic; color: #6b7280; }
.erp-tab tfoot td { position: sticky; bottom: 0; background: #eef3f9; font-weight: 700; border-top: 1px solid var(--erp-borda); padding: 3px 6px; }
.erp-dir { text-align: right; font-variant-numeric: tabular-nums; }
.erp-centro { text-align: center; }
.erp-esq { text-align: left; }
.erp-destaque { color: var(--erp-destaque); font-weight: 700; }
.erp-bola { display: inline-block; width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #b5e36b, #6aa313); box-shadow: 0 0 0 1px #5b8f12; vertical-align: -2px; }
.erp-grade-vazio { position: absolute; inset: 60px 0 0; display: flex; align-items: center; justify-content: center; color: #c0c0c0; font: 700 22px 'Agency FB', 'Arial Narrow', Arial, sans-serif; pointer-events: none; }   /* FundoGrid */
.erp-tab tbody td { font-family: Tahoma, 'Segoe UI', Arial, sans-serif; }

/* Navegador |< << < 1 de 9 > >> >| */
.erp-nav { display: flex; align-items: center; gap: 1px; padding: 3px 4px; border-top: 1px solid var(--erp-borda); background: #f6f8fb; }
.erp-nav button { width: 24px; height: 22px; border: none; background: transparent; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--erp-azul); }
.erp-nav button .erp-ico { width: 12px; height: 12px; color: inherit; fill: currentColor; }
.erp-nav button:hover:not(:disabled) { background: #e3ebf6; }
.erp-nav button:disabled { color: #b7c0cc; cursor: default; }
.erp-nav-pos { min-width: 64px; height: 22px; padding: 0 8px; margin: 0 4px; display: inline-flex; align-items: center; justify-content: center; background: var(--erp-nav); color: #fff; font-weight: 700; font-size: 12px; border-radius: 2px; }
.erp-nav-info { margin-left: 10px; font-size: 11.5px; color: #6b7280; }

/* ═══════════ Janelas e mensagens ═══════════ */
.erp-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.28); display: flex; align-items: center; justify-content: center; padding: 20px; font-family: var(--erp-fonte); font-size: var(--erp-tam); color: var(--erp-texto); }
.erp-janela { max-width: 100%; max-height: 100%; display: flex; flex-direction: column; background: var(--erp-janela); border: 1px solid #9fb3cc; border-radius: 6px; box-shadow: 0 18px 48px rgba(15,23,42,.28); overflow: hidden; }
.erp-janela-titulo { cursor: default; }
.erp-janela-titulo > span { flex: 1; }
.erp-janela-corpo { padding: 8px 10px; overflow: auto; min-height: 0; }
.erp-janela-rodape { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-top: 1px solid #e3e8ef; background: #f7f9fc; }
.erp-rodape-esq { flex: 1; display: flex; align-items: center; }
.erp-rodape-esq .erp-ficha-rodape { display: flex; gap: 16px; }
.erp-rodape-dir { display: flex; gap: 8px; }
.erp-botao { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid #b9c4d2; border-radius: 4px; background: linear-gradient(180deg, #fff, #eef2f7); font: 600 12.5px var(--erp-fonte); color: var(--erp-texto); cursor: pointer; white-space: nowrap; }
.erp-botao:hover:not(:disabled) { border-color: #7f9ec6; background: linear-gradient(180deg, #fff, #e3ecf7); }
.erp-botao:focus-visible { outline: 2px solid #7f9ec6; outline-offset: 1px; }
.erp-botao.erp-primario { border-color: #7f9ec6; }
.erp-botao:disabled { color: #9aa1ac; cursor: default; }
.erp-botao:disabled .erp-ico { filter: grayscale(1); opacity: .5; }
.erp-botao.erp-mini { height: 26px; padding: 0 8px; font-size: 12px; }
.erp-btn-ico { width: 26px; height: 26px; flex: 0 0 auto; border: 1px solid var(--erp-borda-campo); border-radius: 3px; background: #f7f9fc; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.erp-btn-ico:hover:not(:disabled) { background: #e8eff8; }
.erp-btn-ico:disabled { opacity: .5; cursor: default; }
.erp-btn-ico .erp-ico { width: 14px; height: 14px; }

.erp-janela-msg .erp-janela-corpo { padding: 16px 18px 10px; }
.erp-msg { display: flex; gap: 14px; align-items: flex-start; }
.erp-msg-ico .erp-ico { width: 38px; height: 38px; stroke-width: 1.6; }
.erp-msg-texto b { display: block; font-size: 16px; color: var(--erp-azul); margin-bottom: 6px; font-family: Georgia, 'Times New Roman', serif; }
.erp-msg-texto p { font-size: 14px; line-height: 1.45; }
.erp-janela-msg .erp-janela-rodape { justify-content: center; }
.erp-janela-msg .erp-rodape-esq { display: none; }

/* ═══════════ Ficha ═══════════ */
.erp-abas { display: flex; gap: 2px; border-bottom: 1px solid var(--erp-borda); margin-bottom: 8px; padding-left: 2px; }
.erp-aba { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; margin-bottom: -1px; border: 1px solid transparent; border-bottom: none; border-radius: 4px 4px 0 0; background: transparent; font: 500 12.5px var(--erp-fonte); color: #4b5563; cursor: pointer; }
.erp-aba:hover { background: #f1f5fa; }
.erp-aba.ativa { background: #fff; border-color: var(--erp-borda); color: var(--erp-texto); font-weight: 700; box-shadow: inset 0 2px 0 var(--erp-acento); }
.erp-aba .erp-ico { width: 15px; height: 15px; color: var(--erp-azul); }
.erp-grupo { position: relative; border: 1px solid #d9e1eb; border-radius: 4px; background: var(--erp-grupo-bg); padding: 6px 8px 8px; margin-bottom: 8px; }
.erp-grupo-sem { border-color: transparent; background: transparent; padding: 0 0 4px; }
.erp-grupo-titulo { font-size: 12px; color: var(--erp-azul); margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1px solid #e3e9f1; }
.erp-grid { display: grid; gap: 6px 8px; align-items: end; }
.erp-campo { display: flex; flex-direction: column; min-width: 0; }
.erp-rot { font-size: 12px; color: var(--erp-azul); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-rot i { color: var(--erp-erro); font-style: normal; margin-left: 2px; }
.erp-input { width: 100%; height: 25px; padding: 0 6px; border: 1px solid #c0c0c0; border-radius: 2px; background: #fff; font: 13.5px var(--erp-fonte-campo); color: var(--erp-campo-texto); outline: none; min-width: 0; }
textarea.erp-input { height: auto; padding: 4px 6px; resize: vertical; line-height: 1.4; }
select.erp-input { padding: 0 4px; }
.erp-input:hover:not(:focus):not([readonly]):not(:disabled) { border-color: var(--erp-hot-borda); }
.erp-input:focus { border: 2px solid var(--erp-foco-borda); padding: 0 5px; color: var(--erp-foco-texto); background: #fff; }
.erp-input.erp-num, .erp-moeda .erp-input { text-align: right; font-variant-numeric: tabular-nums; }
.erp-input[readonly], .erp-input:disabled, .erp-leitura .erp-input { background: #fff; color: #515151; box-shadow: none; }   /* StyleDisabled: fundo branco, texto 5329233 */
.erp-input.erp-invalido, .erp-campo-erro .erp-input { border-color: var(--erp-erro); box-shadow: 0 0 0 2px rgba(220,38,38,.15); }
.erp-campo-erro .erp-rot { color: var(--erp-erro); }
.erp-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--erp-radio); cursor: pointer; min-height: 22px; }
.erp-campo-logico .erp-chk { font-weight: 600; color: #1e3a8a; }
.erp-chk input { width: 14px; height: 14px; accent-color: var(--erp-azul); margin: 0; }
.erp-opcional { margin-bottom: 2px; }
.erp-radios { display: grid; gap: 4px; }
.erp-radios.erp-horizontal { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.erp-radios .erp-chk { color: var(--erp-radio); }
.erp-data { display: flex; gap: 2px; position: relative; }
.erp-data .erp-input { flex: 1; text-align: center; }
.erp-data .erp-btn-ico { width: 25px; height: 25px; }
.erp-data-nativo { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.erp-periodo { display: flex; align-items: center; gap: 6px; }
.erp-periodo .erp-campo { flex: 1; }
.erp-periodo-a { color: #4b5563; font-size: 12px; }
.erp-texto-rotulo { font-size: 12.5px; color: #374151; }

/* Pesquisa (lookup) */
.erp-pesq { display: flex; gap: 2px; position: relative; }
.erp-pesq-cod { flex: 0 0 64px; width: 64px; text-align: right; }
.erp-pesq-txt { flex: 1; }
.erp-pesq .erp-btn-ico { width: 25px; height: 25px; }
.erp-pesq-lista { position: absolute; left: 0; right: 0; top: 100%; z-index: 50; max-height: 240px; overflow: auto; margin-top: 2px; background: #fff; border: 1px solid #9fb3cc; box-shadow: 0 8px 22px rgba(15,23,42,.18); border-radius: 3px; }
.erp-pesq-item { display: flex; gap: 10px; padding: 4px 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-pesq-item b { color: var(--erp-destaque); min-width: 40px; text-align: right; }
.erp-pesq-item.hi, .erp-pesq-item:hover { background: var(--erp-sel); }
.erp-pesq-vazio { padding: 6px 8px; color: #9aa1ac; }
.erp-pesquisa .erp-digite { margin: 0 0 6px; }

/* Imagem */
.erp-imagem { display: flex; flex-direction: column; gap: 4px; }
.erp-imagem-quadro { height: 150px; border: 1px solid var(--erp-borda-campo); background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #a3acb9; }
.erp-imagem-quadro img { display: none; max-width: 100%; max-height: 100%; object-fit: contain; }
.erp-imagem.tem img { display: block; }
.erp-imagem.tem span { display: none; }
.erp-imagem-botoes { display: flex; justify-content: space-around; }

/* Mestre-detalhe */
.erp-detalhe { border: 1px solid #d9e1eb; border-radius: 4px; background: var(--erp-grupo-bg); padding: 6px 8px 8px; }
.erp-detalhe-corpo { display: flex; gap: 6px; }
.erp-detalhe-botoes { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.erp-detalhe-botoes button { width: 28px; height: 28px; border: 1px solid transparent; background: transparent; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.erp-detalhe-botoes button:hover:not(:disabled) { background: #e3ebf6; border-color: #c6d4e6; }
.erp-detalhe-botoes button:disabled { opacity: .4; cursor: default; filter: grayscale(1); }
.erp-detalhe-grade { flex: 1; min-width: 0; }

/* ═══════════ Pré-visualização de relatório ═══════════ */
.erp-preview { position: fixed; inset: 0; display: flex; flex-direction: column; background: #5f6b7a; font-family: var(--erp-fonte); font-size: var(--erp-tam); }
.erp-preview-barra { display: flex; align-items: center; gap: 4px; padding: 6px 10px; background: #f3f6fa; border-bottom: 1px solid #c9d2de; flex-wrap: wrap; }
.erp-preview-barra .erp-btn-ico { width: 28px; height: 28px; }
.erp-preview-pag { padding: 0 8px; white-space: nowrap; }
.erp-preview-zoom { width: 150px; height: 28px; }
.erp-preview-titulo { color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.erp-preview-area { flex: 1; overflow: auto; padding: 20px 24px 40px; }
.erp-paginas { display: flex; flex-direction: column; align-items: center; gap: 18px; width: max-content; min-width: 100%; }
.erp-pagina { position: relative; flex: 0 0 auto; box-sizing: border-box; padding: 34px 38px 30px; background: #fff; color: #111; box-shadow: 0 4px 18px rgba(0,0,0,.35); font-family: Arial, Helvetica, sans-serif; font-size: 11px; overflow: hidden; display: flex; flex-direction: column; }
.erp-pg-cab { position: relative; border-bottom: 1.5px solid #222; padding-bottom: 6px; margin-bottom: 8px; }
.erp-pg-emp { display: flex; gap: 10px; align-items: center; min-height: 44px; padding-right: 170px; }
.erp-pg-emp img { max-height: 46px; max-width: 120px; object-fit: contain; }
.erp-pg-emp b { display: block; font-size: 13px; }
.erp-pg-emp span { display: block; font-size: 10px; color: #333; }
.erp-pg-data { position: absolute; top: 0; right: 0; text-align: right; font-size: 10px; color: #333; display: flex; flex-direction: column; gap: 2px; }
.erp-pg-cab h1 { margin-top: 6px; text-align: center; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.erp-pg-cab h2 { text-align: center; font-size: 11.5px; font-weight: 400; margin-top: 2px; }
.erp-pg-filtros { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; margin-top: 3px; font-size: 10px; color: #333; }
.erp-pg-corpo { flex: 1; min-height: 0; }
.erp-pg-rod { display: flex; justify-content: space-between; border-top: 1px solid #555; padding-top: 4px; margin-top: 6px; font-size: 9.5px; color: #333; }
.erp-rel-tab { width: 100%; border-collapse: collapse; table-layout: fixed; }
.erp-rel-tab th { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 3px 4px; border-top: 1px solid #222; border-bottom: 1px solid #222; background: #eef0f3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-rel-tab td { padding: 2px 4px; font-size: 10.5px; border-bottom: 1px solid #e3e3e3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-pagina.compacto .erp-rel-tab td { padding: 1px 4px; font-size: 9.5px; }
.erp-rel-tab tr.par td { background: #f7f8fa; }
.erp-rel-grupo td { font-weight: 700; background: #e7ecf3 !important; border-top: 1px solid #9aa8bb; padding-top: 4px; }
.erp-rel-subtotal td { font-weight: 700; border-top: 1px solid #888; background: #fafafa; }
.erp-rel-total td { font-weight: 700; border-top: 1.5px solid #222; border-bottom: 1.5px solid #222; background: #eef0f3; }
.erp-rel-assin { display: flex; justify-content: space-around; gap: 30px; margin-top: 46px; }
.erp-rel-assin div { flex: 1; max-width: 260px; text-align: center; font-size: 10.5px; }
.erp-rel-assin i { display: block; border-top: 1px solid #222; margin-bottom: 4px; }
/* Menu de clique direito / suspenso (PopMenu do original) */
.erp-menu { position: fixed; min-width: 210px; padding: 3px; background: #fff; border: 1px solid #b9c4d1; box-shadow: 0 6px 18px rgba(16,24,40,.18); font-family: var(--erp-fonte, Tahoma, Arial, sans-serif); font-size: 13px; }
.erp-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 10px; border: none; background: none; color: var(--erp-texto, #1f2937); font: inherit; text-align: left; cursor: pointer; }
.erp-menu button:hover:not(:disabled) { background: #fff4d6; }
.erp-menu button:disabled { color: #9aa5b3; cursor: not-allowed; }
.erp-menu button em { margin-left: auto; padding-left: 18px; font-style: normal; color: #6b7a8c; }
.erp-menu-sep { display: block; height: 1px; margin: 3px 4px; background: #e2e8f0; }
.erp-rel-medidor { position: absolute; left: -20000px; top: 0; visibility: hidden; }

/* Motor FastReport (_fastreport.js): objetos nas posições do original, em px a 96 dpi */
.erp-pagina.erp-fr-pagina { padding: 0; display: block; color: #000; font-size: 13px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.erp-fr-area { position: absolute; }
.erp-fr-abs { position: absolute; left: 0; right: 0; }
.erp-fr-banda { position: relative; }
.erp-fr-o { position: absolute; box-sizing: border-box; overflow: hidden; display: block; }
.erp-fr-memo { display: flex; flex-direction: column; white-space: pre-wrap; word-break: break-word; }
.erp-fr-memo.nw { white-space: pre; }
.erp-fr-memo > span { display: block; width: 100%; }
.erp-fr-img img { width: 100%; height: 100%; object-fit: contain; }
.erp-fr-chk { display: flex; align-items: center; justify-content: center; }
.erp-fr-rich { line-height: 1.2; white-space: normal; word-break: break-word; }

@media print {
  body.erp-imprimindo > *:not(.erp-preview) { display: none !important; }
  body.erp-imprimindo { overflow: visible !important; background: #fff !important; }
  body.erp-imprimindo .erp-preview:not(:last-of-type) { display: none !important; }
  body.erp-imprimindo .erp-preview { position: static !important; display: block !important; background: #fff !important; }
  body.erp-imprimindo .erp-preview-barra { display: none !important; }
  body.erp-imprimindo .erp-preview-area { overflow: visible !important; padding: 0 !important; }
  body.erp-imprimindo .erp-paginas { display: block !important; zoom: 1 !important; gap: 0 !important; width: auto !important; min-width: 0 !important; }
  body.erp-imprimindo .erp-pagina { box-shadow: none !important; margin: 0 !important; break-after: page; page-break-after: always; }
  body.erp-imprimindo .erp-pagina:last-child { break-after: auto; page-break-after: auto; }
  body.erp-imprimindo .erp-rel-tab tr.par td, body.erp-imprimindo .erp-rel-tab th, body.erp-imprimindo .erp-rel-grupo td, body.erp-imprimindo .erp-rel-total td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Imagem do Delphi lida da cópia no Storage (Erp.imagemDelphi) */
.erp-img-delphi { display: block; max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }
.erp-img-delphi-nome { color: #555; font-size: 11px; }

/* Campo arquivo (bula, anexo) e indicador "Gravando..." das rotas de gravação */
.erp-arquivo { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.erp-arquivo-nome { font-size: 12px; color: #64748b; min-width: 90px; }
.erp-arquivo.tem .erp-arquivo-nome { color: #0f3d5c; font-weight: 600; }
.erp-arquivo:not(.tem) [data-a="ver"], .erp-arquivo:not(.tem) [data-a="exc"] { display: none; }
.erp-gravando { position: fixed; z-index: 100000; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 8px; background: #0f3d5c; color: #fff; font: 600 13px var(--erp-fonte, sans-serif); padding: 8px 14px; border-radius: 18px; box-shadow: 0 4px 14px rgba(0,0,0,.25); pointer-events: none; }
.erp-gravando i { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: erp-gira .8s linear infinite; }
@keyframes erp-gira { to { transform: rotate(360deg); } }
@media (max-width: 700px) { .erp-gravando { bottom: 76px; right: 50%; transform: translateX(50%); } }
