/* ===========================================================
   Refuge des Tilleuls — système de design
   Repris pixel-perfect du prototype Claude Design.
   =========================================================== */

:root {
  --bg:        #f7f1e8;
  --card:      #fffdf9;
  --border:    #e9dfd2;
  --border2:   #e2d5c2;
  --ink:       #2b2622;
  --muted:     #8a7c6e;
  --muted2:    #6f6355;
  --primary:   #d97750;
  --primary-d: #c9663f;
  --primary-dd:#a8502e;
  --green:     #3f5a4a;
  --green-d:   #344c3e;
  --soft:      #f3ebdf;
  --soft2:     #faf4ea;
  --peach:     #fdf0e8;
  --peach-br:  #f0d9c9;
  --greentint: #e9efe9;
  --yellow:    #f5ecd8;
  --purple:    #efe7f0;
  --red-bg:    #f8e5e2;
  --red:       #a8433a;
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body:    'Albert Sans', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: var(--body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary-d); text-decoration: none; }
a:hover { color: var(--primary-dd); text-decoration: underline; }
::selection { background: var(--peach-br); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.01em; }

/* ---------- Structure ---------- */
.app { display: flex; height: 100vh; min-height: 720px; overflow: hidden; }
.main { flex: 1; overflow-y: auto; padding: 32px 40px; }
.wrap { margin: 0 auto; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 232px; flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 14px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; background: var(--primary);
  display: grid; place-items: center; color: var(--card);
  font-family: var(--display); font-weight: 700; font-size: 17px;
}
/* Icône de la plateforme (public_html/assets/brand/) à la place des initiales. */
.brand-logo.has-img, .mobile-logo.has-img { background: none; overflow: hidden; flex-shrink: 0; }
.brand-logo.has-img img, .mobile-logo.has-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.1; }
.brand-sub  { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* La navigation défile seule : le pied de barre (capacité, compte) reste visible.
   Ascenseur discret, affiché uniquement si le menu dépasse vraiment. */
.nav {
  display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-height: 0;
  overflow-y: auto; margin: 0 -4px; padding: 0 4px;
  scrollbar-width: thin; scrollbar-color: var(--border2) transparent;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; border: none;
  font: inherit; font-size: 14px; padding: 7px 12px; border-radius: 10px;
  cursor: pointer; text-align: left; background: transparent;
  color: var(--muted2); font-weight: 500; text-decoration: none;
}
.nav-item:hover { background: var(--soft); text-decoration: none; color: var(--muted2); }
.nav-item.active { background: var(--peach); color: var(--primary-d); font-weight: 700; }
.nav-item.active:hover { color: var(--primary-d); }
.nav-item > svg { flex-shrink: 0; }

/* Regroupement par intention : Animaux / Personnes / Activité / Administration. */
.nav-section { display: flex; flex-direction: column; gap: 2px; margin-top: 9px; }
.nav-section:first-child { margin-top: 0; }
.nav-section-title {
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); padding: 0 12px 2px;
}

/* Entrée dépliable (annuaire) : une seule cible, la ligne entière. La liste
   complète est la première sous-entrée ; le chevron n'est qu'un indicateur. */
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-toggle.is-current { color: var(--primary-d); font-weight: 700; }
.nav-caret { display: grid; place-items: center; color: var(--muted); flex-shrink: 0; }
.nav-toggle.is-current .nav-caret { color: var(--primary-d); }
.nav-caret svg { display: block; transition: transform .22s ease; }
.nav-group.is-open .nav-caret svg { transform: rotate(180deg); }

/* Déroulé vers le bas : 0fr → 1fr anime la hauteur réelle, sans valeur magique. */
.nav-sub { display: grid; grid-template-rows: 0fr; margin-left: 25px; }
.nav-ready .nav-sub { transition: grid-template-rows .24s ease; }
.nav-group.is-open .nav-sub { grid-template-rows: 1fr; }
/* Pas de marge verticale ici : elle empêcherait la rangée de retomber à 0
   une fois repliée (le padding compte, même avec min-height: 0). */
