:root {
  --fond: #f6f3ee;
  --surface: #ffffff;
  --encre: #1c2430;
  --doux: #5d6673;
  --ligne: #e4dfd6;
  --accent: #0f6b4f;
  --accent-fonce: #0a5039;
  --accent-pale: #e3f0ea;
  --ocre: #c8892b;
  --danger: #b3261e;
  --rayon: 14px;
  --ombre: 0 1px 2px rgba(28, 36, 48, .05), 0 4px 16px rgba(28, 36, 48, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--encre);
  background: var(--fond);
}
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: .2em 0 .25em; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
code { background: var(--accent-pale); padding: .1em .35em; border-radius: 4px; }

.conteneur { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.conteneur { padding-top: 28px; padding-bottom: 48px; min-height: 70vh; }

/* ---------- Barre ---------- */
.barre { background: var(--encre); color: #fff; position: sticky; top: 0; z-index: 10; }
.barre-int { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.marque { color: #fff; text-decoration: none; font-family: Fraunces, Georgia, serif; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; margin-right: auto; }
.marque-pastille { color: var(--ocre); }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav-form button {
  color: rgba(255, 255, 255, .78); text-decoration: none; padding: 8px 12px; border-radius: 8px;
  font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer;
}
.nav a:hover, .nav-form button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a.actif { color: #fff; background: rgba(255, 255, 255, .12); }
.nav-form { margin: 0; }
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; padding: 6px 10px; }

@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .menu-ouvert .nav { display: flex; }
  .nav a, .nav-form button { width: 100%; text-align: left; }
}

/* ---------- En-tête de page ---------- */
.entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.sous-titre { color: var(--doux); margin: 0 0 16px; }
.entete .sous-titre { margin: 0; }
.recherche { display: flex; gap: 8px; flex: 1 1 340px; max-width: 480px; }
.recherche input { flex: 1; }

/* ---------- Filtres ---------- */
.filtres { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 28px; }
.puce {
  text-decoration: none; color: var(--encre); background: var(--surface); border: 1px solid var(--ligne);
  padding: 6px 14px; border-radius: 999px; font-weight: 500; font-size: .92rem; white-space: nowrap;
}
.puce span { color: var(--doux); font-weight: 400; margin-left: 4px; }
.puce:hover { border-color: var(--accent); }
.puce.actif { background: var(--accent); border-color: var(--accent); color: #fff; }
.puce.actif span { color: rgba(255, 255, 255, .75); }

/* ---------- Groupes & cartes ---------- */
.groupe { margin-bottom: 40px; }
.groupe h2 { font-size: 1.35rem; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--ligne); display: flex; align-items: baseline; gap: 10px; }
.compte { font: 600 .8rem Inter, sans-serif; color: var(--accent); background: var(--accent-pale); padding: 2px 9px; border-radius: 999px; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.carte {
  background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 22px 18px 18px;
  text-align: center; display: flex; flex-direction: column; align-items: center; transition: transform .15s, box-shadow .15s;
  min-width: 0;
}
.carte:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(28, 36, 48, .06), 0 10px 28px rgba(28, 36, 48, .1); }
.carte-lien { color: inherit; text-decoration: none; display: flex; flex-direction: column; align-items: center; width: 100%; }
.carte h3 { font-size: 1.05rem; margin: 14px 0 4px; }
.structure { color: var(--doux); margin: 0 0 8px; font-size: .92rem; }
.email { font-size: .88rem; overflow-wrap: anywhere; }
.carte-actions { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--ligne); width: 100%; font-size: .88rem; }

.avatar {
  width: 96px; height: 96px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-fonce));
  display: grid; place-items: center; color: #fff; box-shadow: 0 0 0 4px var(--accent-pale);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar span { font: 600 1.9rem Fraunces, Georgia, serif; }
.avatar-grand { width: 168px; height: 168px; }
.avatar-grand span { font-size: 3.2rem; }

/* ---------- Fiche ---------- */
.retour { display: inline-block; margin-bottom: 14px; text-decoration: none; font-weight: 500; }
.fiche { background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 32px; display: flex; gap: 36px; align-items: flex-start; flex-wrap: wrap; }
.fiche-infos { flex: 1 1 300px; min-width: 0; }
.etiquette { display: inline-block; background: var(--accent-pale); color: var(--accent); font-weight: 600; font-size: .82rem; padding: 3px 10px; border-radius: 999px; margin: 0; }
.fiche dl { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 10px 18px; margin: 22px 0; }
.fiche dt { color: var(--doux); }
.fiche dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.meta { color: var(--doux); font-size: .85rem; margin-top: 18px; }
@media (max-width: 560px) {
  .fiche { padding: 22px; justify-content: center; }
  .fiche dl { grid-template-columns: 1fr; gap: 2px; }
  .fiche dd { margin-bottom: 10px; }
}

/* ---------- Formulaires ---------- */
input[type=text], input:not([type]), input[type=email], input[type=password], input[type=search], select {
  width: 100%; font: inherit; color: var(--encre); background: var(--surface);
  border: 1px solid var(--ligne); border-radius: 10px; padding: 10px 12px;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-pale); }
