/* ============================================================
   LOGICHECK PRO — Estilos globais
   Identidade visual MULTITEINER (extraída de multiteiner.com.br):
   azul principal #04478d | azul escuro #032e5b
   amarelo #ffc806 | azul claro #0397d6
   ============================================================ */

:root {
  --marinho: #032e5b;
  --azul: #04478d;
  --azul-claro: #0397d6;
  --amarelo: #ffc806;
  --verde: #2e7d32;
  --vermelho: #d32f2f;
  --cinza: #6b7280;
  --cinza-claro: #9aa3b2;
  --fundo: #eef1f6;
  --branco: #ffffff;
  --borda: #dfe4ec;
  --texto: #1f2937;
  --sombra: 0 1px 3px rgba(3, 46, 91, 0.08), 0 4px 14px rgba(3, 46, 91, 0.07);
  --raio: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
}

body {
  font-family: "Segoe UI", -apple-system, Roboto, Arial, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============ ÍCONES SVG ============ */
svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============ SISTEMA DE TELAS (SPA) ============ */
.tela {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  max-width: 480px;          /* simula largura de celular no desktop */
  margin: 0 auto;
  background: var(--fundo);
  box-shadow: 0 0 32px rgba(3, 46, 91, 0.10);
}

.tela.ativa {
  display: flex;
}

.oculto {
  display: none !important;
}

/* ============ CABEÇALHO PADRÃO ============ */
.topo {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--marinho) 0%, var(--azul) 100%);
  color: var(--branco);
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 3px solid var(--amarelo);
}

.logo-topo {
  height: 28px;
  flex-shrink: 0;
}

.topo-titulo {
  flex: 1;
  min-width: 0;
}

.topo-titulo h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topo-saudacao {
  font-size: 0.95rem;
  font-weight: 600;
}

.topo-data {
  font-size: 0.72rem;
  opacity: 0.75;
  text-transform: capitalize;
}

.btn-icone {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--branco);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-icone svg {
  width: 19px;
  height: 19px;
}

.btn-icone:active {
  background: rgba(255, 255, 255, 0.28);
}

.conteudo {
  flex: 1;
  padding: 20px 16px 28px;
}

/* ============ TELA DE LOGIN ============ */
#tela-login {
  background:
    repeating-linear-gradient(
      -55deg,
      transparent 0 44px,
      rgba(255, 255, 255, 0.025) 44px 88px
    ),
    linear-gradient(165deg, var(--marinho) 0%, #043a72 55%, var(--azul) 100%);
  justify-content: center;
}

.login-wrapper {
  padding: 40px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.login-logo {
  text-align: center;
  color: var(--branco);
}

.logo-multiteiner {
  max-width: 200px;
  width: 56%;
}

.login-divisor {
  width: 44px;
  height: 3px;
  background: var(--amarelo);
  border-radius: 2px;
  margin: 16px auto 14px;
}

.login-logo h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 3px;
}

.login-logo h1 span {
  color: var(--amarelo);
}

.login-logo p {
  font-size: 0.82rem;
  opacity: 0.75;
  margin-top: 6px;
  letter-spacing: 0.4px;
}

.login-form {
  background: var(--branco);
  border-radius: var(--raio);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.form-titulo {
  font-size: 1.05rem;
  color: var(--marinho);
  font-weight: 700;
}

.form-subtitulo {
  font-size: 0.8rem;
  color: var(--cinza);
  margin-top: -12px;
  margin-bottom: 4px;
}

/* ============ CAMPOS DE FORMULÁRIO ============ */
.campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.campo label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--azul);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.campo-input {
  position: relative;
  display: flex;
  align-items: center;
}

.campo-icone {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--cinza-claro);
  pointer-events: none;
}

.campo input,
.campo select,
.campo textarea {
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  padding: 13px;
  font-size: 0.98rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafbfd;
  color: var(--texto);
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  border-color: var(--azul);
  background: var(--branco);
  box-shadow: 0 0 0 3px rgba(4, 71, 141, 0.12);
}

.campo input::placeholder {
  color: var(--cinza-claro);
}

