/* Hors fil — la liste : filtres, barre des plateformes, tableau, case « C'est bloqué ». */

.liste-intro { color: var(--encre-2); margin: 1rem 0 0; max-width: 42rem; }

.filtres { margin: 2rem 0 0; gap: 1rem 1.25rem; }
.filtres .champ { flex: 1 1 12rem; }
.filtres .champ--recherche { flex: 2 1 18rem; }
.filtres input, .filtres select { max-width: none; }
.champ--recherche input {
  padding-left: 2.75rem;
  background: var(--blanc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A4F57' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E") no-repeat .85rem 50% / 1.2rem 1.2rem;
}

/* Barre des plateformes : reste visible en haut de l'écran pendant le défilement. */
.barre-liste {
  position: sticky; top: var(--entete-h, 0px); z-index: 4; background: var(--fond);
  margin: 1.25rem calc(-1 * var(--gouttiere)) 0; padding: .65rem var(--gouttiere);
  border-bottom: 2px solid transparent; transition: border-color var(--duree) ease, box-shadow var(--duree) ease;
}
.barre-liste.est-collee { border-bottom-color: var(--encre); box-shadow: 0 10px 20px -16px rgba(17, 19, 23, .5); }
.onglets { position: relative; display: flex; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.onglets button {
  display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap;
  font: inherit; font-weight: 700; min-height: 44px; padding: .35rem 1rem; border-radius: 999px;
  border: 2px solid var(--encre); background: var(--blanc); color: var(--encre); cursor: pointer;
  transition: background-color var(--duree) ease, color var(--duree) ease;
}
.onglets button:hover { background: var(--teinte-2); }
.onglets button[aria-pressed="true"] { background: var(--encre); color: var(--fond); }
.onglets__nombre { font-weight: 400; font-size: 1rem; color: var(--encre-2); font-variant-numeric: tabular-nums; }
.onglets button[aria-pressed="true"] .onglets__nombre { color: var(--encre-doux); }
@media (max-width: 60rem) {
  .onglets {
    overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gouttiere)); padding: 0 var(--gouttiere);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
  }
  .onglets::-webkit-scrollbar { display: none; }
  .onglets li:last-child { padding-right: 2rem; }
}

.liste-infos { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin: 1rem 0 0; }
.liste-infos__nombre { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.liste-infos__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn--petit { min-height: 44px; padding: .4rem 1rem; font-size: 1rem; }

/* État vide d'une recherche */
.vide { text-align: center; max-width: 34rem; margin: 1.5rem auto 0; padding: 0 0 1rem; }
.vide .fil-sep { max-width: 16rem; margin-left: auto; margin-right: auto; }
.vide__titre { font-size: 1.4rem; font-weight: 700; margin-bottom: .4rem; }
.vide p:not(.vide__titre) { color: var(--encre-2); }

/* Une section par plateforme */
.plateforme { margin-top: 2.5rem; scroll-margin-top: 5.5rem; }
.plateforme h2 { display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem; font-size: 1.6rem; }
.plateforme h2::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: var(--trait); }

