/* ==========================================================
   ESTILO GERAL E PADRÕES
   ========================================================== */
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f9fafb;
  color: #333;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* Cores de tema */
:root {
  --azul: #2575fc;
  --azul-hover: #1a5de7;
  --vermelho: #dc3545;
  --vermelho-hover: #b52b34;
  --verde: #28a745;
  --preto: #000000;
  --fundo-claro: #ffffff;
  --texto-claro: #333;
  
}

/* Títulos */
h2 {
  color: var(--azul);
  text-align: center;
  margin-top: 0;
}

/* ==========================================================
   FORMULÁRIOS E CAMPOS
   ========================================================== */
.form-container {
  background-color: var(--fundo-claro);
  border: 3px solid var(--azul);
  border-radius: 12px;
  padding: 30px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

label {
  font-weight: bold;
  margin-bottom: 5px;
  display: block;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1em;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--azul);
  box-shadow: 0 0 6px rgba(37, 117, 252, 0.3);
  outline: none;
}

input[readonly] {
  background-color: #f5f5f5;
  color: #555;
  cursor: default;
}

/* ==========================================================
   BOTÕES
   ========================================================== */
button,
.filter-box,
.clean-button,
.back-button,
.logout-button {
  background-color: var(--azul);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  padding: 12px 16px;
  transition: background-color 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  display: inline-block;
}

button:hover,
.filter-box:hover,
.clean-button:hover,
.back-button:hover {
  background-color: var(--azul-hover);
}

/* Variações */
.logout-button {
  background-color: var(--vermelho);
}

.logout-button:hover {
  background-color: var(--vermelho-hover);
}

.clean-button {
  background-color: #0b65fd;
}

.clean-button:hover {
  background-color: #01286b;
}

.back-button {
  background-color: #6c757d;
}

.back-button:hover {
  background-color: #5a6268;
}

.encerrar-button {
  background-color: var(--verde);
}

.encerrar-button:hover {
  background-color: #1e7e34;
}

.pegar-button {
  background-color: #17a2b8;
}

.pegar-button:hover {
  background-color: #138496;
}

/* ==========================================================
   FILTROS E LISTAS
   ========================================================== */
.filters {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
  width: 100%;
}

.filter-box {
  flex: 1;
  min-width: 150px;
  text-align: center;
}

.filter-azul {
  background-color: var(--azul);
}

.filter-vermelho {
  background-color: var(--vermelho);
}

.filter-verde {
  background-color: var(--verde);
}

.filter-preto {
  background-color: var(--preto);
}

.filter-box.active {
  box-shadow: 0 0 10px 3px rgba(37, 117, 252, 0.7);
}

.list-container {
  background-color: var(--fundo-claro);
  border: 3px solid var(--azul);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 98%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

/* ==========================================================
   TABELAS
   ========================================================== */
table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  background-color: var(--azul);
  color: white;
}

th,
td {
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

.status-Aberto {
  color: var(--vermelho);
  font-weight: bold;
}

.status-Em-andamento {
  color: var(--azul);
  font-weight: bold;
}

.status-Concluído {
  color: var(--verde);
  font-weight: bold;
}

/* ==========================================================
   CONTADORES
   ========================================================== */
.top-counters {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 900px;
}

.counter-box {
  flex: 1;
  min-width: 150px;
  padding: 15px 20px;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  font-size: 1.2em;
  text-align: center;
}

.counter-azul {
  background-color: var(--azul);
}

.counter-vermelho {
  background-color: var(--vermelho);
}

.counter-verde {
  background-color: var(--verde);
}

.counter-preto {
  background-color: var(--preto);
}

/* ==========================================================
   BOTÕES SUPERIORES FIXOS
   ========================================================== */
.top-buttons {
  position: fixed;
  top: 20px;
  right: 10px;
  display: flex;
  gap: 10px;
  z-index: 10000;
}

.logout-form {
  margin: 0;
  display: inline;
}

/* ==========================================================
   LOGIN
   ========================================================== */
.login-logo {
  width: 40%;
  max-width: 200px;
  height: auto;
  object-fit: contain;
  margin-bottom: 20px;
}

.login-container {
  background: #fff;
  width: 90%;
  max-width: 350px;
  border-radius: 12px;
  border: 2px solid var(--azul);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 40px 30px;
  text-align: center;
}

.login-container h2 {
  color: var(--azul);
  margin-bottom: 20px;
}

.login-container input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1em;
  transition: all 0.3s ease;
}

.login-container input:focus {
  border-color: var(--azul);
  box-shadow: 0 0 6px rgba(37, 117, 252, 0.3);
  outline: none;
}

/* ==========================================================
   MODO RETRATO (AVISO)
   ========================================================== */
.aviso-orientacao {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 1.5rem;
  text-align: center;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

@media screen and (orientation: portrait) {
  .aviso-orientacao {
    display: flex;
  }
}

/* ==========================================================
   RESPONSIVIDADE GERAL
   ========================================================== */
@media (max-width: 600px) {
  .form-container,
  .list-container {
    padding: 15px;
  }

  form {
    gap: 15px;
  }

  input,
  select,
  textarea {
    font-size: 0.95em;
  }

  button,
  .filter-box,
  .clean-button,
  .back-button,
  .logout-button {
    width: 100%;
    font-size: 0.9em;
    padding: 10px;
  }

  .top-buttons {
    top: 10px;
    right: 10px;
    gap: 8px;
  }

  .counter-box {
    font-size: 1em;
  }
}

/* ==========================================================
   MENSAGENS FIXAS NO TOPO
   ========================================================== */
/* Retângulo superior mensagem */
.top-message {
  width: 100%;
  color: black;
  padding: 15px 25px;
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 20px;
  box-sizing: border-box;
}

/* Variações de cor */
.top-message.success {
  background-color: var(--verde);
}

.top-message.error {
  background-color: var(--vermelho);
}

.top-message.warning {
  background-color: #ffc107;
  color: #000;
}

/* Animação */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Responsivo */
@media (max-width: 600px) {
  .top-message {
    width: 90%;
    font-size: 0.9em;
    padding: 10px 15px;
  }
}



/* ==========================================================
   RESPONSIVIDADE PARA CELULARES EM LANDSCAPE
   ========================================================== */
@media (max-width: 900px) and (orientation: landscape) {
  .form-container,
  .list-container,
  .login-container {
    padding: 15px 20px;
    max-width: 95%;
  }

  input,
  select,
  textarea {
    font-size: 0.9em;
    padding: 10px;
  }

  button,
  .filter-box,
  .clean-button,
  .back-button,
  .logout-button {
    width: auto;
    font-size: 0.9em;
    padding: 8px 12px;
  }

  .top-counters {
    gap: 10px;
    flex-wrap: wrap;
  }

  .counter-box {
    flex: 1 1 45%;
    font-size: 1em;
    padding: 10px;
  }

  .top-message {
    font-size: 1em;
    padding: 10px 15px;
    width: 90%;
  }
}
