* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  padding: 20px;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

header h1 {
  color: #333;
  font-size: 1.8rem;
}

/* Botões */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s, transform 0.1s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-warning {
  background-color: #ffc107;
  color: #212529;
}

.btn-warning:hover {
  background-color: #e0a800;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
}

/* Tabela */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

thead {
  background-color: #343a40;
  color: white;
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  font-weight: 600;
}

tbody tr {
  transition: background-color 0.2s;
}

tbody tr:hover {
  background-color: #f8f9fa;
}

/* Destaque para custo >= R$ 1.000,00 */
tbody tr.custo-alto {
  background-color: #fff3cd !important;
}

tbody tr.custo-alto:hover {
  background-color: #ffe69c !important;
}

tfoot {
  background-color: #e9ecef;
  font-weight: bold;
}

tfoot td {
  padding: 15px;
}

/* Botões de ação na tabela */
.acoes {
  display: flex;
  gap: 5px;
}

.btn-editar {
  background-color: #17a2b8;
  color: white;
  padding: 5px 10px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.btn-editar:hover {
  background-color: #138496;
}

.btn-excluir {
  background-color: #dc3545;
  color: white;
  padding: 5px 10px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.btn-excluir:hover {
  background-color: #c82333;
}

/* Botões de ordenação */
.ordem-btns {
  display: flex;
  gap: 3px;
}

.btn-ordem {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 5px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
}

.btn-ordem:hover {
  background-color: #545b62;
}

.btn-ordem:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Mensagem vazia */
.mensagem-vazia {
  text-align: center;
  padding: 40px;
  color: #6c757d;
  font-size: 16px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 0;
  border-radius: 8px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #ddd;
  background-color: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

.modal-header h2 {
  font-size: 1.3rem;
  color: #333;
}

.btn-fechar {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.btn-fechar:hover {
  color: #333;
}

.modal-body {
  padding: 20px;
}

.modal-confirmacao {
  max-width: 400px;
}

.modal-confirmacao .modal-body {
  text-align: center;
}

/* Formulário */
form {
  padding: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
}

.form-group input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid #ddd;
  background-color: #f8f9fa;
  border-radius: 0 0 8px 8px;
}

/* Drag and drop */
.dragging {
  opacity: 0.5;
  background-color: #e3f2fd !important;
}

.drag-over {
  border-top: 3px solid #007bff;
}

tbody tr {
  cursor: move;
}

/* Responsividade */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  table {
    font-size: 14px;
  }

  th, td {
    padding: 8px 10px;
  }

  .acoes {
    flex-direction: column;
  }

  .modal-content {
    margin: 10px;
    max-width: calc(100% - 20px);
  }
}

/* Notificação toast */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 5px;
  color: white;
  font-weight: 500;
  z-index: 2000;
  animation: toastSlideIn 0.3s;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-success {
  background-color: #28a745;
}

.toast-error {
  background-color: #dc3545;
}