/* campos com ícone interno (após a regra genérica, para o recuo prevalecer) */
/* Campos com ícone interno.
   Especificidade alta de propósito: precisa vencer a regra genérica
   `.campo input` e também a do Modo Pátio, que redefinem o padding
   inteiro (shorthand) e zerariam este recuo, deixando o ícone por
   cima do texto digitado. */
.campo .campo-input input,
body.modo-patio .campo .campo-input input {
  width: 100%;
  padding-left: 44px;
}

.msg-erro {
  color: var(--vermelho);
  font-size: 0.85rem;
  text-align: center;
  background: #fdecea;
  border: 1px solid #f5c6c2;
  border-radius: 8px;
  padding: 9px;
}

.versao {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
  letter-spacing: 0.4px;
}

/* ============ BOTÕES ============ */
.btn {
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 0.98rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.05s;
}

.btn:active {
  transform: scale(0.98);
  filter: brightness(0.94);
}

.btn-primario {
  background: var(--amarelo);
  color: var(--marinho);
  box-shadow: 0 3px 10px rgba(255, 200, 6, 0.35);
}

.btn-link {
  background: none;
  border: none;
  color: var(--azul);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  padding: 4px;
}

.btn-link:active {
  text-decoration: underline;
}

/* ============ HOME — SEÇÕES E CARDS ============ */
.secao-titulo {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cinza);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 22px 4px 10px;
}

.secao-titulo:first-child {
  margin-top: 0;
}

/* Cartão de ação principal (largura total) */
.card-acao {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: var(--sombra);
  transition: transform 0.1s, box-shadow 0.15s;
}

.card-acao:active {
  transform: scale(0.985);
}

.card-acao-texto {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.card-acao-texto strong {
  font-size: 0.98rem;
  color: var(--marinho);
  font-weight: 700;
}

.card-acao-texto small {
  font-size: 0.78rem;
  color: var(--cinza);
}

.card-seta {
  width: 18px;
  height: 18px;
  color: var(--cinza-claro);
  flex-shrink: 0;
}

/* Selo de ícone colorido */
.badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.badge svg {
  width: 23px;
  height: 23px;
}

.badge-amarelo    { background: var(--amarelo); color: var(--marinho); }
.badge-azul       { background: var(--azul); color: var(--branco); }
.badge-azul-claro { background: var(--azul-claro); color: var(--branco); }
.badge-marinho    { background: var(--marinho); color: var(--branco); }

/* Grade de blocos menores */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.tile {
  border: 1px solid var(--borda);
  background: var(--branco);
  border-radius: var(--raio);
  padding: 16px 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--sombra);
  transition: transform 0.1s;
}

.tile:active {
  transform: scale(0.96);
}

.tile .badge {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.tile .badge svg {
  width: 20px;
  height: 20px;
}

.tile-texto {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--marinho);
  text-align: center;
  line-height: 1.25;
}

/* ============ WIZARD — INDICADOR DE ETAPAS ============ */
.wizard-passos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--branco);
  border-bottom: 1px solid var(--borda);
  padding: 14px 18px;
}

.passo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.passo-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--fundo);
  color: var(--cinza);
  border: 2px solid var(--borda);
  transition: all 0.2s;
}

.passo-rotulo {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--cinza);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.passo.ativo .passo-num {
  background: var(--azul);
  border-color: var(--azul);
  color: var(--branco);
}

.passo.ativo .passo-rotulo {
  color: var(--azul);
}

.passo.feito .passo-num {
  background: var(--amarelo);
  border-color: var(--amarelo);
  color: var(--marinho);
}

.passo-linha {
  flex: 1;
  max-width: 46px;
  height: 2px;
  background: var(--borda);
  margin-bottom: 16px;
}

/* ============ ETAPAS ============ */
.etapa {
  display: none;
}

.etapa.ativa {
  display: block;
}

/* ============ CARTÃO GENÉRICO ============ */
.cartao {
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 20px 18px;
  box-shadow: var(--sombra);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cartao-titulo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--marinho);
}

.cartao-subtitulo {
  font-size: 0.82rem;
  color: var(--cinza);
  margin-top: -10px;
}

