:root {
  --bleu: #1f5aa8;
  --bleu-fonce: #17457f;
  --bleu-pale: #e8f0fa;
  --fond: #eef1f5;
  --blanc: #ffffff;
  --texte: #1f2733;
  --texte-doux: #58616f;
  --texte-faible: #8c95a3;
  --bord: #d5dbe3;
  --bord-doux: #e6eaef;
  --gris-tete: #f4f6f9;

  --vert-fond: #e4f1e2;
  --vert-bord: #bcd9b7;
  --vert-texte: #2f6b34;

  --creme-fond: #fdf6e3;
  --creme-bord: #ecd9a6;
  --creme-texte: #8a6100;

  --info-fond: #e2eff6;
  --info-bord: #b6d6e6;
  --info-texte: #245e78;

  --rouge-fond: #fbeaea;
  --rouge-bord: #edbfbd;
  --rouge-texte: #a52b23;

  --ombre: 0 1px 2px rgba(31, 39, 51, 0.07);
  --police: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  font-size: 14.5px;
  line-height: 1.5;
}

a { color: var(--bleu); }

:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }

.enveloppe { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 18px; }

.bandeau { background: var(--blanc); border-bottom: 1px solid var(--bord); }

.bandeau-ligne {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
}

.ecu { display: block; height: 50px; width: auto; flex: none; }

.bandeau-titre { grid-column: 2; text-align: center; }
.bandeau-titre h1 { font-size: 21px; font-weight: 700; color: var(--bleu); margin: 0; letter-spacing: -0.01em; }
.bandeau-titre p { font-size: 14px; font-weight: 600; color: var(--bleu); margin: 1px 0 0; }

.menu { background: var(--bleu); }

.menu-ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
}

.menu-liens { display: flex; overflow-x: auto; }

