/* ===========================================================
   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: 24px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; }
.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;
}
.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; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; border: none;
  font: inherit; font-size: 14px; padding: 10px 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); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.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); }
.capacity { background: var(--soft); border-radius: 14px; padding: 14px; }
.capacity-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.capacity-label { font-size: 12px; font-weight: 600; color: var(--muted2); }
.capacity-val { font-family: var(--display); font-weight: 700; font-size: 14px; }
.capacity-track { height: 6px; border-radius: 3px; background: var(--border2); overflow: hidden; }
.capacity-fill { height: 100%; border-radius: 3px; background: var(--primary); }
.capacity-sub { font-size: 11px; color: var(--muted); margin-top: 8px; }
.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); }
.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; }

/* ---------- 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); }

.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); }

/* ---------- Tâches / 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; }
.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 img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 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 ---------- */
.login-wrap { position: relative; min-height: 100vh; display: grid; 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-error { background: var(--red-bg); color: var(--red); font-size: 13px; font-weight: 600; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }

/* ---------- 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); }
/* Switcher de refuge (super admin) en bas de la barre latérale. */
.refuge-switch { padding: 0; }
.refuge-switch .gsearch-input { background: var(--soft); }
.refuge-switch .gsearch-ico { left: 10px; top: 10px; }
/* Panneau qui s'ouvre vers le haut et épouse la largeur de la barre. */
.gsearch-panel--up { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; width: auto; max-width: none; }

/* ---- 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; }

/* ---- Galerie photos (fiche animal) ---- */
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.photo-thumb { position: relative; width: 58px; height: 58px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; cursor: pointer; }
.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-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; }
  .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 (Box / Arrivé) de la liste d'accueil : masquées sur
     mobile — leurs largeurs fixes (110/120px) forçaient un débordement
     horizontal. L'info reste disponible sur la fiche de l'animal. */
  .row .row-col { display: none; }
}
@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;
}
.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; }
.ss-option { 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: grid; grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 12px; }
.zone-occupants--wrap { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.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; grid-column: 1 / -1; }
.occ-card { display: flex; flex-direction: column; gap: 7px; background: var(--soft2); border: 1px solid var(--border); border-radius: 14px; padding: 8px; }
.zone-card--parc .occ-card { background: var(--card); }
.occ-photo { width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; object-fit: cover; display: block; }
.occ-photo--ph { display: grid; place-items: center; color: #fffdf9; font-family: var(--display); font-weight: 700; font-size: 30px; }
.occ-info { min-width: 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 ---- */
.acting-banner { display: flex; align-items: center; gap: 8px; justify-content: space-between; background: var(--purple); border: 1px solid #e0d3e2; border-radius: 12px; padding: 9px 12px; margin-bottom: 14px; }
.acting-text { font-size: 11.5px; font-weight: 600; color: #7a5a80; line-height: 1.25; min-width: 0; }
.acting-leave { border: none; background: #7a5a80; color: #fff; font: inherit; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 8px; cursor: pointer; flex-shrink: 0; }
.acting-leave:hover { background: #674a6c; }
/* ---- 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); }
.dir-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; }
.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 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; }
}