/* ============ RODAPÉ DAS ETAPAS ============ */
.rodape-etapa {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.btn-largo {
  flex: 1;
}

.btn-secundario {
  background: var(--branco);
  color: var(--azul);
  border: 1.5px solid var(--borda);
  padding-left: 22px;
  padding-right: 22px;
}

/* ============ PROGRESSO DOS ITENS ============ */
.progresso-itens {
  margin-bottom: 14px;
}

.progresso-itens span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cinza);
}

.progresso-barra {
  height: 6px;
  background: var(--borda);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.progresso-preenchido {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--azul), var(--azul-claro));
  border-radius: 3px;
  transition: width 0.25s;
}

/* ============ ITEM DO CHECKLIST ============ */
.item-checklist {
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--sombra);
}

.item-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.item-nome {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--texto);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* selo com o estado do item na retirada (exibido na devolução) */
.item-antes {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border-radius: 5px;
  padding: 2px 7px;
  width: fit-content;
}

.item-antes.ok {
  background: #e8f5e9;
  color: var(--verde);
}

.item-antes.nc {
  background: #fdecea;
  color: var(--vermelho);
}

/* info do checklist de retirada vinculado */
.info-referencia {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--azul);
  background: #eef4fb;
  border: 1px solid #c4d7ec;
  border-radius: 8px;
  padding: 8px 11px;
  margin-top: 6px;
}

input[readonly] {
  background: #eef1f6 !important;
  color: var(--cinza) !important;
}

.seg {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--borda);
  background: var(--branco);
  color: var(--cinza);
  border-radius: 10px;
  min-width: 42px;
  height: 38px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.seg-btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 3;
}

/* V verde e X vermelho sempre identificáveis */
.seg-c {
  border-color: #bfe3c2;
  color: var(--verde);
}

.seg-nc {
  border-color: #f2c8c4;
  color: var(--vermelho);
}

.seg-c.ativo {
  background: var(--verde);
  border-color: var(--verde);
  color: var(--branco);
}

.seg-nc.ativo {
  background: var(--vermelho);
  border-color: var(--vermelho);
  color: var(--branco);
}

/* detalhes do item (comentário + foto) */
.item-detalhe {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--borda);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-detalhe textarea {
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  background: #fafbfd;
}

.item-detalhe textarea:focus {
  border-color: var(--azul);
  background: var(--branco);
}

.detalhe-acoes {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-foto {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid var(--borda);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--azul);
  cursor: pointer;
  background: var(--branco);
}

.btn-foto svg {
  width: 16px;
  height: 16px;
}

.foto-preview {
  position: relative;
  display: inline-flex;
}

.foto-preview img {
  height: 52px;
  border-radius: 8px;
  border: 1px solid var(--borda);
}

.foto-remover {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--vermelho);
  color: var(--branco);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.foto-remover svg {
  width: 11px;
  height: 11px;
  stroke-width: 3;
}

/* botão de detalhes (comentário/foto/vídeo) no item */
.btn-detalhes {
  color: var(--azul);
  border-color: #c4d7ec;
}

.btn-detalhes svg {
  stroke-width: 2.2;
}

/* chip do vídeo anexado */
.video-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eef4fb;
  border: 1px solid #c4d7ec;
  color: var(--azul);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.video-chip svg {
  width: 15px;
  height: 15px;
}

.video-remover {
  border: none;
  background: var(--vermelho);
  color: var(--branco);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.video-remover svg {
  width: 10px;
  height: 10px;
  stroke-width: 3;
}

/* ============ FOTOS DO VEÍCULO (ENTREGA) ============ */
.cartao-espaco {
  margin-top: 14px;
}

.fotos-grade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.foto-slot {
  border: 2px dashed var(--borda);
  border-radius: 12px;
  background: #fafbfd;
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
}

.foto-slot:active {
  border-color: var(--azul);
}

.foto-slot-vazio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--cinza);
  font-size: 0.76rem;
  font-weight: 600;
  width: 100%;
}

.foto-slot-vazio svg {
  width: 24px;
  height: 24px;
  color: var(--cinza-claro);
}

.foto-slot.preenchido {
  border-style: solid;
  border-color: var(--verde);
  padding: 0;
  position: relative;
}

