@import url('https://fonts.googleapis.com/css2?family=Livvic:wght@300;400;500;600;700&display=swap');

:root {
  --enaos-primary: #1A298C;
  --enaos-primary-hover: #17257F;
  --enaos-primary-foreground: #FFFFFF;
  --enaos-secondary: #DFE3FF;
  --enaos-background: #FFF8ED;
  --enaos-foreground: #20243A;
  --enaos-muted-foreground: #73778C;
  --enaos-muted-foreground-2: #9CA0B3;
  --enaos-card: #FFFFFF;
  --enaos-border: #D4D8E3;
  --enaos-border-50: rgba(212, 216, 227, .5);
  --enaos-destructive: #E74C3C;
  --enaos-success: #2E8F5D;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(26, 41, 140, .05);
  --shadow-md: 0 4px 6px -1px rgba(26, 41, 140, .08), 0 2px 4px -2px rgba(26, 41, 140, .05);
  --shadow-lg: 0 10px 15px -3px rgba(26, 41, 140, .10), 0 4px 6px -4px rgba(26, 41, 140, .05);
  --shadow-cta: 0 4px 14px 0 rgba(26, 41, 140, .2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

body {
  font-family: 'Livvic', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--enaos-foreground);
  background: var(--enaos-background);
  min-height: 100vh;
}

a { color: var(--enaos-primary); text-decoration: none; }
a:hover { color: var(--enaos-primary-hover); }
input, select, textarea, button { font-family: inherit; }
input[type="checkbox"] { accent-color: var(--enaos-primary); }

/* ── App shell : rail + topbar ── */
.app-shell { min-height: 100vh; display: flex; }

.rail {
  width: 252px; flex: 0 0 252px; min-width: 0; overflow: hidden;
  background: var(--enaos-card);
  border-right: 1px solid var(--enaos-border-50);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  transition: width .18s ease, flex-basis .18s ease;
}
.rail-head {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid var(--enaos-border-50);
}
.rail-brand { min-width: 0; overflow: hidden; flex: 1; }
.rail-brand-full { font-size: 22px; font-weight: 700; color: var(--enaos-primary); letter-spacing: -.01em; line-height: 1.1; white-space: nowrap; }
.rail-brand-full small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--enaos-muted-foreground); margin-top: 4px; }
.rail-brand-mini { display: none; font-size: 20px; font-weight: 700; color: var(--enaos-primary); letter-spacing: -.01em; }

.rail-toggle {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: var(--radius-full);
  border: 1px solid var(--enaos-border); background: #fff; color: var(--enaos-primary);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.rail-toggle:hover { border-color: var(--enaos-primary); background: var(--enaos-secondary); }
.rail-toggle svg { transition: transform .18s ease; }

.rail-nav { padding: 18px 12px; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; overflow-x: hidden; }
.rail-group-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--enaos-muted-foreground-2); padding: 0 10px 8px; white-space: nowrap;
}
.rail-group-label .label-mini { display: none; flex-direction: column; align-items: center; gap: 6px; font-size: 9px; letter-spacing: .08em; line-height: 1; }
.rail-group-label .mini-rule { width: 26px; height: 1px; background: var(--enaos-border); }
.rail-group { display: flex; flex-direction: column; gap: 2px; }

.rail-link {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-full);
  font-size: 13.5px; font-weight: 500; color: var(--enaos-muted-foreground);
  white-space: nowrap; transition: background .18s ease, color .18s ease;
}
.rail-link:hover { background: rgba(223, 227, 255, .5); color: var(--enaos-primary); }
.rail-link.active { background: var(--enaos-secondary); color: var(--enaos-primary); font-weight: 600; }
.rail-bubble {
  position: relative; flex: 0 0 auto; width: 30px; height: 30px; border-radius: var(--radius-full);
  background: rgba(26, 41, 140, .08);
  display: inline-flex; align-items: center; justify-content: center;
  transition: width .18s ease, height .18s ease, background .18s ease;
}
.rail-link.active .rail-bubble { background: rgba(26, 41, 140, .12); }
.rail-bubble img { width: 17px; height: 17px; object-fit: contain; display: block; transition: width .18s ease, height .18s ease; }
.rail-link-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rail-dot {
  display: none;
  position: absolute; top: -1px; right: -1px; width: 8px; height: 8px;
  border-radius: var(--radius-full); background: var(--enaos-destructive); box-shadow: 0 0 0 2px #fff;
}
.rail-badge {
  flex: 0 0 auto; font-size: 11px; font-weight: 700; color: #B23A2B;
  background: rgba(231, 76, 60, .12); padding: 1px 8px; border-radius: var(--radius-full);
}
.rail-foot { margin-top: auto; padding: 16px; border-top: 1px solid var(--enaos-border-50); }
.rail-foot-text { font-size: 11.5px; color: var(--enaos-muted-foreground-2); font-weight: 300; line-height: 1.6; }
.rail-foot-text .env-ok { color: var(--enaos-success); font-weight: 600; }
.rail-foot-mini { display: none; justify-content: center; }
.rail-foot-mini .env-dot { width: 9px; height: 9px; border-radius: var(--radius-full); background: var(--enaos-success); }

