/* =====================================================================
   ARC CRM v2 — calque d'identité : l'âme du CRM d'origine (Outfit pour les titres et les chiffres, Plus Jakarta Sans pour le texte,
   bleu nuit, bandeaux bleus, fond pointillé) posée sur le socle moderne d'app.css. Chargé après app.css ; retirable d'un seul lien.
   ===================================================================== */

/* Polices auto-hébergées (variables), plus de dépendance externe */
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/outfit-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/outfit-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('../fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('../fonts/plus-jakarta-sans-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Palette d'origine : ardoise, bleu ARC, bleu nuit ---------- */
:root {
  --bg: #f1f5f9; --surface: #ffffff; --surface-2: #f1f5f9; --surface-3: #e2e8f0; --line: #e2e8f0; --line-2: #cbd5e1;
  --fg: #0f172a; --fg-2: #334155; --fg-3: #64748b; --fg-4: #94a3b8;
  --accent: #2563eb; --accent-2: #3b82f6; --accent-soft: #dbeafe; --accent-ink: #1d4ed8;
  --band: #2271b1; --navy: #0f172a; --navy-2: #1e3a5f;
  --ok: #059669; --ok-soft: #d1fae5; --warn: #b45309; --warn-soft: #fef3c7; --danger: #dc2626; --danger-soft: #fee2e2; --info: #2563eb; --info-soft: #dbeafe;
  --gold: #b8841f; --gold-soft: #fdf3dc;
  --font: 'Plus Jakarta Sans', 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
  --r: 10px; --r-lg: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 18px rgba(15,23,42,.06); --shadow-lg: 0 12px 36px rgba(15,23,42,.16);
}
body { font-family: var(--font); font-size: 14px; font-weight: 400; letter-spacing: 0; background: var(--bg) radial-gradient(rgba(15,23,42,.07) 1px, transparent 1px) 0 0 / 22px 22px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }
strong, b { font-weight: 600; }
a { color: var(--accent-ink); }
.content { max-width: none; }                       /* le contenu occupe toute la largeur de l'écran */

/* ---------- Barre latérale bleu nuit ---------- */
.sidebar { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); border-right: 0; color: #e2e8f0; }
.sidebar .brand { color: #fff; border-bottom: 1px solid rgba(255,255,255,.1); font-family: var(--display); font-weight: 600; }
.sidebar .wordmark-mark { background: #fff; color: var(--navy); font-family: var(--display); font-weight: 700; }
.sidebar .nav-label { color: #64748b; font-weight: 600; letter-spacing: .1em; }
.sidebar .nav-item { color: #cbd5e1; font-weight: 500; font-size: 13.5px; }
.sidebar .nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-item.active { background: rgba(37,99,235,.38); color: #fff; box-shadow: inset 3px 0 0 #60a5fa; }
.sidebar .nav-item.soon, .sidebar .nav-item.soon:hover { color: #475569; }
.sidebar .nav-item em { color: #64748b; }
.sidebar-foot { color: #64748b; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar ::-webkit-scrollbar { width: 8px; } .sidebar ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 8px; }

/* ---------- En-tête de page ---------- */
.topbar { background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line); }
.topbar-title h1 { font-weight: 600; }

/* ---------- Bandeau d'accueil (salutation) ---------- */
.page-intro.hero { align-items: center; margin-bottom: 22px; padding: 22px 26px; border-radius: var(--r-lg); position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); box-shadow: var(--shadow); }
.page-intro.hero::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 80% 50%, rgba(37,99,235,.35) 0%, transparent 60%); }
.page-intro.hero > * { position: relative; }
.page-intro.hero .h-greet { font-size: 24px; font-weight: 600; color: #fff; }
.page-intro.hero .h-greet em { color: #93c5fd; font-style: normal; font-weight: 600; }
.page-intro.hero .hero-sub { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-intro.hero .hero-date { font-size: 12.5px; font-weight: 500; color: #cbd5e1; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); padding: 4px 14px; border-radius: 999px; text-transform: capitalize; }
.page-intro.hero .hero-note { font-size: 13px; color: #94a3b8; }
.page-intro.hero .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #fff; box-shadow: none; }
.page-intro.hero .btn:hover { background: rgba(255,255,255,.18); }
.page-intro.hero .btn-primary { background: #fff; border-color: #fff; color: var(--navy); }
.page-intro.hero .btn-primary:hover { background: #dbeafe; border-color: #dbeafe; }
.page-intro.hero .badge { background: rgba(255,255,255,.16); color: #fff; }

/* ---------- Tuiles d'indicateurs (accueil) : teintes douces, icône dans une pastille colorée ---------- */
.kpi-vivid .kpi { --t: var(--accent); --t-soft: var(--accent-soft); position: relative; overflow: hidden; border: 1px solid color-mix(in srgb, var(--t) 18%, var(--line)); background: linear-gradient(160deg, #fff 0%, var(--t-soft) 130%); min-height: 118px; padding: 18px 18px 14px; transition: transform .2s, box-shadow .2s; box-shadow: var(--shadow); }
.kpi-vivid .kpi::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--t); }
.kpi-vivid .kpi:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(15,23,42,.14); text-decoration: none; }
.kpi-vivid .kpi-label { color: var(--fg-3); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; padding-right: 56px; }
.kpi-vivid .kpi-value { color: var(--fg); font-family: var(--display); font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; margin-top: 8px; }
.kpi-vivid .kpi-value sup { font-size: 14px; font-weight: 600; vertical-align: super; margin-left: 2px; color: var(--t); }
.kpi-vivid .kpi-hint { color: var(--fg-3); font-size: 12.5px; margin-top: 6px; }
.kpi-vivid .kpi-ico { position: absolute; right: 14px; top: 16px; width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: var(--t-soft); color: var(--t); box-sizing: border-box; }
.kpi-vivid .kpi-bar { height: 6px; border-radius: 4px; background: var(--surface-3); margin-top: 10px; overflow: hidden; }
.kpi-vivid .kpi-bar i { display: block; height: 100%; background: var(--t); border-radius: 4px; }
.kpi-c1 { --t: #2563eb; --t-soft: #dbeafe; }
.kpi-c2 { --t: #4f46e5; --t-soft: #e0e7ff; }
.kpi-c3 { --t: #059669; --t-soft: #d1fae5; }
.kpi-c4 { --t: #d97706; --t-soft: #fef3c7; }
.kpi-c5 { --t: #0f766e; --t-soft: #ccfbf1; }

/* Autres tuiles (statistiques, ventes, console…) */
.kpi { box-shadow: var(--shadow); border-color: var(--line); }
.kpi-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); }
.kpi-value, .kpi-value.mono, .kpi-value .mono { font-family: var(--display); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Cartes ---------- */
.card { box-shadow: var(--shadow); border-color: var(--line); }
.card-title, .card-head h2, .card-head h3 { font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--fg); }
.card-title .link, .card-head .link { font-weight: 500; font-size: 12.5px; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font: 600 12px/1 var(--display); letter-spacing: 0; }

/* ---------- Tableaux : bandeau d'en-tête bleu ---------- */
.table th { background: var(--band); color: #fff; font-size: 11.5px; font-weight: 600; letter-spacing: .07em; border-bottom: 0; }
.table th[data-sort]:hover { color: #dbeafe; }
.table-wrap { border-radius: var(--r); overflow: hidden; }
.table thead tr th:first-child { border-top-left-radius: var(--r); } .table thead tr th:last-child { border-top-right-radius: var(--r); }
.table tbody tr:nth-child(even) td { background: #f8fafc; }
.table tbody tr:hover td { background: #eff6ff; }
.table td.num { font-family: var(--display); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot th { background: var(--surface-2); color: var(--fg); font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 13px; border-top: 2px solid var(--line-2); }

/* ---------- Onglets ---------- */
.tabs { gap: 4px; border-bottom-width: 2px; }
.tabs a, .tabs button, .tabs .tab-link { font-family: var(--display); font-weight: 500; font-size: 14px; padding: 10px 14px; border-bottom-width: 3px; margin-bottom: -2px; color: var(--fg-3); }
.tabs .active, .tabs .tab-link.active { color: var(--accent-ink); border-bottom-color: var(--accent-ink); font-weight: 600; }
.tabs .count { font-family: var(--display); }

/* ---------- Boutons : bleu dégradé, noir pour les actions fortes ---------- */
.btn { font-weight: 500; border-radius: var(--r); }
.btn-primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); border-color: #1d4ed8; box-shadow: 0 4px 12px rgba(37,99,235,.25); font-weight: 600; }
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af); border-color: #1e40af; }
.btn-dark { background: #0a0a0a; border-color: #0a0a0a; color: #fff; font-weight: 600; } .btn-dark:hover { background: #262626; border-color: #262626; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------- Badges ---------- */
.badge { font-weight: 500; font-size: 12px; }
.badge-gold, .badge-warn { background: var(--gold-soft); color: var(--gold); }

/* ---------- Formulaires ---------- */
label, .field > label { font-size: 12px; font-weight: 500; color: var(--fg-2); }
input, select, textarea { font-family: var(--font); }

/* ---------- Divers ---------- */
.modal { border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.notif-menu .menu, .help-panel { box-shadow: var(--shadow-lg); }
.logo-tile.is-on { box-shadow: 0 0 0 2px var(--accent-soft); }

/* ---------- Bandeau « Vous voyez le CRM comme… » ---------- */
.impersonate-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -8px 0 18px; padding: 10px 16px; border-radius: var(--r); background: #fef3c7; border: 1px solid #fcd34d; color: #78350f; font-size: 13.5px; }
.impersonate-bar strong { font-weight: 600; }
.impersonate-bar .grow { flex: 1; }
.impersonate-bar .btn { height: 30px; padding: 0 12px; font-size: 12.5px; background: #78350f; border-color: #78350f; color: #fff; }

/* ---------- Menu utilisateur : « Voir en tant que » ---------- */
.dropdown .menu .menu-form { display: grid; gap: 4px; padding: 6px 10px 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.dropdown .menu .menu-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--fg-3); }
.dropdown .menu .menu-form select { width: 100%; font-size: 13px; }

/* ---------- Densité des tableaux de listes ---------- */
.table td { padding-top: 8px; padding-bottom: 8px; }
.table td .small, .table td .muted { line-height: 1.3; }
.table td > div.small { margin-top: 1px; }

/* ---------- Droits par utilisateur ---------- */
.perm-group { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; background: var(--surface); }
.perm-group h4 { color: var(--accent-ink) !important; font-weight: 600 !important; letter-spacing: .06em; margin: 0 0 6px !important; }
.perm-row { padding: 4px 0; border-top: 1px solid var(--line); }
.perm-row:first-of-type { border-top: 0; }
.perm-row select { height: 28px; font-size: 12.5px; padding-right: 26px; min-width: 130px; }
.perm-row.is-allow select { border-color: var(--ok); background-color: var(--ok-soft); color: var(--ok); }
.perm-row.is-deny select { border-color: var(--danger); background-color: var(--danger-soft); color: var(--danger); }
.perm-default { display: block; font-size: 11.5px; }
.table .actions .btn-sm:not(.btn-ghost) { width: auto; padding: 0 10px; }

/* ---------- Correctifs du 13/10 ---------- */
.topsearch input, .topsearch input[type="search"] { border: 0 !important; box-shadow: none !important; background: transparent !important; height: auto !important; padding: 0 !important; }
.seg-full { display: flex; width: 100%; } .seg-full .seg-opt { flex: 1; } .seg-full .seg-opt span { width: 100%; justify-content: center; }
.empty .btn svg { width: 16px; height: 16px; margin: 0; color: inherit; }

/* ---------- Retour et confidentialité ---------- */
.topbar-back { flex: none; }
#privacy-toggle[aria-pressed="true"] { background: var(--navy); color: #fff; }
body.privacy .kpi-value, body.privacy td.num, body.privacy .cf-portfolio-val, body.privacy .cf-portfolio-evol, body.privacy .conf-pct, body.privacy [data-money], body.privacy .money, body.privacy input.money, body.privacy .ucs-dl dd { filter: blur(6px); user-select: none; }
body.privacy .kpi-value:hover, body.privacy td.num:hover, body.privacy .cf-portfolio-val:hover { filter: none; }
.doc-rename { width: 22px; height: 22px; vertical-align: middle; opacity: .55; } .doc-rename:hover { opacity: 1; }
.doc-validate.dropdown .menu { min-width: 220px; }

/* Barre d'outils : la recherche et le bouton Filtres restent sur une seule ligne */
.toolbar > .toolbar-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 auto; min-width: 0; }
.toolbar > .toolbar-form .topsearch.inline { flex: 0 1 360px; }

/* ---------- Interrupteurs et matrice d'accès (Administration → Accès) ---------- */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; vertical-align: middle; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:disabled + span { opacity: .4; cursor: not-allowed; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.acc-wrap { max-height: 70vh; overflow: auto; }
.acc-table th.acc-first, .acc-table td.acc-first { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 260px; }
.acc-table thead th { position: sticky; top: 0; z-index: 2; }
.acc-table thead th.acc-first { z-index: 3; }
.acc-table th.acc-user { min-width: 150px; vertical-align: top; }
.acc-table .acc-name { font-family: var(--display); font-weight: 600; font-size: 13px; }
.acc-table th.acc-user form { margin-top: 4px; }
.acc-table td.acc-cell { text-align: center; position: relative; }
.acc-table td.acc-cell.is-custom::after { content: ""; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.acc-table tr.group-row td { background: var(--bg-2); font-family: var(--display); font-weight: 600; font-size: 13px; padding: 8px 12px; border-top: 2px solid var(--border); position: sticky; left: 0; }
/* ---------- Confidentialité étendue : montants, identités, coordonnées, contenus de tableaux et de fiches (survol = lecture ponctuelle) ---------- */
body.privacy .table tbody td:not(.actions), body.privacy .dl dd, body.privacy .cf-name, body.privacy .cf-chips, body.privacy .cf-side, body.privacy .page-intro .muted,
body.privacy .agenda-ev, body.privacy .cal-ev, body.privacy .chart, body.privacy .kanban-card, body.privacy .notif-item, body.privacy .search-results, body.privacy .home-list li,
body.privacy .change, body.privacy .echange, body.privacy .suivi-item, body.privacy .timeline-item, body.privacy .topbar-title .breadcrumb span:last-child, body.privacy input:not([type=search]):not([type=checkbox]):not([type=radio]), body.privacy textarea, body.privacy select { filter: blur(5px); user-select: none; }
body.privacy .table tbody tr:hover td, body.privacy .dl dd:hover, body.privacy .cf-name:hover, body.privacy .cf-side:hover, body.privacy .agenda-ev:hover, body.privacy .cal-ev:hover, body.privacy .chart:hover, body.privacy .kanban-card:hover, body.privacy .home-list li:hover,
body.privacy .change:hover, body.privacy .echange:hover, body.privacy .suivi-item:hover, body.privacy .timeline-item:hover, body.privacy input:focus, body.privacy textarea:focus, body.privacy select:focus, body.privacy .cf-chips:hover { filter: none; user-select: auto; }
body.privacy::after { content: "Mode confidentialité : les données sont floutées, survolez un élément pour le lire."; position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); background: var(--navy); color: #fff; font-size: 12px; padding: 6px 12px; border-radius: 999px; z-index: 50; opacity: .9; pointer-events: none; }

/* ---------- Téléphone : composition dédiée (actions d'abord, grands tableaux et graphiques en retrait) ---------- */
.only-mobile-flex, .only-mobile-grid { display: none !important; }
.cf-complete { display: grid; gap: 6px; margin: 0 0 14px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.cf-complete-bar { height: 6px; border-radius: 999px; background: var(--bg-2); overflow: hidden; } .cf-complete-bar i { display: block; height: 100%; background: var(--navy-2); border-radius: 999px; }
.act-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.act-timeline .timeline-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dup-card { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; background: var(--surface); }
.dup-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.dup-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; } .dup-actions form { margin: 0; }
@media (max-width: 860px) {
  .only-mobile-flex { display: flex !important; } .only-mobile-grid { display: grid !important; }
  .m-actions { grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 18px; }
  .m-actions a { display: grid; justify-items: center; gap: 6px; padding: 14px 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--navy); font: 600 12.5px var(--display); text-decoration: none; box-shadow: var(--shadow-sm, 0 1px 2px rgba(15,23,42,.06)); }
  .m-actions a svg { color: var(--accent); }
  .m-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--navy); color: #fff; padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); justify-content: space-around; box-shadow: 0 -4px 20px rgba(15,23,42,.25); }
  .m-bar a, .m-bar button { display: grid; justify-items: center; gap: 2px; background: none; border: 0; color: #fff; font: 500 11px var(--font); text-decoration: none; padding: 4px 8px; min-width: 56px; cursor: pointer; }
  .m-bar svg { color: #93c5fd; }
  body:has(.m-bar) .content { padding-bottom: 86px; }
  .page-intro.hero { padding: 16px; } .hero .h-greet { font-size: 20px; } .page-intro .btn-group { display: none; }
  .home-mod .chart, #chart, #chart-contract, .chart-legend, .home-mod .table-wrap table tbody tr:nth-child(n+6) { display: none; }
  .home-mod .card-head:has(+ .chart)::after, .card-head:has(+ .chart)::after { content: "graphique disponible sur ordinateur"; font-size: 11px; color: var(--fg-3); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } .kpi { padding: 10px 12px; } .kpi-value { font-size: 20px; }
  .cf-band { flex-direction: column; } .cf-band-right { width: 100%; } .cf-band-right .btn-group { display: none; }
  .cf-layout { grid-template-columns: 1fr; } .cf-side { position: static; order: 2; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; } .tabs button, .tabs .tab-link { white-space: nowrap; }
  .table-wrap { font-size: 13px; } .toolbar .btn span.only-desktop { display: none; }
  .suivi-add .form-grid { grid-template-columns: 1fr; }
  .btn, .icon-btn { min-height: 40px; }
}@media (max-width: 860px) { dialog.modal, dialog.modal-sm, dialog.modal-lg { width: calc(100vw - 16px); max-height: calc(100dvh - 24px); margin: 12px auto; } .dup-actions .btn { flex: 1 1 45%; } }

/* ---------- Échéancier (fenêtre d'accueil) et alertes ---------- */
.ech-row { display: grid; grid-template-columns: 78px 18px 1fr; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; } .ech-row:hover { background: var(--bg-2); }
.ech-opts { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.alert-list li.muted a { color: var(--fg-3); } .dot.ok { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.seg a.seg-opt { text-decoration: none; color: inherit; } .seg a.seg-opt.on span { background: var(--navy); color: #fff; border-radius: 8px; padding: 4px 10px; }
/* ---------- Assistant (compte rendu) et palette ---------- */
.ai-panel { margin-bottom: 14px; } .ai-panel > summary { list-style: none; } .ai-panel > summary::-webkit-details-marker { display: none; }
.ai-actions { display: grid; gap: 6px; } .ai-action { display: grid; grid-template-columns: auto 130px 1fr 120px; gap: 8px; align-items: center; }
@media (max-width: 860px) { .ai-action { grid-template-columns: auto 1fr; } .ai-action .ai-title { grid-column: 1 / -1; } }
.picker-item.picker-cmd .avatar { background: var(--navy); color: #fff; font-weight: 700; }
#ai-dictate.is-on { background: var(--danger); color: #fff; }.ai-panel .field { margin-top: 10px; } .ai-panel .form-row { margin-top: 10px; gap: 10px; } #ai-result h4 { font-family: var(--display); }

/* ---------- Réglementation : fil concentré, questions lisibles ---------- */
.rf-steps li .lbl { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-steps li.more { color: var(--fg-3); font-size: 12.5px; } .rf-steps li.more .n { width: 24px; height: 24px; font-size: 11px; }
.rf-steps li.next { opacity: .7; } .rf-steps li.cur .lbl { max-width: none; font-size: 14.5px; }
.rf-substeps li.done { color: var(--ok); border-color: var(--ok); }

/* ---------- Équipe (accueil administrateur), avatars ---------- */
.avatar.has-img { overflow: hidden; padding: 0; background: var(--bg-2); } .avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-xl { width: 72px; height: 72px; font-size: 22px; }
.avatar-edit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; } .avatar-edit form { margin: 0; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.team-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; display: grid; gap: 10px; background: var(--surface); }
.team-id { display: flex; align-items: center; gap: 10px; } .team-id > div { flex: 1; min-width: 0; } .team-id strong { font-family: var(--display); }
.team-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); flex: none; display: inline-block; } .team-dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.team-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; } .team-stats span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--fg-2); justify-content: center; padding: 4px 0; background: var(--bg-2); border-radius: 6px; } .team-stats span b { font-family: var(--display); }
.team-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.presence-list { display: flex; flex-wrap: wrap; gap: 8px; }
.presence-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; } .presence-chip small { color: var(--fg-3); }
.search-actions-list { display: flex; gap: 8px; flex-wrap: wrap; } #search-actions { margin-bottom: 14px; }
/* Compte rendu assisté : appel visible dans l'onglet Suivi */
.ai-panel { border: 1.5px solid var(--accent-2, #93c5fd); background: linear-gradient(135deg, #fff, var(--accent-soft, #eff6ff) 140%); }
.ai-cta { display: flex; align-items: center; gap: 14px; cursor: pointer; list-style: none; }
.ai-cta::-webkit-details-marker { display: none; }
.ai-cta-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px rgba(37, 99, 235, .6); }
.ai-cta-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.ai-cta-body strong { font-family: var(--display, var(--font)); font-size: 15px; font-weight: 600; color: var(--fg); }
.ai-cta-body span { font-size: 13px; color: var(--fg-3); }
.ai-cta-chev { color: var(--fg-4); transition: transform .15s; } .ai-panel[open] .ai-cta-chev { transform: rotate(180deg); }
@media (max-width: 640px) { .ai-cta .badge { display: none; } }

/* ---------- Demande d'adhésion (page publique) et progression ---------- */
.adh-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.adh-steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.adh-steps li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 6px; border: 1.5px solid var(--line-2); border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--fg-3); background: var(--surface); }
.adh-steps li .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--fg-3); font-size: 11.5px; }
.adh-steps li.cur { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); } .adh-steps li.cur .n { background: var(--accent); color: #fff; }
.adh-steps li.done { border-color: #bbf7d0; color: #15803d; background: #f0fdf4; cursor: pointer; } .adh-steps li.done .n { background: #22c55e; color: #fff; }
.adh-steps.compact li { font-size: 12px; padding: 4px 10px 4px 4px; } .adh-steps.compact li .n { width: 18px; height: 18px; }
.adh-step h2 { font-family: var(--display, var(--font)); font-size: 18px; font-weight: 600; margin: 4px 0 14px; } .adh-step h3 { font-size: 14px; font-weight: 600; margin: 14px 0 8px; }
.adh-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.adh-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line-2); border-radius: var(--r-lg); cursor: pointer; background: var(--surface); }
.adh-card input { margin-top: 3px; } .adh-card span { display: grid; gap: 3px; } .adh-card small { color: var(--fg-3); font-size: 12.5px; line-height: 1.4; }
.adh-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.adh-pack, .adh-crm { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); display: grid; gap: 8px; }
.adh-nav { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.adh-form .is-invalid { border-color: var(--danger); }
.dl.two { grid-template-columns: auto 1fr auto 1fr; }

/* ── Intranet ARG (tenant groupement) : accent rouge brique assourdi, pour distinguer l'intranet du CRM cabinet (bleu) ── */
body.is-groupement { --accent: #a13a3a; --accent-2: #c25c5c; --accent-soft: #f6ecec; --accent-ink: #7c2a2a; --band: #a13a3a; }
body.is-groupement .sidebar .nav-item.active { background: rgba(161,58,58,.42); box-shadow: inset 3px 0 0 #e09a9a; }
body.is-groupement .page-intro.hero .h-greet em, body.is-groupement .m-bar svg { color: #e9b3b3; }
body.is-groupement .page-intro.hero .btn-primary:hover { background: #f6ecec; border-color: #f6ecec; }
body.is-groupement .kpi-c1 { --t: #a13a3a; --t-soft: #f6ecec; }
body.is-groupement .table th[data-sort]:hover { color: #f6ecec; }
body.is-groupement .table tbody tr:hover td { background: #fbf4f4; }
body.is-groupement .btn-primary { background: linear-gradient(135deg, #a13a3a, #7c2a2a); border-color: #7c2a2a; box-shadow: 0 4px 12px rgba(161,58,58,.22); }
body.is-groupement .btn-primary:hover { background: linear-gradient(135deg, #7c2a2a, #5f1f1f); border-color: #5f1f1f; }
body.is-groupement .badge-info { color: var(--info); } body.is-groupement .badge-info::before { background: var(--info); }
body.is-groupement .flash-info, body.is-groupement .alert-info { color: #1e3a5f; }
/* Présence du rouge : barre latérale bordeaux profond, bandeau d'accueil et tuiles dégradées dans les tons brique */
body.is-groupement { --navy: #3a1c21; --navy-2: #6b2a2f; }
body.is-groupement .sidebar { background: linear-gradient(180deg, #2b1519 0%, #1d1013 100%); }
body.is-groupement .sidebar .nav-item.active { background: rgba(193,80,80,.32); box-shadow: inset 3px 0 0 #e09a9a; }
body.is-groupement .sidebar .nav-label, body.is-groupement .sidebar .nav-section-label { color: rgba(255,255,255,.42); }
body.is-groupement .page-intro.hero { background: linear-gradient(135deg, #4a1f24 0%, #8a3237 60%, #a13a3a 100%); }
body.is-groupement .page-intro.hero::before { background: radial-gradient(ellipse at 80% 50%, rgba(255,255,255,.12) 0%, transparent 60%); }
body.is-groupement .page-intro.hero .h-greet em { color: #ffd1d1; }
body.is-groupement .page-intro.hero .btn-primary { color: #7c2a2a; }
body.is-groupement .kpi-vivid .kpi { background: linear-gradient(160deg, #fff 0%, var(--t-soft) 140%); }
body.is-groupement .kpi-c1 { --t: #a13a3a; --t-soft: #f6e3e3; }
body.is-groupement .kpi-c2 { --t: #c2552d; --t-soft: #fbe6dc; }
body.is-groupement .kpi-c3 { --t: #8a6d1f; --t-soft: #f7efd6; }
body.is-groupement .kpi-c4 { --t: #2f7d4f; --t-soft: #e1f0e6; }
body.is-groupement .kpi-c5 { --t: #5b4a6b; --t-soft: #ece6f2; }
body.is-groupement .count { background: #f6e3e3; color: #7c2a2a; }
body.is-groupement .table thead th { background: #7c2a2a; }
body.is-groupement .wordmark-mark { background: linear-gradient(135deg, #a13a3a, #7c2a2a); }
:root { --chart-1: #0b4491; } body.is-groupement { --chart-1: #a13a3a; }