.nav-sub-inner {
  overflow: hidden; min-height: 0; display: flex; flex-direction: column; gap: 2px;
  padding-left: 9px; border-left: 1px solid var(--border);
}
.nav-sub-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; padding: 5px 10px; border-radius: 8px;
  color: var(--muted2); font-weight: 500; text-decoration: none;
}
.nav-sub-item:hover { background: var(--soft); color: var(--muted2); text-decoration: none; }
.nav-sub-item.active { background: var(--peach); color: var(--primary-d); font-weight: 700; }
.nav-sub-item.active:hover { color: var(--primary-d); }
.nav-sub-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.nav-sub-item.active .nav-count { color: var(--primary-d); }
@media (prefers-reduced-motion: reduce) {
  .nav-ready .nav-sub { transition: none; }
  .nav-caret svg { transition: none; }
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.lang-switch { display: flex; gap: 4px; background: var(--soft); border-radius: 10px; padding: 3px; }
.lang-opt {
  flex: 1; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  color: var(--muted2); padding: 5px 0; border-radius: 8px; text-decoration: none;
}
.lang-opt:hover { color: var(--primary-d); text-decoration: none; background: var(--peach); }
.lang-opt.active { background: var(--card); color: var(--primary-d); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.lang-opt.active:hover { color: var(--primary-d); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.user-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 4px; margin: -4px; border-radius: 10px; text-decoration: none; color: inherit; }
.user-link:hover { background: var(--soft); text-decoration: none; color: inherit; }
.user-link.active { background: var(--peach); }
.user-ava {
  width: 32px; height: 32px; border-radius: 50%; background: var(--green);
  color: var(--card); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--muted); }
.logout-btn { border: none; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; font: inherit; }
.logout-btn:hover { color: var(--ink); }

/* ---------- En-têtes de page ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-eyebrow { font-size: 13px; color: var(--muted); font-weight: 500; }
.page-title { font-size: 30px; font-weight: 700; margin: 4px 0 0; }
.head-actions { display: flex; gap: 10px; }

.back-link {
  display: inline-flex; align-items: center; gap: 8px; border: none; background: transparent;
  color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 6px 8px; margin: -6px 0 14px -8px; border-radius: 8px; cursor: pointer;
}
.back-link:hover { background: var(--soft); color: var(--ink); text-decoration: none; }

/* ---------- Boutons ---------- */
.btn {
  border: 1px solid var(--border); background: var(--card); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; padding: 10px 18px;
  border-radius: 12px; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; gap: 8px; line-height: 1;
}
.btn:hover { background: var(--soft); text-decoration: none; color: var(--ink); }
.btn-primary { border: none; background: var(--primary); color: var(--card); }
.btn-primary:hover { background: var(--primary-d); color: var(--card); }
/* Bouton désactivé (étape verrouillée par le vote, signature incomplète…) : le motif est dans le title. */
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--card); }
.btn-primary:disabled:hover { background: var(--primary); }
.btn-green { border: none; background: var(--green); color: var(--card); }
.btn-green:hover { background: var(--green-d); color: var(--card); }
.btn-sm { font-size: 12.5px; padding: 6px 12px; border-radius: 9px; }
.btn-xs { font-size: 12px; padding: 5px 11px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn-ghost { border: 1px solid var(--border); background: var(--card); font-size: 13px; padding: 9px 14px; border-radius: 10px; }

/* ---------- Cartes ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 22px 24px; }
.card-sm { border-radius: 16px; padding: 18px 20px; }
.card-title { font-family: var(--display); font-size: 18px; font-weight: 700; margin: 0 0 14px; }
.card-title-sm { font-size: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head .card-title { margin: 0; }

.grid { display: grid; gap: 20px; align-items: start; }
.grid-kpi { grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.g-1-360 { grid-template-columns: 1fr 360px; }
.g-1-400 { grid-template-columns: 1fr 400px; }
.g-340-1 { grid-template-columns: 340px 1fr; }
.g-380-1 { grid-template-columns: 380px 1fr; }
.g-400-1 { grid-template-columns: 400px 1fr; }
.g-half  { grid-template-columns: 1fr 1fr; }
.col { display: flex; flex-direction: column; gap: 20px; }

/* ---------- KPI ---------- */
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-value { font-family: var(--display); font-size: 32px; font-weight: 700; margin-top: 6px; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi-sub.up { color: var(--green); font-weight: 600; }
.kpi-sub.warn { color: var(--primary-d); }
.kpi-value.warn { color: var(--primary-d); }
.kpi-dark { background: var(--green); border-color: var(--green); color: #f4f1ea; }
.kpi-dark .kpi-label, .kpi-dark .kpi-sub { color: #c5d1c8; }

/* ---------- Alerte ---------- */
.alert {
  display: flex; align-items: center; gap: 12px; background: var(--peach);
  border: 1px solid var(--peach-br); border-radius: 14px; padding: 14px 18px; margin-bottom: 24px;
}
.alert-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.alert-text { font-size: 14px; }
.alert-link { margin-left: auto; font-size: 13px; font-weight: 600; white-space: nowrap; }
.alert + .alert { margin-top: -14px; }

/* ---------- Badges ---------- */
.badge {
  font-size: 12px; font-weight: 600; border-radius: 999px; padding: 5px 12px;
  white-space: nowrap; display: inline-block;
}
.badge-sm { padding: 4px 10px; }
.badge-green  { color: var(--green); background: var(--greentint); }
.badge-peach  { color: var(--primary-d); background: var(--peach); }
.badge-yellow { color: #9a7420; background: var(--yellow); }
.badge-purple { color: #7a5a80; background: var(--purple); }
.badge-grey   { color: var(--muted2); background: var(--soft); }
.badge-red    { color: var(--red); background: var(--red-bg); }

/* ---------- Listes / lignes ---------- */
.row-list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 12px 10px;
  border-radius: 12px; cursor: pointer; border-bottom: 1px solid var(--soft);
  text-decoration: none; color: inherit;
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--soft2); text-decoration: none; color: inherit; }
.row-main { min-width: 0; flex: 1; }
.row-name { font-size: 15px; font-weight: 600; }
.row-meta { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.row-col { font-size: 12.5px; color: var(--muted); }
.row-col-sub { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Repris dans la ligne de détail quand les colonnes sont masquées (mobile). */
.row-narrow { display: none; }

.filters { display: flex; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--card); color: var(--muted2);
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px;
  border-radius: 999px; cursor: pointer; text-decoration: none;
}
.chip:hover { border-color: #d9c9b2; text-decoration: none; color: var(--muted2); }
.chip.active { border-color: var(--primary); background: var(--peach); color: var(--primary-d); }
.chip-sm { padding: 3px 9px; font-size: 12px; }

/* ---------- Recherche avancée (liste des animaux) ---------- */
.adv-search { border-top: 1px solid var(--border); margin: 0 -18px; padding: 0 18px; }
.adv-search > summary {
  cursor: pointer; list-style: none; padding: 12px 0;
  font-size: 13px; font-weight: 700; color: var(--muted2);
  display: flex; align-items: center; gap: 8px;
}
.adv-search > summary::-webkit-details-marker { display: none; }
.adv-search > summary::before {
  content: '▸'; display: inline-block; transition: transform .15s ease; color: var(--primary);
}
.adv-search[open] > summary::before { transform: rotate(90deg); }
.adv-search > summary:hover { color: var(--ink); }
.adv-form { padding-bottom: 6px; }
.adv-form .form-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.adv-count {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--border); margin: 0 -18px 4px; padding: 10px 18px 0;
  font-size: 12.5px; color: var(--muted2);
}
.adv-per { display: flex; align-items: center; gap: 5px; }

/* ---------- Checklist ---------- */
.check-row { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 10px; cursor: pointer; text-decoration: none; color: inherit; }
.check-row:hover { background: var(--soft2); text-decoration: none; color: inherit; }
.check-box {
  width: 20px; height: 20px; border-radius: 7px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--card); border: 1.5px solid #d9c9b2;
}
.check-box.done { background: var(--green); border-color: var(--green); }
.check-label { font-size: 14px; font-weight: 600; }
.check-label.done { color: #a99c8c; text-decoration: line-through; }
.check-sub { font-size: 12px; color: var(--muted); }
.check-time { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---------- Fiche : champs ---------- */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.field-label { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.field-value { font-size: 14px; font-weight: 600; margin-top: 2px; }
.field-full { grid-column: 1 / -1; }
.tabnum { font-variant-numeric: tabular-nums; }

/* ---------- Traits ---------- */
.traits { display: flex; flex-wrap: wrap; gap: 8px; }
.trait { font-size: 12.5px; font-weight: 600; color: var(--green); background: var(--greentint); border-radius: 999px; padding: 5px 12px; }
.note-p { font-size: 13.5px; line-height: 1.55; color: var(--muted2); margin: 14px 0 0; }

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; padding-bottom: 16px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 10px; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--green); }
.tl-dot.last { background: var(--primary); }
.tl-line { width: 2px; flex: 1; background: #f0e5d4; margin-top: 4px; }
.tl-date { font-size: 12px; color: var(--muted); font-weight: 600; }
.tl-label { font-size: 13.5px; font-weight: 600; margin-top: 2px; }
.tl-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.tl-text { font-size: 13.5px; line-height: 1.5; margin-top: 3px; }

/* ---------- Documents ---------- */
.doc {
  display: flex; align-items: center; gap: 12px; border: 1px solid #f0e5d4;
  border-radius: 12px; padding: 10px 12px; text-decoration: none; color: inherit;
}
.doc:hover { background: var(--soft2); border-color: var(--border2); text-decoration: none; color: inherit; }
.doc-tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: 0.03em; flex-shrink: 0; }
.doc-tile.PDF { background: var(--peach); color: var(--primary-d); }
.doc-tile.IMG { background: var(--greentint); color: var(--green); }
.doc-tile.DOC { background: var(--yellow); color: #9a7420; }
.doc-label { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.dashed { border: 1.5px dashed #d9c9b2; border-radius: 12px; padding: 12px; text-align: center; font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ---------- Tableaux (grille) ---------- */
.tbl-head, .tbl-row { display: grid; gap: 8px; align-items: center; }
.tbl-head {
  font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 0 8px 8px; border-bottom: 1px solid var(--soft);
}
.tbl-row { font-size: 13.5px; padding: 11px 8px; border-bottom: 1px solid var(--soft); text-decoration: none; color: inherit; }
.tbl-row:hover { background: var(--soft2); text-decoration: none; color: inherit; }
.tbl-row:last-child { border-bottom: none; }

/* Pagination des longues listes (pager_links) */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding-top: 14px; }
.pager > :first-child { justify-self: start; }
.pager > :last-child { justify-self: end; }
.pager-pages { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pager-num {
  min-width: 32px; height: 32px; padding: 0 8px; box-sizing: border-box; display: inline-grid; place-items: center;
  border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted2); text-decoration: none;
  font-variant-numeric: tabular-nums;
}
a.pager-num:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.pager-num.active { background: var(--peach); color: var(--primary-d); }
.pager-gap { color: var(--muted); font-size: 13px; padding: 0 2px; }
@media (max-width: 520px) { .pager-lbl { display: none; } }

/* Liste des dons : colonnes de largeur fixe, identiques pour chaque ligne
   (des colonnes « auto » prenaient la largeur de leur badge, ligne par ligne,
   et décalaient toutes les autres). */
.don-cols { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 96px 92px 104px 32px; }
.don-cols .don-amount { text-align: right; padding-right: 10px; }
.tbl-row.don-cols { cursor: default; }
.cell-trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-filters.don-filters { margin-bottom: 14px; gap: 8px; }
.don-filters .dir-search { min-width: 180px; }
.don-period { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.don-period label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted2); }
.don-period input { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink); }
.don-who { display: flex; flex-direction: column; min-width: 0; }
.don-sub { display: none; font-size: 12px; color: var(--muted); margin-top: 2px; }
@media (max-width: 620px) {
  /* Sur téléphone : donateur (avec date et type en dessous) et montant ;
     l'état du reçu reste accessible par la recherche. */
  .don-cols { grid-template-columns: minmax(0, 1fr) 76px 32px; }
  .don-cols .don-type, .don-cols .don-date, .don-cols .don-receipt { display: none; }
  .don-sub { display: block; }
  .don-filters .dir-search { flex: 1 1 100%; min-width: 0; }
  .don-filters select { flex: 1 1 40%; min-width: 0; }
  .don-period { flex: 1 1 100%; }
  .don-period label { flex: 1 1 40%; }
  .don-period input { flex: 1; min-width: 0; }
}
.muted { color: var(--muted2); }
.strong { font-weight: 600; }
.due-warn { color: var(--primary-d); font-weight: 600; font-size: 13px; }
.due-ok { color: var(--muted); font-weight: 600; font-size: 13px; }

/* ---------- Photo ---------- */
.photo-slot {
  width: 100%; height: 260px; border-radius: 12px; overflow: hidden;
  background: var(--soft); display: grid; place-items: center; color: var(--muted);
  font-size: 13px; font-weight: 600;
}
.photo-slot { position: relative; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
/* Libellé d'attente, recouvert par la photo dès qu'elle arrive. */
.photo-slot-ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 12px; text-align: center; }

/* ---------- Poids (courbe) ---------- */
.weight-big { font-family: var(--display); font-size: 28px; font-weight: 700; }
.weight-cap { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ---------- Stepper ---------- */
.stepper { display: flex; align-items: flex-start; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; position: relative; min-width: 0; }
.step-conn { position: absolute; top: 17px; left: calc(50% + 22px); width: calc(100% - 44px); height: 2px; background: var(--border); }
.step-conn.on { background: var(--green); }
.step-circle {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13.5px; font-weight: 700; position: relative; z-index: 1;
  background: var(--card); color: var(--muted); border: 1.5px solid #d9c9b2;
}
.step-circle.done { background: var(--green); color: var(--card); border-color: var(--green); }
.step-circle.current { background: var(--primary); color: var(--card); border-color: var(--primary); }
.step-label { font-size: 12.5px; font-weight: 600; text-align: center; color: var(--muted); }
.step-label.done { color: var(--green); }
.step-label.current { color: var(--primary-d); }

/* ---------- Progress ---------- */
.progress { height: 6px; border-radius: 3px; background: var(--border2); overflow: hidden; }
.progress > div { height: 100%; border-radius: 3px; }
.pbar-green { background: var(--green); }
.pbar-primary { background: var(--primary); }

/* ---------- Blocs colorés ---------- */
.panel-green { background: var(--green); border-radius: 18px; padding: 22px 24px; color: #f4f1ea; }
.panel-green .eyebrow { font-size: 11.5px; color: #c5d1c8; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.panel-green .big { font-family: var(--display); font-size: 20px; font-weight: 700; margin-top: 8px; }
.panel-green .sub { font-size: 13px; color: #c5d1c8; margin-top: 4px; }
.eyebrow { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.tile-soft { background: var(--soft2); border-radius: 12px; padding: 12px 14px; }

/* ---------- Interrupteurs ---------- */
.switch { width: 38px; height: 22px; border-radius: 11px; flex-shrink: 0; padding: 2px; transition: background .15s; background: #d9c9b2; border: none; cursor: pointer; }
.switch.on { background: var(--green); }
.switch-knob { width: 18px; height: 18px; border-radius: 50%; background: var(--card); transition: transform .15s; display: block; }
.switch.on .switch-knob { transform: translateX(16px); }

/* ---------- Graphiques ---------- */
.bars { display: flex; align-items: flex-end; gap: 18px; height: 200px; padding: 0 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 44px; border-radius: 8px 8px 4px 4px; background: var(--border2); }
.bar.last { background: var(--primary); }
.bar-val { font-size: 12.5px; font-weight: 700; }
.bar-month { font-size: 12px; color: var(--muted); font-weight: 600; }
.hbar-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.hbar-label { width: 160px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.hbar-track { flex: 1; height: 10px; background: var(--soft); border-radius: 5px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 5px; }
.hbar-n { width: 26px; text-align: right; font-size: 13px; font-weight: 700; }
.donut { width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.donut-hole { width: 78px; height: 78px; border-radius: 50%; background: var(--card); display: grid; place-items: center; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted2); margin-bottom: 6px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; border: 1px solid var(--border2); background: var(--card); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 14px; color: var(--ink);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,119,80,.15);
}
.form-field textarea { min-height: 84px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--green); }

/* ---------- Modales ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(43,38,34,.45); display: none;
  place-items: center; z-index: 50; padding: 24px;
}
.modal-overlay.open { display: grid; }
.modal {
  background: var(--card); border-radius: 20px; padding: 26px 30px 28px; width: 580px;
  max-width: 100%; max-height: calc(100vh - 48px); overflow-y: auto;
  box-shadow: 0 24px 60px rgba(43,38,34,.28);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-family: var(--display); font-size: 21px; font-weight: 700; margin: 0; }
.modal-close {
  border: none; background: var(--soft); color: var(--muted2); width: 30px; height: 30px;
  border-radius: 50%; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.modal-close:hover { background: var(--border); }

/* ---------- Toast (flash) ---------- */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--card); font-size: 14px; font-weight: 600;
  padding: 13px 24px; border-radius: 14px; z-index: 60;
  box-shadow: 0 12px 32px rgba(43,38,34,.35); animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- Login ---------- */
/* Colonne minmax(0, 1fr) : sans elle, la piste prend la largeur de la carte (400px) et la page déborde sur téléphone. */
.login-wrap { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px; }
.login-card { width: 400px; max-width: 100%; }
.login-logo { width: 52px; height: 52px; border-radius: 15px; background: var(--primary); display: grid; place-items: center; color: var(--card); font-family: var(--display); font-weight: 700; font-size: 22px; margin-bottom: 18px; }
.login-brand { display: block; max-height: 64px; max-width: 240px; margin-bottom: 18px; }
.login-error { background: var(--red-bg); color: var(--red); font-size: 13px; font-weight: 600; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }
.login-ok { background: var(--greentint); color: var(--green-d); font-size: 13px; font-weight: 600; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }
.login-link { font-size: 13px; font-weight: 600; color: var(--primary-d); }
.login-link:hover { text-decoration: underline; }

/* Rangée de toutes les langues (pages d'authentification) : sans JS, compatible CSP. */
.lang-flags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--border); }
.lang-flags .flag { width: 28px; height: 19px; display: block; }
.lang-flag { display: inline-flex; padding: 3px; border-radius: 7px; border: 1px solid transparent; line-height: 0; opacity: .62; transition: opacity .15s, border-color .15s, transform .1s; }
.lang-flag:hover { opacity: 1; border-color: var(--peach-br); transform: translateY(-1px); }
.lang-flag.active { opacity: 1; border-color: var(--primary); }

/* Téléphone : carte pleine largeur, champs à 16px (sinon iOS zoome à la saisie) et cibles tactiles d'au moins 44px. */
@media (max-width: 520px) {
  .login-wrap { padding: 16px; }
  .login-card { padding: 24px 20px; }
  .login-card .form-field label { font-size: 13px; }
  .login-card .form-field input { font-size: 16px; padding: 12px 14px; }
  .login-card .btn-block { font-size: 16px; padding: 16px 18px; }
  .login-link { display: inline-block; font-size: 14px; padding: 12px 0; margin: -4px 0; }
  .login-card .lang-flags { flex-wrap: nowrap; gap: 2px; }
  .login-card .lang-flag { flex: 1 1 0; min-width: 0; max-width: 48px; justify-content: center; padding: 11px 0; }
}

/* ---------- Utilitaires ---------- */
.mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }
.gap-10 { display: flex; gap: 10px; }
.center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.items-center { align-items: center; }
.gap8 { gap: 8px; }
.rdv-date { width: 44px; text-align: center; background: var(--soft); border-radius: 10px; padding: 6px 0; flex-shrink: 0; }
.rdv-day { font-family: var(--display); font-size: 15px; font-weight: 700; line-height: 1; }
.rdv-month { font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; }

@media (max-width: 1100px) {
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .g-1-360, .g-1-400, .g-340-1, .g-380-1, .g-400-1, .g-half { grid-template-columns: 1fr; }
}

/* ---- Recherche globale ---- */
.gsearch { position: relative; padding: 0 8px 14px; }
.gsearch-ico { position: absolute; left: 18px; top: 9px; color: var(--muted); pointer-events: none; }
.gsearch-input {
  width: 100%; box-sizing: border-box; padding: 8px 10px 8px 32px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--soft);
  font: inherit; font-size: 13px; color: var(--ink);
}
.gsearch-input:focus { outline: none; border-color: var(--primary); background: var(--card); }
.gsearch-panel {
  position: absolute; left: 8px; top: 100%; z-index: 60;
  width: 320px; max-width: 78vw; max-height: 62vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(40, 30, 15, .16); padding: 6px;
}
.gs-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px 4px; }
.gs-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; text-decoration: none; color: inherit; }
.gs-item:hover, .gs-item.active { background: var(--soft); text-decoration: none; color: inherit; }
.gs-ava { width: 30px; height: 30px; border-radius: 9px; background: var(--muted2); color: #fffdf9; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0; font-family: var(--display); }
.gs-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.gs-label { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-meta { font-size: 11px; font-weight: 600; color: var(--muted2); flex-shrink: 0; }
.gs-empty { padding: 12px 12px 14px; font-size: 13px; color: var(--muted); }

/* ---- Gestionnaires de mots de passe : hors des champs de recherche ----
   LastPass, 1Password, Dashlane & co ignorent souvent autocomplete="off" et
   data-lpignore : on neutralise en plus l'icône qu'ils injectent dans le champ. */
.gsearch-input, .dir-search, .ss-search, .dir-filters input[type="search"] {
  background-image: none !important;
}
/* Recherche globale et bascule de refuge sont en type="search" (un champ de
   recherche n'est pas proposé au remplissage) : sans l'habillage natif. */
.gsearch-input[type="search"] { -webkit-appearance: none; appearance: none; }
.gsearch-input::-webkit-search-cancel-button,
.gsearch-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.gsearch [data-lastpass-icon-root],
.gsearch [data-lastpass-infield],
.gsearch-input ~ [data-lastpass-icon-root],
.dir-search ~ [data-lastpass-icon-root],
.ss-search ~ [data-lastpass-icon-root],
.gsearch com-1password-button,
.gsearch [data-dashlanecreated],
.gsearch [data-bitwarden-watching] + div[style*="position: absolute"] {
  display: none !important;
}

/* ---- Sélecteur de langue (drapeaux + nom) ---- */
.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 10px; background: var(--soft); font-size: 13px; font-weight: 600; color: var(--muted2);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { background: var(--peach); color: var(--primary-d); }
.lang-menu .lang-name { flex: 1; }
.lang-caret { transition: transform .18s; flex-shrink: 0; }
.lang-menu[open] .lang-caret { transform: rotate(180deg); }
.lang-list {
  position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(40, 30, 15, .16); padding: 5px; display: flex; flex-direction: column; gap: 2px;
}
.lang-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted2); text-decoration: none; }
.lang-row:hover { background: var(--soft); text-decoration: none; color: var(--primary-d); }
.lang-row.active { background: var(--peach); color: var(--primary-d); }
.flag { display: inline-block; width: 22px; height: 15px; border-radius: 3px; overflow: hidden; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.flag svg { display: block; width: 100%; height: 100%; }

/* ---- Bascule liste / trombinoscope ---- */
.view-toggle { display: flex; gap: 2px; background: var(--soft); border-radius: 10px; padding: 3px; }
.view-opt { display: grid; place-items: center; width: 32px; height: 30px; border-radius: 8px; color: var(--muted); }
.view-opt:hover { color: var(--primary-d); background: var(--peach); text-decoration: none; }
.view-opt.active { background: var(--card); color: var(--primary-d); box-shadow: 0 1px 2px rgba(0, 0, 0, .07); }

/* ---- Vignette dans la liste ---- */
.row-thumb { width: 42px; height: 42px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }

/* ---- Trombinoscope (colonnes adaptatives) ---- */
.tromb { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; padding: 6px 0; }
@media (max-width: 720px)  { .tromb { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; } }
.tromb-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--card); text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.tromb-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(40, 30, 15, .12); text-decoration: none; color: inherit; }
.tromb-photo { position: relative; aspect-ratio: 4 / 3; background: var(--soft); }
.tromb-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tromb-ph { width: 100% !important; height: 100% !important; border-radius: 0 !important; font-size: 28px !important; }
.tromb-badge { position: absolute; top: 8px; left: 8px; }
.tromb-body { padding: 11px 13px 13px; }
.tromb-name { font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.15; }
.tromb-meta { font-size: 12.5px; color: var(--muted2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tromb-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---- Accueil : dernières arrivées ---- */
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.dash-head { align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
/* Vignettes plafonnées à 170 px : elles ne s'étirent plus sur toute la largeur de la carte. */
.arrivals { display: grid; grid-template-columns: repeat(6, minmax(0, 170px)); gap: 14px; }
@media (max-width: 1280px) { .arrivals { grid-template-columns: repeat(3, minmax(0, 170px)); } }
@media (max-width: 560px)  { .arrivals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
.arr-card { display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: inherit; }
.arr-card:hover { text-decoration: none; color: inherit; }
.arr-photo {
  position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--soft);
  transition: transform .15s, box-shadow .15s;
}
.arr-card:hover .arr-photo { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(40, 30, 15, .14); }
.arr-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.arr-card:hover .arr-photo img { transform: scale(1.04); }
.arr-ph {
  width: 100%; height: 100%; display: grid; place-items: center; color: #fffdf9;
  font-family: var(--display); font-weight: 700; font-size: 36px; background: linear-gradient(150deg, #cfa54d, #a87a24);
}
.arr-ph-chien { background: linear-gradient(150deg, #e69572, #c9663f); }
.arr-ph-chat  { background: linear-gradient(150deg, #5d806b, #344c3e); }
/* Voile en bas de photo : garde la date d'arrivée lisible sur n'importe quelle image. */
.arr-shade { position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(to top, rgba(28, 20, 10, .55), rgba(28, 20, 10, 0)); pointer-events: none; }
.arr-status { position: absolute; top: 9px; left: 9px; box-shadow: 0 1px 4px rgba(40, 30, 15, .12); }
.arr-when {
  position: absolute; left: 11px; bottom: 9px; max-width: calc(100% - 20px); display: flex; align-items: center; gap: 5px;
  color: #fffdf9; font-size: 12px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.arr-when svg { flex-shrink: 0; }
.arr-when-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Arrivé depuis moins d'une semaine : la date devient une pastille. */
.arr-when.is-new {
  left: 9px; bottom: 8px; padding: 3px 9px 3px 7px; border-radius: 999px; background: var(--primary);
  text-shadow: none; font-weight: 700; box-shadow: 0 1px 4px rgba(40, 30, 15, .2);
}
.arr-body { padding: 8px 2px 0; min-width: 0; }
.arr-name { display: flex; align-items: baseline; gap: 6px; font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.2; }
.arr-name-txt { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arr-sex { font-size: 14px; font-weight: 700; flex-shrink: 0; }
.arr-sex-m { color: #4f7699; }
.arr-sex-f { color: #b8577a; }
.arr-meta { font-size: 12.5px; color: var(--muted2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arr-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Accueil : adoptions en cours ---- */
.pipe { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pipe-step {
  flex: 1 1 0; min-width: 96px; background: var(--card); border: 1px solid var(--border);
  border-top: 3px solid var(--border2); border-radius: 12px; padding: 10px 12px 11px;
  font: inherit; color: inherit; text-align: left; cursor: pointer; transition: box-shadow .15s, transform .15s;
}
.pipe-step:not(:disabled):hover { box-shadow: 0 4px 12px rgba(40, 30, 15, .1); transform: translateY(-1px); }
.pipe-step:disabled { cursor: default; }
.pipe-step:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pipe-step.is-active { box-shadow: 0 0 0 2px var(--ink); }
.pipe-step .pipe-n, .pipe-step .pipe-label { display: block; }
.pipe-filter { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: -6px 0 10px; font-size: 13px; font-weight: 600; color: var(--muted2); }
.pipe-filter[hidden], .adopt-row[hidden], .adopt-more[hidden] { display: none; }
.pipe-reset { font: inherit; font-size: 12.5px; font-weight: 600; border: none; background: none; color: var(--primary-d); cursor: pointer; padding: 0; }
.pipe-reset:hover { text-decoration: underline; }
.pipe-step.on { background: var(--peach); border-color: var(--peach-br); border-top-color: var(--primary); }
.pipe-step.final { background: var(--greentint); border-color: #d3dfd5; border-top-color: var(--green); }
.pipe-n { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1; color: var(--muted); }
.pipe-step.on .pipe-n { color: var(--primary-dd); }
.pipe-step.final .pipe-n { color: var(--green); }
.pipe-label { font-size: 12px; font-weight: 600; color: var(--muted2); margin-top: 5px; line-height: 1.25; }
.dash-notes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.dash-note {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; background: var(--yellow); color: #7d5d17;
}
a.dash-note:hover { text-decoration: underline; color: inherit; }
.dash-note-red { background: var(--red-bg); color: var(--red); }
.dash-note-soft { background: var(--soft); color: var(--muted2); }
.adopt-list { display: flex; flex-direction: column; }
.adopt-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 10px; margin: 0 -10px;
  border-bottom: 1px solid var(--soft); border-radius: 12px; text-decoration: none; color: inherit;
}
.adopt-row:last-child { border-bottom: none; }
.adopt-row:hover { background: var(--soft2); text-decoration: none; color: inherit; }
.adopt-row.must-vote { box-shadow: inset 3px 0 0 var(--primary); }
.adopt-main { flex: 1; min-width: 0; }
.adopt-title { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adopt-arrow { color: var(--muted); font-weight: 400; margin: 0 6px; }
.adopt-who { font-weight: 600; }
.adopt-next { font-size: 12.5px; color: var(--muted2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adopt-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; }
.adopt-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; color: var(--muted2); background: var(--soft);
}
.adopt-tag.ok { color: var(--green); background: var(--greentint); }
.adopt-prog { width: 190px; flex-shrink: 0; }
.adopt-step { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted2); margin-bottom: 6px; }
.adopt-step-lbl { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { display: flex; gap: 3px; }
.seg i { flex: 1; height: 6px; border-radius: 3px; background: var(--border2); }
.seg i.on { background: var(--primary); }
@media (max-width: 720px) {
  .adopt-row { flex-wrap: wrap; }
  .adopt-prog { width: 100%; padding-left: 60px; }
}

/* ---- Galerie photos (fiche animal) ---- */
/* Image qui n'a pas pu être chargée (photo hébergée par un partenaire) :
   aplat neutre à la place de l'icône « fichier introuvable » du navigateur. */
.img-missing { position: relative; background: var(--soft); }
.img-missing > img { display: none !important; }
/* Sur une vignette, un pictogramme discret ; le grand cadre, lui, a déjà son
   libellé en dessous, inutile d'ajouter un second symbole. */
.photo-thumb.img-missing::after,
.tromb-photo.img-missing::after,
.arr-photo.img-missing::after {
  content: '🐾'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; opacity: .3;
}

/* Renvoi vers la galerie complète quand la fiche n'affiche qu'un extrait. */
.photo-more {
  display: flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--muted2);
  font-size: 12px; font-weight: 700; text-decoration: none;
}
.photo-more:hover { background: var(--peach); color: var(--primary-d); text-decoration: none; }

.photo-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* Le fond neutre tient la place pendant le chargement — et reste visible si la
   photo, hébergée ailleurs, n'arrive jamais. */
.photo-thumb { position: relative; width: 58px; height: 58px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--soft); }
.photo-thumb.active { border-color: var(--primary); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb .ph-form { position: absolute; top: 0; margin: 0; }
.ph-tr { right: 0; }
.ph-tl { left: 0; }
.photo-del { border: none; background: rgba(28, 25, 23, .6); color: #fff; width: 18px; height: 18px; border-radius: 0 0 0 8px; font-size: 13px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.photo-del:hover { background: var(--red); }
.ph-badge { border: none; width: 18px; height: 18px; padding: 0; display: grid; place-items: center; font-size: 12px; line-height: 1; color: #fff; background: rgba(28, 25, 23, .6); border-radius: 0 8px 8px 0; cursor: pointer; }
.ph-badge:hover { background: #b98a2e; }
span.ph-badge.is-cover { position: absolute; top: 0; left: 0; background: #b98a2e; cursor: default; }
.photo-drop { margin-top: 12px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; padding: 16px 12px; border: 1.5px dashed var(--border2); border-radius: 12px; color: var(--muted2); cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.dropzone:hover { border-color: var(--primary); background: var(--peach); color: var(--primary-d); }
.dropzone svg { color: var(--primary); display: block; flex-shrink: 0; }
.dz-head { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.dropzone-title { font-size: 13px; font-weight: 700; }
.dropzone-sub { display: block; width: 100%; text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.dz-previews { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.dz-previews:not(:empty) { margin-top: 12px; }
.dz-preview { width: 66px; height: 66px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--soft); }
.dz-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Portail public d'adoption ---- */
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.pub-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.pub-logo { font-size: 20px; }
.pub-foot-logo { display: block; height: 26px; width: auto; max-width: 140px; margin: 0 auto 8px; opacity: .85; }
.pub-langs { display: flex; gap: 6px; }
.pub-lang { display: grid; place-items: center; opacity: .45; }
.pub-lang.active, .pub-lang:hover { opacity: 1; }
.pub-main { min-height: 62vh; }
.pub-wrap { max-width: 1040px; margin: 0 auto; padding: 34px 24px 48px; }
.pub-title { font-family: var(--display); font-size: 30px; font-weight: 700; margin: 0 0 6px; }
.pub-lead { font-size: 15px; color: var(--muted2); margin: 0 0 26px; }
.pub-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--primary-d); text-decoration: none; margin-bottom: 16px; }
.pub-back:hover { text-decoration: underline; }
.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.pub-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.pub-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(40, 30, 15, .10); }
.pub-card-title { font-family: var(--display); font-weight: 700; font-size: 17px; }
.pub-card-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pub-badge { display: inline-block; margin-top: 14px; font-size: 12px; font-weight: 700; color: var(--primary-d); background: var(--peach); border-radius: 20px; padding: 4px 12px; }
.pub-animals { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 20px; }
.pub-animal { display: block; text-decoration: none; color: inherit; }
.pub-animal:hover .pub-photo { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(40, 30, 15, .12); }
.pub-photo { width: 100%; aspect-ratio: 1 / 1; border-radius: 16px; object-fit: cover; display: block; background: var(--soft); transition: transform .12s, box-shadow .12s; }
.pub-photo--ph { display: grid; place-items: center; color: #fffdf9; font-family: var(--display); font-weight: 700; font-size: 40px; }
.pub-animal-name { font-family: var(--display); font-weight: 700; font-size: 16px; margin-top: 10px; }
.pub-animal-sub { font-size: 13px; color: var(--muted); }
.pub-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.pub-detail-info h1 { font-family: var(--display); font-size: 30px; margin: 0 0 12px; }
.pub-gallery-main { width: 100%; aspect-ratio: 1 / 1; border-radius: 18px; object-fit: cover; display: block; background: var(--soft); }
.pub-gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pub-gallery-thumbs .photo-thumb { width: 64px; height: 64px; }
.pub-contact { margin-top: 22px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.pub-contact-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted2); margin-bottom: 8px; }
.pub-contact-bar { background: var(--peach); border-radius: 16px; padding: 18px 20px; margin: 6px 0 30px; }
.pub-contact-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--primary-d); margin-bottom: 12px; }
.pub-contact-items { display: flex; flex-wrap: wrap; gap: 12px 22px; }
.pub-contact-item { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; }
a.pub-contact-item:hover { color: var(--primary-d); text-decoration: none; }
.pub-ci-ico { font-size: 15px; opacity: .9; }
.pub-section-title { font-family: var(--display); font-size: 20px; font-weight: 700; margin: 4px 0 16px; }
.pub-foot { text-align: center; padding: 26px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); }
@media (max-width: 720px) { .pub-detail-grid { grid-template-columns: 1fr; } }

/* ---- Zone de danger (archivage / suppression d'un refuge) ---- */
.danger-zone { margin-top: 20px; border: 1px solid var(--red); border-radius: 12px; background: var(--red-bg); overflow: hidden; }
.danger-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--red); margin: 0; padding: 9px 14px; background: rgba(193, 74, 52, .10); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.danger-row + .danger-row { border-top: 1px solid rgba(193, 74, 52, .18); }
.danger-row-title { font-size: 13.5px; font-weight: 700; }
.danger-row-sub { font-size: 12px; color: var(--muted2); margin-top: 1px; }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; filter: brightness(.93); }
.danger-input { border: 1px solid rgba(193, 74, 52, .38); background: var(--card); border-radius: 7px; padding: 9px 12px; font: inherit; font-size: 14px; color: var(--ink); }
.danger-input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(193, 74, 52, .14); }
.danger-input::placeholder { color: var(--red); opacity: .48; }

/* Lien vers le portail public depuis la page de connexion. */
.login-adopt { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 10px 18px; background: var(--card); border: 1px solid var(--border); border-radius: 24px; font-size: 13.5px; font-weight: 600; color: var(--primary-d); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.login-adopt:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(40, 30, 15, .10); color: var(--primary-d); }

/* ---- Boutons d'action discrets (édition en ligne : actes, notes) ---- */
.row-actions { display: flex; gap: 2px; align-items: center; justify-content: flex-end; }
.icon-btn { border: none; background: transparent; cursor: pointer; font-size: 14px; color: var(--muted2); padding: 3px 7px; border-radius: 7px; line-height: 1; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }

/* ---- Avatars photo (sidebar, recherche) ---- */
.user-ava.has-photo, .gs-ava.has-photo { background: transparent; padding: 0; overflow: hidden; }
.user-ava.has-photo img, .gs-ava.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Mon compte : identité, photo, langue ---- */
.account-id { display: flex; align-items: center; gap: 16px; }
.account-ava { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; background: var(--green); color: #fffdf9; font-family: var(--display); font-weight: 700; font-size: 24px; flex-shrink: 0; overflow: hidden; }
.account-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.account-photo-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.account-photo-actions label { cursor: pointer; margin: 0; }
.lang-choices { display: flex; flex-direction: column; gap: 8px; }
.lang-choice { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; color: inherit; font-weight: 600; font-size: 14px; text-decoration: none; }
.lang-choice:hover { border-color: var(--primary); background: var(--peach); color: var(--primary-d); text-decoration: none; }
.lang-choice.active { border-color: var(--primary); background: var(--peach); color: var(--primary-d); }
.lang-choice > span:not(.flag) { flex: 1; }
.lang-choice .flag { width: 28px; height: 19px; }
.lang-check { color: var(--primary-d); }

/* ---- Barre mobile & tiroir latéral ---- */
.mobile-bar { display: none; }
.sidebar-overlay { display: none; }

@media (max-width: 860px) {
  .app { height: auto; min-height: 0; overflow: visible; }
  .mobile-bar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 150; background: var(--card); border-bottom: 1px solid var(--border); padding: 10px 14px; }
  .mobile-menu-btn { border: 1px solid var(--border); background: var(--card); border-radius: 10px; width: 38px; height: 38px; display: grid; place-items: center; color: var(--ink); cursor: pointer; flex-shrink: 0; }
  .mobile-brand { font-family: var(--display); font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
  .mobile-logo { width: 26px; height: 26px; border-radius: 8px; background: var(--primary); color: var(--card); display: grid; place-items: center; font-size: 11px; font-weight: 700; }

  .sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: 270px; max-width: 82vw; transform: translateX(-100%); transition: transform .22s ease; z-index: 300; box-shadow: 0 0 40px rgba(0, 0, 0, .2); overflow-y: auto; }
  /* Dans le tiroir, c'est la barre entière qui défile — pas la seule navigation.
     Les lignes retrouvent leur hauteur confortable pour le doigt. */
  .nav { flex: 0 0 auto; overflow-y: visible; }
  .nav-item { padding: 10px 12px; }
  .nav-sub-item { padding: 9px 10px; }
  .app.nav-open .sidebar { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(20, 15, 8, .42); z-index: 250; }
  .app.nav-open .sidebar-overlay { display: block; }

  .main { padding: 18px 16px; overflow: visible; }
  .wrap { max-width: 100%; }
  .page-head { flex-wrap: wrap; margin-bottom: 20px; }
  .page-title { font-size: 24px; }
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .head-actions { flex-wrap: wrap; }
  .filters { flex-wrap: wrap; }
  .modal { max-width: 94vw !important; }
  .gsearch-panel { width: 300px; max-width: 74vw; }

  /* Colonnes secondaires des listes : masquées sur mobile — leurs largeurs
     fixes forçaient un débordement horizontal. L'info reste disponible sur
     la fiche. */
  .row .row-col { display: none; }
  .row .row-narrow { display: inline; }
}
@media (max-width: 520px) {
  .grid-kpi { grid-template-columns: 1fr; }
  .main { padding: 14px 12px; }
  .account-id { flex-wrap: wrap; }
}

/* ---- Tableau registre / utilisateurs ---- */
.reg { width: 100%; border-collapse: collapse; font-size: 13px; }
.reg th, .reg td { text-align: left; padding: 11px 14px; vertical-align: top; border-bottom: 1px solid var(--soft); }
.reg thead th { background: var(--soft); color: var(--muted2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.reg tbody tr:last-child td { border-bottom: none; }
.reg tbody tr:hover { background: var(--soft2); }
.reg td.strong, .reg .strong { font-weight: 600; }
.reg td.muted, .reg .muted { color: var(--muted); }
.reg a { color: var(--primary-d); font-weight: 600; text-decoration: none; }
.reg a:hover { text-decoration: underline; }

/* ---- Page imprimable du registre ---- */
.print-page { background: #fff; color: #1c1917; }
.print-toolbar { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; }
.print-sheet { max-width: 1000px; margin: 0 auto; padding: 28px 24px 60px; }
.print-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid #1c1917; padding-bottom: 14px; margin-bottom: 18px; }
.print-org { font-size: 13px; font-weight: 700; color: var(--primary-d); text-transform: uppercase; letter-spacing: .04em; }
.print-title { font-size: 22px; font-weight: 700; margin: 4px 0 0; }
.print-meta { font-size: 12px; color: var(--muted2); text-align: right; line-height: 1.7; white-space: nowrap; }
.print-period { font-size: 12.5px; color: var(--muted2); margin-top: 4px; }
.print-legal { font-size: 11px; color: var(--muted2); font-style: italic; margin: -6px 0 14px; }
.reg-print { border: 1px solid #333; }
.reg-print th, .reg-print td { border: 1px solid #999; padding: 6px 8px; font-size: 11.5px; }
.reg-print thead th { background: #f0ebe2; color: #1c1917; }
.print-foot { display: flex; justify-content: space-between; gap: 20px; margin-top: 40px; font-size: 12.5px; color: var(--muted2); }

.no-print { }
@media print {
  @page { size: landscape; margin: 12mm; }
  .no-print { display: none !important; }
  .print-sheet { max-width: none; padding: 0; }
  .print-page { background: #fff; }
  .reg-print { border-color: #000; }
  .reg-print th, .reg-print td { border-color: #000; }
  .reg-print thead { display: table-header-group; }
  .reg-print tr { page-break-inside: avoid; }
}

/* ---- Select recherchable (amélioration de <select>) ---- */
.ss { position: relative; }
.ss-native { display: none !important; }
.ss-trigger {
  width: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; text-align: left;
}
.ss-trigger:hover { border-color: #d9c9b2; }
.ss.open .ss-trigger { border-color: var(--primary); }
.ss-value { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-caret { color: var(--muted); display: flex; transition: transform .18s; flex-shrink: 0; }
.ss.open .ss-caret { transform: rotate(180deg); }
/* Panneau en position fixe, calé sur le déclencheur par app.js : un panneau
   en `absolute` gonflerait la hauteur de défilement d'un conteneur scrollable
   (une modale, par exemple) et y ferait apparaître une barre de défilement. */
.ss-panel {
  position: fixed; z-index: 70; box-sizing: border-box;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(40, 30, 15, .16); padding: 6px;
}
/* Le `display: flex` ci-dessus l'emporte sur le `[hidden] { display: none }` de
   la feuille du navigateur : sans cette règle, tous les panneaux restent
   affichés en permanence. */
.ss-panel[hidden] { display: none; }
.ss-search {
  width: 100%; box-sizing: border-box; padding: 8px 10px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--soft);
  font: inherit; font-size: 13px; color: var(--ink);
}
.ss-search:focus { outline: none; border-color: var(--primary); background: var(--card); }
.ss-options { flex: 1 1 auto; min-height: 0; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.ss-search { flex-shrink: 0; }
/* flex-shrink: 0 : sans lui, les options (overflow: hidden) se tassent pour tenir
   dans les 220 px de la liste au lieu de la faire défiler. */
.ss-option { flex-shrink: 0; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-option:hover, .ss-option.active { background: var(--soft); }
.ss-option.selected { color: var(--primary-d); font-weight: 600; }
.ss-empty { padding: 10px; font-size: 13px; color: var(--muted); }

/* ---- Structure du refuge (boxes / parcs) ---- */
.section-title { font-family: var(--display); font-size: 16px; font-weight: 700; color: var(--muted2); margin: 8px 0 12px; }
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.zone-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px 16px; display: flex; flex-direction: column; }
.zone-card--parc { background: var(--greentint); border-color: #d5e0d5; }
.zone-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.zone-name { font-family: var(--display); font-weight: 700; font-size: 15.5px; line-height: 1.15; }
.zone-kind { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.zone-occ { font-size: 12px; font-weight: 700; color: var(--muted2); background: var(--soft); border-radius: 999px; padding: 3px 10px; flex-shrink: 0; }
.zone-occ.is-partial { color: var(--green); background: var(--greentint); }
.zone-occ.is-full { color: var(--primary-d); background: var(--peach); }
.zone-occupants { display: flex; flex-direction: column; gap: 8px; }
.zone-occupants--wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.zone-empty { font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 10px 4px; text-align: center; border: 1.5px dashed var(--border2); border-radius: 10px; }
.occ-card { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px 10px; background: var(--soft2); border: 1px solid var(--border); border-radius: 12px; padding: 6px 9px; }
.zone-card--parc .occ-card { background: var(--card); }
.occ-photo { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; display: block; flex-shrink: 0; }
.occ-photo--ph { display: grid; place-items: center; color: #fffdf9; font-family: var(--display); font-weight: 700; font-size: 18px; }
.occ-info { min-width: 0; flex: 1 1 0; }
.occ-name { display: block; font-size: 13px; font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.occ-name:hover { color: var(--primary-d); }
.occ-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-move { margin: 0; width: 100%; }
.zone-move select {
  width: 100%; font: inherit; font-size: 12px; color: var(--ink);
  padding: 7px 26px 7px 10px; border: 1px solid var(--border); border-radius: 9px;
  background-color: var(--card); cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpolyline points='3,4.5 6,7.5 9,4.5' fill='none' stroke='%23a8a29e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  text-overflow: ellipsis;
}
.zone-move select:hover { border-color: var(--primary); }
.zone-move select:focus { outline: none; border-color: var(--primary); }
.zone-del { margin: 8px 0 0; text-align: right; }
.zone-del-btn { border: none; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 4px; }
.zone-del-btn:hover { color: var(--red); }

/* ---- Sélecteur de langue (drapeau + nom, <details>) ---- */
.langpick { position: relative; display: inline-block; }
.langpick > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); background: var(--card); border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--ink); user-select: none; }
.langpick > summary::-webkit-details-marker { display: none; }
.langpick > summary:hover { border-color: #d9c9b2; }
.langpick[open] > summary { border-color: var(--primary); }
.langpick-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.langpick-caret { color: var(--muted); display: flex; transition: transform .18s; flex-shrink: 0; }
.langpick[open] .langpick-caret { transform: rotate(180deg); }
.langpick .flag { width: 26px; height: 18px; }
.langpick-panel { position: absolute; z-index: 90; top: calc(100% + 6px); min-width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(40, 30, 15, .16); padding: 6px; }
.langpick-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: inherit; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.langpick-opt:hover { background: var(--peach); color: var(--primary-d); text-decoration: none; }
.langpick-opt.active { background: var(--peach); color: var(--primary-d); }
.langpick-opt-name { flex: 1; }
.langpick-check { color: var(--primary-d); flex-shrink: 0; }
/* Pleine largeur (page Mon compte) */
.langpick--block { display: block; }
.langpick--block > summary { width: 100%; }
.langpick--block .langpick-panel { left: 0; right: 0; }
/* Compact, aligné à droite (coin) */
.langpick--compact > summary { padding: 8px 11px; font-size: 13.5px; border-radius: 999px; }
.langpick--compact .langpick .flag,
.langpick--compact .flag { width: 22px; height: 15px; }
.langpick--compact .langpick-panel { right: 0; left: auto; }
/* Sélecteur de langue en coin sur la page de connexion */
.login-lang { position: absolute; top: 20px; right: 20px; z-index: 20; }

/* ---- Plateforme multi-refuge ---- */
/* Bandeau du super administrateur entré dans un refuge : tout en haut de la
   page, sur toute la largeur. Hauteur fixe (44px) : .app et la page des
   discussions (chat.css) la retranchent de la hauteur de la fenêtre. */
.acting-bar { display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 16px; background: var(--purple); border-bottom: 1px solid #e0d3e2; }
.acting-text { min-width: 0; font-size: 13px; font-weight: 600; color: #7a5a80; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Bascule vers un autre refuge : champ de recherche, résultats dessous
   (au-dessus de la barre mobile, qui suit le bandeau). */
.refuge-switch { flex: 0 1 230px; min-width: 0; padding: 0; }
.refuge-switch .gsearch-input { background: #fff; border-color: #e0d3e2; padding: 5px 10px 5px 30px; font-size: 12.5px; font-weight: 600; color: #5f4564; text-overflow: ellipsis; }
.refuge-switch .gsearch-input:focus { border-color: #7a5a80; }
.refuge-switch .gsearch-ico { left: 9px; top: 6px; color: #8b6f90; }
.refuge-switch .gsearch-panel { left: 0; top: calc(100% + 8px); z-index: 200; }
.acting-leave { border: none; background: #7a5a80; color: #fff; font: inherit; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 8px; cursor: pointer; flex-shrink: 0; }
.acting-leave:hover { background: #674a6c; }
.acting-as { display: flex; align-items: center; gap: 8px; margin: 0 0 0 auto; min-width: 0; }
.acting-as-label { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #8b6f90; white-space: nowrap; }
.acting-as select { width: 250px; min-width: 0; font: inherit; font-size: 12.5px; font-weight: 600; color: #5f4564; background: #fff; border: 1px solid #e0d3e2; border-radius: 9px; padding: 5px 8px; cursor: pointer; }
.acting-as select:focus { outline: 2px solid #7a5a80; outline-offset: 1px; }
.acting-quit { margin: 0 0 0 auto; flex-shrink: 0; }
.acting-as + .acting-quit { margin-left: 0; }
@media (min-width: 861px) { body.has-acting .app { height: calc(100vh - 44px); } }
@media (max-width: 1000px) { .acting-as-label { display: none; } }
@media (max-width: 860px) {
  .acting-bar { gap: 8px; padding: 0 12px; }
  /* Le nom du refuge figure déjà dans la barre mobile, juste dessous. */
  .acting-bar.has-tools .acting-text { display: none; }
  .refuge-switch { flex: 1 1 0; }
  /* La bascule est alors le premier élément : ses résultats prennent la largeur de l'écran. */
  .refuge-switch .gsearch-panel { width: calc(100vw - 24px); max-width: none; }
  .acting-as { flex: 1 1 0; margin: 0; }
  .acting-as select { flex: 1; width: auto; }
}
/* ---- Onglets des paramètres du refuge ---- */
.settings-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.settings-tab { padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--muted2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.settings-tab:hover { color: var(--ink); }
.settings-tab.active { color: var(--primary-d); border-bottom-color: var(--primary); }

/* ---- Annuaire ---- */
.dir-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.dir-search { flex: 1; min-width: 220px; font: inherit; font-size: 14px; padding: 9px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink); }
.dir-filters select { font: inherit; font-size: 14px; padding: 9px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink); }
/* Pastilles de rôle : mêmes rubriques que le sous-menu « Annuaire ». */
.dir-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dir-chip {
  display: inline-flex; align-items: baseline; gap: 7px; font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--muted2); text-decoration: none;
}
.dir-chip:hover { border-color: var(--peach-br); background: var(--soft2); color: var(--primary-d); text-decoration: none; }
.dir-chip.active { border-color: var(--primary); background: var(--peach); color: var(--primary-d); }
.dir-chip-n { font-size: 11.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.dir-chip.active .dir-chip-n { color: var(--primary-d); }

/* Colonne « métier » de la liste : un statut, puis une ligne de contexte. */
.dir-cell { white-space: nowrap; }
.dir-cell-sub { font-size: 12px; color: var(--muted); margin-top: 4px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* Sélection des rôles : une pastille compacte par rôle, l'icône fait office de témoin coché. */
.dir-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(162px, 1fr)); gap: 8px; }
.role-opt {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 5px 11px 5px 5px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--soft2); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.role-opt input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; pointer-events: none; }
.role-opt-ic {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  display: grid; place-items: center;
  transition: border-color .15s, background .15s, color .15s;
}
.role-opt-ic svg { display: block; width: 15px; height: 15px; }
.role-opt-name { font-size: 13px; font-weight: 600; line-height: 1.2; color: var(--muted2); }
.role-opt:hover { border-color: var(--peach-br); background: var(--card); }
.role-opt:hover .role-opt-ic { border-color: var(--peach-br); color: var(--primary-d); }
.role-opt:has(input:checked) { border-color: var(--primary); background: var(--peach); }
.role-opt:has(input:checked) .role-opt-ic { border-color: var(--primary); background: var(--primary); color: var(--card); }
.role-opt:has(input:checked) .role-opt-name { color: var(--ink); }
.role-opt:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.dir-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.dir-links a { font-weight: 600; }
@media (max-width: 860px) { .dir-roles { grid-template-columns: 1fr; } }

/* Sélecteur de refuge (responsable rattaché à plusieurs établissements) */
.refuge-picker { margin: 0 0 14px; }
.refuge-picker-label { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 5px 2px; }
.refuge-picker select { width: 100%; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.refuge-picker select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.sub-banner { background: var(--red-bg); border: 1px solid #eeccc7; color: var(--red); border-radius: 14px; padding: 13px 18px; margin-bottom: 22px; font-size: 13.5px; }
.sub-banner strong { font-weight: 700; }
.check-inline { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted2); cursor: pointer; }
.check-inline input { width: 16px; height: 16px; accent-color: var(--primary); }
.tabnum { font-variant-numeric: tabular-nums; }

/* ---- Paramétrage des offres (plateforme) ---- */
.plan-specs { margin: 14px 0 0; display: grid; gap: 7px; }
.plan-specs > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; }
.plan-specs dt { color: var(--muted); }
.plan-specs dd { margin: 0; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix-cell { width: 100%; min-width: 88px; border: 1px solid var(--border2); background: var(--card); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 13px; color: var(--ink); text-align: center; }
.matrix-cell:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,119,80,.15); }

.param-list { display: flex; flex-direction: column; gap: 8px; }
.param-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--soft2); }
.param-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; flex: 1; min-width: 0; }
.param-form input, .param-form select { border: 1px solid var(--border2); background: var(--card); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 13.5px; color: var(--ink); }
.param-form input:focus, .param-form select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,119,80,.15); }
.inline-lbl { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted2); white-space: nowrap; }

/* ---- Lightbox (agrandissement des photos) ---- */
.photo-slot img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; background: rgba(20, 15, 8, .88); padding: 40px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); object-fit: contain; }
.lb-btn { position: absolute; border: none; background: rgba(255, 253, 249, .12); color: #fffdf9; width: 46px; height: 46px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: background .15s; }
.lb-btn:hover { background: rgba(255, 253, 249, .28); }
.lb-close { top: 22px; right: 22px; }
.lb-prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 22px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: #fffdf9; font-size: 13px; font-weight: 600; background: rgba(0, 0, 0, .35); padding: 5px 12px; border-radius: 999px; }
@media (max-width: 620px) {
  .lightbox { padding: 16px; }
  .lb-btn { width: 40px; height: 40px; }
  .lb-close { top: 12px; right: 12px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

/* ---------- Carte de France (annuaire géolocalisé) ---------- */
/* Couleurs des rôles : trois teintes franches et bien distinctes (lisibles aussi
   par la plupart des daltoniens : bleu / vert d'eau / vermillon). */
.map-view {
  --map-adopter: #1f6fb5;   --map-adopter-bg: #e3eef9;
  --map-volunteer: #0d8f6a; --map-volunteer-bg: #dcf1e9;
  --map-foster: #d9550f;    --map-foster-bg: #fde5d6;
}
.map-view .is-off { display: none; }
.map-count { font-size: 13px; font-weight: 600; color: var(--muted2); }

.map-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-bottom: 20px; }
.map-roles { display: flex; flex-wrap: wrap; gap: 8px; }
.map-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 12px;
  border: 1.5px solid var(--border2); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted2);
  cursor: pointer; background: var(--soft2); user-select: none; transition: .15s; }
.map-chip:hover { border-color: #cbbba6; color: var(--ink); }
.map-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.map-chip .map-dot { transition: .15s; }
.map-chip.chip-all .map-dot { background: conic-gradient(var(--map-adopter) 0 33%, var(--map-volunteer) 0 66%, var(--map-foster) 0); }
.map-chip.chip-adopter .map-dot { background: var(--map-adopter); }
.map-chip.chip-volunteer .map-dot { background: var(--map-volunteer); }
.map-chip.chip-foster .map-dot { background: var(--map-foster); }
.map-chip-n { font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }
.map-chip.on { color: #fff; border-color: transparent; }
.map-chip.on:not(.chip-all) .map-dot { background: #fff; }
.map-chip.on .map-chip-n { opacity: .85; }
.map-chip.chip-all.on { background: #2a2420; }
.map-chip.chip-adopter.on { background: var(--map-adopter); }
.map-chip.chip-volunteer.on { background: var(--map-volunteer); }
.map-chip.chip-foster.on { background: var(--map-foster); }
.map-chip:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }

.map-search { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.map-field input { font: inherit; font-size: 13.5px; color: var(--ink); background: var(--card);
  border: 1px solid var(--border2); border-radius: 12px; padding: 9px 12px; min-width: 210px; }
.map-field input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.map-field-radius { display: flex; align-items: center; gap: 8px; }
.map-radius-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.map-field-radius select { font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--card);
  border: 1px solid var(--border2); border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.map-hint { flex-basis: 100%; margin: 0; font-size: 12.5px; color: var(--muted); }
.map-hint-warn { color: var(--red); font-weight: 600; }

.map-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.map-canvas { padding: 14px 14px 8px; }
.fr-map { display: block; width: 100%; height: auto; max-height: 76vh; }
.fr-land { fill: var(--soft); stroke: var(--border2); stroke-width: calc(1.4px * var(--map-inv, 1)); stroke-linejoin: round; }
/* Régions : aplats alternés (deux voisines n'ont jamais la même teinte), frontières claires. */
.fr-region { fill-rule: evenodd; transition: fill .15s; }
.fr-tone-0 { fill: #f2e9dc; }
.fr-tone-1 { fill: #e9dfce; }
.fr-tone-2 { fill: #f6f0e6; }
.fr-tone-3 { fill: #e2d7c4; }
.fr-tone-4 { fill: #ede4d6; }
.fr-region:hover { fill: #ddd0ba; }
.fr-borders { fill: none; stroke: #fffdf9; stroke-width: calc(2.4px * var(--map-inv, 1)); stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.fr-coast { fill: none; stroke: #c9b89f; stroke-width: calc(1.3px * var(--map-inv, 1)); stroke-linejoin: round; pointer-events: none; }
.fr-labels text { font-family: var(--body); font-size: 14px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; text-anchor: middle; fill: #9a8a78; pointer-events: none; }
.fr-pin { stroke: #fff; stroke-width: 2; cursor: pointer; transition: stroke-width .12s; }
.fr-pin:hover { stroke-width: 3.2; }
.pin-adopter { fill: var(--map-adopter); }
.pin-volunteer { fill: var(--map-volunteer); }
.pin-foster { fill: var(--map-foster); }
/* Filtre sur un rôle : tous les points visibles prennent sa couleur, la légende le met en avant. */
.map-view[data-role="adopter"] .fr-pin { fill: var(--map-adopter); }
.map-view[data-role="volunteer"] .fr-pin { fill: var(--map-volunteer); }
.map-view[data-role="foster"] .fr-pin { fill: var(--map-foster); }
.map-view[data-role="adopter"] .map-ava { background: var(--map-adopter); }
.map-view[data-role="volunteer"] .map-ava { background: var(--map-volunteer); }
.map-view[data-role="foster"] .map-ava { background: var(--map-foster); }
.map-view[data-role="adopter"] .legend-item:not(.lg-adopter),
.map-view[data-role="volunteer"] .legend-item:not(.lg-volunteer),
.map-view[data-role="foster"] .legend-item:not(.lg-foster) { opacity: .35; }
.fr-radius { fill: rgba(217,119,80,.10); stroke: var(--primary); stroke-width: calc(1.6px * var(--map-inv, 1));
  stroke-dasharray: calc(6px * var(--map-inv, 1)) calc(5px * var(--map-inv, 1)); }
.fr-center-halo { fill: rgba(168,80,46,.18); }
.fr-center { fill: var(--primary-dd); stroke: #fffdf9; stroke-width: 1.4; }

/* Zoom et déplacement : le fond grossit, le reste garde une taille d'écran. app.js
   pose sur la carte --map-inv (traits : épaisseur du zoom 1), --map-pin et --map-lab
   (points, noms de régions : grossissent un peu puis se figent) et --map-px (villes :
   taille fixe en pixels, quelle que soit la largeur de la carte). */
.fr-pin, .fr-center, .fr-center-halo { transform: scale(var(--map-pin, 1)); }
.fr-labels text { transform: scale(var(--map-lab, 1)); }
.fr-city-in { transform: scale(var(--map-px, 1)); }
.fr-pin, .fr-center, .fr-center-halo, .fr-labels text { transform-box: fill-box; transform-origin: center; }
/* Personnes d'une même commune, empilées sur un seul point : dépliées en spirale
   (--ox / --oy, posés par la vue) de --map-sp unités à mesure qu'on zoome. */
.fr-pin-link { transform: translate(calc(var(--ox, 0) * var(--map-sp, 0) * 1px), calc(var(--oy, 0) * var(--map-sp, 0) * 1px)); }
/* Les noms de régions s'effacent en zoom rapproché, au profit des villes. */
.fr-labels { transition: opacity .2s; }
.map-stage.is-deep .fr-labels { opacity: 0; }
/* Villes repères : pastille sous les points des personnes, nom par-dessus, sans gêner leur clic. */
.fr-cities { pointer-events: none; }
.fr-city { opacity: 0; transition: opacity .18s; }
.fr-city.on { opacity: 1; }
.fr-city circle { fill: #fffdf9; stroke: #7d6e5d; stroke-width: 1.4; }
.fr-city text { font-family: var(--body); font-size: 12px; font-weight: 600; text-anchor: middle; fill: #4f453b;
  paint-order: stroke; stroke: #fffdf9; stroke-width: 3px; stroke-linejoin: round; }
.fr-city-1 text { font-size: 13px; font-weight: 700; fill: #2b2622; }

.map-stage { position: relative; border-radius: 12px; overflow: hidden; -webkit-user-select: none; user-select: none; }
.map-stage:focus { outline: none; }
.map-stage:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Au zoom minimal, un doigt fait défiler la page ; carte zoomée, il la déplace. */
.map-stage .fr-map { cursor: grab; touch-action: pan-y; }
.map-stage.is-zoomed .fr-map { touch-action: none; }
.map-stage.is-dragging .fr-map, .map-stage.is-dragging .fr-pin { cursor: grabbing; }
.map-zoom { position: absolute; top: 8px; right: 8px; display: grid; border: 1px solid var(--border2); border-radius: 12px;
  background: var(--card); box-shadow: 0 2px 10px rgba(60,40,20,.10); overflow: hidden; }
.map-zoom[hidden], .map-zone[hidden] { display: none; }
.map-zoom button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: none; padding: 0;
  font: inherit; font-size: 21px; line-height: 1; color: var(--ink); cursor: pointer; }
.map-zoom button + button { border-top: 1px solid var(--border); }
.map-zoom button:hover:not(:disabled) { background: var(--soft); }
.map-zoom button:disabled { color: var(--muted); opacity: .45; cursor: default; }
.map-tip { margin-left: auto; font-size: 12px; color: var(--muted); }
/* Carte zoomée : la liste ne garde que les personnes de la zone affichée. */
.map-view .is-out { display: none; }
.map-zone { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 0; padding: 7px 10px;
  border-radius: 10px; background: var(--soft2); font-size: 12.5px; font-weight: 600; color: var(--muted2); }
.map-zone-reset { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--primary-d);
  cursor: pointer; white-space: nowrap; }
.map-zone-reset:hover { text-decoration: underline; }

/* Aperçu d'un point : bulle remplie par app.js avec la ligne de la personne (liste) et sa
   suite (.map-more, masquée dans la liste). Au survol elle ne capte pas la souris, pour
   passer d'un point à l'autre ; retenue (toucher, point empilé), on peut y cliquer. */
.map-view { position: relative; }
.map-peek { position: absolute; z-index: 30; width: 300px; max-width: calc(100vw - 16px); max-height: 440px; overflow: hidden;
  padding: 6px; border: 1px solid var(--border2); border-radius: 14px; background: var(--card);
  box-shadow: 0 10px 30px rgba(60,40,20,.18); pointer-events: none; }
.map-peek[hidden] { display: none; }
.map-peek.is-held { pointer-events: auto; overflow: auto; }
.map-peek .map-row { padding: 8px; }
.map-more { padding: 0 8px 4px 53px; }
.map-fact { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 6px; font-size: 12px; line-height: 1.35; color: var(--muted2); }
.map-fact .map-dot { width: 8px; height: 8px; }
.map-reach { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 8px 0 4px; font-size: 12.5px; font-weight: 600; }
.map-reach a { color: var(--primary-d); overflow-wrap: anywhere; }
.map-peek-title, .map-peek-rest { margin: 6px 8px; font-size: 12px; font-weight: 700; color: var(--muted2); }
.map-peek-foot { margin: 2px 0 0; padding: 7px 8px 3px; border-top: 1px solid var(--border); text-align: right; }
.map-peek-act { border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--primary-d); cursor: pointer; }
.map-peek-act:hover { text-decoration: underline; }
.map-peek-hint { margin: 2px 0 0; padding: 7px 8px 3px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
/* Bulle au survol : rien n'y est cliquable — pas de lien en bas, coordonnées en simple texte. */
.map-peek:not(.is-held) .map-peek-foot, .map-peek.is-held .map-peek-hint { display: none; }
.map-peek:not(.is-held) .map-reach a { color: var(--ink); }
/* Plusieurs personnes au même endroit : une ligne chacune, la pastille de son rôle à droite. */
.map-peek.is-many .map-peek-item { display: flex; align-items: center; }
.map-peek.is-many .map-row { flex: 1; min-width: 0; padding: 5px 8px; }
.map-peek.is-many .map-ava { width: 24px; height: 24px; font-size: 9.5px; }
.map-peek.is-many .map-more { flex: none; display: flex; gap: 4px; padding: 0 8px 0 0; }
.map-peek.is-many .map-fact { margin: 0; }
.map-peek.is-many .map-row-sub, .map-peek.is-many .map-row-roles, .map-peek.is-many .map-dist,
.map-peek.is-many .map-fact-text, .map-peek.is-many .map-reach, .map-peek.is-many .map-fact:not(:has(.badge)) { display: none; }

.map-legend { display: flex; gap: 18px; flex-wrap: wrap; padding: 8px 6px 4px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted2); }
.map-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.dot-adopter { background: var(--map-adopter); }
.dot-volunteer { background: var(--map-volunteer); }
.dot-foster { background: var(--map-foster); }

.map-results { max-height: 80vh; overflow: auto; }
.map-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 3px; }
.map-row { display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: 12px; color: inherit; }
.map-row:hover { background: var(--soft); text-decoration: none; }
.map-ava { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; flex: none; }
.ava-adopter { background: var(--map-adopter); }
.ava-volunteer { background: var(--map-volunteer); }
.ava-foster { background: var(--map-foster); }
.map-row-main { min-width: 0; flex: 1; }
.map-row-name { display: block; font-weight: 700; font-size: 13.5px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-row-sub { display: block; font-size: 12px; color: var(--muted); }
.map-row-roles { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.map-tag { font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.tag-adopter { color: #17578f; background: var(--map-adopter-bg); }
.tag-volunteer { color: #0a6e52; background: var(--map-volunteer-bg); }
.tag-foster { color: #b2440a; background: var(--map-foster-bg); }
.map-dist { font-size: 12px; font-weight: 700; color: var(--primary-d); font-variant-numeric: tabular-nums; flex: none; }

@media (max-width: 980px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-results { max-height: none; }
  .fr-map { max-height: 62vh; }
  .map-search { margin-left: 0; }
  .map-field input { min-width: 0; flex: 1; }
}

/* ---------- Vote des bénévoles (candidature d'une famille d'accueil) ---------- */
.vote-opt {
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
  background: var(--card); transition: border-color .15s ease, background .15s ease;
}
.vote-opt:hover { border-color: #d9c9b2; }
.vote-opt.is-picked { border-color: var(--primary); background: var(--peach); color: var(--primary-d); }
.vote-opt input { accent-color: var(--primary); }

/* ---------- Paramétrage du parcours d'adoption ---------- */
.step-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; }
.step-rank {
  width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0;
  background: var(--peach); color: var(--primary-d);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 14px;
}
.step-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---- Rôles & droits (plateforme) ---- */
.roles-matrix th { position: sticky; top: 0; z-index: 1; }
.roles-matrix .mx-group td { background: var(--soft2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted2); padding: 9px 14px; }
.roles-matrix .mx-key { display: block; font-size: 11px; color: var(--muted); font-weight: 400; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.roles-matrix input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }
.roles-matrix input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .55; }
.roles-matrix th .role-head { display: flex; flex-direction: column; gap: 3px; align-items: center; min-width: 96px; }
.role-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.role-card { border: 1.5px solid var(--border); border-radius: 14px; padding: 14px 16px; background: var(--card); }
.role-card .role-desc { font-size: 12.5px; color: var(--muted2); line-height: 1.5; margin-top: 6px; min-height: 36px; }
.roles-matrix-ro .mx-yes { color: var(--green); font-weight: 700; font-size: 15px; }
.roles-matrix-ro .mx-no { color: var(--border2); }
.roles-matrix-ro th .role-head { min-width: 84px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; }
.check-grid .check-inline { font-weight: 500; }
.day-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.day-picker label { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted2); cursor: pointer; }
.day-picker label:has(input:checked) { border-color: var(--primary); background: var(--peach); color: var(--primary-d); }
.day-picker input { width: 14px; height: 14px; accent-color: var(--primary); margin: 0; }

/* ---- Champ numérique avec unité (« kg ») ---- */
.input-unit { position: relative; }
.input-unit input { padding-right: 46px; }
.input-unit > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12.5px; font-weight: 600; color: var(--muted); pointer-events: none; }

/* ---------- Fiche animal (refonte « Fiche Animal », Claude Design) ----------
   En-tête d'identité, bandeau de chiffres clés, colonne principale à onglets
   (Aperçu, Médical, Journal, Documents) et colonne latérale d'actions. */
.af-wrap { max-width: 1280px; }
.af-faint { color: #a89a8c; }
.btn-ink { background: var(--ink); border-color: var(--ink); color: var(--card); }
.btn-ink:hover { background: #3f3630; border-color: #3f3630; color: var(--card); }
.btn-danger-soft { color: var(--red); }
.btn-danger-soft:hover { background: var(--red-bg); color: var(--red); }

.af-head { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 24px; }
.af-avatar {
  position: relative; width: 112px; height: 112px; border-radius: 20px; flex: none; overflow: hidden;
  border: none; padding: 0; background: repeating-linear-gradient(135deg, #ede3d6 0 8px, #e6dacb 8px 16px);
  display: grid; place-items: center; cursor: zoom-in; color: var(--muted); text-decoration: none;
}
.af-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--card); }
.af-avatar-ph { font-family: var(--display); font-size: 40px; font-weight: 700; color: #b9a995; }
.af-avatar-empty { cursor: default; }
a.af-avatar-empty { cursor: pointer; }
.af-avatar-add { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--primary-d); }
a.af-avatar-empty:hover { text-decoration: none; outline: 2px solid var(--primary); }
.af-id { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.af-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.af-name { margin: 0; font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.af-pill { padding: 5px 10px; display: inline-flex; align-items: center; gap: 6px; }
a.af-pill:hover { text-decoration: none; filter: brightness(.97); }
.af-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.af-sub { font-size: 16px; color: var(--muted2); }
.af-meta { font-size: 13px; color: var(--muted); }
.af-actions { display: flex; gap: 8px; padding-top: 6px; flex-wrap: wrap; justify-content: flex-end; }
.af-actions form { margin: 0; }
/* Liens vers les pages publiques : en tête de fiche, avant les actions d'édition. */
.af-links { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-public { border-color: var(--peach-br); background: var(--peach); color: var(--primary-dd); }
.btn-public:hover { background: #fbe4d6; color: var(--primary-dd); }
.btn-public svg { flex-shrink: 0; }
/* Formulaire de fiche : long, ses boutons restent à portée en bas d'écran. */
.af-form-actions {
  position: sticky; bottom: 0; z-index: 5; margin-top: 0; padding: 14px 0 4px;
  background: linear-gradient(to bottom, rgba(247, 241, 232, 0), var(--bg) 35%);
}

.af-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 24px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
.af-kpi { padding: 16px 20px; border-right: 1px solid var(--soft); min-width: 0; }
.af-kpi:last-child { border-right: none; }
.af-kpi-l { font-size: 12px; color: var(--muted); }
.af-kpi-v { font-family: var(--display); font-size: 22px; font-weight: 700; margin-top: 4px; overflow-wrap: anywhere; }
.af-kpi-v.is-long { font-size: 16px; padding-top: 4px; }
.af-kpi-v.is-warn { color: var(--primary-d); }
.af-kpi-v.is-empty { color: #a89a8c; }
.af-kpi-s { font-size: 12px; color: var(--muted); margin-top: 2px; }

.af-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 24px; align-items: start; }
.af-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.af-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Galerie : sélecteur Photos / Vidéos, puis une seule ligne qui défile
   (flèches affichées par app.js seulement quand la ligne déborde). */
.af-gallery { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.af-gal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.af-switch { display: inline-flex; gap: 3px; padding: 3px; background: var(--card); border: 1px solid var(--border); border-radius: 11px; }
.af-switch-btn {
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border: none; border-radius: 8px;
  background: transparent; color: var(--muted2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.af-switch-btn:hover { background: var(--soft); color: var(--ink); }
.af-switch-btn.active, .af-switch-btn.active:hover { background: var(--ink); color: var(--card); }
.af-car { position: relative; }
.af-car[hidden] { display: none; }
.af-car-track {
  display: flex; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none;
}
.af-car-track::-webkit-scrollbar { display: none; }
/* Cinq vignettes visibles sur une large colonne, jamais moins de 140 px. */
.af-car-track > .af-shot { flex: 0 0 clamp(140px, calc((100% - 40px) / 5), 260px); scroll-snap-align: start; }
.af-car-btn {
  position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card); color: var(--ink); font: inherit; font-size: 22px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; padding: 0 0 2px; box-shadow: 0 4px 14px rgba(40, 30, 15, .18);
}
.af-car-btn:hover { background: var(--soft); }
.af-car-btn[hidden] { display: none; }
.af-car-prev { left: -12px; }
.af-car-next { right: -12px; }
.af-shot {
  position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; border: none; padding: 0;
  background: repeating-linear-gradient(135deg, #ede3d6 0 8px, #e6dacb 8px 16px); cursor: zoom-in;
}
.af-shot img { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--card); }
/* Contour tracé à l'intérieur : la ligne défilante rognerait un contour extérieur. */
.af-shot:hover, .af-shot:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
/* Vidéo de présentation : vignette YouTube, bouton lecture, titre en pied. */
.af-shot-video { display: block; cursor: pointer; background: #1c1917; }
.af-shot-video:hover { text-decoration: none; }
.af-play {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  background: rgba(28, 25, 23, .62); color: #fffdf9; display: grid; place-items: center; transition: background .15s, transform .15s;
}
.af-play svg { margin-left: 3px; }
.af-shot-video:hover .af-play, .af-shot-video:focus-visible .af-play { background: var(--primary); transform: scale(1.06); }
.af-shot-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 10px 7px; font-size: 11.5px; font-weight: 600; color: #fffdf9;
  background: linear-gradient(transparent, rgba(0, 0, 0, .62)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left;
}
.video-inner { width: min(960px, 100%); display: flex; flex-direction: column; gap: 10px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-title { color: #fffdf9; font-size: 14px; font-weight: 600; text-align: center; }

.af-tabs {
  display: flex; gap: 4px; padding: 5px; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; width: fit-content; max-width: 100%; flex-wrap: wrap;
}
.af-tab {
  font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 10px; color: var(--muted2);
  display: inline-flex; gap: 6px; align-items: center; text-decoration: none;
}
.af-tab:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.af-tab.active, .af-tab.active:hover { background: var(--ink); color: var(--card); }
.af-tab-n { font-size: 11px; font-weight: 500; opacity: .65; }
.af-panel { display: flex; flex-direction: column; gap: 20px; }
.af-panel[hidden] { display: none; }

.af-card { border-radius: 16px; display: flex; flex-direction: column; gap: 14px; }
.af-card-lg { padding: 24px 28px; gap: 20px; }
.af-card-sm { padding: 20px 22px; gap: 12px; }
.af-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.af-h2 { margin: 0; font-size: 17px; font-weight: 700; }
.af-h3 { margin: 0; font-size: 15px; font-weight: 700; }
.af-lead { margin: 0; font-size: 15px; line-height: 1.6; }
.af-dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px 20px; font-size: 15px; line-height: 1.6; }
.af-dl:empty { display: none; }
.af-dt { font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 2px; }
.af-dd { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.af-dd .traits { gap: 6px; }
.af-soft { color: var(--muted2); font-size: 14px; }
.af-pretty { text-wrap: pretty; }
.af-rich > :first-child { margin-top: 0; }
.af-rich > :last-child { margin-bottom: 0; }
.af-evo { gap: 10px; }
.af-evo-date { font-size: 13px; font-weight: 600; color: var(--muted); }
.af-evo-date.is-last { color: var(--green); }
.af-foot { font-size: 12px; color: #a89a8c; border-top: 1px solid var(--soft); padding-top: 14px; }
.af-foot-warn { color: var(--red); margin-bottom: 6px; }

.af-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: stretch; }
.af-health { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.af-hs { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 10px; font-size: 14px; background: var(--soft2); }
.af-hs.is-yes { background: #f2f7f3; }
.af-hs.is-yes b { color: var(--green); }
.af-hs.is-no b { color: var(--red); }
.af-hs.is-unk { background: #f4efe8; }
.af-hs.is-unk b { color: #a89a8c; }
.af-ent { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.af-ent > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.af-daily { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; font-size: 15px; }
.af-daily-l { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.af-daily-v { font-weight: 600; line-height: 1.45; }
.af-daily-v.is-warn { color: var(--primary-d); }
.af-daily-v.is-empty { color: #a89a8c; font-weight: 400; }

.af-empty { padding: 28px; text-align: center; font-size: 14px; color: var(--muted); border: 1px dashed var(--border2); border-radius: 12px; line-height: 1.5; }

.af-inline { display: flex; gap: 8px; margin: 0; }
.af-inline input {
  flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--border2); background: #fff; color: var(--ink);
}
.af-inline input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,119,80,.15); }
.af-note-empty { font-size: 14px; }
.af-notes { display: flex; flex-direction: column; }
.af-notes:empty { display: none; }
.af-note { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--soft); font-size: 14px; align-items: flex-start; }
.af-note-when { width: 96px; flex: none; font-size: 12px; color: var(--muted); padding-top: 2px; line-height: 1.4; }
.af-note-text { flex: 1; min-width: 0; line-height: 1.5; }
/* Auteur ou domaine d'origine (« remembermefrance.org ») : coupé, jamais par-dessus le texte. */
.af-note-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.af-upload { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.af-upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dropzone.af-drop { flex: 1; min-width: 220px; align-items: flex-start; text-align: left; padding: 14px 16px; border-width: 1px; }
.af-drop .dropzone-title { color: var(--primary-d); font-size: 14px; }
.af-drop .dropzone-sub { text-align: left; font-size: 12px; margin-top: 0; }
.af-upload-row .btn { padding: 12px 18px; }

.af-todo { background: #fbeee7; border: 1px solid #f1d6c8; border-radius: 16px; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.af-todo .af-h3 { color: #7e3520; }
.af-todo ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: #5a2e20; }
.af-todo li { position: relative; padding-left: 16px; }
.af-todo li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: #c2603e; }
.af-todo-link { color: inherit; font: inherit; background: none; border: none; padding: 0; cursor: pointer; text-align: left; text-decoration: none; }
.af-todo-link:hover { color: #7e3520; text-decoration: underline; }
.af-todo-hint { color: #9a6a58; margin-left: 4px; }

.af-muted-line { font-size: 14px; color: var(--muted2); }
.af-small { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0; }
.af-weight { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.af-weight-v { font-family: var(--display); font-size: 28px; font-weight: 700; }
.af-weight-v.is-empty { color: #a89a8c; }
.af-weight-d { font-size: 13px; color: var(--muted); }
.af-weight-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.af-faint-sm { font-size: 12px; color: #a89a8c; }
.af-details summary { font-size: 12.5px; font-weight: 600; color: var(--muted2); cursor: pointer; padding: 4px 0; }
.af-details[open] summary { margin-bottom: 4px; }
.af-contact { font-size: 12px; color: var(--muted); padding: 0 4px; }

@media (max-width: 1100px) {
  .af-layout { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .af-head { gap: 16px; }
  .af-avatar { width: 76px; height: 76px; border-radius: 16px; }
  .af-avatar-ph { font-size: 28px; }
  .af-id { min-width: 0; flex-basis: calc(100% - 92px); padding-top: 0; }
  .af-name { font-size: 30px; }
  .af-actions { width: 100%; padding-top: 0; }
  .af-card-lg { padding: 20px; }
  .af-dl { grid-template-columns: 1fr; gap: 4px; }
  .af-dl .af-dd { margin-bottom: 12px; }
  .af-kpis { grid-template-columns: 1fr 1fr; }
  .af-kpi { border-bottom: 1px solid var(--soft); }
  .af-kpi:nth-child(2n) { border-right: none; }
  .af-kpi:last-child { border-bottom: none; }
  .af-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .af-note { flex-direction: column; gap: 4px; }
  .af-note-when { width: auto; display: flex; gap: 6px; }
}

/* ===========================================================
   Refonte 27 sept. 2026 — Animaux (trombinoscope), Hébergement,
   Annuaire (liste + fiche personne). Maquettes Claude Design.
   =========================================================== */

/* ---- Teintes : statut d'un animal, rôle d'une personne ---- */
.st-adoptable     { --tint: #e3eee6; --tone: #2f6b4c; --dot: #3f7a5a; }
.st-reserve       { --tint: #f5ebcf; --tone: #86621a; --dot: #c49a3a; }
.st-soins         { --tint: #ece4f2; --tone: #6a4a86; --dot: #8b6aaa; }
.st-quarantaine   { --tint: #f8e3da; --tone: #a8432a; --dot: #c2603e; }
.st-neutre        { --tint: #f0eae2; --tone: #7a6e64; --dot: #a89a8c; }
.tone-adopter     { --tint: #e3eee6; --tone: #2f6b4c; --dot: #3f7a5a; }
.tone-foster      { --tint: #f8e3da; --tone: #a8432a; --dot: #c2603e; }
.tone-volunteer   { --tint: #f5ebcf; --tone: #86621a; --dot: #c49a3a; }
.tone-caregiver   { --tint: #ece4f2; --tone: #6a4a86; --dot: #8b6aaa; }
.tone-donor       { --tint: #eee7de; --tone: #6a5e54; --dot: #9a8c7e; }
.tone-staff       { --tint: #e4ecf0; --tone: #3e5e70; --dot: #5a7f94; }
.tone-partner     { --tint: #e6ede9; --tone: #4a6358; --dot: #7a958a; }
.tone-owner       { --tint: #eee7de; --tone: #6a5e54; --dot: #b5a898; }
.tone-none, .tone-inactive { --tint: #f0eae2; --tone: #7a6e64; --dot: #a89a8c; }
.tone-inactive    { --tint: #f8e5e2; --tone: var(--red); --dot: var(--red); }

/* ---- Page, en-tête, barre de filtres ---- */
.pg { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; padding-bottom: 32px; }
.pg-wide { max-width: 1440px; gap: 24px; }
.pgh { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.pgh-title { margin: 0; font-size: 36px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.pgh-sub { font-size: 14px; color: #7a6e64; margin-top: 6px; }
.pgh-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pg .btn { border-radius: 10px; }

.sinput {
  flex: 1; min-width: 220px; width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  padding: 10px 14px; border-radius: 10px; border: 1px solid #e2d7c9; background: var(--card); outline: none;
}
.sinput:focus { border-color: #bfae98; box-shadow: 0 0 0 3px rgba(42, 36, 32, .06); }
.fbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; margin: -8px 0;
}
.fbar-search { flex: 1; min-width: 220px; display: flex; margin: 0; }
.fbar-sep { width: 1px; align-self: stretch; background: #e6dccf; margin: 2px 2px; }

.fchips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip {
  font: inherit; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px;
  border: 1px solid #e2d7c9; background: var(--card); color: var(--ink); cursor: pointer;
  display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; text-decoration: none; line-height: 1.2;
}
.fchip:hover { border-color: #cbbba6; color: var(--ink); text-decoration: none; }
.fchip.on, .fchip.on:hover { background: #2a2420; border-color: #2a2420; color: #fffdf9; }
.fchip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--ink)); flex: none; }
.fchip.on .fchip-dot.is-all { background: #fffdf9; }
.fchip-n { font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }
.fchips-sm .fchip { font-size: 12px; padding: 5px 10px; }

.vseg { display: inline-flex; padding: 3px; background: var(--card); border: 1px solid #eae1d6; border-radius: 10px; }
.vseg a { font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 7px; color: #5e534a; text-decoration: none; }
.vseg a:hover { color: var(--ink); background: #f6eee3; text-decoration: none; }
.vseg a.on { background: #2a2420; color: #fffdf9; }

.pcard { background: var(--card); border: 1px solid #eae1d6; border-radius: 16px; padding: 8px 10px; }
.adv-panel { margin: 0; padding: 0 18px; border: 1px solid #eae1d6; border-radius: 14px; background: var(--card); }
.adv-panel > summary { padding: 11px 0; }

/* ---- Animaux : trombinoscope ---- */
.tb-group { display: flex; flex-direction: column; gap: 12px; }
.tb-letter-row { display: flex; align-items: center; gap: 12px; }
.tb-letter { font-family: var(--display); font-size: 22px; font-weight: 700; width: 28px; }
.tb-rule { flex: 1; height: 1px; background: #e6dccf; }
.tb-count { font-size: 12px; color: var(--muted); }
.tb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tb-grid.is-compact { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.tb-card {
  display: flex; flex-direction: column; border: 1px solid #eae1d6; border-radius: 14px; background: var(--card);
  overflow: hidden; color: var(--ink); text-decoration: none; transition: border-color .15s;
}
.tb-card:hover { border-color: #2a2420; color: var(--ink); text-decoration: none; }
.tb-photo {
  position: relative; aspect-ratio: 1 / 1; width: 100%; overflow: hidden; display: flex; align-items: flex-end; padding: 8px;
  background: repeating-linear-gradient(135deg, #ede3d6 0 8px, #e6dacb 8px 16px);
}
/* Fond plein sous la photo : un PNG détouré (cœur, cadre) ne laisse pas voir les rayures. */
.tb-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--card); }
.tb-photo.img-missing::after {
  content: '🐾'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px; opacity: .3;
}
.tb-ph { font-size: 10px; color: var(--muted); letter-spacing: .02em; }
.tb-status {
  position: absolute; top: 8px; left: 8px; z-index: 1; font-size: 11px; font-weight: 600; padding: 3px 8px;
  border-radius: 999px; background: var(--tint); color: var(--tone); max-width: calc(100% - 34px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* En famille d'accueil : pastille pêche, sous celle du statut quand il y en a une. */
.tb-fa { --tint: var(--peach); --tone: var(--primary-d); }
.tb-fa.is-second { top: 34px; }
.tb-grid.is-compact .tb-fa.is-second { top: 28px; }
.tb-nobox { position: absolute; top: 8px; right: 8px; z-index: 1; width: 10px; height: 10px; border-radius: 50%; background: #c2603e; border: 2px solid #fffdf9; }
.tb-body { padding: 10px 12px 12px; min-width: 0; }
.tb-name { font-size: 15px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-meta { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-grid.is-compact .tb-meta { display: none; }
.tb-grid.is-compact .tb-body { padding: 8px 10px 10px; }
.tb-grid.is-compact .tb-name { font-size: 13px; }
.tb-grid.is-compact .tb-status { font-size: 10px; padding: 2px 6px; top: 6px; left: 6px; }
/* Urgences (colonne `urgencies`) : pastille en bas de la photo, détail sous le nom. */
.tb-urg {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--red-bg); color: var(--red);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-urg::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.tb-urg.is-vital { background: var(--red); color: #fffdf9; }
.tb-urgs { font-size: 12px; font-weight: 600; color: var(--red); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-grid.is-compact .tb-urg { font-size: 10px; padding: 2px 6px; }
.tb-grid.is-compact .tb-urgs { display: none; }
.tb-empty { padding: 48px; text-align: center; font-size: 14px; color: var(--muted); border: 1px dashed #d9cbb9; border-radius: 16px; }
.tb-legend { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.tb-legend-dot { width: 10px; height: 10px; border-radius: 50%; background: #c2603e; }
.tb-foot { display: flex; flex-direction: column; gap: 10px; }
.tb-foot .adv-per { justify-content: center; font-size: 12.5px; color: var(--muted2); }
.tb-foot .chip.active { border-color: #2a2420; background: #2a2420; color: #fffdf9; }
.tb-list .row:last-child { border-bottom: none; }

/* ---- Hébergement ---- */
.hb { display: flex; flex-direction: column; gap: 24px; }
.hb-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  background: var(--card); border: 1px solid #eae1d6; border-radius: 16px; overflow: hidden;
}
.hb-kpi { padding: 16px 20px; border-right: 1px solid #f0e8dd; }
.hb-kpi:last-child { border-right: none; }
.hb-kpi-k { font-size: 12px; color: var(--muted); }
.hb-kpi-v { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hb-kpi-v.is-green { color: #2f6b4c; }
.hb-kpi-v.is-terra { color: #b4553a; }
.hb-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.hb-aside {
  flex: 1 1 260px; max-width: 340px; background: var(--card); border: 1px solid #eae1d6; border-radius: 16px;
  display: flex; flex-direction: column; position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: hidden;
  transition: border-color .15s, background .15s;
}
.hb-aside.is-over { border-color: #c2603e; background: #fdf6f2; }
.hb-aside-head { padding: 18px 18px 12px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid #f0e8dd; }
.hb-aside-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hb-aside-title h2 { margin: 0; font-size: 16px; font-weight: 700; }
.hb-aside-title span { font-size: 13px; color: var(--muted); }
.hb-aside .sinput { min-width: 0; padding: 9px 12px; border-radius: 9px; background: #fff; flex: none; }
.hb-list { overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; min-height: 60px; }
.hb-item { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; }
.can-manage .hb-item { cursor: grab; }
.hb-item[hidden] { display: none; }
.hb.is-busy { cursor: progress; }
.hb.is-busy .hb-places, .hb.is-busy .hb-list { opacity: .7; pointer-events: none; }
.hb-item:hover, .hb-item:focus-visible { background: #f6eee3; outline: none; }
.hb-item.is-picked { background: #f6eee3; outline: 2px solid #2a2420; outline-offset: -2px; }
.hb-item.is-dragging, .hb-occupant.is-dragging { opacity: .45; }
.hb-thumb { width: 34px; height: 34px; border-radius: 9px; flex: none; overflow: hidden; background: repeating-linear-gradient(135deg, #ede3d6 0 6px, #e6dacb 6px 12px); }
.hb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hb-item-main { min-width: 0; flex: 1; }
.hb-item-name { display: block; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-item-sub { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.hb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dot); flex: none; }
.hb-item-st { color: var(--tone); }
.hb-none { padding: 24px; text-align: center; font-size: 14px; color: var(--muted); }
.hb-main { flex: 999 1 420px; display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.hb-pick {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: 12px; background: #2a2420; color: #fffdf9; font-size: 14px; position: sticky; top: 12px; z-index: 4;
}
.hb-pick[hidden], .hb-msg[hidden] { display: none; }
.hb-pick-cancel { font: inherit; font-size: 13px; font-weight: 600; border: none; background: none; color: #fffdf9; cursor: pointer; opacity: .8; }
.hb-pick-cancel:hover { opacity: 1; }
.hb-msg { padding: 12px 16px; border-radius: 12px; background: #f8e3da; color: #7e3520; font-size: 14px; font-weight: 600; }
.hb-zone { display: flex; flex-direction: column; gap: 12px; }
.hb-zone-head { display: flex; align-items: baseline; gap: 10px; }
.hb-zone-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.hb-zone-head span { font-size: 13px; color: var(--muted); }
.hb-zone[hidden] { display: none; }
.hb-zone-tools { margin-left: auto; align-self: center; display: flex; align-items: center; gap: 4px; }
/* Onglets de secteur : en vert ceux qui ont de la place pour l'animal choisi ou glissé. */
.hb-tab.is-full:not(.on) .fchip-n { color: #a8432a; opacity: 1; }
.hb-tab.can-take:not(.on) { border-color: #9cc3aa; background: #f1f7f2; color: #2f6b4c; }
.hb-tab.is-over:not(.on) { border-color: #3f7a5a; background: #e2efe6; }
.hb-modal-note { margin: 0 0 16px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.form-grid .hb-modal-note { margin: 0; }
.hb-sector-new { margin-top: 8px; }
.hb-sector-new[hidden] { display: none; }
.hb-places { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.hb-place {
  background: var(--card); border: 1.5px solid #eae1d6; border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, background .15s;
}
.hb-place.is-multi { background: #f7f9f5; }
.hb-place.can-take { border-color: #9cc3aa; }
.hb.is-picking .hb-place.can-take { cursor: pointer; }
.hb-place.is-over { border-color: #3f7a5a; background: #eaf3ec; }
.hb-place-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.hb-code { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.hb-type { font-size: 12px; color: var(--muted); }
.hb-place-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.hb-pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #e3eee6; color: #2f6b4c; font-variant-numeric: tabular-nums; }
.hb-pill.is-full { background: #f0eae2; color: #7a6e64; }
.hb-pill.is-over-cap { background: #f8e3da; color: #a8432a; }
.hb-edit { border: none; background: none; color: #a89a8c; cursor: pointer; padding: 5px; border-radius: 6px; display: grid; place-items: center; }
.hb-edit:hover { background: #f3ebe0; color: var(--ink); }
.hb-occ { display: flex; flex-direction: column; gap: 6px; }
.hb-occupant { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; background: #fff; border: 1px solid #efe6da; }
.can-manage .hb-occupant { cursor: grab; }
.hb-ini { width: 32px; height: 32px; border-radius: 8px; flex: none; background: var(--tint); color: var(--tone); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.hb-occ-main { min-width: 0; flex: 1; }
.hb-occ-name { display: block; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-occ-name:hover { color: var(--ink); }
.hb-occ-sub { font-size: 12px; color: var(--tone); }
.hb-unassign { margin: 0; display: contents; }
.hb-x { font: inherit; font-size: 16px; line-height: 1; border: none; background: none; color: #a89a8c; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.hb-x:hover { background: #f3ebe0; color: var(--ink); }
.hb-slot {
  height: 46px; border-radius: 10px; border: 1.5px dashed #e2d7c9; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #a89a8c;
}
.hb-place.can-take .hb-slot { border-color: #9cc3aa; color: #2f6b4c; }
.hb-slot-drop, .hb-place.is-over .hb-slot-free { display: none; }
.hb-place.is-over .hb-slot-drop { display: inline; }
.hb-more { font-size: 12px; color: var(--muted); text-align: center; }
.hb-modal-actions { align-items: center; }
.hb-modal-actions form { margin: 0; }

/* ---- Annuaire : liste ---- */
.an-tools { display: flex; flex-direction: column; gap: 12px; }
.an-search-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.an-search-row .fbar-search { min-width: 260px; }
.an-missing {
  font-size: 13px; font-weight: 600; padding: 10px 14px; border-radius: 10px; border: 1px solid #e2d7c9;
  background: var(--card); color: #9a4128; text-decoration: none; white-space: nowrap;
}
.an-missing:hover { color: #9a4128; border-color: #d9b8a6; text-decoration: none; }
.an-missing.on { background: #f8e3da; border-color: #e9bba6; }
.an-layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.an-table { flex: 999 1 520px; background: var(--card); border: 1px solid #eae1d6; border-radius: 16px; overflow: hidden; min-width: 0; }
.an-head, .an-row {
  display: grid; gap: 16px; align-items: center; padding: 12px 20px;
  grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1.3fr) minmax(90px, .8fr);
}
.an-table.has-extra .an-head, .an-table.has-extra .an-row {
  grid-template-columns: minmax(180px, 1.4fr) minmax(130px, 1fr) minmax(150px, 1.2fr) minmax(90px, .7fr);
}
.an-head { font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid #f0e8dd; }
.an-row { border-bottom: 1px solid #f4eee6; color: var(--ink); text-decoration: none; cursor: pointer; }
.an-row:last-child { border-bottom: none; }
.an-row:hover { background: #faf5ee; color: var(--ink); text-decoration: none; }
.an-row.is-sel { background: #f6eee3; }
.an-person { display: flex; gap: 12px; align-items: center; min-width: 0; }
.an-ava {
  width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--tint); color: var(--tone);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.an-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-inactive { font-size: 11px; font-weight: 600; color: var(--red); }
.an-role { font-size: 12px; font-weight: 600; color: var(--tone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-role-more { color: var(--muted); font-weight: 500; }
.an-extra { font-size: 13px; min-width: 0; }
.an-extra-sub { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-contact { font-size: 13px; line-height: 1.45; min-width: 0; }
.an-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-phone { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-todo { font-size: 12px; color: #b4553a; }
.an-city { font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.an-city.is-empty { color: #a89a8c; }
.an-empty { padding: 40px; text-align: center; font-size: 14px; color: var(--muted); }
.an-aside {
  flex: 1 1 280px; background: var(--card); border: 1px solid #eae1d6; border-radius: 16px; padding: 22px;
  display: flex; flex-direction: column; gap: 18px; position: sticky; top: 24px;
}
.an-aside[hidden] { display: none; }
.an-aside-top { display: flex; justify-content: space-between; align-items: flex-start; }
.an-aside-ava { width: 52px; height: 52px; font-size: 16px; }
.an-aside-close { font: inherit; font-size: 13px; border: none; background: none; color: var(--muted); cursor: pointer; padding: 4px; }
.an-aside-close:hover { color: var(--ink); }
.an-aside-name { font-size: 20px; font-weight: 700; }
.an-aside-role { font-size: 13px; font-weight: 600; color: var(--tone); margin-top: 4px; }
.an-aside-org { font-size: 13px; color: var(--muted); margin-top: 2px; }
.an-aside-org:empty { display: none; }
.an-aside-facts { display: flex; flex-direction: column; gap: 12px; font-size: 14px; border-top: 1px solid #f0e8dd; padding-top: 16px; overflow-wrap: anywhere; }
.an-aside-facts .is-empty { color: #a89a8c; }
.an-aside-k { font-size: 12px; color: var(--muted); }
.an-aside-actions { display: flex; flex-direction: column; gap: 8px; }
.an-aside-actions .btn { justify-content: center; }
.an-aside-actions [hidden] { display: none; }

/* ---- Annuaire : fiche personne ---- */
.pf-back { font-size: 13px; font-weight: 500; color: #7a6e64; }
.pf-back:hover { color: var(--ink); }
.pf-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.pf-ava {
  width: 80px; height: 80px; border-radius: 50%; flex: none; background: var(--tint); color: var(--tone);
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700;
}
.pf-id { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.pf-name { margin: 0; font-size: 36px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.pf-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rpill {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--tint); color: var(--tone);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.rpill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--dot); }
.pf-city { font-size: 12px; color: var(--muted); padding: 4px 2px; }
.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.pf-main { flex: 999 1 440px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.pf-aside { flex: 1 1 300px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pf-sec { background: var(--card); border: 1px solid #eae1d6; border-radius: 16px; overflow: hidden; }
.pf-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid #f0e8dd; flex-wrap: wrap; }
.pf-sec-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-sec-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--dot); }
.pf-sec-title h2 { margin: 0; font-size: 17px; font-weight: 700; }
.pf-sec-meta { font-size: 13px; color: var(--muted); }
.pf-sec-btn {
  font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 8px; border: 1px solid #e2d7c9;
  background: var(--card); color: var(--ink); white-space: nowrap; text-decoration: none;
}
.pf-sec-btn:hover { background: #f3ebe0; color: var(--ink); text-decoration: none; }
.pf-sec-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.pf-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 20px; }
.pf-fact-k { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.pf-fact-v { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.pf-fact-v.is-alert { color: #b4553a; }
.pf-fact-v.is-empty { color: #a89a8c; font-weight: 500; }
.pf-sub { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.pf-dispo { display: grid; grid-template-columns: 78px repeat(7, minmax(0, 1fr)); gap: 4px; font-size: 12px; max-width: 520px; }
.pf-dispo-day { text-align: center; font-weight: 600; color: #5e534a; }
.pf-dispo-lbl { height: 26px; display: flex; align-items: center; color: var(--muted); }
.pf-dispo-cell { height: 26px; border-radius: 6px; background: #f3ede5; }
.pf-dispo-cell.on { background: #e9c97a; }
.pf-taglist { display: flex; gap: 6px; flex-wrap: wrap; }
.pf-tag { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: #f3ede5; color: #5e534a; }
.pf-rows { display: flex; flex-direction: column; }
.pf-rows .pf-sub { margin-bottom: 6px; }
.pf-row {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 11px 0; border-top: 1px solid #f4eee6; font-size: 14px;
}
.pf-row-a { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pf-row-b { color: #7a6e64; min-width: 0; }
.tpill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: #f0eae2; color: #7a6e64; }
.tpill.ok { background: #e3eee6; color: #2f6b4c; }
.tpill.wait { background: #f5ebcf; color: #86621a; }
.tpill.alert { background: #f8e3da; color: #a8432a; display: inline; border: 0; margin-bottom: 0; }   /* « alert » est aussi le bandeau d'alerte */
.pf-empty { padding: 20px; text-align: center; font-size: 14px; color: var(--muted); border: 1px dashed #e2d7c9; border-radius: 12px; }
.pf-empty-lg { padding: 40px; border-radius: 16px; }
.pf-card { background: var(--card); border: 1px solid #eae1d6; border-radius: 16px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.pf-card h2 { margin: 0; font-size: 15px; font-weight: 700; }
.pf-note { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 1.55; }
.pf-kv { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.pf-kv > div { display: flex; justify-content: space-between; gap: 12px; }
.pf-kv .k { color: var(--muted); flex: none; }
.pf-kv .v { text-align: right; overflow-wrap: anywhere; color: var(--ink); }
.pf-kv a.v:hover { color: var(--primary-dd); }
.pf-kv .v.is-empty { color: #a89a8c; }
.pf-roles { display: flex; flex-direction: column; gap: 4px; }
.pf-role { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-size: 14px; cursor: pointer; }
.pf-role:hover { background: #f6eee3; }
.pf-role.is-static { cursor: default; }
.pf-role.is-static:hover { background: none; }
.pf-role input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pf-box {
  width: 18px; height: 18px; border-radius: 5px; flex: none; border: 1.5px solid #d9cbb9; background: #fff;
  color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; line-height: 1;
}
.pf-role input:checked + .pf-box, .pf-box.is-on { background: var(--dot); border-color: var(--dot); }
.pf-role input:checked + .pf-box::after, .pf-box.is-on::after { content: '✓'; }
.pf-role input:checked ~ .pf-role-name, .pf-role.is-static .pf-role-name { font-weight: 600; }
.pf-role input:focus-visible + .pf-box { outline: 2px solid #2a2420; outline-offset: 2px; }
.pf-roles-foot { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #f0e8dd; padding-top: 12px; margin-top: 8px; }
.pf-roles-foot[hidden] { display: none; }
.pf-roles-hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.pf-roles-btns { display: flex; gap: 8px; }
.pf-roles-btns .btn-ink { flex: 1; justify-content: center; }
.pf-muted { font-size: 14px; color: var(--muted); }
.pf-mails { gap: 10px; }
.pf-mail { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 6px 0; border-top: 1px solid #f4eee6; }
.pf-mail-date { color: var(--muted); font-size: 12px; flex: none; }
.pf-danger {
  width: 100%; font: inherit; font-size: 13px; font-weight: 600; padding: 10px; border-radius: 10px;
  border: 1px solid #ebd3c8; background: transparent; color: #a8432a; cursor: pointer;
}
.pf-danger:hover { background: #f8e3da; }

@media (max-width: 860px) {
  .pgh-title, .pf-name { font-size: 26px; }
  .fbar { position: static; margin: 0; padding: 0; }
  .fbar-sep { display: none; }
  .tb-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .tb-grid.is-compact { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .hb-aside { max-width: none; position: static; max-height: 60vh; }
  .hb-pick { top: 64px; }
  .an-aside { display: none !important; }
  .an-head, .an-row, .an-table.has-extra .an-head, .an-table.has-extra .an-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; }
  .an-col-contact, .an-col-extra { display: none; }
  .pf-ava { width: 60px; height: 60px; font-size: 20px; }
  .pf-sec-head, .pf-sec-body { padding-left: 18px; padding-right: 18px; }
  .pf-row { grid-template-columns: minmax(0, 1fr) auto; }
  .pf-row-b { grid-column: 1 / -1; grid-row: 2; margin-top: -6px; font-size: 13px; }
}

/* ===========================================================
   Fiche unique (annuaire) : formulaire adapté aux rôles
   (directory/form) — une section par rôle, visible quand le
   rôle est coché ; alerte quand on décoche un rôle déjà porté.
   =========================================================== */
.dform { display: flex; flex-direction: column; gap: 16px; }
.dform .pf-sec-body textarea { width: 100%; }
.dform .role-opt.is-locked { opacity: .55; cursor: not-allowed; }
.dform-role { border-left: 4px solid var(--dot); scroll-margin-top: 16px; }
.dform:has(#rcb-volunteer:not(:checked)) #role-volunteer,
.dform:has(#rcb-foster:not(:checked)) #role-foster,
.dform:has(#rcb-caregiver:not(:checked)) #role-caregiver,
.dform:has(#rcb-adopter:not(:checked)) #role-adopter { display: none; }
.dform-drop { display: none; margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--red-bg); color: var(--red); font-size: 13px; line-height: 1.45; }
.dform:has(#rcb-adopter:not(:checked)) #rdrop-adopter,
.dform:has(#rcb-foster:not(:checked)) #rdrop-foster,
.dform:has(#rcb-volunteer:not(:checked)) #rdrop-volunteer,
.dform:has(#rcb-caregiver:not(:checked)) #rdrop-caregiver,
.dform:has(#rcb-donor:not(:checked)) #rdrop-donor,
.dform:has(#rcb-staff:not(:checked)) #rdrop-staff,
.dform:has(#rcb-partner:not(:checked)) #rdrop-partner,
.dform:has(#rcb-owner:not(:checked)) #rdrop-owner { display: block; }
.dform-dup {
  display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 14px 18px; border-radius: 14px; border: 1px solid var(--peach-br); background: var(--peach); font-size: 13.5px;
}
.dform-dup .check-sub { margin-top: 3px; }
.dform-dup-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===========================================================
   Planning des bénévoles : vue semaine (volunteers/index)
   =========================================================== */
.vp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.vp-nav { display: flex; gap: 6px; }
.vp-nav .btn.is-current { border-color: var(--primary); color: var(--primary-d); }
.vp-open-count { color: var(--red); font-weight: 600; }
.vp-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.vp-day { display: flex; flex-direction: column; min-height: 150px; border: 1px solid var(--border); border-radius: 12px; background: var(--soft2); overflow: hidden; }
.vp-day.is-today { border-color: var(--primary); box-shadow: inset 0 3px 0 var(--primary); }
.vp-day.is-past { opacity: .62; }
.vp-day-head { display: flex; align-items: baseline; gap: 6px; padding: 8px 10px 6px; }
.vp-dow { font-size: 12px; font-weight: 600; color: var(--muted); }
.vp-dnum { font-size: 16px; font-weight: 700; font-family: var(--display); }
.vp-day.is-today .vp-dnum { color: var(--primary-d); }
.vp-add {
  margin-left: auto; width: 24px; height: 24px; border-radius: 7px; border: 1px dashed var(--border2);
  background: transparent; color: var(--muted2); cursor: pointer; font-size: 15px; line-height: 1; padding: 0;
}
.vp-add:hover { border-style: solid; border-color: var(--primary); color: var(--primary-d); background: var(--card); }
.vp-day-body { display: flex; flex-direction: column; gap: 6px; padding: 0 6px 8px; flex: 1; }
.vp-shift {
  display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; font: inherit; color: inherit;
  padding: 6px 8px 6px 10px; border-radius: 8px; border: 1px solid var(--border); border-left: 4px solid var(--c);
  background: var(--card); cursor: default;
}
button.vp-shift { cursor: pointer; }
button.vp-shift:hover { border-color: var(--border2); border-left-color: var(--c); box-shadow: 0 1px 4px rgba(43, 38, 34, .08); }
.vp-shift.is-open { border: 1px dashed var(--red); border-left-width: 4px; background: var(--red-bg); }
.vp-time { font-size: 11.5px; font-weight: 600; color: var(--muted2); font-variant-numeric: tabular-nums; }
.vp-who { font-size: 13px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.vp-shift.is-open .vp-who { color: var(--red); }
.vp-task { font-size: 12px; color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }
.vp-free { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; padding: 6px 8px; border-top: 1px dashed var(--border); }
.vp-free-lbl { font-size: 11px; color: var(--muted); margin-right: 2px; }
.vp-free-more { font-size: 11px; color: var(--muted2); font-weight: 600; }
.vp-ava {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  color: var(--card); font-size: 13px; font-weight: 600;
}
.vp-ava-sm { width: 22px; height: 22px; font-size: 9.5px; }
.vp-member { cursor: default; }
.vp-days { display: flex; gap: 3px; flex-shrink: 0; }
.vp-days span {
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 600; background: var(--soft); color: #b3a595;
}
.vp-days span.on { background: #e9c97a; color: #5e4a1a; }
@media (max-width: 1100px) {
  .vp-week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .vp-week { grid-template-columns: 1fr; }
  .vp-day { min-height: 0; }
  .vp-days { display: none; }
}

/* ---------- Dons : fiche d'un don, recherche avancée, reçus fiscaux ---------- */
a.tbl-row.don-cols { cursor: pointer; }
.don-go { color: var(--muted); font-size: 18px; line-height: 1; text-align: center; }
a.kpi-link { color: inherit; text-decoration: none; transition: border-color .15s; }
a.kpi-link:hover { border-color: var(--peach-br); text-decoration: none; color: inherit; }
.don-search { margin-bottom: 14px; }
.don-search .don-filters { margin-bottom: 8px; }
.don-adv { border: 1px solid var(--border); border-radius: 12px; background: var(--soft2); }
.don-adv > summary { cursor: pointer; padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--muted2); list-style-position: inside; }
.don-adv[open] > summary { border-bottom: 1px solid var(--border); }
.don-adv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; padding: 12px 14px 4px; }
.don-adv-grid .form-field input, .don-adv-grid .form-field select { width: 100%; min-width: 0; }
.don-adv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 14px 12px; }
.don-missing { margin: 0 0 14px; padding-left: 18px; font-size: 13.5px; line-height: 1.7; }
.don-missing a { font-weight: 600; }
.don-cancel { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--soft); }
.don-cancel > summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.don-cancel form { margin-top: 10px; }
.don-hist { display: grid; grid-template-columns: 96px minmax(0, 1fr) 90px 104px; gap: 8px; align-items: center; }
.don-hist.is-current { background: var(--soft2); font-weight: 600; }
@media (max-width: 1100px) { .don-show > .col:last-child { order: -1; } }
@media (max-width: 900px) { .don-adv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .don-hist { grid-template-columns: 80px minmax(0, 1fr) 76px; }
  .don-hist > :last-child { display: none; }
}
/* ---------- fin Dons ---------- */

/* ---------- Annuaire : recherche avancée ---------- */
.dir-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 2px 0 14px; }
.dir-presets-k { font-size: 12px; color: var(--muted); margin-right: 4px; }
.dir-adv-k { margin: 18px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.adv-form .form-grid + .form-grid { margin-top: 12px; }
.dir-foot { padding: 14px 20px 16px; border-top: 1px solid #f4eee6; }
.adv-form .dir-sort { grid-template-columns: minmax(190px, 320px); }
/* ---------- fin Annuaire : recherche avancée ---------- */

/* ---------- Rapatriements ---------- */
.rp-kpis { grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.rp-trip { scroll-margin-top: 16px; }
.rp-trip-head { display: flex; align-items: flex-start; gap: 16px; }
.rp-date { flex-shrink: 0; width: 64px; padding: 8px 0 9px; border-radius: 14px; background: var(--peach); color: var(--primary-d); display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.rp-dow, .rp-mon { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.rp-dnum { font-family: var(--display); font-size: 26px; font-weight: 700; margin: 2px 0; }
.rp-trip-main { flex: 1; min-width: 0; }
.rp-trip-title { font-family: var(--display); font-size: 18px; font-weight: 700; margin: 2px 0 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-cap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.rp-bar { width: 160px; height: 8px; border-radius: 4px; }
.rp-cap-txt { font-size: 13px; font-weight: 700; }
.rp-list { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.rp-row { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 10px; }
.rp-row:hover { background: var(--soft2); }
.rp-row-wrap { flex-wrap: wrap; }
.rp-dest { flex-shrink: 0; }
.rp-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--soft2); font-size: 13px; color: var(--muted2); }
.rp-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.rp-empty { padding: 30px 24px; }
.rp-past { padding: 14px 20px; }
.rp-past > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted2); }
.rp-row-past { border-top: 1px solid var(--soft); border-radius: 0; }
.rp-quick { display: flex; gap: 6px; width: 100%; padding-left: 46px; }
.rp-quick select { flex: 1; min-width: 0; font-size: 12.5px; padding: 5px 8px; }
.rp-pick { max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 4px 6px; }
.rp-pick-group { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 6px 4px; }
.rp-pick-row { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.rp-pick-row:hover { background: var(--soft2); }
.rp-pick-row input { width: 16px; height: 16px; accent-color: var(--green); flex-shrink: 0; }
/* Types de rapatriement, escales du trajet, escale de chaque animal */
.rp-pick-row { cursor: default; }
.rp-pick-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.rp-pick-dest { display: block; }
.rp-stops { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 10px; }
.rp-stop { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--soft2); color: var(--muted2); white-space: nowrap; }
.rp-stop.on { background: var(--peach); color: var(--primary-d); }
.rp-stop b { font-weight: 700; margin-left: 2px; }
.rp-stops-sep { color: var(--muted); font-size: 12px; }
.rp-stop-head { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; padding: 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--primary-d); }
.rp-stop-head:first-child { margin-top: 0; }
.rp-stop-head.todo { color: var(--muted); }
.rp-stop-n { font-weight: 600; color: var(--muted); letter-spacing: 0; }
.rp-stop-form { margin: 0; flex-shrink: 0; }
select.rp-stop-sel { width: auto; max-width: 170px; flex-shrink: 0; font: inherit; font-size: 12.5px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: inherit; }
.rp-hint { margin-top: 5px; }
.rp-types-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rp-types-head .card-title { margin: 0; }
.rp-type { display: flex; align-items: flex-start; gap: 8px; padding: 10px 0; border-top: 1px solid var(--soft); }
.rp-type-name { font-size: 14px; font-weight: 600; }
.rp-type .rp-stops { margin-top: 6px; }
.rp-type-note { margin-top: 6px; }
@media (max-width: 720px) {
  .rp-kpis { grid-template-columns: 1fr; }
  .rp-pick-row { flex-wrap: wrap; }
  .rp-stop-form { margin-left: 50px; }
  .rp-bar { width: 110px; }
  .rp-row { flex-wrap: wrap; }
  .rp-dest { margin-left: 50px; }
}
/* ---------- fin Rapatriements ---------- */

/* ===========================================================
   Adoptions : un onglet par étape du parcours (adoptions/index)
   =========================================================== */
.adt-tabs {
  display: flex; gap: 4px; padding: 5px; background: var(--card); border: 1px solid #eae1d6;
  border-radius: 14px; flex-wrap: wrap; align-items: center;
}
.adt-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: #5e534a; white-space: nowrap; text-decoration: none; line-height: 1.2;
}
.adt-tab:hover { background: #f6eee3; color: var(--ink); text-decoration: none; }
.adt-tab.on, .adt-tab.on:hover { background: #2a2420; color: #fffdf9; }
.adt-tab.is-empty:not(.on) { color: #a89a8c; }
.adt-num {
  width: 20px; height: 20px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; background: var(--soft); color: var(--muted2); font-variant-numeric: tabular-nums;
}
.adt-num.is-final { background: var(--greentint); color: var(--green); }
.adt-tab.on .adt-num { background: rgba(255, 253, 249, .16); color: #fffdf9; }
.adt-n { font-size: 12px; font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }
.adt-late {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fffdf9;
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.adt-sep { width: 1px; align-self: stretch; background: #e6dccf; margin: 4px 3px; flex: none; }
.adt-navs { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.adt-navs .adt-tabs { flex: 0 1 auto; }

.adt-intro { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: -8px 0 -10px; }
.adt-found { font-weight: 600; color: var(--muted2); }
.adt-table { background: var(--card); border: 1px solid #eae1d6; border-radius: 16px; overflow: hidden; }
.adt-head, .adt-row {
  display: grid; gap: 16px; align-items: center; padding: 12px 20px;
  grid-template-columns: minmax(200px, 1.5fr) minmax(140px, 1fr) minmax(190px, 1.5fr) 150px 92px;
}
.adt-head { font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid #f0e8dd; }
.adt-row { border-bottom: 1px solid #f4eee6; color: var(--ink); text-decoration: none; }
.adt-row:last-of-type { border-bottom: none; }
.adt-row:hover { background: #faf5ee; color: var(--ink); text-decoration: none; }
.adt-row.must-vote { box-shadow: inset 3px 0 0 var(--primary); }
.adt-who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.adt-who-txt { min-width: 0; }
.adt-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adt-arrow { color: var(--muted); font-weight: 400; margin: 0 6px; }
.adt-adopter { font-weight: 600; }
.adt-meta { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adt-contact { font-size: 13px; line-height: 1.45; min-width: 0; }
.adt-phone { font-variant-numeric: tabular-nums; white-space: nowrap; }
.adt-email { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adt-next { min-width: 0; }
.adt-next-txt { font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.adt-next-txt.is-empty { color: #a89a8c; }
.adt-next .adopt-tags { margin-top: 5px; }
.adt-next .adopt-tags:empty { display: none; }
.adt-prog { min-width: 0; }
.adt-prog .adopt-step { margin-bottom: 5px; }
.seg.is-final i.on { background: var(--green); }
.adt-date { font-size: 12.5px; color: var(--muted2); text-align: right; white-space: nowrap; }
.adt-elsewhere { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin-top: 12px; font-size: 13px; }
.adt-table .tb-foot { border-top: 1px solid #f0e8dd; }

.adt-fu { padding: 6px 0; }
.adt-fu-k { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 12px 20px 6px; }
.adt-fu-k.is-late { color: var(--red); }
.adt-fu-done > summary { cursor: pointer; list-style: none; }
.adt-fu-done > summary::-webkit-details-marker { display: none; }
.adt-fu-done > summary::before { content: '▸'; display: inline-block; margin-right: 6px; transition: transform .15s; }
.adt-fu-done[open] > summary::before { transform: rotate(90deg); }
.adt-fu-row { display: flex; align-items: center; gap: 12px; padding: 9px 20px; }
.adt-fu-row + .adt-fu-row { border-top: 1px solid #f4eee6; }
.adt-fu-row.is-done .adt-fu-main { opacity: .6; }
.adt-fu-row.is-done .adt-fu-label { text-decoration: line-through; }
.adt-fu-main { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
a.adt-fu-main:hover { color: inherit; text-decoration: none; }
a.adt-fu-main:hover .adt-fu-label { text-decoration: underline; }
.adt-fu-label { font-size: 14px; font-weight: 600; }
.adt-fu-date { font-size: 12.5px; color: var(--muted2); white-space: nowrap; }
.adt-fu-date.is-late { color: var(--red); font-weight: 700; }

@media (max-width: 1180px) {
  .adt-head, .adt-row { grid-template-columns: minmax(200px, 1.5fr) minmax(190px, 1.5fr) 140px 84px; }
  .adt-col-contact { display: none; }
}
@media (max-width: 760px) {
  /* Barres défilantes : elles ne doivent pas élargir la page (.main grandit sinon à leur largeur). */
  .adt-navs { flex-direction: column; flex-wrap: nowrap; gap: 8px; contain: inline-size; }
  .adt-navs .adt-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .adt-tabs::-webkit-scrollbar { display: none; }
  .adt-head { display: none; }
  .adt-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who date" "next next" "step step"; gap: 8px 12px; padding: 12px 14px; }
  .adt-who { grid-area: who; }
  .adt-next { grid-area: next; padding-left: 52px; }
  .adt-col-step { grid-area: step; padding-left: 52px; }
  .adt-col-date { grid-area: date; align-self: start; }
  .adt-fu-row { padding: 9px 14px; flex-wrap: wrap; }
  .adt-fu-k { padding-left: 14px; }
}
/* ---------- fin Adoptions (onglets) ---------- */

/* ---------- Rappels de soins : raccourcis, « me prévenir », alerte d'accueil ---------- */
.due-pick .due-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.due-pick .due-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.due-pick .due-row input { flex: 1 1 150px; width: auto; min-width: 0; }
.form-field label.due-notify { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 13px; font-weight: 600; color: var(--muted2); cursor: pointer; }
.form-field .due-notify input { flex: none; width: 16px; height: 16px; padding: 0; margin: 0; accent-color: var(--primary); }
.form-field .due-notify:has(input:disabled) { opacity: .5; cursor: default; }
.due-pick .check-sub { margin-top: 4px; }
.due-bell { display: inline-flex; vertical-align: -1px; margin-left: 5px; color: var(--primary); }
.alert-late .alert-dot { background: var(--red); }
.alert-acts { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.alert-acts .alert-link { margin-left: 0; }
.due-done-lead { margin: -4px 0 16px; font-size: 13.5px; color: var(--muted2); }
.due-skip { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); text-align: center; }
.due-skip-btn { border: none; background: none; padding: 0; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; text-decoration: underline; }
.due-skip-btn:hover { color: var(--ink); }
@media (max-width: 620px) {
  .alert:has(.alert-acts) { flex-wrap: wrap; row-gap: 10px; }
  .alert:has(.alert-acts) .alert-text { flex: 1 1 0; min-width: 0; }
  .alert-acts { flex-basis: calc(100% - 20px); margin-left: 20px; }
}
/* ---------- fin Rappels de soins ---------- */

/* ---------- Familles d'accueil : disponibilités (/fosters) et parcours ---------- */
.fb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; contain: inline-size; }
.fb-card {
  background: var(--card); border: 1px solid #eae1d6; border-left: 4px solid var(--green); border-radius: 14px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.fb-card.is-full { border-left-color: #d9b45a; }
.fb-card.is-off { border-left-color: var(--border2); background: #fbf8f3; }
.fb-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fb-name { font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.25; overflow-wrap: anywhere; }
.fb-top .badge { flex-shrink: 0; }
.fb-meta { font-size: 12.5px; color: var(--muted); margin-top: -6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fb-meta:empty { display: none; }
.fb-seats { display: flex; gap: 5px; flex-wrap: wrap; }
.fb-seats span { width: 14px; height: 14px; border-radius: 4px; border: 1.5px dashed #c9b9a3; }
.fb-seats span.on { background: var(--primary); border: 1.5px solid var(--primary); }
.fb-note { font-size: 12.5px; color: #7a6e64; font-style: italic; }
.fb-accepts { gap: 6px; }
.fb-accepts .trait { font-size: 11.5px; padding: 3px 9px; }
.trait.is-match { background: var(--green); color: #fffdf9; }
.fb-cond { font-size: 12.5px; color: #5e534a; line-height: 1.5; }
.fb-hosted { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid #f0e7da; }
.fb-animal { display: flex; align-items: center; gap: 8px; color: inherit; min-width: 0; }
.fb-animal:hover { text-decoration: none; }
.fb-animal:hover b { text-decoration: underline; }
.fb-animal span { display: flex; flex-direction: column; min-width: 0; font-size: 13px; line-height: 1.25; }
.fb-animal small { font-size: 11.5px; color: var(--muted); }
.fb-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; flex-wrap: wrap; }

.pc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pc-item { position: relative; display: flex; gap: 14px; padding: 0 0 18px; }
.pc-item::before { content: ''; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: #f0e5d4; }
.pc-item:last-child { padding-bottom: 0; }
.pc-item:last-child::before { display: none; }
.pc-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; background: var(--card); border: 2.5px solid var(--border2); z-index: 1; }
.pc-item.is-foster .pc-dot { border-color: var(--primary); }
.pc-item.is-adoption .pc-dot { border-color: var(--green); }
.pc-item.is-open .pc-dot { background: currentColor; }
.pc-item.is-foster.is-open .pc-dot { background: var(--primary); }
.pc-item.is-adoption.is-open .pc-dot { background: var(--green); }
.pc-item.is-arrival .pc-dot { border-color: var(--muted); }
.pc-item.is-now .pc-dot { background: var(--primary); border-color: var(--primary); }
.pc-back { color: #9a7420; }
.pc-body { min-width: 0; }
.pc-when { font-size: 12px; color: var(--muted); font-weight: 600; }
.pc-title { font-size: 14px; font-weight: 600; margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pc-kind { color: #5e534a; font-weight: 500; }
.pc-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.ad-when { font-size: 12.5px; color: var(--green); font-weight: 600; margin-top: 3px; }
.ad-back { display: block; color: #9a7420; }
/* ---------- fin Familles d'accueil : disponibilités et parcours ---------- */

/* ---------- Rôles du refuge et droits particuliers d'un compte ---------- */
/* Matrice : case dont le refuge a changé la valeur par rapport à la plateforme. */
.roles-scroll { contain: inline-size; }
.roles-matrix td.mx-diff { background: var(--peach); box-shadow: inset 0 0 0 1px var(--peach-br); }
.mx-legend { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: -1px;
  background: var(--peach); box-shadow: inset 0 0 0 1px var(--peach-br); }
.role-flag { font-size: 11.5px; font-weight: 700; color: var(--primary-d); background: var(--peach); border-radius: 999px; padding: 2px 8px; }

/* Liste des comptes : « +2 −1 » à côté du rôle. */
.uperm-chip { display: inline-flex; gap: 5px; margin-left: 6px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); vertical-align: middle; }
.uperm-chip:hover { text-decoration: none; border-color: var(--peach-br); }
.uperm-chip .is-plus { color: var(--green); }
.uperm-chip .is-minus { color: var(--red); }

/* Fiche d'un compte : une case par droit, groupées par page. */
.uperms .btn[hidden] { display: none; }
.uperm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.uperm-group { border: 1.5px solid var(--border); border-radius: 14px; padding: 10px 12px 8px; margin: 0; min-width: 0; }
.uperm-group legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted2); padding: 0 6px; }
.uperm { display: flex; align-items: flex-start; gap: 9px; padding: 6px 6px; border-radius: 8px; font-size: 13.5px; line-height: 1.35; cursor: pointer; }
.uperm:hover { background: var(--soft2); }
.uperm input { width: 16px; height: 16px; margin: 1px 0 0; flex: none; accent-color: var(--green); cursor: pointer; }
.uperm input:disabled { cursor: not-allowed; opacity: .55; }
.uperm-label { flex: 1; min-width: 0; }
.uperm-tag { display: none; flex: none; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.uperm[data-state="plus"] { background: var(--greentint); }
.uperm[data-state="plus"] .uperm-tag.is-plus { display: inline-block; color: var(--green); background: #fff; }
.uperm[data-state="minus"] { background: var(--red-bg); }
.uperm[data-state="minus"] .uperm-label { color: var(--muted2); text-decoration: line-through; text-decoration-color: rgba(168,67,58,.45); }
.uperm[data-state="minus"] .uperm-tag.is-minus { display: inline-block; color: var(--red); background: #fff; }
/* ---------- fin Rôles du refuge et droits particuliers ---------- */

/* ---------- Documents : liste commune à tout le refuge (/documents) ---------- */
.dl-table { background: var(--card); border: 1px solid #eae1d6; border-radius: 16px; overflow: hidden; min-width: 0; }
.dl-head, .dl-row {
  display: grid; gap: 16px; align-items: center; padding: 12px 20px;
  grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.1fr) 100px 200px;
}
.dl-head { font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid #f0e8dd; }
.dl-row { border-top: 1px solid #f4eee6; }
.dl-head + .dl-row { border-top: none; }
.dl-row:hover { background: #faf5ee; }
.dl-doc { display: flex; gap: 12px; align-items: center; min-width: 0; }
.dl-doc > div { min-width: 0; flex: 1; }
.dl-doc .doc-tile { text-decoration: none; }
.doc-tile.WEB { background: var(--purple); color: #7a5a80; }
.dl-title { display: flex; gap: 8px; align-items: center; min-width: 0; font-size: 14px; font-weight: 600; }
.dl-title > a, .dl-title > .dl-nolink { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.dl-title > a:hover { color: var(--primary-d); }
.dl-title .tpill { flex: none; }
.dl-meta { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-link { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13px; line-height: 1.4; }
.dl-link > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-link .dl-sub { font-size: 12px; color: var(--muted); text-decoration: underline; text-decoration-color: #d9cdbd; text-underline-offset: 2px; }
.dl-none { color: #a89a8c; }
.dl-date { font-size: 13px; color: var(--muted2); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.dl-acts { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; min-width: 0; }
.dl-acts .btn { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.dl-note { font-size: 12px; color: #a89a8c; white-space: nowrap; }
.dl-note.is-missing { color: var(--red); font-weight: 600; }
.dl-adv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 0 12px; }
.dl-adv-actions { display: flex; gap: 8px; margin-left: auto; }
.dl-hint { margin: -6px 2px 0; line-height: 1.5; }
@media (max-width: 860px) {
  .dl-head { display: none; }
  .dl-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; align-items: start; }
  .dl-date { padding-top: 2px; font-size: 12px; }
  .dl-link { grid-column: 1 / -1; grid-row: 2; flex-direction: row; flex-wrap: wrap; gap: 2px 12px; padding-left: 48px; }
  .dl-title { flex-wrap: wrap; gap: 4px 8px; }
  .dl-title > a, .dl-title > .dl-nolink { white-space: normal; }
  .dl-acts { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; padding-left: 48px; }
}
/* ---------- fin Documents ---------- */

/* ---------- Acte médical pour plusieurs animaux (partials/modal_acte) ---------- */
.acte-who [hidden] { display: none !important; }
.acte-who-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.form-field .acte-who-head label { margin: 0; }
.acte-who-switch { border: none; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--primary-d); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.acte-who-switch:hover { color: var(--primary); }
/* Plusieurs animaux : la liste prend toute la largeur, la description passe à côté du type. */
.form-grid.acte-many .acte-who { grid-column: 1 / -1; }
.form-grid.acte-many .acte-desc { grid-column: auto; }
.acte-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin: 8px 0; }
.acte-tools-btns { display: flex; gap: 6px; }
.acte-who .acte-pick { max-height: 220px; }
.form-field .acte-pick label.rp-pick-row { display: flex; margin: 0; font-size: 13.5px; font-weight: 400; color: var(--ink); cursor: pointer; }
.form-field .acte-pick input[type="checkbox"] { flex: none; width: 16px; height: 16px; padding: 0; margin: 0; border: 0; box-shadow: none; }
.form-field .acte-pick input[type="checkbox"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.acte-pick-empty { padding: 10px 6px; }
/* ---------- fin Acte médical pour plusieurs animaux ---------- */

/* ---------- Historique des emplacements (hébergement à une date, passages, fiche animal) ---------- */
.hb-asof { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.hb-asof label { font-size: 13px; color: var(--muted); font-weight: 600; }
.hb-asof .sinput { width: auto; min-width: 0; flex: none; padding: 8px 10px; border-radius: 10px; background: #fff; }
.hb-asof-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px;
  background: var(--peach); border: 1px solid var(--peach-br); border-radius: 14px;
}
.hb-asof-bar strong { font-size: 15px; }
.hb-asof-now { margin-left: auto; }
.hb-move { display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; }
.hb-move-at { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; width: 38px; }
.hb-hist { padding: 6px 8px; overflow-x: auto; contain: inline-size; }
.bx-now { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bx-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.bx-when { font-size: 12.5px; color: var(--muted); }
.bx-mates { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.bx-mates a { color: var(--primary-d); font-weight: 600; }
.bx-stay { padding: 6px 0; }
.bx-stay + .bx-stay { border-top: 1px solid var(--soft); }
/* ---------- fin Historique des emplacements ---------- */

/* ---------- Organisations de l'annuaire (autre association, refuge…) et animaux cédés / confiés ---------- */
.tone-org { --tint: #e2e8f4; --tone: #3b4f7a; --dot: #5b74a8; }
/* Une organisation se reconnaît à son avatar carré ; sa pastille de filtre se tient à l'écart des rôles. */
.an-row.is-org .an-ava { border-radius: 9px; }
.pf-ava.is-org { border-radius: 18px; }
.fchip-org { margin-left: 10px; }
.fchip-org .fchip-dot { border-radius: 2px; }
/* Formulaire de la fiche : choix personne / organisation, qui affiche les champs de l'une ou de l'autre. */
.kind-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.kind-opt {
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; cursor: pointer;
  border: 1px solid var(--border2); border-radius: 12px; background: var(--card);
}
.kind-opt input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; pointer-events: none; }
.kind-opt-name { font-size: 14px; font-weight: 700; color: var(--muted2); }
.kind-opt-hint { font-size: 12px; line-height: 1.35; color: var(--muted); }
.kind-opt:hover { border-color: var(--peach-br); }
.kind-opt:has(input:checked) { border-color: var(--primary); background: var(--peach); }
.kind-opt:has(input:checked) .kind-opt-name { color: var(--ink); }
.kind-opt:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.dform:has(#kind-org:not(:checked)) .only-org,
.dform:has(#kind-org:checked) .only-person { display: none; }
@media (max-width: 520px) { .kind-switch { grid-template-columns: 1fr; } }
/* Parcours de l'animal : confié à une organisation (en cours = plein), cédé. */
.pc-item.is-custody .pc-dot, .pc-item.is-cession .pc-dot { border-color: #5b74a8; }
.pc-item.is-custody.is-open .pc-dot, .pc-item.is-cession.is-open .pc-dot { background: #5b74a8; }
/* ---------- fin Organisations ---------- */
