body, html {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f0f0f0;
}

header {
  background-color: #2c3e50;
  color: white;
  padding: 10px;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 24px;
}

main {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 15px;
  padding: 15px;
  box-sizing: border-box;
  max-height: calc(100vh - 60px);
}

.space {
  border-radius: 8px;
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1;
}

.space h2 {
  margin-top: 0;
  margin-bottom: 10px;
  color: white;
  text-align: center;
  font-size: 18px;
}

#fila-espera { background-color: #3498db; }
#em-atendimento { background-color: #2ecc71; }
#intervalo-almoco { background-color: #e74c3c; }
#atividades-externas { background-color: #f39c12; }
#banheiro { background-color: #9b59b6; }
#fora-expediente { background-color: #34495e; }

.card {
  background-color: white;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 8px;
  cursor: move;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  font-size: 14px;
}

.card:hover {
  box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

.card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

#fora-expediente .card {
  background-color: #bdc3c7;
  color: #7f8c8d;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  text-align: center;
}

.modal-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
}

.modal-button {
  background-color: #4CAF50;
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
  width: 100%;
}

.modal-button:hover {
  background-color: #45a049;
}

.modal-button.back {
  background-color: #f44336;
}

.modal-button.back:hover {
  background-color: #da190b;
}

.modal-input {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 16px;
}

.position-button {
  background-color: #3498db;
  color: white;
  padding: 10px 20px;
  margin: 5px;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  width: 100%;
}

.position-button:hover {
  background-color: #2980b9;
}

.timer, .vendas-info, .atendimentos-info, .taxa-conversao, .ticket-medio {
  font-size: 11px;
  color: #666;
  margin-top: 3px;
}

.vendas-info { color: #2ecc71; }
.atendimentos-info { color: #3498db; }
.taxa-conversao { color: #e74c3c; }
.ticket-medio { color: #f39c12; }

.expediente-status {
  color: #e74c3c;
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 12px;
}

#valorVendaInput {
  width: 100%;
  padding: 5px;
  margin-bottom: 10px;
}

@media (max-height: 768px) {
  main {
    gap: 10px;
    padding: 10px;
  }

  .space {
    padding: 8px;
  }

  .space h2 {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .card {
    padding: 6px;
    margin-bottom: 6px;
  }

  .card strong {
    font-size: 14px;
  }

  .timer, .vendas-info, .atendimentos-info, .taxa-conversao, .ticket-medio {
    font-size: 10px;
  }

  .modal-content {
    width: 90%;
    margin: 10% auto;
  }

  .modal-title {
    font-size: 20px;
  }

  .modal-button {
    padding: 12px 24px;
    font-size: 14px;
  }

  .modal-input {
    padding: 10px 16px;
    font-size: 14px;
  }
}