* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background: linear-gradient(#011f46, #045474, #0fafee);
  min-height: 100vh;
}

header {
  background: #080808;
  color: rgb(23, 196, 226);
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

header h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.header-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.btn-export, .btn-import {
  padding: 8px 16px;
  border: 2px solid #0fafee;
  border-radius: 6px;
  background: #045474;
  color: #0fafee;
  cursor: pointer;
  transition: 0.2s;
  font-size: 0.9rem;
  font-weight: bold;
}

.btn-export:hover, .btn-import:hover {
  background: #0fafee;
  color: #011f46;
  transform: translateY(-2px);
}

main {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 1.5rem;
}

/* Formulários em linha */
.forms-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.form-section {
  background: rgb(10, 10, 10);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(12, 12, 12, 0.3);
  padding: 1.5rem;
}

.form-section h2 {
  color: #0fafee;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

label {
  color: #0fafee;
  font-weight: bold;
  margin-top: 0.5rem;
}

input, select {
  padding: 10px;
  border: 1px solid #045474;
  border-radius: 6px;
  background: #1a1a1a;
  color: #0fafee;
  font-size: 1rem;
}

input::placeholder {
  color: #666;
}

button {
  padding: 10px;
  border: 1px solid #045474;
  border-radius: 6px;
  background: #2563eb;
  color: #0fafee;
  cursor: pointer;
  transition: 0.2s;
  font-size: 1rem;
  font-weight: bold;
}

button:hover {
  background: #1e40af;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

/* Tabelas em linha */
.tables-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.table-section {
  background: rgb(10, 10, 10);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(12, 12, 12, 0.3);
  padding: 1.5rem;
}

.table-section h2 {
  color: #0fafee;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

/* Caixa de busca */
.search-container {
  margin-bottom: 1rem;
}

.search-container input {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid #045474;
  border-radius: 6px;
  background: #1a1a1a;
  color: #0fafee;
  font-size: 0.95rem;
  transition: 0.2s;
}

.search-container input:focus {
  outline: none;
  border-color: #0fafee;
  box-shadow: 0 0 8px rgba(15, 175, 238, 0.3);
}

.search-container input::placeholder {
  color: #666;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: #0fafee;
}

th, td {
  border: 1px solid #045474;
  padding: 10px;
  text-align: center;
}

th {
  background: #011f46;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9rem;
}

td {
  background: #1a1a1a;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  padding: 0.5rem;
}

.actions button {
  background: #045474;
  padding: 6px 10px;
  font-size: 0.85rem;
  margin: 0;
}

.actions button:hover {
  background: #0fafee;
  color: #011f46;
}

.btn-editar {
  background: #045474 !important;
}

.btn-editar:hover {
  background: #0fafee !important;
  color: #011f46 !important;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: rgb(10, 10, 10);
  margin: 5% auto;
  padding: 2rem;
  border: 2px solid #045474;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  animation: slideDown 0.3s;
  box-shadow: 0 4px 20px rgba(15, 175, 238, 0.3);
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h2 {
  color: #0fafee;
  margin-bottom: 1.5rem;
}

.close {
  color: #0fafee;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

.close:hover,
.close:focus {
  color: #ff4444;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-buttons button {
  flex: 1;
}

.btn-salvar {
  background: #045474 !important;
}

.btn-salvar:hover {
  background: #0fafee !important;
  color: #011f46 !important;
}

.btn-cancelar {
  background: #dc2626 !important;
}

.btn-cancelar:hover {
  background: #b91c1c !important;
}

/* Responsividade */
@media (max-width: 1024px) {
  main {
    padding: 1rem;
  }

  .forms-container,
  .tables-container {
    grid-template-columns: 1fr;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .form-section,
  .table-section {
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  header {
    padding: 1rem;
  }

  header h1 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
  }

  .header-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-export, .btn-import {
    width: 100%;
    font-size: 0.85rem;
  }

  main {
    margin: 1rem auto;
    padding: 0.5rem;
  }

  .form-section h2,
  .table-section h2 {
    font-size: 1.1rem;
  }

  th, td {
    padding: 8px;
    font-size: 0.85rem;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
    font-size: 0.8rem;
  }

  .modal-content {
    width: 95%;
    padding: 1.5rem;
    margin: 10% auto;
  }

  .search-container input {
    font-size: 0.9rem;
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.1rem;
  }

  .form-section,
  .table-section {
    padding: 0.8rem;
  }

  input, select, button {
    padding: 8px;
    font-size: 0.9rem;
  }

  th, td {
    padding: 6px;
    font-size: 0.75rem;
  }

  .actions button {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .modal-content {
    padding: 1rem;
  }

  .modal-buttons {
    flex-direction: column;
  }

  .search-container input {
    font-size: 0.85rem;
    padding: 8px 10px;
  }
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(#011f46, #045474, #0fafee);
  color: #fff;
  text-align: center;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.footer img {
  height: 30px;
}

.footer p {
  margin: 0;
}