.foto-slot.preenchido .foto-slot-vazio {
  gap: 0;
}

.foto-slot.preenchido img {
  width: 100%;
  height: 108px;
  object-fit: cover;
  display: block;
}

.foto-slot-rotulo {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(3, 46, 91, 0.75);
  color: var(--branco);
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
  padding: 4px;
}

/* ============ TERMO DE RECEBIMENTO ============ */
.termo-recebimento {
  font-size: 0.82rem;
  color: var(--texto);
  line-height: 1.55;
  background: #fff8dc;
  border: 1px solid #f0e0a0;
  border-left: 4px solid var(--amarelo);
  border-radius: 8px;
  padding: 12px 14px;
}

/* ============ ASSINATURA ============ */
.assinatura-canvas {
  width: 100%;
  height: 200px;
  border: 2px dashed var(--borda);
  border-radius: 12px;
  background:
    linear-gradient(to top, transparent 38px, transparent 39px),
    #fafbfd;
  touch-action: none;
  cursor: crosshair;
}

.ico-inline {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

/* ============ SELETOR RETIRADA / ENTREGA ============ */
.op-toggle {
  display: flex;
  gap: 10px;
}

.op-btn {
  flex: 1;
  border: 1.5px solid var(--borda);
  background: var(--branco);
  color: var(--cinza);
  border-radius: 10px;
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.15s;
}

.op-btn:active {
  transform: scale(0.98);
}

.op-btn.ativo {
  background: var(--azul);
  border-color: var(--azul);
  color: var(--branco);
}

/* remover foto do interior */
.foto-slot {
  position: relative;
}

.foto-slot-remover {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--branco);
  background: var(--vermelho);
  color: var(--branco);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.foto-slot-remover svg {
  width: 11px;
  height: 11px;
  stroke-width: 3;
}

/* ============ MAPA DO CONTÊINER (SVG) ============ */
.mapa-svg {
  background: #fafbfd;
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: 8px;
}

.mapa-svg svg {
  width: 100%;
  height: auto;
  display: block;
}

.face {
  cursor: pointer;
  stroke: var(--marinho);
  stroke-width: 1.5;
  transition: fill 0.15s;
}

.face-teto    { fill: #7ba7d4; }
.face-frente  { fill: #4a7fb8; }
.face-lateral { fill: #04478d; }

.face:hover { opacity: 0.85; }

.face-selecionada {
  stroke: var(--amarelo);
  stroke-width: 3;
}

.face-avariada {
  fill: var(--vermelho) !important;
  fill-opacity: 0.75;
}

.corrugacao-linha {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 4;
  pointer-events: none;
}

/* ============ CHIPS DE ÁREA ============ */
.mapa-areas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.chip-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1.5px solid var(--borda);
  background: var(--branco);
  color: var(--marinho);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.chip-area:active {
  transform: scale(0.97);
}

.chip-area.selecionado {
  border-color: var(--azul);
  background: #eef4fb;
}

.chip-area.com-avaria {
  border-color: #f2c8c4;
}

.chip-badge {
  background: var(--vermelho);
  color: var(--branco);
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* ============ AVARIAS ============ */
.sem-avarias {
  font-size: 0.83rem;
  color: var(--cinza);
  text-align: center;
  padding: 10px 0;
}

.avaria-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--borda);
  border-left: 4px solid var(--vermelho);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fffafa;
}

.avaria-card img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--borda);
}

.avaria-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.avaria-info strong {
  font-size: 0.88rem;
  color: var(--marinho);
}

.avaria-info small {
  font-size: 0.76rem;
  color: var(--cinza);
}

.avaria-remover {
  border: none;
  background: none;
  color: var(--vermelho);
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}

.avaria-remover svg {
  width: 17px;
  height: 17px;
}

.form-avaria {
  border-top: 1px dashed var(--borda);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-avaria .rodape-etapa {
  margin-top: 4px;
}

.resumo-avarias {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cinza);
  padding: 12px;
  margin-top: 14px;
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: 10px;
}

/* ============ ASSINATURA DUPLA ============ */
.assinatura-menor {
  height: 150px;
}

/* ============ TELA DE SUCESSO ============ */
.sucesso-box {
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  text-align: center;
  padding: 44px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sucesso-icone {
  width: 62px;
  height: 62px;
  color: var(--verde);
  stroke-width: 1.6;
}

.sucesso-box h3 {
  font-size: 1.15rem;
  color: var(--marinho);
}

.sucesso-box p {
  font-size: 0.85rem;
  color: var(--cinza);
}

.sucesso-acoes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
}

/* ============ HISTÓRICO — FILTROS E LISTA ============ */
.filtros-linha {
  display: flex;
  gap: 8px;
}

.filtros-linha select,
.filtros-linha input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.85rem;
  font-family: inherit;
  background: #fafbfd;
  outline: none;
}

