/* ED CONSULT — interface 2.0 : menu à gauche, cartes blanches sur fond pierre, bordeaux du logo.
   Les documents imprimés ont leur propre feuille (sheet.css). */
@font-face { font-family: "Marcellus"; src: url("fonts/marcellus.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  --ground: #f4f3f2;
  --surface: #ffffff;
  --line: #e4dfdd;
  --line-soft: #efebe9;
  --field-edge: #d8d2cf;
  --ink: #1c1a1a;
  --ink-soft: #4d4747;
  --ink-faint: #6a6260;
  --accent: #6e0a0e;
  --accent-dark: #4a0609;
  --accent-ink: #ffffff;
  --accent-soft: #f6ecec;
  --accent-line: #e6cfd0;
  --ok: #1b5e33; --ok-bg: #e6f2ea; --ok-line: #bfdcc7;
  --warn: #8a4a00; --warn-bg: #fdf0dc; --warn-line: #f0d7ae;
  --danger: #a31621; --danger-bg: #fbe6e6; --danger-line: #ecc9c9;
  --na-bg: #efedec;
  --paper: #ffffff; --paper-ink: #1a1a1a; --paper-soft: #58524f; --paper-rule: #dcd8d6;
  --panel: #ffffff; --panel-edge: #e4dfdd;
  --sans: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --display: "Marcellus", Georgia, serif;
  --serif: Georgia, "Times New Roman", serif;
  --r-card: 14px; --r-ctl: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #d2ccc9; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b9b1ae; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- icônes ---------- */
svg.ico { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; display: block; }
[data-ico] { display: inline-flex; align-items: center; }

/* ---------- boutons ---------- */
button {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--field-edge); background: var(--surface); color: var(--ink);
  border-radius: var(--r-ctl); white-space: nowrap;
}
button:hover { background: #faf8f7; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
button.ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
button.ghost:hover { background: var(--accent-soft); color: var(--accent); }
button.danger { color: var(--danger); border-color: var(--danger-line); background: var(--surface); }
button.danger:hover { background: var(--danger-bg); }
button.icon-btn { min-height: 38px; width: 38px; padding: 0; border-color: transparent; background: transparent; color: var(--ink-soft); }
button.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- champs ---------- */
input, select, textarea {
  font: inherit; font-size: 14px; font-weight: 400; color: var(--ink);
  background: var(--surface); border: 1px solid var(--field-edge);
  border-radius: 9px; padding: 0 12px; min-height: 40px; width: 100%;
}
input[type="checkbox"], input[type="radio"] { width: 16px; min-height: 0; height: 16px; padding: 0; accent-color: var(--accent); flex-shrink: 0; }
textarea { resize: vertical; min-height: 76px; padding: 9px 12px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110, 10, 14, .12); outline: none; }
input::placeholder, textarea::placeholder { color: #9b9390; }
input.bad { border-color: var(--danger); background: #fff7f7; }
/* minmax(0, …) partout : un champ ne doit jamais élargir sa carte */
input, select, textarea { min-width: 0; }
label.f { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
label.chk { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--ink); font-weight: 500; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.row7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.row7 label.f { font-size: 11px; }
.row7 input { padding: 0 4px; text-align: center; }
.row3civ { display: grid; grid-template-columns: 84px minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.hint { font-size: 12px; color: var(--ink-faint); font-weight: 400; line-height: 1.45; }
.fin-section { font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin-top: 8px; }
.spacer { flex: 1; }

/* ======================= STRUCTURE : menu + page ======================= */
.shell { display: grid; grid-template-columns: 266px minmax(0, 1fr); height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px 14px; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; min-height: 0; }
.side-logo { width: 132px; height: auto; margin-left: 8px; display: block; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-group { padding: 12px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.side-group:first-child { padding-top: 0; }
.side-nav button {
  width: 100%; min-height: 44px; padding: 0 14px; gap: 12px; justify-content: flex-start;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); font-size: 14.5px; font-weight: 500;
}
.side-nav button:hover { background: var(--accent-soft); color: var(--accent); }
.side-nav button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.side-nav .lbl { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.side-nav .count { font-size: 12px; font-weight: 500; opacity: .75; }
.side-nav .count:empty { display: none; }
.side-nav .badge { min-width: 24px; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.side-nav .badge.alert { background: #c0392b; }
.side-nav button[aria-selected="true"] .badge { background: #fff; color: var(--accent); }
.side-user { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 0 6px; min-width: 0; }
.user-chip .who { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.user-chip .who b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { font-size: 12px; color: var(--ink-faint); }
.side-actions { display: flex; gap: 2px; justify-content: space-between; }
.av { width: 36px; height: 36px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
.av.sm { width: 22px; height: 22px; font-size: 9.5px; }
.av.sq { border-radius: 10px; width: 38px; height: 38px; }
.shell-main { min-width: 0; height: 100vh; overflow: hidden; }
.view { height: 100%; display: flex; flex-direction: column; min-height: 0; }

/* ======================= PAGES D'ACCUEIL ======================= */
.page-head { padding: 28px 36px 0; display: flex; flex-direction: column; gap: 6px; }
.page-sub { font-size: 13px; font-weight: 500; color: var(--ink-faint); min-height: 1.2em; }
.page-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 38px; line-height: 1.1; }
.home-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 20px 36px 26px; }
.home-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.home-toolbar .search { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; width: min(360px, 100%); background: var(--surface); border: 1px solid var(--field-edge); border-radius: 10px; color: var(--ink-faint); }
.home-toolbar .search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110, 10, 14, .12); }
.home-toolbar .search input { border: 0; padding: 0; min-height: 0; height: 38px; background: transparent; box-shadow: none; }
.home-toolbar input[type="search"] { width: min(340px, 100%); }
.home-toolbar select { width: auto; }
.home-toolbar label.chk { font-size: 13px; }
.tb-group { display: flex; gap: 8px; flex-wrap: wrap; }
.home-hint { font-size: 12.5px; color: var(--ink-faint); }
.home-hint:empty { display: none; }
.home-table-wrap { flex: 0 1 auto; min-height: 0; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.home-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
.home-table th {
  position: sticky; top: 0; z-index: 1; background: var(--surface);
  text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-faint); padding: 14px 16px; border-bottom: 1px solid var(--line);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.home-table th:first-child, .home-table td:first-child { padding-left: 22px; }
.home-table th.sorted { color: var(--accent); }
.home-table td { padding: 0 16px; height: 64px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.home-table tbody tr { cursor: pointer; }
.home-table tbody tr:hover { background: #faf8f7; }
.home-table td.muted { color: var(--ink-soft); font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.home-table td.go { width: 36px; color: #a59c99; padding-right: 18px; }
/* formalités ponctuelles archivées */
.home-table td.act { text-align: right; white-space: nowrap; padding-right: 18px; }
.home-table td.act button { min-height: 32px; padding: 0 12px; font-size: 12.5px; margin-left: 8px; }
.home-table tr.archive td { background: #faf9f8; color: var(--ink-faint); }
.home-table tr.archive .cli-name { color: var(--ink-soft); }
.arch-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--na-bg); color: #6d6461; font-size: 12px; font-weight: 700; white-space: nowrap; }
#homeBandeau:empty { display: none; }
#homeBandeau .bandeau button { margin-left: auto; }
.cli { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cli-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cli-name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.cli-sub { font-size: 12.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.forme-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--accent-line); background: #fbf5f5; color: var(--accent); font-size: 12px; font-weight: 700; }
.op-pill { display: inline-block; padding: 4px 11px; border-radius: 999px; background: var(--na-bg); color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }
.s-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.s-pill::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.s-pill.s-ok { background: var(--ok-bg); color: var(--ok); }
.s-pill.s-warn { background: var(--warn-bg); color: var(--warn); }
.s-pill.s-bad { background: var(--danger-bg); color: #8f1d1d; font-weight: 700; }
.home-empty { padding: 44px; text-align: center; color: var(--ink-faint); }

/* ======================= MODULES (tâches, suivis, codes) ======================= */
.home-module { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.mod-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.mod-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.mod-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 18px; display: flex; align-items: baseline; gap: 10px; font-size: 13.5px; color: var(--ink-soft); }
/* chiffres en police de texte : dans la police de titre, « 1 » et « 0 » se lisent « I » et « O » */
.mod-stat b { font-family: var(--sans); font-weight: 700; font-size: 26px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.mod-stat.alert b { color: var(--danger); }
.mod-legend { display: flex; gap: 8px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-soft); }
.mod-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.mod-legend .dot { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.subtabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.subtabs button { min-height: 34px; border: 0; background: transparent; color: var(--ink-soft); font-weight: 500; }
.subtabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.card-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: clip; width: max-content; min-width: 100%; flex-shrink: 0; }
.card-note { padding: 14px 18px; font-size: 13px; color: var(--ink-soft); }
.card-note a { font-weight: 600; text-decoration: none; }

.suivi-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.suivi-table th {
  position: sticky; top: 0; z-index: 2; background: var(--surface); text-align: center;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint);
  padding: 12px 3px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.suivi-table th.name, .suivi-table td.name { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 150px; padding-left: 20px; padding-right: 6px; }
.suivi-table th.name { z-index: 3; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ink); }
.suivi-table td { padding: 6px 3px; border-bottom: 1px solid var(--line-soft); text-align: center; vertical-align: middle; }
.suivi-table td.name { font-weight: 600; max-width: 230px; overflow-wrap: anywhere; }
.suivi-table td.name a { color: var(--ink); text-decoration: none; font-size: 13.5px; }
.suivi-table td.name a:hover { color: var(--accent); }
.suivi-table td.name .sub, .suivi-table th.name .sub { display: block; font-weight: 400; font-size: 12px; color: var(--ink-faint); }
.suivi-table td.comment { padding: 6px 12px 6px 6px; }
.suivi-table td.comment input { min-width: 104px; min-height: 36px; font-size: 13px; padding: 0 10px; }
.suivi-table td.off { background: #faf9f8; }
.st { display: grid; gap: 2px; justify-items: center; }
.st select {
  appearance: none; -webkit-appearance: none; width: 100%; min-width: 56px; min-height: 36px; padding: 0 2px;
  font-size: 11.5px; font-weight: 700; text-align: center; text-align-last: center; border-radius: 9px; cursor: pointer;
  background: transparent; border: 1px dashed #b9b1ae; color: var(--ink-faint);
}
.st select:focus { box-shadow: 0 0 0 3px rgba(110, 10, 14, .12); }
.st .d { font-size: 10.5px; color: var(--ink-faint); line-height: 1.1; min-height: 1.1em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.st.ok select { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok); }
.st.warn select { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn); }
.st.bad select { background: var(--danger-bg); border: 1px solid var(--danger-line); color: #8f1d1d; }
.st.na select { background: var(--na-bg); border: 1px solid var(--line); color: #5d5553; }
.st.late select { background: var(--surface); border: 2px solid var(--danger); color: var(--danger); }
/* 2.8 — statut proposé par un agent du serveur, en attente de validation */
.st.propose select { background: #fbf5f5; border: 2px dashed var(--accent); color: var(--accent); }
.st.propose .d:empty::after { content: "proposé"; color: var(--accent); font-weight: 700; }
.prop-panel { padding: 14px 16px; display: grid; gap: 10px; flex-shrink: 0; }
.prop-titre { font-weight: 700; color: var(--ink); }
.prop { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--accent-line); border-left: 4px solid var(--accent); border-radius: 0; }
.prop-qui { font-size: 12px; color: var(--ink-faint); }
.prop-quoi { font-size: 14px; color: var(--ink); }
.prop-pourquoi { font-size: 12.5px; color: var(--ink-soft); }
.prop-boutons { grid-row: 1 / span 3; grid-column: 2; display: flex; gap: 6px; }
/* 2.8 — onglet « Mails » de la fiche : la liste prend toute la largeur (pas de document à droite) */
.content.sans-doc { grid-template-columns: minmax(0, 1fr); }
.content.sans-doc .doc-col { display: none; }
.content.sans-doc .form-col { max-width: 980px; }
.mails-filtres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.mails-filtres button { min-height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; }
.mails-filtres button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.mail-agent { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 14px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; }
.ma-quand { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.ma-objet { font-weight: 600; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.ma-resume { font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.ma-droite { grid-row: 1 / span 3; grid-column: 2; display: grid; gap: 6px; justify-items: end; align-content: start; }
.ma-droite button { min-height: 28px; padding: 0 10px; font-size: 12px; }
.ma-cat { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--na-bg); color: #5d5553; }
.ma-cat.urgent { background: var(--danger-bg); color: #8f1d1d; }
.ma-cat.pieces { background: #e6f3f1; color: #0f5e54; }
.ma-cat.paie { background: #e8f0fb; color: #1d4f8f; }
.ma-cat.question, .ma-cat.juridique { background: var(--accent-soft); color: var(--accent); }
.ma-cat.suspect { background: var(--warn-bg); color: var(--warn); }
.ma-cat.accuse { background: var(--ok-bg); color: var(--ok); }
.ma-etat { font-size: 12px; font-weight: 600; white-space: nowrap; }
.ma-etat.ok { color: var(--ok); }
.ma-etat.attente { color: var(--warn); }
.row-actions { white-space: nowrap; }
.row-actions button { min-height: 30px; width: 30px; padding: 0; }
.row-actions button.mail-on { color: var(--accent); }
.row-actions button.mail-off { color: #c9c1be; }
.relance { color: var(--warn); font-weight: 600; }
.bil-note { font-size: 12.5px; color: var(--ink-faint); line-height: 1.5; }
.bil-note b { color: var(--ink-soft); }

/* bilans : tableau groupé saisies / bilan / comptes annuels */
.bil-table th.grp-h { white-space: normal; line-height: 1.2; font-size: 11px; color: var(--accent); letter-spacing: .1em; border-bottom: 1px solid var(--line); padding-top: 10px; padding-bottom: 6px; }
.bil-table thead tr:nth-child(2) th { top: 33px; }
.bil-table th.g1, .bil-table td.g1 { border-left: 1px solid #d9d2cf; }
.bil-table td.comment input { min-width: 104px; }
.bil-table td.name { max-width: 190px; }
.bil-table td.clo { text-align: left; white-space: nowrap; padding-left: 6px; padding-right: 6px; font-variant-numeric: tabular-nums; }
.bil-table td.clo b { display: block; font-size: 13px; font-weight: 600; }
.bil-table td.clo .ech { display: block; font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.bil-table td.clo .ech.proche { color: var(--warn); font-weight: 700; }
.bil-table td.clo .ech.depassee { color: var(--danger); font-weight: 700; }
.bil-table tr.done td { background: #fbfaf9; }
.bil-table tr.done td.name a { color: var(--ink-soft); }
.bil-table tr.done td.name .sub::after { content: " · Bilan terminé"; color: var(--ok); font-weight: 600; }
.prio-cell { display: inline-flex; align-items: center; gap: 6px; }
.prio select { appearance: none; -webkit-appearance: none; min-width: 74px; min-height: 30px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; text-align: center; text-align-last: center; cursor: pointer; background: transparent; border: 1px solid var(--line); color: var(--ink-faint); }
.prio.haute select { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.prio.basse select { background: var(--na-bg); color: #6d6461; }
.rang { width: 44px; min-height: 30px; padding: 0 4px; text-align: center; font-weight: 700; font-size: 13px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.rang::-webkit-inner-spin-button, .rang::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.suivi-table td.off .st select { opacity: .75; }

/* attestations : montant libre sous une dette, dette reportée */
.att-table td { min-width: 124px; }
.att-table .st { gap: 4px; }
.mt-in { width: 118px; min-width: 0; min-height: 28px; padding: 0 6px; font-size: 12px; font-weight: 700; text-align: center; color: #8f1d1d; border: 1px solid var(--warn-line); border-radius: 8px; background: #fffaf2; }
.mt-in::placeholder { color: #b58a55; font-weight: 500; }
.st .d.mt { color: #8f1d1d; font-weight: 700; }
.st.reporte select { border-style: dashed; border-width: 1.5px; }
.st.reporte .mt-in { border-style: dashed; background: transparent; }
.rep { font-size: 10.5px; line-height: 1.1; color: var(--warn); font-weight: 600; white-space: nowrap; }
.bandeau { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: #6b3a00; font-size: 13.5px; flex-shrink: 0; }
.bandeau.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.bandeau.gris { background: var(--na-bg); border-color: var(--line); color: var(--ink-soft); }
#sortieModal .modal { width: min(580px, 100%); }

/* classement des attestations */
.class-dossiers { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-soft); }
.class-dossiers .chemin { font-family: Consolas, "Courier New", monospace; font-size: 12px; overflow-wrap: anywhere; }
.class-dossiers button { min-height: 26px; padding: 0 10px; font-size: 12px; margin-left: 6px; }
.class-wrap { width: 100%; min-width: 0; overflow-x: auto; }
.imp-table th { position: static; }
.imp-table td, .imp-table th { text-align: left; padding: 9px 10px; vertical-align: top; }
.imp-table td.fichier { font-size: 12.5px; color: var(--ink-soft); max-width: 230px; overflow-wrap: anywhere; }
.imp-table select { min-height: 34px; font-size: 13px; max-width: 230px; }
.imp-table .nom-fichier { display: block; font-size: 12.5px; overflow-wrap: anywhere; }
.imp-res { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.imp-res.ok { background: var(--ok-bg); color: var(--ok); }
.imp-res.inconnu { background: var(--danger-bg); color: #8f1d1d; }
.org-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }

/* import du tableau Excel des bilans */
.imp-annees { display: flex; flex-wrap: wrap; align-self: flex-start; }
.imp-annees button { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.imp-scroll { max-height: 50vh; overflow: auto; }
/* fenêtre d'import : le tableau prend la place restante, les boutons restent visibles */
#bilImpModal .modal { display: flex; flex-direction: column; }
#bilImpModal .modal > * { flex-shrink: 0; }
#bilImpModal .modal > .imp-scroll { flex: 1 1 auto; min-height: 160px; max-height: none; }
.imp-table td.nomx { font-weight: 600; white-space: nowrap; }
.chg { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 9px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chg.efface { background: var(--na-bg); color: #6d6461; }
.chg.com { background: var(--accent-soft); color: var(--accent); }
.imp-table .cree { display: block; margin-top: 4px; color: var(--accent); font-weight: 600; font-size: 12px; }
#bilImpResume button { margin-left: 10px; min-height: 30px; font-size: 12.5px; }

/* bilans ponctuels (sociétés hors de la liste des clients) */
.ponct-pill { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; vertical-align: 1px; }
.op-pill.bilan { background: var(--accent-soft); color: var(--accent); }
/* suivis du cabinet dans la liste des clients */
.suivi-pill { display: inline-block; margin: 1px 6px 1px 0; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.suivi-pill.compta { background: var(--accent-soft); color: var(--accent); }
.suivi-pill.paie { background: var(--ok-bg); color: var(--ok); }
.home-table td.suivis { white-space: nowrap; }
.home-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* liste des clients avec honoraires : colonnes plus serrées pour tenir en largeur */
.home-table.avec-hono th, .home-table.avec-hono td { padding-left: 10px; padding-right: 10px; }
.home-table.avec-hono th:first-child, .home-table.avec-hono td:first-child { padding-left: 18px; }
.home-table.avec-hono td[data-k="dirigeant"] { white-space: normal; }
.mod-stat b { white-space: nowrap; }

/* tarifs du cabinet (2.6) */
.statut-l { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.statut-l.signee { background: var(--ok-bg); color: var(--ok); }
.statut-l.envoyee { background: var(--accent-soft); color: var(--accent); }
.statut-l.envoyer { background: var(--na-bg); color: #6d6461; }
.statut-l.renouveler { background: var(--warn-bg); color: var(--warn); }
.statut-l.alerte { background: var(--danger-bg); color: #8f1d1d; }
.tar-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.tar-table th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); padding: 10px; border-bottom: 1px solid var(--line); }
.tar-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tar-table tr.cat td { background: var(--bg); font-weight: 700; font-size: 12.5px; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; padding: 10px 12px; }
.tar-table tr.cat td small { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-faint); margin-left: 8px; }
.tar-table tr.cat td button { float: right; text-transform: none; letter-spacing: 0; }
.tar-table input, .tar-table select { width: 100%; min-height: 34px; font-size: 13px; }
.tar-table input:disabled, .tar-table select:disabled { background: transparent; border-color: transparent; color: var(--ink); opacity: 1; }
.tar-table .prix { width: 112px; }
.tar-table td:first-child { width: 34%; }
.tar-table td.prix input { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.tar-table td.prix input:placeholder-shown:not(:disabled) { background: var(--warn-bg); border-color: var(--warn-line); }
.tar-table .ttc { width: 96px; text-align: right; font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tar-table td.unite { width: 170px; }
.tar-table td.act { width: 44px; text-align: center; }
.tar-panneau { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r-card); padding: 14px 16px; }
.tar-panneau .hint { flex-basis: 100%; }
.tar-cases { flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 14px; }
.tar-formules { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; align-items: start; }
.tar-formule { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 18px; display: grid; gap: 10px; }
.tar-ftete { display: flex; gap: 8px; align-items: center; }
.tar-ftete input { font-weight: 700; font-size: 15px; }
.tar-fprix { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-soft); }
.tar-fprix input { width: 110px; text-align: right; font-weight: 700; font-size: 15px; }
.tar-fliste { display: grid; gap: 4px; max-height: 300px; overflow-y: auto; }
.tar-fliste label.chk, .devis-choix label.chk { font-size: 13px; }
.tar-fcalc { font-size: 12.5px; color: var(--ink-faint); border-top: 1px solid var(--line); padding-top: 8px; }
.tar-formule-ajout { min-height: 120px; border-style: dashed; color: var(--ink-soft); }
.hono-box { display: grid; gap: 10px; }
.hono-lignes { display: grid; gap: 8px; }
.hono-ligne { display: grid; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.hl-tete { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 6px; align-items: center; }
.hl-corps { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12px; color: var(--ink-soft); }
.hl-corps label { display: inline-flex; gap: 6px; align-items: center; }
.hono-ligne select, .hono-ligne input { min-height: 32px; font-size: 13px; min-width: 0; }
.hono-ligne input.q { width: 62px; text-align: right; }
.hono-ligne input.p { width: 92px; text-align: right; }
.hono-ligne input.p.special { border-color: var(--accent); background: var(--accent-soft); }
.hono-ligne.inclus { opacity: .7; }
.hono-info { font-size: 11.5px; color: var(--ink-faint); }
.hono-info b { color: var(--accent); }
.hono-info .warn-t { color: var(--warn); font-weight: 600; }
.hono-totaux { display: grid; gap: 4px; background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.hono-totaux div { display: flex; justify-content: space-between; gap: 10px; }
.hono-totaux .gros { font-weight: 700; font-size: 14.5px; }
.suivi-l { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.devis-choix { display: grid; gap: 4px; max-height: 360px; overflow-y: auto; padding-right: 4px; }
.devis-grp { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-top: 8px; }
.devis-choix label.chk { display: flex; gap: 8px; align-items: center; }
.devis-prix { margin-left: auto; color: var(--ink-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
#bilPonctModal .modal { width: min(620px, 100%); }
.bp-form { display: grid; gap: 12px; }
.bil-table tr.nouveau td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* fenêtre de préparation des mails */
.mail-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.mail-grid.seul { grid-template-columns: minmax(0, 1fr); }
.mail-list { display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); padding-right: 12px; max-height: 60vh; overflow-y: auto; }
.mail-list button { flex-shrink: 0; display: block; width: 100%; min-height: 0; text-align: left; border: 0; border-radius: 10px; background: transparent; padding: 9px 11px; font-weight: 600; font-size: 13px; white-space: normal; }
.mail-list button small { display: block; font-weight: 400; color: var(--ink-faint); font-size: 12px; margin-top: 2px; }
.mail-list button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.mail-list button.prepare small { color: var(--ok); font-weight: 600; }
.mail-form { display: grid; gap: 10px; min-width: 0; }
.mail-form textarea { min-height: 300px; font-size: 13.5px; line-height: 1.5; }
.mail-info { font-size: 12.5px; color: var(--ink-faint); line-height: 1.45; }
.mail-info.ok { color: var(--ok); font-weight: 600; }
.mail-info.warn { color: var(--warn); font-weight: 600; }

/* tâches */
.taches { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 24px; align-items: start; }
.t-groupe { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.t-gtitre { display: flex; align-items: baseline; gap: 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); }
.t-gtitre span { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-faint); }
.t-liste { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.t-vide { color: var(--ink-faint); font-size: 13.5px; padding: 18px 20px; }
.tache { display: flex; align-items: flex-start; gap: 4px; padding: 10px 14px 14px 6px; border-bottom: 1px solid var(--line-soft); }
.tache:last-child { border-bottom: 0; }
.t-check { min-height: 44px; width: 44px; padding: 0; border: 0; background: transparent; flex-shrink: 0; }
.t-check:hover { background: transparent; }
.t-check i { width: 22px; height: 22px; border-radius: 999px; border: 2px solid #a59c99; display: flex; align-items: center; justify-content: center; color: #fff; }
.t-check:hover i { border-color: var(--accent); }
.tache.encours .t-check i { border-color: #b35c00; }
.tache.encours .t-check i::after { content: ""; width: 10px; height: 10px; border-radius: 999px; background: #b35c00; }
.tache.fait .t-check i { background: var(--ok); border-color: var(--ok); }
.tache.fait .t-titre span.txt { text-decoration: line-through; color: var(--ink-faint); }
.t-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 10px; }
.t-titre { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.t-detail { font-size: 13.5px; color: var(--ink-soft); overflow-wrap: anywhere; }
.t-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 12.5px; color: var(--ink-faint); }
.t-meta > span, .t-meta > a { display: inline-flex; align-items: center; gap: 5px; }
.t-meta a { font-weight: 600; text-decoration: none; }
.t-retard { color: var(--danger); font-weight: 700; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.pill.urg { background: var(--accent); color: #fff; }
.pill.new { background: var(--ok); color: #fff; }
.t-coms { display: grid; gap: 5px; margin-top: 2px; }
.t-com { font-size: 13px; line-height: 1.45; background: var(--ground); border-radius: 10px; padding: 8px 12px; justify-self: start; max-width: 92%; overflow-wrap: anywhere; }
.t-com.mine { background: var(--accent-soft); justify-self: end; }
.t-when { font-size: 11px; color: var(--ink-faint); }
.t-lien { min-height: 24px; padding: 0 4px; gap: 5px; border: 0; background: transparent; color: var(--accent); font-size: 12.5px; font-weight: 600; }
.t-lien:hover { background: var(--accent-soft); }
.t-reply { display: flex; gap: 6px; margin-top: 2px; }
.t-reply input { min-height: 36px; font-size: 13px; }
.tache.fait .t-reply { display: none; }
.t-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-top: 8px; flex-shrink: 0; }
.t-side .st select { min-width: 96px; }
.t-actions { display: flex; gap: 0; }
.t-actions button { min-height: 32px; width: 32px; padding: 0; }

/* coffre des codes */
.codes-layout { flex: 1; min-height: 320px; display: grid; grid-template-columns: 290px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.codes-list { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
/* flex-shrink: 0 — sinon, quand la liste est longue, les lignes s’écrasent et les textes se chevauchent */
.codes-list button { display: block; width: 100%; min-height: 0; flex-shrink: 0; text-align: left; white-space: normal; border: 0; border-radius: 10px; background: transparent; padding: 10px 12px; font-weight: 600; font-size: 13.5px; }
.codes-list button small { display: block; font-weight: 400; color: var(--ink-faint); font-size: 12px; margin-top: 2px; }
.codes-list button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.codes-detail { overflow-y: auto; padding: 22px 26px; display: grid; gap: 14px; align-content: start; }
.codes-detail h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 24px; }
.codes-detail .meta { font-size: 13px; color: var(--ink-faint); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; }
.codes-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.codes-table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.codes-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.codes-table td.site { font-weight: 600; white-space: nowrap; }
.secret { font-family: Consolas, "Courier New", monospace; letter-spacing: .03em; }
.cell-actions { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: middle; }
.cell-actions button { min-height: 30px; width: 30px; padding: 0; border-color: transparent; background: transparent; color: var(--ink-soft); }
.cell-actions button:hover { background: var(--accent-soft); color: var(--accent); }
.codes-table input { min-height: 36px; font-size: 13px; }
.codes-empty { padding: 34px; color: var(--ink-faint); text-align: center; }

/* ======================= ESPACE CLIENT ======================= */
.work-head { padding: 20px 36px 0; display: flex; flex-direction: column; gap: 12px; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-faint); }
.crumb-link { min-height: 28px; padding: 0 6px 0 2px; gap: 4px; border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 600; }
.crumb-link:hover { background: var(--accent-soft); }
.work-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.work-title { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.work-name { margin: 0; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.12; letter-spacing: .02em; overflow-wrap: anywhere; }
.work-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; }
.meta-pill { padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.meta-pill.forme { border-color: var(--accent-line); background: #fbf5f5; color: var(--accent); font-weight: 700; }
.work-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.save-state { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-right: 4px; }
.save-state.ok { color: var(--ok); }
.taskbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.taskbar button { min-height: 38px; padding: 0 16px; border: 0; background: transparent; color: var(--ink-soft); font-weight: 500; }
.taskbar button:hover { background: var(--accent-soft); color: var(--accent); }
.taskbar button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.content { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(330px, 450px) minmax(0, 1fr); gap: 22px; padding: 16px 36px 22px; }

/* colonne formulaire : une carte par rubrique */
.form-col { overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 14px; padding: 2px 8px 2px 2px; min-height: 0; }
details.grp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); flex-shrink: 0; }
details.grp > summary, details.sub > summary, .sal-row > summary { cursor: pointer; list-style: none; user-select: none; display: flex; align-items: center; gap: 8px; }
details.grp > summary::-webkit-details-marker, details.sub > summary::-webkit-details-marker, .sal-row > summary::-webkit-details-marker { display: none; }
details.grp > summary { padding: 16px 20px; font-size: 15.5px; font-weight: 700; color: var(--ink); }
details.grp > summary::after, details.sub > summary::after, .sal-row > summary::after {
  content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid #a59c99; border-bottom: 2px solid #a59c99;
  transform: rotate(-45deg); transition: transform .15s; flex-shrink: 0;
}
details[open] > summary::after { transform: rotate(45deg); }
.grp-body { padding: 2px 20px 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.form-col button { white-space: normal; line-height: 1.25; padding-top: 7px; padding-bottom: 7px; }
.form-col .insee-row button { flex-shrink: 0; white-space: nowrap; }
details.sub, .sal-row { border: 1px solid var(--line); border-radius: 11px; }
details.sub > summary, .sal-row > summary { padding: 12px 14px; font-size: 13.5px; font-weight: 600; }
details.sub .grp-body, .sal-row .grp-body { padding: 2px 14px 14px; }
.sal-row { margin-bottom: 8px; }
.assoc-row { border: 1px solid var(--line); border-radius: 11px; padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 8px; }
.assoc-row .rm, .sal-row .rm { justify-self: end; color: var(--danger); background: transparent; border-color: transparent; font-weight: 500; }
.assoc-row .rm:hover, .sal-row .rm:hover { background: var(--danger-bg); }
.clause-box { background: var(--ground); border-radius: 10px; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.link-tag { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--accent); background: var(--accent-soft); border-radius: 9px; padding: 6px 10px; }
.link-tag button { min-height: 28px; padding: 0 10px; font-size: 12px; margin-left: auto; }
.balance, .cap-status { font-size: 13px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); }
.balance.bad, .cap-status.bad { color: #8f1d1d; font-weight: 600; background: var(--danger-bg); }
.balance.good, .cap-status.ok { color: var(--ok); font-weight: 600; background: var(--ok-bg); }
.cap-status ul { margin: 4px 0 0; padding-left: 18px; font-weight: 500; }
.fiche-alert { flex-shrink: 0; padding: 12px 16px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; border: 1px solid var(--warn-line); background: var(--warn-bg); color: #6b3a00; }
.fiche-alert.err { border-color: var(--danger-line); background: var(--danger-bg); color: #8f1d1d; }
.fiche-alert b { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.fiche-alert ul { margin: 4px 0 0; padding-left: 18px; }
.fiche-alert li { margin: 1px 0; }
.fiche-alert details:not(:first-child) { margin-top: 8px; }
.fiche-alert details summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 7px; }
.fiche-alert details summary::-webkit-details-marker { display: none; }
.fin-grid { display: grid; grid-template-columns: 1fr 104px 104px; gap: 6px 8px; align-items: center; }
.fin-grid .fh { font-size: 11px; color: var(--ink-faint); text-align: right; }
.fin-grid .fl { font-size: 12.5px; color: var(--ink-soft); }
.fin-grid input { min-height: 34px; padding: 0 8px; font-size: 13px; text-align: right; }
.insee-row { display: flex; gap: 8px; }
.insee-row input, .insee-row select { flex: 1; min-width: 0; }
.insee-results { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.insee-results button { display: block; width: 100%; min-height: 0; text-align: left; white-space: normal; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; background: var(--surface); font-weight: 400; padding: 10px 12px; }
.insee-results button:hover { background: var(--accent-soft); }
.insee-results .ir-name { font-weight: 600; }
.insee-results .ir-meta { font-size: 12px; color: var(--ink-faint); }
.cloture-rappel { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; font-size: 13px; padding: 8px 8px 8px 14px; border-radius: 10px; background: var(--ground); }
.cloture-rappel b.manque { color: var(--danger); }
.ei-bloc, #sEI [data-eiop], #dirEtatCivil { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.mod-checks-list { display: flex; gap: 8px 16px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.mod-checks-list label { display: flex; gap: 7px; align-items: center; font-weight: 500; }
#sModifs > .grp-body:not(:has(> :not([hidden])))::after { content: "Cochez à droite la ou les modifications décidées : les champs à remplir s’affichent ici."; font-size: 13px; line-height: 1.45; color: var(--ink-faint); }

/* colonne document */
.doc-col { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; min-width: 0; min-height: 0; padding: 2px; }
.op-bar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; display: grid; gap: 10px; }
.op-row { display: flex; gap: 12px; align-items: center; }
.op-bar select { max-width: 460px; font-weight: 600; }
.op-fixed { display: flex; gap: 10px; align-items: center; font-size: 14.5px; }
.op-fixed-label { color: var(--ink-faint); }
.doc-nav { display: flex; flex-direction: column; gap: 8px; }
.doc-nav .cat { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.doc-nav .cat-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); min-width: 118px; }
.doc-nav button { min-height: 34px; border-radius: 999px; padding: 0 14px; font-weight: 500; font-size: 13px; }
.doc-nav button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.doc-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: sticky; top: 0; z-index: 3; background: var(--ground); padding: 6px 0; margin: -6px 0; }
.doc-toolbar button { min-height: 38px; padding: 0 13px; }
.doc-toolbar .note { flex-basis: 100%; font-size: 12.5px; color: var(--ink-faint); }
/* un seul défilement pour toute la colonne ; la barre d’actions reste accrochée en haut */
.sheet-wrap { flex: none; padding: 4px 4px 22px; }
.sheet {
  background: var(--paper); color: var(--paper-ink);
  font-family: var(--serif); font-size: 14px; line-height: 1.6;
  max-width: 780px; margin: 0 auto; padding: clamp(28px, 4vw, 56px);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 14px 34px rgba(28, 26, 26, .08);
}
.sheet .ph { font-style: italic; color: #b05c20; }
.sheet h1 { font-size: 17px; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .04em; margin: 22px 0 4px; }
.sheet h2.titre { font-size: 13.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; text-align: center; margin: 26px 0 10px; border-top: 1px solid var(--paper-rule); border-bottom: 1px solid var(--paper-rule); padding: 5px 0; }
.sheet .subtitle { text-align: center; font-size: 13.5px; color: var(--paper-soft); margin: 0 0 24px; }
.sheet .letterhead { text-align: center; font-size: 12.5px; color: var(--paper-soft); border-bottom: 1px solid var(--paper-rule); padding-bottom: 13px; }
.sheet .letterhead .co { font-size: 15.5px; font-weight: 700; color: var(--paper-ink); letter-spacing: .03em; text-transform: uppercase; }
.sheet p { margin: 0 0 11px; text-align: justify; }
.sheet .res-title { font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: .05em; margin: 20px 0 8px; }
.sheet .sub-title { font-weight: 700; font-size: 13px; margin: 12px 0 6px; }
.sheet .article { font-style: italic; margin-left: 24px; }
.sheet ul.odj, .sheet ul.lst { margin: 8px 0 14px; padding-left: 26px; }
.sheet ul.odj li, .sheet ul.lst li { margin-bottom: 3px; }
.sheet .parties { margin: 14px 0; }
.sheet .partie { margin: 0 0 12px; }
.sheet .partie .qual { text-align: right; font-style: italic; }
.sheet .sig { margin-top: 40px; display: flex; justify-content: flex-end; }
.sheet .sigrow { display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; margin-top: 40px; }
.sheet .bloc { text-align: center; min-width: 210px; }
.sheet .line { margin-top: 54px; border-top: 1px solid var(--paper-ink); padding-top: 5px; font-size: 12.5px; }
.sheet table { border-collapse: collapse; width: 100%; margin: 13px 0; font-size: 12.5px; }
.sheet th, .sheet td { border: 1px solid var(--paper-ink); padding: 6px 8px; text-align: left; vertical-align: top; }
.sheet th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.sheet td.num, .sheet th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet .aff-table td { border: none; padding: 3px 8px; }
.sheet .aff-table .tot td { border-top: 1px solid var(--paper-ink); font-weight: 700; }
.sheet .place-date { text-align: right; margin: 16px 0 20px; }
.sheet .dest { margin: 20px 0; padding-left: 52%; }
.sheet .mention { font-size: 12px; font-style: italic; color: var(--paper-soft); }
.sheet .cab-foot { text-align: center; font-size: 10.5px; color: var(--paper-soft); border-top: 1px solid var(--paper-rule); margin-top: 34px; padding-top: 8px; }
.sheet.editing { outline: 3px dashed var(--warn); outline-offset: 6px; cursor: text; }
.sheet .annonce { border: 1px solid var(--paper-rule); padding: 14px 18px; margin: 10px 0 14px; }
.sheet .annonce p { text-align: left; }
.sheet .doc-alert { color: var(--danger); font-style: normal; font-weight: 600; border: 1px dashed var(--danger); padding: 6px 10px; border-radius: 4px; font-family: var(--sans); font-size: 12px; }
footer.appfoot { font-size: 11.5px; color: var(--ink-faint); }

/* ======================= FENÊTRES ======================= */
.modal-back { position: fixed; inset: 0; background: rgba(28, 26, 26, .42); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: var(--surface); border-radius: 18px; padding: 26px 28px 24px; width: min(640px, 100%); max-height: 90vh; overflow-y: auto; display: grid; gap: 12px; box-shadow: 0 24px 60px rgba(28, 26, 26, .22); }
.modal h2 { margin: 0 0 2px; font-family: var(--display); font-weight: 400; font-size: 25px; line-height: 1.15; }
.modal-wide { width: min(1000px, 100%); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 10px; }
.op-pick { display: grid; gap: 8px; }
.op-pick button { justify-content: flex-start; text-align: left; white-space: normal; padding: 14px 16px; min-height: 0; font-size: 14.5px; display: grid; gap: 3px; border-color: var(--line); border-radius: 12px; }
.op-pick button:hover { border-color: var(--accent); background: var(--accent-soft); }
.op-pick button small { font-weight: 400; color: var(--ink-faint); font-size: 12.5px; }
.users-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.users-table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.users-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
.users-table td.perms { font-size: 12.5px; color: var(--ink-soft); }
.users-table tr.disabled td { color: var(--ink-faint); text-decoration: line-through; }
.user-form { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 12px; background: #faf8f7; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; }
.perm-grid label { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; font-weight: 600; }
.perm-grid label small { display: block; font-weight: 400; color: var(--ink-faint); font-size: 12px; }
.perm-grid input { margin-top: 2px; }
.import-list { display: grid; gap: 0; max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.import-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; align-items: center; font-size: 13.5px; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); }
.import-row > span { display: flex; align-items: center; gap: 8px; }
.import-row b { overflow-wrap: anywhere; }
.registre-wrap { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.registre-table th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.registre-table td { white-space: nowrap; }
.registre-table td select { width: 76px; }
.registre-table td input:not([type="checkbox"]) { min-width: 130px; }
.registre-table tr.sorti td { color: var(--ink-faint); }
.registre-table .sub { display: block; font-size: 11.5px; color: var(--ink-faint); white-space: normal; }

/* ======================= CONNEXION ======================= */
.auth-view { height: 100vh; overflow-y: auto; padding: 32px 20px; display: flex; }
.auth-card { margin: auto; width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 44px rgba(28, 26, 26, .07); padding: 38px 40px 26px; display: grid; gap: 20px; }
.auth-logo { width: 176px; height: auto; justify-self: center; }
.auth-form { display: grid; gap: 14px; }
.auth-form h2 { margin: 0 0 2px; font-family: var(--display); font-weight: 400; font-size: 29px; line-height: 1.15; text-align: center; }
.auth-form label.f { font-size: 13px; }
.auth-form .row2 { align-items: end; }
.auth-form input:not([type="checkbox"]) { min-height: 44px; font-size: 15px; }
.auth-form button { min-height: 46px; font-size: 15px; }
.auth-err { color: var(--danger); font-size: 13px; font-weight: 600; min-height: 1em; }
.auth-link { font-size: 13px; font-weight: 500; justify-self: center; }
.auth-foot { border-top: 1px solid var(--line); padding-top: 12px; font-size: 12px; color: var(--ink-faint); display: flex; gap: 10px; justify-content: space-between; align-items: baseline; }
.auth-foot > span { overflow-wrap: anywhere; }
.recovery-code { font-family: Consolas, "Courier New", monospace; font-size: 20px; font-weight: 700; letter-spacing: .08em; text-align: center; padding: 16px; border: 2px dashed var(--accent); border-radius: 12px; background: var(--accent-soft); user-select: all; }
.missing-dir { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; padding: 10px 12px; border: 1px solid var(--danger-line); background: var(--danger-bg); color: #8f1d1d; border-radius: 10px; overflow-wrap: anywhere; }

/* ======================= IMPRESSION (secours : l'impression passe par sheet.css) ======================= */
@media print {
  @page { size: A4; margin: 18mm 16mm; }
  body { background: #fff; }
  .shell { display: block; height: auto; }
  .shell-main, .view { height: auto; display: block; overflow: visible; }
  .side, #viewHome, .work-head, .form-col, .doc-nav, .doc-toolbar, .op-bar, footer.appfoot, .modal-back, .auth-view { display: none !important; }
  .content { display: block; padding: 0; }
  .doc-col { padding: 0; overflow: visible; display: block; }
  .sheet-wrap { padding: 0; overflow: visible; }
  .sheet { box-shadow: none; border: 0; max-width: none; padding: 0; color: #000; font-size: 12pt; }
  .sheet th, .sheet td { border-color: #000; }
  .sheet .ph { color: #000; }
  .sheet .doc-alert { display: none !important; }
}

.ico-inline { display: inline-flex; vertical-align: -3px; margin-right: 6px; }
.link-tag > span { flex: 1; min-width: 0; }

/* 2.7.0 — siège au domicile du dirigeant, PV libre, options des mails */
.dom-details { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--accent-soft); }
.dom-details[hidden], #domHebRow[hidden], #domDestRow[hidden] { display: none; }
#domDestRow { display: grid; gap: 12px; }
#domDetecte { font-weight: 600; color: var(--ink-soft); }
.libre-resos { display: grid; gap: 10px; }
.libre-reso { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.libre-tete { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.libre-num { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.libre-reso textarea { min-height: 72px; }
.libre-reso select { justify-self: start; }
.mail-options { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.mail-options[hidden] { display: none; }
.mail-options .mail-options-titre { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.mail-options label.chk { font-size: 13px; }
.st.na.reporte select { background: transparent; color: #8f8683; border-color: #b9b0ad; }
.st.na .rep { color: var(--ink-faint); }
#mailModal .modal { grid-template-columns: minmax(0, 1fr); }
.mail-extra { display: flex; flex-wrap: wrap; gap: 8px; }
.mail-extra:empty { display: none; }
.row3.libre-quand { grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr) minmax(0, 1.2fr); }

/* ======================= TÂCHES : plusieurs personnes (2.9) ======================= */
.tf-pour-f { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.tf-pour { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 9px 12px; min-height: 42px; max-height: 128px; overflow: auto; background: var(--surface); border: 1px solid var(--field-edge); border-radius: var(--r-ctl); }
.tf-pour-note { width: 100%; font-weight: 500; color: var(--ink-faint); font-size: 12px; }
.t-check:disabled { cursor: default; opacity: .45; }

.row2:has(.tf-pour-f) { align-items: start; }

/* fenêtre d'envoi des mails aux clients */
.mail-grid { grid-template-columns: 270px minmax(0, 1fr); }
.mail-gauche { display: grid; gap: 6px; min-width: 0; border-right: 1px solid var(--line); padding-right: 12px; }
.mail-gauche[hidden] { display: none; }
.mail-gauche .mail-list { border-right: 0; padding-right: 0; max-height: 58vh; }
.mail-compte { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
button.mail-lien { min-height: 0; padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 12.5px; font-weight: 600; }
.mail-cl { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 9px; align-items: start; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.mail-cl:hover { background: var(--ground); }
.mail-cl.cur { background: var(--accent-soft); }
.mail-cl input { margin: 2px 0 0; }
.mail-cl b { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.mail-cl.cur b { color: var(--accent); }
.mail-cl small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-faint); overflow-wrap: anywhere; }
.mail-cl small.manque { color: var(--warn); font-weight: 600; }
.mail-cl small.envoye { color: var(--ok); font-weight: 600; }
.mail-pastille { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--warn-bg); color: var(--warn); }
.mail-de { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; font-size: 13px; color: var(--ink-faint); }
.mail-de b { color: var(--ink); font-weight: 600; }
.mail-avert { padding: 9px 12px; border-radius: 10px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn); font-size: 13px; font-weight: 600; }
.mail-avert[hidden] { display: none; }
.mail-pj { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mail-pj-f { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; max-width: 100%; overflow-wrap: anywhere; }
.mail-pj-f button { min-height: 0; padding: 0; border: 0; background: transparent; color: var(--ink-faint); line-height: 0; }
.mail-actions { flex-wrap: wrap; }
.mail-actions label.chk { font-size: 13px; }
.mail-actions label.chk[hidden], .mail-actions button[hidden] { display: none; }
.mail-prog { display: grid; gap: 10px; }
.mail-barre { height: 8px; border-radius: 999px; background: var(--ground); overflow: hidden; }
.mail-barre i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.mail-pl { display: grid; gap: 2px; max-height: 44vh; overflow-y: auto; }
.mail-pl > div { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.mail-pl > div:last-child { border-bottom: 0; }
.mail-pl .ok { color: var(--ok); }
.mail-pl .ko { color: var(--danger); }
.mail-pl .att { color: var(--ink-faint); }
.mail-pl b { font-weight: 600; }
.mail-pl small { display: block; color: var(--ink-faint); font-size: 12px; overflow-wrap: anywhere; }
.mail-pl small.err { color: var(--danger); font-weight: 600; }
#boiteAutre[hidden] { display: none; }
#mailModal .mail-form textarea { min-height: 200px; height: 34vh; }
#mailModal .modal { padding-bottom: 0; }
#mailModal .mail-actions { position: sticky; bottom: 0; background: var(--surface); margin-top: 0; padding: 12px 0 18px; border-top: 1px solid var(--line); z-index: 1; }

/* onglet E-mails */
.em-cartes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 14px; align-items: start; }
.em-carte { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; display: grid; gap: 12px; min-width: 0; }
.em-tete { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: baseline; }
.em-tete h2 { margin: 0; font-family: inherit; font-size: 15.5px; font-weight: 700; }
.em-tete span { font-size: 12.5px; color: var(--ink-faint); }
.em-boite { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.em-badge { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 800; letter-spacing: .03em; }
.em-boite b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.em-boite small { display: block; font-size: 12.5px; color: var(--ink-faint); line-height: 1.4; }
.em-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.em-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.em-pill.warn { background: var(--warn-bg); color: var(--warn); }
.em-pill.bad { background: var(--danger-bg); color: var(--danger); }
.em-quota { display: grid; gap: 4px; }
.em-quota i { display: block; height: 6px; border-radius: 999px; background: var(--ground); overflow: hidden; }
.em-quota i::before { content: ""; display: block; height: 100%; width: var(--q, 0%); background: var(--accent); }
.em-quota span { font-size: 12px; color: var(--ink-faint); }
.em-note { font-size: 12.5px; color: var(--ink-faint); line-height: 1.5; margin: 0; }
.em-rond { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.em-prep { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.em-prep:last-child { border-bottom: 0; }
.em-prep b { display: block; font-size: 13.5px; }
.em-prep small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-faint); line-height: 1.4; }
.em-barre { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.em-barre input { width: 260px; max-width: 100%; }
.em-segs { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 12px; background: var(--ground); }
.em-segs button { min-height: 32px; padding: 0 12px; border: 0; background: transparent; color: var(--ink-soft); font-size: 12.5px; font-weight: 500; border-radius: 9px; }
.em-segs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 700; }
.em-hist-wrap { overflow-x: auto; }
.em-hist { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.em-hist th { text-align: left; padding: 9px 10px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); border-bottom: 1px solid var(--line); }
.em-hist td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.em-hist tbody tr { cursor: pointer; }
.em-hist tbody tr:hover td { background: var(--ground); }
.em-hist tbody tr:last-child td { border-bottom: 0; }
.em-hist .d { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.em-hist .de { white-space: nowrap; color: var(--ink-soft); }
.em-hist b { display: block; font-weight: 600; }
.em-hist small { display: block; font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.em-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--ink-soft); }
.em-faits { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; font-size: 13px; }
.em-faits span:not(.em-pill) { display: block; font-size: 11.5px; color: var(--ink-faint); }
.em-faits b { font-weight: 600; overflow-wrap: anywhere; }
.em-ligne { display: block; width: 100%; min-height: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.mail-pl > div.cur b { color: var(--accent); }
.em-texte { white-space: pre-wrap; font-size: 13px; line-height: 1.5; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--ground); max-height: 34vh; overflow-y: auto; }
@media (max-width: 1100px) { .em-cartes { grid-template-columns: minmax(0, 1fr); } }

/* onglet E-mails : sections et message à tous */
.em-onglets { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.em-onglets button { min-height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px; background: transparent; color: var(--ink-soft); font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; }
.em-onglets button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.em-libre { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
.em-lb-champ { display: grid; gap: 6px; }
.em-lb-apercu { font-size: 12.5px; color: var(--ink-faint); }
.em-lb-apercu b { color: var(--ink-soft); font-weight: 600; }
.em-lb-page { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.em-lb-page:focus-within { border-color: var(--accent); }
.em-lb-fixe { padding: 11px 14px; background: var(--ground); font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); white-space: pre-line; }
.em-lb-fixe[hidden] { display: none; }
.em-lb-page textarea { display: block; width: 100%; min-height: 130px; border: 0; border-radius: 0; padding: 12px 14px; background: transparent; color: var(--ink); font-size: 13.5px; line-height: 1.55; resize: vertical; box-shadow: none; outline: none; }
.em-lb-pied { position: sticky; bottom: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 12px 0 6px; border-top: 1px solid var(--line); background: var(--surface); }
.em-lb-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.em-lb-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.em-lb-lien { min-height: 0; padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 12.5px; font-weight: 600; }
.em-lb-liste { max-height: 54vh; overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.em-lb-liste .mail-cl input[type="text"] { margin: 5px 0 0; width: 100%; min-height: 30px; font-size: 12.5px; padding: 4px 8px; }
#emLbSansBoite .small { margin-left: 8px; }
@media (max-width: 1100px) { .em-libre { grid-template-columns: minmax(0, 1fr); } }
