/* INCLUSÃO — Alberth — 2026-10-09 — Montserrat, tipografia da marca APEX (o @import tem que ser a 1ª regra do arquivo) */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --azul: #1d4ed8;
  --azul-escuro: #1e3a8a;
  --cinza-borda: #d1d5db;
  --cinza-fundo: #f3f4f6;
  --texto: #1f2937;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--cinza-fundo);
  color: var(--texto);
  min-height: 100vh;
}

.topbar {
  background: var(--azul-escuro);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.topbar h1 { font-size: 20px; letter-spacing: 1px; }
.topnav { display: flex; gap: 4px; }
.topnav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
}
.topnav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.topnav a.ativo { background: var(--azul); color: #fff; }

.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

.card {
  background: #fff;
  border: 1px solid var(--cinza-borda);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.row-flex { display: flex; gap: 12px; align-items: flex-end; }
.grow { flex: 1; }

.field { display: flex; flex-direction: column; }
.field label { font-size: 12px; font-weight: 600; margin-bottom: 4px; text-transform: uppercase; color: #4b5563; }
.field input, .field select, .field textarea {
  border: 1px solid var(--cinza-borda);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--azul);
  outline-offset: -1px;
}
.req { color: #dc2626; }

.btn {
  border: 1px solid var(--cinza-borda);
  background: #fff;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--cinza-fundo); }
.btn-primary { background: var(--azul); border-color: var(--azul); color: #fff; }
.btn-primary:hover { background: var(--azul-escuro); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-mini { padding: 3px 10px; font-size: 12px; margin-left: 10px; }

/* Combobox de cliente */
.combo { position: relative; }
.combo-list {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--cinza-borda);
  border-radius: 0 0 6px 6px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
}
.combo-item { padding: 8px 12px; cursor: pointer; font-size: 14px; }
.combo-item:hover, .combo-item.ativo { background: #dbeafe; }
.combo-vazio { padding: 10px 12px; color: #6b7280; font-size: 13px; }

/* Painel de detalhes */
#painelCliente h2 { font-size: 18px; margin-bottom: 12px; color: var(--azul-escuro); }
.det-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 8px; }
.det-grid > div { display: flex; flex-direction: column; }
.det-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #6b7280; }
.det-bloco { margin-top: 16px; }
.det-bloco h3 { font-size: 13px; text-transform: uppercase; color: #4b5563; border-bottom: 1px solid var(--cinza-borda); padding-bottom: 4px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: #dbeafe;
  color: var(--azul-escuro);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
}
.chips-promo .chip { background: #dcfce7; color: #166534; }
.vazio { color: #9ca3af; font-size: 13px; }

.tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabela th, .tabela td { border: 1px solid var(--cinza-borda); padding: 6px 10px; text-align: left; }
.tabela th { background: var(--cinza-fundo); text-transform: uppercase; font-size: 11px; }

/* Modal */
.modal-overlay[hidden] { display: none; }
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 980px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--cinza-borda);
}
.modal-header h2 { font-size: 17px; color: var(--azul-escuro); }
.btn-fechar {
  border: none; background: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  font-size: 24px; line-height: 1;
  cursor: pointer; color: #6b7280;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}
.btn-fechar:hover { background: #fee2e2; color: var(--vermelho); }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--cinza-borda);
}

.secao {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--azul-escuro);
  background: #eff6ff;
  border-left: 4px solid var(--azul);
  padding: 6px 10px;
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
}
.secao:first-child { margin-top: 0; }

/* minmax(0, 1fr) pelo mesmo motivo do .editor-grid: com "1fr" puro, um campo
   de conteudo largo (select com opcao comprida, por exemplo) estica a coluna
   e vaza a linha inteira para fora da tela. */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.c1 { grid-column: span 2; }
.c2 { grid-column: span 3; }
.c3 { grid-column: span 4; }
.c4 { grid-column: span 5; }
.c5 { grid-column: span 6; }
.c12 { grid-column: span 12; }

@media (max-width: 700px) {
  .c1, .c2, .c3, .c4, .c5 { grid-column: span 6; }
}

/* ===== INCLUSÃO — Gabriel — 2026-09-20 =====
   Motivo: escala de grid literal (1 a 12 = número real de colunas), pra evitar
   o tipo de bug que ".c6" causou (nome sugeria "6 colunas", mas essa classe nem
   existia — a escala antiga .c1-.c5/.c12 é uma progressão de frações, não
   literal). NÃO mexe em .c1-.c5/.c12 — essas continuam em uso em todas as telas
   já existentes (Clientes, Negociações, Comissionados...) e só podem mudar com
   ordem direta do dono do projeto. Use .col-N nas telas novas daqui pra frente. */
.col-1  { grid-column: span 1; }
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

@media (max-width: 700px) {
  .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
  .col-7, .col-8, .col-9, .col-10, .col-11 { grid-column: span 12; }
}
/* ===== FIM INCLUSÃO — Gabriel — 2026-09-20 ===== */

/* Linhas dinâmicas dos grids do modal */
.linha-grid {
  display: grid;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
  padding: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.linha-banco { grid-template-columns: 1.4fr 1.6fr .8fr 1fr .7fr 1fr 1.2fr auto; }
.linha-produto { grid-template-columns: 1.5fr .8fr 1.3fr 2.2fr auto; }
.linha-canal { grid-template-columns: 1.5fr .9fr 1.6fr auto; }
.linha-promocao { grid-template-columns: 1fr auto; }
.linha-comissionado { grid-template-columns: 2fr .8fr auto; }

.linha-grid .field label { font-size: 10px; }
.btn-remover {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #dc2626;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700;
}
.btn-remover:hover { background: #fee2e2; }

.preview-canal { font-size: 12px; color: var(--azul-escuro); font-weight: 700; align-self: center; padding-bottom: 9px; }

/* Campos de arquivo (rótulo do produto, cartão CNPJ): envio + link do já cadastrado */
.campo-arquivo { display: flex; align-items: center; gap: 6px; min-height: 38px; }
.campo-arquivo .btn-mini { white-space: nowrap; }
.rotulo-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--azul-escuro);
  text-decoration: underline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rotulo-vazio { font-size: 12px; color: #9ca3af; }
.rotulo-limpar {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #dc2626;
  border-radius: 6px;
  padding: 1px 6px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.3;
}
.rotulo-limpar:hover { background: #fee2e2; }

.alerta {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
}
.alerta.sucesso { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

@media (max-width: 700px) {
  .linha-banco, .linha-produto, .linha-canal { grid-template-columns: 1fr 1fr; }
}

/* ===== Módulo Negociação ===== */
.container-larga { max-width: 1400px; margin: 24px auto; padding: 0 16px; }

.titulo-neg { font-size: 18px; color: var(--azul-escuro); margin: 0 8px; }

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  white-space: nowrap;
}
.badge-cinza { background: #e5e7eb; color: #374151; }
.badge-azul { background: #dbeafe; color: var(--azul-escuro); }
.badge-amarelo { background: #fef3c7; color: #92400e; }
.badge-laranja { background: #ffedd5; color: #9a3412; } /* INCLUSÃO — Gustavo — 2026-10-23 — ASO CRÍTICO (≤30 dias), como na planilha do RH */
.badge-verde { background: #dcfce7; color: #166534; }
.badge-vermelho { background: #fee2e2; color: #b91c1c; }

.aviso-readonly { font-size: 13px; color: #92400e; background: #fef3c7; padding: 6px 12px; border-radius: 6px; }

/* minmax(0, 1fr) e nao 1fr: "1fr" equivale a minmax(auto, 1fr), e esse auto
   impede a coluna de encolher abaixo do conteudo — a tabela de midias, que e
   larga, empurrava a coluna e criava barra horizontal na pagina inteira. */
/* Coluna do resumo elastica: cede ate 220px antes de o layout empilhar, em vez
   de travar em 280px e roubar espaco da tabela quando a janela (ou o zoom)
   aperta. O minmax(0, 1fr) da primeira coluna evita o vazamento horizontal. */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); gap: 20px; align-items: start; }
/* Empilha a 1150px, nao a 1000px: com 11 colunas na tabela de itens, descontar
   os 220px do resumo deixava ~60px por coluna — ilegivel. Empilhado, a tabela
   usa a largura inteira e volta a caber. */
@media (max-width: 1150px) { .editor-grid { grid-template-columns: minmax(0, 1fr); } }

.abas { display: flex; gap: 4px; margin-bottom: -1px; }
.aba {
  border: 1px solid var(--cinza-borda);
  border-bottom: none;
  background: #e5e7eb;
  border-radius: 8px 8px 0 0;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: #4b5563;
}
.aba.ativo { background: #fff; color: var(--azul-escuro); }
.aba-conteudo { border-top-left-radius: 0; margin-bottom: 20px; }

.subtitulo {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--azul-escuro);
  margin-bottom: 10px;
}

/* overflow nos DOIS eixos: so overflow-y deixava a tabela larga transbordar
   para os lados e esticar o layout em vez de rolar dentro da propria caixa. */
/* Altura relativa a janela: 320px fixos ocupavam quase a tela toda com zoom
   alto (a 200% o viewport cai para ~450px de altura). O min() mantem os 320px
   em tela folgada e encolhe quando nao ha espaco. */
.tabela-scroll { max-height: min(320px, 45vh); overflow: auto; border: 1px solid var(--cinza-borda); border-radius: 6px; }
.tabela-scroll .tabela { border: none; }
.tabela-compacta th, .tabela-compacta td { padding: 5px 8px; font-size: 12.5px; }

/* Grade de midias (aba 1): table-layout fixed + larguras em % fazem a tabela
   caber SEMPRE na coluna, sem barra horizontal — nome de emissora/programa e
   texto livre e nao tinha teto. Os truncados levam title com o texto inteiro. */
#tabelaMidias { table-layout: fixed; width: 100%; }
#tabelaMidias th, #tabelaMidias td { padding: 5px 6px; }
#tabelaMidias th:nth-child(1), #tabelaMidias td:nth-child(1) { width: 18%; }
#tabelaMidias th:nth-child(2), #tabelaMidias td:nth-child(2) { width: 20%; }
#tabelaMidias th:nth-child(3), #tabelaMidias td:nth-child(3) { width: 12%; }
#tabelaMidias th:nth-child(4), #tabelaMidias td:nth-child(4) { width: 9%; }
#tabelaMidias th:nth-child(5), #tabelaMidias td:nth-child(5) { width: 10%; }
#tabelaMidias th:nth-child(6), #tabelaMidias td:nth-child(6) { width: 10%; }
#tabelaMidias th:nth-child(7), #tabelaMidias td:nth-child(7) { width: 10%; }
#tabelaMidias th:nth-child(8), #tabelaMidias td:nth-child(8) { width: 11%; }
/* Corta com reticencias em vez de empurrar a coluna */
#tabelaMidias td:nth-child(-n+5) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tabelaMidias td:nth-child(8) { text-align: right; }
/* margin-left: 0 e essencial: o .btn-mini global tem margin-left: 10px (para
   separar de titulos, como em "Materiais a produzir + Material") e dentro da
   celula essa margem somava na largura e fazia o botao vazar. Escopado aqui
   para nao quebrar os outros usos do .btn-mini. */
#tabelaMidias td:nth-child(8) .btn-mini { margin-left: 0; padding: 3px 6px; max-width: 100%; }

/* Midias selecionadas: mesmo tratamento, 11 colunas. Os inputs ja sao
   width:100% e o box-sizing global e border-box, entao eles acompanham a
   celula sem estourar. */
#tabelaItens { table-layout: fixed; width: 100%; }
#tabelaItens th, #tabelaItens td { padding: 5px 6px; }
/* "LIGAÇÕES" (col. 8) e uma palavra unica, sem espaco onde quebrar: em 5% ela
   nao cabia nem se dividia, e vazava. Os 3% extras saem de Emissora/Programa e
   Periodo, que quebram em varias linhas sem prejuizo. */
#tabelaItens th:nth-child(1),  #tabelaItens td:nth-child(1)  { width: 14%; }
#tabelaItens th:nth-child(2),  #tabelaItens td:nth-child(2)  { width: 8%; }
#tabelaItens th:nth-child(3),  #tabelaItens td:nth-child(3)  { width: 5%; }
#tabelaItens th:nth-child(4),  #tabelaItens td:nth-child(4)  { width: 9%; }
#tabelaItens th:nth-child(5),  #tabelaItens td:nth-child(5)  { width: 9%; }
#tabelaItens th:nth-child(6),  #tabelaItens td:nth-child(6)  { width: 11%; }
#tabelaItens th:nth-child(7),  #tabelaItens td:nth-child(7)  { width: 10%; }
#tabelaItens th:nth-child(8),  #tabelaItens td:nth-child(8)  { width: 8%; }
#tabelaItens th:nth-child(9),  #tabelaItens td:nth-child(9)  { width: 11%; }
#tabelaItens th:nth-child(10), #tabelaItens td:nth-child(10) { width: 10%; }
#tabelaItens th:nth-child(11), #tabelaItens td:nth-child(11) { width: 5%; }
/* Coluna do X: o .btn-remover global usa padding 8px 10px e nao cabia. Aqui ele
   fica compacto e centralizado, com padding menor na propria celula. */
#tabelaItens td:nth-child(11) { padding: 5px 3px; text-align: center; }
#tabelaItens td:nth-child(11) .btn-remover { padding: 3px 7px; font-size: 13px; line-height: 1.2; }
/* A 1a e a 2a sao as unicas de texto livre: quebram em vez de empurrar, e
   quebram ate no meio da palavra se o nome for muito longo. */
#tabelaItens td:nth-child(1), #tabelaItens td:nth-child(2) { overflow-wrap: anywhere; }
/* Dentro desta tabela o input acompanha a coluna, sem o teto de 100px */
#tabelaItens .input-cel.num { max-width: 100%; }

/* Nas duas tabelas de largura fixa, o TITULO pode quebrar em varias linhas.
   O .num global aplica white-space: nowrap, o que faz sentido no valor
   ("R$ 1.234,56" nao deve quebrar) mas nao no cabecalho: titulos longos como
   "Vl. Vendido Avulso" transbordavam por cima da coluna vizinha.
   Alinhados pela base para o cabecalho ficar reto com titulos de 1 e 2 linhas.
   Estas regras aparecem ANTES da global ".tabela th.num" e ainda assim vencem:
   seletor com ID tem especificidade maior que dois de classe, e a ordem so
   desempata entre seletores de mesma especificidade. Nao reordenar achando
   que esta "errado". */
/* overflow-wrap: anywhere e a rede de seguranca — titulo de palavra unica que
   nao caiba na coluna quebra em vez de vazar por cima da vizinha. Com as
   larguras atuais nao chega a ser acionado; existe para nao voltar a quebrar
   se algum titulo mudar. */
#tabelaMidias th, #tabelaItens th { white-space: normal; vertical-align: bottom; overflow-wrap: anywhere; }
#tabelaMidias th.num, #tabelaItens th.num { white-space: normal; }
.tabela th.num, .tabela td.num { text-align: right; white-space: nowrap; }
.linha-click { cursor: pointer; }
.linha-click:hover { background: #eff6ff; }
.mini-sts { font-size: 10px; font-weight: 700; color: #6b7280; }

/* ===== INCLUSÃO — Gabriel — 2026-09-20 =====
   Motivo: tela de Emissora/Programa — ícones de ação em tabela + multi-select por chips */
/* Botão-ícone (ações de linha em tabela: visualizar/editar/inativar) */
.btn-icone {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  border: none; background: transparent; padding: 0;
}
.btn-icone:hover { background: #eef2f7; }
.btn-icone.perigo:hover { background: #fee2e2; }
.btn-icone svg { width: 15px; height: 15px; flex: none; }

/* Multi-select por chips (produtos, regiões...) — reutilizável */
.campo-chips {
  min-height: 36px; border: 1px solid var(--cinza-borda); border-radius: 6px;
  padding: 6px 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  cursor: pointer; background: #fff;
}
.campo-dropdown { position: absolute; top: 100%; left: 0; margin-top: 4px; width: 100%; z-index: 10; }
.campo-dropup { position: absolute; bottom:100%; top: auto ; left: 0; margin-top: 4px; width: 100%; z-index: 10; }

/* Dias da semana — botão-pílula sem checkbox (não usar .dia-chk, que já está em
   uso em Negociação/Programação com checkbox visível). */
.dia-toggle {
  width: 44px; height: 32px; border-radius: 6px; border: 1px solid var(--cinza-borda);
  background: #f3f4f6; color: #6b7280; font-size: 11px; font-weight: 700;
  cursor: pointer; user-select: none;
}
.dia-toggle.ativo { background: var(--azul); border-color: var(--azul); color: #fff; }
.dia-toggle[disabled] { cursor: default; opacity: .7; }

/* Barra de Salvar/Cancelar fixa no rodapé (sticky) — substitui o padrão anterior
   de botões no cabeçalho; ver docs/PADROES-DESENVOLVIMENTO.md (seção 4, revisada
   em 2026-09-20). Sticky mantém os botões visíveis durante a rolagem sem tampar
   o conteúdo como um fixed cobriria. */
/* Focus visível no multi-select de chips (div, não <input> — precisa de
   tabindex + estilo próprio pra mostrar foco por teclado/clique, já que o
   .field input:focus padrão não alcança um <div>). */
.campo-chips:focus, .campo-chips:focus-visible {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(37,99,235,.16);
}

/* Campo obrigatório vazio, sinalizado após tentativa de salvar — some sozinho
   assim que o usuário começa a corrigir (ver limparCampoInvalido()). */
.campo-invalido {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
}

.barra-acoes-sticky {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  margin-top: 20px;
  background: #fff;
  border: 1px solid var(--cinza-borda);
  border-radius: 8px;
  box-shadow: 0 -4px 12px rgba(0,0,0,.08);
}
/* ===== FIM INCLUSÃO — Gabriel — 2026-09-20 ===== */

.input-cel {
  border: 1px solid var(--cinza-borda);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12.5px;
  width: 100%;
  min-width: 70px;
  font-family: inherit;
}
.input-cel.num { text-align: right; max-width: 100px; }
.input-cel:focus { outline: 2px solid var(--azul); outline-offset: -1px; }
.input-cel:disabled { background: var(--cinza-fundo); color: #6b7280; }

/* Sticky precisa de teto de altura: sem isso, quando o painel fica mais alto
   que a janela ele gruda no topo e o rodape fica inalcancavel — nao rola junto
   com a pagina nem por dentro. Com max-height ele rola sozinho quando precisa. */
.painel-resumo { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
/* Abaixo do breakpoint o painel vai para baixo do editor: sticky e teto de
   altura perdem o sentido e so atrapalhariam.
   O 1150px precisa ser o MESMO do .editor-grid — se os dois divergirem, existe
   uma faixa de largura em que o painel ja esta empilhado mas ainda sticky. */
@media (max-width: 1150px) {
  .painel-resumo { position: static; max-height: none; overflow-y: visible; }
}
.resumo-linha { display: flex; justify-content: space-between; font-size: 14px; padding: 5px 0; }
.resumo-linha.destaque { font-weight: 700; font-size: 16px; color: var(--azul-escuro); }
.resumo-linha.mini { font-size: 12px; color: #6b7280; }
.resumo-divisor { border-top: 1px solid var(--cinza-borda); margin: 8px 0; }
.negativo { color: #dc2626 !important; }

.alerta-alcada {
  margin-top: 12px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12.5px;
}
.alerta-inline { color: #92400e; background: #fef3c7; border-radius: 6px; padding: 6px 10px; font-size: 13px; margin-top: 8px; }

/* Envio da produção para o APEX (aba Produção) */
.apex-envio { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--cinza-borda); }
.apex-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.apex-info { font-size: 12.5px; color: #6b7280; margin-top: 8px; }
.apex-info.apex-ok { color: #166534; font-weight: 600; }

.rodape-acoes { position: sticky; bottom: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.12); }
.btn-perigo { border-color: #fecaca; color: #dc2626; }
.btn-perigo:hover { background: #fef2f2; }

.modal-pequeno { max-width: 480px; }

.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline-item {
  display: flex;
  gap: 14px;
  font-size: 13px;
  border-left: 3px solid var(--azul);
  padding-left: 12px;
}
.timeline-data { color: #6b7280; white-space: nowrap; font-size: 12px; padding-top: 1px; }

/* ===== Fase 2: Programação ===== */
.info-reserva {
  font-size: 12.5px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.pendente { color: #d97706; font-weight: 600; }

.prog-card {
  border: 1px solid var(--cinza-borda);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
  background: #fafafa;
}
.prog-titulo { font-size: 14px; margin-bottom: 10px; color: var(--azul-escuro); }
.prog-total {
  border: 1px solid var(--cinza-borda);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  background: #eff6ff;
  color: var(--azul-escuro);
}
.prog-dias { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dia-chk {
  display: flex; align-items: center; gap: 5px;
  border: 1px solid var(--cinza-borda);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
  user-select: none;
}
.dia-chk:has(input:checked) { background: #dbeafe; border-color: var(--azul); color: var(--azul-escuro); }
.prog-conflito {
  margin-top: 10px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12.5px;
}
.prog-feriados { margin-top: 8px; font-size: 12.5px; color: #92400e; }

.calendario { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.cal-mes { background: #fff; border: 1px solid var(--cinza-borda); border-radius: 8px; padding: 10px; }
.cal-mes-nome { font-size: 12px; font-weight: 700; color: var(--azul-escuro); margin-bottom: 6px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 26px); gap: 3px; }
.cal-cab { font-size: 10px; font-weight: 700; color: #9ca3af; text-align: center; }
.cal-dia, .cal-vazio {
  width: 26px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  border-radius: 4px;
}
.cal-on { background: var(--azul); color: #fff; font-weight: 600; }
.cal-off { background: var(--cinza-fundo); color: #9ca3af; }
.cal-fora { color: #d1d5db; }
.cal-fer { outline: 2px solid #f59e0b; outline-offset: -2px; }

/* ===== Fase 3: Tarefas ===== */
.badge-roxo { background: #ede9fe; color: #5b21b6; }
.badge-setor { background: var(--azul-escuro); color: #fff; }
.setor-redacao { background: #9d174d; }
.setor-criacao { background: #5b21b6; }
.setor-opec { background: #065f46; }
.setor-financeiro { background: #92400e; }

.tarefa-linha {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13.5px;
}
.tarefa-linha:last-child { border-bottom: none; }
.tarefa-titulo { font-weight: 600; }
.tarefa-meta { color: #6b7280; font-size: 12px; }

.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 1000px) { .kanban { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .kanban { grid-template-columns: 1fr; } }

.kanban-col {
  background: #e9ecf1;
  border-radius: 10px;
  padding: 10px;
  min-height: 200px;
}
.kanban-cab {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #374151;
  padding: 4px 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-qt {
  background: #fff;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 12px;
}
.kanban-lista { display: flex; flex-direction: column; gap: 10px; }

.tarefa-card {
  background: #fff;
  border: 1px solid var(--cinza-borda);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}
.tarefa-card.atrasada { border-color: #fca5a5; box-shadow: 0 0 0 1px #fca5a5; }
.tarefa-card-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tarefa-neg { font-size: 11px; font-weight: 700; color: #6b7280; }
.tarefa-card-titulo { font-weight: 700; margin-bottom: 4px; }
.tarefa-card-info { color: #6b7280; font-size: 12px; margin-top: 2px; }
.tarefa-card-prazo { font-size: 12px; margin-top: 4px; }
.prazo-estourado { color: #dc2626; font-weight: 700; }
.tarefa-card-bloqueio {
  background: #f3f4f6;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11.5px;
  color: #4b5563;
  margin-top: 6px;
}
.link-desc {
  border: none; background: none;
  color: var(--azul);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  margin-top: 6px;
}
.tarefa-desc {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
  font-size: 11.5px;
  white-space: pre-wrap;
  font-family: inherit;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
}
.tarefa-card-acoes {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}

/* ================================================================
   Refinamento visual — paleta, sombras, logo, ícones e toasts
   (sobrescreve regras acima; mantém a estrutura das telas)
   ================================================================ */
:root {
  --azul: #2563eb;
  --azul-escuro: #1e3a8a;
  --azul-claro: #eff6ff;
  --cinza-borda: #e5e7eb;
  --cinza-fundo: #f4f5f7;
  --texto: #111827;
  --texto-suave: #6b7280;
  --verde: #16a34a;
  --vermelho: #dc2626;
  --raio: 12px;
  --raio-sm: 8px;
  --sombra: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.09);
  --sombra-md: 0 6px 18px rgba(16,24,40,.09);
  --sombra-lg: 0 14px 40px rgba(16,24,40,.20);
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Barra superior + logo */
.topbar {
  background: linear-gradient(90deg, #172033 0%, #1e3a8a 100%);
  padding: 0 26px;
  height: 60px;
  gap: 30px;
  box-shadow: var(--sombra-md);
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 40px; width: auto; max-width: 220px; object-fit: contain; display: block; image-rendering: auto; }
.brand-fallback { font-size: 19px; font-weight: 700; letter-spacing: 2px; color: #fff; }
.topnav { gap: 6px; }
.topnav a {
  color: rgba(255,255,255,.74);
  padding: 7px 16px;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}
.topnav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.topnav a.ativo { background: rgba(255,255,255,.18); color: #fff; }

/* Usuário logado + sair (injetado por auth.js) */
.usuario-box { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.usuario-info { display: flex; flex-direction: column; line-height: 1.15; text-align: right; }
.usuario-nome { color: #fff; font-size: 13.5px; font-weight: 700; }
.usuario-setor { color: rgba(255,255,255,.6); font-size: 11px; letter-spacing: .3px; text-transform: uppercase; }
.btn-sair {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn-sair:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.4); }

/* Cartões e superfícies */
.card {
  border-radius: var(--raio);
  padding: 22px;
  box-shadow: var(--sombra);
}
.container, .container-larga { margin-top: 28px; }

/* Campos */
.field label { letter-spacing: .3px; color: var(--texto-suave); }
.field input, .field select, .field textarea { border-radius: var(--raio-sm); transition: border-color .15s ease, box-shadow .15s ease; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(37,99,235,.16);
}

/* Botões */
.btn {
  border-radius: var(--raio-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { box-shadow: 0 1px 2px rgba(37,99,235,.35); }
.btn-mini { border-radius: 6px; }

/* Ícones inline (SVG herda a cor do texto) */
.ico { width: 16px; height: 16px; flex: none; vertical-align: -3px; stroke-width: 2; }
.ico-lg { width: 18px; height: 18px; }

/* Semáforo de margem */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; margin-right: 3px; }
.dot-verde { background: #22c55e; }
.dot-amarelo { background: #f59e0b; }
.dot-vermelho { background: #ef4444; }

/* Garante que o atributo [hidden] sempre esconda (regras de layout do autor
   têm prioridade sobre a UA e vazariam elementos ocultos como o aviso e a reserva) */
[hidden] { display: none !important; }

/* Avisos de linha única com ícone centralizado; nos demais o SVG flui inline */
.aviso-readonly, .info-reserva { display: inline-flex; align-items: center; gap: 7px; }
.alerta-alcada .ico, .alerta-inline .ico, .prog-conflito .ico, .prog-feriados .ico { margin-right: 5px; }

/* Toasts — popup discreto na base */
.toast-box {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 460px;
  padding: 13px 18px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  box-shadow: var(--sombra-lg);
  opacity: 0;
  transform: translateY(16px) scale(.98);
  transition: opacity .26s ease, transform .26s ease;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast-ok { background: linear-gradient(90deg, #15803d, #16a34a); }
.toast-erro { background: linear-gradient(90deg, #b91c1c, #dc2626); }
.toast .ico { width: 18px; height: 18px; opacity: .95; }
@media (max-width: 560px) {
  .toast { min-width: 0; width: calc(100vw - 32px); }
}

/* ================================================================
   Select pesquisável (mesmo modelo do seletor de cliente)
   O <select> nativo é mantido escondido como fonte de verdade.
   ================================================================ */
.ss { position: relative; width: 100%; }
.ss-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
.ss-control {
  width: 100%;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--cinza-borda);
  border-radius: var(--raio-sm);
  background: #fff;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--texto);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ss-control:hover { border-color: #c3c9d2; }
.ss.aberto .ss-control, .ss-control:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(37,99,235,.16); }
.ss-control:disabled { background: var(--cinza-fundo); color: #9ca3af; cursor: not-allowed; box-shadow: none; }
.ss-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-label.vazio { color: #9ca3af; }
.ss-chevron { flex: none; width: 16px; height: 16px; color: #6b7280; transition: transform .15s ease; }
.ss.aberto .ss-chevron { transform: rotate(180deg); }

.ss-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 340px;
  z-index: 60;
  background: #fff;
  border: 1px solid var(--cinza-borda);
  border-radius: var(--raio-sm);
  box-shadow: var(--sombra-lg);
  overflow: hidden;
}
.ss-search { padding: 8px; border-bottom: 1px solid var(--cinza-borda); }
.ss-search input {
  width: 100%;
  border: 1px solid var(--cinza-borda);
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 13.5px;
  font-family: inherit;
}
.ss-search input:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(37,99,235,.16); }
.ss-list { max-height: 240px; overflow-y: auto; }
.ss-item { padding: 8px 12px; font-size: 14px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-item:hover, .ss-item.destacado { background: var(--azul-claro); }
.ss-item.sel { font-weight: 600; color: var(--azul-escuro); }
.ss-vazio { padding: 10px 12px; color: #6b7280; font-size: 13px; }

/* Lista de clientes cadastrados (tela Clientes) */
.lista-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.contador { background: var(--azul-claro); color: var(--azul-escuro); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 11px; }
#tabelaClientes thead th { position: sticky; top: 0; z-index: 1; }
#tabelaClientes tr.sel td { background: var(--azul-claro); font-weight: 600; }
.vazio-busca { text-align: center; padding: 30px 16px; color: var(--texto-suave); }
.vazio-busca p { margin-bottom: 14px; font-size: 14px; }

/* Master-detail da tela Clientes */
.clientes-layout { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
.cli-lista { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 80px; }
.cli-form { min-height: 420px; }
.form-cab { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--cinza-borda); }
.form-cab h2 { font-size: 18px; color: var(--azul-escuro); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vazio-form { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; color: var(--texto-suave); padding: 56px 20px; }
.vazio-form svg { color: #cbd5e1; }
.vazio-form p { font-size: 14px; line-height: 1.6; }
.form-acoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--cinza-borda); }

/* Check de opção destacado (ex.: "Comissão Alpes?" no cadastro de terceiro) */
.opcao-check[hidden] { display: none; }
.opcao-check {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--cinza-borda);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: var(--cinza-fundo);
  cursor: pointer;
}
.opcao-check:has(input:checked) { background: #eff6ff; border-color: var(--azul); }
.opcao-check input { margin-top: 2px; }
.opcao-check b { font-size: 14px; color: var(--azul-escuro); display: block; }
.opcao-check small { font-size: 12.5px; color: var(--texto-suave); }
@media (max-width: 900px) {
  .clientes-layout { grid-template-columns: 1fr; }
  .cli-lista { position: static; }
}

/* Grupos colapsáveis da lista (cadastrados / inativos) */
.lista-grupos { padding: 8px; }
.grupo-cab {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 10px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--azul-escuro);
  border-radius: 8px;
}
.grupo-cab:hover { background: var(--cinza-fundo); }
.grupo-cab .contador { margin-left: auto; }
.grupo-cab .ss-chevron { width: 16px; height: 16px; color: #6b7280; transition: transform .15s ease; }
.grupo-cab.aberto .ss-chevron { transform: rotate(180deg); }
.grupo-corpo { padding: 0 4px 10px; }
.grupo-vazio { padding: 14px 10px; text-align: center; }
.contador-inativo { background: #f1f5f9; color: #64748b; }

/* Botões de situação */
.btn-sucesso { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn-sucesso:hover { background: #15803d; }
.btn-perigo-solido { background: var(--vermelho); border-color: var(--vermelho); color: #fff; }
.btn-perigo-solido:hover { background: #b91c1c; }

.conf-msg { font-size: 14px; line-height: 1.6; color: var(--texto); }

/* Campos de data/mês nos filtros */
.campo-data { min-width: 150px; }

/* ===== Date / Month picker customizado (design system) ===== */
.dp { position: relative; width: 100%; }
.dp-control {
  width: 100%;
  min-width: 148px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--cinza-borda);
  border-radius: var(--raio-sm);
  background: #fff;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--texto);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dp-control:hover { border-color: #c3c9d2; }
.dp.aberto .dp-control, .dp-control:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(37,99,235,.16); }
.dp-label.vazio { color: #9ca3af; }
.dp-ico { flex: none; width: 16px; height: 16px; color: #6b7280; }

.dp-pop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 60;
  background: #fff;
  border: 1px solid var(--cinza-borda);
  border-radius: var(--raio-sm);
  box-shadow: var(--sombra-lg);
  padding: 12px;
  width: 260px;
}
.dp-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-titulo { font-size: 14px; font-weight: 700; color: var(--azul-escuro); text-transform: capitalize; }
.dp-nav { border: none; background: none; cursor: pointer; color: #6b7280; padding: 4px; border-radius: 6px; display: flex; }
.dp-nav:hover { background: var(--cinza-fundo); color: var(--azul-escuro); }
.dp-nav svg { width: 18px; height: 18px; }

.dp-grade { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { font-size: 11px; font-weight: 700; color: #64748b; text-align: center; padding: 4px 0; }
.dp-dia { border: none; background: none; cursor: pointer; font-size: 13px; height: 32px; border-radius: 8px; color: var(--texto); font-family: inherit; }
.dp-dia:hover { background: var(--azul-claro); }
.dp-dia.hoje { outline: 1.5px solid var(--azul); outline-offset: -2px; font-weight: 700; }
.dp-dia.sel { background: var(--azul); color: #fff; font-weight: 700; }
.dp-vazio { visibility: hidden; }

.dp-grade-mes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dp-mes { border: none; background: none; cursor: pointer; font-size: 13px; padding: 11px 0; border-radius: 8px; color: var(--texto); text-transform: capitalize; font-family: inherit; }
.dp-mes:hover { background: var(--azul-claro); }
.dp-mes.hoje { outline: 1.5px solid var(--azul); outline-offset: -2px; font-weight: 700; }
.dp-mes.sel { background: var(--azul); color: #fff; font-weight: 700; }

.dp-rodape { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--cinza-borda); }
.dp-link { border: none; background: none; color: var(--azul); font-size: 13px; font-weight: 600; cursor: pointer; padding: 2px 4px; font-family: inherit; }
.dp-link:hover { text-decoration: underline; }

/* Selects nativos que seguem em tabela (dinâmicos) — chevron custom p/ manter o mesmo visual */
select.input-cel {
  appearance: none;
  -webkit-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
  background-repeat: no-repeat;
  background-position: right 7px center;
  padding-right: 24px;
}

/* ======================================================================
   SIDEBAR LATERAL ESQUERDA  (substitui a topbar)
   ====================================================================== */
:root { --sb-w: 232px; --sb-w-rail: 64px; }
body { --sb-atual: var(--sb-w); }
body.sb-collapsed { --sb-atual: var(--sb-w-rail); }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sb-atual);
  background: linear-gradient(180deg, #172033 0%, #1b2a4a 55%, #1e3a8a 140%);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 60;
  box-shadow: var(--sombra-md);
  transition: width .2s ease;
  overflow: hidden;
}

/* desloca o conteúdo pra direita da sidebar (padding no body preserva o margin:auto
   dos containers, mantendo o conteúdo centralizado no espaço restante) */
body.tem-sidebar { padding-left: var(--sb-atual); transition: padding-left .2s ease; }

/* ---- topo: logo + botão recolher ---- */
.sb-top {
  display: flex; align-items: center; gap: 8px;
  height: 60px; padding: 0 12px 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sb-brand { display: flex; align-items: center; overflow: hidden; text-decoration: none; flex: 1; min-width: 0; }
.sb-logo { height: 34px; width: auto; max-width: 160px; object-fit: contain; display: block; }
.sb-brand-fb { font-size: 17px; font-weight: 700; letter-spacing: 2px; color: #fff; white-space: nowrap; }
.sb-toggle {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  transition: background .15s ease, transform .2s ease;
}
.sb-toggle:hover { background: rgba(255,255,255,.18); color: #fff; }
.sb-toggle svg { width: 17px; height: 17px; }
body.sb-collapsed .sb-toggle svg { transform: rotate(180deg); }

/* ---- navegação ---- */
.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 10px; }
.sb-nav::-webkit-scrollbar { width: 6px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }

.sb-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 3px;
  border: 0; background: transparent;
  color: rgba(255,255,255,.74);
  font: inherit; font-size: 14px; text-align: left;
  text-decoration: none;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.sb-item:hover { background: rgba(255,255,255,.10); color: #fff; }
.sb-item.ativo { background: var(--azul); color: #fff; box-shadow: 0 4px 12px rgba(29,78,216,.35); }
.sb-ico { width: 20px; height: 20px; flex-shrink: 0; }
.sb-txt { flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* grupo com sub-abas */
.sb-group-head { position: relative; }
.sb-caret { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; transition: transform .2s ease; }
.sb-group.aberto > .sb-group-head .sb-caret { transform: rotate(90deg); }
.sb-sub {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .2s ease;
}
.sb-group.aberto > .sb-sub { grid-template-rows: 1fr; }
.sb-sub > * { min-height: 0; overflow: hidden; }
.sb-sub-item {
  display: flex; align-items: center;
  padding: 9px 12px 9px 46px;
  margin-bottom: 2px;
  color: rgba(255,255,255,.62);
  font-size: 13.5px; text-decoration: none;
  border-radius: 8px;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.sb-sub-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.sb-sub-item.ativo { color: #fff; font-weight: 600; background: rgba(255,255,255,.10); }
.sb-sub-item.sb-vazio { color: rgba(255,255,255,.38); font-style: italic; cursor: default; pointer-events: none; }
.sb-sub-item.sb-vazio::before { opacity: .25; }
.sb-sub-item::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; margin-right: 12px; margin-left: -20px; opacity: .55; flex-shrink: 0;
}

/* ---- rodapé: usuário + sair (injetado por auth.js) ---- */
.sb-footer {
  flex-shrink: 0;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  min-height: 56px;
  display: flex; align-items: center;
}
.sidebar .usuario-box { margin: 0; width: 100%; gap: 10px; }
.sidebar .usuario-info { text-align: left; flex: 1; min-width: 0; }
.sidebar .usuario-nome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ====== estado RECOLHIDO (rail só ícones) ====== */
body.sb-collapsed .sb-txt,
body.sb-collapsed .sb-caret,
body.sb-collapsed .sb-logo,
body.sb-collapsed .sb-brand-fb,
body.sb-collapsed .sb-footer .usuario-info { display: none; }
body.sb-collapsed .sb-top { padding: 0 10px; justify-content: center; }
body.sb-collapsed .sb-brand { flex: 0; }
body.sb-collapsed .sb-item { justify-content: center; padding: 11px; }
body.sb-collapsed .sb-group .sb-sub { grid-template-rows: 0fr; }
body.sb-collapsed .sb-footer { justify-content: center; padding: 12px 8px; }
body.sb-collapsed .sidebar .usuario-box { justify-content: center; }

/* tooltip no hover quando recolhido */
body.sb-collapsed .sb-item[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: #0f172a; color: #fff; padding: 5px 10px; border-radius: 6px;
  font-size: 12.5px; white-space: nowrap; z-index: 70;
  box-shadow: var(--sombra-md); pointer-events: none;
}

/* ---- botão mobile + backdrop (ocultos no desktop) ---- */
.sb-mobile-btn, .sb-backdrop { display: none; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); width: var(--sb-w); transition: transform .2s ease; }
  body.sb-mobile-open .sidebar { transform: translateX(0); }
  body.tem-sidebar { padding-left: 0; }
  .sb-mobile-btn {
    display: grid; place-items: center;
    position: fixed; top: 12px; left: 12px; z-index: 55;
    width: 42px; height: 42px;
    background: var(--azul-escuro); color: #fff;
    border: 0; border-radius: 10px; cursor: pointer;
    box-shadow: var(--sombra-md);
  }
  .sb-mobile-btn svg { width: 22px; height: 22px; }
  body.sb-mobile-open .sb-backdrop {
    display: block; position: fixed; inset: 0;
    background: rgba(15,23,42,.5); z-index: 50;
  }
  /* no mobile a sidebar nunca fica em modo rail */
  body.sb-collapsed .sb-txt, body.sb-collapsed .sb-caret,
  body.sb-collapsed .sb-logo, body.sb-collapsed .sb-footer .usuario-info { display: revert; }
  body.sb-collapsed .sb-item { justify-content: flex-start; padding: 10px 12px; }
  .sb-toggle { display: none; }
  /* espaço pro botão hamburguer não cobrir o conteúdo */
  main, .container, .container-larga { margin-top: 64px; }
}

/* ===== Home ===== */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.home-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px; border: 1px solid var(--cinza-borda); border-radius: 10px;
  text-decoration: none; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.home-card:hover { border-color: var(--azul); box-shadow: 0 6px 18px rgba(29,78,216,.12); transform: translateY(-1px); }
.home-card b { color: var(--azul-escuro); font-size: 15px; }
.home-card span { color: #6b7280; font-size: 13px; }

/* ===== Administração / Auditoria ===== */
.abas-acl { display: flex; gap: 6px; margin-bottom: 16px; }
.aba-acl {
  padding: 8px 18px; border: 1px solid var(--cinza-borda); background: #fff;
  border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; color: #4b5563;
}
.aba-acl.ativo { background: var(--azul); border-color: var(--azul); color: #fff; }
.acl-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.acl-lista .item-lista {
  padding: 10px 12px; border-radius: 8px; cursor: pointer; border: 1px solid transparent;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.acl-lista .item-lista:hover { background: var(--cinza-fundo); }
.acl-lista .item-lista.sel { background: #eff6ff; border-color: var(--azul); }
.acl-lista .item-lista small { color: #6b7280; font-size: 11px; }
.perm-modulo { margin-top: 14px; }
.perm-modulo h4 { font-size: 12px; text-transform: uppercase; color: var(--azul-escuro); margin-bottom: 6px; letter-spacing: .4px; }
.perm-linha { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13.5px; }
.perm-linha label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ovr-linha { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 4px 0; font-size: 13.5px; }
.ovr-linha select { width: auto; padding: 4px 8px; font-size: 12.5px; }
@media (max-width: 800px) { .acl-layout { grid-template-columns: 1fr; } }

/* ===== Relatórios de telefonia ===== */
/* --- landing (cards de clientes) --- */
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.rel-card {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 18px; border: 1px solid var(--cinza-borda); border-radius: 10px;
  text-decoration: none; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.rel-card:hover { border-color: var(--azul); box-shadow: 0 6px 18px rgba(29,78,216,.12); transform: translateY(-1px); }
.rel-card b { color: var(--azul-escuro); font-size: 15px; }
.rel-card span { color: #6b7280; font-size: 13px; }
.rel-card-off { cursor: not-allowed; opacity: .7; }
.rel-card-off:hover { border-color: var(--cinza-borda); box-shadow: none; transform: none; }
.rel-tag { align-self: flex-start; margin-top: 6px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .3px; }
.rel-tag.ok { background: #dcfce7; color: #15803d; }
.rel-tag.off { background: #f3f4f6; color: #6b7280; }

/* --- cabeçalho do relatório --- */
.rel-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.rel-header-left { display: flex; align-items: center; gap: 12px; }
.rel-voltar { text-decoration: none; color: var(--azul-escuro); font-size: 22px; line-height: 1; padding: 2px 8px; border-radius: 6px; }
.rel-voltar:hover { background: var(--cinza-fundo); }
.rel-eyebrow { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6b7280; }
.rel-titulo { margin: 2px 0 0; font-size: 18px; font-weight: 700; color: var(--azul-escuro); }
.rel-dia { display: flex; align-items: center; gap: 6px; }
.rel-dia label { font-size: 12.5px; color: #6b7280; }
.rel-dia input[type='date'] { border: 1px solid var(--cinza-borda); border-radius: 6px; padding: 5px 8px; font-size: 13px; }
.rel-0800 { display: flex; align-items: center; gap: 6px; }
.rel-0800 > label { font-size: 12.5px; color: #6b7280; }
.rel-header-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.rel-progress { display: flex; flex-direction: column; gap: 5px; min-width: 190px; }
.rel-status { font-size: 13px; font-weight: 600; color: #374151; }
.rel-track { width: 100%; height: 6px; background: var(--cinza-fundo); border-radius: 999px; overflow: hidden; }
.rel-fill { height: 100%; width: 0%; background: var(--verde); border-radius: 999px; transition: width .25s ease-out; }
.rel-parcial { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 10px; background: #fff; border: 1px solid var(--cinza-borda); border-radius: 8px; }
.rel-parcial-grupo { display: flex; align-items: center; gap: 6px; }
.rel-parcial label { font-size: 12.5px; color: #6b7280; white-space: nowrap; }
.rel-parcial input[type='time'], .rel-parcial input[type='number'] { border: 1px solid var(--cinza-borda); border-radius: 6px; padding: 5px 7px; font-size: 13px; }
.rel-parcial input[type='number'] { width: 64px; }
.btn-danger { color: var(--vermelho); }
.btn-danger:hover { background: #fee2e2; border-color: var(--vermelho); }

/* --- tabela --- */
.rel-tabela-wrap { overflow-x: auto; }
.rel-tabela { width: 100%; border-collapse: collapse; }
.rel-tabela th, .rel-tabela td { text-align: left; padding: 9px 14px; }
.rel-tabela th { background: var(--cinza-fundo); color: #6b7280; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--cinza-borda); }
.rel-tabela td { border-bottom: 1px solid var(--cinza-borda); font-variant-numeric: tabular-nums; }
.rel-tabela td:nth-child(1), .rel-tabela td:nth-child(2), .rel-tabela td:nth-child(3) { font-family: ui-monospace, Consolas, monospace; }
.rel-tabela tbody tr:hover { background: var(--cinza-fundo); }
.rel-tabela tbody tr.is-lancada { background: #dcfce7; }
.rel-tabela tbody tr.is-lancada:hover { background: #dcfce7; filter: brightness(.97); }
.rel-sortable { cursor: pointer; user-select: none; }
.rel-sortable:hover { color: var(--azul-escuro); }
.rel-sort-icon { color: var(--azul); font-weight: 700; }
.rel-col-ddd { position: relative; overflow: visible; }
.rel-col-check { text-align: center; width: 80px; }
.rel-tabela td.rel-col-check { text-align: center; }
.rel-tabela input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--azul); cursor: pointer; }
.rel-ddd-chip { display: inline-block; background: var(--cinza-fundo); border: 1px solid var(--cinza-borda); border-radius: 6px; padding: 1px 8px; font-size: 12.5px; }
/* filtro de DDD */
.rel-ddd-filter { position: relative; display: inline-block; }
.rel-ddd-btn { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--cinza-borda); border-radius: 6px; color: #374151; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; padding: 4px 8px; }
.rel-ddd-btn:hover { border-color: var(--azul); }
.rel-ddd-panel { position: absolute; top: calc(100% + 5px); left: 0; z-index: 20; min-width: 144px; background: #fff; border: 1px solid var(--cinza-borda); border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,.14); padding: 8px; text-transform: none; letter-spacing: normal; }
.rel-ddd-actions { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--cinza-borda); }
.rel-link-btn { background: none; border: none; padding: 0; color: var(--azul); font-size: 12px; font-weight: 600; cursor: pointer; }
.rel-link-btn:hover { text-decoration: underline; }
.rel-ddd-options { display: flex; flex-direction: column; gap: 2px; max-height: 224px; overflow-y: auto; }
.rel-ddd-option { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; font-size: 13px; color: #374151; cursor: pointer; }
.rel-ddd-option:hover { background: var(--cinza-fundo); }
.rel-ddd-option input[type='checkbox'] { width: 15px; height: 15px; }
@media (max-width: 720px) { .rel-header { flex-direction: column; align-items: stretch; } }

/* ===== Mídia → Entradas ao vivo ===== */
.atalhos-periodo { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.atalhos-periodo .btn-mini { margin-left: 0; }

/* Alternador Todas / Só com ocorrência */
.seletor-visao { display: flex; gap: 0; }
.seletor-visao .btn { border-radius: 0; margin: 0; }
.seletor-visao .btn:first-child { border-top-left-radius: var(--raio-sm); border-bottom-left-radius: var(--raio-sm); }
.seletor-visao .btn:last-child { border-top-right-radius: var(--raio-sm); border-bottom-right-radius: var(--raio-sm); margin-left: -1px; }
.seletor-visao .btn.ativo {
  background: var(--azul); border-color: var(--azul); color: #fff;
  box-shadow: 0 1px 2px rgba(37,99,235,.35); position: relative; z-index: 1;
}
.seletor-visao .btn span { opacity: .75; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* A entrada sem novidade ("Sem Observações") e a maioria das linhas: fica
   apagada para a ocorrência real saltar aos olhos. */
.tabela tr.linha-neutra td { color: var(--texto-suave); }
.tabela tr.linha-ocorrencia { background: #fffbeb; }
.tabela tr.linha-ocorrencia td.col-obs { font-weight: 600; color: #92400e; }
.tabela td.col-obs { min-width: 220px; }
.aviso-limite { margin-top: 10px; font-size: 12.5px; color: #92400e; background: #fef3c7; border-radius: var(--raio-sm); padding: 8px 10px; }

/* ===== INCLUSÃO — Gabriel — 2026-09-21 =====
   Switch (toggle) genérico — mesmo visual do "form-switch" do Bootstrap, mas
   em CSS puro (sem trazer a lib pra telas fora de Mídia). Empilhar com
   .switch-list pra ficar um embaixo do outro. ===== */
.switch-list { display: flex; flex-direction: column; gap: 12px; }
/* ===== INCLUSÃO — Gabriel — 2026-09-28 (3) =====
   Perfis de Atuação (Pessoas) em duas colunas — só ali (usa uma classe
   própria em cima de .switch-list, não muda o padrão de 1 coluna usado nos
   outros lugares). O aviso do Representante (só aparece se vinculado a
   Emissora) ocupa as duas colunas pra não quebrar o grid quando aparecer. */
.switch-list.duas-colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.switch-list.duas-colunas > #avisoRepresentanteEmUso { grid-column: 1 / -1; margin-top: -6px; }
@media (max-width: 640px) { .switch-list.duas-colunas { grid-template-columns: 1fr; } }
/* ===== FIM INCLUSÃO — Gabriel — 2026-09-28 (3) ===== */
.form-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.form-switch input[type='checkbox'] {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 36px; height: 20px; border-radius: 999px; background: #cbd5e1;
  position: relative; cursor: pointer; transition: background .15s; margin: 0;
}
.form-switch input[type='checkbox']::before {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.35);
  transition: left .15s;
}
.form-switch input[type='checkbox']:checked { background: var(--azul); }
.form-switch input[type='checkbox']:checked::before { left: 18px; }
.form-switch input[type='checkbox']:disabled { opacity: .5; cursor: not-allowed; }
.form-switch input[type='checkbox']:disabled + label { cursor: not-allowed; color: var(--texto-suave); }
.form-switch label { font-weight: 600; cursor: pointer; }
/* ===== FIM INCLUSÃO — Gabriel — 2026-09-21 ===== */

/* ===== INCLUSÃO — Gabriel — 2026-09-22 =====
   Ícone de ajuda inline (tooltip via title nativo) — usado no campo
   Identificador Fiscal da Emissora pra explicar CNPJ x TIN/NIF. ===== */
.icone-ajuda { width: 14px; height: 14px; vertical-align: -2px; margin-left: 2px; color: #9ca3af; cursor: help; }
.icone-ajuda:hover { color: var(--azul); }
.ajuda-wrap { position: relative; display: inline-block; }
.ajuda-tooltip {
  position: absolute; top: 100%; left: 0; margin-top: 6px; z-index: 30;
  width: 240px; background: #1f2937; color: #fff; font-size: 12px; font-weight: 400;
  line-height: 1.4; padding: 8px 10px; border-radius: 6px; box-shadow: 0 6px 16px rgba(0,0,0,.2);
  text-transform: none;
}
/* ===== FIM INCLUSÃO — Gabriel — 2026-09-22 ===== */

/* ===== INCLUSÃO — Gabriel — 2026-09-22 =====
   Cadastro de Pessoas — bloco de campos específicos de uma função (Dados do
   Representante/Locutor/...). `.secao` sozinha perde a margem de cima quando
   é a primeira coisa dentro do bloco (regra `.secao:first-child`) — por isso
   o espaçamento vem do wrapper, não do título. `.campo-reservado` marca
   espaço reservado pra campo que ainda não foi definido (mesmo tamanho de um
   input, sem parecer campo quebrado). ===== */
.bloco-funcao { margin-top: 18px; }
/* ===== INCLUSÃO — Gabriel — 2026-09-28 =====
   Pessoas virou abas: campos de uma aba de função ficam visíveis mas
   desabilitados até marcar o Flag (não usa mais "hidden" no bloco inteiro).
   .aba-alerta é o sinal vermelho de atenção no nome da aba (círculo + "!",
   mesma ideia do ícone de aviso passado como referência — não é a imagem). */
.bloco-campos-aba.desabilitado { opacity: .45; pointer-events: none; filter: grayscale(40%); }
.aba-alerta {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 6px; border-radius: 50%;
  background: #dc2626; color: #fff; font-size: 11px; font-weight: 800;
  line-height: 1; vertical-align: middle;
}
/* ===== FIM INCLUSÃO — Gabriel — 2026-09-28 ===== */
.campo-reservado {
  display: flex; align-items: center; justify-content: center;
  height: 38px; border: 1px dashed var(--cinza-borda); border-radius: 6px;
  background: #fafafa; color: #9ca3af; font-size: 12px; font-style: italic;
}
/* ===== FIM INCLUSÃO — Gabriel — 2026-09-22 ===== */

/* ===== INCLUSÃO — Gabriel — 2026-09-30 =====
   Motivo: paginação das listas (Emissoras/Pessoas). Mesma marcação do
   componente .pagination do Bootstrap 5, mas estilizada aqui — o Bootstrap
   não é carregado nessas telas (só em midias.html) e trazê-lo inteiro
   quebraria o resto do style.css. */
.pagination {
  display: flex; flex-wrap: wrap; justify-content: center;
  list-style: none; margin-top: 14px; gap: 0;
}
.page-item .page-link {
  display: block; min-width: 36px; padding: 6px 12px;
  border: 1px solid var(--cinza-borda); margin-left: -1px;
  background: #fff; color: var(--azul); text-align: center;
  font-size: 13px; text-decoration: none; cursor: pointer;
}
.page-item:first-child .page-link { margin-left: 0; border-radius: 6px 0 0 6px; }
.page-item:last-child .page-link { border-radius: 0 6px 6px 0; }
.page-item .page-link:hover { background: #eaf0fe; }
.page-item.active .page-link {
  position: relative; z-index: 1;
  background: var(--azul); border-color: var(--azul); color: #fff; cursor: default;
}
.page-item.disabled .page-link { color: #9ca3af; background: #fff; pointer-events: none; cursor: default; }
/* ===== FIM INCLUSÃO — Gabriel — 2026-09-30 ===== */


/* ===== INCLUSÃO — Gabriel — 2026-10-09 — matriz de permissões (Papéis e permissões + aba Usuário Sistema em Pessoas) ===== */
.perm-topo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 8px; }
.perm-topo input[type=search] { flex: 1; min-width: 200px; padding: 8px 10px; border: 1px solid var(--cinza-borda); border-radius: 6px; font-size: 14px; }
.perm-contador { font-weight: 700; color: var(--azul-escuro); }
.matriz-modulo { border: 1px solid var(--cinza-borda); border-radius: 8px; margin-top: 12px; overflow: hidden; }
.matriz-modulo > header { display: flex; align-items: center; gap: 10px; background: #f3f4f6; padding: 8px 12px; font-weight: 700; text-transform: uppercase; font-size: 12px; color: var(--azul-escuro); letter-spacing: .4px; }
.matriz-modulo > header small { margin-left: auto; font-weight: 400; color: #6b7280; text-transform: none; }
.matriz { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.matriz th, .matriz td { padding: 6px 10px; border-top: 1px solid var(--cinza-borda); text-align: center; }
.matriz th { background: #fafafa; font-size: 11px; text-transform: uppercase; color: #6b7280; }
.matriz td:first-child, .matriz th:first-child { text-align: left; }
.matriz tr[hidden] { display: none; }
.matriz input[type=checkbox]:not([role=switch]) { width: 16px; height: 16px; cursor: pointer; }
.matriz .sem { color: #d1d5db; }
.matriz .form-switch { justify-content: center; margin: 0; }
.matriz td.aj-permitir { background: #ecfdf5; box-shadow: inset 3px 0 0 #22c55e; }
.matriz td.aj-negar { background: #fef2f2; box-shadow: inset 3px 0 0 #ef4444; }
/* ===== FIM INCLUSÃO — Gabriel — 2026-10-09 ===== */

/* ===== INCLUSÃO — Gabriel — 2026-10-08 =====
   Motivo: status provisório "PROCESSANDO" na grid de Negociação V2 enquanto o
   envio para aprovação roda no servidor (bolinha girando ao lado do texto). */
.badge-processando { background:#e0e7ff; color:#3730a3; border:1px solid #c7d2fe; display:inline-flex; align-items:center; gap:6px; }
.spinner-mini { width:10px; height:10px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; display:inline-block; animation:girar .7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
/* ===== FIM INCLUSÃO — Gabriel — 2026-10-08 ===== */
/* ===== INCLUSÃO — Gustavo — 2026-10-06 =====
   Motivo: campo sigiloso genérico (input password + botão-olho), usado nas
   credenciais do Cliente Sistema em Pessoas — mesmo visual do botão-olho do
   salário em Locutores, com nome reutilizável. E botão "×" no .chip (lista de
   e-mails do relatório). */
.campo-sigiloso { display: flex; gap: 6px; align-items: center; }
.campo-sigiloso input { flex: 1; min-width: 0; }
.btn-olho {
  display: inline-flex; width: 36px; height: 36px; flex: 0 0 36px;
  align-items: center; justify-content: center;
  border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #64748b; cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.btn-olho:hover, .btn-olho.ativo { border-color: var(--azul); background: #eff6ff; color: var(--azul); }
.btn-olho:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }
.btn-olho svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-olho[hidden] { display: none; }
.chip-remover {
  border: 0; background: transparent; color: inherit; cursor: pointer;
  margin-left: 6px; padding: 0; font-size: 15px; line-height: 1; font-weight: 700;
}
.chip-remover:disabled { cursor: default; opacity: .5; }
/* Alternador Com/Sem duplicadas do relatório: o display:flex do .seletor-visao venceria o [hidden]. */
.seletor-visao[hidden] { display: none; }
/* Modal "Ver dados" do Cliente Sistema (#modalVerSistemaCliente). Cor por tipo em --vs-cor;
   entrada/saída animadas, campos em cascata, credencial desembaça ao revelar. */
.modal-ver-sistema { --vs-cor: var(--azul); --vs-cor-suave: #dbeafe; backdrop-filter: blur(3px); animation: vsFundoEntrar .2s ease both; }
.modal-ver-sistema[data-tipo="SISTEMA_LOCAL"] { --vs-cor: #7c3aed; --vs-cor-suave: #ede9fe; }
.modal-ver-sistema[data-tipo="WEBHOOK"] { --vs-cor: #ea580c; --vs-cor-suave: #ffedd5; }
.modal-ver-sistema[data-tipo="EMAIL"] { --vs-cor: #059669; --vs-cor-suave: #d1fae5; }
.modal-ver-sistema .modal { max-width: 620px; overflow: hidden; box-shadow: 0 24px 60px rgba(15, 23, 42, .28); animation: vsModalEntrar .32s cubic-bezier(.2, .9, .3, 1.15) both; }
.modal-ver-sistema.fechando { animation: vsFundoSair .18s ease both; }
.modal-ver-sistema.fechando .modal { animation: vsModalSair .18s ease both; }
@keyframes vsFundoEntrar { from { opacity: 0; } to { opacity: 1; } }
@keyframes vsFundoSair { from { opacity: 1; } to { opacity: 0; } }
@keyframes vsModalEntrar { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes vsModalSair { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(10px) scale(.97); } }

.vs-cabecalho {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 18px 20px;
  background: linear-gradient(135deg, var(--vs-cor-suave), #fff 75%);
  border-bottom: 1px solid var(--cinza-borda);
}
.vs-cabecalho::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--vs-cor); }
.vs-icone {
  flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--vs-cor); color: #fff; box-shadow: 0 6px 16px -6px var(--vs-cor);
  animation: vsIconePop .45s cubic-bezier(.2, .9, .3, 1.4) .08s both;
}
.vs-icone svg { width: 22px; height: 22px; }
@keyframes vsIconePop { from { opacity: 0; transform: scale(.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
.vs-titulos { flex: 1; min-width: 0; }
.vs-tipo { font-size: 11px; font-weight: 700; letter-spacing: .8px; color: var(--vs-cor); }
.vs-titulos h2 { margin: 2px 0 0; font-size: 18px; color: var(--azul-escuro); overflow-wrap: anywhere; }
.vs-status { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.vs-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.vs-status.ativo { background: #dcfce7; color: #166534; }
.vs-status.ativo::before { animation: vsPulso 1.8s ease-out infinite; }
.vs-status.inativo { background: #e5e7eb; color: #4b5563; }
@keyframes vsPulso { 0% { box-shadow: 0 0 0 0 rgba(22, 101, 52, .45); } 100% { box-shadow: 0 0 0 7px rgba(22, 101, 52, 0); } }

.vs-campos { display: flex; flex-direction: column; gap: 10px; }
.vs-campo {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border: 1px solid var(--cinza-borda); border-radius: 10px; background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .3s ease, transform .2s ease;
  animation: vsCampoEntrar .35s ease backwards; animation-delay: calc(80ms + var(--ordem, 0) * 55ms);
}
.vs-campo:hover { border-color: var(--vs-cor); box-shadow: 0 4px 14px -8px var(--vs-cor); transform: translateY(-1px); }
@keyframes vsCampoEntrar { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.vs-campo.sigiloso { background: #f8fafc; border-style: dashed; }
.vs-campo.sigiloso.aberto { background: var(--vs-cor-suave); border-style: solid; border-color: var(--vs-cor); }
.vs-campos .vs-campo.vs-flash { background: #dcfce7; border-color: #16a34a; }
.vs-info { min-width: 0; flex: 1; }
.vs-rotulo { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #6b7280; margin-bottom: 3px; }
.vs-rotulo svg { width: 12px; height: 12px; color: var(--vs-cor); }
.vs-valor { font-size: 14px; color: var(--texto); overflow-wrap: anywhere; transition: filter .25s ease, opacity .14s ease, letter-spacing .25s ease; }
.vs-valor.mascarado { font-family: ui-monospace, Consolas, monospace; letter-spacing: 2px; color: #64748b; }
.vs-valor.revelado { font-family: ui-monospace, Consolas, monospace; font-weight: 600; color: var(--azul-escuro); animation: vsRevelar .35s ease; }
.vs-valor.trocando { opacity: 0; filter: blur(5px); }
@keyframes vsRevelar { from { filter: blur(6px); letter-spacing: 3px; opacity: .3; } to { filter: none; letter-spacing: 0; opacity: 1; } }
.vs-valor.vs-vazio { font-style: italic; color: #9ca3af; font-size: 13px; }
.vs-emails { display: flex; flex-wrap: wrap; gap: 6px; }
.vs-email { padding: 3px 10px; border-radius: 999px; background: var(--vs-cor-suave); color: var(--texto); font-size: 13px; }
.vs-acoes { flex: none; display: flex; gap: 6px; }
.vs-acao {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--cinza-borda); background: #fff;
  display: grid; place-items: center; cursor: pointer; color: #6b7280;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .12s ease;
}
.vs-acao svg { width: 16px; height: 16px; }
.vs-acao:hover { color: var(--vs-cor); border-color: var(--vs-cor); background: var(--vs-cor-suave); }
.vs-acao:active { transform: scale(.9); }
.vs-acao:focus-visible { outline: 2px solid var(--vs-cor); outline-offset: 2px; }
.vs-acao.vs-olho[aria-pressed="true"] { background: var(--vs-cor); border-color: var(--vs-cor); color: #fff; }
.vs-acao.copiado { background: #16a34a; border-color: #16a34a; color: #fff; animation: vsCopiado .3s ease; }
@keyframes vsCopiado { 50% { transform: scale(1.18); } }
@media (max-width: 560px) {
  .vs-cabecalho { flex-wrap: wrap; padding: 14px 16px; }
  .vs-campo { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .modal-ver-sistema, .modal-ver-sistema *, .modal-ver-sistema *::before { animation: none !important; transition: none !important; }
}
/* Modal "Ver dados": tipo GOTO (telefonia) em ciano. */
.modal-ver-sistema[data-tipo="GOTO"] { --vs-cor: #0891b2; --vs-cor-suave: #cffafe; }
/* Administração → Integrações (integracoes.html). */
.integracao-card { border-left: 4px solid #0891b2; }
.integracao-topo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.integracao-icone { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #0891b2; color: #fff; }
.integracao-icone svg { width: 22px; height: 22px; }
.integracao-titulo { margin: 0; font-size: 17px; color: var(--azul-escuro); }
/* ===== FIM INCLUSÃO — Gustavo — 2026-10-06 ===== */

/* ===== INCLUSÃO — Alberth — 2026-10-09 =====
   Motivo: identidade visual APEX Sistema (APEX-BRAND-KIT/01_APEX). Paleta única
   azul da família APEX, tipografia Montserrat e logo no topo do menu.
   Regras do kit (APEX-BRAND-KIT/README_DEV.md): não criar cor por módulo, não
   distorcer a logo, não aplicar sombra na logo. Os tokens --apex-* são a fonte;
   as variáveis antigas (--azul, --azul-escuro, --azul-claro) passam a apontar
   para eles, então as telas existentes herdam a paleta sem mexer em cada regra. */
:root {
  --apex-primary: #0B2D6B;   /* primário */
  --apex-accent: #1061FF;    /* destaque / ação */
  --apex-support: #3B82F6;   /* apoio */
  --apex-light: #60A5FA;     /* hover / interações */
  --apex-surface: #E0EDFF;   /* superfícies claras */
  --apex-dark: #0A1A3A;      /* fundo escuro */
  --apex-white: #FFFFFF;
  --apex-fonte: "Montserrat", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;

  --azul: var(--apex-accent);
  --azul-escuro: var(--apex-primary);
  --azul-claro: var(--apex-surface);
}

/* "html body" e não só "body": a Grade de Lançamento carrega o Bootstrap depois
   deste arquivo e ele redefine a fonte do body com a mesma especificidade. */
html body { font-family: var(--apex-fonte); }
/* controles de formulário não herdam a fonte do body por padrão */
button, input, select, textarea { font-family: inherit; }

/* ---- foco e sombras que tinham o azul antigo fixo em rgba ---- */
.field input:focus, .field select:focus, .field textarea:focus,
.ss.aberto .ss-control, .ss-control:focus, .ss-search input:focus,
.dp.aberto .dp-control, .dp-control:focus { box-shadow: 0 0 0 3px rgba(16,97,255,.16); }
.btn-primary { box-shadow: 0 1px 2px rgba(16,97,255,.35); }
.btn-primary:hover { background: var(--apex-primary); border-color: var(--apex-primary); }
.home-card:hover, .rel-card:hover { box-shadow: 0 6px 18px rgba(16,97,255,.12); }
.badge-azul, .dia-chk:has(input:checked) { background: var(--apex-surface); }
.opcao-check:has(input:checked), .acl-lista .item-lista.sel { background: var(--apex-surface); }

/* ---- barra superior (telas sem sidebar, ex.: PI) ---- */
.topbar { background: var(--apex-dark); }

/* ---- sidebar: fundo escuro da marca + logo APEX Sistema ---- */
.sidebar { background: linear-gradient(180deg, var(--apex-dark) 0%, #0B2350 70%, var(--apex-primary) 150%); }
.sb-item.ativo { background: var(--apex-accent); box-shadow: 0 4px 12px rgba(16,97,255,.35); }
.sb-mobile-btn { background: var(--apex-dark); }
body.sb-collapsed .sb-item[data-tip]:hover::after { background: var(--apex-dark); }

/* Sair: na Grade de Lançamento o .btn do Bootstrap (carregado depois) deixava o
   botão com texto escuro sobre o fundo escuro — invisível. Reafirma com mais especificidade. */
.sidebar .usuario-box .btn-sair { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.22); color: #fff; }
.sidebar .usuario-box .btn-sair:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.4); color: #fff; }

/* topo: container da logo (kit: ~200 x 68, respiro 8–12px, nunca esticar) */
/* Revisado em 2026-10-09: a logo ocupa a largura inteira do menu (antes dividia
   a linha com o botão de recolher e o "by Alpes Mídia" ficava ilegível). O menu
   ganhou 16px (232 → 248) e o botão virou um círculo na borda direita do menu. */
:root { --sb-w: 248px; }
/* direita com 20px: reserva o espaço do botão de recolher, que fica na borda */
.sb-top { height: auto; min-height: 0; padding: 14px 20px 12px 12px; }
.sb-brand { justify-content: flex-start; gap: 10px; }

/* Montanha = recorte da prévia aprovada (PNG com fundo #00122A). mix-blend-mode:
   lighten fica com o mais claro entre a imagem e o fundo do menu, então o fundo
   do recorte desaparece e sobram a montanha e o brilho. Só funciona sobre fundo
   MAIS CLARO que #00122A — não usar esta imagem em fundo branco. */
.sb-logo-symbol { display: block; flex: none; width: 82px; height: auto; aspect-ratio: 193 / 146; mix-blend-mode: lighten; }

/* Textos da marca (ao lado da montanha), no desenho da prévia aprovada:
   APEX branco e espaçado; SISTEMA e "by Alpes Mídia" entre dois traços azuis. */
.sb-marca { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; line-height: 1; }
.sb-marca-apex { color: #fff; font-weight: 700; font-size: 27px; letter-spacing: .2em; margin-right: -.2em; text-align: center; white-space: nowrap; }
.sb-marca-linha { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.sb-marca-linha::before, .sb-marca-linha::after { content: ""; flex: 1; height: 1.5px; background: var(--apex-accent); border-radius: 1px; }
.sb-marca-sistema { margin-top: 7px; color: var(--apex-support); font-weight: 700; font-size: 12.5px; letter-spacing: .22em; }
.sb-marca-by { margin-top: 6px; color: var(--apex-surface); font-weight: 500; font-size: 10px; letter-spacing: .02em; }

/* position: fixed para escapar do overflow:hidden da sidebar; acompanha a largura atual */
.sb-toggle {
  position: fixed; top: 34px; left: calc(var(--sb-atual) - 13px);
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--apex-primary); border: 1px solid rgba(255,255,255,.28);
  color: #fff; z-index: 61;
  transition: left .2s ease, background .15s ease;
}
.sb-toggle:hover { background: var(--apex-accent); }
.sb-toggle svg { width: 14px; height: 14px; }

/* recolhido: só a montanha */
body.sb-collapsed .sb-marca { display: none; }
body.sb-collapsed .sb-top { justify-content: center; padding: 14px 0 12px; }
body.sb-collapsed .sb-brand { flex: 0 0 auto; }
body.sb-collapsed .sb-logo-symbol { width: 46px; }
body.sb-collapsed .sb-toggle { top: 19px; }

@media (max-width: 900px) {
  /* no mobile a sidebar é gaveta: sempre a marca completa e sem botão de recolher */
  .sb-toggle { display: none; }
  body.sb-collapsed .sb-marca { display: flex; }
  body.sb-collapsed .sb-top { justify-content: flex-start; padding: 14px 20px 12px 12px; }
  body.sb-collapsed .sb-brand { flex: 1; }
  body.sb-collapsed .sb-logo-symbol { width: 82px; }
}

/* ---- Barra de ações: VOLTAR é sempre o 1º botão, à esquerda dos demais ----
   Padrão da Negociação V2 (docs/PADROES-DESENVOLVIMENTO.md §4). A regra abaixo
   garante a ordem mesmo se alguém escrever o botão fora de posição no HTML. */
.barra-acoes-sticky .btn-voltar, .barra-acoes-sticky-bs .btn-voltar,
.rodape-acoes .btn-voltar, .form-acoes .btn-voltar { order: -1; }
/* ===== FIM INCLUSÃO — Alberth — 2026-10-09 ===== */

/* ===== INCLUSÃO — Gustavo — 2026-10-15 =====
   Motivo: módulo RH (funcionarios.html / rh-cadastros.html). Paleta APEX via variáveis. */
.rh-tabela-wrap { overflow-x: auto; }
.rh-alerta-experiencia { margin: 10px 0 0; padding: 8px 12px; border-radius: 6px; background: #fef3c7; color: #92400e; font-size: 13px; }
.rh-calculado input { background: var(--cinza-fundo); color: #374151; cursor: default; }
.combo-item.rh-combo-novo { color: var(--azul); font-weight: 600; border-top: 1px solid var(--cinza-borda); }
.combo-item.rh-combo-limpar { color: #6b7280; font-style: italic; border-bottom: 1px solid var(--cinza-borda); }
.rh-abas { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--cinza-borda); }
.rh-aba { border: none; background: none; padding: 8px 14px; font: inherit; font-weight: 600; color: #6b7280; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.rh-aba:hover { color: var(--azul); }
.rh-aba.ativo { color: var(--azul); border-bottom-color: var(--azul); }
/* Ficha do funcionário (cabeçalho do editor): foto + nome + resumo + selos. */
.ficha-cabecalho { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ficha-foto-bloco { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ficha-foto { width: 112px; height: 112px; border-radius: 16px; overflow: hidden; display: grid; place-items: center;
  background: var(--apex-surface, #E0EDFF); border: 1px solid var(--cinza-borda); position: relative; }
.ficha-foto img { width: 100%; height: 100%; object-fit: cover; }
.ficha-iniciais { font-size: 38px; font-weight: 700; color: var(--azul-escuro); letter-spacing: 1px; }
.ficha-foto-acoes { display: flex; gap: 6px; }
.ficha-foto-acoes .btn-mini { margin-left: 0; }
.ficha-info { flex: 1; min-width: 220px; }
.ficha-nome { margin: 0; font-size: 22px; color: var(--azul-escuro); overflow-wrap: anywhere; }
.ficha-resumo { margin: 4px 0 10px; color: #6b7280; font-size: 14px; }
.ficha-selos { display: flex; gap: 8px; flex-wrap: wrap; }
/* Lista: miniatura da foto (ou iniciais) ao lado do nome. */
.rh-colaborador { display: flex; align-items: center; gap: 10px; }
.rh-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.rh-avatar-iniciais { display: grid; place-items: center; background: var(--apex-surface, #E0EDFF); color: var(--azul-escuro); font-size: 12px; font-weight: 700; }
/* Pessoas: dados pessoais/bancários de funcionário ativo travados (são editados no RH). O fieldset
   só agrupa — sem borda nem espaço próprio; desabilitado, esmaece os campos. */
.trava-rh { border: 0; margin: 0; padding: 0; min-width: 0; }
/* Ficha do funcionário → aba Documentos (INCLUSÃO — Gustavo — 2026-10-19). */
.rh-doc-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--cinza-borda); border-radius: 8px; margin-bottom: 8px; }
.rh-doc-icone { flex: none; width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }
.rh-doc-icone.pdf { background: #dc2626; }
.rh-doc-icone.img { background: var(--azul); }
.rh-doc-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rh-doc-info .badge { margin-left: 6px; }
.rh-doc-acoes { flex: none; display: flex; gap: 8px; align-items: center; }
.rh-dropzone { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 12px; border: 2px dashed var(--cinza-borda); border-radius: 8px; background: #fff; color: #6b7280; font-size: 13px; text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s; }
.rh-dropzone:hover, .rh-dropzone.arrastando { border-color: var(--azul); background: var(--apex-surface, #E0EDFF); color: var(--azul-escuro); }
/* Ficha do funcionário → aba Histórico: linha do tempo (INCLUSÃO — Gustavo — 2026-10-20).
   --cor vem do tipo do evento (definida no style do .rh-evento). */
.rh-linha-tempo { position: relative; padding-left: 26px; margin-top: 8px; }
.rh-linha-tempo::before { content: ""; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--cinza-borda); }
.rh-linha-tempo:empty::before { display: none; }
.rh-ano { position: relative; margin: 14px 0 8px -26px; padding-left: 26px; font-size: 12px; font-weight: 700; color: #6b7280; letter-spacing: .5px; }
.rh-ano:first-child { margin-top: 0; }
.rh-evento { position: relative; margin-bottom: 10px; }
.rh-evento-ponto { position: absolute; left: -23px; top: 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--cor, var(--azul)); box-shadow: 0 0 0 3px #fff; }
.rh-evento-corpo { border: 1px solid var(--cinza-borda); border-radius: 8px; padding: 8px 12px; background: #fff; overflow-wrap: anywhere; }
.rh-evento-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rh-evento-topo .btn-icone { margin-left: auto; }
.rh-evento-data { color: #6b7280; font-size: 13px; }
.rh-evento-descricao { margin-top: 4px; font-size: 14px; }
.rh-evento-alteracoes { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; display: grid; gap: 3px; }
.rh-alt-campo { display: inline-block; min-width: 110px; color: #6b7280; }
.rh-alt-de { color: #6b7280; text-decoration: line-through; }
.rh-evento-meta { margin-top: 6px; font-size: 12px; color: #9ca3af; }
@media (max-width: 560px) { .rh-alt-campo { display: block; min-width: 0; } }
/* Ficha → aba Ocorrências e jornada (INCLUSÃO — Gustavo — 2026-10-20). */
.rh-oc-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid var(--cinza-borda); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.rh-oc-item.cancelada { opacity: .65; }
.rh-oc-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rh-oc-info .badge { vertical-align: middle; }
.rh-oc-descricao { margin: 6px 0 4px; font-size: 13px; color: #374151; white-space: pre-wrap; }
.rh-oc-acoes { flex: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; max-width: 45%; }
.rh-oc-acoes .btn-mini { margin-left: 0; text-decoration: none; }
.rh-dias-semana { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 560px) { .rh-oc-item { flex-direction: column; } .rh-oc-acoes { max-width: none; justify-content: flex-start; } }
/* ===== Telas de Controle do RH — ASO, Férias, Vencimentos (INCLUSÃO — Gustavo — 2026-10-20) =====
   Cartões de resumo clicáveis (filtram a lista); --cor vem de cada cartão. */
.rh-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.rh-resumo-card { text-align: left; border: 1px solid var(--cinza-borda); border-radius: 8px; /* sem a barra lateral colorida (pedido do usuário, 2026-10-20) — a cor fica só no número */ padding: 10px 14px; background: #fff; cursor: pointer; font: inherit; color: inherit; transition: box-shadow .15s; }
.rh-resumo-card:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.rh-resumo-card.ativo { box-shadow: 0 0 0 2px var(--cor, var(--azul)); }
.rh-resumo-card .valor { display: block; font-size: 26px; font-weight: 700; color: var(--cor, var(--azul)); line-height: 1.2; }
.rh-resumo-card .rotulo { display: block; font-size: 12px; color: #4b5563; text-transform: uppercase; letter-spacing: .3px; font-weight: 600; }
.rh-resumo-card .detalhe { display: block; font-size: 12px; color: #6b7280; }
.rh-ficha-mini { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rh-ficha-mini .rh-avatar { width: 56px; height: 56px; font-size: 18px; }
.rh-ficha-mini h2 { margin: 0; font-size: 20px; color: var(--azul-escuro); overflow-wrap: anywhere; }
.rh-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid var(--cinza-borda); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.rh-item.cancelada { opacity: .6; }
.rh-item-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rh-item-info .badge { vertical-align: middle; }
.rh-item-acoes { flex: none; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.rh-item-acoes .btn-mini { margin-left: 0; text-decoration: none; }
.rh-meta { font-size: 12px; color: #6b7280; margin: 2px 0 0; }
.rh-link-abrir { white-space: nowrap; }
.rh-link-abrir, .barra-acoes-sticky a.btn { text-decoration: none; } /* link com cara de botão */
@media (max-width: 560px) { .rh-item { flex-direction: column; } .rh-item-acoes { justify-content: flex-start; } }
/* ===== RH → Lançamentos e Calendário do RH (INCLUSÃO — Gustavo — 2026-10-20) ===== */
.rh-form-lancamento { margin-top: 12px; }
/* Ficha do funcionário: quadro de conferência do cadastro incompleto (INCLUSÃO — Gustavo — 2026-10-20) */
.rh-conferencia { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; padding: 12px 16px; border: 1px solid #fcd34d; border-radius: 8px; background: #fffbeb; color: #78350f; }
.rh-conferencia .btn[disabled] { opacity: .55; cursor: not-allowed; }
/* Combo do colaborador aninhado por departamento (Lançamentos) */
.rh-combo-grupo { display: flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 12px; font-weight: 700; letter-spacing: .3px; color: #374151; background: #f8fafc; border-top: 1px solid var(--cinza-borda); cursor: pointer; user-select: none; }
.rh-combo-grupo:first-child { border-top: 0; }
.rh-combo-grupo:hover { background: #eef2f7; }
.rh-combo-grupo .contador { margin-left: auto; }
.rh-combo-seta { display: inline-block; font-size: 10px; color: #6b7280; transition: transform .15s; }
.rh-combo-grupo.aberto .rh-combo-seta { transform: rotate(90deg); }
.combo-item.rh-combo-sub { padding-left: 30px; display: flex; align-items: center; gap: 8px; }
/* INCLUSÃO — Gustavo — 2026-10-21 — foto no combo de colaborador e tipos desabilitados sem colaborador (Lançamentos) */
.combo-item.rh-combo-sub .rh-avatar { width: 26px; height: 26px; font-size: 10px; }
.rh-tipo:disabled { opacity: .45; cursor: not-allowed; }
.rh-tipo:disabled:hover { border-color: var(--cinza-borda); box-shadow: none; transform: none; }
/* Tipo de lançamento: quadrados com ícone (--cor = cor do tipo, a mesma do feed e do calendário) */
.rh-tipos-titulo { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: #4b5563; margin: 18px 0 8px; }
.rh-tipos-lancamento { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; } /* ALTERAÇÃO — Gustavo — 2026-10-21 — auto-fit: os cards visíveis ocupam a largura toda (pedido do usuário) */
.rh-tipo { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; padding: 16px 12px; text-align: center; border: 1px solid var(--cinza-borda); border-radius: 12px; background: #fff; color: var(--texto); font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s, background-color .15s; }
.rh-tipo:hover { border-color: var(--cor); box-shadow: 0 4px 14px rgba(0, 0, 0, .08); transform: translateY(-1px); }
.rh-tipo:focus-visible { outline: 2px solid var(--cor); outline-offset: 2px; }
.rh-tipo.ativo { border-color: var(--cor); background: color-mix(in srgb, var(--cor) 6%, #fff); box-shadow: 0 0 0 2px var(--cor); }
.rh-tipo.ativo::after { content: "\2713"; position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--cor); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.rh-tipo-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--cor) 12%, #fff); color: var(--cor); }
.rh-tipo-ico svg { width: 28px; height: 28px; }
.rh-tipo b { font-size: 14px; }
.rh-tipo small { font-size: 11.5px; color: #6b7280; line-height: 1.35; }
@media (max-width: 560px) { .rh-tipos-lancamento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rh-tipo { min-height: 120px; } .rh-tipo small { display: none; } }
.rh-cal-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rh-cal-mes { font-size: 18px; font-weight: 700; color: var(--azul-escuro); min-width: 170px; }
.rh-cal-legenda { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rh-cal-chip-leg { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--cinza-borda); border-radius: 999px; padding: 4px 10px; background: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.rh-cal-chip-leg::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--cor); }
.rh-cal-chip-leg.off { opacity: .45; text-decoration: line-through; }
.rh-cal-grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--cinza-borda); border-radius: 8px; overflow: hidden; }
.rh-cal-semana { background: var(--cinza-fundo); font-size: 11px; font-weight: 700; text-transform: uppercase; color: #6b7280; padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--cinza-borda); }
.rh-cal-dia { min-height: 110px; padding: 4px 6px; border-right: 1px solid var(--cinza-borda); border-bottom: 1px solid var(--cinza-borda); background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rh-cal-dia:nth-child(7n) { border-right: 0; }
.rh-cal-dia:hover { background: #f8fafc; }
.rh-cal-dia.fora { background: #f9fafb; color: #9ca3af; }
.rh-cal-dia.feriado { background: #fef2f2; }
.rh-cal-dia.selecionado { box-shadow: inset 0 0 0 2px var(--azul); }
.rh-cal-num { font-size: 12px; font-weight: 700; width: 22px; height: 22px; display: grid; place-items: center; flex: none; }
.rh-cal-dia.hoje .rh-cal-num { background: var(--azul); color: #fff; border-radius: 50%; }
.rh-cal-feriado { font-size: 11px; font-weight: 700; color: #dc2626; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-cal-ev { font-size: 11px; line-height: 1.35; padding: 1px 6px; border-radius: 4px; background: color-mix(in srgb, var(--cor) 12%, #fff); color: var(--cor); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-cal-mais { font-size: 11px; color: #6b7280; padding-left: 6px; }
.rh-cal-lista-dia { margin-bottom: 14px; }
.rh-cal-lista-dia h4 { margin: 0 0 6px; font-size: 13px; color: #374151; }
.rh-item-info a { color: inherit; text-decoration: none; } /* nome do colaborador no feed de lançamentos */
.rh-item-info a:hover { color: var(--azul); text-decoration: underline; }
.rh-cal-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--cinza-borda); border-radius: 6px; margin-bottom: 6px; background: #fff; }
@media (max-width: 700px) {
  .rh-cal-dia { min-height: 56px; padding: 2px; }
  .rh-cal-ev, .rh-cal-feriado, .rh-cal-mais { display: none; }
}
/* ===== RH → Relatórios (INCLUSÃO — Gustavo — 2026-10-20) ===== */
.rh-relatorios-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rh-rel-item { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 14px; border: 1px solid var(--cinza-borda); border-radius: 10px; background: #fff; color: var(--texto); font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.rh-rel-item:hover { border-color: var(--azul); box-shadow: 0 4px 12px rgba(0, 0, 0, .06); }
.rh-rel-item.ativo { border-color: var(--azul); background: #eff6ff; box-shadow: 0 0 0 1px var(--azul); }
.rh-rel-item b { font-size: 14px; color: var(--azul-escuro); }
.rh-rel-item small { font-size: 12px; color: #6b7280; line-height: 1.35; }
.rh-th-ordena { cursor: pointer; user-select: none; white-space: nowrap; }
.rh-th-ordena:hover { color: var(--azul); }
@media print {
  #appSidebar, .sb-mobile-btn, .sb-backdrop, .rh-nao-imprime, .toast-box { display: none !important; }
  body.tem-sidebar { padding-left: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none !important; border: 0 !important; }
  .rh-tabela-wrap { overflow: visible !important; }
  .tabela th, .tabela td { font-size: 10pt; }
}
.trava-rh:disabled { opacity: .7; }
.trava-rh:disabled input, .trava-rh:disabled select { cursor: not-allowed; }
@media (max-width: 560px) { .ficha-cabecalho { flex-direction: column; align-items: flex-start; } }
/* ===== FIM INCLUSÃO — Gustavo — 2026-10-15 ===== */

/* ===== INCLUSÃO — Gabriel — 2026-10-21 =====
   Motivo: identidade visual das telas (docs/IDENTIDADE-VISUAL-TELAS.md) — base = Negociação V2. Tela que já foi
   reformulada ganha a classe "tela-padrao" no <body>: título da tela grande (navy) e títulos de seção como os do
   cartão da Negociação ("Dados da negociação", "Programas"): 18px, negrito, sem a faixa azul em maiúsculas do .secao antigo.
   Aplicado em: Pessoas, Emissoras (2026-10-21). As demais telas continuam com o .secao antigo até serem reformuladas. */
.tela-padrao .titulo-neg { font-size: 24px; font-weight: 700; color: var(--azul-escuro); margin: 0 8px 0 0; }
.tela-padrao .secao { font-size: 18px; font-weight: 700; text-transform: none; color: var(--texto, #111827);
  background: none; border-left: 0; padding: 0; margin: 24px 0 12px; }
.tela-padrao .secao:first-child { margin-top: 0; }
.tela-padrao .card > h3.secao:first-child, .tela-padrao .aba-conteudo > h3.secao:first-of-type { margin-top: 0; }
/* ===== FIM INCLUSÃO — Gabriel — 2026-10-21 ===== */
/* INCLUSÃO — Gabriel — 2026-10-21 — contador ao lado do título de seção com um respiro (ex.: "Programas desta emissora 0") */
.tela-padrao .secao .contador { margin-left: 8px; }
/* INCLUSÃO — Gabriel — 2026-10-21 — Cadastros do RH: 7 abas em uma linha só (pedido do usuário) — aba um pouco mais estreita; se a tela for pequena, rola de lado */
#abasRhCadastros .aba { padding-left: 14px; padding-right: 14px; font-size: 13px; white-space: nowrap; flex: none; } /* ALTERAÇÃO — Gabriel — 2026-10-21 — só o espaço lateral (o de cima/baixo é do padrão de abas) */
/* INCLUSÃO — Gabriel — 2026-10-21 — PADRÃO DE ABAS (aprovado pelo usuário no teste de Emissoras; aplicado em todas as abas de cartão de título — classe .abas-invertidas).
   Modelo: abas do Chrome, INVERTIDAS (aqui o fundo da página é cinza). A faixa das abas é o cartão branco; a aba selecionada
   é cinza (cor do fundo), tem os cantos de cima arredondados e "escorre" para o fundo de baixo com as curvinhas nos pés;
   as não selecionadas não têm caixa (só o texto, com um separador fino), e no mouse ganham um fundo leve.
   RETIRADO POR SUBSTITUIÇÃO (mesmo dia, versões de teste anteriores): abas brancas fechadas, aba selecionada com sombra
   externa / sombra interna / cantos de baixo arredondados. Se aprovar, vira o padrão do .aba (aí some esta classe). */
.card:has(.abas-invertidas) { padding-bottom: 0; } /* ALTERAÇÃO — Gabriel — 2026-10-21: vale para qualquer cartão com as abas no fim (era só .cabecalho-neg) */
.cabecalho-neg:has(.abas-invertidas) > .row-flex:last-child { align-items: flex-end; }
.abas-invertidas { align-items: flex-end; gap: 0; margin-bottom: 0 !important; position: relative; z-index: 1; padding-left: 10px; }
.abas-invertidas .aba { position: relative; background: transparent; border: 0; border-radius: 10px 10px 0 0; color: #4b5563;
  margin: 0 0 8px; padding: 9px 20px; }
.abas-invertidas .aba:hover { background: #f3f4f6; }
.abas-invertidas .aba:not(.ativo) + .aba:not(.ativo)::before { content: ''; position: absolute; left: 0; top: 25%; height: 50%; border-left: 1px solid var(--cinza-borda); }
.abas-invertidas .aba.ativo { background: var(--cinza-fundo, #f4f5f7); color: var(--azul-escuro); margin: 0 0 -7px; padding: 11px 20px 20px; } /* ALTERAÇÃO — Gabriel — 2026-10-21: desce 7px (antes 2px) para cobrir a sombra do cartão, que deixava uma linha embaixo da aba */
/* pés curvos da aba selecionada (como no Chrome): quadradinhos de 10px nos dois lados, com um quarto de círculo vazado */
.abas-invertidas .aba.ativo::before, .abas-invertidas .aba.ativo::after { content: ''; position: absolute; bottom: 0; width: 10px; height: 10px; }
.abas-invertidas .aba.ativo::before { left: -10px; background: radial-gradient(circle at 0 0, transparent 10px, var(--cinza-fundo, #f4f5f7) 10.5px); }
.abas-invertidas .aba.ativo::after { right: -10px; background: radial-gradient(circle at 100% 0, transparent 10px, var(--cinza-fundo, #f4f5f7) 10.5px); }

/* INCLUSÃO — Gabriel — 2026-10-21 — padrão de abas nas telas que têm o cabeçalho em flex (Funcionários): as abas descem para a linha de baixo, na largura toda */
.ficha-cabecalho:has(.abas-invertidas) { flex-wrap: wrap; }
.ficha-cabecalho > .abas-invertidas { flex-basis: 100%; margin-top: 14px; }
/* INCLUSÃO — Gabriel — 2026-10-21 — mesmo modelo para abas que abrem um PAINEL branco logo abaixo (Negociação V2: Programas/PIs e Resumo):
   as não selecionadas são só texto com separador fino; a selecionada é BRANCA com borda em cima e dos lados e emenda no painel. */
.abas-painel { gap: 0; margin-bottom: -1px; position: relative; z-index: 1; }
.abas-painel .aba { position: relative; background: transparent; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; color: #4b5563; padding: 9px 20px; }
.abas-painel .aba:hover { background: #f3f4f6; }
.abas-painel .aba:not(.ativo) + .aba:not(.ativo)::before { content: ''; position: absolute; left: 0; top: 25%; height: 50%; border-left: 1px solid var(--cinza-borda); }
.abas-painel .aba.ativo { background: #fff; color: var(--azul-escuro); border-color: var(--cinza-borda); padding-bottom: 10px; }
/* INCLUSÃO — Gabriel — 2026-10-21 — Cadastros do RH em tela estreita: as 7 abas continuam numa linha só, um pouco menores */
@media (max-width: 1400px) { #abasRhCadastros .aba { padding-left: 6px; padding-right: 6px; font-size: 12px; } }
/* RETIRADO POR SUBSTITUIÇÃO — Gabriel — 2026-10-22: teste body.voltar-esquerda (só Emissoras). Aprovado: virou padrão em barra-acoes-topo.js */
/* INCLUSÃO — Gabriel — 2026-10-22 — botão de recolher o menu desce para perto do Sair (pedido do usuário; antes ficava ao lado da logo) */
.sb-toggle { top: auto; bottom: 64px; }
body.sb-collapsed .sb-toggle { top: auto; }
/* ===== INCLUSÃO — Gustavo — 2026-10-21 — contas bancárias / chaves PIX (public/contas-bancarias.js — RH e Pessoas) ===== */
.cb-topo { justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cb-topo .cb-resumo { font-size: 12px; margin: 0; }
.cb-form { background: #f8f9fb; margin: 8px 0 12px; }
.cb-form .grid + .grid { margin-top: 8px; }
.cb-par { display: flex; gap: 6px; }
.cb-par input:first-child { flex: 1; min-width: 0; }
.cb-par .cb-dig { width: 58px; flex: none; text-align: center; text-transform: uppercase; }
.cb-principal { display: flex; flex-direction: column; justify-content: flex-end; }
.cb-principal .vazio { font-size: 11px; margin: 2px 0 0; }
.cb-principal .cb-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--texto); margin: 0; }
.cb-principal .cb-check input { width: 16px; height: 16px; margin: 0; flex: none; }
.cb-dica { font-size: 11px; margin: 2px 0 0; }
.cb-erro { margin-top: 8px; }
.cb-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--cinza-borda); border-radius: 10px; background: #fff; margin-bottom: 8px; }
.cb-item.principal { border-color: var(--azul); } /* sem barra lateral colorida (padrão do usuário) */
.cb-info { flex: 1; min-width: 0; font-size: 13px; }
.cb-info > div + div { margin-top: 2px; }
.cb-acoes { display: flex; gap: 4px; flex: none; }
.cb-sigla { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; background: #eef2f7; color: #475569; }
.cb-sigla.cb-pix { background: #e0f7f4; color: #0f766e; }
.cb-sigla.cb-ted, .cb-sigla.cb-deposito { background: #e0edff; color: var(--azul-escuro, #1e3a8a); }
.cb-sigla.cb-especie { background: #fef3c7; color: #92400e; }
/* ===== FIM INCLUSÃO — Gustavo — 2026-10-21 ===== */

/* ===== INCLUSÃO — Alberth — 2026-10-16 =====
   Motivo: Financeiro → Recebimentos (recebimentos.html). Paleta APEX via variáveis. */
.fin-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.fin-resumo-card { display: flex; flex-direction: column; gap: 4px; margin-bottom: 0; }
.fin-resumo-rotulo { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--texto-suave, #6b7280); }
.fin-resumo-valor { font-size: 24px; color: var(--azul-escuro); font-variant-numeric: tabular-nums; }
.fin-tabela-wrap { overflow-x: auto; }
.fin-valor { font-variant-numeric: tabular-nums; font-weight: 600; }
.fin-cancelado td { opacity: .55; }
.fin-cancelado .fin-valor { text-decoration: line-through; }
.fin-calculado input { background: var(--cinza-fundo); color: #374151; cursor: default; }
.fin-aviso { margin: 0 0 8px; padding: 8px 12px; border-radius: 6px; background: #fef3c7; color: #92400e; font-size: 13px; }
/* ===== FIM INCLUSÃO — Alberth — 2026-10-16 ===== */
/* ===== INCLUSÃO — Gabriel — 2026-10-26 — devolução por mídia (OPEC) e "i" do status em revisão (vendedor) ===== */
.dv-linha { border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 10px; margin: 6px 0; text-align: left; }
.dv-chk { display: flex; gap: 8px; align-items: center; cursor: pointer; text-align: left; }
.dv-campos { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 6px; }
.dv-campos .swal2-select, .dv-campos .swal2-input { margin: 0; width: 100%; font-size: 13px; }
.dica-flutuante { position: fixed; z-index: 1200; width: 400px; max-width: 92vw; max-height: 70vh; overflow-y: auto; background: #1f2937; color: #fff; font-size: 13px; font-weight: 400; line-height: 1.5; padding: 12px 14px; border-radius: 8px; box-shadow: 0 8px 22px rgba(0,0,0,.28); text-align: left; }
.swal-form .dv-chk { text-transform: none; font-size: 13px; font-weight: 400; letter-spacing: 0; color: inherit; margin: 0; }
.swal-form .dv-chk .vazio { color: #6b7280; }
/* ===== INCLUSÃO — Gustavo — 2026-10-27 — responsividade do módulo RH (pedido do usuário). Conferida com uma auditoria
   automática em 1366 / 1280 / 1100 / 1024 / 768 / 390 px: nenhuma tela do RH pode rolar a PÁGINA de lado. ===== */
/* Títulos das colunas quebram linha (o "DEPARTAMENTO" inteiro numa linha só segurava a coluna larga) */
.rh-tabela-wrap .tabela th { white-space: normal; }
.rh-tabela-wrap .tabela td { overflow-wrap: break-word; }
/* Abas da ficha do funcionário (9) e do Cadastros do RH (7) não cabem numa linha abaixo de ~1340px: quebram em linhas e a
   aba ativa vira um destaque simples (o encaixe "invertido" só funciona com uma linha) */
@media (max-width: 1340px) {
  #abasFuncionario, #abasRhCadastros { flex-wrap: wrap; row-gap: 4px; padding-left: 0; }
  #abasFuncionario .aba.ativo, #abasRhCadastros .aba.ativo { margin: 0; padding: 10px 16px; border-radius: 10px; }
  #abasFuncionario .aba.ativo::before, #abasFuncionario .aba.ativo::after,
  #abasRhCadastros .aba.ativo::before, #abasRhCadastros .aba.ativo::after { display: none; }
}
/* Celular: as tabelas do RH viram cartões (padrão das listas do Estoque — data-label preenchido por tabela-responsiva.js) */
@media (max-width: 640px) {
  .rh-tabela-wrap { overflow-x: visible; }
  .rh-tabela-wrap .tabela thead { display: none; }
  .rh-tabela-wrap .tabela, .rh-tabela-wrap .tabela tbody, .rh-tabela-wrap .tabela tr { display: block; width: 100%; }
  .rh-tabela-wrap .tabela tr { border: 1px solid var(--cinza-borda); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; background: #fff; }
  /* bloco com o rótulo flutuando na margem esquerda (e não grid): a célula com selo + data, nome + 2ª linha ou vários
     botões segue o fluxo normal — no grid cada pedaço virava um item e caía embaixo do rótulo. flow-root faz a célula
     crescer até a altura do rótulo quando o valor é curto ("—" com rótulo de 2 linhas) */
  .rh-tabela-wrap .tabela td { display: flow-root; border: 0; padding: 5px 0 5px 118px;
    text-align: left !important; white-space: normal !important; }
  .rh-tabela-wrap .tabela td::before { content: attr(data-label); float: left; width: 108px; margin: 2px 0 0 -118px;
    color: #64748b; font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; line-height: 1.25; }
  .rh-tabela-wrap .tabela td[data-label=""], .rh-tabela-wrap .tabela td[colspan] { padding-left: 0; }
  .rh-tabela-wrap .tabela td[data-label=""]::before, .rh-tabela-wrap .tabela td[colspan]::before { content: none; }
  .ficha-info { min-width: 0; }
}
/* Nomes longos sem espaço (empresa) e e-mails podem quebrar; relatórios largos ficam mais compactos em telas menores */
.rh-tabela-wrap td.rh-quebra, #tabelaRelatorio td[data-chave="email"] { overflow-wrap: anywhere; }
@media (max-width: 1440px) { #tabelaRelatorio { font-size: 12px; } #tabelaRelatorio th, #tabelaRelatorio td { padding: 5px 7px; } }
/* Lista de Funcionários e Controle de Vencimentos: mais compactas entre o celular e o desktop largo */
@media (min-width: 641px) and (max-width: 1180px) {
  #tabelaFuncionarios, #tabelaVencimentos { font-size: 12px; }
  #tabelaFuncionarios th, #tabelaFuncionarios td, #tabelaVencimentos th, #tabelaVencimentos td { padding: 5px 6px; }
  #tabelaFuncionarios .rh-avatar { width: 28px; height: 28px; }
  #tabelaFuncionarios .btn-icone { padding: 4px; }
}
.rh-tabela-wrap td.rh-quebra { min-width: 110px; } /* razão social quebra entre palavras, não no meio */
/* Filtros da lista de Funcionários (7 campos) em duas linhas quando a tela aperta — os de col-1 ficavam espremidos */
@media (min-width: 701px) and (max-width: 1340px) {
  .rh-filtros-func > .col-3, .rh-filtros-func > .col-2 { grid-column: span 4; }
  .rh-filtros-func > .col-1 { grid-column: span 3; }
  .rh-filtros-func > .col-2:last-child { grid-column: span 3; }
}
/* Desligar funcionário: o modal é curto e não rola — a lista do motivo abre por cima do rodapé, sem criar barra no corpo */
#modalDesligar .modal-body { overflow: visible; }
#modalDesligar .combo-list { z-index: 20; }
/* O botão "? Ajuda" (fixo no canto) nunca sai na impressão de nenhuma tela */
@media print { #btnAjudaTela, #btnAjudaMidia { display: none !important; } }
/* ===== FIM INCLUSÃO — Gustavo — 2026-10-27 ===== */
/* ===== INCLUSÃO — Gustavo — 2026-10-27 — com um modal aberto a tela de fundo não rola (pedido do usuário). Vale para
   todas as telas: todo .modal-overlay do sistema abre/fecha pelo atributo hidden (inclusive o "? Ajuda"). O gutter
   estável guarda o lugar da barra de rolagem, para a página não "pular" de lado ao abrir. ===== */
html:has(.modal-overlay:not([hidden])) { overflow: hidden; scrollbar-gutter: stable; }
body:has(.modal-overlay:not([hidden])) { overflow: hidden; }
.modal-overlay { overscroll-behavior: contain; }
/* ===== FIM INCLUSÃO — Gustavo — 2026-10-27 ===== */
/* ===== INCLUSÃO — Gustavo — 2026-10-27 — sem barrinhas laterais coloridas no módulo RH (pedido do usuário). As das
   classes rh-* (Histórico, conferência, Calendário) foram tiradas na própria regra; o título de seção .secao é global,
   então só perde a barra nas telas do RH (body.modulo-rh). ===== */
.modulo-rh .secao { border-left: 0; border-radius: 6px; }
/* ===== FIM INCLUSÃO — Gustavo — 2026-10-27 ===== */
/* ===== INCLUSÃO — Gustavo — 2026-10-27 — calendário dos campos de data do RH no visual do sistema (seletor-data.js).
   Com mouse, o ícone nativo some e entra o nosso; no toque (celular) continua o seletor do aparelho. ===== */
@media (pointer: fine) {
  .modulo-rh input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
  .modulo-rh input[type="date"]:not(:disabled) { cursor: pointer; padding-right: 34px; background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
}
.sd-pop { position: fixed; z-index: 1500; width: 272px; padding: 10px; background: #fff; border: 1px solid var(--cinza-borda); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18); font-family: inherit; font-size: 13px; color: #111827; }
.sd-pop[hidden] { display: none; }
.sd-pop button { font-family: inherit; font-size: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
.sd-pop button:disabled { cursor: default; }
.sd-topo { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.sd-nav { width: 32px; height: 32px; border-radius: 8px; font-size: 20px !important; line-height: 1; color: var(--azul-escuro) !important; }
.sd-nav:hover { background: #eff6ff; }
.sd-titulo { flex: 1; height: 32px; border-radius: 8px; font-weight: 700; color: var(--azul-escuro) !important; }
.sd-titulo:not(:disabled):hover { background: #eff6ff; }
.sd-grade { display: grid; gap: 2px; }
.sd-dias { grid-template-columns: repeat(7, 1fr); }
.sd-meses { grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0; }
.sd-sem { text-align: center; font-size: 11px; font-weight: 700; color: #64748b; padding: 4px 0; }
.sd-dia, .sd-cel { height: 34px; border-radius: 8px; }
.sd-cel { height: 40px; }
.sd-dia:not(:disabled):hover, .sd-cel:not(:disabled):hover { background: #eff6ff; }
.sd-fora { color: #94a3b8 !important; }
.sd-hoje { color: var(--azul) !important; font-weight: 700; box-shadow: inset 0 0 0 1px var(--azul); }
.sd-sel, .sd-sel:hover { background: var(--azul) !important; color: #fff !important; font-weight: 700; box-shadow: none; }
.sd-pop button:disabled.sd-dia, .sd-pop button:disabled.sd-cel { color: #cbd5e1 !important; text-decoration: line-through; text-decoration-color: #e2e8f0; }
.sd-rodape { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid #eef2f7; }
.sd-link { color: var(--azul) !important; font-weight: 600; padding: 4px 8px; border-radius: 6px; }
.sd-link:not(:disabled):hover { background: #eff6ff; }
.sd-link:disabled { color: #cbd5e1 !important; }
/* ===== FIM INCLUSÃO — Gustavo — 2026-10-27 ===== */

/* INCLUSÃO — Gabriel — 2026-11-17 — campo travado por REGRA (ex.: Emissora do tipo Grupo: CNPJ, Razão Social e origem vêm da matriz). Cinza visível + cursor de bloqueado; só vale onde a classe é posta, não mexe nos demais campos desabilitados. */
input.campo-travado:disabled, select.campo-travado:disabled { background: #E5E7EB !important; color: #6B7280 !important; cursor: not-allowed; }

/* INCLUSÃO — Gabriel — 2026-11-18 — sino de notificações do menu */
.sb-sino { position: fixed; top: 12px; right: 26px; z-index: 55; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: #1f2937; border: 1px solid var(--cinza-borda); border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.10); cursor: pointer; padding: 0; }
.sb-sino:hover { border-color: var(--azul); color: var(--azul); }
.sb-sino-n { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #dc2626; color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; }
.sino-painel { position: fixed; z-index: 60; width: 340px; max-height: 70vh; overflow-y: auto; background: #fff; color: #1f2937; border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.25); }
.sino-topo { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid #e5e7eb; font-size: 13px; }
.sino-topo button { background: none; border: 0; color: var(--azul); font-size: 12px; cursor: pointer; }
.sino-item { display: block; padding: 10px 12px; border-bottom: 1px solid #f3f4f6; text-decoration: none; color: inherit; font-size: 13px; }
.sino-item.nova { background: #eef4ff; }
.sino-item:hover { background: #f3f4f6; }
.sino-item b { display: block; margin-bottom: 2px; }
.sino-item span { display: block; line-height: 1.4; }
.sino-item small { color: #6b7280; }
.sino-vazio { padding: 16px; text-align: center; color: #6b7280; margin: 0; }