.menu-liens a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  padding: 12px 16px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.menu-liens a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.menu-liens a[aria-current="page"] { color: #fff; font-weight: 600; border-bottom-color: #fff; background: rgba(255, 255, 255, 0.08); }

.compteur {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  background: #d94a41;
  color: #fff;
  border-radius: 9px;
  padding: 1px 6px;
}

.compte { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; padding: 5px 0; }
.compte-txt { text-align: right; min-width: 0; }
.compte-nom { font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compte-meta { font-size: 11px; opacity: 0.85; font-family: var(--mono); line-height: 1.3; }

.avatar {
  width: 30px; height: 30px; flex: none; border-radius: 50%; object-fit: cover;
  background: rgba(255, 255, 255, 0.22); display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
}

.quitter {
  color: #fff; text-decoration: none; font-size: 12.5px; padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 5px; white-space: nowrap;
}

.quitter:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

main { padding: 22px 0 55px; }

.titre-page { font-size: 19px; font-weight: 600; margin: 0 0 3px; }
.sous-titre { color: var(--texte-doux); font-size: 13.5px; margin: 0 0 20px; }

.encart {
  border: 1px solid var(--bord);
  border-left: 4px solid var(--texte-faible);
  border-radius: 5px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 13.5px;
}

.encart h2 { font-size: 14px; font-weight: 700; margin: 0 0 6px; }
.encart ul { margin: 0; padding-left: 20px; }
.encart li + li { margin-top: 6px; }

.encart-vert { background: var(--vert-fond); border-color: var(--vert-bord); border-left-color: var(--vert-texte); color: var(--vert-texte); }
.encart-creme { background: var(--creme-fond); border-color: var(--creme-bord); border-left-color: var(--creme-texte); color: var(--creme-texte); font-weight: 600; }
.encart-info { background: var(--info-fond); border-color: var(--info-bord); border-left-color: var(--info-texte); color: var(--info-texte); }
.encart-rouge { background: var(--rouge-fond); border-color: var(--rouge-bord); border-left-color: var(--rouge-texte); color: var(--rouge-texte); }

.panneau {
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: 6px;
  box-shadow: var(--ombre);
  margin-bottom: 18px;
  overflow: hidden;
}

.panneau-tete {
  background: var(--gris-tete);
  border-bottom: 1px solid var(--bord);
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panneau-tete h2 { font-size: 14.5px; font-weight: 700; margin: 0; }
.panneau-tete p { font-size: 12.5px; color: var(--texte-doux); margin: 2px 0 0; }
.panneau-corps { padding: 16px; }

.catalogue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 14px;
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}

.appli {
  --teinte: 76, 141, 255;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 11px;
  height: 100%;
  padding: 22px 14px 18px;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: 6px;
  box-shadow: var(--ombre);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.14s, box-shadow 0.14s, background 0.14s;
}

.appli:hover, .appli:focus-visible {
  border-color: #c0c8d3;
  background: var(--gris-tete);
  box-shadow: 0 2px 6px -2px rgba(15, 30, 55, 0.16);
}

.appli-icone {
  width: 64px; height: 64px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(var(--teinte), 0.1);
  border: 1px solid rgba(var(--teinte), 0.22);
  color: rgb(var(--teinte));
}

.appli-nom { font-size: 14.5px; font-weight: 700; margin: 0; }
.appli-desc { font-size: 12px; color: var(--texte-doux); margin: -5px 0 0; line-height: 1.4; }

.vide { padding: 34px 20px; text-align: center; color: var(--texte-doux); }

.portail-connexion { min-height: 100vh; display: grid; place-items: center; padding: 30px 18px; }

.bloc-connexion {
  width: 100%;
  max-width: 340px;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: 6px;
  box-shadow: var(--ombre);
  padding: 30px 28px 26px;
  text-align: center;
}

.bloc-connexion h1 { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.bloc-connexion p { font-size: 13.5px; color: var(--texte-doux); margin: 0 0 20px; }

.colonne-etroite { max-width: 640px; margin: 0 auto; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 13.5px; font-weight: 600; color: #fff;
  background: var(--bleu); border: 1px solid var(--bleu); border-radius: 5px;
  padding: 9px 18px; cursor: pointer; text-decoration: none;
}

.bouton[hidden] { display: none; }
.bouton:hover { background: var(--bleu-fonce); border-color: var(--bleu-fonce); color: #fff; }
.bouton-large { width: 100%; }

.bouton-second {
  background: var(--blanc); color: var(--texte); border-color: var(--bord);
  font-weight: 500; font-size: 13px; padding: 7px 13px;
}

.bouton-second:hover { background: var(--gris-tete); color: var(--texte); border-color: var(--texte-faible); }

.bouton-icone { gap: 0; padding: 6px 9px; }
.bouton-icone svg { display: block; }

.verrous { display: flex; flex-wrap: wrap; gap: 4px; max-width: 240px; }
.verrous .etiquette { padding: 2px 6px; }

.reglages { max-width: 620px; }

.reglage {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bord-doux);
  font-size: 13px;
}

.reglage:first-child { padding-top: 0; }
.reglage-lib { color: var(--texte-doux); }
.reglage-champ { display: flex; align-items: center; gap: 8px; }
.reglage-champ .champ { width: 82px; }
.reglage-unite { font-size: 12px; color: var(--texte-faible); min-width: 62px; }
.reglage-pied { display: flex; justify-content: flex-end; margin-top: 14px; }

@media (max-width: 560px) {
  .reglage { grid-template-columns: 1fr; gap: 6px; }
  .reglage-pied { justify-content: stretch; }
}

.chiffres { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

.chiffre {
  flex: 1 1 140px; background: var(--blanc); border: 1px solid var(--bord);
  border-radius: 6px; box-shadow: var(--ombre); padding: 13px 15px;
}

.chiffre-val { font-size: 23px; font-weight: 700; line-height: 1.1; }
.chiffre-lib { font-size: 12px; color: var(--texte-faible); margin-top: 2px; }

.defilant { overflow-x: auto; overflow-y: hidden; max-width: 100%; -webkit-overflow-scrolling: touch; }

table.tableau { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 13px; }

.tableau th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--texte-doux);
  background: var(--gris-tete); padding: 9px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--bord);
}

.tableau td { padding: 9px 12px; border-bottom: 1px solid var(--bord-doux); vertical-align: middle; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover td { background: var(--bleu-pale); }

.mono { font-family: var(--mono); font-size: 12px; }

.etiquette {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  border-radius: 4px; padding: 2px 7px; background: var(--gris-tete);
  border: 1px solid var(--bord); color: var(--texte-doux); white-space: nowrap;
}

.etiquette-danger { background: var(--rouge-fond); border-color: var(--rouge-bord); color: var(--rouge-texte); }
.etiquette-ok { background: var(--vert-fond); border-color: var(--vert-bord); color: var(--vert-texte); }
.etiquette-info { background: var(--bleu-pale); border-color: #c3d8f0; color: var(--bleu-fonce); }

button.etiquette { cursor: pointer; font-family: var(--mono); }
button.etiquette:hover { border-color: var(--texte-faible); color: var(--texte); }

.champ {
  font: inherit; font-size: 13px; color: var(--texte); background: var(--blanc);
  border: 1px solid var(--bord); border-radius: 5px; padding: 7px 9px; max-width: 100%;
}

.champ:focus { border-color: var(--bleu); outline: none; box-shadow: 0 0 0 3px var(--bleu-pale); }

.barre-filtres { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.avis {
  border: 1px solid var(--bord); border-left: 4px solid var(--bleu);
  background: var(--bleu-pale); border-radius: 5px; padding: 12px 15px;
  font-family: var(--mono); font-size: 12px; line-height: 1.6;
  margin-bottom: 18px; max-height: 320px; overflow: auto;
}

.avis-brut { white-space: pre-wrap; }

.avis-erreur { background: var(--rouge-fond); border-color: var(--rouge-bord); border-left-color: var(--rouge-texte); color: var(--rouge-texte); }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pagination .courante { background: var(--bleu); border-color: var(--bleu); color: #fff; pointer-events: none; }

.mention {
  background: var(--info-fond); border: 1px solid var(--info-bord); border-radius: 5px;
  padding: 12px 15px; font-size: 12px; color: var(--info-texte); line-height: 1.55; margin-top: 18px;
}

@media (max-width: 860px) {
  .defilant { overflow: visible; }

  table.tableau { min-width: 0; }
  .tableau, .tableau tbody, .tableau tr, .tableau td { display: block; width: 100%; }
  .tableau thead { display: none; }

  .tableau tr {
    border: 1px solid var(--bord);
    border-radius: 6px;
    margin: 0 0 10px;
    background: var(--blanc);
  }

  .tableau tbody tr:hover td { background: transparent; }

  .tableau td {
    border: 0;
    border-bottom: 1px solid var(--bord-doux);
    padding: 9px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px 12px;
  }

  .tableau tr td:last-child { border-bottom: 0; }

  .tableau td::before {
    content: attr(data-label);
    flex: none;
    margin-right: auto;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--texte-doux);
  }

  .tableau td[data-label=""]::before, .tableau td:not([data-label])::before { display: none; }

  .tableau td > .champ { width: auto; min-width: 0; flex: 1 1 auto; }
  .tableau td > .bouton { width: 100%; justify-content: center; }
  .tableau td > .bouton-icone { width: auto; }
  .tableau td:last-child { justify-content: stretch; }

  .panneau-tete { flex-direction: column; align-items: stretch; }
  .panneau-tete .barre-filtres .champ { flex: 1 1 auto; }
}

@media (max-width: 720px) {
  .enveloppe { padding: 0 13px; }
  .bandeau-ligne { grid-template-columns: auto 1fr; gap: 12px; }
  .bandeau-titre { grid-column: 2; text-align: left; }
  .bandeau-titre h1 { font-size: 16.5px; }
  .bandeau-titre p { font-size: 12.5px; }
  .ecu { height: 42px; }
  .menu-ligne { flex-direction: column; align-items: stretch; gap: 0; }
  .compte { padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.2); justify-content: flex-end; }
  .catalogue { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 11px; }
  .appli { padding: 17px 10px 15px; }
  .appli-icone { width: 52px; height: 52px; }
  .appli-desc { display: none; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
