/* Titres */
h2 {
  text-align: center;
  color: #6a1b9a;
  margin: 20px 0 10px;
}

h3 {
  text-align: center;
  color: #8e24aa;
  margin: 14px 0;
}

/* Navbar */
.navbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #fff;
  border-radius: 8px;
  margin: 10px 16px 0;
  border: 1px solid #eee;
}

.retour button {
  background: #f8bbd0;
  color: #333;
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.menu select {
  width: 200px;
  max-width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

/* Bloc restant */
.case {
  border: 2px solid #6a1b9a;
  background: #ede7f6;
  padding: 15px;
  border-radius: 10px;
  width: 320px;
  max-width: 95%;
  margin: 16px auto;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
}

/* Layout */
.budget-container {
  display: flex;
  gap: 20px;
  padding: 0 16px;
  margin: 10px 0 20px;
  align-items: flex-start;
}

.table-block {
  flex: 1;
}

.table-block-centered {
  width: 70%;
  margin: 16px auto 24px;
  padding: 0 16px;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  background: #f3e5f5;
  border-radius: 8px;
  margin-bottom: 20px; /* espace entre les tables */
}

th, td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: center;
}

th {
  background: #e1bee7;
  font-weight: 600;
}

tr:nth-child(even) td {
  background: #f8f1fb;
}

/* Inputs */
input[type="text"],
input[type="number"] {
  width: 95%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #aaa;
  font-size: 15px;
}

/* Boutons */
.table-block button,
.table-block-centered button,
.export-buttons button {
  background: #e1bee7;
  color: #311b92;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
}

.export-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 0 16px 24px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .budget-container {
    flex-direction: column;   /* empile les blocs */
    gap: 30px;                /* ajoute de l’air entre eux */
    align-items: stretch;
  }

  .table-block,
  .table-block-centered {
    width: 100%;              /* chaque bloc prend toute la largeur */
  }
}

@media (max-width: 600px) {
  .navbar {
    flex-direction: column;
    align-items: stretch;
  }

  .menu select {
    width: 100%;
    margin-top: 8px;
  }

  table {
    font-size: 14px;
  }

  th, td {
    padding: 6px;
  }

  input[type="text"],
  input[type="number"] {
    width: 100%;
    font-size: 14px;
  }

  .export-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .export-buttons button {
    width: 100%;
  }

  .case {
    font-size: 18px;
    width: 95%;
  }
}

/* Pourcentage coloré */
td.pourcentage {
  color: #6a1b9a;
  font-weight: 600;
}
