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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #0f0f23;
  color: #e0e0e0;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 60px 20px 40px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: #fff;
}

header p {
  font-size: 1.1rem;
  color: #aaa;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.hero {
  text-align: center;
  margin-bottom: 50px;
}

.hero h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: #8B1A2B;
}

.hero p {
  font-size: 1.1rem;
  color: #bbb;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.card {
  background: #1a1a2e;
  border-radius: 12px;
  padding: 30px;
  border: 1px solid #333;
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #8B1A2B;
}

.card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: #fff;
}

.card p {
  color: #aaa;
}

/* ===== CRUD Personnes ===== */
.crud-section {
  margin-top: 60px;
}

.crud-section h2 {
  font-size: 1.8rem;
  color: #8B1A2B;
  text-align: center;
  margin-bottom: 30px;
}

/* Formulaire */
.person-form {
  background: #1a1a2e;
  border-radius: 12px;
  padding: 30px;
  border: 1px solid #333;
  margin-bottom: 30px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

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

.form-group label {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  background: #0f0f23;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px 16px;
  color: #e0e0e0;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #8B1A2B;
  box-shadow: 0 0 0 3px rgba(139, 26, 43, 0.2);
}

.form-group input::placeholder {
  color: #555;
}

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

.btn {
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #8B1A2B;
  color: #fff;
}

.btn-primary:hover {
  background: #a52240;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(139, 26, 43, 0.4);
}

.btn-secondary {
  background: transparent;
  color: #aaa;
  border: 1px solid #444;
}

.btn-secondary:hover {
  background: #222;
  color: #fff;
}

/* Barre de recherche */
.search-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.search-bar input {
  flex: 1;
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px 16px;
  color: #e0e0e0;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.search-bar input:focus {
  outline: none;
  border-color: #8B1A2B;
}

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

/* Tableau */
.table-container {
  background: #1a1a2e;
  border-radius: 12px;
  border: 1px solid #333;
  overflow: hidden;
}

#personTable {
  width: 100%;
  border-collapse: collapse;
}

#personTable thead {
  background: #16213e;
}

#personTable th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

#personTable td {
  padding: 14px 16px;
  border-top: 1px solid #2a2a40;
  color: #ddd;
  font-size: 0.95rem;
}

#personTable tbody tr {
  transition: background 0.15s;
}

#personTable tbody tr:hover {
  background: rgba(139, 26, 43, 0.08);
}

/* Boutons d'action du tableau */
.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.2s;
  margin-right: 4px;
}

.action-btn.edit-btn:hover {
  background: rgba(59, 130, 246, 0.15);
}

.action-btn.delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* État vide */
.empty-state {
  padding: 50px 20px;
  text-align: center;
}

.empty-state p {
  font-size: 1.1rem;
  color: #666;
}

.empty-state .empty-sub {
  font-size: 0.9rem;
  color: #444;
  margin-top: 8px;
}

/* Animation d'ajout de ligne */
@keyframes fadeInRow {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-row {
  animation: fadeInRow 0.3s ease;
}

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

  .search-bar {
    flex-direction: column;
  }

  #personTable th:nth-child(1),
  #personTable td:nth-child(1) {
    display: none;
  }
}

/* Notification toast */
.toast {
  position: fixed;
  bottom: 80px;
  right: 20px;
  padding: 14px 24px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 9999;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

footer {
  text-align: center;
  padding: 30px;
  color: #666;
  border-top: 1px solid #222;
  margin-top: 60px;
}