.filtros-linha .btn {
  padding: 10px 14px;
  font-size: 0.85rem;
}

.hi-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 13px 14px;
  margin-top: 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: var(--sombra);
  transition: transform 0.1s;
}

.hi-card:active {
  transform: scale(0.985);
}

.hi-card .badge {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.hi-card .badge svg {
  width: 20px;
  height: 20px;
}

.hi-card-texto {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hi-card-texto strong {
  font-size: 0.9rem;
  color: var(--marinho);
}

.hi-card-texto small {
  font-size: 0.74rem;
  color: var(--cinza);
}

.hi-card-direita {
  flex-shrink: 0;
}

.chip-status {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 6px;
  padding: 4px 8px;
}

.chip-status.pendente {
  background: #fff4d6;
  color: #8a6d00;
  border: 1px solid #f0dc9a;
}

.chip-status.sincronizado {
  background: #e8f5e9;
  color: var(--verde);
  border: 1px solid #bfe3c2;
}

.btn-voltar-vista {
  margin-bottom: 14px;
}

/* ============ HISTÓRICO — DETALHE ============ */
.linha-dado {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.86rem;
  padding: 7px 0;
  border-bottom: 1px dashed var(--borda);
}

.linha-dado:last-child {
  border-bottom: none;
}

.linha-dado span {
  color: var(--cinza);
}

.linha-dado strong {
  color: var(--marinho);
  text-align: right;
}

.fotos-detalhe {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fotos-detalhe figure {
  margin: 0;
}

.fotos-detalhe img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--borda);
  display: block;
}

.fotos-detalhe figcaption {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cinza);
  text-align: center;
  margin-top: 4px;
}

.itens-detalhe {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-detalhe-linha {
  border: 1px solid var(--borda);
  border-radius: 10px;
  padding: 9px 12px;
}

.item-detalhe-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--texto);
}

.item-detalhe-obs {
  display: block;
  font-size: 0.78rem;
  color: var(--cinza);
  margin-top: 4px;
}

.item-detalhe-foto {
  height: 62px;
  border-radius: 8px;
  border: 1px solid var(--borda);
  margin-top: 6px;
}

.estado-badge {
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 6px;
  padding: 3px 9px;
  background: var(--fundo);
  color: var(--cinza);
}

.estado-badge.ok {
  background: #e8f5e9;
  color: var(--verde);
}

.estado-badge.nc {
  background: #fdecea;
  color: var(--vermelho);
}

.assinatura-img {
  width: 100%;
  max-height: 130px;
  object-fit: contain;
  background: #fafbfd;
  border: 1px solid var(--borda);
  border-radius: 10px;
}

.btn-video-play {
  display: inline-flex;
  margin-top: 6px;
  border: 1.5px solid #c4d7ec;
  background: #eef4fb;
  color: var(--azul);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.video-player {
  width: 100%;
  border-radius: 10px;
  margin-top: 6px;
  background: #000;
}

/* ============ HISTÓRICO — COMPARAÇÃO ============ */
.comp-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.86rem;
}

.comp-item-nome {
  font-weight: 600;
  color: var(--texto);
}

.comp-item-estados {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cinza);
}

.comp-item.mudou-pior {
  background: #fdecea;
  border: 1px solid #f5c6c2;
}

.comp-item.mudou-melhor {
  background: #e8f5e9;
  border: 1px solid #bfe3c2;
}

