* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
  padding: 24px 16px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

h1 {
  font-size: 1.8rem;
  color: #1a237e;
  margin-bottom: 24px;
  border-left: 5px solid #3f51b5;
  padding-left: 12px;
}

h2 {
  font-size: 1.1rem;
  color: #3f51b5;
  margin-bottom: 16px;
}

/* Formulário */
.form-section {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
}

input[type="text"],
input[type="email"],
select {
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
  background: #fafafa;
}

input:focus,
select:focus {
  border-color: #3f51b5;
  background: #fff;
}

input.error {
  border-color: #e53935;
}

.form-actions {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #3f51b5;
  color: #fff;
}

.btn-primary:hover {
  background: #303f9f;
}

.btn-secondary {
  background: #e0e0e0;
  color: #333;
}

.btn-secondary:hover {
  background: #bdbdbd;
}

/* Busca */
.search-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

#searchInput {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  background: #fff;
  transition: border-color 0.2s;
}

#searchInput:focus {
  border-color: #3f51b5;
}

.total-count {
  font-size: 0.85rem;
  color: #888;
  white-space: nowrap;
}

/* Tabela */
.table-section {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #3f51b5;
  color: #fff;
}

thead th {
  padding: 13px 14px;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}

tbody tr:hover {
  background: #f5f7ff;
}

tbody td {
  padding: 12px 14px;
  font-size: 0.9rem;
  color: #444;
}

.empty-msg {
  text-align: center;
  color: #aaa;
  padding: 40px !important;
  font-style: italic;
}

/* Botões de ação na tabela */
.action-btns {
  display: flex;
  gap: 8px;
}

.btn-edit,
.btn-delete {
  padding: 5px 12px;
  border: none;
  border-radius: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-edit {
  background: #e8eaf6;
  color: #3f51b5;
}

.btn-edit:hover {
  background: #c5cae9;
}

.btn-delete {
  background: #ffebee;
  color: #e53935;
}

.btn-delete:hover {
  background: #ffcdd2;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #323232;
  color: #fff;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success { background: #2e7d32; }
.toast.error   { background: #c62828; }

/* Responsivo */
@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  thead th:nth-child(4),
  thead th:nth-child(5),
  tbody td:nth-child(4),
  tbody td:nth-child(5) {
    display: none;
  }
}
