/* ══════════════════════════════════════════════════════
   AGENT RECOUVREMENT DASHBOARD
   Design system aligné sur agent-support.css (.sp-*) — préfixe .rc-*.
   Accent violet #8b5cf6. Utilise les variables CSS du projet
   (--bg, --sf, --ink, --gr, --sf3...) pour le thème clair/sombre.
══════════════════════════════════════════════════════ */

/* ── Base ── */
#recouvrement-root {
  width: 100% !important;
  max-width: 100% !important;
  align-self: stretch !important;
  overflow-y: scroll !important;
}
.rc {
  width: 100%;
  max-width: 100%;
  padding: 28px 40px 40px;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Onglets soulignés, alignés à gauche (remplace la pill-nav noire) ── */
.rc-tabs {
  display: flex; gap: 2px; align-items: center;
  border-bottom: 1px solid var(--sf3); margin-bottom: 24px;
}
.rc-tab {
  padding: 10px 16px; font-size: 13px; font-weight: 600;
  color: var(--gr); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  font-family: inherit; transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.rc-tab:hover { color: var(--ink); }
.rc-tab.active { color: #8b5cf6; border-bottom-color: #8b5cf6; }
[data-theme="dark"] .rc-tabs { border-color: #2a2a2a; }
[data-theme="dark"] .rc-tab { color: #9ca3af; }
[data-theme="dark"] .rc-tab:hover { color: #e5e7eb; }
[data-theme="dark"] .rc-tab.active { color: #a78bfa; border-bottom-color: #a78bfa; }

/* ── Panel pages ── */
.rc-panel-page { animation: rcFadeIn .25s ease; }
@keyframes rcFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Hero ── */
.rc-hero {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px; gap: 20px; flex-wrap: wrap;
}
.rc-headline {
  font-size: 32px; font-weight: 300; color: var(--gr2); line-height: 1.2;
}
.rc-headline strong {
  display: block; font-size: 32px; font-weight: 700; color: var(--ink);
}
.rc-hero-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── Setup strip (remplace les bannières empilées) ── */
.rc-setup {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(139,92,246,.07), rgba(124,58,237,.04));
  border: 1px solid rgba(139,92,246,.22);
  border-radius: 16px; padding: 14px 20px; margin-bottom: 22px;
}
.rc-setup-ico { font-size: 1.4rem; flex-shrink: 0; }
.rc-setup-body { flex: 1; min-width: 200px; }
.rc-setup-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.rc-setup-desc { font-size: 12px; color: var(--gr); margin-top: 2px; }
.rc-setup-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.rc-setup-step {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 7px 13px; border-radius: 9px;
  border: 1px solid var(--sf3); background: var(--sf2); color: var(--gr);
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.rc-setup-step:hover { border-color: #8b5cf6; color: #8b5cf6; }
.rc-setup-step.done { color: #16a34a; border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.07); cursor: default; }
.rc-setup-step.todo::before { content: '○'; }
.rc-setup-step.done::before { content: '✓'; }

/* ── KPI row ── */
.rc-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.rc-kpi {
  background: var(--sf); border: 1px solid var(--sf3); border-radius: 16px;
  padding: 20px; transition: box-shadow .15s;
}
.rc-kpi:hover { box-shadow: 0 2px 16px rgba(0,0,0,.08); }
.rc-kpi-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.rc-kpi-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rc-kpi-label { font-size: 12px; font-weight: 500; color: var(--gr); }
.rc-kpi-val {
  font-size: 36px; font-weight: 700; letter-spacing: -.03em;
  color: var(--ink); line-height: 1;
}
.rc-kpi-sub { font-size: 11px; color: var(--gr2); margin-top: 6px; }

/* ── Top grid (KPIs + perf) ── */
.rc-top { display: grid; grid-template-columns: 1fr 340px; gap: 20px; margin-bottom: 20px; }

/* ── Cards ── */
.rc-card {
  background: var(--sf); border: 1px solid var(--sf3);
  border-radius: 16px; padding: 22px;
}
.rc-card-hd {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.rc-card-title { font-size: 14px; font-weight: 700; color: var(--ink); }

/* ── Perf ring ── */
.rc-perf { display: flex; align-items: center; gap: 20px; }
.rc-perf-ring { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.rc-perf-ring svg { transform: rotate(-90deg); }
.rc-perf-track { fill: none; stroke: var(--sf3); stroke-width: 9; }
.rc-perf-fill { fill: none; stroke: #8b5cf6; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.rc-perf-label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.rc-perf-val { font-size: 20px; font-weight: 800; color: var(--ink); line-height: 1; }
.rc-perf-sub { font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: var(--gr2); margin-top: 3px; }
.rc-perf-stats { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.rc-perf-stat-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.rc-perf-stat-lbl { color: var(--gr); }
.rc-perf-stat-val { font-weight: 700; color: var(--ink); }
.rc-perf-bar { height: 6px; background: var(--sf3); border-radius: 99px; overflow: hidden; }
.rc-perf-bar-fill { height: 100%; background: #8b5cf6; border-radius: 99px; transition: width .6s ease; }

/* ── Chart bars ── */
.rc-bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.rc-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rc-bar { width: 100%; max-width: 28px; border-radius: 5px 5px 0 0; min-height: 3px; background: var(--sf3); transition: height .4s ease; }
.rc-bar.today { background: #8b5cf6; }
.rc-bar-lbl { font-size: 10px; color: var(--gr); }

/* ── Section (table) ── */
.rc-section {
  background: var(--sf); border: 1px solid var(--sf3);
  border-radius: 16px; padding: 0; overflow: hidden; margin-bottom: 20px;
}
.rc-section-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--sf3); gap: 10px; flex-wrap: wrap;
}
.rc-section-tabs { display: flex; gap: 0; align-items: center; }
.rc-stab {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 16px; font-size: 13px; font-weight: 500;
  color: var(--gr); background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap;
}
.rc-stab:hover { color: var(--ink); }
.rc-stab.active { color: var(--ink); font-weight: 600; border-bottom-color: #8b5cf6; }
.rc-section-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Search ── */
.rc-search {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--sf3); border-radius: 10px;
  padding: 7px 12px; background: var(--sf2);
}
.rc-search input {
  border: none; outline: none; font-size: 12px; font-family: inherit;
  color: var(--ink); background: transparent; width: 200px;
}
.rc-search input::placeholder { color: var(--gr2); }
.rc-search svg { width: 14px; height: 14px; color: var(--gr); flex-shrink: 0; }

/* ── Table ── */
.rc-table { width: 100%; border-collapse: collapse; }
.rc-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--gr);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 12px 16px; border-bottom: 1px solid var(--sf3); white-space: nowrap;
  cursor: pointer; user-select: none;
}
.rc-table td {
  padding: 14px 16px; font-size: 13px; color: var(--ink);
  border-bottom: 1px solid var(--sf3); vertical-align: middle;
}
.rc-table tbody tr { cursor: pointer; transition: background .1s; }
.rc-table tbody tr:hover td { background: var(--sf2); }
.rc-table-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 20px; font-size: 12px; color: var(--gr);
}
.rc-amount { font-weight: 700; color: var(--ink); }

/* ── Badges ── */
.rc-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; font-size: 11px; font-weight: 600; border-radius: 20px;
  white-space: nowrap;
}
.rc-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rc-badge-pending  { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.rc-badge-encours  { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.rc-badge-paye     { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.rc-badge-opposition { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
[data-theme="dark"] .rc-badge-pending  { background: #222; color: #fdba74; border-color: #333; }
[data-theme="dark"] .rc-badge-encours  { background: #222; color: #93c5fd; border-color: #333; }
[data-theme="dark"] .rc-badge-paye     { background: #1a2a1a; color: #86efac; border-color: #2a3a2a; }
[data-theme="dark"] .rc-badge-opposition { background: #2a2020; color: #f87171; border-color: #3a2a2a; }

/* ── Buttons ── */
.rc-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--sf3); border-radius: 10px; cursor: pointer;
  font-family: inherit; transition: all .15s; white-space: nowrap;
  background: var(--sf2); color: var(--ink);
}
.rc-btn:hover { border-color: #8b5cf6; }
.rc-btn-primary { background: #8b5cf6; color: #fff; border-color: #8b5cf6; }
.rc-btn-primary:hover { background: #7c3aed; border-color: #7c3aed; }
.rc-btn-sm { padding: 5px 11px; font-size: 11px; }
.rc-btn-icon {
  width: 32px; height: 32px; padding: 0; justify-content: center;
  color: var(--gr);
}

/* ── Filter pills (Tous / En cours / Payés / Opposition) ── */
.rc-filter {
  padding: 6px 13px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--sf3); border-radius: 99px; cursor: pointer;
  background: var(--sf2); color: var(--gr); font-family: inherit; transition: all .15s;
}
.rc-filter:hover { color: var(--ink); }
.rc-filter.active { background: #8b5cf6; color: #fff; border-color: #8b5cf6; }

/* ── Config form ── */
.rc-form-group { margin-bottom: 18px; }
.rc-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--gr);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.rc-input, .rc-select {
  width: 100%; border: 1px solid var(--sf3); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; font-family: inherit;
  outline: none; background: var(--sf2); color: var(--ink);
  transition: border-color .15s; box-sizing: border-box;
}
.rc-input:focus, .rc-select:focus { border-color: #8b5cf6; }
.rc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Onboarding cards (empty state) ── */
.rc-empty { padding: 32px 24px; }
.rc-onboard-title { font-size: 16px; font-weight: 700; color: var(--ink); text-align: center; margin-bottom: 22px; }
.rc-onboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 720px; margin: 0 auto; }
.rc-onboard-card {
  border: 1px solid var(--sf3); border-radius: 16px; padding: 24px 20px;
  background: var(--sf2); cursor: pointer; transition: all .18s; text-align: center;
}
.rc-onboard-card:hover { border-color: #8b5cf6; box-shadow: 0 4px 18px rgba(139,92,246,.12); }
.rc-onboard-card.drag-over { border-color: #8b5cf6; border-style: dashed; background: rgba(139,92,246,.06); }
.rc-onboard-icon { font-size: 2.2rem; margin-bottom: 10px; }
.rc-onboard-label { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.rc-onboard-desc { font-size: 12px; color: var(--gr); line-height: 1.6; margin-bottom: 16px; }
.rc-onboard-actions { display: flex; flex-direction: column; gap: 8px; }

/* ── Card collapse (config entreprise/agent) ── */
.rc-cfg-card { background: var(--sf); border: 1px solid var(--sf3); border-radius: 16px; padding: 22px; margin-bottom: 16px; }
.rc-cfg-hd { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.rc-cfg-hd-dot { width: 8px; height: 8px; border-radius: 50%; background: #8b5cf6; }
.rc-cfg-body { overflow: hidden; transition: max-height .35s ease, opacity .3s ease; }

/* ── Modal (réutilisé par les overlays existants : .rc-modal-overlay / .rc-modal) ── */
.rc-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px); z-index: 10000;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.rc-modal {
  background: var(--sf); border-radius: 16px;
  max-width: 560px; width: 100%; max-height: 86vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
}
.rc-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--sf3);
}
.rc-modal-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.rc-modal-close {
  width: 28px; height: 28px; border-radius: 50%; background: var(--sf2);
  border: none; cursor: pointer; font-size: 14px; color: var(--gr);
  display: flex; align-items: center; justify-content: center;
}
.rc-modal-close:hover { background: var(--sf3); }
.rc-modal-body { padding: 20px 24px; }
.rc-modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 24px; border-top: 1px solid var(--sf3);
}
.rc-modal-field { margin-bottom: 14px; }
.rc-modal-label { font-size: 12px; font-weight: 600; color: var(--gr); margin-bottom: 6px; }
.rc-modal-input {
  width: 100%; border: 1px solid var(--sf3); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; font-family: inherit;
  background: var(--sf2); color: var(--ink); outline: none; box-sizing: border-box;
}
.rc-modal-input:focus { border-color: #8b5cf6; }
.rc-modal-hint { font-size: 11px; color: var(--gr); margin-top: 8px; line-height: 1.6; }

/* ── Integrations grid ── */
.rc-integ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.rc-integ {
  border: 1px solid var(--sf3); border-radius: 14px; padding: 18px 16px;
  background: var(--sf2); cursor: pointer; transition: all .15s; text-align: center;
  position: relative;
}
.rc-integ:hover { border-color: #8b5cf6; }
.rc-integ.connected { border-color: rgba(34,197,94,.4); }
.rc-integ-logo {
  width: 44px; height: 44px; border-radius: 12px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.rc-integ-name { font-size: 12px; font-weight: 600; color: var(--ink); }
.rc-integ-tag {
  display: inline-block; margin-top: 6px; font-size: 9px; font-weight: 700;
  letter-spacing: .05em; color: #8b5cf6;
}
.rc-integ-dot {
  position: absolute; top: 12px; right: 12px;
  width: 8px; height: 8px; border-radius: 50%; background: #ef4444;
}
.rc-integ.connected .rc-integ-dot { background: #22c55e; }

/* ── Status badge (hero) ── */
.rc-status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; font-size: 12px; font-weight: 600; border-radius: 99px;
  background: var(--sf2); border: 1px solid var(--sf3); color: var(--gr);
}
.rc-status-badge.active { color: #16a34a; border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.07); }
.rc-status-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Empty inline ── */
.rc-empty-inline { text-align: center; padding: 36px 20px; color: var(--gr); font-size: 13px; }

/* ── Responsive ── */
@media (max-width: 1000px) {
  .rc-top { grid-template-columns: 1fr; }
  .rc-kpis { grid-template-columns: repeat(2, 1fr); }
  .rc-onboard-grid { grid-template-columns: 1fr; }
  .rc-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .rc { padding: 16px; }
  .rc-kpis { grid-template-columns: 1fr 1fr; }
  .rc-section-bar { flex-direction: column; align-items: stretch; }
  .rc-search input { width: 100%; }
}

/* ══ DARK THEME ══ */
[data-theme="dark"] .rc { background: #111; color: #e5e7eb; }
[data-theme="dark"] .rc-headline { color: #6b7280; }
[data-theme="dark"] .rc-headline strong { color: #e5e7eb; }
[data-theme="dark"] .rc-kpi,
[data-theme="dark"] .rc-card,
[data-theme="dark"] .rc-section,
[data-theme="dark"] .rc-cfg-card { background: #1a1a1a; border-color: #2a2a2a; }
[data-theme="dark"] .rc-kpi-val, [data-theme="dark"] .rc-card-title,
[data-theme="dark"] .rc-perf-val, [data-theme="dark"] .rc-modal-title { color: #e5e7eb; }
[data-theme="dark"] .rc-kpi-label, [data-theme="dark"] .rc-perf-stat-lbl { color: #9ca3af; }
[data-theme="dark"] .rc-section-bar { border-color: #2a2a2a; }
[data-theme="dark"] .rc-stab { color: #9ca3af; }
[data-theme="dark"] .rc-stab.active { color: #e5e7eb; }
[data-theme="dark"] .rc-table th { color: #6b7280; border-color: #2a2a2a; }
[data-theme="dark"] .rc-table td { color: #e5e7eb; border-color: #2a2a2a; }
[data-theme="dark"] .rc-table tbody tr:hover td { background: #222; }
[data-theme="dark"] .rc-search,
[data-theme="dark"] .rc-btn,
[data-theme="dark"] .rc-filter,
[data-theme="dark"] .rc-input, [data-theme="dark"] .rc-select,
[data-theme="dark"] .rc-modal-input,
[data-theme="dark"] .rc-onboard-card,
[data-theme="dark"] .rc-integ { background: #222; border-color: #333; }
[data-theme="dark"] .rc-search input,
[data-theme="dark"] .rc-input, [data-theme="dark"] .rc-select,
[data-theme="dark"] .rc-modal-input { color: #e5e7eb; }
[data-theme="dark"] .rc-bar, [data-theme="dark"] .rc-perf-track,
[data-theme="dark"] .rc-perf-bar { background: #2a2a2a; }
[data-theme="dark"] .rc-modal { background: #1a1a1a; box-shadow: 0 24px 64px rgba(0,0,0,.4); }
[data-theme="dark"] .rc-modal-head, [data-theme="dark"] .rc-modal-actions { border-color: #2a2a2a; }
[data-theme="dark"] .rc-modal-close { background: #222; color: #9ca3af; }
[data-theme="dark"] .rc-label, [data-theme="dark"] .rc-modal-label,
[data-theme="dark"] .rc-kpi-sub, [data-theme="dark"] .rc-bar-lbl,
[data-theme="dark"] .rc-table-footer, [data-theme="dark"] .rc-onboard-desc { color: #9ca3af; }
[data-theme="dark"] .rc-onboard-label { color: #e5e7eb; }
[data-theme="dark"] .rc-status-badge { background: #222; border-color: #333; }

/* ══════════════════════════════════════════════════════
   Modales « legacy » (.rec-modal*, .rec-btn*) — re-stylées pour être raccord
   avec le nouveau shell sans toucher au JS. Les modales (import CSV,
   opposition, CGU, KBIS, détail débiteur...) gardent leurs classes .rec-* ;
   ce bloc, chargé après agent-dashboard.css, leur applique le look .rc-*.
══════════════════════════════════════════════════════ */
.rec-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px); z-index: 10000;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.rec-modal {
  background: var(--sf); border-radius: 16px;
  max-width: 560px; width: 100%; max-height: 86vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
}
.rec-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--sf3);
}
.rec-modal-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.rec-modal-close {
  width: 28px; height: 28px; border-radius: 50%; background: var(--sf2);
  border: none; cursor: pointer; font-size: 14px; color: var(--gr);
  display: flex; align-items: center; justify-content: center;
}
.rec-modal-close:hover { background: var(--sf3); }
.rec-modal-body { padding: 20px 24px; }
.rec-modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 24px; border-top: 1px solid var(--sf3);
}
.rec-modal-field { margin-bottom: 14px; }
.rec-modal-label { font-size: 12px; font-weight: 600; color: var(--gr); margin-bottom: 6px; }
.rec-modal-input {
  width: 100%; border: 1px solid var(--sf3); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; font-family: inherit;
  background: var(--sf2); color: var(--ink); outline: none; box-sizing: border-box;
}
.rec-modal-input:focus { border-color: #8b5cf6; }
.rec-modal-hint { font-size: 11px; color: var(--gr); margin-top: 8px; line-height: 1.6; }
.rec-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--sf3); border-radius: 10px; cursor: pointer;
  font-family: inherit; transition: all .15s; white-space: nowrap;
  background: var(--sf2); color: var(--ink);
}
.rec-btn:hover { border-color: #8b5cf6; }
.rec-btn-primary, .rec-btn.rec-btn-primary { background: #8b5cf6; color: #fff; border-color: #8b5cf6; }
.rec-btn-primary:hover { background: #7c3aed; border-color: #7c3aed; }
.rec-modal-overlay .btn-secondary {
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--sf3); border-radius: 10px; cursor: pointer;
  background: var(--sf2); color: var(--ink); font-family: inherit; transition: all .15s;
}
.rec-modal-overlay .btn-secondary:hover { border-color: #8b5cf6; }
[data-theme="dark"] .rec-modal { background: #1a1a1a; box-shadow: 0 24px 64px rgba(0,0,0,.4); }
[data-theme="dark"] .rec-modal-head, [data-theme="dark"] .rec-modal-actions { border-color: #2a2a2a; }
[data-theme="dark"] .rec-modal-title { color: #e5e7eb; }
[data-theme="dark"] .rec-modal-close { background: #222; color: #9ca3af; }
[data-theme="dark"] .rec-modal-label, [data-theme="dark"] .rec-modal-hint { color: #9ca3af; }
[data-theme="dark"] .rec-modal-input,
[data-theme="dark"] .rec-btn,
[data-theme="dark"] .rec-modal-overlay .btn-secondary { background: #222; border-color: #333; color: #e5e7eb; }

/* Grille d'intégrations (.int-bubble rendue par _renderIntegGrid) dans le shell */
.rc-integ-grid .int-bubble {
  border: 1px solid var(--sf3); border-radius: 14px; padding: 18px 14px;
  background: var(--sf2); cursor: pointer; transition: all .15s; text-align: center;
}
.rc-integ-grid .int-bubble:hover { border-color: #8b5cf6; }
[data-theme="dark"] .rc-integ-grid .int-bubble { background: #222; border-color: #333; }

/* ── Carte « Personnalisation des relances » ── */
.rc-textarea {
  width: 100%; border: 1px solid var(--sf3); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; font-family: inherit; line-height: 1.6;
  outline: none; background: var(--sf2); color: var(--ink);
  transition: border-color .15s; box-sizing: border-box; resize: vertical;
}
.rc-textarea:focus { border-color: #8b5cf6; }

/* Toggles canaux */
.rc-toggle-row { display: flex; flex-wrap: wrap; gap: 10px; }
.rc-toggle-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid var(--sf3); border-radius: 10px; padding: 10px 14px;
  background: var(--sf2); cursor: pointer; flex: 1; min-width: 160px;
}
.rc-toggle-item.rc-toggle-disabled { cursor: not-allowed; opacity: .6; }
.rc-toggle-txt { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.rc-soon {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: rgba(139,92,246,.12); color: #8b5cf6; padding: 2px 6px; border-radius: 5px;
}
.rc-toggle { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.rc-toggle input { opacity: 0; width: 0; height: 0; }
.rc-toggle-slider {
  position: absolute; inset: 0; background: var(--sf3); border-radius: 22px;
  transition: background .18s; cursor: pointer;
}
.rc-toggle-slider::before {
  content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.rc-toggle input:checked + .rc-toggle-slider { background: #8b5cf6; }
.rc-toggle input:checked + .rc-toggle-slider::before { transform: translateX(16px); }
.rc-toggle input:disabled + .rc-toggle-slider { cursor: not-allowed; }

/* Cadence (lecture seule) */
.rc-cadence { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rc-cad-step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1px solid var(--sf3); border-radius: 10px; padding: 8px 10px;
  background: var(--sf2); min-width: 84px;
}
.rc-cad-dot { font-size: 12px; font-weight: 700; color: #8b5cf6; }
.rc-cad-lbl { font-size: 10px; color: var(--gr); text-align: center; line-height: 1.3; }
.rc-cad-arrow { color: var(--gr); font-size: 13px; }

/* Modèles de messages */
.rc-tpl {
  border: 1px solid var(--sf3); border-radius: 12px; padding: 14px;
  background: var(--sf2); margin-bottom: 12px;
}
.rc-tpl-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.rc-tpl-tag {
  font-size: 11px; font-weight: 700; color: #8b5cf6;
  background: rgba(139,92,246,.1); padding: 3px 8px; border-radius: 6px;
}
.rc-tpl-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.rc-tpl-badge {
  font-size: 10px; font-weight: 600; color: var(--gr); margin-left: auto;
  border: 1px solid var(--sf3); padding: 2px 7px; border-radius: 6px;
}
.rc-tpl-badge-custom { color: #16a34a; border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.07); }
.rc-tpl .rc-input { margin-bottom: 8px; }
.rc-tpl-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.rc-btn-sm { padding: 6px 12px; font-size: 12px; }
#rec-cfg-relances-body code {
  font-size: 11px; background: var(--sf3); padding: 1px 5px; border-radius: 4px;
  font-family: ui-monospace, monospace;
}
[data-theme="dark"] .rc-toggle-item,
[data-theme="dark"] .rc-cad-step,
[data-theme="dark"] .rc-tpl { background: #222; border-color: #333; }
[data-theme="dark"] .rc-textarea { background: #222; border-color: #333; color: #e5e7eb; }
[data-theme="dark"] #rec-cfg-relances-body code { background: #2a2a2a; }

/* ── Analyse des créances : DSO / balance âgée ── */
.rc-aging-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.rc-aging-tile {
  border: 1px solid var(--sf3); border-radius: 12px; padding: 14px;
  background: var(--sf2); text-align: center;
}
.rc-aging-tile-val { font-size: 20px; font-weight: 800; color: var(--ink); }
.rc-aging-tile-lbl { font-size: 11px; color: var(--gr); margin-top: 4px; line-height: 1.4; }
.rc-aging-title {
  font-size: 12px; font-weight: 700; color: var(--gr);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px;
}
.rc-aging-bars { display: flex; flex-direction: column; gap: 8px; }
.rc-aging-row { display: flex; align-items: center; gap: 10px; }
.rc-aging-row-lbl { font-size: 12px; color: var(--ink); width: 72px; flex-shrink: 0; }
.rc-aging-row-bar {
  flex: 1; height: 18px; background: var(--sf2);
  border-radius: 6px; overflow: hidden;
}
.rc-aging-row-fill { height: 100%; border-radius: 6px; min-width: 2px; transition: width .3s ease; }
.rc-aging-row-val { font-size: 12px; font-weight: 600; color: var(--ink); width: 130px; text-align: right; flex-shrink: 0; }
.rc-aging-row-cnt { color: var(--gr); font-weight: 400; }
@media (max-width: 640px) {
  .rc-aging-tiles { grid-template-columns: 1fr; }
}
[data-theme="dark"] .rc-aging-tile { background: #222; border-color: #333; }
[data-theme="dark"] .rc-aging-row-bar { background: #2a2a2a; }

/* ── Cadence d'escalade : layout amélioré ── */
.rc-cad-step { min-width: 110px; padding: 10px 12px; }
.rc-cad-dot { font-size: 11px; padding: 2px 6px; border-radius: 5px; background: rgba(139,92,246,.1); }
.rc-cad-lbl { line-height: 1.4; }

/* Onboarding solo (post-retrait ERP) */
.rc-onboard-grid.rc-onboard-grid-solo { grid-template-columns: 1fr; max-width: 520px; }

/* Badge statut huissier (rouge sombre, distinct de "opposition") */
.rc-badge-huissier {
  background: rgba(139,92,246,.1) !important;
  border: 1px solid rgba(139,92,246,.4) !important;
  color: #6d28d9 !important;
}
.rc-badge-huissier .rc-badge-dot { background: #6d28d9 !important; }

/* Header de phase dans l'éditeur de templates */
.rc-tpl-phase-hd {
  font-size: 12px; font-weight: 700; color: var(--ink);
  text-transform: uppercase; letter-spacing: .04em;
  margin: 18px 0 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--sf3);
}
.rc-tpl-phase-hd:first-child { margin-top: 0; }

/* ── Empty state Dossiers : hero + parcours d'escalade ── */
.rc-onboard {
  max-width: 760px; margin: 24px auto;
  background: var(--sf); border: 1.5px dashed var(--sf3);
  border-radius: 20px; padding: 48px 40px 36px;
  text-align: center; transition: all .2s;
}
.rc-onboard.drag-over {
  border-color: #8b5cf6; background: rgba(139,92,246,.04);
  box-shadow: 0 0 0 4px rgba(139,92,246,.08);
}
.rc-onboard-icon-wrap { margin-bottom: 18px; }
.rc-onboard-icon-bg {
  display: inline-flex; align-items: center; justify-content: center;
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(139,92,246,.12), rgba(245,158,11,.12));
  font-size: 36px; line-height: 1;
}
.rc-onboard-h {
  font-size: 22px; font-weight: 800; color: var(--ink);
  margin: 0 0 10px; line-height: 1.3;
}
.rc-onboard-sub {
  font-size: 14px; color: var(--gr); line-height: 1.6;
  max-width: 520px; margin: 0 auto 28px;
}
.rc-onboard-cta {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 14px;
}
.rc-btn-lg { padding: 11px 20px; font-size: 14px; font-weight: 600; }
.rc-onboard-links {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 12px; color: var(--gr); margin-bottom: 32px; flex-wrap: wrap;
}
.rc-link {
  background: none; border: none; color: var(--gr); cursor: pointer;
  font-size: 12px; padding: 4px 0; transition: color .15s;
  font-family: inherit;
}
.rc-link:hover { color: #8b5cf6; text-decoration: underline; }
.rc-link-sep { opacity: .5; }
.rc-link-info { font-style: italic; opacity: .8; }

/* Parcours d'escalade (5 phases) */
.rc-onboard-journey {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; flex-wrap: nowrap; overflow-x: auto;
  padding: 18px 0 4px; border-top: 1px solid var(--sf3);
}
.rc-onboard-journey-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 86px; flex-shrink: 0;
}
.rc-onboard-journey-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--sf2); border: 1.5px solid var(--sf3);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--gr);
}
.rc-onboard-journey-step-end .rc-onboard-journey-dot {
  background: rgba(139,92,246,.1); border-color: rgba(139,92,246,.4); color: #6d28d9;
  font-size: 14px;
}
.rc-onboard-journey-lbl {
  display: flex; flex-direction: column; gap: 1px; text-align: center;
  font-size: 10px; line-height: 1.3;
}
.rc-onboard-journey-lbl strong { color: var(--ink); font-weight: 700; font-size: 11px; }
.rc-onboard-journey-lbl span { color: var(--gr); }
.rc-onboard-journey-arrow {
  color: var(--sf3); font-size: 14px; padding: 0 2px;
  margin-top: -16px; /* aligne avec les dots */
  flex-shrink: 0;
}

[data-theme="dark"] .rc-onboard { background: #1a1a1a; border-color: #2a2a2a; }
[data-theme="dark"] .rc-onboard-journey-dot { background: #222; border-color: #333; }

@media (max-width: 720px) {
  .rc-onboard { padding: 32px 20px 24px; }
  .rc-onboard-h { font-size: 19px; }
  .rc-onboard-journey { gap: 2px; }
  .rc-onboard-journey-step { min-width: 70px; }
  .rc-onboard-journey-lbl { font-size: 9px; }
}

/* ── Empty state minimaliste (v2) ── */
.rc-onboard-min {
  max-width: 560px; margin: 40px auto;
  text-align: center;
  padding: 8px 20px 32px;
}
.rc-onboard-min-h {
  font-size: 22px; font-weight: 700; color: var(--ink);
  letter-spacing: -.01em; line-height: 1.3;
  margin: 0 0 28px;
}
.rc-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  padding: 44px 24px;
  border: 1.5px dashed var(--sf3); border-radius: 14px;
  background: var(--sf);
  cursor: pointer;
  transition: all .2s ease;
}
.rc-dropzone:hover {
  border-color: #8b5cf6; background: rgba(139,92,246,.03);
}
.rc-dropzone.drag-over {
  border-color: #8b5cf6; border-style: solid;
  background: rgba(139,92,246,.06);
  box-shadow: 0 0 0 4px rgba(139,92,246,.08);
}
.rc-dropzone-ico {
  width: 32px; height: 32px; color: var(--gr);
  transition: color .2s, transform .2s;
}
.rc-dropzone:hover .rc-dropzone-ico { color: #8b5cf6; transform: translateY(-2px); }
.rc-dropzone-main {
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.rc-dropzone-sub {
  font-size: 12px; color: var(--gr);
}
.rc-dropzone-model {
  margin-top: 14px; font-size: 12px;
}
.rc-onboard-min-or {
  margin-top: 22px; font-size: 13px; color: var(--gr);
}
.rc-link-strong {
  color: #8b5cf6 !important; font-weight: 600;
}
.rc-link-strong:hover { color: #7c3aed !important; }

[data-theme="dark"] .rc-dropzone { background: #1a1a1a; border-color: #2a2a2a; }
[data-theme="dark"] .rc-dropzone:hover { border-color: #8b5cf6; background: rgba(139,92,246,.06); }

/* ── Gestion des relances : tuiles d'action ── */
.rc-mgr-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.rc-mgr-tile {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--sf); border: 1px solid var(--sf3); border-radius: 14px;
  cursor: pointer; transition: all .18s ease;
  text-align: left; font-family: inherit;
}
.rc-mgr-tile:hover {
  border-color: #8b5cf6; box-shadow: 0 4px 14px rgba(139,92,246,.1);
  transform: translateY(-1px);
}
.rc-mgr-tile-ico {
  font-size: 22px; line-height: 1; flex-shrink: 0;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(139,92,246,.08); border-radius: 10px;
}
.rc-mgr-tile-body { flex: 1; min-width: 0; }
.rc-mgr-tile-title {
  font-size: 14px; font-weight: 700; color: var(--ink);
  margin-bottom: 3px;
}
.rc-mgr-tile-sub {
  font-size: 12px; color: var(--gr);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc-mgr-tile-arrow {
  font-size: 22px; color: var(--gr); flex-shrink: 0;
  transition: color .18s, transform .18s;
}
.rc-mgr-tile:hover .rc-mgr-tile-arrow { color: #8b5cf6; transform: translateX(2px); }

@media (max-width: 720px) { .rc-mgr-grid { grid-template-columns: 1fr; } }
[data-theme="dark"] .rc-mgr-tile { background: #1a1a1a; border-color: #2a2a2a; }

/* ── Modales de gestion ── */
.rc-mgr-modal { max-width: 640px !important; width: 100%; }
.rc-mgr-section {
  padding: 14px 0; border-bottom: 1px solid var(--sf3);
}
.rc-mgr-section:last-child { border-bottom: none; }
.rc-mgr-section:first-child { padding-top: 0; }
.rc-mgr-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
}

/* ── Radio cards (Ton IA) ── */
.rc-mgr-radio-group { display: flex; flex-direction: column; gap: 8px; }
.rc-mgr-radio {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: var(--sf2); border: 1.5px solid var(--sf3); border-radius: 12px;
  cursor: pointer; transition: all .15s;
}
.rc-mgr-radio:hover { border-color: rgba(139,92,246,.4); }
.rc-mgr-radio input[type="radio"] {
  margin-top: 3px; accent-color: #8b5cf6; cursor: pointer;
}
.rc-mgr-radio:has(input:checked) {
  border-color: #8b5cf6; background: rgba(139,92,246,.05);
}
.rc-mgr-radio-body { flex: 1; }
.rc-mgr-radio-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.rc-mgr-radio-desc { font-size: 12px; color: var(--gr); line-height: 1.5; }

[data-theme="dark"] .rc-mgr-radio { background: #222; border-color: #333; }
[data-theme="dark"] .rc-mgr-radio:has(input:checked) { background: rgba(139,92,246,.1); }

/* ── Timeline des contacts (modal détail débiteur) ── */
.rc-timeline { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; padding-right: 6px; }
.rc-timeline-row {
  display: flex; gap: 10px; padding: 8px 10px;
  background: var(--sf); border: 1px solid var(--sf3); border-radius: 9px;
  transition: border-color .15s;
}
.rc-timeline-row:hover { border-color: rgba(139,92,246,.3); }
.rc-timeline-ico {
  font-size: 16px; line-height: 1; flex-shrink: 0;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--sf2); border-radius: 7px;
}
.rc-timeline-body { flex: 1; min-width: 0; }
.rc-timeline-hd { font-size: 11px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.rc-timeline-canal { text-transform: capitalize; }
.rc-timeline-phase { color: var(--gr); font-weight: 500; }
.rc-timeline-statut { font-weight: 600; font-size: 10.5px; }
.rc-timeline-preview {
  font-size: 11px; color: var(--gr); line-height: 1.45;
  margin-bottom: 4px; word-break: break-word;
}
.rc-timeline-date { font-size: 10px; color: var(--gr); opacity: .8; }
[data-theme="dark"] .rc-timeline-row { background: #1a1a1a; border-color: #2a2a2a; }
[data-theme="dark"] .rc-timeline-ico { background: #222; }