.alerta-novo {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: var(--vermelho);
  color: var(--branco);
  border-radius: 5px;
  padding: 3px 6px;
}

.comp-par {
  margin-bottom: 14px;
}

.comp-par-rotulo {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--marinho);
  margin-bottom: 6px;
}

.comp-par-fotos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.comp-par-fotos figure {
  margin: 0;
}

.comp-par-fotos img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--borda);
  display: block;
}

.comp-par-fotos figcaption {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cinza);
  text-align: center;
  margin-top: 4px;
}

.sem-foto {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90px;
  border: 2px dashed var(--borda);
  border-radius: 10px;
  font-size: 0.75rem;
  color: var(--cinza-claro);
}

/* ============ SINCRONIZAÇÃO ============ */
.sc-online {
  color: var(--verde);
  font-weight: 700;
}

.sc-offline {
  color: var(--vermelho);
  font-weight: 700;
}

.texto-info {
  font-size: 0.85rem;
  color: var(--texto);
  line-height: 1.6;
}

/* selo de pendências no bloco da Home */
.tile {
  position: relative;
}

.tile-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  background: var(--vermelho);
  color: var(--branco);
  font-size: 0.66rem;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* aviso flutuante */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--marinho);
  color: var(--branco);
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 20px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  z-index: 100;
  max-width: 90%;
  text-align: center;
}

/* ============ DASHBOARD ============ */
.stats-grade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-tile {
  position: relative;
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: 12px;
  box-shadow: var(--sombra);
  padding: 14px 14px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.stat-acento {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.acento-azul     { background: var(--azul-claro); }
.acento-amarelo  { background: var(--amarelo); }
.acento-verde    { background: var(--verde); }
.acento-vermelho { background: var(--vermelho); }

.stat-num {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--marinho);
  line-height: 1.1;
}

.stat-rotulo {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cinza);
}

.db-svg {
  width: 100%;
  height: auto;
  display: block;
}

.db-eixo {
  stroke: var(--borda);
  stroke-width: 1;
}

.db-dia {
  font-size: 10px;
  font-weight: 600;
  fill: var(--cinza-claro);
  text-anchor: middle;
  text-transform: capitalize;
}

.db-valor {
  font-size: 11px;
  font-weight: 700;
  fill: var(--texto);
  text-anchor: middle;
}

/* ============ LIGHTBOX (FOTO AMPLIADA) ============ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  overflow: hidden;
}

.lightbox img {
  max-width: 96%;
  max-height: 92%;
  border-radius: 8px;
  transition: transform 0.2s;
  cursor: zoom-in;
}

.lightbox img.ampliada {
  transform: scale(2.2);
  cursor: zoom-out;
}

/* fotos clicáveis do histórico */
.fotos-detalhe img,
.comp-par-fotos img,
.item-detalhe-foto,
.assinatura-img {
  cursor: zoom-in;
}

/* ============ ATALHOS DE PERÍODO (HISTÓRICO) ============ */
.filtros-linha + .filtros-linha,
.filtros-atalhos {
  margin-top: 8px;
}

.filtros-atalhos {
  display: flex;
  gap: 8px;
}

.atalho-chip {
  flex: 1;
  border: 1.5px solid var(--borda);
  background: var(--branco);
  color: var(--azul);
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.atalho-chip:active {
  background: #eef4fb;
  border-color: var(--azul);
}

/* ============ PREFERÊNCIAS ============ */
.pref-linha {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--texto);
  cursor: pointer;
}

.pref-linha small {
  font-weight: 400;
  font-size: 0.76rem;
  color: var(--cinza);
}

.pref-linha input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--azul);
  flex-shrink: 0;
  cursor: pointer;
}

/* ============ MODO PÁTIO (ALTO CONTRASTE) ============ */
body.modo-patio {
  --borda: #97a1b1;
  --cinza: #3d4552;
  --cinza-claro: #6b7280;
  font-size: 17px;
}

body.modo-patio .btn {
  padding: 18px;
  font-size: 1.08rem;
}

body.modo-patio .seg-btn {
  min-width: 52px;
  height: 48px;
  font-size: 0.95rem;
}

