:root {
  --cor-primaria: #2979FF;
  --cor-fundo-principal: #f4f6f9;
  --cor-card-fundo: #fff;
  --sombra-card: 0 4px 8px rgba(0, 0, 0, 0.08);
  --cor-texto-principal: #333;

  --status-concluido: #4CAF50;
  --status-viagem: #00BCD4;
  --status-livre: #9E9E9E;
  ---status-indisponivel: #ff0000;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  background-color: rgba(0, 0, 0, 0.849);
  color: var(--cor-texto-principal);
  margin: 0;
  margin-top: 50px;
  padding: 20px;
}

.title {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 8px 20px;
  box-sizing: border-box;
  font-style: italic;
  background-color: #4CAF50;
  color: #fff;
  z-index: 1000;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr 2fr;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  height: 90vh;
  margin-top: 50px;
}

.coluna-cadastro {
  width: 500px;
}

.card {
  background: var(--cor-card-fundo);
  border-radius: 8px;
  box-shadow: var(--sombra-card);
  padding: 20px;
  margin-bottom: 20px;
}

.card-mapa {
  flex-grow: 1;
}

.mapa-iframe-placeholder {
  background: #e0e0e0;
  height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #616161;
  border-radius: 4px;
  margin: 15px 0;
  font-size: 1.2em;
  text-align: center;
}

.status-em_viagem {
  background: var(--status-viagem);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: bold;
  text-transform: uppercase;
  color: #fff;
}

.status-livre {
  background: var(--status-livre);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: bold;
  text-transform: uppercase;
  color: #fff;
}

.status-concluido {
  background: var(--status-concluido);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: bold;
  text-transform: uppercase;
  color: #fff;
}

.status-indisponivel {
  background: var(---status-indisponivel);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: bold;
  text-transform: uppercase;
  color: #fff;
}

.header-motoristas {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#btn-toggle-form {
  width: 60px;
  height: 43px;
  border-radius: 10px;
  border: 1px solid black;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#btn-toggle-form:hover {
  background-color: #4CAF50;
  transform: translateY(-2px);
}

.export-excel {
  display: flex;
  flex-direction: column;
}

.btn-arquivo {
  display: inline-block;
  padding: 8px;
  margin-bottom: 8px;
  background: #2979ff;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
}

.btn-arquivo:hover {
  background: #1b5fd1;
}

#nome-arquivo {
  margin-left: 8px;
  font-size: 0.9rem;
  color: #555;
  font-style: italic;
}

.lista-motoristas {
  list-style: none;
  padding: 0;
}

.btn-data {
  width: 100%;
  max-width: 220px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #ccc;
  background-color: #f9fafb;
  font-family: inherit;
  font-size: 0.95rem;
  color: #333;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-data::placeholder {
  color: #999;
}

.btn-data:focus {
  border-color: #2979FF;
  background-color: #fff;
  box-shadow: 0 0 0 2px rgba(41, 121, 255, 0.2);
}

.btn-data:disabled {
  background-color: #eee;
  color: #888;
  cursor: not-allowed;
}

.remover-carga {
  border: 1px solid black;
  border-radius: 10px;
  background: rgba(255, 0, 0, 0.733);
  color: #fff;
  cursor: pointer;
  padding: 5px;
  margin: 10px;
}

.remover-carga:hover {
  background-color: red;
  transform: translateY(-2px);
}

.cargas-selecionadas-listadas {
  border: 1px solid black;
  border-radius: 10px;
}

.cargas-selecionadas-listadas li {
  padding: 10px;
}

#btn-filtrar {
  border-radius: 10px;
  border: 1px solid black;
  padding: 5px;
  cursor: pointer;
  background-color: #067e38;
  color: #fff;
}

#btn-filtrar:hover {
  background-color: #067e38e3;
}

#exibir-cargas.card{
  width: 500px;

}

.motorista-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #eeeeee;
  cursor: pointer;
}

.motorista-item:hover {
  background: #00000049;
}

input[type="text"],
select {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  cursor: pointer;
}

.btn-primario {
  background: var(--cor-primaria);
  color: #fff;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  width: 100%;
  font-weight: bold;
  cursor: pointer;
}

/* apenas esconder */
#form-cadastro {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 2000;
}

/* visível */
#form-cadastro.mostrar {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* escondido */
#form-cadastro.oculto {
  display: none;
}

#cargas-selecionadas.mostrar {
  display: flex;
  align-items: center;
  justify-content: center;
}

#cargas-selecionadas.escondido {
  display: none;
}


/* caixa branca */
.modal {
  background-color: #fff;
  border-radius: 10px;
  padding: 20px;
  width: 320px;
  max-width: 90%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2)
}

.modal input[type="password"] {
  height: 30px;
  border-radius: 8px;
  border: 0.3px solid black;
  padding: 3px;
}

.modal input[type="text"] {
  height: 30px;
  border-radius: 8px;
  border: 0.3px solid black;
  padding: 3px;
}

.modal .form-fechar {
  background: rgba(255, 0, 0, 0.733);
  color: #fff;
  border-style: none;
  border: 1px solid black;
  border-radius: 8px;
  height: 40px;
  cursor: pointer;
}

.modal .form-salvar {
  background: rgba(22, 122, 2, 0.733);
  color: #fff;
  border-style: none;
  border: 1px solid black;
  border-radius: 8px;
  height: 40px;
  cursor: pointer;
}

/*lista dinamica*/

#resultado-cargas {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.carga-item {
  background: #ffffff;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid #e0e0e0;
  font-size: 0.85rem;
}

.carga-item:hover {
  border-color: #2979FF;
  box-shadow: 0 3px 6px rgba(41, 121, 255, 0.15);
}

.carga-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.carga-cliente {
  font-weight: 600;
  color: #333;
}

.carga-nf {
  font-size: 0.8rem;
  color: #666;
}

.carga-detalhes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.carga-detalhes span {
  color: #444;
}

.carga-vazia {
  font-size: 0.9rem;
  color: #777;
}

.modal .form-salvar:hover {
  background-color: green;
  transform: translateY(-2px);
}

.modal .form-fechar:hover {
  background-color: red;
  transform: translateY(-2px);
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .mapa-iframe-placeholder {
    height: 200px;
  }
}