:root {
  --bg: #e1e6ee;
  --panel: #ffffff;
  --ink: #0b1220;
  --muted: #4b5563;
  --line: #d2d9e4;
  --brand: #1e3a8a;
  --brand-2: #2563eb;
  --brand-soft: #e0e9ff;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --ok: #166534;
  --ok-bg: #dcfce7;
  --info-bg: #dbeafe;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 4px 16px rgba(17, 24, 39, .04);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.01em; }
h3 { font-size: 12px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ===== Mise en page ===== */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: #f3f5f9; border-right: 1px solid var(--line); padding: 22px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; padding: 0 8px 22px; }
.logo .mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; }
.logo span.sub { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 10px; color: #1f2937; padding: 9px 10px; border-radius: 10px; margin-bottom: 2px; font-weight: 500; }
.nav a:hover { background: #eef1f6; text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav .ico { width: 20px; text-align: center; }
.nav .sep { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 16px 10px 6px; }
.nav .count { margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 600; }
.sidebar .bottom { margin-top: auto; font-size: 12px; color: var(--muted); padding: 10px; display: grid; gap: 8px; }
.main { padding: 28px 36px 80px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }

/* ===== Composants ===== */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .layout { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .main { padding: 20px; } }
.kpi { padding: 16px 18px; display: block; color: var(--ink); }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi.alert .v { color: var(--danger); }
a.kpi:hover { text-decoration: none; border-color: #d1d9f0; }

button, .btn { font: inherit; font-weight: 500; border: 1px solid #cfd6e0; background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: .12s; }
button:hover, .btn:hover { background: #f3f5f9; border-color: #b9c2cf; text-decoration: none; }
.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.danger { color: var(--danger); }
.ghost { background: transparent; border-color: transparent; }
.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

input, select, textarea { font: inherit; border: 1px solid #cfd6e0; border-radius: 10px; padding: 9px 12px; background: #fff; color: var(--ink); width: 100%; }
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 3px solid #dbe7ff; border-color: var(--brand-2); }
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.form .full { grid-column: 1 / -1; }
.form .check { display: flex; align-items: center; gap: 8px; }
.form .check input { width: auto; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 340px; }
.toolbar select { width: auto; }

table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
th { font-size: 12px; color: #1f2937; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: #e9edf4; border-bottom: 2px solid #cfd6e0; position: sticky; top: 0; z-index: 1; }
tbody tr:nth-child(even) td { background: #f6f8fb; }
tfoot td { background: #eef1f6; border-top: 2px solid #cfd6e0; }
th.sort { cursor: pointer; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #dfe9ff; }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); max-height: 72vh; }
.sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e5e7eb; color: #1f2937; white-space: nowrap; }
.b-red { background: var(--danger-bg); color: var(--danger); }
.b-orange { background: var(--warn-bg); color: var(--warn); }
.b-green { background: var(--ok-bg); color: var(--ok); }
.b-blue { background: var(--info-bg); color: #1e40af; }
.b-dark { background: #1f2937; color: #fff; }
.late { color: var(--danger); font-weight: 600; }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap; background: #dfe4ec; padding: 4px; border-radius: 12px; width: fit-content; }
.tabs button { border: none; border-radius: 9px; background: none; padding: 7px 14px; color: var(--muted); }
.tabs button:hover { background: rgba(255,255,255,.6); }
.tabs button.on { color: var(--ink); background: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.tabs .count { background: #c7cfdb; color: #0b1220; border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 4px; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; word-break: break-word; }

/* ===== Fiche agence ===== */
.hero { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.hero .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .l { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 18px; font-weight: 600; margin-top: 3px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; color: var(--brand-2); font-size: 13px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }

/* ===== Fil (journal + mails) ===== */
.feed { display: flex; flex-direction: column; gap: 2px; }
.item { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: none; }
.item .ic { width: 34px; height: 34px; border-radius: 10px; background: #f3f4f6; display: grid; place-items: center; font-size: 15px; }
.item.t-rejet_prelevement .ic, .item.t-injonction .ic, .item.t-mise_en_demeure .ic, .item.t-tribunal .ic, .item.t-contestation .ic { background: var(--danger-bg); }
.item.t-virement .ic, .item.t-promesse_paiement .ic { background: var(--ok-bg); }
.item.t-legalcity .ic { background: #f5f3ff; }
.item.t-mail .ic, .item.mail .ic { background: var(--info-bg); }
.item .h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.item .titre { font-weight: 600; }
.item .d { color: var(--muted); font-size: 12.5px; margin-left: auto; white-space: nowrap; }
.item .det { white-space: pre-wrap; color: #374151; margin-top: 4px; font-size: 13.5px; }
.item .corps { white-space: pre-wrap; font-size: 13.5px; color: #374151; margin-top: 6px; background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; max-height: 260px; overflow: auto; }
.item.sortant .corps { background: #f5f8ff; border-color: #e0e9ff; }
.item.systeme { opacity: .75; }

/* ===== Assistant ===== */
.assist { background: linear-gradient(180deg, #f5f8ff 0%, #fff 70%); border: 1px solid #dfe8ff; border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.assist-head { margin-bottom: 10px; }
.assist textarea { background: #fff; margin-bottom: 10px; }
.assist.compact { padding: 12px 14px; }
.assist-resume { background: var(--brand-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; color: var(--brand); }
.assist-actions { display: grid; gap: 6px; }
.assist-act { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: 14px; margin: 0; cursor: pointer; }
.assist-act:hover { background: #fafbff; }
.assist-act input { width: auto; margin-top: 3px; }
.fab { position: fixed; right: 24px; bottom: 24px; z-index: 40; border-radius: 999px; padding: 12px 18px; box-shadow: 0 10px 30px rgba(37, 99, 235, .35); font-weight: 600; }

/* ===== Modale & notifications ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(17, 24, 39, .4); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 50px 16px; z-index: 50; overflow: auto; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 680px; box-shadow: 0 24px 60px rgba(0,0,0,.2); }
.modal.wide { max-width: 860px; }
.modal header { padding: 18px 22px 8px; display: flex; justify-content: space-between; align-items: center; }
.modal header h2 { margin: 0; font-size: 18px; }
.modal .body { padding: 12px 22px 18px; }
.modal footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #111827; color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 520px; display: flex; align-items: center; gap: 14px; animation: toast-entre .2s ease; transition: opacity .2s, transform .2s; }
.toast.sort { opacity: 0; transform: translateY(8px); }
.toast-annuler { background: transparent; color: #fde68a; border: 1px solid rgba(253,230,138,.5); padding: 4px 10px; font-weight: 700; border-radius: 8px; white-space: nowrap; }
.toast-annuler:hover { background: rgba(253,230,138,.15); }
@keyframes toast-entre { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.err { background: var(--danger); }

/* ===== Connexion ===== */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.login .card { width: 380px; padding: 32px; }
.login form { display: grid; gap: 14px; margin-top: 18px; }

.empty { padding: 32px; text-align: center; color: var(--muted); }
.loading { padding: 32px; text-align: center; color: var(--muted); }
.alert-box { border: 1px solid #fecaca; background: var(--danger-bg); color: #991b1b; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; }
.info-box { border: 1px solid #dbeafe; background: var(--info-bg); padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; }
.dropzone { border: 2px dashed #d1d5db; border-radius: 14px; padding: 34px; text-align: center; background: #fff; cursor: pointer; }
.dropzone.over { border-color: var(--brand-2); background: var(--info-bg); }
.todo { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.todo:last-child { border-bottom: none; }
.todo:hover { background: #fafbff; }
.todo .w { flex: 1; min-width: 0; }
.todo .w b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Impression (dossier tribunal) ===== */
@media print {
  .sidebar, .no-print, .tabs, .toolbar, .fab, .page-head .actions { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; }
  .card, .table-wrap { box-shadow: none; border: none; max-height: none; overflow: visible; }
  body { background: #fff; }
}

/* ===== v3 ===== */
.seg { display: inline-flex; background: #dfe4ec; border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 14px; flex-wrap: wrap; }
.seg button { border: none; background: transparent; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.12); }
.switch { display: inline-flex; gap: 8px; align-items: center; margin: 0; color: var(--ink); font-size: 14px; cursor: pointer; }
.switch input { width: auto; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; }
.step { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: #e5e9f0; color: var(--muted); }
.step.done { background: var(--ok-bg); color: var(--ok); }
.step.cur { background: var(--brand-2); color: #fff; font-weight: 600; }
.doc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 10px; }
@media (max-width: 1000px) { .doc-grid { grid-template-columns: 1fr; } }
.doc-box { min-height: 120px; }
.doc { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); border: 1px solid var(--line); margin-top: 6px; }
.doc:hover { background: #f7f9fc; text-decoration: none; }
.sl-acc { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sl-acc:last-child { border-bottom: none; }
.sl-acc.off { opacity: .6; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.kpi-type { display: block; color: var(--ink); padding: 14px 16px; border: 2px solid transparent; }
.kpi-type:hover { text-decoration: none; border-color: #dbe4ff; }
.kpi-type.on { border-color: var(--brand-2); }
.kpi-type .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi-type .v { font-size: 22px; font-weight: 700; margin-top: 4px; }
.mail-card { margin-bottom: 10px; }
.mail-card summary { cursor: pointer; list-style: none; }
.mail-card summary::-webkit-details-marker { display: none; }
.repart { width: 100%; } .repart td, .repart th { padding: 6px 8px; }

/* ===== v3.1 ===== */
.ag { display: inline-block; font-weight: 800; font-size: 13px; color: #fff; background: var(--brand); padding: 2px 8px; border-radius: 6px; letter-spacing: .02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hero-id { display: flex; gap: 16px; align-items: center; }
.ag-big { font-size: 26px; font-weight: 800; color: #fff; background: var(--brand); padding: 10px 16px; border-radius: 12px; letter-spacing: .01em; white-space: nowrap; }
.sl-switch { background: #fff; border: 1px solid #cfd6e0; border-radius: 999px; padding: 3px 12px 3px 8px; font-size: 13px; font-weight: 600; }
.seg-lg button { padding: 9px 16px; font-size: 14px; }
button.ok { color: var(--ok); border-color: #86efac; }
button.ok:hover { background: var(--ok-bg); }
.topbar { display: flex; justify-content: flex-end; margin: -14px 0 8px; }
.notif { border-radius: 999px; font-size: 13px; background: #fff; }
.notif .count:empty { display: none; }
.notif .count { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; }
.notif.on { border-color: #fca5a5; color: var(--danger); font-weight: 600; }
.notif-pop { position: fixed; top: 58px; right: 36px; width: 380px; max-height: 70vh; overflow: auto; background: #fff; border: 1px solid #cfd6e0; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.18); z-index: 60; padding: 8px; }
.notif-pop .h { font-weight: 700; padding: 8px 10px; }
.notif-pop a { display: block; padding: 9px 10px; border-radius: 8px; color: var(--ink); }
.notif-pop a:hover { background: #eef3ff; text-decoration: none; }
.notif-pop a.all { color: var(--brand-2); font-weight: 600; border-top: 1px solid var(--line); border-radius: 0; margin-top: 4px; }
table.guide td, table.guide th { font-size: 13px; vertical-align: top; }
/* Rapprochement : une page portrait par agence */
.rp-nav { display: grid; grid-template-columns: 56px minmax(0, 1100px) 56px; justify-content: center; gap: 12px; align-items: start; }
.rp-arrow { position: sticky; top: 40vh; width: 52px; height: 52px; border-radius: 999px; font-size: 30px; justify-content: center; padding: 0; background: #fff; box-shadow: var(--shadow); }
.rp-arrow:disabled { opacity: .3; }
.rp-sheet { padding: 28px 32px; min-height: 900px; }
.rp-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #cfd6e0; padding-bottom: 14px; }
.rp-code { display: inline-block; font-size: 24px; font-weight: 800; color: #fff; background: var(--brand); padding: 6px 14px; border-radius: 10px; }
.rp-tot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 12px; }
.rp-tot > div { background: #f3f5f9; border-radius: 10px; padding: 10px 14px; }
.rp-tot .l { font-size: 12px; color: var(--muted); }
.rp-tot .v { font-size: 20px; font-weight: 700; margin-top: 2px; }
.rp-tot .bad { background: var(--danger-bg); color: var(--danger); }
.rp-tot .good { background: var(--ok-bg); color: var(--ok); }
.rp-ecarts { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-table { font-size: 13px; border: 1px solid var(--line); }
.rp-table th { position: static; }
.rp-table td, .rp-table th { padding: 7px 9px; }
.rp-table tr.warn td { background: #fff7e6; }
@media print {
  .topbar, .notif-pop { display: none !important; }
  .rp-nav { display: block; }
  .rp-sheet { min-height: 0; border: none; padding: 0; }
  @page { size: A4 portrait; margin: 12mm; }
}

/* ===== v3.2 : couleurs par catégorie ===== */
.tabs button.c-interne { box-shadow: inset 0 -3px 0 #2563eb; }
.tabs button.c-legalcity { box-shadow: inset 0 -3px 0 #7c3aed; }
.tabs button.c-huissier { box-shadow: inset 0 -3px 0 #dc2626; }
.tabs button.c-aclasser { box-shadow: inset 0 -3px 0 #d97706; }
.tabs button.c-ok { box-shadow: inset 0 -3px 0 #16a34a; }
.tabs button.c-interne.on { background: #dbeafe; color: #1e3a8a; }
.tabs button.c-legalcity.on { background: #ede9fe; color: #5b21b6; }
.tabs button.c-huissier.on { background: #fee2e2; color: #991b1b; }
.tabs button.c-aclasser.on { background: #fef3c7; color: #92400e; }
.tabs button.c-ok.on { background: #dcfce7; color: #166534; }
.kpi-type.c-interne, .kpi.c-interne { border-left: 6px solid #2563eb; }
.kpi-type.c-legalcity { border-left: 6px solid #7c3aed; }
.kpi-type.c-huissier, .kpi.c-huissier { border-left: 6px solid #dc2626; }
.kpi-type.c-aclasser { border-left: 6px solid #d97706; }
.kpi-type.c-interne.on { background: #eff5ff; border-color: #2563eb; }
.kpi-type.c-legalcity.on { background: #f5f3ff; border-color: #7c3aed; }
.kpi-type.c-huissier.on { background: #fef2f2; border-color: #dc2626; }
/* Boîte mails */
.mail-card.nonlu { border-left: 5px solid var(--brand-2); }
.mail-card.nonlu .sujet { font-weight: 800; }
.mail-card .sujet { font-weight: 600; }
.pastille { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-2); margin-right: 6px; vertical-align: middle; }
/* Documents dépliables */
details.docx { border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; background: #fff; }
details.docx summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; }
details.docx summary::-webkit-details-marker { display: none; }
details.docx[open] summary { border-bottom: 1px solid var(--line); background: #f3f5f9; }
details.docx .apercu { padding: 10px; }
details.docx iframe { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
details.docx img { max-width: 100%; border-radius: 8px; }

/* ===== SeLoger : bulles d'outils ===== */
.bulles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.bulle { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 28px 26px; box-shadow: var(--shadow); color: var(--ink); transition: transform .12s, box-shadow .12s, border-color .12s; min-height: 210px; }
.bulle:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 10px 28px rgba(15,23,42,.10); border-color: var(--brand-2); }
.bulle .ico { font-size: 40px; line-height: 1; }
.bulle .t { font-size: 20px; font-weight: 700; }
.bulle .info { margin-top: auto; font-weight: 600; color: var(--brand); }
.bulle.alerte .info { color: var(--danger); }
.selbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.selbar label { margin: 0; display: flex; gap: 6px; align-items: center; }
.selbar input[type=checkbox], td.chk input { width: auto; }
.sub.warn { color: var(--warn); }

/* ===== Facture SeLoger au format AGPR (impression A4) ===== */
.moyenne { margin-top: 12px; padding: 10px 14px; background: var(--info-bg); border-radius: 10px; }
.warn { color: var(--warn); }
.lignes-fact { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.lignes-fact .ligne { display: flex; gap: 8px; align-items: center; padding: 4px 0; margin: 0; font-weight: 400; border-bottom: 1px dashed var(--line); }
.lignes-fact .ligne input { width: auto; }
.fsl { --vio: #8a16ab; --vio-l: #f6eaf9; max-width: 820px; margin: 18px auto; background: #fff; padding: 30px 30px 20px; color: #2b2340; font-family: Arial, Helvetica, sans-serif; font-size: 12.5px; border: 1px solid var(--line); }
.fsl-top { display: flex; justify-content: space-between; align-items: flex-start; }
.fsl-logo { width: 255px; }
.fsl-titre { text-align: right; color: #3b2a75; font-size: 14px; line-height: 1.55; }
.fsl-h { font-size: 42px; font-weight: 700; color: var(--vio); line-height: 1.1; margin-bottom: 6px; }
.fsl-parties { display: flex; justify-content: space-between; gap: 30px; margin: 18px 0 16px; font-size: 13.5px; color: #3b2a75; line-height: 1.5; }
.fsl-cl { border: 2px solid #3b2a75; padding: 10px 16px; min-width: 46%; color: #1f1a2e; }
.fsl-cl b { font-size: 15px; }
.fsl-bandeau { background: var(--vio); color: #fff; text-align: center; font-weight: 700; font-size: 20px; padding: 8px 12px; border-radius: 6px; margin: 0 auto 16px; width: 82%; letter-spacing: .02em; }
.fsl-table { width: 100%; border-collapse: collapse; }
.fsl-table th { background: var(--vio); color: #fff; font-weight: 700; padding: 7px 4px; font-size: 10.5px; border: 1px solid #fff; white-space: nowrap; }
.fsl-table td { border: 1px solid #c9bcd6; padding: 5px 4px; font-size: 10.5px; vertical-align: middle; }
.fsl-table td.nw { white-space: nowrap; }
.fsl-table td.r { text-align: right; white-space: nowrap; }
.fsl-table td.c { text-align: center; }
.fsl-table tr { break-inside: avoid; }
.fsl-bas { display: flex; gap: 0; margin-top: 16px; align-items: stretch; break-inside: avoid; }
.fsl-mod { flex: 1; border: 2px solid #3b2a75; padding: 10px 14px; font-size: 11.5px; line-height: 1.45; margin-right: -2px; }
.fsl-mod-t { color: var(--vio); font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.fsl-ment { margin-top: 8px; white-space: normal; }
.fsl-tot { border-collapse: collapse; width: 310px; align-self: flex-start; }
.fsl-tot td { background: var(--vio-l); border: 1px solid #fff; padding: 12px 14px; font-size: 15px; text-align: right; }
.fsl-tot td:first-child { text-align: center; }
.fsl-tot .ttc td { background: var(--vio); color: #fff; font-weight: 700; font-size: 21px; padding: 18px 14px; }
.fsl-page { width: 100%; border-collapse: collapse; }
.fsl-page > tbody > tr > td, .fsl-page > tfoot > tr > td { padding: 0; border: none; background: transparent !important; box-shadow: none !important; }
.fsl-espace { display: none; }
.fsl-pied { margin-top: 22px; border-top: 2px solid var(--vio); border-bottom: 2px solid var(--vio); padding: 10px 0; text-align: center; font-size: 11px; line-height: 1.6; color: #2b2340; break-inside: avoid; }
@page { size: A4; margin: 10mm; }
@media print {
  body { background: #fff; }
  .fsl { border: none; margin: 0; padding: 0; max-width: none; }
  .main { padding: 0 !important; }
  .fsl-pied { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; background: #fff; }
  .fsl-espace { display: block; height: 24mm; }
  .fsl-table th, .fsl-bandeau, .fsl-tot td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Pastille AG : verte si active, noire si arrêtée */
.ag.ag-on { background: #15803d; }
.ag.ag-off { background: #111827; }
.lien-ext { font-size: 13px; font-weight: 600; white-space: nowrap; }
.selbar.vide { box-shadow: none; border: none; background: transparent; padding: 0 2px; position: static; }

/* Fiche agence : gros code AG = raccourci Arc'Hive */
a.ag-big { display: inline-block; text-decoration: none; transition: transform .12s, box-shadow .12s, filter .12s; cursor: pointer; }
.ag-big.ag-on { background: #15803d; }
.ag-big.ag-off { background: #111827; }
a.ag-big:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.18); filter: brightness(1.25); }
.ag-big.ag-off:hover { filter: none; background: #374151; }
a.ag { text-decoration: none; }
a.ag:hover { text-decoration: none; filter: brightness(1.2); }
.affil { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.affil-liste { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.lien-archive { display: inline-flex; vertical-align: middle; margin-left: 4px; padding: 2px; border-radius: 6px; transition: transform .12s, background .12s; }
.lien-archive img { width: 20px; height: 20px; display: block; }
.lien-archive:hover { background: #f3e6f8; transform: scale(1.15); }
/* Dernière ligne ouverte : reste surlignée au retour sur la page */
tbody tr.sel td { background: #fff4c2 !important; }
tbody tr.sel td:first-child { box-shadow: inset 4px 0 0 #f59e0b; }
.count-mini { background: var(--warn-bg); color: var(--warn); border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 700; margin-left: 4px; }
.relier { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
input.mini { width: 110px; padding: 4px 8px; font-size: 12.5px; }
.auto-pop { position: fixed; z-index: 1000; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(15,23,42,.16); min-width: 280px; max-width: 420px; padding: 4px; }
.auto-it { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auto-it:hover, .auto-it.on { background: var(--brand-soft); }
input.mini { width: 190px; }
.th-check { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 0 10px; font-weight: 500; font-size: 12px; cursor: pointer; text-transform: none; }
.th-check input { width: auto; margin: 0; }
.th-split { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; }
.th-check { margin-left: auto !important; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.7); border: 1px solid var(--line); transition: background .15s, border-color .15s; }
.th-check:hover { border-color: var(--brand-2); }
.th-check:has(input:checked) { background: var(--brand-soft); border-color: var(--brand-2); color: var(--brand); font-weight: 600; }
#t tbody { transition: opacity .18s ease, filter .18s ease; }
#t.fondu tbody { opacity: .15; filter: blur(1px); }
#t.apparait tbody tr { animation: apparition .32s ease both; }
@keyframes apparition { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.maillon { display: inline-flex; vertical-align: middle; margin-left: 3px; color: var(--muted); padding: 2px; border-radius: 6px; }
a.maillon:hover { color: var(--brand-2); background: var(--brand-soft); }
.maillon.a-relier { color: var(--warn); }

/* ===== Virements reçus ===== */
.vr-saisie textarea { font-family: var(--mono, ui-monospace, monospace); font-size: 13px; }
.vr-res { margin-top: 16px; transition: border-color .2s; }
.vr-res.vert { border: 2px solid #16a34a; }
.vr-ctl { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.vr-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 2px solid; background: #fff; cursor: default; font-weight: 400; min-height: 86px; }
.vr-chip[data-k="ag"], .vr-chip[data-k="facture"] { cursor: pointer; }
.vr-chip[data-k="ag"]:hover, .vr-chip[data-k="facture"]:hover { filter: brightness(.97); transform: translateY(-1px); }
.vr-chip .vr-l { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.vr-chip .vr-e { font-size: 18px; font-weight: 800; }
.vr-chip .vr-i { font-size: 12.5px; color: var(--ink); line-height: 1.35; word-break: break-word; }
.vr-chip.ok { border-color: #16a34a; background: #f0fdf4; color: #15803d; }
.vr-chip.warn { border-color: #f59e0b; background: #fffbeb; color: #b45309; }
.vr-chip.ko { border-color: #dc2626; background: #fef2f2; color: #b91c1c; }
.vr-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 16px; }
.vr-actions button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 16px; font-size: 15px; font-weight: 700; text-align: left; }
.vr-actions button .sub { font-weight: 400; }
.vr-actions button.fait { background: #f0fdf4; border-color: #16a34a; color: #15803d; }
.ok-txt { color: #15803d; font-weight: 600; }
.auto-pop { z-index: 3000; }

.vr-chip { white-space: normal; }
.vr-chip .vr-i { overflow-wrap: anywhere; white-space: normal; }
.vr-actions button { white-space: normal; }
.vr-actions button.primary .sub { color: rgba(255,255,255,.9); }
.vr-actions button.fait .sub { color: #15803d; }
.vr-deja { font-size: 14px; }
.vr-actions button.deja { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
.vr-actions button.deja .sub { color: #b45309; font-weight: 600; }
.vr-props { display: flex; flex-direction: column; gap: 6px; }
.vr-props-t { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.vr-prop { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 12px; border-radius: 10px; font-weight: 400; white-space: normal; }
.vr-prop:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.vr-prop.on { border-color: #16a34a; background: #f0fdf4; }
.vr-prop .sub { display: block; }
.vr-nom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 12px; background: var(--bg); border-radius: 10px; }
.vr-nom-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
/* Historique replié : un clic déplie */
.feed .item.pliable { cursor: pointer; }
.feed .item.pliable .det, .feed .item.pliable .corps { display: none; }
.feed .item.pliable.ouvert .det, .feed .item.pliable.ouvert .corps { display: block; }
.feed .item.pliable .titre::after { content: ' ▸'; color: var(--muted); font-size: 11px; }
.feed .item.pliable.ouvert .titre::after { content: ' ▾'; }
.vr-hist tr.pliable { cursor: pointer; }
.vr-hist tr.pliable:hover td { background: #f8fafc; }
.vr-hist tr.ouvert td { background: #f1f5f9; }
.vr-hist .vr-det-in { padding: 4px 2px; font-size: 13px; }
.vr-hist pre { white-space: pre-wrap; font-family: inherit; font-size: 12.5px; background: #f8fafc; padding: 10px 12px; border-radius: 8px; margin: 8px 0 0; }
label.vr-prop { margin: 0; cursor: pointer; border: 1px solid var(--line); }
label.vr-prop input[type=checkbox] { width: auto; margin: 0; }
label.vr-prop a { text-decoration: none; }
.card.avoirs { margin-bottom: 14px; }
.feed .ev-actions { margin-top: 8px; }
/* Répartition cliquable (règlements, avoirs) */
.repart-outils { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
table.repart tr.repart-l { cursor: pointer; }
table.repart tr.repart-l:hover td { background: #f8fafc; }
table.repart tr.repart-l.on td { background: #f0fdf4; }
table.repart tr.repart-l.on td:first-child { box-shadow: inset 4px 0 0 #16a34a; }
.repart-recap { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: #f1f5f9; font-size: 14px; }
.repart-recap.reste { background: #fffbeb; color: #92400e; }
.repart-recap.ok { background: #f0fdf4; color: #15803d; }
.repart-recap.trop { background: #fef2f2; color: #b91c1c; }
.vr-actions button.vr-saisir { border-width: 2px; }
/* Recouvrement « Créance » (déclaration au liquidateur) */
.badge.b-teal { background: #ccfbf1; color: #115e59; }
.tabs button.c-creance { box-shadow: inset 0 -3px 0 #0d9488; }
.tabs button.c-creance.on { background: #ccfbf1; color: #115e59; }
.kpi-type.c-creance { border-left: 6px solid #0d9488; }
.kpi-type.c-creance.on { background: #f0fdfa; border-color: #0d9488; }

/* ===== Incidents de prélèvement ===== */
.card.inc { margin-bottom: 12px; padding: 14px 18px; }
.card.inc.termine { opacity: .75; }
.card.inc.ignore { opacity: .55; }
.inc-tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inc-tete a { text-decoration: none; }
.inc-date { font-weight: 700; color: var(--muted); min-width: 86px; }
.inc-montant { margin-left: auto; font-size: 18px; font-weight: 800; }
.inc-etapes { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.inc-etapes > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.inc-st { display: inline-block; min-width: 128px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid; }
.inc-st.ok { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.inc-st.warn { background: #fffbeb; color: #b45309; border-color: #fcd34d; }
.inc-st.ko { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.inc-analyse { display: grid; gap: 6px; }
.inc-chk { padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.inc-chk.ok { background: #f0fdf4; color: #15803d; }
.inc-chk.ko { background: #fef2f2; color: #b91c1c; }

.inc-etapes button.fait { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.inc-com { flex-basis: 100%; margin-left: 136px; font-style: italic; }

/* ===== Commandes SeLoger ===== */
.cmd-act { display: inline-flex; gap: 6px; white-space: nowrap; }
.cmd-form { display: grid; gap: 14px; }
.cmd-sec { border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; background: #fcfcfd; }
.cmd-sec h3 { margin: 0 0 12px; font-size: 15px; }
.cmd-det > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.cmd-det > summary::-webkit-details-marker { display: none; }
.cmd-det > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.cmd-det[open] > summary::before { transform: rotate(90deg); }
.cmd-det[open] > summary { margin-bottom: 12px; }
.cmd-sec.cmd-det > summary h3 { margin: 0; }
section .cmd-det { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.cmd-ag { display: flex; gap: 8px; align-items: center; }
.cmd-ag input { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 8px 16px; background: #fff; }
.seg button.on.devis { background: var(--warn-bg); color: var(--warn); font-weight: 700; }
.seg button.on.commande { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.combo { position: relative; }
.combo-pop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 420px; overflow: auto; }
.combo-it { padding: 7px 12px; cursor: pointer; font-size: 14px; }
.combo-it:hover, .combo-it.on { background: var(--info-bg); }
.combo-pied { position: sticky; bottom: 0; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13px; color: #6d28d9; cursor: pointer; background: #faf5ff; }
.combo-pied:hover { background: #f3e8ff; }
.prix-tete, .prix-l { display: grid; grid-template-columns: 150px 180px 1fr 34px; gap: 10px; align-items: center; }
.prix-tete { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.prix-l { margin-bottom: 8px; }
.prix-duree, .prix-pu { display: flex; align-items: center; gap: 6px; }
.prix-duree .combo { flex: 1; }
.prix-pu input { text-align: right; }
.prix-t { text-align: right; }
.cmd-tot { margin-top: 12px; margin-left: auto; max-width: 340px; display: grid; gap: 4px; }
.cmd-tot > div { display: flex; justify-content: space-between; gap: 12px; }
.cmd-tot .ttc { border-top: 1px solid var(--line); padding-top: 6px; font-size: 16px; }
.doc-l { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.doc-l > span:first-child { flex: 1; font-weight: 600; }
.doc-l.attente { opacity: .7; }
#docs { margin-bottom: 10px; }
.cmd-resume { padding: 10px 14px; background: #f8fafc; border-radius: 10px; margin-bottom: 12px; }
.cmd-manque { border: 1px solid #fcd34d; background: #fffbeb; border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; }
.cmd-manque .t { font-weight: 700; color: #b45309; }
.cmd-manque .l { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cmd-ok { padding: 12px 14px; border-radius: 10px; background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.prod-liste { display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
.prod-l { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; }
.prod-l:hover { background: #f8fafc; }
.prod-l > span { flex: 1; }
.modal.wide { max-width: 900px; }
.seg button.on.arretee { background: #1f2937; color: #fff; font-weight: 700; }
.doc-nom { flex: 1; font-weight: 600; }
.pointage { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
a.btn { text-decoration: none; }

/* ===== Commerciaux SeLoger ===== */
.com-t td { vertical-align: top; }
.com-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.com-nom { font-size: 13px; padding: 3px 9px; border-radius: 999px; }
button.com-nom { background: #fff; border: 1px dashed #cbd5e1; color: var(--muted); }
button.com-nom:hover { border-color: var(--ok); color: var(--ink); }
button.com-nom.on { background: var(--ok-bg); color: var(--ok); border: 1px solid #86efac; font-weight: 700; }
.com-nom.seul { padding-left: 0; }
tr.com-ach td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.badge.b-encours { background: #ede9fe; color: #6d28d9; margin-top: 4px; }

.ag-props { margin-top: 8px; border: 1px solid #ddd6fe; background: #faf5ff; border-radius: 10px; padding: 8px 10px; display: grid; gap: 6px; }
.ag-props .t { font-weight: 700; color: #6d28d9; font-size: 13px; }
.ag-props.vide { border-color: #fcd34d; background: #fffbeb; color: #b45309; }
.ag-prop { justify-content: flex-start; text-align: left; white-space: normal; background: #fff; }
.ag-prop:hover { border-color: #8b5cf6; }

/* ===== Commandes SeLoger — affichage moderne ===== */
.cm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.cm-head h1 { margin: 4px 0 4px; font-size: 28px; letter-spacing: -.02em; }
.cm-head p { margin: 0; color: var(--muted); }
.cm-back { font-size: 13px; color: var(--muted); }
.cm-actions { display: flex; gap: 10px; }
.cm-primary { background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; border: 0; padding: 11px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 6px 18px rgba(79, 70, 229, .25); }
.cm-primary:hover { filter: brightness(1.05); }
.cm-ghost { background: #fff; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; }
.cm-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.cm-kpi { background: #fff; border-radius: 16px; padding: 16px 18px; border: 1px solid #e8ecf3; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.cm-kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--k, #94a3b8); }
.cm-kpi span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.cm-kpi b { font-size: 26px; letter-spacing: -.02em; }
.cm-kpi small { color: #8a94a6; font-size: 12px; }
.k-orange { --k: #f59e0b; } .k-green { --k: #10b981; } .k-red { --k: #ef4444; } .k-blue { --k: #4f46e5; } .k-grey { --k: #cbd5e1; }
.cm-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.cm-seg { display: inline-flex; background: #e6eaf2; padding: 4px; border-radius: 12px; gap: 2px; }
.cm-seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; color: #475569; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; }
.cm-seg button i { font-style: normal; font-size: 11.5px; background: rgba(15, 23, 42, .08); padding: 1px 7px; border-radius: 999px; }
.cm-seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.cm-seg button.on i { background: #eef2ff; color: #4338ca; }
.cm-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; min-width: 320px; }
.cm-search input { border: 0; outline: 0; padding: 10px 0; flex: 1; background: transparent; box-shadow: none; }
.cm-list { display: flex; flex-direction: column; gap: 8px; }
.cm-month { display: flex; align-items: center; gap: 8px; margin: 14px 2px 2px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
.cm-month i { font-style: normal; background: #e2e8f0; color: #475569; border-radius: 999px; padding: 0 7px; letter-spacing: 0; }
.cm-row { display: grid; grid-template-columns: 42px minmax(200px, 1.6fr) minmax(170px, 1.3fr) 92px 110px 100px minmax(150px, 1fr) auto; align-items: center; gap: 14px;
  background: #fff; border: 1px solid #e8ecf3; border-radius: 14px; padding: 12px 14px; cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.cm-row:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, .08); border-color: #d5dcea; transform: translateY(-1px); }
.cm-av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; }
.cm-av.commande { background: linear-gradient(135deg, #10b981, #059669); }
.cm-av.devis { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.cm-name { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.cm-ag { background: #dcfce7; color: #166534; font-weight: 700; padding: 1px 8px; border-radius: 6px; font-size: 12px; }
.cm-ag.off { background: #1f2937; color: #fff; }
.cm-pr { background: #f1f5f9; color: #475569; font-weight: 600; padding: 1px 8px; border-radius: 6px; font-size: 12px; }
.cm-meta .lien-archive img { width: 16px; height: 16px; }
.cm-prod { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cm-chip { background: #eef2ff; color: #3730a3; padding: 4px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-qte { font-weight: 700; color: #334155; font-size: 13px; white-space: nowrap; }
.cm-date, .cm-amt, .cm-q { display: flex; flex-direction: column; font-size: 13.5px; white-space: nowrap; }
.cm-date small, .cm-amt small, .cm-q small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; font-weight: 600; }
.cm-amt b { font-size: 14.5px; }
.cm-dim { color: #cbd5e1; }
.cm-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.cm-tag { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.cm-tag.ok { background: #dcfce7; color: #166534; } .cm-tag.dv { background: #fef3c7; color: #92400e; }
.cm-tag.enc { background: #ede9fe; color: #6d28d9; } .cm-tag.ko { background: #fee2e2; color: #b91c1c; }
.cm-tag.pp { background: #f5f3ff; color: #7c3aed; } .cm-tag.ne { background: #f1f5f9; color: #64748b; }
.cm-act { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.cm-valid { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; padding: 7px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.cm-valid:hover { background: #d1fae5; }
.cm-ico { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 10px; background: #f8fafc; border: 1px solid #e2e8f0; }
.cm-ico:hover { background: #eef2ff; }
.cm-empty { background: #fff; border: 1px dashed #cbd5e1; border-radius: 14px; padding: 40px; text-align: center; color: var(--muted); }
@media (max-width: 1300px) { .cm-row { grid-template-columns: 42px 1.5fr 1.2fr 92px 110px auto; } .cm-q, .cm-tags { display: none; } .cm-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ===== Carte de France (Commerciaux SeLoger) ===== */
.carte-bloc { display: grid; grid-template-columns: minmax(320px, 520px) 1fr; gap: 18px; margin-bottom: 18px; align-items: start; }
.carte-fr { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.carte-fr svg { width: 100%; height: auto; display: block; }
.carte-fr path { fill: #c7d2fe; stroke: #fff; stroke-width: 1.2; cursor: pointer; transition: fill .12s; }
.carte-fr path:hover { fill: #818cf8; }
.carte-fr path.vide { fill: #e5e7eb; }
.carte-fr path.ach { fill: #fcd34d; }
.carte-fr path.sel { fill: #4f46e5; }
.carte-info { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; min-height: 200px; position: sticky; top: 16px; }
.ci-vide { color: var(--muted); padding: 40px 10px; text-align: center; }
.ci-tete { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ci-code { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #4f46e5, #2563eb); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.ci-roles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ci-role { background: #f8fafc; border: 1px solid #e8ecf3; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ci-role span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; font-weight: 700; }
@media (max-width: 1100px) { .carte-bloc { grid-template-columns: 1fr; } }

.logo .mark-img { width: 34px; height: 34px; display: block; }

/* ===== Onglet LegalCity de la fiche agence ===== */
.lc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lc-full { grid-column: 1 / -1; }
.lc-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.lc-kpis > div { background: #f8fafc; border: 1px solid #e8ecf3; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.lc-kpis span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; font-weight: 700; }
.lc-msg { background: #f8fafc; border-radius: 12px; padding: 12px 14px; }
.lc-msg-t { white-space: pre-wrap; margin-top: 6px; max-height: 260px; overflow: auto; }
.lc-hist { display: grid; gap: 2px; max-height: 420px; overflow: auto; }
.lc-hist > div { display: flex; gap: 14px; padding: 6px 4px; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; }
.lc-d { color: var(--muted); min-width: 120px; font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) { .lc-grid { grid-template-columns: 1fr; } }
.lc-alerte { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; }

.lc-suivi { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: grid; gap: 8px; }
.lc-at { color: #b45309; font-weight: 600; } .lc-ok { color: #15803d; font-weight: 600; }
.lc-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* Points de progression RIB / SEPA */
.sp-frise { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); margin: 6px 0 2px; }
.sp-frise::before, .sp-frise::after { content: ''; position: absolute; top: 9px; left: calc(100% / 14); height: 3px; border-radius: 2px; }
.sp-frise::before { right: calc(100% / 14); background: #dfe4ec; }
.sp-frise::after { width: calc((100% - 100% / 7) * var(--p, 0)); background: #22c55e; transition: width .4s; }
.sp-frise .sp-pt { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.sp-frise .sp-pt i { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid #cfd6e1; box-sizing: border-box; }
.sp-frise .sp-pt em { font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.25; max-width: 110px; }
.sp-frise .sp-pt.done i { background: #22c55e; border-color: #22c55e; }
.sp-frise .sp-pt.done i::after { content: '✓'; display: block; color: #fff; font-size: 11px; font-weight: 700; line-height: 14px; text-align: center; }
.sp-frise .sp-pt.cur i { background: var(--brand-2); border-color: #bfd3fb; box-shadow: 0 0 0 4px #dbe7fe; }
.sp-frise .sp-pt.cur em { color: var(--brand-2); font-weight: 700; }
.sp-frise .sp-pt.done em { color: var(--ok); }
.sp-cell { display: inline-flex; flex-direction: column; gap: 4px; }
.sp-dots { display: inline-flex; align-items: center; }
.sp-dots .sp-pt { width: 10px; height: 10px; border-radius: 50%; background: #d5dbe5; }
.sp-dots .sp-pt + .sp-pt { margin-left: 3px; position: relative; }
.sp-dots .sp-pt.done { background: #22c55e; }
.sp-dots .sp-pt.cur { background: var(--brand-2); box-shadow: 0 0 0 3px #dbe7fe; }
.sp-lab { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Fiche agence : encart du haut bien marqué */
.fiche-top { background: #fff; border: 1px solid #cdd5e1; border-top: 6px solid #15803d; border-radius: 16px; box-shadow: 0 6px 18px rgba(15, 23, 42, .08); padding: 18px 20px 16px; margin-bottom: 20px; }
.fiche-top.ft-off { border-top-color: #334155; }
.fiche-top .hero { margin-bottom: 14px; }
.fiche-top .stats { margin-bottom: 0; }
.fiche-top .stat { background: #f4f6fa; border-color: #e1e6ee; }
.fiche-top .alert-box { margin: 0 0 14px; }

/* ===== Marges produits ===== */
.mp-calc { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .mp-calc { grid-template-columns: 1fr; } }
.mp-etapes { display: flex; flex-direction: column; gap: 12px; }
.mp-etape { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.mp-etape.off { opacity: .55; box-shadow: none; }
.mp-num { flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--brand-2); color: #fff; font-weight: 700; display: grid; place-items: center; }
.mp-etape.off .mp-num { background: #cbd5e1; }
.mp-corps { flex: 1; min-width: 0; }
.mp-corps h3 { margin: 4px 0 10px; font-size: 15px; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-chip { --c: #2563eb; border: 2px solid color-mix(in srgb, var(--c) 35%, #fff); background: color-mix(in srgb, var(--c) 8%, #fff); color: #0f172a; border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: transform .1s, background .15s; }
.mp-chip:hover { transform: translateY(-1px); border-color: var(--c); }
.mp-chip.on { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 35%, transparent); }
.mp-chip.static { cursor: default; display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; }
.mp-chip.static button { padding: 0 6px; min-height: 0; border: 0; }
.mp-res { position: sticky; top: 16px; }
.mp-res-vide { border: 2px dashed #cbd5e1; border-radius: 18px; padding: 40px 20px; text-align: center; color: var(--muted); background: #fff8; }
.mp-ticket { --c: #7c3aed; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 14px 34px rgba(15, 23, 42, .14); border: 1px solid #e2e8f0; padding: 0 0 16px; animation: mpIn .25s ease-out; }
@keyframes mpIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.mp-t-head { display: flex; justify-content: space-between; background: var(--c); color: #fff; padding: 10px 18px; font-weight: 700; font-size: 13px; letter-spacing: .03em; }
.mp-t-prod { font-size: 22px; font-weight: 800; padding: 14px 18px 0; }
.mp-t-sous { color: var(--muted); padding: 2px 18px 0; }
.mp-t-prix { margin: 14px 18px 4px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--c) 10%, #fff); border: 1px solid color-mix(in srgb, var(--c) 25%, #fff); }
.mp-t-big { font-size: 34px; font-weight: 800; color: var(--c); line-height: 1.15; }
.mp-t-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 18px 0; }
.mp-t-grid div { background: #f4f6fa; border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.mp-t-grid span { font-size: 12px; color: var(--muted); }
.mp-t-grid b { font-size: 15px; }
.mp-t-params { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 12px 18px 0; font-size: 12.5px; color: var(--muted); }
.mp-t-notes { margin: 12px 18px 0; font-size: 12.5px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; }
.mp-t-actions { display: flex; gap: 8px; padding: 14px 18px 0; }
.mp-vide { text-align: center; padding: 36px 20px; }
.mp-groupes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.mp-gcard { --c: #7c3aed; display: block; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 14px; padding: 16px; color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.mp-gcard:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(15, 23, 42, .1); }
.mp-gcard.arch { opacity: .55; }
.mp-gnom { font-size: 17px; font-weight: 800; margin-bottom: 4px; color: var(--c); }
.mp-head { --c: #7c3aed; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--c); border-radius: 16px; padding: 14px 18px; margin: 8px 0 16px; box-shadow: var(--shadow); }
.mp-head h1 { margin: 0; }
.mp-an { font-size: 16px; background: var(--c); color: #fff; border-radius: 999px; padding: 2px 10px; vertical-align: middle; }
.mp-annee { margin: 18px 0 10px; font-size: 18px; }
.mp-prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.mp-pcard { --c: #7c3aed; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.mp-pcard a { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.mp-pcard a b { font-size: 16px; }
.mp-zone { --c: #64748b; display: inline-block; background: var(--c); color: #fff; font-weight: 700; font-size: 12px; border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.mp-table th.calc, .mp-table td.calc { background: #f1f5f9; color: #475569; }
.mp-table th.princ { color: var(--brand-2); }
.mp-table td { padding: 4px 6px; }
.mp-in { width: 110px; padding: 5px 8px; text-align: right; border: 1px solid transparent; background: transparent; border-radius: 6px; }
.mp-in:hover { border-color: var(--line); background: #fff; }
.mp-in:focus { border-color: var(--brand-2); background: #fff; outline: none; }
.mp-in.ok { background: #dcfce7; transition: background .3s; }
td.princ .mp-in { font-weight: 700; }
.mp-li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mp-li .sp { flex: 1; }
.mp-param { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr auto auto; gap: 8px; align-items: center; margin-top: 8px; }
.mp-couleurs { display: flex; gap: 8px; flex-wrap: wrap; }
.mp-couleurs label { margin: 0; cursor: pointer; }
.mp-couleurs input { display: none; }
.mp-couleurs span { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px #cbd5e1; }
.mp-couleurs input:checked + span { box-shadow: 0 0 0 3px var(--c); }
#mod label { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 4px 0; }
#mod input { width: auto; }
.mp-assist { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: 13px; }
.mp-assist select { width: auto; max-width: 260px; padding: 4px 8px; }
.mp-assist b { width: 100%; }
.mp-simu { margin: 14px 18px 0; padding: 12px 14px; border: 1px dashed #cbd5e1; border-radius: 12px; }
.mp-simu .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.mp-simu input { width: 120px; }
.mp-simu select { width: auto; }
.mp-simu .res { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.mp-simu .res div { border-radius: 10px; padding: 8px 10px; background: #f4f6fa; display: flex; flex-direction: column; }
.mp-simu .res .pos { background: #dcfce7; color: #166534; }
.mp-simu .res .neg { background: #fee2e2; color: #991b1b; }
.mp-simu .res span { font-size: 12px; }
.mp-per { display: inline-block; font-size: 12px; font-weight: 600; background: #fef3c7; color: #92400e; border-radius: 999px; padding: 2px 9px; vertical-align: middle; }
.mp-pcard .mp-per { align-self: flex-start; margin: 3px 0; }
.mp-var { font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 1px 5px; background: #f1f5f9; color: #475569; white-space: nowrap; }
.mp-var.up { background: #fee2e2; color: #b91c1c; }
.mp-var.down { background: #dcfce7; color: #166534; }
.mp-histo-t { margin: 14px 18px 0; padding: 10px 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; font-size: 13px; }
.mp-histo-t table { width: 100%; margin-top: 6px; background: none; }
.mp-histo-t td { padding: 4px 4px; border-top: 1px solid #e2e8f0; }
.mp-histo-t tr.on td { font-weight: 700; color: var(--brand-2); }
#dq { display: flex; gap: 16px; flex-wrap: wrap; }
#dq label { display: flex; gap: 6px; align-items: center; margin: 0; font-weight: 600; }
#dq input { width: auto; }
.mp-gcard { padding: 0; display: flex; flex-direction: column; }
.mp-glien { display: block; padding: 16px 16px 8px; color: inherit; text-decoration: none; flex: 1; }
.mp-gtools { display: flex; gap: 2px; padding: 4px 8px 8px; border-top: 1px dashed var(--line); opacity: .55; transition: opacity .15s; }
.mp-gcard:hover .mp-gtools { opacity: 1; }
.mp-gtools button { padding: 2px 7px; min-height: 0; font-size: 13px; }
.mp-gtools button[data-a="del"] { margin-left: auto; }
.mp-gtools button:disabled { opacity: .3; }

/* Marges produits : tableau des tarifs (v2) */
.mp-grid { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; display: inline-block; max-width: 100%; }
.mp-grid-aide { padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.mp-grid-scroll { overflow: auto; max-height: 72vh; }
.mp-table { width: auto; border-collapse: separate; border-spacing: 0; background: #fff; }
.mp-table th { position: sticky; top: 0; z-index: 1; background: #f4f6fa; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: #475569; padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mp-table th:first-child { text-align: left; }
.mp-table th.calc { background: #ede9fe; color: #6d28d9; }
.mp-table th.princ { color: var(--brand-2); }
.mp-table th.calc.princ { color: #6d28d9; }
.mp-table td { padding: 0; border-bottom: 1px solid #eef1f5; min-width: 150px; height: 42px; }
.mp-table tr:last-child td { border-bottom: 0; }
.mp-table tbody tr:hover td { background: #f8fafc; }
.mp-table td.mp-vol { min-width: 90px; padding: 0 14px; font-weight: 800; font-size: 15px; color: #0f172a; }
.mp-table td:has(.mp-zone) { min-width: 110px; padding: 0 14px; }
.mp-table td.calc { background: #f7f5ff; color: #5b21b6; text-align: right; padding: 0 16px; font-weight: 600; font-variant-numeric: tabular-nums; border-left: 1px solid #ede9fe; }
.mp-table tbody tr:hover td.calc { background: #f1edff; }
.mp-table td.calc.princ { font-weight: 800; font-size: 15px; }
.mp-table td.saisie { padding: 3px 6px; }
.mp-table .mp-in { width: 100%; box-sizing: border-box; height: 34px; padding: 4px 10px; text-align: right; font: inherit; font-variant-numeric: tabular-nums; color: #0f172a; border: 1px solid transparent; background: transparent; border-radius: 8px; }
.mp-table .mp-in:hover { border-color: #d6dde8; background: #fff; }
.mp-table .mp-in:focus { border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px #dbe7fe; outline: none; text-align: right; }
.mp-table .mp-in::placeholder { color: #cbd5e1; }
.mp-table td.princ .mp-in { font-weight: 800; }
.mp-table td.ok, .mp-table td.ok .mp-in { background: #dcfce7 !important; transition: background .3s; }
.mp-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .03em; border-radius: 999px; padding: 1px 7px; margin-left: 4px; text-transform: lowercase; vertical-align: 1px; }
.mp-tag.calc { background: #7c3aed; color: #fff; }
.mp-table td.right { padding: 0 14px; text-align: right; font-variant-numeric: tabular-nums; }
.mp-grid { display: inline-flex; flex-direction: column; }
.mp-grid-aide { width: 0; min-width: 100%; box-sizing: border-box; }
.mp-t-gamme, .mp-gamme { display: inline-block; font-size: .7em; font-weight: 800; color: #fff; background: var(--c, #7c3aed); border-radius: 8px; padding: 2px 10px; vertical-align: middle; }
.mp-pgroupe { --c: #7c3aed; margin-bottom: 12px; }
.mp-pgroupe-t { width: 100%; display: flex; gap: 14px; align-items: center; text-align: left; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); cursor: pointer; transition: transform .12s, box-shadow .12s; font: inherit; color: inherit; }
.mp-pgroupe-t:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(15, 23, 42, .1); }
.mp-pg-nom { font-size: 18px; font-weight: 800; }
.mp-pg-sous { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.mp-pg-chip { --c: #64748b; font-size: 12px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); border-radius: 999px; padding: 3px 10px; }
.mp-pg-fl { color: var(--muted); font-size: 13px; }
.mp-pg-corps { display: none; margin: 10px 0 0 18px; padding-left: 14px; border-left: 2px dashed #cbd5e1; }
.mp-pgroupe.open .mp-pg-corps { display: grid; animation: mpIn .2s ease-out; }
.mp-pgroupe.open .mp-pgroupe-t { border-bottom-left-radius: 14px; }
/* Marges produits : cartes des sous-produits (V3.20) */
.mp-cp { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.mp-cp input { width: 150px; font-size: 15px; padding: 8px 12px; border-radius: 10px; }
.mp-cp .ok { color: #15803d; }
.mp-cp .ko { color: #b91c1c; }
.mp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mp-card { --c: #7c3aed; position: relative; text-align: left; display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1.5px solid #e2e8f0; border-top: 5px solid var(--c); border-radius: 16px; padding: 14px 16px 16px; cursor: pointer; font: inherit; color: #0f172a; transition: transform .12s, box-shadow .15s, border-color .15s; min-height: 0; }
.mp-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, .10); border-color: color-mix(in srgb, var(--c) 45%, #e2e8f0); border-top-color: var(--c); }
.mp-card.on { background: color-mix(in srgb, var(--c) 7%, #fff); border-color: var(--c); box-shadow: 0 10px 26px color-mix(in srgb, var(--c) 25%, transparent); }
.mp-card.off { cursor: default; opacity: .55; }
.mp-card-nom { font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 75%, #0f172a); }
.mp-card-prix { font-size: 30px; font-weight: 800; line-height: 1.1; margin-top: 4px; }
.mp-card-lib { font-size: 12px; color: var(--muted); }
.mp-card-pp { font-size: 12.5px; color: var(--muted); }
.mp-card-pp s { color: #94a3b8; font-weight: 600; }
.mp-card-pa { align-self: flex-start; margin-top: 6px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--c) 12%, #fff); color: color-mix(in srgb, var(--c) 80%, #0f172a); border-radius: 999px; padding: 3px 10px; }
/* V3.21 : frise SEPA cliquable dans la fiche */
.sp-frise .sp-pt[data-et] { cursor: pointer; }
.sp-frise .sp-pt[data-et]:hover i { transform: scale(1.25); box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
.sp-frise .sp-pt[data-et]:hover em { color: var(--text, #0f172a); }
/* V3.25 : mandat SEPA signé / pas signé */
.doc-signe { display: flex; align-items: center; gap: 8px; }
.doc-signe .doc { flex: 1; min-width: 0; }
.sig { white-space: nowrap; font-weight: 700; border-radius: 999px; }
.sig-ok { background: #dcfce7; color: #15803d; border-color: #86efac; }
.sig-non { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.sig-ok:hover { background: #bbf7d0; } .sig-non:hover { background: #fecaca; }
/* V3.26 : Boîte mails façon Gmail (liste + lecture) */
.bx-filtres { margin: 4px 0 12px; }
.bx-filtres b { font-weight: 700; opacity: .6; margin-left: 4px; }
.bx { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 14px; align-items: start; }
.bx-liste { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: auto; max-height: calc(100vh - 220px); }
.bx-jour { position: sticky; top: 0; z-index: 1; background: #f6f8fb; padding: 6px 14px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: capitalize; border-bottom: 1px solid var(--line); }
.bx-row { position: relative; display: grid; grid-template-columns: 1fr; padding-left: 28px !important; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #eef1f5; border-radius: 0; padding: 10px 14px; cursor: pointer; font: inherit; color: inherit; }
.bx-row:hover { background: #f5f8ff; }
.bx-row.on { background: #eaf1ff; box-shadow: inset 3px 0 0 var(--brand, #2563eb); }
.bx-pt { position: absolute; left: 12px; top: 16px; width: 8px; height: 8px; border-radius: 50%; }
.bx-row.nonlu .bx-pt { background: var(--brand, #2563eb); }
.bx-l1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bx-de { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.bx-h { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bx-suj { font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.bx-ext { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bx-row.nonlu .bx-de, .bx-row.nonlu .bx-suj { font-weight: 800; color: #0f172a; }
.bx-ag { font-size: 10.5px; font-weight: 800; background: #dcfce7; color: #15803d; border-radius: 6px; padding: 1px 6px; white-space: nowrap; text-decoration: none; }
.bx-ag.lg { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; display: inline-block; }
.bx-lire { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 24px; min-height: 300px; position: sticky; top: 12px; max-height: calc(100vh - 160px); overflow: auto; }
.bx-tete h2 { margin: 0 0 6px; font-size: 19px; }
.bx-meta { font-size: 13px; margin-bottom: 8px; }
.bx-agl { margin-bottom: 10px; }
.bx-tete .actions { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.bx-pj { font-size: 12.5px; background: #f8fafc; border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; }
.bx-corps { font-size: 14px; line-height: 1.6; white-space: normal; word-break: break-word; }
.bx-vide { padding: 40px 20px; text-align: center; color: var(--muted); }
@media (max-width: 900px) { .bx { grid-template-columns: 1fr; } .bx-lire, .bx-liste { position: static; max-height: none; } }
/* V3.27 : catégories de mails */
.bx-cat { --c: #94a3b8; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; line-height: 1; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); border: 1px solid color-mix(in srgb, var(--c) 30%, #fff); border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.bx-cat::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.bx-l3 { margin-top: 5px; }
.bx-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; align-items: center; }
.bx-catf { cursor: pointer; font-size: 12px; padding: 5px 10px; }
.bx-catf b { opacity: .7; }
.bx-catf.on { background: var(--c); color: #fff; border-color: var(--c); }
.bx-catf.on::before { background: #fff; }
.bx-agl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bx-nb { font-size: 11px; font-weight: 600; color: var(--muted); }
.bx-msg { border-top: 1px solid var(--line); padding: 12px 0; }
.bx-msg:first-of-type { border-top: 0; }
details.bx-msg summary { cursor: pointer; list-style: none; }
details.bx-msg summary::-webkit-details-marker { display: none; }
details.bx-msg:not([open]) summary::after { content: ' — déplier'; color: var(--muted); font-size: 12px; }
.bx-msg .bx-corps { margin-top: 8px; }
.bx-crayon { padding: 3px 7px; }
.bx-corps { font-size: 14.5px; line-height: 1.65; color: #1e293b; max-width: 72ch; }
.bx-cite { margin-top: 14px; }
.bx-cite summary { cursor: pointer; list-style: none; display: inline-block; font-size: 12px; color: var(--muted); background: #f1f5f9; border-radius: 999px; padding: 3px 10px; }
.bx-cite summary::-webkit-details-marker { display: none; }
.bx-cite[open] .bx-corps { margin-top: 10px; padding-left: 12px; border-left: 3px solid #e2e8f0; color: #64748b; font-size: 13px; }
/* V3.29 : pièces jointes ouvertes dans l'outil */
.bx-pj { display: flex; flex-wrap: wrap; gap: 6px; background: none; padding: 0; }
.bx-pjb { font-size: 12.5px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.bx-pjb:hover { background: #e0ecff; border-color: #93c5fd; }
.bx-apercu { width: 100%; height: 65vh; border: 1px solid var(--line); border-radius: 10px; object-fit: contain; background: #f8fafc; }
.bx-ranger { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.bx-ranger .row { margin-top: 6px; }

/* ✏️ Modifier un mail : panneau à droite */
.mail-tiroir { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); background: var(--card, #fff); box-shadow: -8px 0 24px rgba(0,0,0,.18); z-index: 1001; display: flex; flex-direction: column; gap: 10px; padding: 16px; animation: mtIn .18s ease-out; }
.mail-tiroir header { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.mail-tiroir textarea { width: 100%; resize: vertical; }
.mail-tiroir .mt-hist { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.mail-tiroir .mt-c { background: #f3eef8; border-radius: 8px; padding: 6px 9px; font-size: 13px; }
.mail-tiroir .mt-act { display: flex; gap: 8px; flex-wrap: wrap; }
@keyframes mtIn { from { transform: translateX(40px); opacity: 0 } to { transform: none; opacity: 1 } }
textarea.flash { outline: 2px solid #7a3e9d; transition: outline .3s; }
@media (min-width: 1100px) { .modal-bg:has(.mail-tiroir) .modal { margin-right: 400px; } }

/* Boîte mails : boutons à droite du sujet + « Traité » */
.bx-haut { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 4px; }
.bx-haut h2 { flex: 1 1 auto; min-width: 0; }
.bx-btns { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; align-items: center; max-width: 55%; }
@media (max-width: 900px) { .bx-haut { flex-direction: column; } .bx-btns { max-width: none; justify-content: flex-start; } }
.bx-traite.on { background: #dcfce7; border-color: #86efac; color: #166534; font-weight: 700; }
.bx-ok { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; color: #166534; background: #dcfce7; border-radius: 999px; padding: 1px 7px; }
.bx-agl { padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }

/* Mail : choix des destinataires */
.dest-choix { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.dest-choix .dest { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line, #e5e7eb); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; margin: 0; font-weight: 400; }
.dest-choix .dest:has(input:checked) { background: #eaf1ff; border-color: #93c5fd; }
.dest-choix .dest b { font-weight: 700; margin-right: 2px; }
.assist-act.ajout { background: #f3eef8; border-radius: 8px; }