body.modo-patio .campo input,
body.modo-patio .campo select,
body.modo-patio .campo textarea {
  padding: 16px 13px;
  font-size: 1.05rem;
}

body.modo-patio .item-nome {
  font-size: 1.02rem;
}

body.modo-patio .menu-card,
body.modo-patio .tile,
body.modo-patio .card-acao,
body.modo-patio .cartao,
body.modo-patio .item-checklist {
  border-width: 2px;
}

body.modo-patio .op-btn {
  padding: 17px;
  font-size: 1.05rem;
}

/* ============ NOTIFICAÇÕES E MANUTENÇÃO ============ */
.btn-icone {
  position: relative;
}

.btn-icone .tile-badge {
  top: -6px;
  right: -6px;
}

.badge-vermelho {
  background: var(--vermelho);
  color: var(--branco);
}

.notif-alerta {
  border-left: 4px solid var(--vermelho);
}

.btn-baixa {
  padding: 9px 12px;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.usuario-acoes {
  display: flex;
  gap: 14px;
  margin-top: 6px;
}

.usuario-acoes .btn-link {
  font-size: 0.78rem;
  padding: 2px 0;
  text-decoration: none;
}

.btn-arquivo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ============ DOCUMENTO PDF (IMPRESSÃO) ============ */
#area-impressao {
  display: none;
}

@media print {
  /* só o documento aparece na impressão */
  body > *:not(#area-impressao) {
    display: none !important;
  }

  body {
    background: #fff;
  }

  #area-impressao {
    display: block;
    font-family: "Segoe UI", Arial, sans-serif;
    color: #1f2937;
    font-size: 11pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  @page {
    margin: 12mm;
  }
}

/* cabeçalho do documento */
.imp-cabecalho {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #032e5b;
  color: #fff;
  border-radius: 8px;
  padding: 14px 18px;
  border-bottom: 4px solid #ffc806;
}

.imp-cabecalho img {
  height: 34px;
}

.imp-cabecalho-texto {
  flex: 1;
}

.imp-cabecalho-texto h1 {
  font-size: 15pt;
  letter-spacing: 1.5px;
  margin: 0;
}

.imp-cabecalho-texto p {
  font-size: 10pt;
  opacity: 0.85;
  margin: 2px 0 0;
}

.imp-cabecalho-id {
  text-align: right;
  display: flex;
  flex-direction: column;
}

.imp-cabecalho-id strong {
  font-size: 12pt;
}

.imp-cabecalho-id span {
  font-size: 9pt;
  opacity: 0.85;
}

/* seções */
.imp-secao {
  font-size: 11.5pt;
  color: #032e5b;
  border-bottom: 2px solid #ffc806;
  padding-bottom: 4px;
  margin: 18px 0 8px;
  page-break-after: avoid;
}

/* tabela de dados */
.imp-dados {
  width: 100%;
  border-collapse: collapse;
}

.imp-dados td {
  border: 1px solid #d8dee9;
  padding: 6px 10px;
  font-size: 10pt;
}

.imp-rotulo {
  width: 38%;
  background: #f2f4f8;
  font-weight: 700;
  color: #032e5b;
}

/* fotos */
.imp-fotos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.imp-fotos figure {
  margin: 0;
  width: calc(50% - 4px);
  page-break-inside: avoid;
}

.imp-fotos img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border: 1px solid #d8dee9;
  border-radius: 6px;
}

.imp-fotos figcaption {
  font-size: 8.5pt;
  font-weight: 600;
  color: #6b7280;
  text-align: center;
  margin-top: 2px;
}

/* tabela de itens */
.imp-itens {
  width: 100%;
  border-collapse: collapse;
}

.imp-itens th {
  background: #032e5b;
  color: #fff;
  font-size: 9.5pt;
  padding: 6px 8px;
  text-align: left;
}

.imp-itens td {
  border: 1px solid #d8dee9;
  padding: 5px 8px;
  font-size: 9.5pt;
  vertical-align: middle;
}

.imp-itens tr {
  page-break-inside: avoid;
}

.imp-nc td {
  background: #fdecea;
}

.imp-estado {
  text-align: center;
  width: 52px;
}