/* Tableau */
.tableau {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 0; font-size: 1.05rem;
  background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon-grand); box-shadow: var(--ombre);
}
.tableau th, .tableau td { text-align: left; padding: .55rem 1rem; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.tableau thead th { font-size: 1rem; color: var(--encre-2); border-bottom: 2px solid var(--encre); padding-top: .9rem; padding-bottom: .7rem; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tbody tr:last-child td:first-child { border-bottom-left-radius: var(--rayon-grand); }
.tableau tbody tr:last-child td:last-child { border-bottom-right-radius: var(--rayon-grand); }
.tableau tbody tr:hover td { background: var(--teinte-2); }
.tableau td:first-child { font-weight: 700; }
.tableau .identifiant { font-family: var(--mono); font-size: 1rem; color: var(--encre-2); overflow-wrap: anywhere; }
.tableau td:nth-child(3) { color: var(--encre-2); font-size: 1rem; }
.tableau tr[hidden] { display: none; }
.tableau th.col-bloque { text-align: right; }
.tableau td:nth-child(5) { text-align: right; white-space: nowrap; width: 1%; }
.tableau td:nth-child(4) { white-space: nowrap; width: 1%; }
.tableau tr.est-bloque td { background: var(--teinte-2); }

/* Lien vers le profil */
.tableau td a {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; padding: 0 .95rem;
  border: 2px solid var(--accent); border-radius: 999px; font-weight: 700; font-size: 1rem; text-decoration: none;
  transition: background-color var(--duree) ease, color var(--duree) ease;
}
.tableau td a::after { content: "↗"; content: "↗" / ""; }
.tableau td a:hover { background: var(--accent); color: var(--fond); }

/* Case « C'est bloqué » : une vraie case à cocher, dessinée en pilule. */
.bascule {
  position: relative; display: inline-flex; align-items: center; gap: .55rem; min-height: 44px;
  padding: .3rem 1rem .3rem .65rem; border: 2px solid var(--encre-2); border-radius: 999px; background: var(--blanc);
  cursor: pointer; font-weight: 700; font-size: 1rem; white-space: nowrap; user-select: none; -webkit-user-select: none;
  transition: border-color var(--duree) ease, background-color var(--duree) ease;
}
.bascule:hover { border-color: var(--encre); }
.bascule__case { position: absolute; left: .65rem; top: 50%; width: 1.35rem; height: 1.35rem; margin: -.675rem 0 0; opacity: 0; }
.bascule__boite {
  position: relative; flex: none; width: 1.35rem; height: 1.35rem; border: 2px solid var(--encre-2); border-radius: 6px; background: var(--blanc);
  transition: background-color var(--duree) ease, border-color var(--duree) ease;
}
.bascule__boite::after {
  content: ""; position: absolute; left: .34rem; top: .08rem; width: .38rem; height: .72rem;
  border: solid var(--fond); border-width: 0 3px 3px 0; transform: rotate(45deg) scale(0); transform-origin: 60% 60%;
  transition: transform 220ms cubic-bezier(.2, .8, .3, 1.5);
}
.bascule__case:checked + .bascule__boite { background: var(--accent); border-color: var(--accent); }
.bascule__case:checked + .bascule__boite::after { transform: rotate(45deg) scale(1); }
.bascule:has(.bascule__case:checked) { border-color: var(--accent); background: var(--accent); color: var(--fond); }
.bascule:has(.bascule__case:checked) .bascule__boite { background: var(--fond); border-color: var(--fond); }
.bascule:has(.bascule__case:checked) .bascule__boite::after { border-color: var(--accent); }
.bascule:has(.bascule__case:checked):hover { background: var(--encre); border-color: var(--encre); }
.bascule:has(.bascule__case:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (forced-colors: active) {
  .bascule__case { position: static; opacity: 1; margin: 0; }
  .bascule__boite { display: none; }
}

/* Petits écrans : chaque compte devient une fiche. */
@media (max-width: 47.99rem) {
  .tableau { border: 0; background: transparent; box-shadow: none; display: block; }
  .tableau caption { display: block; }
  .tableau thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tableau tbody { display: grid; gap: .6rem; }
  .tableau tr {
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "nom nom" "id id" "cat cat" "profil bloque";
    gap: 0 .75rem; background: var(--blanc); border: 1px solid var(--trait); border-radius: 14px; padding: .85rem 1rem .9rem;
  }
  .tableau tr[hidden] { display: none; }
  .tableau td, .tableau tbody tr:hover td, .tableau tr.est-bloque td { display: block; padding: 0; border: 0; background: transparent; width: auto; text-align: left; }
  .tableau td:nth-child(1) { grid-area: nom; font-size: 1.15rem; line-height: 1.3; }
  .tableau td:nth-child(2) { grid-area: id; }
  .tableau td:nth-child(3) { grid-area: cat; }
  .tableau td:nth-child(4), .tableau td:nth-child(5) { width: auto; }
  .tableau td:nth-child(4) { grid-area: profil; margin-top: .7rem; }
  .tableau td:nth-child(5) { grid-area: bloque; margin-top: .7rem; justify-self: end; }
  .tableau tr.est-bloque { background: var(--teinte-2); border-color: var(--accent); }
}
@media (max-width: 22rem) {
  .tableau tr { grid-template-columns: 1fr; grid-template-areas: "nom" "id" "cat" "profil" "bloque"; }
  .tableau td:nth-child(5) { justify-self: start; margin-top: .5rem; }
}

@media print {
  .tableau { box-shadow: none; border: 0; }
  .tableau th.col-bloque, .tableau td:nth-child(5), .tableau td:nth-child(4) a::after { display: none; }
  .tableau td a { border: 0; padding: 0; min-height: 0; }
  .tableau tr[hidden] { display: table-row !important; }
  .tableau th, .tableau td { padding: 3pt 4pt; }
  .plateforme[hidden] { display: block !important; }
  .vide { display: none !important; }
}

/* Liste longue (des milliers de comptes) : les sections hors de l'écran ne sont pas mises en page
   tant qu'on n'y arrive pas. La recherche du navigateur (Ctrl+F) et les ancres fonctionnent toujours. */
.plateforme { content-visibility: auto; contain-intrinsic-size: auto 2400px; }
@media print { .plateforme { content-visibility: visible; } }
