/* ============ Sistema de Checklists — estilo base ============ */
:root {
  --azul: #1d4ed8; --azul-escuro: #1e3a8a; --fundo: #f1f5f9; --card: #ffffff;
  --texto: #0f172a; --cinza: #64748b; --borda: #e2e8f0;
  --verde: #16a34a; --vermelho: #dc2626; --laranja: #d97706; --raio: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--fundo); color: var(--texto); font-size: 15px;
}
h1, h2, h3 { margin: 0 0 .5em; }
h2 { font-size: 1.4rem; }
a { color: var(--azul); text-decoration: none; }
.oculto { display: none !important; }
.muted { color: var(--cinza); font-size: .85em; }

/* ---- login ---- */
.tela-login { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px; }
.login-box { background: var(--card); border-radius: var(--raio); padding: 32px; width: 100%; max-width: 380px; box-shadow: 0 8px 30px rgba(2,6,23,.08); }
.login-box h1 { text-align: center; color: var(--azul-escuro); }
.login-box .sub { text-align: center; color: var(--cinza); margin-top: -8px; }

/* ---- formulários ---- */
label { display: block; margin-bottom: 14px; font-weight: 600; font-size: .9em; }
input, select, textarea {
  width: 100%; padding: 11px 12px; margin-top: 5px; border: 1px solid var(--borda);
  border-radius: 8px; font-size: 1rem; font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--azul); border-color: var(--azul); }
