/* Importando uma fonte moderna */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Poppins", sans-serif;
  background-color: #ffffff;
  color: #333;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* HEADER */
header {
  width: 100%;
  background: linear-gradient(135deg, #ffc107, #ffa000);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

header .system-name {
  font-size: 26px;
  font-weight: 600;
  color: #fff;
}

/* Botão que só aparece no mobile para abrir/fechar menu */
.menu-toggle {
  display: none; /* some no desktop */
  font-size: 24px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

.btn-group {
  display: flex;
  gap: 15px;
}

.btn {
  cursor: pointer;
  background: white;
  color: #333;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.1s ease-in-out;
}

.btn:hover {
  background: #ffc107;
  color: white;
  border-color: #ffffff;
  box-shadow: 0px 4px 6px rgba(255, 193, 7, 0.4);
}

.small-button {
  cursor: pointer;
  background: white;
  color: #000000;
  margin-top: 20px;
  box-shadow: 0px 2px 6px rgba(255, 193, 7, 0.3);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  border: 2px solid #ffa000;
  transition: all 0.1s ease-in-out;
}

.small-button:hover {
  background: #ffa000;
  color: #ffffff;
  box-shadow: 0px 4px 6px rgba(255, 193, 7, 0.3);
}

/* CONTEÚDO PRINCIPAL */
.container {
  width: 100%;
  max-width: 1200px;
  padding: 30px;
  background: white;
  border-radius: 12px;
  box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.1);
  margin-top: 100px;
  text-align: center;
}

/* FORMULÁRIOS */
.form-group {
  margin-top: 30px;
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus {
  border-color: #ffc107;
  outline: none;
}

/* LOADING SPINNER */
#loadingSpinner {
  display: none;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 2;
}

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top: 4px solid #ffc107;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* MODAL */
.modal-content {
  background-color: white;
  padding: 25px;
  width: 90%;
  max-width: 400px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.2);
}

/* Estilo para os textos dentro do modal */
.modal-content h2,
.modal-content h3 {
  color: #333;
  font-weight: 600;
  margin-bottom: 15px;
}

/* Parágrafos dentro do modal */
.modal-content p {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
  font-weight: 500;
  color: #333;
}

/* Formulário dentro do modal */
.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

select {
  width: 100%;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s;
}

select:focus {
  border-color: #ffa000;
  outline: none;
  box-shadow: 0px 2px 6px rgba(255, 193, 7, 0.3);
}

/* Campos de entrada */
.modal-content input,
.modal-content select {
  width: 100%;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s;
}
.modal-content input:focus,
.modal-content select:focus {
  border-color: #ffa000;
  outline: none;
  box-shadow: 0px 2px 6px rgba(255, 193, 7, 0.3);
}
.filters {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  margin-top: 20px;
}

.filters input {
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  width: 24%;
  transition: border-color 0.3s;
}

.filters input:focus {
  border-color: #ffa000;
  outline: none;
  box-shadow: 0px 2px 6px rgba(255, 193, 7, 0.3);
}

.modal-content .small-button {
  cursor: pointer;
  background: white;
  color: #000000;
  margin-top: 20px;
  box-shadow: 0px 2px 6px rgba(255, 193, 7, 0.3);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  border: 2px solid #ffa000;
  transition: all 0.1s ease-in-out;
}

.modal-content .small-button:hover {
  background: #ffa000;
  color: #ffffff;
  box-shadow: 0px 4px 6px rgba(255, 193, 7, 0.3);
}

.modal-content #close-button:hover {
  background: red;
  border-color: red;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.close {
  color: #666;
  float: right;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: black;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 20px; /* Ajuste para separar do formulário */
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  /* força a largura fixa das colunas */
  table-layout: fixed;
}

table,
th,
td {
  border: 1px solid #ddd;
}

th,
td {
  width: 100px; /* ajuste conforme quiser */
  overflow: hidden; /* oculta excesso */
  text-overflow: ellipsis; /* adiciona reticências no final  */
  white-space: nowrap; /* impede quebra de linha */
  padding: 8px;
  text-align: left;
  border: 1px solid #ddd;
}

th {
  background-color: #ffffff;
  color: rgb(0, 0, 0);
}

/* Responsividade */
@media (max-width: 480px) {
  .modal-content {
    width: 95%;
    padding: 20px;
  }
}

/* RESPONSIVIDADE */
@media (max-width: 768px) {
  .filters {
    flex-direction: column; /* empilha verticalmente */
    align-items: flex-start; /* opcional, alinha à esquerda */
    gap: 10px; /* espaço entre os itens se desejar */
  }

  /* Ajustar a largura dos inputs se precisar */
  .filters input {
    width: 100%;
  }
  thead {
    display: none;
  }

  /* Cada linha (tr) passa a ser um bloco */
  tr {
    display: block;
    margin-bottom: 1rem; /* espaço entre “cards” */
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
  }

  /* Cada célula (td) também em block */
  td {
    width: 100%;
    display: block;
    text-align: right; /* texto ficará “alinhado” à direita */
    position: relative;
    /* use padding-left se quiser um “espaço” para o título */
    padding-left: 0%;
    box-sizing: border-box;
  }

  /* Inserimos o nome da coluna via ::before */
  td::before {
    /* content: "<título da coluna>"; 
         mas para ficar dinâmico, usamos data-label no HTML */
    content: attr(data-label);
    font-weight: 600;
    position: absolute;
    left: 1rem;
    text-align: left;
    /* Ajuste a largura para o "rótulo" */
    width: 45%;
    white-space: nowrap;
  }
  /* Reorganiza o header no mobile */
  header {
    flex-direction: row;
    justify-content: space-between; /* ou flex-start / center */
    align-items: center;
  }

  /* Mostra o ícone do menu no mobile */
  .menu-toggle {
    display: block;
  }

  .btn-group {
    display: none; /* some totalmente */
  }

  .btn-group {
    position: absolute;
    top: 60px; /* abaixo do header (ajuste conforme a altura do seu header) */
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ffc107, #ffa000);
    padding: 10px;
    border-radius: 8px;

    flex-direction: column;
    gap: 10px;
    width: auto; /* pode ajustar para 100% se quiser ocupar toda largura */
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  }

  /* Classe "show" exibindo o menu ao clicar no botão */
  .btn-group.show {
    display: flex;
  }

  .container {
    width: 90%;
  }
}
