/* =========================================================
   CRM interne — feuille de style unique
   Toutes les couleurs sont des variables (thème clair + sombre)
   ========================================================= */
:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eef0f5;
  --border: #e4e7ee;
  --border-strong: #d3d8e2;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-text: #4338ca;
  --on-accent: #ffffff;
  --success: #059669;
  --success-soft: #e7f8f1;
  --warning: #b45309;
  --warning-soft: #fef5e6;
  --danger: #dc2626;
  --danger-soft: #fdeeee;
  --info: #0284c7;
  --info-soft: #e8f5fc;

  --side-bg: #0f1424;
  --side-text: #a5adc2;
  --side-text-strong: #ffffff;
  --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(129, 140, 248, .16);

  /* Étapes du pipeline */
  --st-nouveau: #8b5cf6;
  --st-contact: #0ea5e9;
  --st-attente_infos: #64748b;
  --st-devis: #f59e0b;
  --st-gagne: #10b981;
  --st-enquete: #06b6d4;
  --st-rapport: #6366f1;
  --st-med: #ef4444;
  --st-clos: #475569;
  --st-non_rentable: #a16207;
  --st-retracte: #be185d;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .16);
  --avatar-l: 92%;
  --avatar-t: 32%;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e17;
    --surface: #131827;
    --surface-2: #171d2e;
    --surface-3: #1d2437;
    --border: #232b40;
    --border-strong: #2e3750;
    --text: #e8ebf3;
    --text-2: #c3c9d8;
    --muted: #8f99b0;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: #1f2447;
    --accent-text: #a5b4fc;
    --on-accent: #0b0e17;
    --success: #34d399;
    --success-soft: #0f2a22;
    --warning: #fbbf24;
    --warning-soft: #2e2410;
    --danger: #f87171;
    --danger-soft: #331819;
    --info: #38bdf8;
    --info-soft: #0f2533;
    --side-bg: #080b13;
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, .02);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    --avatar-l: 24%;
    --avatar-t: 82%;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.55 "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .75rem; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.02rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
code { font-size: .85em; background: var(--surface-3); padding: .1em .35em; border-radius: 5px; overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.xs { font-size: .76rem; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }
.strong { font-weight: 600; }
.overdue { color: var(--danger); }
.row { display: flex; gap: .75rem; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Icônes (sprite SVG dans header.ejs) */
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i.sm { width: 15px; height: 15px; vertical-align: -2px; }
.i.lg { width: 22px; height: 22px; }

/* ---------- Mise en page ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.app.no-nav { grid-template-columns: minmax(0, 1fr); }

.sidebar {
  background: var(--side-bg);
  overflow-x: hidden;
  color: var(--side-text);
  padding: 1.1rem .8rem;
  display: flex; flex-direction: column; gap: .15rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--side-text-strong); font-weight: 700; font-size: 1rem; padding: .2rem .55rem 1.1rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-banner { display: flex; align-items: center; gap: .7rem; padding: .35rem .4rem 1.1rem; min-width: 0; color: #fff; }
.brand-banner:hover { text-decoration: none; }
.brand-banner img { width: 44px; height: 44px; flex: none; border-radius: 11px; box-shadow: 0 0 0 1px rgba(34, 211, 238, .35), 0 4px 16px rgba(34, 211, 238, .25); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-txt strong { font-size: 1.35rem; font-weight: 800; letter-spacing: .14em; color: #e6fbff; text-shadow: 0 0 12px rgba(34, 211, 238, .55); }
.brand-txt small { font-size: .7rem; letter-spacing: .04em; color: #67e8f9; margin-top: .2rem; white-space: nowrap; }
.auth-brand img.auth-emblem { border-radius: 50%; box-shadow: 0 0 22px rgba(34, 211, 238, .35); }
.brand-logo { width: 34px; height: 34px; flex: none; border-radius: 10px; box-shadow: 0 4px 14px rgba(99, 102, 241, .35); }
.brand-name { display: block; font-size: 1.05rem; font-weight: 800; letter-spacing: .06em; line-height: 1.1; }
.brand-sub { display: block; font-size: .72rem; font-weight: 500; color: var(--side-text); max-width: 160px; }
.auth-brand { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.6rem; }
.auth-brand img { border-radius: 16px; box-shadow: 0 8px 24px rgba(99, 102, 241, .35); }
.auth-name { font-size: 1.5rem; font-weight: 800; letter-spacing: .05em; line-height: 1.1; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-size: .85rem; font-weight: 800; flex: none; }
.nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #5d6680; padding: .9rem .65rem .35rem; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .52rem .65rem; border-radius: 9px; color: var(--side-text); font-weight: 500;
  position: relative;
}
.nav a:hover { background: var(--side-hover); color: var(--side-text-strong); text-decoration: none; }
.nav a.active { background: var(--side-active); color: var(--side-text-strong); }
.nav a.active::before { content: ""; position: absolute; left: -.8rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #818cf8; }
.nav .count { margin-left: auto; background: #ef4444; color: #fff; border-radius: 999px; font-size: .7rem; padding: .05rem .45rem; font-weight: 700; min-width: 20px; text-align: center; }
.nav .count.violet { background: #8b5cf6; }
.nav .count.info { background: #3b82f6; }
.side-foot { margin-top: auto; padding-top: .8rem; border-top: 1px solid rgba(255, 255, 255, .07); }
.me { display: flex; align-items: center; gap: .6rem; padding: .5rem .45rem; }
.me .name { color: var(--side-text-strong); font-weight: 600; font-size: .88rem; }
.me .role { font-size: .75rem; }
.me form { margin-left: auto; }
.me button { background: none; border: 0; color: var(--side-text); cursor: pointer; padding: .35rem; border-radius: 7px; }
.me button:hover { background: var(--side-hover); color: #fff; }
.backdrop { display: none; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 2rem; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .spacer { flex: 1; }
.main { padding: 1.6rem 2rem 4rem; width: 100%; } /* occupe toute la largeur de l'écran (demande du 08/10/2026) */

/* Recherche globale */
.search { position: relative; flex: 1; max-width: 520px; }
@media (min-width: 901px) { .topbar .search { flex: 0 1 460px; } }
.search > .i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 2.3rem; padding-right: 2.6rem; background: var(--surface); height: 38px; border-radius: 10px; }
.search kbd { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: .35rem; display: none; max-height: 440px; overflow-y: auto;
}
.search-results.open { display: block; }
.search-results a { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: 8px; color: var(--text); }
.search-results a:hover, .search-results a.sel { background: var(--surface-3); text-decoration: none; }
.search-results .group { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .5rem .6rem .25rem; font-weight: 600; }
.search-results .none { padding: .8rem; color: var(--muted); font-size: .88rem; }
kbd { font: 600 .7rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: .18rem .35rem; background: var(--surface-2); }

/* Menu déroulant (details/summary) */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .35rem;
}
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: .65rem; width: 100%; padding: .55rem .65rem; border-radius: 8px;
  color: var(--text); font: inherit; background: none; border: 0; cursor: pointer; text-align: left;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); text-decoration: none; }
.dropdown-menu .hint { display: block; color: var(--muted); font-size: .76rem; }
.dropdown-menu .i { color: var(--accent-text); }

/* ---------- En-tête de page ---------- */
.page-head { display: flex; gap: 1rem; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: .25rem; font-size: .92rem; }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: .35rem; display: flex; gap: .35rem; align-items: center; }
.crumbs a { color: var(--muted); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem 1.3rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.card-head h2 .i { color: var(--muted); }
.card.flush .card-head { padding: 1rem 1.3rem .9rem; margin: 0; }
.card-head a { font-size: .84rem; font-weight: 500; white-space: nowrap; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 27%, 480px); gap: 1.25rem; align-items: start; }
.mb { margin-bottom: 1rem; }

/* Indicateurs */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.05rem 1.2rem; box-shadow: var(--shadow); display: block; color: inherit; transition: border-color .15s, transform .15s; }
a.stat:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-1px); }
.stat .top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .84rem; font-weight: 500; }
.chip { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.chip.green { background: var(--success-soft); color: var(--success); }
.chip.red { background: var(--danger-soft); color: var(--danger); }
.chip.amber { background: var(--warning-soft); color: var(--warning); }
.chip.violet { background: color-mix(in srgb, var(--st-nouveau) 15%, transparent); color: var(--st-nouveau); }
.chip.blue { background: var(--info-soft); color: var(--info); }
.stat .value { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: .35rem 0 .1rem; }
.stat .hint { font-size: .8rem; color: var(--muted); }
.stat.danger .value { color: var(--danger); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
.card > .table-wrap { margin: 0 -1.3rem -1.15rem; }
.card.flush > .table-wrap { margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 1.3rem; }
th:last-child, td:last-child { padding-right: 1.3rem; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--surface-2); }
tr[data-href] { cursor: pointer; }
th.num, td.num { text-align: right; }

/* ---------- Pastilles / badges ---------- */
.avatar {
  --h: 230;
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: .78rem; letter-spacing: .02em;
  background: hsl(var(--h) 70% var(--avatar-l)); color: hsl(var(--h) 55% var(--avatar-t));
}
.avatar.sm { width: 28px; height: 28px; border-radius: 8px; font-size: .68rem; }
.avatar.lg { width: 58px; height: 58px; border-radius: 16px; font-size: 1.15rem; }
.avatar.round { border-radius: 999px; }
.who { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.who .name { font-weight: 600; color: var(--text); display: block; }
.who .meta { font-size: .8rem; color: var(--muted); display: block; }
a.who:hover { text-decoration: none; }
a.who:hover .name { color: var(--accent-text); }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; line-height: 1.55; }
.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warning-soft); color: var(--warning); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--accent-soft); color: var(--accent-text); }
.badge.violet { background: color-mix(in srgb, var(--st-nouveau) 14%, transparent); color: var(--st-nouveau); }
.badge .i { width: 13px; height: 13px; }
.dot { width: 7px; height: 7px; border-radius: 99px; background: currentColor; display: inline-block; flex: none; }
.stage-badge { background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c); }
.pulse { width: 8px; height: 8px; border-radius: 99px; background: var(--st-nouveau); box-shadow: 0 0 0 0 rgba(139, 92, 246, .6); animation: pulse 2s infinite; display: inline-block; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(139, 92, 246, 0); } 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); } }