.btn {
  display: inline-block; border: 0; border-radius: 8px; padding: 10px 18px; font-size: 1rem;
  font-weight: 600; cursor: pointer; background: #e2e8f0; color: var(--texto);
}
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primario { background: var(--azul); color: #fff; }
.btn-perigo { background: var(--vermelho); color: #fff; }
.btn-claro { background: #fff; border: 1px solid var(--borda); }
.btn-grande { width: 100%; padding: 14px; font-size: 1.05rem; }
.btn-mini { padding: 5px 10px; font-size: .85rem; }
.alerta { background: #fef2f2; color: var(--vermelho); border: 1px solid #fecaca; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; white-space: pre-wrap; }
.sucesso { background: #f0fdf4; color: var(--verde); border-color: #bbf7d0; }

/* ---- toast não-bloqueante ---- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  padding: 11px 18px; border-radius: 8px; font-size: .92rem; font-weight: 600;
  box-shadow: 0 4px 14px rgba(2,6,23,.14); opacity: 1; pointer-events: none;
  transition: opacity .3s ease;
}
.toast.toast-ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.toast.toast-erro { background: #fef2f2; color: var(--vermelho); border: 1px solid #fecaca; }
.toast.toast-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.toast.saindo { opacity: 0; }

/* ---- pergunta informativa ---- */
.pergunta-informativa { background: #eff6ff; }

/* ---- faixa de aviso de homologação ---- */
.faixa-homolog {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: #fef3c7; color: var(--laranja); border-bottom: 1px solid #fcd34d;
  font-size: 12px; font-weight: 600; text-align: center; padding: 4px;
}
body.com-faixa-homolog { padding-top: 24px; }

/* ---- layout do painel ---- */
.layout { display: flex; min-height: 100vh; }
.menu {
  width: 230px; background: var(--azul-escuro); color: #cbd5e1; padding: 18px 0;
  display: flex; flex-direction: column; gap: 2px; flex-shrink: 0;
}
.menu .logo { color: #fff; font-size: 1.15rem; font-weight: 700; padding: 0 18px 14px; }
.menu a { color: #cbd5e1; padding: 11px 18px; display: block; border-left: 3px solid transparent; }
.menu a.ativo, .menu a:hover { background: rgba(255,255,255,.08); color: #fff; border-left-color: #60a5fa; }
.menu .rodape { margin-top: auto; padding: 14px 18px; font-size: .82em; border-top: 1px solid rgba(255,255,255,.15); }
.conteudo { flex: 1; padding: 24px; max-width: 1200px; }
.topo-mobile { display: none; }

@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .menu { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 8px; position: sticky; top: 0; z-index: 50; }
  body.com-faixa-homolog .menu { top: 24px; } /* não deixar o menu grudar sob a faixa */
  .menu .logo { display: none; }
  .menu a { padding: 9px 12px; font-size: .9em; border-left: 0; border-radius: 6px; }
  .menu .rodape { margin: 0; border: 0; padding: 9px 12px; }
  .conteudo { padding: 14px; }
}

/* ---- cards / tabelas ---- */
.card { background: var(--card); border-radius: var(--raio); padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(2,6,23,.06); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border-radius: var(--raio); padding: 16px; text-align: center; box-shadow: 0 1px 3px rgba(2,6,23,.06); }
.kpi .num { font-size: 1.9rem; font-weight: 800; color: var(--azul-escuro); }
.kpi .rotulo { color: var(--cinza); font-size: .82em; }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--raio); overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--borda); font-size: .92em; }
th { background: #f8fafc; color: var(--cinza); font-size: .8em; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #f8fafc; }
.tabela-scroll { overflow-x: auto; border-radius: var(--raio); box-shadow: 0 1px 3px rgba(2,6,23,.06); }

.tag { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78em; font-weight: 700; }
.tag-verde { background: #dcfce7; color: #166534; }
.tag-vermelho { background: #fee2e2; color: #991b1b; }
.tag-laranja { background: #fef3c7; color: #92400e; }
.tag-azul { background: #dbeafe; color: #1e40af; }
.tag-cinza { background: #e2e8f0; color: #475569; }

.barra-acoes { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.filtros label { margin-bottom: 0; }

/* ---- modal ---- */
.modal-fundo { position: fixed; inset: 0; background: rgba(2,6,23,.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 14px; }
.modal { background: #fff; border-radius: var(--raio); padding: 22px; width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; }
.modal h3 { margin-bottom: 14px; }
.modal .acoes { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.linha-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-linha { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-bottom: 8px; }
.check-linha input { width: auto; margin: 0; }

/* ---- termos de uso (modal bloqueante LGPD) ---- */
.termos-scroll {
  max-height: 48vh; overflow-y: auto; border: 1px solid var(--borda); border-radius: 8px;
  padding: 12px 14px; background: #f8fafc; margin-bottom: 12px;
}
.termos-scroll h4 { margin: 12px 0 6px; }
.termos-scroll h4:first-child { margin-top: 0; }
.pre-linha { white-space: pre-wrap; font-size: .9em; margin: 0 0 8px; }
.aviso-homologacao {
  background: #fef3c7; color: #92400e; border: 1px solid #fde68a;
  padding: 8px 12px; border-radius: 8px; font-size: .88em; font-weight: 600; margin-bottom: 12px;
}

/* ---- preenchimento (mobile-first) ---- */
.preencher { max-width: 640px; margin: 0 auto; }
.pergunta-card { background: var(--card); border-radius: var(--raio); padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(2,6,23,.06); }
.pergunta-card .titulo { font-weight: 700; margin-bottom: 10px; }
.pergunta-card .obrig { color: var(--vermelho); }
.opcoes-botoes { display: flex; gap: 8px; flex-wrap: wrap; }
.opcao-btn {
  flex: 1; min-width: 90px; padding: 13px 10px; border: 2px solid var(--borda); border-radius: 8px;
  background: #fff; font-size: 1rem; font-weight: 600; cursor: pointer; text-align: center;
}
.opcao-btn.sel { border-color: var(--azul); background: #dbeafe; color: var(--azul-escuro); }
.opcao-btn.sel-na { border-color: var(--cinza); background: #e2e8f0; }
.fotos-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fotos-row img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; border: 1px solid var(--borda); }
.foto-thumb { position: relative; }
.foto-thumb button { position: absolute; top: -6px; right: -6px; background: var(--vermelho); color: #fff; border: 0; border-radius: 99px; width: 44px; height: 44px; min-width: 44px; min-height: 44px; cursor: pointer; font-size: 16px; line-height: 1; transform: translate(12px, -12px); }
canvas.assinatura { width: 100%; height: 170px; border: 2px dashed var(--borda); border-radius: 8px; background: #fff; touch-action: none; }
.rodape-envio { position: sticky; bottom: 0; background: var(--fundo); padding: 12px 0; display: flex; gap: 10px; }
.rodape-envio .btn { flex: 1; padding: 14px; }
.info-sla { font-size: .85em; color: var(--cinza); }

/* ---- lista de tarefas (operacional) ---- */
.tarefa {
  background: var(--card); border-radius: var(--raio); padding: 16px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  box-shadow: 0 1px 3px rgba(2,6,23,.06); cursor: pointer;
}
.tarefa:active { transform: scale(.99); }
.tarefa .nome { font-weight: 700; }

/* ---- barras simples do dashboard ---- */
.barras { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.barras .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.barras .bar { width: 100%; background: var(--azul); border-radius: 4px 4px 0 0; min-height: 3px; }
.barras .leg { font-size: .62em; color: var(--cinza); transform: rotate(-45deg); white-space: nowrap; }

/* ---- relatório / impressão ---- */
.relatorio .cab { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-bottom: 2px solid var(--texto); padding-bottom: 10px; margin-bottom: 14px; }
.relatorio table { box-shadow: none; }
.conf-num { font-size: 2.2rem; font-weight: 800; }
@media print {
  .menu, .barra-acoes, .topo-mobile, .nao-imprimir, .faixa-homolog { display: none !important; }
  body { background: #fff; }
  body.com-faixa-homolog { padding-top: 0; }
  .conteudo { padding: 0; max-width: none; }
  .card, table { box-shadow: none; border: 1px solid #ccc; }
  .card { page-break-inside: avoid; }
  tr { page-break-inside: avoid; }
  .foto-thumb { page-break-inside: avoid; }
}

/* ---- utilitário: botão de foto com alvo 44px ---- */
.btn-foto { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
