/* ===== Fonte ===== */
@font-face {
  font-family: "FuturaBkBT";
  src: url("fonts/FuturaBkBT.woff2") format("woff2"),
    url("fonts/FuturaBkBT.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

body,
input,
select,
textarea,
button {
  font-family: "FuturaBkBT", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

/* ===== Layout Base ===== */
body {
  margin: 0;
  background-color: #000;
  color: white;
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

/* ===== Botões de menu (mobile) ===== */
.menu-toggle {
  display: none;
  background-color: orange;
  color: black;
  border: none;
  padding: 10px 15px;
  font-weight: bold;
  cursor: pointer;
  position: fixed;
  top: 10px;
  left: 10px;
  border-radius: 6px;
  z-index: 1100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* ===== Menu lateral ===== */
nav.menu-lateral {
  width: 220px;
  background-color: #111;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  overflow-y: auto;
  border-right: 2px solid #333;
  transition: transform 0.3s ease;
  z-index: 1000;
}

nav.menu-lateral h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-weight: bold;
  font-size: 1.5rem;
  color: orange;
  user-select: none;
}

nav.menu-lateral ul {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
}

nav.menu-lateral ul li {
  margin-bottom: 12px;
  position: relative;
}

nav.menu-lateral ul li a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 4px;
  display: block;
  transition: background-color 0.3s ease;
  user-select: none;
}

nav.menu-lateral ul li a:hover,
nav.menu-lateral ul li a.active {
  background-color: orange;
  color: black;
}

nav.menu-lateral .sair {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid #333;
}

nav.menu-lateral .sair a {
  color: white;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 4px;
  display: block;
  transition: background-color 0.3s ease;
  text-decoration: none;
}

nav.menu-lateral .sair a:hover,
nav.menu-lateral .sair a.active {
  background-color: orange;
  color: black;
}

/* ===== Conteúdo principal ===== */
main.content {
  padding: 25px 30px 70px;
  overflow-y: auto;
  height: 100%;
  grid-column: 2;
  grid-row: 2;
}

h2 {
  margin-top: 0;
  margin-bottom: 20px;
  user-select: none;
}

/* ===== Pesquisa de Lote (Centralizado com Fieldset) ===== */
.pesquisa-lote {
  display: flex;
  align-items: flex-end;
  justify-content: left;
  /* gap: 15px; */
  /*margin-bottom: 20px; */
}

.pesquisa-lote .campo {
  min-width: 250px;
}

.pesquisa-lote button {
  white-space: nowrap;
  height: 38px;
  margin-top: 23px;
}

/* ===== Fieldsets ===== */
fieldset {
  background-color: #111;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 20px;
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.2);
}

legend {
  font-weight: bold;
  padding: 0 8px;
  color: orange;
  user-select: none;
  font-size: 1.1rem;
}

/* ===== Campos de formulário ===== */
.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 15px;
  align-items: center;
}

.campo {
  display: flex;
  flex-direction: column;
}

.campo label {
  margin-bottom: 4px;
  font-weight: 600;
  color: white;
}

.campo input,
.campo select,
.campo textarea {
  width: 100%;
  padding: 6px 10px;
  background-color: white;
  color: black;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  resize: vertical;
}

.col-span-2 {
  grid-column: span 2;
}

/* Estilo para campos com erro */
.erro-input {
  border: 2px solid #ff4d4d !important;
  background-color: #2a0000 !important;
  color: #ffb3b3 !important;
}

/* Estilo para mensagens de erro ao lado do campo */
.erro-msg {
  font-size: 0.85rem;
  color: #ff8080;
  margin-top: 4px;
  display: block;
}

/* Suporte visual para radios */
.campo-radio-vertical .erro-msg {
  margin-left: 6px;
  display: inline-block;
}

/* ===== Botões ===== */
button,
.actions button,
.botao-laranja {
  background-color: orange;
  color: black;
  padding: 10px 25px;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover,
.actions button:hover,
.botao-laranja:hover {
  background-color: #cc8400;
}

.botao-fechar {
  background-color: #666;
  color: white;
}

.botao-fechar:hover {
  background-color: #444;
}

.botoes-exportar .botao-laranja,
.dt-button.botao-laranja {
  background-color: orange !important;
  color: black !important;
  border: none;
  padding: 8px 14px;
  border-radius: 6px !important;
  font-weight: bold;
  font-family: "FuturaBkBT", sans-serif;
  cursor: pointer;
  margin-left: 8px;
  transition: background 0.3s;
}

.botoes-exportar .botao-laranja:hover,
.dt-button.botao-laranja:hover {
  background-color: #cc8400 !important;
}

/* === Campo de pesquisa DataTables (padrão Gulp!) === */
.dataTables_filter {
  float: right;
  margin-bottom: 10px;
}

.dataTables_filter label {
  color: #fff;
  font-family: "FuturaBkBT", sans-serif;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dataTables_filter input {
  background-color: #222;
  color: #fff;
  border: 1px solid #ff6600;
  border-radius: 6px;
  padding: 6px 12px;
  font-family: "FuturaBkBT", sans-serif;
  transition: all 0.2s ease;
}

.dataTables_filter input:focus {
  outline: none;
  box-shadow: 0 0 5px #ff6600;
}

/* === Botão "Imprimir Checklist" === */
.btn-imprimir {
  background-color: orange;
  color: black;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-family: "FuturaBkBT", sans-serif;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-imprimir:hover {
  background-color: #cc8400;
  transform: scale(1.05);
}

@media print {
  .btn-imprimir {
    display: none;
  }
}

/* ===== Mensagens de alerta ===== */
.sucesso {
  background-color: #d5ffcc;
  color: #13e600;
  border: 1px solid #95ff80;
  padding: 12px;
  font-weight: bold;
  margin-bottom: 20px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 255, 55, 0.3);
}

.erro {
  background-color: #ffcccc;
  color: #b30000;
  border: 1px solid #ff9999;
  padding: 12px;
  font-weight: bold;
  margin-bottom: 20px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(255, 0, 0, 0.3);
}

/* ===== Radios Conformidade ===== */
.campo-radio-vertical {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.radio-opcao {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  font-size: 1rem;
  white-space: nowrap;
}

.radio-opcao input[type="radio"] {
  transform: scale(1.2);
}

.radio-opcao .conforme {
  color: lime;
}

.radio-opcao .nconforme {
  color: red;
}

/* ===== Footer ===== */
.gulp-footer {
  position: fixed;
  bottom: 0;
  left: 220px; /* respeita menu lateral */
  right: 0;
  background-color: #111;
  color: #ccc;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-top: 1px solid #333;
  z-index: 900;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease;
  cursor: url("/assets/cursors/double-down-svgrepo-com.svg") 0 0, pointer;
  overflow: hidden;
}

.gulp-footer.minimizado {
  transform: translateY(calc(100% - 10px)); /* “afunda” */
  cursor: url("/assets/cursors/double-up-svgrepo-com.svg") 0 0, pointer;
  height: 8px;
}

.gulp-footer .footer-text {
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.3s ease;
}

.gulp-footer.minimizado .footer-text {
  opacity: 0;
  width: 0;
  pointer-events: none;
  user-select: none;
}

/* Responsivo: menu lateral escondido */
@media (max-width: 768px) {
  .gulp-footer {
    left: 0;
    width: 100%;
  }
}

/* Links de ação específicos */
.editar-link {
  color: #4fc3f7;
  margin-right: 10px;
}

.editar-link:hover {
  color: #29b6f6;
  text-decoration: underline;
}

.excluir-link {
  color: #ef5350;
}

.excluir-link:hover {
  color: #e53935;
  text-decoration: underline;
}

/* ===== Distribuição da dashboard ===== */
.cards {
  display: flex;
  flex-direction: column;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
  align-items: stretch;
}

.cards fieldset {
  height: 100%;
}

/* ===== Ajustes nas tabelas internas da dashboard ===== */
.tabela-box table {
  width: 100%;
  border-collapse: collapse;
}

.tabela-box th,
.tabela-box td {
  padding: 10px 15px;
  text-align: left;
  border-bottom: 1px solid #333;
  vertical-align: middle;
}

.tabela-box th {
  color: orange;
  font-size: 0.95rem;
  font-weight: bold;
}

.tabela-box td {
  color: white;
  word-break: break-word;
}

/* Evita que os textos fiquem colados nas bordas */
fieldset .tabela-box {
  padding-top: 10px;
}

/* Exemplo para filtros */
.filtros-relatorio {
  background: #111;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
.campo-filtro {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  text-transform: uppercase;
}
.btn-gulp {
  background-color: orange;
  border: none;
  color: black;
  font-weight: bold;
  padding: 0.5rem 1.2rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.25s ease;
}
.btn-gulp:hover {
  background-color: #e05500;
}
.titulo-principal {
  color: #ff6600;
  margin-bottom: 1rem;
}

.dataTables_length select {
  background-color: #111;
  color: white;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 4px 8px;
}

.dataTables_length select option {
  background-color: #111;
  color: white;
}

/* Esconder tabelas*/
.escondido {
  display: none;
}

/* Estilo para Autocompletar */
.autocomplete-lista {
  position: absolute;
  background: #222;
  color: #fff;
  border: 1px solid #444;
  border-radius: 4px;
  list-style: none;
  padding: 5px 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  width: 300px;
}

.autocomplete-lista li {
  padding: 8px 12px;
  cursor: pointer;
}

.autocomplete-lista li:hover {
  background-color: #ff6600;
  color: #000;
}

/* Regras específicas para impressão */
@media print {
  /* Esconder elementos que não devem aparecer */
  .sidebar,
  .menu,
  header,
  nav,
  #acoes-botoes,
  #btnLimpar,
  #btnPesquisar,
  #navegacao-resultados,
  fieldset:first-of-type,
  footer,
  .footer {
    display: none !important;
  }
}

/* Responsivo */
@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr !important;
  }

  .pesquisa-lote {
    flex-direction: column;
    align-items: stretch;
  }

  .pesquisa-lote button {
    width: 100%;
  }

  .actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .actions button {
    flex: none;
    min-width: 120px;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
  }

  .menu-toggle {
    display: block;
  }

  nav.menu-lateral {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background-color: #111;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
  }

  nav.menu-lateral.aberto {
    transform: translateX(0);
  }

  main.content {
    padding: 25px 15px 70px;
    overflow-y: auto;
  }

  .form-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .form-row .campo {
    min-width: 100%;
  }

  .form-row input,
  .form-row select,
  .form-row textarea {
    max-width: 100%;
    width: 100%;
  }

  .tabela-box {
    overflow-x: auto;
  }

  .tabela-box table {
    width: 100%;
    font-size: 14px;
    border-collapse: collapse;
  }

  .tabela-box th,
  .tabela-box td {
    white-space: normal;
    padding: 6px 10px;
    font-size: 13px;
  }

  .tabela-box th {
    font-size: 14px;
  }

  .col-criado-em,
  .col-email {
    display: none !important;
  }

  .tabela-box td,
  .tabela-box th {
    word-break: break-word;
    white-space: normal;
    font-size: 13px;
  }

  .campo-radio-vertical {
    align-items: flex-start;
    gap: 12px;
  }

  .radio-opcao {
    font-size: 1rem;
    color: white;
  }

  .esconder-mobile {
    display: none !important;
  }

  .nowrap-mobile {
    white-space: nowrap !important;
  }

  .content table th {
    color: orange;
  }

  .content table td {
    color: white;
  }

  .main-fieldsets {
    grid-template-columns: 1fr;
  }

  .gulp-footer {
    left: 0;
    right: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    text-align: center;
    height: auto;
  }

  .gulp-footer.minimizado {
    transform: translateY(calc(100% - 10px));
    padding: 2px 10px;
    height: 10px;
  }

  .gulp-footer .footer-text {
    width: 100% !important;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    align-items: stretch;
  }

  .cards fieldset {
    height: 100%;
  }

  .filtros-relatorio {
    flex-direction: column;
    align-items: stretch;
  }
  .filtros-relatorio label,
  .filtros-relatorio select,
  .filtros-relatorio input,
  .filtros-relatorio button {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}
