/* ----------------- Body / global ----------------- */
body {
  margin: 0;
  font-family: 'Barlow', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto;
  background-color: #f9f9f9;
  color: #333;
  padding: 0;
}

/* ----------------- Layout ----------------- */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden; /* empêche le scroll général */
}

#sidebar {
  flex: 0 0 300px;          /* largeur fixe */
  padding: 1em;
  border-right: 1px solid #ccc;
  background-color: #f9f9f9;
  order: -1;                /* pour la mettre à gauche */
  overflow-y: auto;         /* scroll si contenu trop haut */
}

#main {
  flex: 1;                  /* prend tout l’espace restant */
  padding: 1em;
  overflow-y: auto;         /* scroll vertical contenu */
}

/* ----------------- Formulaire ----------------- */
.search_form {
  margin-bottom: 1.5em;
}

.search_form input[type="text"] {
    width: calc(100% - 12px);  /* 100% du conteneur moins le padding */
    box-sizing: border-box;    /* inclut padding et bordure dans la largeur */
    padding: 5px 6px;
    margin-bottom: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.search_form input[type="submit"] {
  padding: 5px 10px;
  background-color: #ab0b3d;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  margin-right: 5px;
}

.search_form input[type="submit"]:hover {
  background-color: #630614;
}

/* ----------------- Tableaux CSV ----------------- */
.csv_table {
  border-collapse: collapse;
  margin-bottom: 20px;
  width: 100%;
  background-color: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.csv_table th, .csv_table td {
  border: 1px solid #ccc;
  padding: 6px 10px;
  text-align: left;
}

.csv_table th {
  background-color: #f2f2f2;
  width: 350px;
}

.csv_table td {
  position: relative;       /* pour le bouton copier */
  padding-right: 25px;
}

/* Bouton copier */
.copy-btn-cell {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9em;
}

.copy-btn-cell:hover {
  color: #ab0b3d;
}

/* ----------------- Index alphabétique / pagination ----------------- */
.alpha_index a, .pagination a {
  margin-right: 5px;
  text-decoration: none;
  color: #007BFF;
  padding: 2px 5px;
  border-radius: 3px;
}

.alpha_index a:hover, .pagination a:hover {
  background-color: #e0f0ff;
}

.pagination {
  margin-top: 15px;
  text-align: center;
}

/* ----------------- Résultats ----------------- */
.result_count {
  margin-bottom: 15px;
  font-weight: bold;
}

/* ----------------- Responsive ----------------- */
@media (max-width: 700px) {
  .layout { flex-direction: column; height: auto; }
  #sidebar { width: 100%; order: 0; height: auto; border-right: none; border-bottom: 1px solid #ccc; }
  #main { flex: 1; height: auto; }
  .csv_table th, .csv_table td { padding: 4px 6px; }
  .search_form input[type="text"] { width: 100%; }
}