/* ---------- Formulaires ---------- */
label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .3rem; color: var(--text-2); }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .55rem .75rem;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea { min-height: 110px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; margin: 0 .5rem 0 0; accent-color: var(--accent); flex: none; }
.field { margin-bottom: .95rem; }
.help { font-size: .78rem; color: var(--muted); margin-top: .25rem; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 1rem; }
.check { display: flex; align-items: center; font-weight: 500; margin-bottom: .55rem; color: var(--text); }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 650; padding: 0 .35rem; }
.section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; margin: .4rem 0 .8rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 600; font-size: .88rem;
  height: 38px; padding: 0 .95rem; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.small { height: 30px; padding: 0 .65rem; font-size: .8rem; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; }
.btn.small.icon { width: 30px; }
.btn.link { border: 0; background: none; color: var(--accent-text); padding: 0; height: auto; font-weight: 500; box-shadow: none; }
button:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ---------- Messages ---------- */
.toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 100; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.toast {
  display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 12px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: toast-in .25s ease-out;
}
.toast .i { margin-top: 1px; }
.toast.success > .i { color: var(--success); }
.toast.error > .i { color: var(--danger); }
.toast.warning > .i { color: var(--warning); }
.toast.info > .i, .toast.call > .i { color: var(--accent); }
.toast.call { border-color: var(--accent); }
.toast .close { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 .1rem; }
.toast.hide { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.callout { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-size: .9rem; }
.callout > .i { margin-top: 1px; }
.callout.info { background: var(--accent-soft); color: var(--accent-text); }
.callout.warning { background: var(--warning-soft); color: var(--warning); }
.callout.error { background: var(--danger-soft); color: var(--danger); }
.callout.success { background: var(--success-soft); color: var(--success); }
.callout a { color: inherit; font-weight: 600; text-decoration: underline; }

.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty > .i { width: 38px; height: 38px; stroke-width: 1.4; color: var(--border-strong); margin-bottom: .5rem; }
.empty strong { display: block; color: var(--text); font-size: .98rem; margin-bottom: .2rem; }
.empty .btn { margin-top: .9rem; }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--border); margin-bottom: 1.1rem; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem .85rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs .n { font-size: .72rem; background: var(--surface-3); color: var(--muted); border-radius: 99px; padding: 0 .45rem; }
.segmented { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented a { padding: .32rem .8rem; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .84rem; display: inline-flex; gap: .35rem; align-items: center; }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented a:hover { text-decoration: none; color: var(--text); }

/* ---------- Fil d'activité ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline li { position: relative; display: flex; gap: .9rem; padding: .6rem 0; }
.t-icon { width: 36px; height: 36px; border-radius: 99px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--muted); border: 3px solid var(--surface); position: relative; z-index: 1; }
.t-icon.mail-in { background: var(--info-soft); color: var(--info); }
.t-icon.mail-out { background: var(--success-soft); color: var(--success); }
.t-icon.call { background: var(--accent-soft); color: var(--accent-text); }
.t-icon.call-missed { background: var(--danger-soft); color: var(--danger); }
.t-icon.lead { background: color-mix(in srgb, var(--st-nouveau) 15%, transparent); color: var(--st-nouveau); }
.t-icon.money { background: var(--warning-soft); color: var(--warning); }
.t-body { flex: 1; min-width: 0; padding-top: .2rem; }
.t-meta { font-size: .78rem; color: var(--muted); display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-bottom: .15rem; }
.t-title { font-weight: 600; }
.t-body details summary { cursor: pointer; font-weight: 600; list-style: none; }
.t-body details summary::-webkit-details-marker { display: none; }
.t-body details summary::after { content: " · lire"; color: var(--muted); font-weight: 400; font-size: .82rem; }
.t-body details[open] summary::after { content: " · réduire"; }
.bubble { margin-top: .45rem; font-size: .9rem; background: var(--surface-2); border: 1px solid var(--border); padding: .7rem .85rem; border-radius: 10px; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
audio { width: 100%; max-width: 360px; height: 34px; margin-top: .4rem; display: block; }

.kv { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: .55rem .75rem; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

/* ---------- Listes ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.list > li:first-child { padding-top: 0; }

/* À faire aujourd'hui */
.todo { display: flex; align-items: center; gap: .85rem; padding: .7rem .8rem; border-radius: 11px; color: var(--text); border: 1px solid var(--border); background: var(--surface-2); margin-bottom: .5rem; }
.todo:hover { text-decoration: none; border-color: var(--border-strong); background: var(--surface); }
.todo .title { font-weight: 600; display: block; }
.todo .desc { font-size: .8rem; color: var(--muted); display: block; }
.todo .go { color: var(--muted); }

/* Guide de démarrage */
.setup { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .6rem; }
.setup-item { display: flex; gap: .6rem; align-items: center; padding: .7rem .8rem; border-radius: 11px; border: 1px dashed var(--border-strong); color: var(--text); font-weight: 500; font-size: .88rem; }
.setup-item:hover { text-decoration: none; border-color: var(--accent); }
.setup-item.done { border-style: solid; background: var(--success-soft); border-color: transparent; color: var(--success); }
.setup-item .tick { width: 22px; height: 22px; border-radius: 99px; border: 2px solid var(--border-strong); display: grid; place-items: center; flex: none; }
.setup-item.done .tick { background: var(--success); border-color: var(--success); color: #fff; }
.setup-item .tick .i { width: 13px; height: 13px; stroke-width: 3; }
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin: .2rem 0 1rem; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: 99px; }

/* ---------- Pipeline ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(255px, 1fr); gap: .8rem; overflow-x: auto; padding-bottom: .75rem; align-items: stretch; } /* colonnes toutes à la hauteur de la plus longue : on peut déposer une carte n'importe où dans la colonne */
.column { background: var(--surface-3); border-radius: var(--radius); padding: .55rem; min-height: 340px; transition: background .15s, box-shadow .15s; }
.column.drop { background: color-mix(in srgb, var(--c) 10%, var(--surface-3)); box-shadow: inset 0 0 0 2px var(--c); }
.col-head { padding: .45rem .5rem .7rem; }
.col-head .row { gap: .5rem; }
.col-head .title { font-weight: 650; font-size: .88rem; }
.col-head .n { font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--surface); border-radius: 99px; padding: 0 .45rem; }
.col-head .total { margin-left: auto; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.col-head .bar { height: 3px; border-radius: 3px; background: var(--c); margin-top: .55rem; }
.deal {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .75rem .8rem;
  margin-bottom: .55rem; cursor: grab; box-shadow: var(--shadow-sm); color: var(--text); transition: box-shadow .15s, transform .15s, border-color .15s;
}
.deal:hover { box-shadow: var(--shadow); border-color: var(--border-strong); text-decoration: none; }
.deal.dragging { opacity: .45; transform: rotate(1.5deg); }
.deal.is-new { border-color: color-mix(in srgb, var(--st-nouveau) 50%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-nouveau) 10%, transparent); }
.deal .t { font-weight: 600; font-size: .9rem; line-height: 1.35; display: flex; gap: .45rem; align-items: center; }
.deal .c { font-size: .8rem; color: var(--muted); margin-top: .35rem; display: flex; gap: .45rem; align-items: center; }
.deal .foot { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; margin-top: .65rem; gap: .5rem; }
.deal .amount { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.deal .date { color: var(--muted); display: inline-flex; gap: .25rem; align-items: center; white-space: nowrap; margin-left: auto; }
.deal .date.late { color: var(--danger); }
.deal .msg { font-size: .8rem; line-height: 1.4; color: var(--text-2); margin-top: .5rem; background: var(--surface-2); border-radius: 8px; padding: .4rem .55rem; }
.deal .msg span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.col-empty { font-size: .8rem; color: var(--muted); text-align: center; padding: 1.4rem .5rem; border: 1.5px dashed var(--border-strong); border-radius: 10px; }

/* Barre d'étapes (fiche opportunité) */
.stepper-wrap { display: flex; gap: .6rem; align-items: stretch; margin-bottom: 1.25rem; }
.stepper { display: flex; gap: 3px; flex: 1; min-width: 0; }
.stepper form { display: contents; }
.stepper button {
  flex: 1; min-width: 0; border: 0; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 600; line-height: 1.25; padding: .55rem .35rem;
  background: var(--surface-3); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: .25rem; text-align: center;
}
.stepper button:first-of-type, .stepper form:first-child button { border-radius: 9px 0 0 9px; }
.stepper form:last-child button { border-radius: 0 9px 9px 0; }
.stepper button .i { width: 13px; height: 13px; flex: none; stroke-width: 3; }
.stepper button.done { background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--c); }
.stepper button.current { background: var(--c); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--c) 35%, transparent); }
.stepper button:hover:not(.current) { filter: brightness(.96); }
.stepper-side { flex: 0 0 auto; }
.stepper-side button { flex: none; padding: .55rem .7rem; border-radius: 9px !important; background: transparent; border: 1px dashed var(--border-strong); }
.stepper-side form + form button { margin-left: 0; }
@media (max-width: 900px) {
  .stepper-wrap { flex-direction: column; }
  .stepper { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .stepper button { flex: none; min-width: 104px; }
  .stepper-side { justify-content: flex-end; }
}

/* ---------- Lignes de devis/facture ---------- */
.lines td { padding: .45rem .35rem; vertical-align: top; border-bottom: 0; }
.lines th { padding: .5rem .35rem; }
.lines td:first-child, .lines th:first-child { padding-left: 0; }
.lines input, .lines select { padding: .45rem .55rem; }
.lines .line-total { padding-top: .8rem; font-weight: 600; }
.totals { margin: 1rem 0 0 auto; max-width: 320px; }
.totals div { display: flex; justify-content: space-between; padding: .25rem 0; color: var(--text-2); }
.totals .grand { font-weight: 700; font-size: 1.08rem; color: var(--text); border-top: 1px solid var(--border); margin-top: .35rem; padding-top: .55rem; }

/* ---------- Fiche client ---------- */
.hero { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.3rem; }
.hero h1 { margin: 0; }
.hero .tags { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; align-items: center; font-size: .86rem; color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; margin-bottom: 1.1rem; }
.quick a, .quick button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; padding: .8rem .5rem; border-radius: 12px; min-height: 74px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font: inherit; font-weight: 600; font-size: .84rem; cursor: pointer; box-shadow: var(--shadow-sm);
}
.quick a:hover, .quick button:hover { border-color: var(--accent); color: var(--accent-text); text-decoration: none; }
.quick .i { color: var(--accent-text); width: 20px; height: 20px; }
.quick form { display: contents; }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent), var(--bg); }
.auth .card { width: 100%; max-width: 410px; padding: 2rem; box-shadow: var(--shadow-lg); }
.auth .brand { color: var(--text); padding: 0 0 1.4rem; font-size: 1.1rem; }

