:root {
  --rose: #fcd5ce;
  --rose-pale: #fae1dd;
  --fond: #f8edeb;
  --gris-clair: #e8e8e4;
  --vert-pastel: #d8e2dc;
  --vert-pastel-fonce: #a5c3a3;
  --jaune-pastel: #ffe5d9;
  --orange-pastel: #ffd7ba;
  --accent-rose: #fec5bb;
  --accent-jaune: #fec89a;
}

body {
  background-color: var(--fond);
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 1em;
  color: #333;
}

h1, h2 {
  text-align: center;
  color: #444;
}

form {
  max-width: 600px;
  margin: 1em auto;
  background: white;
  padding: 1.2em;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

form label {
  font-weight: bold;
  margin-top: 1em;
  display: block;
}

form input, form textarea, form select {
  width: 100%;
  padding: 0.5em;
  margin-top: 0.2em;
  margin-bottom: 1em;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 1em;
}

form input[type="submit"],
form button {
  background-color: var(--accent-rose);
  border: none;
  border-radius: 6px;
  padding: 0.6em 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

form input[type="submit"]:hover,
form button:hover {
  background-color: var(--accent-jaune);
}

.recette-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6em;
  margin-top: 2em;
}

.recette-item {
  background-color: var(--vert-pastel);
  padding: 0.6em 1em;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  text-align: center;
  transition: background-color 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recette-item:hover {
  background-color: var(--vert-pastel-fonce);
}

.recette-item a {
  text-decoration: none;
  color: #000;
  font-weight: bold;
}

.btn-ajouter,
.btn-secondaire {
  display: inline-block;
  background-color: var(--accent-jaune);
  color: black;
  padding: 0.6em 1.2em;
  border-radius: 10px;
  text-decoration: none;
  margin: 0.5em;
  font-weight: bold;
  transition: background-color 0.3s;
}

.btn-ajouter:hover,
.btn-secondaire:hover {
  background-color: var(--accent-rose);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

table th, table td {
  padding: 0.8em;
  border: 1px solid var(--gris-clair);
  text-align: center;
}

.total {
  font-weight: bold;
  text-align: right;
  margin-top: 1em;
  font-size: 1.2em;
}

@media (max-width: 600px) {
  form {
    padding: 1em;
  }

  .recette-item {
    font-size: 1em;
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-ajouter, .btn-secondaire {
    display: block;
    width: 80%;
    margin: 0.5em auto;
    text-align: center;
  }
}

/* ✅ Correctifs en dehors du media query */
.btn-supprimer {
  background: none;
  border: none;
  font-size: 1.2em;
  padding: 0.2em 0.5em;
  cursor: pointer;
  color: #900;
  transition: transform 0.2s;
}

.btn-supprimer:hover {
  transform: scale(1.2);
}

.table-responsive {
  overflow-x: auto;
  width: 100%;
}

table.responsive {
  width: 100%;
  font-size: 0.9em;
  table-layout: auto;
}

table.responsive th:nth-child(2),
table.responsive td:nth-child(2) {
  width: 40px; /* Quantité */
  text-align: center;
  white-space: nowrap;
}

table.responsive th:nth-child(3),
table.responsive td:nth-child(3) {
  width: 40px; /* Unité */
  text-align: center;
  white-space: nowrap;
}
