/* Sistema Injex — estilo geral: telas simples, botões grandes. */

:root {
  --cor: #008000;
  --cor-escura: #006400;
  --cor-clara: #e6f4e6;
  --fundo: #f3f5f8;
  --cartao: #ffffff;
  --texto: #1f2933;
  --suave: #6b7785;
  --borda: #d9dee5;
  --verde: #2e7d32;
  --vermelho: #c62828;
  --amarelo: #f9a825;
  --raio: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px;
  color: var(--texto);
  background: var(--fundo);
}

button, input, select, textarea { font: inherit; }

/* ---------- Topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  background: var(--cor); color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.topo .marca { font-weight: 700; font-size: 20px; color: #fff; text-decoration: none; }
.topo .espaco { flex: 1; }
.topo .logado {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.15); padding: 6px 8px 6px 14px; border-radius: 30px;
}
.topo .logado strong { font-size: 18px; }
.topo .logado button {
  border: 0; border-radius: 20px; padding: 8px 14px; cursor: pointer;
  background: #fff; color: var(--cor-escura); font-weight: 600;
}

.conteudo { max-width: 1000px; margin: 24px auto; padding: 0 16px; }

h1 { font-size: 26px; margin: 0 0 18px; }
h2 { font-size: 20px; margin: 0 0 14px; }

/* ---------- Botões ---------- */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px;
  border: 0; border-radius: var(--raio); cursor: pointer;
  background: var(--cor); color: #fff; font-weight: 600; font-size: 17px;
  text-decoration: none;
}
.botao:hover { background: var(--cor-escura); }
.botao:disabled { opacity: .5; cursor: default; }
.botao.secundario { background: #fff; color: var(--cor); border: 2px solid var(--cor); }
.botao.secundario:hover { background: var(--cor-clara); }
.botao.perigo { background: var(--vermelho); }
.botao.pequeno { min-height: 38px; padding: 6px 14px; font-size: 15px; }

/* ---------- Cartões do início ---------- */
.grade-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.item-menu {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 140px; padding: 16px;
  background: var(--cartao); border: 2px solid var(--borda); border-radius: var(--raio);
  color: var(--texto); text-decoration: none; font-size: 19px; font-weight: 600; text-align: center;
}
.item-menu .icone { font-size: 40px; }
.item-menu:hover { border-color: var(--cor); }
.item-menu.desligado { opacity: .5; pointer-events: none; }
.item-menu small { font-weight: 400; color: var(--suave); font-size: 14px; }

/* ---------- Login ---------- */
.tela-login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.tela-login .logo-empresa { max-height: 90px; max-width: 260px; margin-bottom: 10px; }
.tela-login h1 { color: var(--cor-escura); }
.grade-nomes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; width: 100%; max-width: 760px; }
.botao-nome {
  min-height: 90px; border-radius: var(--raio); border: 2px solid var(--borda);
  background: #fff; cursor: pointer; font-size: 21px; font-weight: 600; color: var(--texto);
}
.botao-nome:hover { border-color: var(--cor); background: var(--cor-clara); }