/* ---------- Intégrations ---------- */
.integration { display: flex; gap: 1rem; align-items: flex-start; }
.logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; font-size: .85rem; letter-spacing: -.02em; }
.logo.pl { background: linear-gradient(135deg, #10b981, #047857); }
.logo.io { background: linear-gradient(135deg, #0ea5e9, #1d4ed8); }
.logo.ghl { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.logo.ro { background: linear-gradient(135deg, #22c55e, #15803d); }
.copy { display: flex; gap: .4rem; }
.copy input { font: .8rem ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); }
pre.code { font: .78rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .75rem; overflow-x: auto; margin: .5rem 0; }
.steps { margin: .5rem 0 0; padding-left: 1.2rem; font-size: .88rem; color: var(--text-2); }
.steps li { margin-bottom: .35rem; }
.integration details > summary { cursor: pointer; font-weight: 600; font-size: .86rem; color: var(--accent-text); margin-top: .5rem; }

/* ---------- Mobile ---------- */
.menu-toggle { display: none; }
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; height: 100vh; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .backdrop.open { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .45); }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: .6rem 1rem; }
  .topbar kbd, .hide-mobile { display: none; }
  .main { padding: 1.1rem 1rem 4rem; }
  .grid-2, .split { grid-template-columns: minmax(0, 1fr); }
  .stat .value { font-size: 1.35rem; }
  .kv { grid-template-columns: 95px minmax(0, 1fr); }
  th:first-child, td:first-child { padding-left: 1rem; }
  th:last-child, td:last-child { padding-right: 1rem; }
  .card > .table-wrap { margin: 0 -1.3rem -1.15rem; }
}
@media (max-width: 600px) {
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .stat .value { font-size: 1.4rem; }
  .topbar .btn .lbl { display: none; }
}
.notif-dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: #ef4444; color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }

/* Suivi de bout en bout (vente → enquête → livraison) */
.process { display: flex; align-items: flex-start; gap: 0; margin: .2rem 0 1.25rem; overflow-x: auto; padding-bottom: .25rem; }
.process .step { flex: 1; min-width: 78px; text-align: center; position: relative; font-size: .74rem; color: var(--muted); font-weight: 600; }
.process .step::before { content: ""; position: absolute; top: 11px; left: -50%; right: 50%; height: 3px; background: var(--border); z-index: 0; }
.process .step:first-child::before { display: none; }
.process .node { width: 24px; height: 24px; border-radius: 99px; margin: 0 auto .35rem; display: grid; place-items: center; background: var(--surface-3); border: 2px solid var(--border-strong); position: relative; z-index: 1; color: #fff; }
.process .node .i { width: 13px; height: 13px; stroke-width: 3; }
.process .step.done { color: var(--text-2); }
.process .step.done .node { background: var(--success); border-color: var(--success); }
.process .step.done::before, .process .step.current::before { background: var(--success); }
.process .step.current { color: var(--accent-text); }
.process .step.current .node { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.process.lost .step.current .node { background: var(--danger); border-color: var(--danger); }
.process .phase { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* Fichiers et dépôt */
.file-row { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.file-row:last-child { border-bottom: 0; }
.file-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--muted); font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.file-ico.rapport { background: var(--success-soft); color: var(--success); }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 1.3rem; text-align: center; background: var(--surface-2); transition: border-color .15s, background .15s; position: relative; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .i { width: 28px; height: 28px; color: var(--accent-text); }
.dropzone .picked { font-size: .84rem; color: var(--text); margin-top: .4rem; font-weight: 600; }

/* Messages d'un dossier */
.chat { display: flex; flex-direction: column; gap: .6rem; max-height: 460px; overflow-y: auto; padding: .2rem; }
.msg-item { max-width: 85%; }
.msg-item .b { background: var(--surface-3); padding: .6rem .8rem; border-radius: 12px 12px 12px 4px; white-space: pre-wrap; word-break: break-word; font-size: .9rem; }
.msg-item.me { align-self: flex-end; }
.msg-item.me .b { background: var(--accent-soft); color: var(--text); border-radius: 12px 12px 4px 12px; }
.msg-item .m { font-size: .72rem; color: var(--muted); margin: .2rem .3rem 0; }
.msg-item.me .m { text-align: right; }
.case-card { display: block; color: var(--text); }
.case-card:hover { text-decoration: none; border-color: var(--border-strong); }
.case-card.late { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 8%, transparent); }
.case-card.calme { opacity: .82; }
.case-next { display: flex; align-items: center; gap: .4rem; margin-top: .75rem; font-size: .84rem; font-weight: 600; color: var(--accent-text); }
.case-card.late .case-next { color: var(--danger); }
.case-card.calme .case-next { color: var(--success); }
.espace-resume { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.er-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; display: flex; align-items: center; gap: .7rem; font-size: .86rem; color: var(--text-2); }
.er-n { font-size: 1.5rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.er-n.er-txt { font-size: 1.15rem; }
.er-item.bad { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.er-item.bad .er-n { color: var(--danger); }
.espace-nouvelle { margin-top: 1rem; }
@media (max-width: 600px) {
  .reach-card .row > .grow { flex: 1 1 calc(100% - 3.5rem); min-width: 0; }
  .reach-card .row > form { margin-left: auto; }
}
@media (max-width: 700px) { .espace-resume { gap: .45rem; } .er-item { flex-direction: column; align-items: flex-start; gap: .1rem; padding: .55rem .7rem; font-size: .74rem; line-height: 1.25; } .er-n { font-size: 1.25rem; } .er-n.er-txt { font-size: 1.05rem; } }
.notif-line { display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.notif-line .notif { flex: 1; border-bottom: 0; }
.notif-line form { padding-right: .6rem; }
.back-btn { flex-shrink: 0; }
.notif { display: flex; gap: .75rem; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif.unread { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.notif.unread .text { font-weight: 600; }

/* ---------- Page de connexion : thème néon cyan du logo CONAN (toujours sombre) ---------- */
.auth-page { background: #0b0f13; }
.auth.neon {
  --n-cyan: #22d3ee; --n-cyan-soft: rgba(34, 211, 238, .14); --n-text: #e6f7fb; --n-muted: #8aa4ad; --n-line: rgba(34, 211, 238, .28);
  color-scheme: dark; color: var(--n-text);
  background:
    radial-gradient(700px 420px at 50% 32%, rgba(34, 211, 238, .12), transparent 70%),
    linear-gradient(135deg, transparent 0 62%, rgba(34, 211, 238, .06) 62% 62.3%, transparent 62.3%),
    linear-gradient(35deg, transparent 0 22%, rgba(34, 211, 238, .05) 22% 22.25%, transparent 22.25%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #161c22, #0b0f13);
}
.auth.neon .card {
  background: rgba(10, 16, 22, .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--n-line); border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, .06), 0 0 38px rgba(34, 211, 238, .16), 0 24px 60px rgba(0, 0, 0, .55);
}
.neon-brand { text-align: center; margin-bottom: 1.4rem; }
.neon-emblem { display: block; margin: -.2rem auto .8rem; border-radius: 50%; box-shadow: 0 0 34px rgba(34, 211, 238, .45); }
.neon-name { font-size: 1.9rem; font-weight: 800; letter-spacing: .22em; color: var(--n-cyan); text-shadow: 0 0 12px rgba(34, 211, 238, .75), 0 0 28px rgba(34, 211, 238, .35); line-height: 1.1; }
.neon-sub { font-size: .8rem; color: var(--n-muted); margin-top: .35rem; }
.auth.neon h1 { color: var(--n-text); }
.auth.neon .muted { color: var(--n-muted); }
.auth.neon label { color: #b9d6dd; }
.auth.neon input {
  background: #0d151c; color: var(--n-text); border: 1px solid rgba(34, 211, 238, .22);
}
.auth.neon input::placeholder { color: #55707a; }
.auth.neon input:focus { border-color: var(--n-cyan); box-shadow: 0 0 0 3px var(--n-cyan-soft), 0 0 14px rgba(34, 211, 238, .25); outline: none; }
.auth.neon .help { color: var(--n-muted); }
.auth.neon .btn.primary {
  background: linear-gradient(180deg, #3ee0f5, #13b8d4); color: #04232a; border: 0; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 0 18px rgba(34, 211, 238, .45);
}
.auth.neon .btn.primary:hover { background: linear-gradient(180deg, #5fe8f8, #1ec7e2); box-shadow: 0 0 26px rgba(34, 211, 238, .6); }
.auth.neon .callout.error { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .45); color: #fecaca; }
.auth.neon .neon-check { color: #b9d6dd; font-size: .88rem; }
.auth.neon .neon-check input { accent-color: #22d3ee; }

/* ---------- Téléphone Ringover intégré ---------- */
.phone-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 10000; display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.1rem; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 700;
  background: #16a34a; color: #fff; box-shadow: 0 8px 24px rgba(22, 163, 74, .35);
}
.phone-fab .i { width: 20px; height: 20px; }
.phone-fab:hover { background: #15803d; }
.phone-fab.open { background: #0f172a; box-shadow: 0 8px 24px rgba(15, 23, 42, .3); }
.phone-fab.ringing { background: #16a34a; animation: phone-ring 1s ease-in-out infinite; }
.phone-fab.in-call { background: #dc2626; box-shadow: 0 8px 24px rgba(220, 38, 38, .35); }
@keyframes phone-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(5deg); } }
.phone-panel {
  position: fixed; right: 20px; bottom: 80px; z-index: 10000; width: 360px; height: min(600px, calc(100vh - 110px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.phone-panel[hidden] { display: flex; visibility: hidden; pointer-events: none; }
.phone-head { display: flex; align-items: center; gap: .5rem; padding: .55rem .6rem .55rem .9rem; border-bottom: 1px solid var(--border); font-weight: 700; font-size: .9rem; }
.phone-head .muted { font-weight: 500; }
.phone-min { display: inline-flex; align-items: center; gap: .25rem; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: .3rem .6rem; cursor: pointer; font: inherit; font-size: .8rem; }
.phone-body { flex: 1; min-height: 0; position: relative; }
.phone-body iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 520px) { .phone-panel { right: 8px; left: 8px; width: auto; } .phone-fab span { display: none; } .phone-fab { padding: .8rem; } }

/* Bandeau « Activer micro, son et notifications » */
.perms-banner { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.perms-pill { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid color-mix(in srgb, #16a34a 40%, var(--border)); background: color-mix(in srgb, #16a34a 9%, var(--surface));
  color: #15803d; font: inherit; font-size: .8rem; font-weight: 600; padding: .35rem .7rem; border-radius: 99px; cursor: pointer; white-space: nowrap; }
.perms-pill .i { width: 15px; height: 15px; }
.perms-pill:hover { filter: brightness(.97); }
.perms-banner.denied .perms-pill { border-color: color-mix(in srgb, #f59e0b 45%, var(--border)); background: color-mix(in srgb, #f59e0b 12%, var(--surface)); color: #b45309; }
.perms-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .8rem; padding: .3rem .35rem; border-radius: 6px; }
.perms-x:hover { background: var(--surface-3); }
@media (max-width: 600px) { .perms-pill span { display: none; } .perms-pill { padding: .4rem; } .perms-x { display: none; } }
.deal .received { display: flex; align-items: center; gap: .3rem; font-size: .75rem; color: var(--muted); margin: .35rem 0 0; }

/* Page « Installer l'application » */
.install-hero { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.install-hero img { border-radius: 16px; }
.install-card.mine { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.install-card.mine .card-head h2::after { content: "Votre appareil"; margin-left: .5rem; font-size: .7rem; font-weight: 600; padding: .15rem .5rem; border-radius: 99px; background: var(--accent); color: #fff; vertical-align: middle; }
.os-ico { margin-right: .2rem; }
.install-hero[hidden], .callout[hidden] { display: none; }

/* Sécurité du compte */
.qr-box { display: inline-block; background: #fff; padding: .6rem; border-radius: 12px; border: 1px solid var(--border); margin: .3rem 0 .6rem; }
.qr-box svg { display: block; width: 200px; height: 200px; }
.secret-key { font-size: .95rem; letter-spacing: .08em; user-select: all; }

/* ================================================================
   Compatibilité et adaptation à tous les écrans
   (téléphones, tablettes, ordinateurs, iPhone installé, anciens navigateurs)
   ================================================================ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-wrap: anywhere; -webkit-tap-highlight-color: transparent; }
img, svg, video, iframe { max-width: 100%; }
td, th { overflow-wrap: normal; }

/* Hauteur réelle de l'écran sur mobile (barre d'adresse qui apparaît / disparaît) */
@supports (height: 100dvh) {
  .app, .auth { min-height: 100dvh; }
  .sidebar { height: 100dvh; }
  .phone-panel { height: min(600px, calc(100dvh - 110px)); }
}

/* iPhone installé (encoche, barre d'accueil) */
.topbar { padding-top: max(.7rem, env(safe-area-inset-top)); padding-left: max(2rem, env(safe-area-inset-left)); padding-right: max(2rem, env(safe-area-inset-right)); }
.sidebar { padding-top: max(1.1rem, env(safe-area-inset-top)); padding-bottom: max(1.1rem, env(safe-area-inset-bottom)); }
.main { padding-bottom: calc(4rem + env(safe-area-inset-bottom)); }
.phone-fab { bottom: calc(20px + env(safe-area-inset-bottom)); right: calc(20px + env(safe-area-inset-right)); }
.phone-panel { bottom: calc(80px + env(safe-area-inset-bottom)); }
.toasts { bottom: calc(76px + env(safe-area-inset-bottom)); } /* au-dessus du bouton Téléphone */
.auth { padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); }

/* Écrans tactiles : cibles assez grandes pour le doigt, pas de zoom automatique de l'iPhone sur les champs (16 px minimum) */
@media (pointer: coarse), (max-width: 900px) {
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 42px; }
  .btn.small { min-height: 36px; }
  .btn.icon { min-width: 42px; }
  .nav a { padding-top: .6rem; padding-bottom: .6rem; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
}

@media (max-width: 900px) {
  .topbar { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); gap: .4rem; }
  .topbar .search { flex: 1; min-width: 0; }
  .page-head { flex-wrap: wrap; gap: .75rem; }
  .page-head .actions, .hero .actions { width: 100%; }
  /* Pipeline : une colonne par écran, on glisse de colonne en colonne */
  .board { grid-auto-columns: minmax(82vw, 1fr); scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .board > * { scroll-snap-align: start; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .topbar .search + .spacer { display: none; } /* la recherche prend toute la place libre */
}
/* Téléphone : la recherche passe sur sa propre ligne, en pleine largeur, sous les boutons */
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; row-gap: .5rem; }
  .topbar .search { order: 10; flex: 1 1 100%; max-width: none; }
  .topbar .search + .spacer { display: block; flex: 1; }
}
@media (max-width: 480px) {
  .main { padding-left: max(.8rem, env(safe-area-inset-left)); padding-right: max(.8rem, env(safe-area-inset-right)); }
  .card { padding-left: 1rem; padding-right: 1rem; }
  .card > .table-wrap { margin-left: -1rem; margin-right: -1rem; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .inline-form > * { flex: 1 1 100%; }
  .inline-form > .btn { flex: 1 1 auto; }
  h1 { font-size: 1.4rem; }
  .qr-box svg { width: 180px; height: 180px; }
}

/* Animations réduites (réglage d'accessibilité du téléphone / de l'ordinateur) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Anciens navigateurs sans color-mix() (Safari avant 16.2, Chrome avant 111) : couleurs de remplacement */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .topbar { background: var(--bg); }
  .stage-badge { background: var(--surface-3); }
  .chip.violet, .badge.violet, .t-icon.lead { background: rgba(139, 92, 246, .15); }
  input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(99, 102, 241, .25); }
  input::placeholder, textarea::placeholder { color: var(--muted); }
  .deal.is-new { border-color: rgba(139, 92, 246, .5); box-shadow: 0 0 0 3px rgba(139, 92, 246, .12); }
  .column.drop { background: var(--surface-3); }
  .stepper button.done { background: var(--surface-2); }
  .process .step.current .node { box-shadow: 0 0 0 4px rgba(99, 102, 241, .22); }
  .notif.unread { background: var(--accent-soft); }
  .perms-pill { background: rgba(22, 163, 74, .1); border-color: rgba(22, 163, 74, .4); }
  .perms-banner.denied .perms-pill { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .45); }
  .install-card.mine { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
  .auth:not(.neon) { background: var(--bg); }
  .brand-banner img { box-shadow: none; }
}

/* Impression (fiche client, dossier, rapport…) : uniquement le contenu */
@media print {
  .sidebar, .topbar, .backdrop, .toasts, .phone-fab, .phone-panel, .perms-banner, .btn, form button, .stepper, .dropzone { display: none !important; }
  .app { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* Recherche dans le pipeline */
.pipeline-search { position: relative; display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.pipeline-search > .i { position: absolute; left: .8rem; color: var(--muted); pointer-events: none; }
.pipeline-search input { padding-left: 2.4rem; max-width: 520px; }
.deal[hidden] { display: none !important; }

/* Fiches trouvées par la recherche du pipeline */
.search-results-panel { margin-bottom: 1rem; }
.result-row { display: flex; align-items: center; gap: .75rem; padding: .6rem 0 .6rem .75rem; border-top: 1px solid var(--border); border-left: 3px solid var(--c); }
.result-main { display: flex; flex-direction: column; min-width: 0; color: var(--text); }
.result-main:hover { text-decoration: none; }
.result-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-stage select { width: auto; min-width: 210px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 600px) {
  .result-row { flex-wrap: wrap; }
  .result-stage, .result-stage select { width: 100%; min-width: 0; }
}
#pipeline-search-count { white-space: nowrap; }
@media (max-width: 600px) { #pipeline-search-count { display: none; } }

/* Téléphone en mode fenêtre */
.phone-fab .i-sm, .phone-fab svg:last-child:not(:first-child) { width: 14px; height: 14px; opacity: .8; }
.phone-back { position: fixed; right: calc(20px + env(safe-area-inset-right)); bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 10000;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 99px; padding: .25rem .7rem; font: inherit; font-size: .75rem; cursor: pointer; box-shadow: var(--shadow); }

/* Montant du préjudice */
.prejudice-form { flex-wrap: nowrap; gap: .35rem; }
.prejudice-form input { max-width: 130px; padding: .35rem .55rem; }
.deal .prejudice-line { font-size: .75rem; color: var(--text-2); margin-top: .3rem; }

/* Pipeline : recherche à droite, colonnes réparties selon la largeur de l'écran */
.pipeline-head { align-items: flex-start; }
.pipeline-tools { display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; margin-left: auto; }
.pipeline-head .pipeline-search { margin: 0; width: min(380px, 100%); }
.pipeline-head .pipeline-search input { max-width: none; }
.pipeline-head #pipeline-search-count { position: absolute; right: .8rem; pointer-events: none; }
.pipeline-head .pipeline-search input { padding-right: 6.5rem; }
/* Une seule ligne : les colonnes s'élargissent pour remplir l'écran quand il est assez grand, sinon on fait défiler */
@media (min-width: 901px) { .board { grid-auto-columns: minmax(225px, 1fr); } }
.main.wide { max-width: none; }
.board .column { min-width: 0; }
.board .col-head .row { flex-wrap: wrap; row-gap: .15rem; }
@media (max-width: 900px) {
  .pipeline-tools { width: 100%; align-items: stretch; margin-left: 0; }
  .pipeline-head .pipeline-search { width: 100%; }
}

/* Clients injoignables */
.reach-card { padding-top: .9rem; padding-bottom: .9rem; }
.reach-card.unreachable { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.deal .nrp-line { display: flex; align-items: center; gap: .25rem; font-size: .72rem; font-weight: 600; color: var(--danger); margin-top: .3rem; }
@supports not (color: color-mix(in srgb, red 50%, blue)) { .reach-card.unreachable { border-color: var(--danger); } }

/* Agenda */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.day { background: var(--surface-3); border-radius: var(--radius); padding: .6rem; min-height: 160px; }
.day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.day.weekend { opacity: .7; }
.day-head { font-size: .85rem; margin-bottom: .5rem; text-transform: capitalize; }
.day-empty { margin: .2rem 0; }
.rdv { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; padding: .5rem .6rem; margin-bottom: .45rem; display: flex; flex-direction: column; gap: .3rem; }
.rdv.done { opacity: .55; border-left-color: var(--success); }
.rdv.late { border-left-color: var(--danger); }
.rdv-time { font-weight: 700; font-size: .85rem; }
.rdv-main { display: flex; flex-direction: column; color: var(--text); min-width: 0; }
.rdv-main:hover { text-decoration: none; }
.rdv-main strong { font-size: .82rem; overflow-wrap: anywhere; }
.rdv-actions { display: flex; gap: .3rem; flex-wrap: wrap; }
.i.flip { transform: rotate(180deg); }
@media (max-width: 1200px) { .week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .week { grid-template-columns: minmax(0, 1fr); } .day { min-height: 0; } .day.weekend { display: none; } }
/* Accueil : semaine */
.week-list .wl-day { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .7rem 0 .3rem; }
.week-list .wl-item { display: flex; gap: .6rem; align-items: center; padding: .35rem 0; color: var(--text); }
.week-list .wl-item:hover { text-decoration: none; }
.week-list .wl-time { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3.2rem; }

/* Mises en demeure : aperçu papier de la lettre */
.med-paper { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.4rem 1.5rem; font-family: "Times New Roman", Times, serif; font-size: 1rem; line-height: 1.5; }
.med-head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.med-dest { text-align: right; margin-left: auto; }
.med-paper input, .med-paper textarea { font-family: inherit; font-size: inherit; line-height: inherit; }
.med-body { min-height: 28rem; }

/* ---------- Mails : boîte façon messagerie (dossiers | liste | lecture) ---------- */
.mailbox { display: grid; grid-template-columns: 200px minmax(260px, 340px) minmax(0, 1fr); height: calc(100vh - 190px); min-height: 480px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mailbox > * { min-width: 0; overflow-y: auto; }
.mb-dossiers { background: var(--surface-2); border-right: 1px solid var(--border); padding: .5rem; display: flex; flex-direction: column; gap: 2px; }
.mb-dossiers a { display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem; border-radius: 8px; color: var(--text-2); font-size: .88rem; }
.mb-dossiers a:hover { background: var(--surface-3); text-decoration: none; }
.mb-dossiers a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.mb-count { font-size: .72rem; font-weight: 700; background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 0 .45rem; }
.mb-count.bad { background: var(--danger-soft); color: var(--danger); }
.mb-liste { border-right: 1px solid var(--border); }
.mb-recherche { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: .4rem; padding: .5rem .6rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.mb-recherche > .i { color: var(--muted); flex: none; }
.mb-recherche input { height: 32px; font-size: .85rem; border-radius: 8px; }
.mb-info { font-size: .78rem; color: var(--muted); padding: .35rem .8rem; border-bottom: 1px solid var(--border); }
.mb-ligne { display: block; position: relative; padding: .5rem .8rem .5rem 1.1rem; border-bottom: 1px solid var(--border); color: var(--text); font-size: .84rem; line-height: 1.3; }
.mb-ligne:hover { background: var(--surface-2); text-decoration: none; }
.mb-ligne.active { background: var(--accent-soft); }
.mb-ligne.non-lu::before { content: ""; position: absolute; left: .35rem; top: .8rem; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mb-ligne.non-lu { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.mb-l1 { display: flex; gap: .5rem; align-items: baseline; }
.mb-qui { flex: 1; color: var(--text-2); }
.mb-date { flex: none; font-size: .74rem; color: var(--muted); }
.mb-l2 { display: block; margin-top: 1px; }
.mb-l2 strong { font-weight: 500; }
.mb-ligne.non-lu .mb-qui, .mb-ligne.non-lu .mb-l2 strong, .mb-ligne.non-lu .mb-date { font-weight: 700; color: var(--text); }
.mb-tag { display: inline-block; margin-top: 3px; font-size: .68rem; padding: 0 .4rem; border-radius: 5px; background: var(--surface-3); color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-tag.bad { background: var(--danger-soft); color: var(--danger); }
.mb-pages { display: flex; justify-content: space-between; padding: .6rem; }
.mb-lecture { padding: 1.1rem 1.4rem 2rem; }
.mb-retour { display: none; }
.mb-sujet { font-size: 1.15rem; margin: 0 0 .8rem; }
.mb-entete { display: flex; gap: .7rem; align-items: center; padding-bottom: .8rem; border-bottom: 1px solid var(--border); }
.mb-classer { display: flex; flex-wrap: wrap; gap: .5rem; padding: .7rem .8rem; margin-top: .8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.mb-corps { margin: 1rem 0 1.2rem; font-size: .9rem; line-height: 1.55; }
.mb-repondre > summary { list-style: none; display: inline-flex; }
.mb-repondre > summary::-webkit-details-marker { display: none; }
.mb-repondre[open] > summary { display: none; }
.mb-compose { margin-top: .6rem; }
.mb-compose textarea { font-family: inherit; }
.mb-vide { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
@media (max-width: 900px) {
  .mailbox { grid-template-columns: 1fr; height: auto; min-height: 0; overflow: visible; }
  .mailbox > * { overflow: visible; }
  .mb-dossiers { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .mb-dossiers a { white-space: nowrap; }
  .mb-lecture { display: none; }
  .mailbox.lecture .mb-dossiers, .mailbox.lecture .mb-liste { display: none; }
  .mailbox.lecture .mb-lecture { display: block; }
  .mb-retour { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .6rem; font-size: .85rem; }
}

.mb-clip { flex: none; color: var(--muted); display: inline-flex; }
.mb-pieces { margin: 0 0 1.2rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.mb-piece { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; border-top: 1px solid var(--border); font-size: .86rem; }
.mb-piece:first-of-type { border-top: 0; }

.mb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.mb-cadre { display: block; width: 100%; height: 420px; border: 0; margin: 1rem 0 1.2rem; background: #fff; border-radius: 6px; }
.mb-images { margin-top: .8rem; padding: .45rem .7rem; font-size: .82rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.mb-compose-cadre { margin: .9rem 0 .4rem; padding: .8rem .9rem; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); }

/* Lecture façon webmail IONOS : objet en grand, ligne expéditeur, icônes d'action, pièces jointes en vignettes */
.mb-lecture { padding: 1.4rem 1.8rem 2.4rem; }
.mb-sujet { font-size: 1.35rem; font-weight: 600; line-height: 1.3; margin: 0 0 1.1rem; color: var(--text); }
.mb-entete { display: flex; flex-wrap: wrap; gap: .6rem .85rem; align-items: flex-start; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.mb-exp { flex: 1 1 220px; }
.mb-avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .92rem;
  color: #fff; background: linear-gradient(135deg, #1e5bb8, #0b2a63); }
.mb-exp { min-width: 0; }
.mb-exp-l1 { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-exp-l1 .muted { font-size: .85rem; }
.mb-exp-l2 { font-size: .82rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-client { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; padding: 1px .5rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); margin-top: 3px; }
.mb-client.inconnu { background: var(--danger-soft); color: var(--danger); }
.mb-droite { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .45rem; }
.mb-date-longue { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.mb-icones { display: flex; gap: 2px; }
.mb-icones form { display: inline; margin: 0; }
.mb-ico { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.mb-ico:hover { background: var(--surface-3); color: var(--accent); text-decoration: none; }
.mb-ico.danger:hover { color: var(--danger); background: var(--danger-soft); }
.mb-pj { margin-top: 1rem; }
.mb-pj-titre { font-size: .8rem; color: var(--muted); margin-bottom: .45rem; display: flex; align-items: center; gap: .3rem; }
.mb-pj-liste { display: flex; flex-wrap: wrap; gap: .5rem; }
.mb-pj-carte { display: flex; align-items: center; gap: .2rem; max-width: 260px; padding: .35rem .35rem .35rem .45rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.mb-pj-carte:hover { border-color: var(--border-strong); box-shadow: 0 1px 4px rgba(15, 23, 42, .06); }
.mb-pj-ouvrir { display: flex; align-items: center; gap: .55rem; min-width: 0; color: var(--text); }
.mb-pj-ouvrir:hover { text-decoration: none; }
.mb-pj-ext { flex: none; width: 38px; height: 38px; border-radius: 7px; display: grid; place-items: center; font-size: .62rem; font-weight: 800; color: #fff; background: #1e5bb8; }
.mb-pj-nom { display: flex; flex-direction: column; min-width: 0; font-size: .84rem; line-height: 1.25; }
.mb-bas { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

@media (max-width: 1350px) and (min-width: 901px) {
  .mailbox { grid-template-columns: 185px minmax(240px, 290px) minmax(0, 1fr); }
  .mb-lecture { padding: 1.2rem 1.2rem 2rem; }
}
.mb-dossiers a .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Éditeur de rapport d'enquête (views/rapport/editeur.ejs, public/rapport.js) ---------- */
.rz { max-width: 980px; margin: 0 auto; }
.rz-head { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.rz-head h1 { margin: 0 0 .2rem; }
.rz-actions { display: flex; gap: .6rem; align-items: center; }
.rz-etat { font-size: .8rem; color: var(--muted); }
.rz-etat.ok { color: var(--success); }
.rz-etat.erreur { color: var(--danger); font-weight: 600; }
.rz-etapes { position: sticky; top: 0; z-index: 5; display: flex; gap: .4rem; overflow-x: auto; padding: .6rem 0; margin-bottom: .6rem; background: var(--bg); }
.rz-etapes a { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .8rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .85rem; font-weight: 600; white-space: nowrap; }
.rz-etapes a:hover { text-decoration: none; color: var(--text); border-color: var(--border-strong); }
.rz-etapes .n { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--surface-3); font-size: .75rem; }
.rz-etapes a.fait { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, var(--border)); }
.rz-etapes a.fait .n { background: var(--success); color: #fff; }
.rz-etape { scroll-margin-top: 4rem; margin-bottom: 1.1rem; }
.rz-titre { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: 1rem; }
.rz-titre h2 { margin: 0 0 .15rem; }
.rz-titre p { margin: 0; }
.rz-num { flex: none; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.rz-infos { display: flex; gap: 1.6rem; flex-wrap: wrap; padding: .7rem .9rem; margin-bottom: 1rem; border-radius: 10px; background: var(--surface-2); }
.rz-infos div { display: flex; flex-direction: column; gap: .1rem; }
.rz-message { margin-top: .4rem; padding: .8rem .9rem; border-radius: 10px; background: var(--surface-2); }
.rz-citation { margin-top: .5rem; padding-left: .8rem; border-left: 3px solid var(--accent); font-style: italic; white-space: pre-wrap; font-size: .9rem; color: var(--muted); max-height: 14rem; overflow: auto; }
.rz-partie { border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.1rem; margin-bottom: 1rem; background: var(--surface); scroll-margin-top: 4rem; }
.rz-partie:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: 0 0 0 3px var(--accent-soft); }
.rz-partie-tete { display: flex; align-items: center; gap: .6rem; margin-bottom: .35rem; }
.rz-partie-tete .badge { margin-left: .4rem; font-size: .7rem; }
.rz-ico { font-size: 1.35rem; line-height: 1; }
.rz-conseil { margin: 0 0 .8rem; font-size: .82rem; color: var(--muted); }
.rz-constat { margin-top: .2rem; }
.rz-details { margin: .3rem 0 .8rem; }
.rz-details summary { cursor: pointer; font-weight: 600; font-size: .88rem; margin-bottom: .4rem; }
.rz-captures { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; margin: .4rem 0 .6rem; }
.rz-captures:empty { display: none; }
.rz-capture { position: relative; margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.rz-capture img { display: block; width: 100%; height: 120px; object-fit: cover; object-position: top; }
.rz-capture input { width: 100%; border: 0; border-top: 1px solid var(--border); border-radius: 0; font-size: .8rem; padding: .45rem .55rem; background: var(--surface); }
.rz-fichier { height: 120px; display: grid; place-items: center; text-align: center; padding: .5rem; font-size: .82rem; word-break: break-all; }
.rz-x { position: absolute; top: .3rem; right: .3rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; font-size: .75rem; }
td > .rz-x { position: static; background: var(--surface-3); color: var(--muted); }
.rz-depot { display: block; border: 2px dashed var(--border-strong); border-radius: 12px; padding: .9rem; text-align: center; font-size: .88rem; color: var(--muted); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.rz-depot:hover, .rz-depot.survol { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.rz-depot input { display: none; }
.rz-existantes { margin-top: .5rem; }
.rz-existantes select { font-size: .85rem; max-width: 100%; }
.rz-flux { overflow-x: auto; margin-bottom: .8rem; }
.rz-flux table { width: 100%; border-collapse: collapse; margin-bottom: .5rem; }
.rz-flux th { text-align: left; font-size: .75rem; color: var(--muted); font-weight: 600; padding: 0 .3rem .3rem; }
.rz-flux td { padding: .15rem .2rem; }
.rz-flux input { width: 100%; min-width: 90px; font-size: .85rem; }
.rz-vide { padding: 1.6rem; text-align: center; color: var(--muted); border: 2px dashed var(--border); border-radius: 14px; margin-bottom: 1rem; }
.rz-ajout { margin-top: .3rem; }
.rz-catalogue { margin-top: .9rem; padding: 1rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.rz-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; }
.rz-tuile { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; text-align: left; padding: .8rem .9rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; transition: border-color .15s, transform .15s; }
.rz-tuile:hover { border-color: var(--accent); transform: translateY(-1px); }
.rz-conclusion { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.rz-choix-ligne { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.rz-choix input { position: absolute; opacity: 0; pointer-events: none; }
.rz-choix span { display: inline-block; padding: .4rem .85rem; border-radius: 99px; border: 1px solid var(--border-strong); font-size: .88rem; font-weight: 600; cursor: pointer; }
.rz-choix input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.rz-choix input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.rz-controle { margin: 1rem 0; padding: .8rem 1rem; border-radius: 12px; background: var(--surface-2); }
.rz-controle ul { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .25rem .8rem; }
.rz-controle a { color: var(--muted); font-size: .88rem; }
.rz-controle li.ok a { color: var(--success); }
.rz-envoi { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding-top: .4rem; }
.rz-envoi form { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }
.rz-note { flex: 1; min-width: 200px; max-width: 320px; }
@media (max-width: 720px) {
  .rz-actions { width: 100%; justify-content: space-between; }
  .rz-envoi form { justify-content: stretch; }
  .rz-envoi .btn { flex: 1; justify-content: center; }
}
.rz .form-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.callout .btn, .callout .btn:hover { text-decoration: none; }
.case-card .case-lien { display: block; color: var(--text); }
.case-card .case-lien:hover { text-decoration: none; }
.case-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.hero .actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* ---------- Centre d'aide (bouton « ? » de la barre du haut, page /aide) ---------- */
.aide-rond { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; border: 2px solid currentColor; font-weight: 800; font-size: .85rem; line-height: 1; }
.aide-menu > summary { list-style: none; }
.aide-menu > summary::-webkit-details-marker { display: none; }
.aide-panel { width: min(420px, calc(100vw - 2rem)); right: 0; left: auto; padding: .9rem; max-height: min(640px, 80vh); overflow: auto; }
.aide-tete { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .6rem; }
.aide-panel input[type=search] { width: 100%; margin-bottom: .6rem; }
.aide-sous { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: .2rem 0 .4rem; }
.aide-q { border: 1px solid var(--border); border-radius: 10px; margin-bottom: .45rem; background: var(--surface); }
.aide-q > summary { cursor: pointer; padding: .55rem .75rem; font-weight: 600; font-size: .9rem; }
.aide-q[open] > summary { color: var(--accent-text); }
.aide-r { padding: 0 .75rem .7rem; font-size: .88rem; }
.aide-r p { margin: 0 0 .55rem; line-height: 1.5; }
.aide-r kbd { border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 .3rem; font-size: .8rem; }
.aide-pied { border-top: 1px solid var(--border); margin-top: .6rem; padding-top: .6rem; font-size: .85rem; }
#aide-page-q { width: 100%; font-size: 1rem; }
.aide-panel .aide-tete strong { white-space: nowrap; font-size: 1rem; }
.aide-panel a { display: inline; padding: 0; background: none; font-weight: 500; }
.aide-panel .aide-r a.btn { display: inline-flex; padding: .3rem .7rem; }
.aide-panel a:hover { background: none; text-decoration: underline; }
.aide-panel .aide-r a.btn:hover { text-decoration: none; background: var(--surface-3); }
.aide-panel .aide-tete { display: flex; justify-content: space-between; gap: .75rem; width: 100%; }
.rz-capture img { object-fit: contain; object-position: center; background: var(--surface-3); }
.rz-ordre { position: absolute; top: .3rem; left: .3rem; min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem; border-radius: 99px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.rz-deplacer { position: absolute; top: 88px; right: .3rem; display: flex; gap: .2rem; }
.rz-deplacer button { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; font-size: .8rem; }
.rz-deplacer button:disabled { opacity: .3; cursor: default; }
.rz-annexes { margin: 1rem 0; padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--border); }
.rz-annexes-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; font-size: .88rem; }
.rz-num-annexe { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; border-radius: 99px; background: var(--surface-3); font-size: .72rem; font-weight: 700; margin-right: .3rem; }
/* Téléphone : le panneau d'aide occupe toute la largeur sous la barre du haut (sinon il déborde à gauche) */
@media (max-width: 720px) {
  .aide-panel { position: fixed; top: 3.6rem; left: .6rem; right: .6rem; width: auto; max-height: calc(100dvh - 4.4rem); }
}
.aide-panel .aide-tete { align-items: center; }
.aide-panel .aide-tete a { margin-left: auto; }
.aide-fermer { flex: none; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: .9rem; cursor: pointer; }
.aide-fermer:hover { background: var(--surface-3); }
.aide-panel .aide-tete a { flex: none; white-space: nowrap; width: auto; }
.aide-panel button.aide-fermer { flex: none; width: 2rem; height: 2rem; padding: 0; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-2); text-align: center; }
.aide-panel button.aide-fermer:hover { background: var(--surface-3); }

/* Relances : tuiles-onglets et cartes clients */
a.stat.relance-onglet { color: inherit; text-decoration: none; border: 1px solid var(--border); transition: border-color .15s, box-shadow .15s; }
a.stat.relance-onglet:hover { border-color: var(--accent); }
a.stat.relance-onglet.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.relance-card.a-relancer { border-left: 4px solid var(--warning, #f59e0b); }
.relance-actions { gap: .5rem; margin: .2rem 0 .7rem; }
.relance-actions form { margin: 0; }
.relance-mail > summary { list-style: none; display: inline-flex; cursor: pointer; }
.relance-mail > summary::-webkit-details-marker { display: none; }
.relance-mail[open] > summary { opacity: .75; }
.relance-card .relance-mail { display: inline-block; vertical-align: top; margin-right: .5rem; }
.relance-card .relance-mail[open] { display: block; margin-top: .5rem; }

/* ---------- Accueil (revu le 08/10/2026) : bandeau de chiffres, « À faire » groupé ---------- */
.kpi-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.25rem; overflow: hidden; }
.kpi { display: flex; flex-direction: column; gap: .2rem; padding: .95rem 1.2rem 1rem; color: inherit; transition: background-color .15s; }
.kpi + .kpi { border-left: 1px solid var(--border); }
.kpi:hover { text-decoration: none; background: var(--surface-2); }
.kpi:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.kpi-label { display: flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.kpi-label .i { width: 15px; height: 15px; }
.kpi-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-value.ok { color: var(--success); }
.kpi.danger .kpi-value, .kpi.danger .kpi-label { color: var(--danger); }
.kpi-hint { font-size: .78rem; color: var(--muted); }

.todo-card .card-head { margin-bottom: .2rem; }
.todo-total { min-width: 1.6rem; height: 1.6rem; padding: 0 .45rem; border-radius: 99px; display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.todo-group { display: flex; align-items: center; gap: .45rem; margin: 1.1rem 0 .15rem; font-size: .76rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.todo-group .n { color: var(--text-2); font-variant-numeric: tabular-nums; }
/* Lignes à plat séparées d'un filet, au lieu de cadres dans le cadre */
.todo-card .todo { margin: 0 -.6rem; padding: .6rem; border: 0; border-radius: var(--radius-sm); background: none; position: relative; }
.todo-card .todo + .todo::before { content: ''; position: absolute; top: 0; left: 3.2rem; right: .6rem; border-top: 1px solid var(--border); }
.todo-card .todo:hover { background: var(--surface-2); }
.todo-card .todo:hover::before, .todo-card .todo:hover + .todo::before { border-color: transparent; }
.todo-card .todo .t-icon { width: 34px; height: 34px; border: 0; }
.todo-card .todo .title { font-weight: 600; }

.feed .list > li { padding: .55rem 0; }
.feed-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; color: var(--text-2); margin-top: .1rem; }

@media (max-width: 1100px) {
  .kpi-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 640px) {
  /* Boutons Appeler / Pas de réponse sous le nom, pour que le nom reste lisible */
  .todo-card div.todo:has(form + form) { flex-wrap: wrap; row-gap: .45rem; column-gap: .5rem; }
  .todo-card div.todo:has(form + form) > .grow { flex: 1 1 calc(100% - 3.2rem); }
  .todo-card div.todo:has(form + form) > .grow + form { margin-left: calc(34px + .35rem); }
  .kpi { padding: .8rem .9rem; }
  .kpi-value { font-size: 1.3rem; }
}

/* ---------- Fenêtre de confirmation (remplace la boîte du navigateur, 08/10/2026) ---------- */
.confirm-dialog { width: min(440px, calc(100vw - 2rem)); padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.confirm-dialog::backdrop { background: rgba(8, 11, 20, .55); backdrop-filter: blur(2px); }
.confirm-dialog[open] { animation: confirm-in .18s cubic-bezier(.16, 1, .3, 1); }
@keyframes confirm-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.confirm-dialog form { padding: 1.35rem 1.4rem 1.1rem; }
.confirm-msg { margin: 0 0 1.25rem; font-size: 1rem; line-height: 1.5; font-weight: 500; color: var(--text); white-space: pre-line; }
.confirm-actions { display: flex; justify-content: flex-end; gap: .6rem; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { filter: brightness(1.08); }
@media (prefers-reduced-motion: reduce) { .confirm-dialog[open] { animation: none; } }

/* ---------- Pipeline : molette de défilement (08/10/2026) ---------- */
.board-scroll { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; position: sticky; top: 0; z-index: 5; }
.board-scroll[hidden] { display: none; }
.board-scroll .i.flip { transform: scaleX(-1); }
.board-scroll input[type=range] { flex: 1; max-width: 520px; height: 22px; margin: 0; background: none; cursor: grab; -webkit-appearance: none; appearance: none; }
.board-scroll input[type=range]:active { cursor: grabbing; }
.board-scroll input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border); }
.board-scroll input[type=range]::-moz-range-track { height: 8px; border-radius: 99px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border); }
.board-scroll input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 64px; height: 16px; margin-top: -4px; border-radius: 99px; background: var(--accent); box-shadow: 0 1px 4px rgba(15, 23, 42, .25); }
.board-scroll input[type=range]::-moz-range-thumb { width: 64px; height: 16px; border: 0; border-radius: 99px; background: var(--accent); box-shadow: 0 1px 4px rgba(15, 23, 42, .25); }
.board-scroll input[type=range]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 99px; }

/* ---------- Page publique de dépôt de pièces par le client (/depot/<jeton>, 08/10/2026) ----------
   Aux couleurs des mails clients : bandeau noir, logo clair, filet doré */
.depot-page { --or: #d9b56a; background: var(--bg); min-height: 100vh; }
.depot-top { background: #0b0b0c; border-bottom: 3px solid var(--or); padding: 1rem; display: flex; justify-content: center; }
.depot-top img { height: 52px; width: auto; }
.depot { max-width: 620px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.depot-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.7rem 1.6rem; }
.depot-card h1 { font-size: 1.4rem; line-height: 1.25; margin: 0 0 .5rem; text-wrap: balance; }
.depot-lead { color: var(--text-2); margin: 0 0 1.3rem; line-height: 1.55; }
.depot-drop { display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center; position: relative; cursor: pointer;
  border: 2px dashed var(--border-strong); border-radius: 14px; padding: 1.8rem 1rem 1.5rem; background: var(--surface-2); transition: border-color .15s, background-color .15s; }
.depot-drop:hover, .depot-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.depot-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.depot-drop.has-files { border-style: solid; border-color: var(--success); }
.depot-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.depot-drop > .i { width: 34px; height: 34px; color: var(--accent-text); margin-bottom: .2rem; }
.depot-drop strong { font-size: 1.05rem; }
.depot-drop > span { color: var(--muted); font-size: .9rem; }
.depot-drop .depot-limits { font-size: .78rem; margin-top: .45rem; max-width: 42ch; }
.depot-picked { list-style: none; margin: .7rem 0 0; padding: 0; font-size: .85rem; font-weight: 600; color: var(--text); text-align: left; max-width: 100%; }
.depot-picked li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .15rem 0; }
.depot-picked li::before { content: '✓ '; color: var(--success); }
.depot .field { margin-top: 1.1rem; }
.depot-send { width: 100%; justify-content: center; padding: .8rem 1rem; font-size: 1rem; margin-top: .3rem; }
.depot-ok, .depot-err { display: flex; gap: .7rem; align-items: flex-start; border-radius: 12px; padding: .85rem 1rem; margin-bottom: 1.1rem; line-height: 1.45; }
.depot-ok { background: var(--success-soft); color: var(--text); }
.depot-ok > .i { color: var(--success); flex: none; margin-top: .1rem; }
.depot-err { background: var(--danger-soft); color: var(--text); }
.depot-err > .i { color: var(--danger); flex: none; margin-top: .1rem; }
.depot-recus { margin-top: 1.3rem; border-top: 1px solid var(--border); padding-top: .9rem; font-size: .88rem; }
.depot-recus summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
.depot-recus ul { list-style: none; margin: .6rem 0 0; padding: 0; }
.depot-recus li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px solid var(--border); }
.depot-safe { display: flex; gap: .8rem; align-items: flex-start; margin-top: 1rem; padding: 1rem 1.2rem; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border); font-size: .86rem; color: var(--text-2); line-height: 1.5; }
.depot-safe > .i { color: var(--or); flex: none; width: 22px; height: 22px; }
.depot-foot { text-align: center; font-size: .78rem; color: var(--muted); margin-top: 1.8rem; }
@media (max-width: 520px) { .depot-card { padding: 1.3rem 1.1rem; } .depot-card h1 { font-size: 1.2rem; } }

/* ---------- Statistiques de l'équipe (/equipe, 11/10/2026) ---------- */
.equipe-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.equipe-carte { margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.equipe-statut { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.equipe-statut .point { width: 9px; height: 9px; border-radius: 99px; background: var(--border-strong); }
.equipe-statut.on { color: var(--success); }
.equipe-statut.on .point { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.equipe-maintenant { display: flex; flex-direction: column; gap: .15rem; padding: .65rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.equipe-maintenant strong { font-size: .92rem; }
.equipe-actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.equipe-actions li { display: grid; grid-template-columns: 5.5rem 1fr; gap: .5rem; align-items: baseline; }
.equipe-filtres { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.equipe-filtres input[type=date] { width: auto; }
.equipe-table tfoot td { font-weight: 700; border-top: 2px solid var(--border-strong); }
.equipe-titre-impression { display: none; }
@media print {
  .equipe-filtres, .page-head .segmented { display: none !important; }
  .equipe-titre-impression { display: block; margin: 0 0 1rem; }
}
@media (max-width: 640px) { .equipe-actions li { grid-template-columns: 1fr; gap: 0; } }

/* Fiche client : carte « Coordonnées » modifiable sur place */
.fiche-form { display: grid; gap: .55rem; }
.fiche-form label { display: grid; gap: .2rem; font-size: .78rem; color: var(--muted); font-weight: 500; }
.fiche-form input, .fiche-form select, .fiche-form textarea { padding: .4rem .55rem; font-size: .9rem; color: var(--text); }
.fiche-form-2 { display: grid; grid-template-columns: 7rem 1fr; gap: .5rem; }
.fiche-form-2.egal { grid-template-columns: 1fr 1fr; }
.fiche-groupe { display: grid; gap: .55rem; }
.fiche-type label { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; font-size: .85rem; color: var(--text); padding: .3rem .7rem; }
.fiche-type input { width: auto; margin: 0; }
.fiche-form:has(input[value="societe"]:checked) .si-particulier,
.fiche-form:has(input[value="particulier"]:checked) .si-societe { display: none; }
.fiche-type label:has(input:checked) { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-sm); font-weight: 600; }
.fiche-pliable > summary { cursor: pointer; list-style: none; }
.fiche-pliable > summary::-webkit-details-marker { display: none; }
.fiche-pliable:not([open]) > summary { margin-bottom: 0; }
.fiche-pliable > summary h2 { flex: 1; }
.fiche-pliable > summary { display: flex; align-items: center; gap: .5rem; }
.fiche-pliable:not([open]) .fiche-fermer, .fiche-pliable[open] .fiche-ouvrir { display: none; }
.fiche-bouton > span { display: inline-flex; align-items: center; gap: .3rem; }
.produits-supprimer[hidden] { display: none; }
.proposition-choix { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: center; margin: .4rem 0 0; }
.proposition-choix input { width: auto; margin: 0; }
.hero > .grow { flex: 1 1 20rem; min-width: 0; }
.check-ligne { display: flex; gap: .45rem; align-items: center; margin-top: .5rem; font-size: .85rem; font-weight: 400; color: var(--text); cursor: pointer; }
.check-ligne input { width: auto; margin: 0; }
.stepper button { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: normal; word-break: normal; }
.fiche-pliable > summary h2 { white-space: nowrap; } .fiche-pliable > summary { flex-wrap: wrap; row-gap: .4rem; }
/* Nouveau rapport d'enquête disponible (à relire et livrer) : ligne ou carte en surbrillance */
tr.rapport-nouveau > td { background: color-mix(in srgb, var(--st-rapport) 11%, var(--surface)); }
tr.rapport-nouveau > td:first-child { box-shadow: inset 4px 0 0 var(--st-rapport); }
.deal.rapport-nouveau { background: color-mix(in srgb, var(--st-rapport) 9%, var(--surface)); border-color: color-mix(in srgb, var(--st-rapport) 55%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-rapport) 14%, transparent); }
.badge-rapport { display: inline-flex; align-items: center; gap: .25rem; margin-top: .2rem; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700; color: #fff; background: var(--st-rapport); white-space: nowrap; }
.badge-rapport .i { width: 12px; height: 12px; }
/* Messagerie : fiche du client à côté de son mail */
.mb-fiche { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, var(--surface)); margin: .6rem 0; }
.mb-fiche > summary { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .55rem .8rem; cursor: pointer; list-style: none; }
.mb-fiche > summary::-webkit-details-marker { display: none; }
.mb-fiche-titre { display: inline-flex; align-items: center; gap: .35rem; margin-right: auto; }
.mb-fiche:not([open]) .fiche-fermer, .mb-fiche[open] .fiche-ouvrir { display: none; }
.mb-fiche-corps { padding: 0 .8rem .8rem; max-width: 560px; }
.mb-fiche-liens { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .4rem; }
.t-mail-actions { margin: .35rem 0; }
.t-repondre { margin-top: .3rem; }
.t-repondre > summary { list-style: none; display: inline-flex; cursor: pointer; }
.t-repondre > summary::-webkit-details-marker { display: none; }
.t-repondre[open] > summary { display: none; }
.t-repondre-form { margin-top: .5rem; padding: .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
/* Fiche ouverte (écran large) : la liste se range, le mail à gauche et la fiche à droite, pour recopier sans défiler */
@media (min-width: 1000px) {
  .mailbox:has(.mb-fiche[open]) { grid-template-columns: minmax(0, 1fr); }
  .mailbox:has(.mb-fiche[open]) > .mb-dossiers, .mailbox:has(.mb-fiche[open]) > .mb-liste { display: none; }
  .mb-lecture:has(.mb-fiche[open]) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); column-gap: 1.4rem; align-items: start; }
  .mb-lecture:has(.mb-fiche[open]) > * { grid-column: 1; }
  .mb-lecture:has(.mb-fiche[open]) > .mb-fiche { grid-column: 2; grid-row: 1 / span 40; position: sticky; top: 0; margin-top: 0; max-height: calc(100vh - 220px); overflow-y: auto; }
  .mb-lecture:has(.mb-fiche[open]) .mb-cadre { height: calc(100vh - 360px); min-height: 420px; }
}

/* Messagerie › Conversations clients : échanges présentés comme une discussion */
.cv-ligne { display: flex; align-items: center; gap: .6rem; }
.cv-ligne-txt { flex: 1; min-width: 0; display: block; }
.cv-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: var(--accent-soft); color: var(--accent-text); }
.cv-badge { flex: none; min-width: 20px; height: 20px; padding: 0 .35rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.cv-tete { display: flex; align-items: center; gap: .7rem; padding-bottom: .8rem; border-bottom: 1px solid var(--border); }
.cv-nom { font-size: 1.15rem; margin: 0; }
.cv-fil { display: flex; flex-direction: column; gap: .45rem; padding: 1rem 0; }
.cv-jour { text-align: center; margin: .6rem 0 .2rem; }
.cv-jour span { font-size: .72rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: .1rem .6rem; }
.cv-msg { display: flex; }
.cv-msg.envoye { justify-content: flex-end; }
.cv-bulle { max-width: min(78%, 620px); padding: .55rem .8rem .4rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.cv-msg.recu .cv-bulle { border-bottom-left-radius: 4px; }
.cv-msg.envoye .cv-bulle { background: var(--accent-soft); border-color: transparent; border-bottom-right-radius: 4px; }
.cv-objet { font-size: .74rem; font-weight: 600; color: var(--text-2); margin-bottom: .25rem; }
.cv-texte { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.45; }
.cv-meta { font-size: .7rem; color: var(--muted); margin-top: .3rem; text-align: right; }
.cv-meta .i { width: 12px; height: 12px; vertical-align: -2px; }
.cv-saisie { position: sticky; bottom: -2.4rem; background: var(--surface); border-top: 1px solid var(--border); padding: .7rem 0 .4rem; display: flex; flex-direction: column; gap: .5rem; }
.cv-saisie textarea { font-family: inherit; resize: vertical; }
.cv-options > summary { cursor: pointer; list-style: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-options > summary::-webkit-details-marker { display: none; }
.cv-options > summary .lien { color: var(--accent-text); text-decoration: underline; }
.cv-options[open] > summary { margin-bottom: .4rem; }
.mb-exp-lien { color: inherit; }
.mb-exp-lien:hover strong { text-decoration: underline; }
.mb-exp-l2:has(.mb-client) { white-space: normal; overflow: visible; display: flex; flex-wrap: wrap; gap: .3rem; }
@media (max-width: 900px) { .cv-saisie { position: static; } }
.cv-avatar.inconnu { background: var(--surface-3); color: var(--text-2); }
.cv-suppr { display: inline; }
.cv-suppr button { border: 0; background: none; padding: 0 0 0 .3rem; color: var(--muted); cursor: pointer; vertical-align: -2px; }
.cv-suppr button:hover { color: var(--danger); }
.cv-bulle:not(:hover) .cv-suppr { opacity: .35; }
.choix-client { display: inline-block; min-width: 0; width: 100%; } .inline-form .choix-client { width: auto; }

/* Mises en demeure : aperçu de la lettre comme une feuille imprimée (même mise en page que le Word) */
.med-apercu { position: relative; max-width: 800px; margin: 0 auto 2rem; padding: 64px 72px; background: #fff; color: #111; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 10px 30px -18px rgba(0,0,0,.35);
  font: 15.5px/1.5 "Times New Roman", Times, serif; text-align: justify; }
.med-apercu p { margin: 0 0 .55em; }
.med-apercu-dest, .med-apercu-lieu { text-align: right; }
.med-apercu-exp, .med-apercu-dest { margin-bottom: 1.4em; }
.med-apercu-lieu { margin-bottom: .8em; }
.med-apercu-objet { margin-bottom: 1.2em !important; }
.med-apercu-titre { margin-top: 1em !important; }
.med-apercu-puce { padding-left: 1.6em; text-indent: -1em; margin-bottom: .3em !important; }
.med-apercu-signature { margin-top: 2em !important; }
.med-apercu.brouillon::before { content: "BROUILLON"; position: absolute; top: 18px; right: 22px; font: 700 12px/1 system-ui, sans-serif; letter-spacing: .12em; color: #b45309; background: #fef3c7; padding: 5px 8px; border-radius: 6px; }
@media (max-width: 700px) { .med-apercu { padding: 28px 20px; font-size: 14.5px; } }
@media print {
  .no-print, .sidebar, .topbar, header, nav, .toasts { display: none !important; }
  .med-apercu { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .med-apercu.brouillon::before { display: none; }
}

/* Version d'entraînement (FORMATION=1) */
.bandeau-formation { display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; padding: .55rem .9rem; border-radius: 10px; background: #fef3c7; color: #78350f; border: 1px solid #fcd34d; font-size: .9rem; }
.bandeau-formation .grow { flex: 1; }
.bandeau-formation.rappel { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.bandeau-formation.rappel a, .bandeau-formation a { color: inherit; text-decoration: underline; }
.formation-regles li { margin-bottom: .4rem; }
.formation-missions { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.formation-missions li { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 10px; }
.formation-missions li.faite { background: var(--success-soft, #e3f6ee); border-color: transparent; }
.formation-missions li.faite strong { text-decoration: line-through; opacity: .7; }
.formation-missions li.encours { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.formation-missions li.oubli { border-color: var(--danger); background: var(--danger-soft); }
.formation-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; background: var(--surface-2); }
.formation-missions li.faite .formation-num { background: var(--success, #047857); color: #fff; }