label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: 6px; }
label.case { font-weight: 400; display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.formulaire { background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 28px; }
.champ { margin-bottom: 18px; }
.grille-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.champ-large { grid-column: 1 / -1; }
@media (max-width: 640px) { .grille-form { grid-template-columns: 1fr; } .formulaire { padding: 20px; } }
.form-photo { display: flex; gap: 24px; align-items: center; margin-bottom: 26px; padding-bottom: 24px; border-bottom: 1px solid var(--ligne); flex-wrap: wrap; }
.form-photo > div:last-child { flex: 1 1 240px; }
.aide { color: var(--doux); font-size: .84rem; margin: 6px 0 0; }
.erreur-champ { color: var(--danger); font-size: .86rem; margin: 6px 0 0; }

.btn {
  display: inline-block; font: 600 .95rem Inter, sans-serif; text-decoration: none; cursor: pointer;
  background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 10px; padding: 10px 18px;
}
.btn:hover { background: var(--accent-fonce); }
.btn-sec { background: var(--surface); color: var(--accent); }
.btn-sec:hover { background: var(--accent-pale); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #e6b7b3; }
.btn-danger:hover { background: #fbeceb; }
.btn-plein { width: 100%; }
.recherche button { font: 600 .95rem Inter, sans-serif; background: var(--encre); color: #fff; border: 0; border-radius: 10px; padding: 0 16px; cursor: pointer; }
.btn-lien { background: none; border: 0; color: var(--accent); font: 500 .9rem Inter, sans-serif; cursor: pointer; padding: 6px; white-space: nowrap; }
.btn-lien.danger { color: var(--danger); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

/* ---------- Alertes ---------- */
.alerte { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 500; }
.alerte-succes { background: var(--accent-pale); color: var(--accent-fonce); }
.alerte-erreur { background: #fbeceb; color: var(--danger); }
.alerte-info { background: #fdf3e2; color: #7a5212; }

/* ---------- Divers ---------- */
.vide { text-align: center; padding: 56px 16px; color: var(--doux); background: var(--surface); border-radius: var(--rayon); border: 1px dashed var(--ligne); }
.boite-connexion { max-width: 440px; margin: 24px auto; }
.ligne-ajout { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.ligne-ajout input { flex: 1 1 260px; }
.tableau-conteneur { background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; }
.tableau th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); padding: 12px 16px; border-bottom: 1px solid var(--ligne); }
.tableau td { padding: 8px 16px; border-bottom: 1px solid var(--ligne); }
.tableau tr:last-child td { border-bottom: 0; }
.num { text-align: center; width: 90px; }
.droite { text-align: right; width: 110px; }
.renommer { display: flex; gap: 6px; align-items: center; margin: 0; }
.renommer input { border-color: transparent; background: transparent; padding: 8px; min-width: 160px; }
.renommer input:hover { border-color: var(--ligne); }
.pied { color: var(--doux); font-size: .85rem; padding: 24px 16px 36px; text-align: center; }