/* ---------- Janela (modal) e teclado de código ---------- */
.fundo-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 380px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.modal.largo { max-width: 520px; }
.modal h2 { text-align: center; }
.visor-codigo {
  width: 100%; height: 56px; margin-bottom: 14px; border: 2px solid var(--borda); border-radius: var(--raio);
  text-align: center; font-size: 34px; letter-spacing: 10px;
  -webkit-text-security: disc;
}
.visor-codigo:focus { outline: 0; border-color: var(--cor); }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.teclado button {
  height: 64px; border-radius: var(--raio); border: 1px solid var(--borda); background: #f7f9fc;
  font-size: 26px; font-weight: 600; cursor: pointer;
}
.teclado button:hover { background: var(--cor-clara); }
.teclado .ok { background: var(--verde); color: #fff; border: 0; }
.teclado .ok:hover { background: #1b5e20; }
.erro { color: var(--vermelho); text-align: center; min-height: 24px; margin: 8px 0 0; font-weight: 600; }
.acoes-modal { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.lista-escolha { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lista-escolha button { min-height: 60px; font-size: 18px; }

/* ---------- Abas e formulários ---------- */
.abas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.abas button {
  padding: 12px 20px; border: 0; border-radius: var(--raio) var(--raio) 0 0;
  background: #e4e8ee; cursor: pointer; font-size: 17px; font-weight: 600; color: var(--suave);
}
.abas button.ativa { background: var(--cartao); color: var(--cor); box-shadow: inset 0 -3px 0 var(--cor); }
.painel { background: var(--cartao); border-radius: var(--raio); padding: 22px; border: 1px solid var(--borda); }


.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.campo label { font-weight: 600; font-size: 15px; color: var(--suave); }
.campo input, .campo select, .campo textarea {
  padding: 12px; border: 2px solid var(--borda); border-radius: 10px; background: #fff; min-height: 48px;
}
.campo input:focus, .campo select:focus { outline: 0; border-color: var(--cor); }
.rastro { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
          margin-top: 14px; padding: 10px 12px; background: #f6f8fa; border-radius: 8px; font-size: 14px; color: var(--suave); }
.rastro strong { color: var(--texto, #1f2933); }
#historico { margin-top: 10px; max-height: 360px; overflow-y: auto; }
.linha-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.marcar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 17px; cursor: pointer; }
.marcar input { width: 22px; height: 22px; accent-color: var(--cor); }

.tabela { width: 100%; border-collapse: collapse; }
.tabela th, .tabela td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--borda); }
.tabela th { font-size: 14px; color: var(--suave); text-transform: uppercase; }
.tabela tr.inativo td { color: var(--suave); text-decoration: line-through; }
.etiqueta { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; background: #eceff1; }
.etiqueta.admin { background: #fff3e0; color: #e65100; }
.etiqueta.nacional { background: #e3f2fd; color: #0d47a1; }
.etiqueta.movel { background: #f3e5f5; color: #6a1b9a; }
.etiqueta.municipal { background: #e8f5e9; color: var(--verde); }

.logo-previa { max-height: 100px; max-width: 260px; border: 1px dashed var(--borda); padding: 6px; border-radius: 8px; display: block; margin-bottom: 10px; }
.dica { color: var(--suave); font-size: 15px; margin: 4px 0 14px; }

/* ---------- Aviso rápido ---------- */
.aviso {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200;
  background: #263238; color: #fff; padding: 14px 24px; border-radius: 30px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.aviso.erro-aviso { background: var(--vermelho); }

/* ---------- Produtos ---------- */
.barra-busca { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.barra-busca input[type=search] {
  flex: 1; min-width: 240px; min-height: 56px; padding: 12px 16px; font-size: 20px;
  border: 2px solid var(--borda); border-radius: var(--raio); background: #fff;
}
.barra-busca input[type=search]:focus { outline: 0; border-color: var(--cor); }

.lista-produtos { display: flex; flex-direction: column; gap: 8px; }
.linha-produto {
  display: grid; grid-template-columns: 56px 110px 1fr auto; gap: 14px; align-items: center;
  padding: 10px 14px; background: var(--cartao); border: 2px solid var(--borda); border-radius: var(--raio);
  color: var(--texto); text-decoration: none; cursor: pointer;
}
.linha-produto:hover { border-color: var(--cor); }
.linha-produto.inativo { opacity: .55; }
.linha-produto .codigo { font-family: Consolas, monospace; font-size: 17px; color: var(--suave); }
.linha-produto .nome { font-weight: 600; font-size: 18px; }
.linha-produto .preco { font-weight: 700; color: var(--cor-escura); white-space: nowrap; }
.linha-produto .filhos-achados { grid-column: 3 / 5; display: flex; flex-direction: column; gap: 4px; }
.linha-produto .filho-achado { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; color: var(--suave); }
.linha-produto .filho-achado.exato { color: var(--texto); font-weight: 600; }
.miniatura {
  width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #eef1f4;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.miniatura.pequena { width: 40px; height: 40px; font-size: 18px; }
.etiqueta.exemplo { background: #fff8e1; color: #8d6e00; }
.etiqueta.tipo-faixas { background: #e3f2fd; color: #0d47a1; }
.etiqueta.tipo-pai { background: #f3e5f5; color: #6a1b9a; }
.vazio { text-align: center; color: var(--suave); padding: 30px; }

.escolha-tipo { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.escolha-tipo button {
  text-align: left; padding: 14px 16px; border-radius: var(--raio); border: 2px solid var(--borda);
  background: #fff; cursor: pointer; color: var(--texto);
}
.escolha-tipo button strong { display: block; font-size: 18px; margin-bottom: 4px; }
.escolha-tipo button span { font-size: 14px; color: var(--suave); }
.escolha-tipo button.ativo { border-color: var(--cor); background: var(--cor-clara); }

.tabela input { padding: 8px 10px; border: 2px solid var(--borda); border-radius: 8px; min-height: 42px; width: 100%; }
.tabela input:focus { outline: 0; border-color: var(--cor); }
.tabela input[readonly] { background: #f3f5f8; color: var(--suave); }
.tabela td.estreito { width: 1%; white-space: nowrap; }
.campo-dinheiro { max-width: 160px; }
.tabela input.campo-dinheiro { width: 120px; }
.calculadora {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding: 14px;
  background: var(--cor-clara); border-radius: var(--raio);
}
.calculadora input { width: 110px; padding: 8px 10px; border: 2px solid var(--borda); border-radius: 8px; min-height: 42px; }
.calculadora .resultado { font-weight: 700; font-size: 18px; }
.rodape-acoes {
  position: sticky; bottom: 0; display: flex; gap: 12px; justify-content: flex-end;
  padding: 14px 0; background: linear-gradient(transparent, var(--fundo) 30%);
}
.foto-produto { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.foto-produto img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--raio); border: 1px solid var(--borda); }

/* ---------- Venda ---------- */
.conteudo.largo { max-width: 1400px; }
.tela-venda { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .tela-venda { grid-template-columns: 1fr; } }
.faixa-caixa { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; color: var(--suave); font-size: 15px; margin-bottom: 14px; }
.faixa-caixa strong { color: var(--texto); }

.seletor-modo { display: inline-flex; background: #e4e8ee; border-radius: var(--raio); padding: 4px; gap: 4px; margin-bottom: 14px; }
.seletor-modo button { border: 0; background: transparent; padding: 10px 20px; border-radius: 9px; font-weight: 600; font-size: 17px; cursor: pointer; color: var(--suave); }
.seletor-modo button.ativo { background: #fff; color: var(--cor); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.seletor-modo button:disabled { cursor: not-allowed; opacity: .5; }

.quantidades { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.quantidades .rotulo { font-weight: 600; color: var(--suave); margin-right: 4px; }
.quantidades button {
  min-width: 58px; height: 58px; border-radius: var(--raio); border: 2px solid var(--borda); background: #fff;
  font-size: 22px; font-weight: 700; cursor: pointer; padding: 0 14px;
}
.quantidades button.ativo { border-color: var(--cor); background: var(--cor); color: #fff; }

.resultados { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.resultado {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 14px; background: #fff; border: 2px solid var(--borda); border-radius: var(--raio); cursor: pointer; font-size: 17px;
}
.resultado:hover, .resultado:focus { border-color: var(--cor); outline: 0; }
.resultado .codigo { font-family: Consolas, monospace; color: var(--suave); min-width: 80px; }
.resultado .nome { flex: 1; font-weight: 600; }
.resultado .preco { font-weight: 700; color: var(--cor-escura); white-space: nowrap; }
.resultado.filho { margin-left: 28px; width: calc(100% - 28px); border-style: dashed; }
.resultado.filho .nome { font-weight: 500; }

.grade-atalhos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.atalho {
  min-height: 84px; padding: 10px; border-radius: var(--raio); border: 2px solid var(--borda); background: #fff; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; gap: 4px; text-align: center; font-weight: 600; font-size: 16px;
}
.atalho:hover { border-color: var(--cor); background: var(--cor-clara); }
.atalho small { font-weight: 400; color: var(--suave); }

.carrinho { position: sticky; top: 76px; display: flex; flex-direction: column; max-height: calc(100vh - 96px); }
.carrinho .itens { overflow-y: auto; flex: 1; min-height: 120px; }
.item-carrinho { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--borda); }
.item-carrinho .desc { font-weight: 600; }
.item-carrinho .desc small { display: block; font-weight: 400; color: var(--suave); font-family: Consolas, monospace; }
.item-carrinho .total-item { font-weight: 700; text-align: right; white-space: nowrap; }
.item-carrinho .controles { grid-column: 1 / 3; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-carrinho .controles button { min-width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--borda); background: #f7f9fc; font-size: 18px; cursor: pointer; }
.item-carrinho .controles input { width: 70px; height: 38px; text-align: center; border: 2px solid var(--borda); border-radius: 8px; font-size: 17px; }
.item-carrinho .preco-unit { border: 0; background: none; color: var(--cor-escura); text-decoration: underline dotted; cursor: pointer; font-size: 16px; }
.item-carrinho .alterado { color: #e65100; font-size: 13px; font-weight: 600; }
.item-carrinho .remover { margin-left: auto; color: var(--vermelho); }
.totais { border-top: 2px solid var(--texto); padding-top: 12px; margin-top: 8px; }
.totais .linha { display: flex; justify-content: space-between; font-size: 17px; margin-bottom: 4px; }
.totais .grande { font-size: 30px; font-weight: 800; }
.botoes-venda { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.botoes-venda .pagar { grid-column: 1 / 3; min-height: 64px; font-size: 22px; }

/* Pagamento */
.modal.pagamento { max-width: 640px; max-height: calc(100vh - 32px); overflow-y: auto; }
.total-pagar { text-align: center; font-size: 40px; font-weight: 800; color: var(--cor-escura); margin: 4px 0 12px; }
.formas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.formas button { min-height: 56px; border-radius: var(--raio); border: 2px solid var(--borda); background: #fff; font-weight: 700; font-size: 17px; cursor: pointer; }
.formas button.ativo { border-color: var(--cor); background: var(--cor); color: #fff; }
.linhas-pagamento { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.linha-pagamento { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--cor-clara); border-radius: 10px; font-weight: 600; }
.linha-pagamento button { border: 0; background: none; color: var(--vermelho); font-size: 20px; cursor: pointer; }
.troco { font-size: 26px; font-weight: 800; color: var(--verde); }
.ajustes { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }

/* ---------- Pessoa (cor de cada funcionário) ---------- */
.chip-pessoa {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 8px;
  font-weight: 700; font-size: 14px; color: #1f2933; border: 1px solid rgba(0,0,0,.08); white-space: nowrap;
}
.filtro-pessoas { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filtro-pessoas button {
  border: 2px solid transparent; border-radius: 10px; padding: 6px 14px; font-weight: 700; font-size: 15px;
  cursor: pointer; color: #1f2933; background: #eceff1;
}
.filtro-pessoas button.ativo { border-color: var(--texto); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.amostras-cor { display: flex; gap: 8px; flex-wrap: wrap; }
.amostras-cor button { width: 40px; height: 40px; border-radius: 10px; border: 2px solid rgba(0,0,0,.1); cursor: pointer; }
.amostras-cor button.ativo { border: 3px solid var(--texto); }

/* Botão de almoço no topo */
.botao-almoco { border: 2px solid rgba(255,255,255,.6); background: transparent; color: #fff; border-radius: 20px;
  padding: 6px 14px; font-weight: 600; cursor: pointer; margin-right: 8px; }
.botao-almoco.ativo { background: #fff59d; color: #5d4037; border-color: #fff59d; }
@media print { .botao-almoco { display: none; } }
.lista-permissoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; max-height: 60vh; overflow-y: auto; }
.grupo-permissoes { border: 2px solid var(--borda); border-radius: var(--raio); padding: 8px 12px; margin: 0; }
.grupo-permissoes legend { font-weight: 700; color: var(--cor-escura); padding: 0 6px; }
.grupo-permissoes .marcar { margin: 6px 0; font-size: 15px; }
.modal.largo.permissoes { max-width: 860px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.permissoes .lista-permissoes { flex: 1; min-height: 0; max-height: none; }
.grupo-permissoes .marcar input { flex: 0 0 auto; width: 20px; height: 20px; accent-color: var(--cor); }
.aviso-transferencias { position: fixed; right: 16px; bottom: 16px; z-index: 90; max-width: 380px; background: #fff;
  border: 2px solid var(--cor); border-radius: var(--raio); box-shadow: 0 8px 30px rgba(0,0,0,.25); padding: 12px 14px; }
.aviso-transferencias ul { margin: 6px 0 0; padding-left: 18px; }
.aviso-transferencias li { margin-bottom: 4px; }