.imp-ok {
  color: #2e7d32;
  font-weight: 800;
}

.imp-x {
  color: #d32f2f;
  font-weight: 800;
}

.imp-foto-celula {
  width: 78px;
  text-align: center;
}

.imp-foto-celula img {
  height: 46px;
  border-radius: 4px;
}

/* termo e assinaturas */
.imp-termo {
  font-size: 10pt;
  background: #fff8dc;
  border: 1px solid #f0e0a0;
  border-left: 4px solid #ffc806;
  border-radius: 6px;
  padding: 10px 12px;
  page-break-inside: avoid;
}

.imp-assinaturas {
  display: flex;
  gap: 30px;
  margin-top: 14px;
  page-break-inside: avoid;
}

.imp-assinatura {
  flex: 1;
  text-align: center;
}

.imp-assinatura img {
  max-height: 80px;
  max-width: 100%;
}

.imp-assinatura-linha {
  border-top: 1.5px solid #1f2937;
  margin: 4px 20px 6px;
}

.imp-assinatura span {
  font-size: 9.5pt;
  font-weight: 600;
}

/* rodapé */
.imp-rodape {
  margin-top: 22px;
  padding-top: 8px;
  border-top: 1px solid #d8dee9;
  font-size: 8pt;
  color: #6b7280;
  text-align: center;
}

/* ============ SCANNER DE QR CODE ============ */
.scanner {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.scanner video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-mira {
  position: relative;
  width: 230px;
  height: 230px;
  border: 3px solid var(--amarelo);
  border-radius: 18px;
  box-shadow: 0 0 0 3000px rgba(0, 0, 0, 0.45);
}

.scanner-dica {
  position: relative;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.scanner .btn {
  position: relative;
  min-width: 160px;
}

/* campo com botão de leitura QR */
.campo-scan {
  display: flex;
  gap: 8px;
}

.campo-scan select,
.campo-scan input {
  flex: 1;
  min-width: 0;
}

.btn-scan {
  width: 48px;
  border: 1.5px solid #c4d7ec;
  background: #eef4fb;
  color: var(--azul);
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-scan svg {
  width: 21px;
  height: 21px;
}

.btn-scan:active {
  background: #dcebfa;
}

/* ============ ETIQUETA QR (IMPRESSÃO) ============ */
.etiqueta {
  width: 300px;
  margin: 0 auto;
  border: 2px solid #032e5b;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  page-break-inside: avoid;
}

.etiqueta-topo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #032e5b;
  border-bottom: 3px solid #ffc806;
  padding: 10px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.etiqueta-topo img {
  height: 22px;
}

.etiqueta-topo span {
  color: #fff;
  font-size: 10pt;
  font-weight: 700;
  letter-spacing: 1px;
}

.etiqueta-qr {
  width: 220px;
  margin: 14px auto 6px;
  display: block;
}

.etiqueta h1 {
  font-size: 20pt;
  color: #032e5b;
  letter-spacing: 2px;
  margin: 4px 0 2px;
}

.etiqueta p {
  font-size: 10pt;
  color: #4b5563;
  margin: 0 0 6px;
}

.etiqueta small {
  display: block;
  font-size: 7pt;
  color: #9aa3b2;
  margin-bottom: 10px;
}

/* ============ ANÁLISE INTELIGENTE ============ */
.analise-resultado {
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 7px;
  padding: 6px 10px;
  margin-bottom: 6px;
}

.analise-resultado.ok {
  background: #e8f5e9;
  color: var(--verde);
  border: 1px solid #bfe3c2;
}

.analise-resultado.medio {
  background: #fff4d6;
  color: #8a6d00;
  border: 1px solid #f0dc9a;
}

.analise-resultado.alto {
  background: #fdecea;
  color: var(--vermelho);
  border: 1px solid #f5c6c2;
}

/* ============ PLACEHOLDER EM CONSTRUÇÃO ============ */
.em-construcao {
  text-align: center;
  color: var(--cinza);
  padding: 70px 20px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 2;
  background: var(--branco);
  border: 2px dashed var(--borda);
  border-radius: var(--raio);
}

.em-construcao small {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--cinza-claro);
}