/* ── Rail collapsed (icons only) ── */
html.rail-collapsed .rail { width: 72px; flex-basis: 72px; }
html.rail-collapsed .rail-brand-full { display: none; }
html.rail-collapsed .rail-brand-mini { display: block; }
html.rail-collapsed .rail-head { justify-content: center; }
html.rail-collapsed .rail-toggle svg { transform: rotate(180deg); }
html.rail-collapsed .rail-group-label .label-full { display: none; }
html.rail-collapsed .rail-group-label .label-mini { display: flex; }
html.rail-collapsed .rail-group-label { display: flex; justify-content: center; padding: 0 4px 8px; }
html.rail-collapsed .rail-link { justify-content: center; padding: 9px 4px; }
html.rail-collapsed .rail-bubble { width: 38px; height: 38px; }
html.rail-collapsed .rail-bubble img { width: 21px; height: 21px; }
html.rail-collapsed .rail-link-label,
html.rail-collapsed .rail-badge { display: none; }
html.rail-collapsed .rail-dot { display: block; }
html.rail-collapsed .rail-foot-full { display: none; }
html.rail-collapsed .rail-foot-mini { display: flex; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px;
  display: flex; align-items: center; gap: 16px; padding: 0 32px;
  background: rgba(255, 248, 237, .95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--enaos-border-50);
}
.topbar-title { font-size: 17px; font-weight: 700; color: var(--enaos-primary); letter-spacing: -.01em; line-height: 1.2; }
.user-pill {
  display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 14px;
  background: #fff; border: 1px solid var(--enaos-border-50); border-radius: var(--radius-full); box-shadow: var(--shadow-sm);
}
.user-pill .user-email {
  font-size: 12.5px; color: var(--enaos-muted-foreground); font-weight: 500;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-pill .user-avatar {
  width: 28px; height: 28px; border-radius: var(--radius-full);
  background: var(--enaos-secondary); color: var(--enaos-primary);
  font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}

.main { flex: 1; padding: 26px 32px 56px; max-width: 1420px; width: 100%; }

/* ── Flash ── */
.flash {
  padding: 11px 16px;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 500;
  animation: fadeUp .3s ease-out both;
}
.flash.notice { background: rgba(46, 143, 93, .1); color: #1F6B44; border: 1px solid rgba(46, 143, 93, .25); }
.flash.alert  { background: rgba(231, 76, 60, .1); color: #B23A2B; border: 1px solid rgba(231, 76, 60, .28); }
.flash.alert ul { margin: 6px 0 0; padding-left: 18px; }

.page-actions { margin-bottom: 20px; }

/* ── Search bar ── */
.search-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.search-bar input[type="text"],
.search-bar input[type="search"] {
  padding: 9px 14px; border: 1px solid var(--enaos-border); border-radius: var(--radius-full);
  font-size: 13px; background: #fff; color: var(--enaos-foreground); outline: none; transition: border-color .15s;
}
.search-bar input[type="text"]:focus,
.search-bar input[type="search"]:focus { border-color: var(--enaos-primary); }
.search-bar input[name="search"] { width: 300px; }
.search-bar input[name="amount"] { width: 130px; }

.btn {
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius-full);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn-primary   { background: var(--enaos-primary); color: #fff; box-shadow: var(--shadow-cta); }
.btn-primary:hover { background: var(--enaos-primary-hover); color: #fff; }
.btn-secondary {
  background: transparent; color: var(--enaos-muted-foreground);
  border: 1px solid var(--enaos-border);
}
.btn-secondary:hover { border-color: var(--enaos-primary); color: var(--enaos-primary); }
.btn-warning {
  background: #fff; color: var(--enaos-primary); border: 1px solid #C7CCE8;
  font-size: 11.5px; padding: 4px 12px;
}
.btn-warning:hover { background: var(--enaos-primary); color: #fff; border-color: var(--enaos-primary); }
.btn-lg { padding: 11px 26px; font-size: 14px; }
.btn-danger { display: inline-block; padding: 9px 20px; border: 0; border-radius: var(--radius-full); background: var(--enaos-destructive); color: #fff; font-weight: 600; cursor: pointer; }
.btn-danger:hover { background: #C0392B; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--enaos-border); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--enaos-muted-foreground);
  white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .18s ease, border-color .18s ease; display: flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--enaos-primary); }
.tab.active { color: var(--enaos-primary); border-bottom-color: var(--enaos-primary); font-weight: 600; }

.tab-count {
  background: rgba(212, 216, 227, .5); color: var(--enaos-muted-foreground);
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: var(--radius-full);
}
.tab.active .tab-count { background: var(--enaos-secondary); color: var(--enaos-primary); }

/* ── Table ── */
.table-wrapper {
  background: var(--enaos-card);
  border: 1px solid var(--enaos-border-50);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}
.table-wrapper .table-scroll { max-height: 640px; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: #F7F5FA; text-align: left; }
th {
  position: sticky; top: 0; z-index: 2; background: #F7F5FA;
  padding: 10px 14px; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--enaos-muted-foreground);
  border-bottom: 1px solid var(--enaos-border-50); white-space: nowrap;
}
td { padding: 9px 14px; border-bottom: 1px solid rgba(212, 216, 227, .35); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(223, 227, 255, .28); }

.col-id   { width: 72px; color: var(--enaos-muted-foreground-2); font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.col-date { width: 150px; color: var(--enaos-muted-foreground); font-size: 12px; white-space: nowrap; }

.error-text {
  color: #C0392B; font-size: 12px; max-width: 260px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; display: block; cursor: default;
}

/* ── Empty state ── */
.empty-state { padding: 56px 24px; text-align: center; }
.empty-state .empty-icon {
  width: 56px; height: 56px; border-radius: var(--radius-full); background: var(--enaos-secondary);
  margin: 0 auto 16px; display: flex; align-items: center; justify-content: center;
  color: var(--enaos-primary); font-size: 20px; font-weight: 700;
}
.empty-state h4 { font-size: 15px; margin-bottom: 6px; }
.empty-state p { max-width: 340px; margin: 0 auto 18px; }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-received  { background: rgba(26, 41, 140, .1); color: var(--enaos-primary); }
.badge-pending   { background: #FBF0D9; color: #92400E; }
.badge-errored   { background: rgba(231, 76, 60, .12); color: #B23A2B; }
.badge-processed { background: rgba(46, 143, 93, .12); color: #1F6B44; }

/* Type de groupement : la structure est le parent, les autres des étiquettes de l'EPF. */
.etiquette {
  display: inline-block; padding: 1px 8px; border-radius: var(--radius-full); margin: 1px 3px 1px 0;
  font-size: 11px; font-weight: 600; white-space: nowrap; text-decoration: none;
  border: 1px solid transparent;
}
a.etiquette:hover { border-color: currentColor; }
.etiquette-structure { background: rgba(26, 41, 140, .1); color: var(--enaos-primary); }
.etiquette-reseau    { background: #E6F2F7; color: #1D5F7A; }
.etiquette-segment   { background: #FBF0D9; color: #92400E; }
.etiquette-erp       { background: #F1EFF6; color: #5B3A99; }
.etiquette-test      { background: #EEEEEE; color: #555555; }
.etiquette-churn     { background: #EEEEEE; color: #555555; }

.badge-type {
  background: #F4F2FA; color: var(--enaos-foreground); font-size: 11.5px; font-weight: 500;
  padding: 3px 8px; border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Source — couleurs par marque (charte respective), volontairement hors palette Enaos. */
.badge-source {
  display: inline-block; padding: 2px 9px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; white-space: nowrap; margin: 1px 3px 1px 0;
}
/* !important pour que la couleur de texte de marque l'emporte sur les règles
   contextuelles d'ancre (.detail-grid dd a, tableaux, arbre…) — sinon le texte
   des badges-liens repasse en bleu et devient illisible sur fond coloré. */
.badge-enaos   { background: #1e63d0; color: #ffffff !important; }
.badge-fm      { background: #7fd0f2; color: #0b3a54 !important; }
.badge-legacio { background: #f5c518; color: #4a3600 !important; }
.badge-hubspot { background: #1c1c1c; color: #ffffff !important; }
.badge-odoo    { background: #714b67; color: #ffffff !important; }
.badge-airtable-legacio { background: #f82b60; color: #ffffff !important; }
.badge-airtable-soutien { background: #2d7ff9; color: #ffffff !important; }
.badge-notion  { background: #e9e5de; color: #37352f !important; box-shadow: inset 0 0 0 1px #d3cec4; }
a.badge-link { text-decoration: none; cursor: pointer; }
a.badge-link:hover { filter: brightness(0.92); text-decoration: none; }

/* ── Payload viewer ── */
details summary { cursor: pointer; font-size: 12px; color: var(--enaos-primary); user-select: none; padding: 2px 0; }
details summary:hover { text-decoration: underline; }
details pre {
  margin-top: 8px; background: #F7F5FA; border: 1px solid var(--enaos-border-50); border-radius: var(--radius-md);
  padding: 10px; font-size: 11px; white-space: pre-wrap; word-break: break-word;
  max-width: 380px; max-height: 300px; overflow: auto; color: var(--enaos-foreground);
}

/* ── Forms ── */
.form-card {
  background: var(--enaos-card); border: 1px solid var(--enaos-border-50); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 30px 32px; max-width: 760px;
}

/* Doublons probables avant création d'un partenaire : la carte est bordée en
   rouge parce qu'elle bloque l'action, pas parce qu'elle informe. */
.form-card.duplicates {
  border-color: var(--enaos-destructive); margin-bottom: 20px;
}
.form-card.duplicates .form-section-title { color: var(--enaos-destructive); }
.duplicate-list { list-style: none; margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.duplicate-list li {
  padding: 10px 12px; border: 1px solid var(--enaos-border-50); border-radius: var(--radius-md);
  font-size: 13.5px;
}
.duplicate-list .muted { display: block; margin-top: 3px; font-size: 12.5px; }

.manual-event-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.manual-event-header h2 { font-size: 17px; font-weight: 600; color: var(--enaos-foreground); }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--enaos-foreground); margin-bottom: 6px; }
.label-hint { font-weight: 300; color: var(--enaos-muted-foreground-2); font-size: 12px; }

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--enaos-border); border-radius: var(--radius-md);
  font-size: 13px; background: #fff; color: var(--enaos-foreground); outline: none;
  transition: border-color .15s; box-sizing: border-box;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--enaos-primary); }
.form-textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; resize: vertical; min-height: 220px; }

.form-actions { margin-top: 26px; }

.pagination { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--enaos-muted-foreground); font-weight: 300; }

.form-section-title { font-size: 13.5px; font-weight: 600; color: var(--enaos-foreground); margin: 26px 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--enaos-border-50); }
.form-hint { font-size: 12px; color: var(--enaos-muted-foreground); font-weight: 300; margin-bottom: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Lignes répétables du formulaire EPF (agences, conseillers) */
.child-row { border: 1px solid var(--enaos-border-50); border-radius: 10px; padding: 14px 16px 2px; margin: 0 0 12px; }
.child-row-title { font-size: 12px; font-weight: 600; color: var(--enaos-muted-foreground); padding: 0 6px; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.checkbox-label {
  display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px;
  background: #FBFAFE; border: 1px solid var(--enaos-border-50); border-radius: var(--radius-full);
  padding: 8px 16px; transition: border-color .15s;
}
.checkbox-label:hover { border-color: var(--enaos-primary); }
.checkbox-label input[type="checkbox"] { accent-color: var(--enaos-primary); }
.checkbox-text { color: var(--enaos-foreground); font-weight: 500; }

.required { color: var(--enaos-destructive); }

/* ── Partners explorer ── */
.page-title { margin: 0 0 16px; font-size: 22px; font-weight: 700; color: var(--enaos-primary); letter-spacing: -.01em; }
.filters { flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select {
  padding: 8px 12px; border: 1px solid var(--enaos-border); border-radius: var(--radius-full);
  font-size: 12.5px; background: #fff; color: var(--enaos-foreground); outline: none;
}
.filters .checkbox { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--enaos-foreground); font-weight: 500; }
.muted { color: var(--enaos-muted-foreground); font-size: 12px; white-space: nowrap; }
.breadcrumb { margin: 0 0 16px; font-size: 13px; color: var(--enaos-muted-foreground); }
.breadcrumb a { color: var(--enaos-primary); }
.breadcrumb .sep { margin: 0 7px; color: #C2C5D4; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

.eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--enaos-muted-foreground-2);
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.empty { color: var(--enaos-muted-foreground-2); font-weight: 400; }
.muted-text { color: var(--enaos-muted-foreground); font-size: 12.5px; line-height: 1.55; }
.badge-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: var(--radius-full); background: currentColor; }
.status-on      { background: rgba(46, 143, 93, .12); color: #1F6B44; }
.status-off     { background: rgba(231, 76, 60, .1); color: #B23A2B; }
.status-unknown { background: #F1EFF6; color: var(--enaos-muted-foreground); }


.dup-alert {
  display: block; margin-bottom: 16px; padding: 11px 16px; border-radius: var(--radius-lg);
  background: #FBF0D9; border: 1px solid #F3DBA0; color: #92400E !important; font-size: 13px;
}
.dup-alert:hover { border-color: #E3B964; }

/* ── Fiche partenaire : un en-tête court, l'arbre fait le reste ── */
.fiche-head { margin-bottom: 16px; }
.fiche-back { display: inline-block; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.fiche-head .eyebrow { margin-bottom: 4px; }
.fiche-head .page-title { margin: 0; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.fiche-intro { margin-top: 6px; max-width: 76ch; color: var(--enaos-muted-foreground); font-size: 13px; line-height: 1.5; }

/* ── Fiche : chiffres clés ── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-tile {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 18px;
  background: var(--enaos-card); border: 1px solid var(--enaos-border-50); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); color: var(--enaos-foreground);
}
.stat-label { font-size: 12px; color: var(--enaos-muted-foreground); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 600; color: var(--enaos-primary); line-height: 1.1; }


#fusion { scroll-margin-top: 80px; }
.empty-note { color: var(--enaos-muted-foreground); font-size: 13px; padding: 4px 0; }

/* ── Partners : fusion de doublons ── */
.merge-box { margin: 24px 0 0; padding: 20px 22px; border: 1px solid var(--enaos-border-50); border-radius: var(--radius-lg); background: #FBFAFE; box-shadow: var(--shadow-sm); min-width: 0; }
.merge-box h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 700; color: var(--enaos-primary); }
.dup-list-title { margin-top: 14px; font-size: 13px; }
.dup-list { list-style: none; margin: 4px 0 16px; padding: 0; }
.dup-list li { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 0; border-bottom: 1px solid rgba(212, 216, 227, .35); }
.dup-list li:last-child { border-bottom: 0; }
.merge-link { color: var(--enaos-primary); font-weight: 600; font-size: 12.5px; }
.merge-link:hover { text-decoration: underline; }
.merge-manual { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.merge-manual label { display: flex; flex-direction: column; gap: 5px; flex: 1 1 200px; min-width: 0; font-size: 12.5px; font-weight: 600; }
.merge-manual select { max-width: 100%; padding: 7px 10px; border: 1px solid var(--enaos-border); border-radius: var(--radius-md); font-size: 13px; background: #fff; }
.merge-manual input[type="number"] {
  padding: 7px 12px; border: 1px solid var(--enaos-border); border-radius: var(--radius-md); width: 100%; font-size: 13px; font-weight: 400; outline: none;
}
.merge-manual input[type="number"]:focus { border-color: var(--enaos-primary); }
.merge-manual input[type="submit"] {
  padding: 7px 16px; border: 0; border-radius: var(--radius-full); background: var(--enaos-primary); color: #fff; font-weight: 600; cursor: pointer;
}
.merge-manual input[type="submit"]:hover { background: var(--enaos-primary-hover); }
.merge-compare { width: 100%; border-collapse: collapse; margin: 16px 0; }
.merge-compare th, .merge-compare td { text-align: left; padding: 9px 14px; border-bottom: 1px solid rgba(212, 216, 227, .3); vertical-align: top; font-size: 12.5px; }
.merge-compare thead th { background: #F7F5FA; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--enaos-muted-foreground); }
.merge-compare tbody th { color: var(--enaos-muted-foreground); font-weight: 600; width: 170px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.merge-actions { display: flex; align-items: center; gap: 16px; margin-top: 22px; }

/* ── Partners : boutons de liens externes (index + fiche) ── */
.link-btn {
  display: inline-block; padding: 2px 9px; margin: 1px 0; border: 1px solid #D9DEF5;
  border-radius: var(--radius-full); background: #F3F4FE; color: var(--enaos-primary) !important;
  font-size: 11.5px; white-space: nowrap;
}
.link-btn:hover { background: var(--enaos-primary); color: #fff !important; border-color: var(--enaos-primary); }
.admin-links { white-space: normal; }

/* ── Édition (partenaires, conseillers) : d'abord le téléphone ──
   Formes : interactif en pilule (boutons, choix), champs en 8px, cartes en 12px. */
.ef { max-width: 720px; }
.ef-head { margin-bottom: 16px; }
.ef-head .eyebrow { margin-bottom: 4px; }
.ef-head .page-title { margin: 0; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.ef-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--enaos-muted-foreground); }
.ef-flag { padding: 2px 9px; border-radius: var(--radius-full); background: #FBF0D9; color: #92400E; font-size: 11.5px; font-weight: 600; }

.ef-card {
  margin-bottom: 14px; padding: 18px 20px 4px; background: var(--enaos-card);
  border: 1px solid var(--enaos-border-50); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.ef-card h2 { margin-bottom: 14px; font-size: 14px; font-weight: 700; color: var(--enaos-primary); }
.ef-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.ef-row-cp { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }

.ef-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 14px; border: 0; }
.ef-field > label, .ef-field > legend { font-size: 13px; font-weight: 600; color: var(--enaos-foreground); }
.ef-field > legend { margin-bottom: 6px; padding: 0; }
.ef-field input:not([type="radio"]):not([type="checkbox"]), .ef-field select {
  width: 100%; min-height: 44px; padding: 10px 12px; font-size: 14px; color: var(--enaos-foreground);
  background: #fff; border: 1px solid var(--enaos-border); border-radius: var(--radius-md); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ef-field select[multiple] { padding: 6px; }
.ef-field input:focus-visible, .ef-field select:focus-visible { border-color: var(--enaos-primary); box-shadow: 0 0 0 3px rgba(26, 41, 140, .15); }
.ef-field.has-error input, .ef-field.has-error select { border-color: var(--enaos-destructive); }
.ef-hint { font-size: 12.5px; line-height: 1.45; color: var(--enaos-muted-foreground); }
.ef-card > .ef-hint { margin-bottom: 14px; }
.ef-error { font-size: 12.5px; font-weight: 600; color: #B23A2B; }

/* Choix segmentés : de vraies radios, invisibles mais focusables, cible de 44px. */
.ef-seg { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.ef-seg-opt { position: relative; display: flex; }
.ef-seg-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ef-seg-opt span {
  flex: 1; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 10px;
  border: 1px solid var(--enaos-border); border-radius: var(--radius-full); background: #fff;
  font-size: 13.5px; font-weight: 500; line-height: 1.2; color: var(--enaos-muted-foreground); text-align: center;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.ef-seg-opt:hover span { border-color: var(--enaos-primary); }
.ef-seg-opt input:checked + span { background: var(--enaos-secondary); border-color: var(--enaos-primary); color: var(--enaos-primary); font-weight: 600; }
.ef-seg-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(26, 41, 140, .2); }

/* Identifiants techniques : repliés, ouverts d'office sur un conflit d'unicité. */
.ef-fold summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin-bottom: 14px; list-style: none; cursor: pointer; }
.ef-fold summary::-webkit-details-marker { display: none; }
.ef-fold summary h2 { margin: 0; }
.ef-fold summary::after {
  content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin-right: 4px;
  border-right: 2px solid var(--enaos-primary); border-bottom: 2px solid var(--enaos-primary);
  transform: rotate(45deg); transition: transform .15s ease;
}
.ef-fold[open] summary::after { transform: rotate(-135deg); }
.ef-ids { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0 14px; }
.ef-ids label { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 500; }
.ef-checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.ef-checks label { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13.5px; }
.ef-checks input { width: 18px; height: 18px; }

/* Barre d'enregistrement : reste sous le pouce tant que le formulaire défile. */
.ef-bar {
  position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--enaos-background) 70%, rgba(255, 248, 237, 0));
}
.ef-bar .btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 26px; font-size: 14px;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .1s ease;
}
.ef-bar .btn:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) { .ef-bar .btn:active { transform: none; } }

@media (max-width: 760px) {
  .ef-head .page-title { font-size: 20px; }
  .ef-card { padding: 16px 14px 2px; }
  .ef-row { grid-template-columns: minmax(0, 1fr); }
  .ef-row-cp { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  /* 16px : iOS ne zoome plus la page au focus d'un champ. */
  .ef-field input:not([type="radio"]):not([type="checkbox"]), .ef-field select { font-size: 16px; }
  .ef-bar .btn-primary { flex: 1; }
}


/* ── Écran de connexion ── */
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(to bottom right, var(--enaos-secondary), rgba(223, 227, 255, .55) 55%, var(--enaos-background));
  padding: 40px;
}
.login-card {
  width: 100%; max-width: 432px; background: #fff; border: 1px solid var(--enaos-border-50);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  padding: 40px 40px 32px; text-align: center; animation: fadeUp .5s ease-out both;
}
.login-brand { font-size: 26px; font-weight: 700; color: var(--enaos-primary); letter-spacing: -.01em; }
.login-brand small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--enaos-muted-foreground); margin-top: 6px; }
.login-rule { height: 1px; background: rgba(212, 216, 227, .6); margin: 24px 0; }
.login-card h2 { font-size: 18px; font-weight: 600; color: var(--enaos-foreground); margin-bottom: 8px; }
.login-intro { font-size: 14px; color: var(--enaos-muted-foreground); font-weight: 300; line-height: 1.6; margin-bottom: 24px; }
.login-card form { display: block; }
.btn-google { width: 100%; }
.login-warning {
  font-size: 13px; color: #92400E; background: #FBF0D9; border: 1px solid #F3DBA0;
  border-radius: var(--radius-md); padding: 12px; margin-bottom: 16px; text-align: left;
}
.login-separator {
  display: flex; align-items: center; gap: 12px; margin: 24px 0 16px;
  font-size: 12px; color: var(--enaos-muted-foreground-2); font-weight: 300;
}
.login-separator::before, .login-separator::after { content: ""; flex: 1; height: 1px; background: rgba(212, 216, 227, .6); }
.login-shared .form-input { margin-bottom: 12px; }
.login-help { font-size: 12px; color: var(--enaos-muted-foreground-2); font-weight: 300; margin-top: 24px; line-height: 1.6; }
.login-help code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--enaos-muted-foreground); }

/* ── Petits écrans : rail replié d'office, marges réduites ── */
@media (max-width: 760px) {
  .rail { width: 72px; flex-basis: 72px; }
  .rail-brand-full, .rail-toggle { display: none; }
  .rail-brand-mini { display: block; }
  .rail-head { justify-content: center; }
  .rail-group-label .label-full { display: none; }
  .rail-group-label .label-mini { display: flex; }
  .rail-group-label { display: flex; justify-content: center; padding: 0 4px 8px; }
  .rail-link { justify-content: center; padding: 9px 4px; }
  .rail-link-label, .rail-badge, .rail-foot-full { display: none; }
  .rail-dot { display: block; }
  .rail-foot-mini { display: flex; }

  .topbar { padding: 0 16px; }
  .user-pill .user-email { display: none; }
  .main { padding: 18px 16px 40px; }

  .fiche-hero-top { padding: 18px 16px 14px; }
  .fiche-open-in { padding: 12px 16px; }
  .fiche-hero .page-title { font-size: 20px; }
  .card { padding: 16px; }
}
@media (max-width: 420px) {
  .kv-list { grid-template-columns: 1fr; }
  .kv-list dt { padding-bottom: 0; border-bottom: 0; }
  .kv-list dd { padding-top: 2px; }
}

/* ── Utilisateurs ── */
.users-form-card { margin-bottom: 20px; padding: 22px 26px; }
.users-form-card .form-section-title { margin-top: 0; }
.users-add-form { display: flex; gap: 10px; align-items: center; max-width: 520px; }
.users-add-form .form-input { flex: 1; }
.users-actions { text-align: right; }
.users-actions form { display: inline; }
/* ── Portefeuille CSM ── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.inline-form { display: inline; }

.pf-head { align-items: flex-start; }
.pf-head .page-title { margin-bottom: 6px; }
.pf-intro { max-width: 72ch; color: var(--enaos-muted-foreground); font-size: 12.5px; line-height: 1.55; }
.pf-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-switch-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--enaos-muted-foreground); }
.pf-switch select {
  padding: 8px 14px; border: 1px solid var(--enaos-border); border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600; color: var(--enaos-primary); background-color: #fff; cursor: pointer;
}
.pf-switch select:hover { border-color: var(--enaos-primary); }
.pf-all { font-size: 12.5px; font-weight: 600; padding: 8px 4px; }

/* Avancement : une barre, vérifiées puis rejetées, le reste en creux. */
.pf-progress {
  background: var(--enaos-card); border: 1px solid var(--enaos-border-50); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 14px 18px 12px; margin-bottom: 18px;
}
.pf-progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.pf-progress-title { font-size: 13.5px; color: var(--enaos-foreground); }
.pf-progress-title strong { font-size: 20px; font-weight: 700; color: var(--enaos-primary); font-variant-numeric: tabular-nums; margin-right: 2px; }
.pf-progress-pct { font-size: 13px; font-weight: 600; color: var(--enaos-muted-foreground); font-variant-numeric: tabular-nums; }
.pf-bar { display: flex; height: 8px; border-radius: var(--radius-full); background: var(--enaos-secondary); overflow: hidden; }
.pf-bar span { display: block; height: 100%; transition: width .4s cubic-bezier(.16, 1, .3, 1); }
.pf-bar-ok { background: var(--enaos-success); }
.pf-bar-ko { background: var(--enaos-destructive); }
.pf-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 12px; color: var(--enaos-muted-foreground); font-variant-numeric: tabular-nums; }
.pf-legend li { display: inline-flex; align-items: center; gap: 6px; }
.pf-dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--enaos-secondary); box-shadow: inset 0 0 0 1px #C7CCE8; }
.pf-dot-ok { background: var(--enaos-success); box-shadow: none; }
.pf-dot-ko { background: var(--enaos-destructive); box-shadow: none; }
.pf-dot-pre { background: var(--enaos-primary); opacity: .35; box-shadow: none; }

/* Recherche à gauche, actions de masse à droite, sur une ligne quand ça tient. */
.pf-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.pf-toolbar .pf-search { margin-bottom: 0; }
.pf-clear { font-size: 12.5px; font-weight: 600; }
.pf-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-bulk-count { font-size: 12.5px; color: var(--enaos-muted-foreground); font-variant-numeric: tabular-nums; margin-right: 2px; }

/* Boutons de décision : contourés, compacts, la couleur dit l'issue. */
.qa-btn {
  padding: 5px 13px; border-radius: var(--radius-full); border: 1px solid; background: #fff;
  font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.qa-btn:focus-visible { outline: 2px solid var(--enaos-primary); outline-offset: 2px; }
.qa-btn:disabled { opacity: .45; cursor: not-allowed; }
.qa-verify { color: #1F6B44; border-color: rgba(46, 143, 93, .45); }
.qa-verify:not(:disabled):hover { background: var(--enaos-success); border-color: var(--enaos-success); color: #fff; }
.qa-reject { color: #B23A2B; border-color: rgba(231, 76, 60, .4); }
.qa-reject:not(:disabled):hover { background: var(--enaos-destructive); border-color: var(--enaos-destructive); color: #fff; }
.qa-reset { color: var(--enaos-muted-foreground); border-color: var(--enaos-border); }
.qa-reset:not(:disabled):hover { color: var(--enaos-primary); border-color: var(--enaos-primary); }

.portefeuille .pf-col-check { width: 36px; padding-right: 0; }
.portefeuille th.num, .portefeuille td.num { text-align: right; font-variant-numeric: tabular-nums; }
.portefeuille td.num .muted { white-space: nowrap; }
.pf-epf-name { font-weight: 600; }
.portefeuille-groupe td { background: #F7F5FA; padding-top: 8px; padding-bottom: 8px; border-bottom-color: var(--enaos-border-50); }
.portefeuille-groupe:hover td { background: #F1EFF7; }
.pf-group-kind { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--enaos-muted-foreground-2); margin-right: 6px; }
.pf-group-name { font-weight: 700; color: var(--enaos-primary); margin-right: 6px; }
.portefeuille-actions { white-space: nowrap; text-align: right; }
.portefeuille-actions .inline-form + .inline-form { margin-left: 6px; }

@media (max-width: 720px) {
  .pf-switch { width: 100%; }
  .pf-toolbar { flex-direction: column; align-items: stretch; }
  .pf-search input[type="search"] { flex: 1; width: auto; min-width: 0; }
}

/* Liste ou arbre : contrôle segmenté sous l'en-tête du portefeuille. */
.pf-view { display: flex; align-items: center; gap: 2px; width: fit-content; margin: -4px 0 16px; padding: 3px;
  background: rgba(212, 216, 227, .45); border-radius: var(--radius-full); }
.pf-view a { padding: 6px 16px; border-radius: var(--radius-full); font-size: 12.5px; font-weight: 600; color: var(--enaos-muted-foreground); }
.pf-view a:hover { color: var(--enaos-primary); }
.pf-view a.is-active { background: #fff; color: var(--enaos-primary); box-shadow: var(--shadow-sm); }
.pf-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.pf-toggle input { margin: 0; }
.pf-toggle-note { font-size: 12px; color: var(--enaos-muted-foreground); }
.pf-toggle-note.is-warning { color: #9A4B00; }
.pf-view-count { padding: 0 12px 0 8px; font-size: 12px; color: var(--enaos-muted-foreground); font-variant-numeric: tabular-nums; }

/* ── Revue par exception : filtres, sections par type d'anomalie ── */
.revue-filtres { display: flex; align-items: flex-end; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 16px; }
.revue-filtres label { display: flex; flex-direction: column; gap: 4px; }
.revue-filtres label.pf-toggle { flex-direction: row; align-items: center; height: 36px; }
.revue-filtres .pf-toggle-note { align-self: center; }
.revue-filtres select {
  min-width: 150px; max-width: 260px; padding: 7px 12px; border: 1px solid var(--enaos-border); border-radius: var(--radius-full);
  font: inherit; font-size: 13px; background-color: #fff;
}
.revue-filtres select:focus { border-color: var(--enaos-primary); outline: none; }
.revue-regle { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; font-size: 12.5px; }
.revue-section { margin-bottom: 22px; }
.revue-section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--enaos-foreground); }
.revue-isolee td { background: #FFF1DE; }
@media (max-width: 720px) {
  .revue-filtres label, .revue-filtres select { width: 100%; max-width: none; }
}

/* ── Arbre groupement → EPF → agences (portefeuille, fiches) ── */
.arbre { position: relative; }
.arbre .tree-legend { margin: 0 0 12px; }
.tree-node.is-courant > .tree-row { background: var(--enaos-secondary); box-shadow: inset 0 0 0 1px rgba(26, 41, 140, .25); }
.tree-node.is-courant > .tree-row .tree-name { color: var(--enaos-primary); }
.tree-ici {
  flex-shrink: 0; padding: 1px 8px; border-radius: var(--radius-full); background: #fff;
  font-size: 10.5px; font-weight: 700; color: var(--enaos-primary);
}
/* Place sur la ligne : le nom d'abord ; le lieu et la note cèdent en premier,
   les pastilles (sources, qualité, Déplacer) ne se compressent pas. */
.tree-row { min-width: 0; }
.tree-row .tree-name { flex: 0 1 auto; min-width: 7em; }
.tree-row > .muted, .tree-meta > .muted { flex: 0 3 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tree-meta { position: relative; min-width: 0; }
.tree-meta > .badge, .tree-meta > .tree-info { flex-shrink: 0; }
/* « Déplacer » se pose par-dessus le lieu au survol, sans prendre de place au repos. */
.tree-meta > .tree-move { position: absolute; right: 100%; margin-right: 8px; box-shadow: 0 0 0 6px var(--enaos-card); }
.tree-row:hover .tree-move { box-shadow: 0 0 0 6px #F7F5FA; }
.tree-node.is-courant > .tree-row .tree-move { box-shadow: 0 0 0 6px var(--enaos-secondary); }
.tree-pop-list .tree-option-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-pop-list button .muted { flex-shrink: 0; font-size: 11.5px; }
.tree-toolbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.tree-toolbar .search-bar { margin-bottom: 0; }
.tree-toolbar input[type="search"] {
  width: 280px; padding: 8px 14px; border: 1px solid var(--enaos-border); border-radius: var(--radius-full);
  font: inherit; font-size: 13px; background: #fff; outline: none;
}
.tree-toolbar input[type="search"]:focus { border-color: var(--enaos-primary); }
.tree-add { position: relative; }
.tree-add-results {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; width: 340px; max-height: 320px; overflow: auto;
  list-style: none; margin: 0; padding: 4px; background: #fff; border: 1px solid var(--enaos-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
}
.tree-add-results[hidden] { display: none; }
.tree-add-results button {
  display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; font: inherit; font-size: 13px; text-align: left; color: var(--enaos-foreground); cursor: pointer;
}
.tree-add-results button:hover, .tree-add-results button:focus-visible { background: var(--enaos-secondary); color: var(--enaos-primary); outline: none; }
.tree-add-empty { padding: 8px 10px; font-size: 12.5px; color: var(--enaos-muted-foreground); }
.tree-expand { display: flex; gap: 6px; margin-left: auto; }

.tree-card {
  background: var(--enaos-card); border: 1px solid var(--enaos-border-50); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 10px 12px 14px;
}
/* Deux colonnes : le portefeuille à gauche, un groupement cherché à droite,
   chacune défile seule pour glisser d'une colonne à l'autre. */
.arbre-duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.arbre-duo .tree-card { max-height: calc(100vh - 160px); overflow-y: auto; }
/* Deux colonnes : la page prend toute la largeur de l'écran, et le nom d'un
   nœud passe à la ligne au lieu d'être coupé (retour de Gilles). */
.main:has(.arbre-duo) { max-width: none; }
.arbre-duo .tree-name { white-space: normal; overflow-wrap: anywhere; }
.arbre-col-droite { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 8px; }
.arbre-cible { position: relative; display: flex; flex-direction: column; gap: 6px; }
.arbre-cible input[type="search"] {
  width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--enaos-border); border-radius: var(--radius-md);
  background: var(--enaos-card); font: inherit; font-size: 13px; outline: none;
}
.arbre-cible input[type="search"]:focus { border-color: var(--enaos-primary); }
.arbre-cible .tree-add-results { top: 100%; width: 100%; }
.arbre-cible-titre { display: flex; align-items: baseline; gap: 8px; margin: 0; font-weight: 600; }
.arbre-cible-fermer { margin-left: auto; font-size: 12.5px; font-weight: 500; }
@media (max-width: 1100px) {
  .arbre-duo { grid-template-columns: minmax(0, 1fr); }
  .arbre-duo .tree-card { max-height: none; }
  .arbre-col-droite { position: static; }
}
.tree, .tree-children { list-style: none; margin: 0; padding: 0; }
.tree-children { margin-left: 22px; padding-left: 12px; border-left: 1px solid var(--enaos-border-50); }
.tree-node:not(.is-open) > .tree-children { display: none; }
.tree-node[hidden] { display: none; }

.tree-row {
  display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 10px 4px 4px; margin: 1px 0;
  border: 1px dashed transparent; border-radius: var(--radius-md); font-size: 13px;
  transition: background-color .12s ease, border-color .12s ease;
}
.tree-row:hover { background: #F7F5FA; }
.tree-groupement > .tree-row { margin-top: 8px; background: #F7F5FA; font-weight: 600; }
.tree-groupement > .tree-row:hover { background: #F1EFF7; }
.tree-name { font-weight: 600; color: var(--enaos-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
a.tree-name:hover { color: var(--enaos-primary); }
.tree-groupement > .tree-row .tree-name { color: var(--enaos-primary); font-weight: 700; }
.tree-agence .tree-name { font-weight: 500; }
.tree-row .muted { font-size: 12px; white-space: nowrap; }
.tree-meta { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }

.tree-kind {
  flex-shrink: 0; padding: 2px 7px; border-radius: var(--radius-full); background: var(--enaos-secondary);
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--enaos-primary);
}
.tree-groupement > .tree-row .tree-kind { background: var(--enaos-primary); color: #fff; }
.tree-kind-funerarium { background: #EDE7F6; color: #5B3A99; }
/* Pas d'orange : il est réservé au fond d'une agence isolée. */
.tree-kind-point_de_vente { background: #E8EEF3; color: #34556B; }
.tree-kind-agence { background: rgba(46, 143, 93, .12); color: #1F6B44; }
.tree-etiquettes { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.tree-etiquettes .etiquette { margin: 0; font-size: 10.5px; }

/* Chevron : tourne quand le nœud est ouvert, disparaît sur une EPF sans agence. */
.tree-toggle {
  flex-shrink: 0; width: 22px; height: 22px; border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--enaos-muted-foreground);
}
.tree-toggle::before {
  content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s ease;
}
.tree-node.is-open > .tree-row .tree-toggle::before { transform: rotate(45deg); }
.tree-toggle:hover { background: var(--enaos-secondary); color: var(--enaos-primary); }
.tree-toggle:focus-visible { outline: 2px solid var(--enaos-primary); outline-offset: 1px; }
.tree-epf.is-leaf > .tree-row .tree-toggle { visibility: hidden; }
.tree-agence > .tree-row { padding-left: 10px; }

/* Poignée : six points, signale ce qui se déplace. */
.tree-grip {
  flex-shrink: 0; width: 8px; height: 14px; opacity: .45; cursor: grab;
  background-image: radial-gradient(circle, var(--enaos-muted-foreground) 1.2px, transparent 1.4px);
  background-size: 4px 4.7px;
}
.tree-row:has(.tree-info) { cursor: pointer; }
.tree-row[draggable="true"] { cursor: grab; }
.tree-row[draggable="true"]:hover .tree-grip { opacity: .9; }
.tree-autre > .tree-row { opacity: .7; }
.tree-autre > .tree-row .tree-name { font-weight: 500; }

/* Pendant un glisser : ranger (bleu) ou fusionner (orange), dit par la cible. */
.tree-node.is-dragging > .tree-row { opacity: .4; }
.tree-row.is-drop-move { background: var(--enaos-secondary); border-color: var(--enaos-primary); }
.tree-row.is-drop-merge { background: #FBF0D9; border-color: #D97706; }
.tree-row.is-drop-move::after, .tree-row.is-drop-merge::after {
  flex-shrink: 0; padding: 2px 8px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; color: #fff;
}
.tree-row.is-drop-move::after { content: "Ranger ici"; background: var(--enaos-primary); }
.tree-row.is-drop-merge::after { content: "Fusionner"; background: #B45309; }
.tree-node.is-saving > .tree-row { opacity: .55; pointer-events: none; }
.tree-node.is-moved > .tree-row { animation: tree-moved 1.6s ease; }
@keyframes tree-moved { 0%, 30% { background: rgba(46, 143, 93, .16); } 100% { background: transparent; } }
.tree-ajoute > .tree-row { border-color: var(--enaos-border); }

/* Légende des deux issues d'un lâcher, reprise des pastilles de survol. */
.tree-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; font-size: 12px; color: var(--enaos-muted-foreground); }
.tree-legend li { display: inline-flex; align-items: center; gap: 8px; }
.tree-legend-chip { flex-shrink: 0; white-space: nowrap; padding: 2px 8px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; color: #fff; }
.tree-legend-chip.is-move { background: var(--enaos-primary); }
.tree-legend-chip.is-merge { background: #B45309; }
.tree-empty { padding: 18px 10px 4px; font-size: 13px; color: var(--enaos-muted-foreground); }

/* « Infos » : ouvre la fiche du nœud sous sa ligne ; plein quand c'est ouvert. */
.tree-info {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--enaos-border);
  border-radius: var(--radius-full); background: #fff; font: inherit; font-size: 11.5px; font-weight: 600;
  color: var(--enaos-muted-foreground); cursor: pointer; transition: color .12s ease, border-color .12s ease, background-color .12s ease;
}
.tree-info::after {
  content: ""; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg); transition: transform .15s ease;
}
.tree-info:hover { color: var(--enaos-primary); border-color: var(--enaos-primary); }
.tree-info[aria-expanded="true"] { background: var(--enaos-primary); border-color: var(--enaos-primary); color: #fff; }
.tree-info[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }
.tree-info[aria-expanded="true"]:hover { background: var(--enaos-primary-hover); color: #fff; }
.tree-info:focus-visible { outline: 2px solid var(--enaos-primary); outline-offset: 2px; }
.tree-info.is-loading { opacity: .55; cursor: progress; }

/* Infos dépliées : la ligne et son panneau forment une seule carte. */
.tree-node:not(.is-info) > .tree-details { display: none; }
.tree-node.is-info > .tree-row {
  margin-bottom: 0; border-style: solid; border-color: #E6E2F0; border-bottom-color: transparent;
  border-radius: var(--radius-md) var(--radius-md) 0 0; background: #F4F2F9;
}
.tree-node.is-courant.is-info > .tree-row { border-color: rgba(26, 41, 140, .25); border-bottom-color: transparent; box-shadow: none; }
.tree-details {
  display: flex; flex-direction: column; gap: 14px; margin: 0 0 10px; padding: 14px 16px 16px;
  background: #FBFAFE; border: 1px solid #E6E2F0; border-top: 0; border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: 13px; cursor: auto;
}
/* Ouverte au clic, la fiche apparaît ; celle de la page est là d'emblée. */
.tree-node:not(.is-courant) > .tree-details { animation: fadeUp .18s ease; }
@media (prefers-reduced-motion: reduce) { .tree-details { animation: none !important; } }
.tree-node.is-courant > .tree-details { border-color: rgba(26, 41, 140, .25); }
.td-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--enaos-muted-foreground-2); }
.td-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.td-quality { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-width: 0; }
.td-quality .muted { white-space: normal; }
.td-links { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; margin: 10px 0 0; }

/* Commentaires d'un partenaire (arbre/commentaires) et marques de ligne. */
.td-commentaires { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--enaos-border-50); }
.td-commentaires > h4 { margin: 0 0 8px; }
.td-commentaires .count { font-size: 12px; font-weight: 500; color: var(--enaos-muted-foreground); }
.td-commentaires-liste { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.td-commentaires-liste > li { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--enaos-border-50); }
.td-commentaires-liste > li.is-ouvert { box-shadow: inset 3px 0 0 #7A5AF8; }
.td-commentaire-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 4px; font-size: 12px; }
.td-commentaire-texte p { margin: 0 0 4px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.td-commentaire-texte p:last-child { margin-bottom: 0; }
.td-commentaire-form textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; resize: vertical; }
.td-commentaire-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 12px; }
.tree-a-revoir {
  display: inline-block; padding: 1px 6px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600;
  color: #4A2FB0; background: #EEEAFE; box-shadow: inset 0 0 0 1px #CFC4FB; white-space: nowrap;
}
.tree-epf-seule {
  display: inline-block; padding: 1px 6px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600;
  color: #6B4E00; background: #FFF4D6; box-shadow: inset 0 0 0 1px #F0D78C; white-space: nowrap; cursor: help;
}
.tree-commentaires { font-size: 11px; color: var(--enaos-muted-foreground); white-space: nowrap; cursor: help; }
.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; }
.td-decide, .td-actions { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
a.qa-btn { display: inline-block; }
.td-facts, .td-ids { display: grid; gap: 12px 24px; margin: 0; }
.td-facts { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.td-ids { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.td-facts > div, .td-ids > div { min-width: 0; }
.td-facts dt, .td-ids dt { margin-bottom: 3px; font-size: 11.5px; font-weight: 500; color: var(--enaos-muted-foreground); }
.td-facts dd, .td-ids dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
/* Référent par défaut (BBSW-12446) : son origine sous le nom, le choix dans un pli. */
.td-referent { grid-column: span 2; }
.td-referent .muted { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; }
.td-referent .tree-a-revoir { margin-top: 4px; }
.td-referent-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.td-referent-form select { flex: 1 1 260px; min-width: 0; max-width: 100%; }
@media (max-width: 480px) { .td-referent { grid-column: auto; } }
.td-ids dt.mono { font-size: 11px; }
.td-ids dd.mono { font-size: 12px; }
.td-open-in, .td-activite, .td-fold { padding-top: 12px; border-top: 1px solid var(--enaos-border-50); }
.td-open-in, .td-activite { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.td-fold > summary {
  list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; width: fit-content; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--enaos-primary);
}
.td-fold > summary::-webkit-details-marker { display: none; }
.td-fold > summary::before {
  content: ""; align-self: center; width: 5px; height: 5px; margin-right: 2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease;
}
.td-fold[open] > summary::before { transform: rotate(45deg); }
.td-fold > summary:focus-visible { outline: 2px solid var(--enaos-primary); outline-offset: 3px; border-radius: var(--radius-sm); }
.td-fold > summary .count { font-size: 12px; font-weight: 500; color: var(--enaos-muted-foreground); }
.td-fold[open] > summary { margin-bottom: 12px; }
.td-list { list-style: none; margin: 0 0 10px; }
.td-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 7px 0; border-bottom: 1px solid rgba(212, 216, 227, .35); }
.td-list li:last-child { border-bottom: 0; }
.td-list .muted { white-space: normal; }
.td-list-name { font-weight: 600; }
.td-fusion { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; align-items: start; }
.td-fusion .merge-box { margin: 0; background: #fff; }

/* « Déplacer » : discret au repos, visible au survol et au focus de la ligne. */
.tree-move {
  padding: 3px 10px; border: 1px solid var(--enaos-border); border-radius: var(--radius-full); background: #fff;
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--enaos-muted-foreground); cursor: pointer;
  opacity: 0; transition: opacity .12s ease, color .12s ease, border-color .12s ease;
}
.tree-row:hover .tree-move, .tree-row:focus-within .tree-move, .tree-move[aria-expanded="true"] { opacity: 1; }
.tree-move:hover { color: var(--enaos-primary); border-color: var(--enaos-primary); }
.tree-move:focus-visible { opacity: 1; outline: 2px solid var(--enaos-primary); outline-offset: 2px; }
@media (hover: none) { .tree-move { opacity: 1; } }

.tree-pop {
  position: absolute; z-index: 40; width: 340px; max-width: calc(100vw - 32px); padding: 10px;
  background: #fff; border: 1px solid var(--enaos-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.tree-pop[hidden] { display: none; }
.tree-pop-title { margin: 0 2px 8px; font-size: 12.5px; font-weight: 600; color: var(--enaos-foreground); line-height: 1.4; }
.tree-pop-input {
  width: 100%; padding: 7px 12px; border: 1px solid var(--enaos-border); border-radius: var(--radius-full);
  font: inherit; font-size: 13px; outline: none;
}
.tree-pop-input:focus { border-color: var(--enaos-primary); }
.tree-pop-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 280px; overflow: auto; }
.tree-pop-list button {
  display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 7px 10px; border: 0;
  border-radius: var(--radius-sm); background: none; font: inherit; font-size: 13px; text-align: left;
  color: var(--enaos-foreground); cursor: pointer; white-space: nowrap;
}
.tree-pop-list button:hover, .tree-pop-list button:focus-visible { background: var(--enaos-secondary); color: var(--enaos-primary); outline: none; }

.tree-toast {
  position: fixed; z-index: 50; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; max-width: min(640px, calc(100vw - 32px));
  padding: 11px 16px; border-radius: var(--radius-lg); background: var(--enaos-foreground); color: #fff;
  font-size: 13px; box-shadow: var(--shadow-lg);
}
.tree-toast[hidden] { display: none; }
.tree-toast.is-error { background: #B23A2B; }
.tree-toast-undo {
  flex-shrink: 0; padding: 4px 12px; border: 1px solid rgba(255, 255, 255, .5); border-radius: var(--radius-full);
  background: none; color: #fff; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.tree-toast-undo:hover { background: #fff; color: var(--enaos-foreground); }

@media (max-width: 720px) {
  .tree-toolbar input[type="search"] { width: 100%; }
  .tree-toolbar > * { width: 100%; }
  .tree-expand { margin-left: 0; }
  .tree-children { margin-left: 10px; padding-left: 8px; }
  .tree-row { flex-wrap: wrap; row-gap: 4px; }
  .tree-name { flex: 1 1 0; }
  .tree-row > .muted, .tree-row > .tree-count { display: none; }
  .tree-meta { width: 100%; justify-content: flex-end; }
  .tree-meta > .tree-move { position: static; margin-right: 0; box-shadow: none; }
  .tree-meta { flex-wrap: wrap; row-gap: 4px; }
  .tree-details { padding: 12px; }
  .td-facts, .td-ids { grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); gap: 10px 16px; }
}

.users-merge { white-space: nowrap; }
.users-merge form { display: inline; margin-left: 8px; }

/* ── Dashboards BigQuery ── */
.dash-intro { max-width: 820px; margin: -6px 0 16px; }
.dash-min-input { width: 64px; padding: 6px 8px; border: 1px solid var(--enaos-border); border-radius: var(--radius-md, 8px); font: inherit; }
.dash-table th.num, .dash-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-delta-down { color: #B23A2B; font-weight: 600; }
.dash-delta-up   { color: #1F6B44; font-weight: 600; }
.dash-flag { margin-left: 6px; font-size: 10.5px; vertical-align: 1px; }
.dash-flag-new   { background: rgba(46, 143, 93, .12); color: #1F6B44; }
.dash-flag-spike { background: #FBF0D9; color: #92400E; }
.sparkline { display: block; overflow: visible; }
.sparkline .spark-baseline { fill: rgba(26, 41, 140, .28); }
.sparkline .spark-current.spark-down { fill: #E74C3C; }
.sparkline .spark-current.spark-up   { fill: #2E8F5D; }
.sparkline .spark-current.spark-flat { fill: var(--enaos-primary); }
.sparkline .spark-ref      { stroke: var(--enaos-muted-foreground); stroke-width: 1; stroke-dasharray: 3 2; }

/* ── Boutons et actions de revue ── */
.revue-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 14px; }
.revue-fusion-input { width: 220px; }
.revue-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.revue-actions form { display: inline-flex; }
.revue-rattacher { gap: 6px; align-items: center; }
.revue-rattacher select { max-width: 280px; }
.revue-btn { padding: 6px 14px; font-size: 12.5px; white-space: nowrap; }
.revue-btn[disabled] { opacity: .45; cursor: not-allowed; }
.merge-parent { border: 1px solid var(--enaos-border-50); border-radius: var(--radius-md); padding: 10px 14px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.merge-parent legend { font-weight: 600; padding: 0 4px; }
/* Aperçu de fusion : ce que fera la fusion, et la mise en attente (retours n° 9 et 11). */
.merge-implications { margin: 16px 0; padding: 12px 16px; border: 1px solid var(--enaos-border-50); border-radius: var(--radius-md); background: #fff; }
.merge-implications h3 { margin: 0 0 8px; font-size: 14px; }
.merge-implications ul { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 4px; font-size: 13px; }
.merge-attente { display: grid; gap: 6px; margin: 0 0 12px; padding: 12px 16px; border: 1px dashed var(--enaos-border-50); border-radius: var(--radius-md); font-size: 13px; }
.merge-attente p { margin: 0; }
.merge-attente textarea { width: 100%; box-sizing: border-box; font: inherit; }
.merge-attente .btn { justify-self: start; }
.mart-doublons { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--enaos-border-50); }
.mart-doublons .dup-list li { display: flex; flex-direction: column; gap: 6px; }
.mart-doublons .dup-list li > div { white-space: normal; overflow-wrap: anywhere; }

/* Pastilles de logiciel sur chaque ligne de l'arbre et de la liste (retour de
   Marc) : une couleur par logiciel, la lettre pour rester lisible sans elle.
   L'orange n'est à aucun logiciel : il signale une agence isolée. */
.pastilles-logiciels { display: inline-flex; gap: 3px; flex: 0 0 auto; }
.pastille-logiciel {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 18px; padding: 0 5px; border-radius: var(--radius-sm);
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em; line-height: 1; color: #fff;
}
.pastille-enaos           { background: #1e63d0; }
.pastille-funeral_manager { background: #1f8a4c; }
.pastille-legacio         { background: #7a3fc4; }
.pastille-odoo            { background: #3d4148; }
/* Sans activité sur 12 mois dans ce logiciel : grisée, lettre conservée. */
.pastille-logiciel.is-inactive { background: #E4E6EA; color: #6B7280; box-shadow: inset 0 0 0 1px #CDD1D7; }
.pf-col-source { width: 30px; text-align: center; }
.pf-col-source abbr { text-decoration: none; }

.tree-node.is-isolee > .tree-row { background: #FFF1DE; }
.tree-node.is-isolee > .tree-row:hover { background: #FFE7C7; }
.tree-isolee { font-size: 11px; font-weight: 600; color: #9A4B00; }
.tree-sans-agence { font-size: 11px; color: var(--enaos-muted-foreground); font-style: italic; cursor: help; white-space: nowrap; }
.tree-doublon {
  display: inline-block; padding: 1px 6px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600;
  color: #8A1F3D; background: #FBE7ED; box-shadow: inset 0 0 0 1px #EDB7C6; white-space: nowrap; cursor: help;
}
.pf-isolees { font-size: 12px; font-weight: 600; color: #9A4B00; }

.pastilles-legende {
  display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0 0 12px; padding: 0;
  font-size: 12px; color: var(--enaos-foreground);
}
.pastilles-legende li { display: inline-flex; align-items: center; gap: 6px; }
.pastilles-legende-isolee { display: inline-block; width: 22px; height: 14px; border-radius: var(--radius-sm); background: #FFF1DE; box-shadow: inset 0 0 0 1px #F2C894; }

.lieux-de-repos { margin-top: 24px; }
.lieux-de-repos > summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.lieux-de-repos .count { font-weight: 400; color: var(--enaos-muted-foreground); margin-left: 6px; }
.lieux-de-repos > p { margin: 4px 0 12px; }

/* ══ Référent & décès : l'arbre de nettoyage (deces_theoriques/arbre) ══
   Même arbre que le portefeuille, lu comme un registre : une ligne par
   partenaire, deux colonnes alignées à droite quelle que soit la profondeur,
   l'état « à traiter » en ambre, la correction dépliée sous la ligne. */
.rd {
  --rd-ref: 19rem;
  --rd-deces: 8.5rem;
  --rd-action: 6.25rem;
  --rd-ambre: #B45309;
  --rd-ambre-fond: #FDF3E4;
  --rd-ligne: #EEEDF4;
  --rd-survol: #F8F7FB;
}
.rd-head { align-items: flex-end; margin-bottom: 14px; }
.rd-head .page-title { margin-bottom: 6px; }

.rd-total { margin: 0 0 2px auto; font-size: 12.5px; color: var(--enaos-muted-foreground); font-variant-numeric: tabular-nums; }

/* À traiter : le point d'entrée du nettoyage, un filtre par puce. */
.rd-traiter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.rd-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 14px;
  border: 1px solid var(--enaos-border); border-radius: var(--radius-full); background: #fff;
  font-size: 13px; font-weight: 500; color: var(--enaos-foreground);
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.rd-chip:first-child { padding-right: 14px; }
.rd-chip:hover { border-color: var(--enaos-primary); color: var(--enaos-primary); }
.rd-chip:focus-visible { outline: 2px solid var(--enaos-primary); outline-offset: 2px; }
.rd-chip-n {
  min-width: 24px; padding: 2px 8px; border-radius: var(--radius-full); background: #F1F2F7;
  font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; color: var(--enaos-muted-foreground);
}
.rd-chip.is-alerte .rd-chip-n { background: var(--rd-ambre-fond, #FDF3E4); color: #B45309; }
.rd-chip.is-zero { color: var(--enaos-muted-foreground); }
.rd-chip.is-active { background: var(--enaos-primary); border-color: var(--enaos-primary); color: #fff; }
.rd-chip.is-active .rd-chip-n { background: rgba(255, 255, 255, .18); color: #fff; }

.rd-toolbar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.rd-search {
  flex: 1 1 320px; max-width: 440px; height: 36px; padding: 0 14px 0 36px;
  border: 1px solid var(--enaos-border); border-radius: var(--radius-full); font: inherit; font-size: 13px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2373778C' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center;
  color: var(--enaos-foreground); transition: border-color .15s ease;
}
.rd-search::placeholder { color: var(--enaos-muted-foreground-2); }
.rd-search:focus { border-color: var(--enaos-primary); outline: none; box-shadow: 0 0 0 3px rgba(26, 41, 140, .12); }
.rd-expand { display: flex; gap: 4px; margin-left: auto; }
.rd-link-btn {
  padding: 6px 10px; border: 0; border-radius: var(--radius-sm); background: none; font: inherit; font-size: 12.5px;
  font-weight: 600; color: var(--enaos-muted-foreground); cursor: pointer; transition: color .15s ease, background-color .15s ease;
}
.rd-link-btn:hover { color: var(--enaos-primary); background: var(--enaos-secondary); }
.rd-link-btn:focus-visible { outline: 2px solid var(--enaos-primary); outline-offset: 1px; }

.rd-card {
  background: var(--enaos-card); border: 1px solid var(--enaos-border-50); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 0 10px 10px;
}
/* En-tête des colonnes, collé sous la barre du haut pendant le défilement. */
.rd-colhead {
  position: sticky; top: 64px; z-index: 5; display: flex; align-items: center; gap: 12px;
  margin: 0 -10px 4px; padding: 12px 20px 10px 44px; border-bottom: 1px solid var(--rd-ligne);
  background: rgba(255, 255, 255, .96); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--enaos-muted-foreground-2);
}
.rd-colhead-nom { flex: 1; }
.rd-num-col { text-align: right; }

/* Lignes : un registre, pas des cartes. */
.rd-tree .tree-row {
  gap: 12px; min-height: 40px; margin: 0; padding: 4px 10px 4px 4px; border: 0; border-radius: var(--radius-sm);
  font-size: 13px; cursor: pointer;
}
.rd-tree .tree-row:hover { background: var(--rd-survol); }
.rd-tree .tree-children { margin-left: 14px; padding-left: 12px; border-left-color: var(--rd-ligne); }
.rd-tree > .tree-groupement + .tree-groupement { margin-top: 6px; }
.rd-tree .tree-groupement > .tree-row { margin-top: 0; background: none; border-bottom: 1px solid var(--rd-ligne); border-radius: 0; }
.rd-tree .tree-groupement > .tree-row:hover { background: var(--rd-survol); }
.rd-tree .tree-groupement > .tree-row .tree-name { font-size: 13.5px; }
.rd-tree .tree-orphelines > .tree-row .tree-name { color: var(--enaos-muted-foreground); font-weight: 600; }
.rd-tree .tree-epf > .tree-row .tree-name { font-weight: 600; }
.rd-tree .tree-agence > .tree-row { padding-left: 10px; }
.rd-tree .tree-agence > .tree-row .tree-name { font-weight: 500; color: #3A3E55; }

.rd-nom { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; }
.rd-nom .tree-name { flex: 0 1 auto; min-width: 4em; }
.rd-lieu, .rd-count { flex: 0 3 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--enaos-muted-foreground); }
.rd-count { flex-shrink: 0; color: var(--enaos-muted-foreground-2); font-variant-numeric: tabular-nums; }
.rd-kind { flex-shrink: 0; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--enaos-muted-foreground-2); }

.rd-cols { flex: 0 0 auto; display: grid; grid-template-columns: var(--rd-ref) var(--rd-deces); gap: 16px; align-items: center; }
.rd-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rd-deces { justify-content: flex-end; }
.rd-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-vide { color: var(--enaos-muted-foreground-2); }
.is-barre { color: var(--enaos-muted-foreground); text-decoration: line-through; text-decoration-color: rgba(115, 119, 140, .6); }
.rd-num { min-width: 2.6em; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.rd-num.rd-vide { font-weight: 400; }
.tree-groupement > .tree-row .rd-num { color: var(--enaos-muted-foreground); font-weight: 600; }

/* Source retenue : discrète ; « main » quand quelqu'un l'a saisie. */
.rd-src {
  flex-shrink: 0; padding: 1px 7px; border-radius: 4px; background: #F1F2F7;
  font-size: 11px; font-weight: 600; color: var(--enaos-muted-foreground);
}
.rd-src.is-main { background: var(--enaos-secondary); color: var(--enaos-primary); }
.rd-src.is-cumul { background: none; padding: 0; font-weight: 500; color: var(--enaos-muted-foreground-2); }

.rd-etat { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.rd-etat.is-alerte { color: #B45309; }
.rd-etat.is-alerte::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-full); background: #D97706; }
.rd-etat.is-main { padding: 1px 7px; border-radius: 4px; background: var(--enaos-secondary); color: var(--enaos-primary); font-size: 11px; }
.rd-etat.is-ok { color: #1F6B44; }

/* « Corriger » : ouvre le panneau ; plein quand il est ouvert. */
.rd-corriger, .rd-corriger-place { flex: 0 0 var(--rd-action); }
.rd-corriger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 10px;
  border: 1px solid var(--enaos-border); border-radius: var(--radius-full); background: #fff;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--enaos-muted-foreground); cursor: pointer;
  opacity: .0; transition: opacity .12s ease, color .12s ease, border-color .12s ease, background-color .12s ease;
}
.rd-corriger::after {
  content: ""; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg); transition: transform .15s ease;
}
.tree-row:hover .rd-corriger, .rd-corriger:focus-visible, .rd-corriger[aria-expanded="true"],
.tree-node:has(> .tree-row .is-alerte) > .tree-row .rd-corriger { opacity: 1; }
@media (hover: none) { .rd-corriger { opacity: 1; } }
.rd-corriger:hover { color: var(--enaos-primary); border-color: var(--enaos-primary); }
.rd-corriger:focus-visible { outline: 2px solid var(--enaos-primary); outline-offset: 2px; }
.rd-corriger[aria-expanded="true"] { background: var(--enaos-primary); border-color: var(--enaos-primary); color: #fff; }
.rd-corriger[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }
.rd-corriger.is-loading { opacity: .55; cursor: progress; }

.rd-node.is-saving > .tree-row { opacity: .55; pointer-events: none; }
.rd-node.is-saved > .tree-row { animation: rd-saved 1.4s cubic-bezier(.16, 1, .3, 1); }
@keyframes rd-saved { 0%, 25% { background: rgba(46, 143, 93, .14); } 100% { background: transparent; } }

/* Panneau dépli : la ligne et lui forment une seule surface. */
.rd-node.is-corrige > .tree-row { background: #F4F3FA; border-radius: var(--radius-md) var(--radius-md) 0 0; }
.rd-editeur {
  margin: 0 0 10px; border: 1px solid #E6E2F0; border-top: 0; border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: #FBFAFE; cursor: auto; animation: fadeUp .18s cubic-bezier(.16, 1, .3, 1);
}
.rd-editeur[hidden] { display: none; }
.rd-node.is-corrige > .tree-row { box-shadow: inset 0 0 0 1px #E6E2F0; }
@media (prefers-reduced-motion: reduce) { .rd-editeur, .rd-node.is-saved > .tree-row { animation: none; } }

.rd-pane { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rd-bloc { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; min-width: 0; }
.rd-bloc + .rd-bloc { border-left: 1px solid #ECE9F3; }
.rd-bloc-titre { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--enaos-primary); }
.rd-bloc-etat { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0; font-size: 14px; }
.rd-bloc-etat strong { font-weight: 600; }
.rd-note { font-size: 12.5px; line-height: 1.5; color: var(--enaos-muted-foreground); }
.rd-note a { font-weight: 600; }

.rd-sources { margin: 0; display: flex; flex-direction: column; }
.rd-sources > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 8px;
  border-bottom: 1px solid #ECE9F3; font-size: 13px;
}
.rd-sources > div:last-child { border-bottom: 0; }
.rd-sources dt { color: var(--enaos-muted-foreground); min-width: 0; }
.rd-sources dd { display: inline-flex; align-items: baseline; gap: 8px; margin: 0; }
.rd-sources .is-retenue { background: #fff; border-radius: var(--radius-sm); box-shadow: 0 1px 2px rgba(26, 41, 140, .06), 0 0 0 1px #E6E2F0; border-bottom-color: transparent; }
.rd-sources .is-retenue dt { color: var(--enaos-foreground); font-weight: 600; }

.rd-form, .rd-form-auto { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rd-form select, .rd-input-unite input {
  height: 34px; border: 1px solid var(--enaos-border); border-radius: var(--radius-md); background: #fff;
  font: inherit; font-size: 13px; color: var(--enaos-foreground); transition: border-color .15s ease, box-shadow .15s ease;
}
.rd-form select { flex: 1 1 260px; min-width: 0; max-width: 100%; padding: 0 10px; }
.rd-form select:focus, .rd-input-unite input:focus { border-color: var(--enaos-primary); outline: none; box-shadow: 0 0 0 3px rgba(26, 41, 140, .12); }
.rd-input-unite { position: relative; display: inline-flex; align-items: center; }
.rd-input-unite input { width: 9.5rem; padding: 0 52px 0 12px; font-variant-numeric: tabular-nums; }
.rd-input-unite input::placeholder { color: var(--enaos-muted-foreground-2); }
.rd-input-unite span { position: absolute; right: 12px; font-size: 12px; color: var(--enaos-muted-foreground); pointer-events: none; }

.rd-btn {
  height: 34px; padding: 0 14px; border: 1px solid var(--enaos-border); border-radius: var(--radius-full); background: #fff;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--enaos-muted-foreground); cursor: pointer; white-space: nowrap;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.rd-btn:hover { color: var(--enaos-primary); border-color: var(--enaos-primary); }
.rd-btn:focus-visible { outline: 2px solid var(--enaos-primary); outline-offset: 2px; }
.rd-btn:disabled { opacity: .5; cursor: progress; }
.rd-btn-primaire { background: var(--enaos-primary); border-color: var(--enaos-primary); color: #fff; }
.rd-btn-primaire:hover { background: var(--enaos-primary-hover); border-color: var(--enaos-primary-hover); color: #fff; }

/* Filtres CSM et présentation (retours de Marc, 20/11/2026). */
.rd-filtres { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: -4px 0 14px; }
.rd-filtres select {
  height: 32px; padding: 0 10px; border: 1px solid var(--enaos-border); border-radius: var(--radius-md); background: #fff;
  font: inherit; font-size: 13px; color: var(--enaos-foreground); max-width: 100%;
}
.rd-filtres select:focus { border-color: var(--enaos-primary); outline: none; box-shadow: 0 0 0 3px rgba(26, 41, 140, .12); }
.rd-filtres-sep { width: 1px; height: 20px; margin: 0 6px; background: var(--enaos-border); }
.rd-vues { display: inline-flex; padding: 2px; border: 1px solid var(--enaos-border); border-radius: var(--radius-full); background: #fff; }
.rd-vue { padding: 4px 12px; border-radius: var(--radius-full); font-size: 12.5px; font-weight: 600; color: var(--enaos-muted-foreground); text-decoration: none; }
.rd-vue:hover { color: var(--enaos-primary); }
.rd-vue:focus-visible { outline: 2px solid var(--enaos-primary); outline-offset: 1px; }
.rd-vue.is-active { background: var(--enaos-primary); color: #fff; }
.rd-plat .tree-node.is-plat > .tree-row { padding-left: 10px; }
.rd-plat .tree-node.is-plat + .tree-node.is-plat > .tree-row { border-top: 1px solid var(--rd-ligne); }
.rd-plat .tree-groupement > .tree-row { border-bottom: 0; }
.rd-parent { color: var(--enaos-muted-foreground); font-weight: 600; text-decoration: none; }
.rd-parent:hover { color: var(--enaos-primary); text-decoration: underline; }

/* Le référent et le chiffre s'ouvrent d'un clic ; la case valide le calcul. */
.rd-cell-btn {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; margin: -3px -6px; padding: 3px 6px;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.rd-cell-btn:hover { border-color: var(--enaos-border); background: #fff; }
.rd-cell-btn:hover .rd-val, .rd-cell-btn:hover .rd-vide { text-decoration: underline dotted; text-underline-offset: 3px; }
.rd-cell-btn:focus-visible { outline: 2px solid var(--enaos-primary); outline-offset: 1px; }
.rd-ref .rd-cell-btn { flex: 0 1 auto; }
.rd-valider-form { flex-shrink: 0; margin-left: auto; }
.rd-valider {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px 0 6px;
  border: 1px solid var(--enaos-border); border-radius: var(--radius-full); background: #fff;
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--enaos-muted-foreground); cursor: pointer; white-space: nowrap;
}
.rd-valider:hover { border-color: var(--enaos-primary); color: var(--enaos-primary); }
.rd-valider:focus-visible { outline: 2px solid var(--enaos-primary); outline-offset: 1px; }
.rd-case { width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; position: relative; }
.rd-valider.is-valide { border-color: #CFE7D9; background: #EEF8F2; color: #1F6B44; }
.rd-valider.is-valide .rd-case { background: #1F6B44; border-color: #1F6B44; }
.rd-valider.is-valide .rd-case::after {
  content: ""; position: absolute; left: 3px; top: 0; width: 3px; height: 7px;
  border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(45deg);
}

/* « + » d'une EPF : ajouter un point de vente. */
.rd-ajouter, .rd-ajouter-place { flex: 0 0 28px; }
.rd-ajouter {
  width: 28px; height: 28px; border: 1px solid var(--enaos-border); border-radius: var(--radius-full); background: #fff;
  font: inherit; font-size: 16px; line-height: 1; font-weight: 600; color: var(--enaos-muted-foreground); cursor: pointer;
  opacity: 0; transition: opacity .12s ease, color .12s ease, border-color .12s ease;
}
.tree-row:hover .rd-ajouter, .rd-ajouter:focus-visible { opacity: 1; }
@media (hover: none) { .rd-ajouter { opacity: 1; } }
.rd-ajouter:hover { color: var(--enaos-primary); border-color: var(--enaos-primary); }
.rd-ajouter:focus-visible { outline: 2px solid var(--enaos-primary); outline-offset: 2px; }

.rd-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rd-actions:empty { display: none; }
.rd-jumeau { margin: -4px 0 0; }
.rd-creer { font-size: 13px; }
.rd-creer summary { cursor: pointer; font-weight: 600; color: var(--enaos-primary); width: fit-content; }
.rd-creer[open] summary { margin-bottom: 10px; }
.rd-form-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.rd-form-grille label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--enaos-muted-foreground); }
.rd-form-grille input, .rd-form-grille select {
  height: 34px; padding: 0 10px; border: 1px solid var(--enaos-border); border-radius: var(--radius-md); background: #fff;
  font: inherit; font-size: 13px; font-weight: 400; color: var(--enaos-foreground); min-width: 0;
}
.rd-form-grille input:focus, .rd-form-grille select:focus { border-color: var(--enaos-primary); outline: none; box-shadow: 0 0 0 3px rgba(26, 41, 140, .12); }
.rd-form-grille .rd-btn { justify-self: start; }
.rd-bloc-large { grid-column: 1 / -1; border-top: 1px solid #ECE9F3; }
.rd-bloc + .rd-bloc.rd-bloc-large { border-left: 0; }

.rd-empty { padding: 36px 16px 28px; text-align: center; color: var(--enaos-muted-foreground); font-size: 13px; }
.rd-empty p { margin-bottom: 8px; }
.rd-empty strong { color: var(--enaos-foreground); }
.rd-filtre-vide { padding: 24px 16px 14px; text-align: center; font-size: 13px; color: var(--enaos-muted-foreground); }
.rd-filtre-vide[hidden] { display: none; }

@media (max-width: 1100px) {
  .rd { --rd-ref: 15rem; --rd-deces: 7.5rem; }
}
@media (max-width: 860px) {
  .rd-pane { grid-template-columns: minmax(0, 1fr); }
  .rd-bloc + .rd-bloc { border-left: 0; border-top: 1px solid #ECE9F3; }
}
/* Téléphone : les colonnes passent sous le nom. */
@media (max-width: 720px) {
  .rd-colhead { display: none; }
  .rd-total { margin-left: 0; width: 100%; }
  .rd-expand { margin-left: 0; }
  .rd-tree .tree-row { flex-wrap: wrap; gap: 4px 8px; padding-top: 6px; padding-bottom: 6px; }
  .rd-nom { flex: 1 1 0; }
  .rd-lieu, .tree-epf > .tree-row .rd-count { display: none; }
  .rd-cols { order: 3; flex: 1 1 100%; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding-left: 30px; }
  .rd-ref { overflow: hidden; }
  .tree-agence > .tree-row .rd-cols { padding-left: 0; }
  .tree-groupement > .tree-row .rd-ref { visibility: hidden; }
  .rd-corriger { order: 2; flex: 0 0 auto; height: 26px; opacity: 1; }
  .rd-corriger-place, .rd-ajouter-place { display: none; }
  .rd-ajouter { order: 2; opacity: 1; height: 26px; width: 26px; flex-basis: 26px; }
  .rd-filtres-sep { display: none; }
  .rd-tree .tree-children { margin-left: 6px; padding-left: 8px; }
}

/* ── Dashboard light conseiller / agence (CibleDashboardsController) ── */
.dl { max-width: 1080px; --dl-green: #1F8A4C; --dl-amber: #B7791F; --dl-red: #C0392B; --dl-grey: #8A93A3; }
.dl-hero, .dl-card, .dl-chart, .dl-table, .dl-signaux, .dl-vide {
  background: var(--enaos-card); border: 1px solid var(--enaos-border); border-radius: var(--radius-lg);
}
.dl-hero { padding: 18px 20px; margin-bottom: 14px; }
.dl-hero h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.dl-sub { color: var(--enaos-muted-foreground); }
.dl-sub a, .dl-acts a, .dl-reps a, .dl-table a, .dl-note a { color: var(--enaos-primary); text-decoration: none; }
.dl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dl-tag { font-size: 12px; padding: 3px 9px; border-radius: var(--radius-full); background: #EEF1F5; color: #3B4453; text-decoration: none; }
a.dl-tag:hover { text-decoration: underline; }
.dl-tag.dl-amber { background: #FDF3E1; color: var(--dl-amber); }
.dl-acts { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--enaos-border-50); font-size: 13px; }
.dl-acts a.dl-edit {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: var(--radius-full);
  background: var(--enaos-primary); color: #fff; font-weight: 600; box-shadow: var(--shadow-cta);
}
.dl-acts a.dl-edit:hover { background: var(--enaos-primary-hover); }
.dl-vide { padding: 16px 20px; margin-bottom: 14px; color: var(--enaos-muted-foreground); }

.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 14px; }
.dl-card { padding: 14px 16px; min-width: 0; }
.dl-card h3 { font-size: 13px; font-weight: 600; color: #3B4453; margin-bottom: 2px; }
.dl-def { font-size: 12px; color: var(--enaos-muted-foreground); margin-bottom: 8px; }
.dl-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.dl-v { font-size: 30px; font-weight: 600; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.dl-n { color: var(--enaos-muted-foreground); font-size: 13px; font-variant-numeric: tabular-nums; }
.dl-pill { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-full); font-weight: 600; white-space: nowrap; }
.dl-pill.dl-green { background: #E6F4EA; color: var(--dl-green); }
.dl-pill.dl-amber { background: #FDF3E1; color: var(--dl-amber); }
.dl-pill.dl-red   { background: #FBE9E7; color: var(--dl-red); }
.dl-pill.dl-grey  { background: #EEF1F5; color: var(--dl-grey); }
.dl-bar { position: relative; height: 8px; background: #EEF1F5; border-radius: 4px; margin: 10px 0 6px; }
.dl-bar i { position: absolute; left: 0; top: 0; height: 100%; border-radius: 4px; background: var(--enaos-primary); }
.dl-bar b { position: absolute; top: -3px; width: 2px; height: 14px; background: #111; }
.dl-bar b.dl-q3 { background: #999; }
.dl-m30 { font-size: 12px; color: var(--enaos-muted-foreground); display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dl-reps { border-top: 1px solid var(--enaos-border-50); padding-top: 8px; font-size: 12px; }
.dl-reps > div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.dl-rep-lib { color: var(--enaos-muted-foreground); }
.dl-rep-val { text-align: right; font-variant-numeric: tabular-nums; }
.dl-rep-val small { display: block; color: var(--enaos-muted-foreground-2); font-size: 11px; }
.dl-d { font-weight: 600; margin-left: 4px; }
.dl-d.dl-up { color: var(--dl-green); }
.dl-d.dl-dn { color: var(--dl-red); }

.dl-h2 { font-size: 15px; font-weight: 600; margin: 18px 0 8px; }
.dl-signaux { padding: 10px 12px; font-size: 13px; color: var(--enaos-muted-foreground); border-style: dashed; }
.dl-table-wrap { overflow-x: auto; }
.dl-table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; font-size: 13px; }
.dl-table th, .dl-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--enaos-border-50); white-space: nowrap; }
.dl-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--enaos-muted-foreground); background: #FAFBFC; }
.dl-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.dl-table td.dl-few { color: var(--dl-grey); }
.dl-table tr.dl-ref td { background: #FAFBFC; color: #3B4453; font-style: italic; }
.dl-table .dl-tag { margin-right: 4px; }
.dl-note { font-size: 12px; color: var(--enaos-muted-foreground); margin-top: 8px; line-height: 1.5; }
.dl-chart { padding: 12px 16px; }
.dl-svg { display: block; }
.dl-svg .dl-ax { font-size: 10px; fill: var(--enaos-muted-foreground); }
.dl-svg .dl-ax-line { fill: var(--enaos-primary); }
.dl-foot { margin-top: 14px; }

@media (max-width: 760px) {
  .dl-grid { grid-template-columns: 1fr; }
  .dl-hero { padding: 14px 16px; }
}
