/* Octave · Dossiers — interface interne (charte Octave : Syne, encre, papier, couleurs de services). */
:root {
  --ink: #1d1d1b;
  --paper: #efefec;
  --card: #f8f8f6;
  --white: #fff;
  --line: rgba(29, 29, 27, 0.14);
  --line-2: rgba(29, 29, 27, 0.28);
  --muted: rgba(29, 29, 27, 0.62);
  --lime: #e3fb40;
  --orange: #ff7f11;
  --rose: #f991cc;
  --bleu: #0086ff;
  --rouge: #d42a1e;
  --rouge-bg: #fde6e3;
  --rose-bg: #fde8f4;
  --orange-bg: #fff0e2;
  --bleu-bg: #e5f1ff;
  --side: 248px;
  --r: 4px;
  --shadow: 0 1px 0 rgba(29, 29, 27, 0.05), 0 14px 30px -24px rgba(29, 29, 27, 0.55);
  --accent: var(--lime);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 14.5px/1.4 "Syne", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.modal-ouverte { overflow: hidden; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.86em; background: rgba(29, 29, 27, 0.07); padding: 0.1em 0.35em; border-radius: 3px; }
::selection { background: var(--lime); }
:focus-visible { outline: 2.5px solid var(--bleu); outline-offset: 2px; }
.skip { position: absolute; left: 12px; top: -50px; z-index: 300; background: var(--ink); color: var(--paper); padding: 10px 14px; }
.skip:focus { top: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.hl { background-image: var(--trait-1); background-repeat: no-repeat; background-position: 0 92%; background-size: 100% 0.55em; padding-inline: 0.08em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--ink); color: var(--paper);
  padding: 22px 18px 18px; display: flex; flex-direction: column; gap: 16px;
}
.ico { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side { scrollbar-width: thin; scrollbar-color: rgba(239, 239, 236, 0.25) transparent; }
.side__brand { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.side__flag { width: 34px; flex: 0 0 34px; }
.side__logo { width: 128px; min-width: 0; flex: 0 1 auto; }
.side__replier { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border: 1.5px solid rgba(239, 239, 236, 0.18); border-radius: 6px; background: transparent; color: rgba(239, 239, 236, 0.8); cursor: pointer; }
.side__replier:hover { color: var(--paper); border-color: rgba(239, 239, 236, 0.5); background: rgba(239, 239, 236, 0.08); }
.side__menu { display: none; background: none; border: 1.5px solid rgba(239, 239, 236, 0.4); color: var(--paper); padding: 6px 10px; border-radius: var(--r); cursor: pointer; }
.side__app { font-size: 12px; letter-spacing: 0.04em; color: rgba(239, 239, 236, 0.6); margin-top: -6px; }
.side__new { justify-content: center; gap: 8px; }
.side__new .ico { stroke-width: 2; }
.side__nav { display: grid; gap: 2px; }
.side__bloc { display: grid; gap: 2px; }
.side__liens { display: grid; gap: 2px; }
.side__liens[hidden] { display: none; }
.side__nav a { display: flex; align-items: center; gap: 11px; text-decoration: none; padding: 9px 10px; border-radius: var(--r); color: rgba(239, 239, 236, 0.86); }
.side__nav a .ico { opacity: 0.8; }
.side__nav .badge { margin-left: auto; background: var(--rose); color: var(--ink); font-weight: 700; }
.side__nav a:hover { background: rgba(239, 239, 236, 0.08); color: var(--paper); }
.side__nav a:hover .ico, .side__nav a.on .ico { opacity: 1; }
.side__nav a.on { background: var(--paper); color: var(--ink); font-weight: 700; }
/* Titres de section en jaune ; un clic replie ou déplie la section */
.side__groupe { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin: 14px 0 4px; padding: 5px 10px; border: 0; border-radius: var(--r); background: none; color: var(--lime); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; text-align: left; cursor: pointer; }
.side__bloc:first-child .side__groupe { margin-top: 2px; }
.side__groupe:hover { background: rgba(227, 251, 64, 0.08); }
.side__groupe .ico--chevron { width: 16px; height: 16px; flex-basis: 16px; stroke-width: 2; transition: transform 0.2s; }
.side__groupe[aria-expanded="false"] .ico--chevron { transform: rotate(-90deg); }
.side__groupe.a-actif[aria-expanded="false"] .side__txt::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--paper); vertical-align: 2px; }
.side__pied { margin-top: auto; font-size: 12px; color: rgba(239, 239, 236, 0.55); }
/* Infobulle des icônes quand le menu est replié */
.bulle { position: fixed; z-index: 450; transform: translateY(-50%); padding: 6px 10px; border-radius: 6px; background: var(--paper); color: var(--ink); font-size: 13px; font-weight: 700; white-space: nowrap; pointer-events: none; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5); }
.bulle::before { content: ""; position: absolute; left: -5px; top: 50%; width: 10px; height: 10px; background: var(--paper); transform: translateY(-50%) rotate(45deg); border-radius: 2px; }
.bulle[hidden] { display: none; }
.main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 64px; outline: none; }
.view { max-width: 1440px; margin: 0 auto; display: grid; gap: 22px; }

/* ---------- Titres de page ---------- */
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.phead h1 { font-size: clamp(26px, 3vw, 36px); font-weight: 700; letter-spacing: -0.06em; line-height: 1; }
.phead__sub { margin-top: 8px; color: var(--muted); max-width: 70ch; }
.phead__act { display: flex; gap: 8px; flex-wrap: wrap; }
.h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.04em; margin-top: 8px; }
.h3 { font-size: 16px; font-weight: 700; margin: 18px 0 8px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  min-height: 40px; padding: 0 16px; border: 1.5px solid var(--ink); border-radius: var(--r);
  background: var(--ink); color: var(--paper); font-weight: 700; letter-spacing: -0.02em;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color 0.15s, color 0.15s, transform 0.15s;
}
.btn:hover:not(:disabled) { background: var(--accent); color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover:not(:disabled) { background: var(--white); }
.btn--accent { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.side .btn--accent:hover { background: var(--paper); border-color: var(--paper); }
.btn--sm { min-height: 32px; padding: 0 11px; font-size: 13px; }
.btn--grand { min-height: 48px; font-size: 15px; }
.btn--block { width: 100%; }
.btn--danger { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn--danger:hover:not(:disabled) { background: #a81f15; color: #fff; }
.btn--danger-ghost { color: var(--rouge); border-color: rgba(212, 42, 30, 0.45); }
.btn--gauche { margin-right: auto; }
.icon-btn { width: 32px; height: 32px; flex: 0 0 32px; display: inline-grid; place-items: center; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--white); cursor: pointer; font-size: 15px; line-height: 1; }
.icon-btn:hover:not(:disabled) { border-color: var(--ink); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- Cartes, KPIs ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.card > h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 10px; }
.card > p + p, .card > p + .boutons { margin-top: 10px; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card__head h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.04em; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; text-decoration: none; display: grid; gap: 8px; box-shadow: var(--shadow); transition: transform 0.15s; }
.kpi:hover { transform: translateY(-2px); }
.kpi b { font-size: 40px; line-height: 1; letter-spacing: -0.06em; }
.kpi span { justify-self: start; }
.liste li a { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 4px 10px; padding: 10px 6px; border-top: 1px solid var(--line); text-decoration: none; }
.liste li:first-child a { border-top: 0; }
.liste li a:hover { background: var(--white); }
.liste__titre { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste__meta { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.journal li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.journal li:first-child { border-top: 0; }
.journal time { color: var(--muted); font-size: 12.5px; }
.base-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.base-stats a { display: grid; gap: 2px; text-decoration: none; padding: 12px; background: var(--white); border-radius: var(--r); border: 1px solid var(--line); }
.base-stats b { font-size: 26px; letter-spacing: -0.05em; line-height: 1; }
.base-stats span { color: var(--muted); font-size: 13px; }
.types-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.type-mini { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 12px; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--white); cursor: pointer; font-weight: 700; }
.type-mini:hover { background: var(--accent); }
.type-mini__code { font-size: 11px; font-weight: 500; letter-spacing: 0.05em; padding: 1px 6px; background: var(--accent); border-radius: 3px; }
.note { font-size: 13px; color: var(--muted); margin-top: 10px; }
.note--alerte { color: #a24a00; background: var(--orange-bg); padding: 8px 10px; border-radius: var(--r); }
.note--bloquant { color: var(--rouge); }
.ok { color: #3b6d11; font-weight: 700; }
.vide { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 48px 20px; background: var(--card); border: 1px dashed var(--line-2); border-radius: 6px; }
.vide img { width: 64px; opacity: 0.85; }
.vide p { max-width: 46ch; color: var(--muted); }

/* ---------- Pastilles ---------- */
.ref { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--accent); white-space: nowrap; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; border: 1.5px solid var(--ink); }
.pill--encours { background: transparent; }
.pill--brouillon { background: var(--white); border-color: var(--line-2); }
.pill--pret { background: var(--orange); border-color: var(--orange); }
.pill--signe { background: var(--lime); border-color: var(--lime); }
.pill--depose { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.pill--archive { background: transparent; border-color: var(--line-2); color: var(--muted); }
.cnt { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; font-size: 12px; font-weight: 700; margin-right: 3px; }
.cnt--bloquant { background: var(--rouge); color: #fff; }
.cnt--manquant { background: var(--rose); }
.cnt--alerte { background: var(--orange); }
.cnt--ok { background: var(--lime); }
.role { display: inline-block; font-size: 12px; padding: 1px 7px; border: 1px solid var(--line-2); border-radius: 99px; margin: 1px 0; background: var(--white); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--ink); color: var(--paper); font-size: 11.5px; }
.badge:empty { display: none; }
.fmt { display: inline-grid; place-items: center; min-width: 40px; height: 22px; padding: 0 6px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; border-radius: 3px; background: var(--ink); color: var(--paper); }
.fmt--pdf { background: var(--rose); color: var(--ink); }
.fmt--csv { background: var(--lime); color: var(--ink); }
.fmt--grand { min-width: 52px; height: 52px; font-size: 12px; }

/* ---------- Filtres et tableaux ---------- */
.filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.recherche { flex: 1 1 280px; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--white); }
.filtres select { min-height: 40px; padding: 0 10px; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--white); }
.toggle { display: inline-flex; gap: 6px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 34px; padding: 0 12px; border: 1.5px solid var(--line-2); border-radius: 99px; background: var(--white); cursor: pointer; }
.chip b { margin-left: 4px; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.modal .table-wrap { box-shadow: none; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 12px; border-bottom: 1.5px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl td a { text-decoration: none; }
.tbl .num { text-align: right; }
.tbl--click tbody tr { cursor: pointer; }
.tbl--click tbody tr:hover td { background: var(--white); }

/* ---------- Nouveau dossier ---------- */
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.type { display: grid; gap: 12px; align-content: start; text-align: left; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.15s, border-color 0.15s; }
.type:hover { transform: translateY(-3px); border-color: var(--ink); }
.type__service { font-size: 11.5px; letter-spacing: 0.03em; color: var(--muted); }
.type__nom { font-size: 26px; font-weight: 700; letter-spacing: -0.07em; line-height: 1; }
.type__desc { color: var(--muted); }
.type__liste { display: grid; gap: 3px; font-size: 13px; }
.type__liste b { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.type__liste span::before { content: "— "; color: var(--muted); }
.type__var { display: flex; flex-wrap: wrap; gap: 5px; }
.type__var i { font-style: normal; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--accent); }

/* ---------- Dossier ---------- */
.dossier { display: grid; gap: 18px; }
.dhead { display: grid; gap: 12px; }
.dhead__top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.retour { text-decoration: none; color: var(--muted); }
.retour:hover { color: var(--ink); }
.service { font-size: 12px; }
.dhead__ligne { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.dhead__titre { font-size: clamp(24px, 2.6vw, 34px); font-weight: 700; letter-spacing: -0.06em; line-height: 1.02; max-width: 30ch; }
.dhead__act { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sauve { font-size: 12.5px; color: var(--muted); margin-right: 6px; }
.sauve::before { content: "●"; color: #6aa212; margin-right: 5px; }
.sauve.en-cours::before { color: var(--orange); }
.dossier, .dhead { min-width: 0; }
/* Sur petit écran, les onglets défilent horizontalement au lieu d'élargir la page */
.onglets { display: flex; align-items: center; gap: 4px; border-bottom: 1.5px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
.onglets a { flex: 0 0 auto; padding: 10px 14px; text-decoration: none; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1.5px; display: inline-flex; gap: 6px; align-items: center; }
.onglets__statut { flex: 0 0 auto; }
.onglets a.on { color: var(--ink); border-bottom-color: var(--ink); }
.onglets__statut { margin-left: auto; }
.dgrille { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 22px; align-items: start; }
.dform { display: grid; gap: 16px; min-width: 0; }
.dpanneau { position: sticky; top: 18px; display: grid; gap: 12px; max-height: calc(100vh - 36px); overflow-y: auto; padding-bottom: 6px; }

/* ---------- Formulaires ---------- */
.fsec { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px 20px; box-shadow: var(--shadow); }
.fsec__head { margin-bottom: 14px; }
.fsec__head h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.04em; }
.fsec__head p { margin-top: 4px; color: var(--muted); font-size: 13px; max-width: 80ch; }
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.fld, .flist { grid-column: span var(--span, 1); min-width: 0; }
.fld { display: grid; gap: 5px; align-content: start; }
.fld > label, .fld legend, .fcell > label { font-size: 12.5px; font-weight: 700; color: rgba(29, 29, 27, 0.8); }
.req { color: var(--rouge); font-style: normal; }
.fld input[type=text], .fld input[type=date], .fld input[type=time], .fld input[type=password], .fld input[type=email], .fld select, .fld textarea,
.fcell input[type=text], .fcell input[type=date], .fcell input[type=time], .fcell select {
  width: 100%; min-height: 40px; padding: 8px 10px; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fld textarea { min-height: 76px; resize: vertical; line-height: 1.35; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .fcell input:focus, .fcell select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(0, 134, 255, 0.18); }
.unit { position: relative; display: flex; }
.unit input { padding-right: 30px !important; }
.unit span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.hint { font-size: 12px; color: var(--muted); }
.person { display: flex; gap: 6px; align-items: center; }
.person select { flex: 1; min-width: 0; }
.fld--check, .fcell--check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; align-self: end; min-height: 40px; }
.fld--check input, .fcell--check input { width: 18px; height: 18px; accent-color: var(--ink); flex-shrink: 0; }
.fld--choix { border: 0; padding: 0; margin: 0; }
.choix { display: flex; flex-wrap: wrap; gap: 6px; }
.choix__opt { position: relative; cursor: pointer; }
.choix__opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choix__opt span { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--white); font-size: 13.5px; }
.choix__opt.on span { background: var(--accent); border-color: var(--ink); font-weight: 700; }
.choix__opt input:focus-visible + span { outline: 2.5px solid var(--bleu); outline-offset: 2px; }
.flist { display: grid; gap: 8px; }
.flist__head { display: flex; align-items: center; gap: 8px; }
.flist__label { font-size: 12.5px; font-weight: 700; }
.flist__count { font-size: 11.5px; padding: 0 7px; border-radius: 99px; background: rgba(29, 29, 27, 0.08); }
.flist__vide { font-size: 13px; color: var(--muted); }
.flist__row { position: relative; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; padding: 10px 48px 10px 32px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); }
.flist__n { position: absolute; left: 10px; top: 12px; font-size: 11px; font-weight: 700; color: var(--muted); }
.fcell { display: grid; gap: 4px; min-width: 0; flex: 1 1 160px; }
.fcell--checkbox { flex: 0 0 auto; }
.fcell--person { flex: 2 1 250px; }
.fcell--select { flex: 1 1 180px; }
.fcell--percent, .fcell--number, .fcell--time { flex: 0 1 112px; }
.fcell--money { flex: 0 1 140px; }
.fcell--date { flex: 0 1 160px; }
.fcell > label { font-size: 11.5px; }
.fcell--check { min-height: 40px; font-size: 13px; }
.flist__del { position: absolute; right: 8px; top: 8px; }
.flist__actions { display: flex; gap: 8px; flex-wrap: wrap; }
:is(.fld, .fcell).is-bloquant :is(input, select, textarea) { border-color: var(--rouge) !important; }
.flist.is-bloquant .flist__label { color: var(--rouge); }
.flist.is-bloquant .flist__row { border-color: rgba(212, 42, 30, 0.5); }
:is(.fld, .fcell).is-manquant :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { background-color: var(--rose-bg) !important; border-color: var(--rose) !important; }
.flist.is-manquant .flist__label { box-shadow: inset 0 -0.45em 0 var(--rose); }
.flash { animation: flash 1.4s ease; border-radius: var(--r); }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 4px var(--lime); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Panneau de contrôle ---------- */
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 8px; }
.pcard h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.03em; }
.pcard__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard--modele { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pcard--modele .label { font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.pcard--modele h3 { font-size: 19px; letter-spacing: -0.05em; }
.pcard--modele p:last-child { font-size: 13px; color: rgba(239, 239, 236, 0.78); }
.anom-titre { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.anom-titre--bloquant { color: var(--rouge); }
.anom-titre--manquant { color: #b0247a; }
.anom-titre--alerte { color: #a24a00; }
.anoms { display: grid; gap: 5px; }
.anom { font-size: 13px; padding: 7px 9px 7px 11px; border-left: 3px solid; border-radius: 0 var(--r) var(--r) 0; line-height: 1.3; }
.anom[data-champ] { cursor: pointer; }
.anom[data-champ]:hover { filter: brightness(0.97); text-decoration: underline; text-underline-offset: 3px; }
.anom--bloquant { background: var(--rouge-bg); border-color: var(--rouge); }
.anom--manquant { background: var(--rose-bg); border-color: var(--rose); }
.anom--alerte { background: var(--orange-bg); border-color: var(--orange); }
.anom--info { background: var(--bleu-bg); border-color: var(--bleu); }
.infos summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-top: 4px; }
.infos .anoms { margin-top: 6px; }
.prod { display: grid; gap: 6px; font-size: 13px; margin-bottom: 6px; }
.prod li { display: flex; gap: 8px; align-items: center; }
.calc { font-size: 12px; overflow-x: auto; }
.calc .d-table { font-size: 11.5px; }
.calc .d-table th, .calc .d-table td { padding: 3px 5px; }
.calc .d-table td:not(:first-child) { white-space: nowrap; }
.calc .d-table th { font-size: 10.5px; }
.calc .d-table { margin: 0; }
.calc .d-p.d-small { margin-top: 8px; }

/* ---------- Documents ---------- */
.bandeau { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.bandeau--alerte { background: var(--orange-bg); border-color: rgba(255, 127, 17, 0.5); }
.docs { display: grid; gap: 10px; }
.doc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.doc--interne { background: transparent; box-shadow: none; border-style: dashed; }
.doc--ancien { opacity: 0.8; box-shadow: none; }
.doc__main h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.03em; }
.doc__main p { font-size: 12.5px; margin-top: 3px; }
.doc__act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sel-statut { min-height: 34px; padding: 0 8px; border-radius: 99px; border: 1.5px solid var(--ink); font-weight: 700; font-size: 13px; cursor: pointer; }
.sel-statut--brouillon { background: var(--white); }
.sel-statut--pret { background: var(--orange); }
.sel-statut--signe { background: var(--lime); }
.sel-statut--depose { background: var(--bleu); color: #fff; }
.sel-statut--archive { background: transparent; color: var(--muted); }
.docs__pied { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.docs__pied .note { margin: 0; flex-basis: 100%; }
.anciens summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.anciens .docs { margin-top: 8px; }

/* ---------- Règles, modèles, données ---------- */
.niveaux { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.niveau { padding: 12px 14px; border-radius: 6px; border-left: 4px solid; font-size: 13px; }
.niveau b { display: block; font-size: 14px; margin-bottom: 3px; }
.niveau--bloquant { background: var(--rouge-bg); border-color: var(--rouge); }
.niveau--manquant { background: var(--rose-bg); border-color: var(--rose); }
.niveau--alerte { background: var(--orange-bg); border-color: var(--orange); }
.niveau--info { background: var(--bleu-bg); border-color: var(--bleu); }
.baremes, .regles, .modeles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bareme { display: grid; gap: 8px; }
.bareme__l { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 12px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.bareme__l small { display: block; font-size: 11.5px; margin-top: 2px; }
.bareme__l input { width: 100%; min-height: 36px; padding: 0 34px 0 10px; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--white); text-align: right; }
.regles .card h3, .modeles .card h3 { font-size: 18px; letter-spacing: -0.05em; margin-bottom: 12px; }
.modele { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.modele__main { display: grid; gap: 2px; }
.modele__main .muted { font-size: 12.5px; }
.modele__act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.aide ol { list-style: decimal; padding-left: 20px; display: grid; gap: 8px; }
.kv li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.kv li:first-child { border-top: 0; }

/* ---------- Fenêtres ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(29, 29, 27, 0.55); }
.modal__box { position: relative; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--paper); border-radius: 8px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5); animation: entree 0.18s ease; }
.modal--large .modal__box { width: min(980px, 100%); }
.modal--doc .modal__box { width: min(1000px, 100%); }
@keyframes entree { from { opacity: 0; transform: translateY(10px); } }
.modal__head { position: relative; padding: 18px 56px 14px 22px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.05em; }
.modal__sub { margin-top: 4px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.modal__x { position: absolute; right: 14px; top: 14px; }
.modal__body { padding: 18px 22px; overflow-y: auto; display: grid; gap: 12px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal .fsec { box-shadow: none; }
.modal--doc .modal__body { background: #d9d9d4; }
.fiche-form { display: grid; gap: 14px; }

/* ---------- Aperçu de document (feuille A4) ---------- */
.feuille { background: #fff; width: min(794px, 100%); margin: 0 auto; padding: clamp(24px, 6vw, 64px) clamp(20px, 6vw, 70px); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.35); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.45; color: #1d1d1b; }
.d-marque { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 22px; border-bottom: 1px solid #1d1d1b; font-size: 12px; }
.d-marque img { width: 40px; }
.d-marque em { margin-left: auto; font-style: normal; font-size: 11px; }
.d-title { text-align: center; font-size: 19px; text-transform: uppercase; letter-spacing: 0.01em; margin: 0 0 4px; }
.d-subtitle { text-align: center; margin: 0 0 22px; white-space: pre-line; }
.d-h { font-size: 14px; margin: 18px 0 6px; }
.d-p { margin: 0 0 8px; text-align: justify; }
.d-center { text-align: center; }
.d-right { text-align: right; }
.d-small { font-size: 11px; color: #555; }
.d-list { list-style: disc; padding-left: 22px; margin: 0 0 10px; }
.d-list li { margin-bottom: 3px; }
.d-table, .d-kv { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 12px; }
.d-table th, .d-table td { border: 1px solid #1d1d1b; padding: 4px 6px; vertical-align: top; }
.d-table th { background: #efefec; text-align: left; }
.d-total tbody tr:last-child td { background: #efefec; font-weight: 700; }
.d-kv th { text-align: left; width: 34%; padding: 3px 8px 3px 0; vertical-align: top; }
.d-kv td { padding: 3px 0; }
.d-sign { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 18px 0 8px; break-inside: avoid; }
.d-sign__col p { margin: 0 0 3px; }
.d-sign__box { height: 64px; border: 1px solid #999; margin-top: 4px; }
.d-stamp { text-align: center; font-weight: 700; padding: 8px; margin: 6px auto 14px; border: 2px solid #1d1d1b; background: #f991cc; width: fit-content; }
.d-rule { border: 0; border-top: 1px solid #1d1d1b; margin: 12px 0; }
.d-break { border: 0; border-top: 2px dashed #bbb; margin: 26px -20px; }
.d-pied { margin-top: 28px; padding-top: 8px; border-top: 1px solid #ccc; font-size: 10px; color: #777; text-align: center; }
mark.ph { background: #f991cc; color: #1d1d1b; font-weight: 700; padding: 0 2px; }

/* ---------- Notifications ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 400; display: grid; gap: 8px; width: min(420px, calc(100vw - 36px)); }
.toast { padding: 12px 14px; border-radius: 6px; background: var(--ink); color: var(--paper); box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.5); font-size: 13.5px; border-left: 5px solid var(--lime); animation: entree 0.2s ease; transition: opacity 0.4s, transform 0.4s; }
.toast--erreur { border-left-color: var(--rouge); }
.toast--alerte { border-left-color: var(--orange); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* =====================================================================
   Espace équipe, comptes et écran de démarrage
   ===================================================================== */

/* ---------- Pastilles de membres ---------- */
.avatar { --a: 30px; flex: 0 0 var(--a); width: var(--a); height: var(--a); border-radius: 50%; display: inline-grid; place-items: center; font-size: calc(var(--a) * 0.38); font-weight: 700; letter-spacing: -0.02em; line-height: 1; background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); user-select: none; }
.avatar--xs { --a: 20px; border-width: 1px; font-size: 8.5px; }
.avatar--sm { --a: 26px; }
.avatar--lg { --a: 52px; }
.avatar--xl { --a: 76px; }
.avatar--lime { background: var(--lime); }
.avatar--rose { background: var(--rose); }
.avatar--orange { background: var(--orange); }
.avatar--bleu { background: var(--bleu); }
.avatar--encre { background: var(--ink); color: var(--paper); }
.avatar--vide { background: transparent; border-style: dashed; color: var(--muted); }
.avatar--fantome { visibility: hidden; }
.avatars { display: inline-flex; vertical-align: middle; }
.avatars .avatar + .avatar { margin-left: -7px; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--card); }

/* ---------- Menu : recherche et compte ---------- */
kbd { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; padding: 1px 6px; border: 1px solid currentColor; border-radius: 4px; opacity: 0.75; white-space: nowrap; }
.side__recherche { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 10px; border: 1.5px solid rgba(239, 239, 236, 0.22); border-radius: var(--r); background: rgba(239, 239, 236, 0.05); color: rgba(239, 239, 236, 0.78); cursor: pointer; text-align: left; }
.side__recherche .side__txt { flex: 1; }
.side__recherche:hover { border-color: rgba(239, 239, 236, 0.5); color: var(--paper); }
.side__mobile { display: none; gap: 8px; }
.side__compte { margin-top: auto; display: flex; gap: 6px; }
.side__pied { margin-top: 0; }
.side__profil { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; border: 1.5px solid rgba(239, 239, 236, 0.16); border-radius: 6px; background: transparent; color: var(--paper); cursor: pointer; text-align: left; }
.side__profil:hover, .side__verrou:hover { background: rgba(239, 239, 236, 0.08); border-color: rgba(239, 239, 236, 0.4); }
.side__profil .avatar { border-color: transparent; }
.side__profil-txt { display: grid; min-width: 0; line-height: 1.2; }
.side__profil-txt b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__profil-txt small { font-size: 11.5px; color: rgba(239, 239, 236, 0.6); }
.side__verrou { width: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 1.5px solid rgba(239, 239, 236, 0.16); border-radius: 6px; background: transparent; color: var(--paper); cursor: pointer; }

/* ---------- Listes de l'équipe (journal signé, dossiers) ---------- */
.journal--auteurs li { grid-template-columns: 130px 26px minmax(0, 1fr); align-items: center; }
.card__head a.muted { font-size: 13px; text-decoration: none; white-space: nowrap; }
.card__head a.muted:hover { color: var(--ink); }
.equipe-cell { white-space: nowrap; }
.equipe-cell .avatars { margin-left: -6px; }
.dresp { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 3px; border: 1.5px solid var(--line-2); border-radius: 99px; background: var(--white); text-decoration: none; font-size: 12.5px; font-weight: 700; }
.dresp:hover { border-color: var(--ink); }

/* ---------- Tâches ---------- */
.resultats { display: grid; gap: 18px; }
.taches { display: grid; gap: 6px; }
.tache { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); }
.tache--retard { border-left: 3px solid var(--rouge); }
.tache__check { position: relative; width: 22px; height: 22px; flex: 0 0 22px; cursor: pointer; }
.tache__check input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.tache__check span { position: absolute; inset: 0; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--white); transition: background-color 0.15s; }
.tache__check input:checked + span { background: var(--lime); }
.tache__check input:checked + span::after { content: ""; position: absolute; left: 6.5px; top: 3px; width: 5px; height: 10px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tache__check input:focus-visible + span { outline: 2.5px solid var(--bleu); outline-offset: 2px; }
.tache__corps { display: grid; gap: 3px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.tache__titre { font-weight: 700; overflow-wrap: anywhere; }
.tache__corps:hover .tache__titre { text-decoration: underline; text-underline-offset: 3px; }
.tache__meta { display: flex; flex-wrap: wrap; gap: 3px 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.tache__meta:empty { display: none; }
.tache__date { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tache__date.retard { color: var(--rouge); font-weight: 700; }
.tache--faite .tache__titre { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.prio { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; background: var(--orange); font-size: 11px; vertical-align: 1px; }
.pill--encours-t { font-size: 11px; padding: 1px 7px; border-color: var(--bleu); background: var(--bleu-bg); }
.groupe { display: grid; gap: 8px; }
.groupe__titre { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.groupe__titre span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 6px; border-radius: 99px; background: rgba(29, 29, 27, 0.08); color: var(--ink); }
.groupe--retard .groupe__titre { color: var(--rouge); }
.ajout-rapide { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ajout-rapide.card { padding: 10px; }
.ajout-rapide--compact { margin-bottom: 12px; }
.ajout-rapide input[type=text], .ajout-rapide input[type=date], .ajout-rapide select { min-height: 40px; padding: 0 10px; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--white); }
.ajout-rapide input[type=text] { flex: 1 1 240px; min-width: 0; }
.ajout-rapide input:focus, .ajout-rapide select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(0, 134, 255, 0.18); }
.chips--sm .chip { min-height: 30px; font-size: 12.5px; }
.chip--membre { display: inline-flex; align-items: center; gap: 6px; padding-left: 5px; }

/* ---------- Agenda ---------- */
.agenda { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.cal__tete { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal__titre { min-width: 150px; text-align: center; font-size: 18px; font-weight: 700; letter-spacing: -0.04em; }
.cal__tete .btn { margin-left: auto; }
.cal__grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal__jsem { padding: 0 4px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.cal__jour { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; min-height: 92px; padding: 5px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); cursor: pointer; text-align: left; }
.cal__jour:hover { border-color: var(--ink); }
.cal__jour.hors { background: transparent; color: var(--muted); }
.cal__jour.sel { outline: 2px solid var(--ink); outline-offset: -1px; }
.cal__n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12.5px; font-weight: 700; }
.cal__jour.auj .cal__n { background: var(--lime); }
.cal__evts { display: grid; gap: 2px; min-width: 0; }
.cal__points { display: none; gap: 3px; justify-content: center; }
.cal__points i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.evt { display: block; padding: 2px 5px; border-radius: 3px; background: var(--accent); font-size: 11px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evt--tache { background: transparent; box-shadow: inset 0 0 0 1px var(--accent); }
.evt--relance { background: var(--rose); }
.evt--plus { background: none; color: var(--muted); }
.evts { display: grid; gap: 6px; }
.evt-l > a, .evt-l > div, .evt-l > button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.evt-l > a:hover, .evt-l > button:hover { border-color: var(--ink); }
.evt-l > div { cursor: default; }
.evt-l--retard > a, .evt-l--retard > button { border-left: 3px solid var(--rouge); }
.evt-l__genre { padding: 3px 7px; border-radius: 99px; background: var(--accent); font-size: 11px; font-weight: 700; white-space: nowrap; }
.evt-l__genre.evt--tache { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.evt-l__date { min-width: 76px; font-size: 12px; font-weight: 700; }
.evt-l__txt { display: grid; gap: 2px; min-width: 0; }
.evt-l__txt b { font-size: 13.5px; }
.evt-l__txt .muted { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jourliste { display: grid; gap: 6px; margin-top: 14px; }
.jourliste:first-of-type { margin-top: 4px; }
.jourliste h3 { font-size: 13px; font-weight: 700; }
.jourliste--retard h3 { color: var(--rouge); }

/* ---------- Espace équipe ---------- */
.membres { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.membre { display: grid; gap: 12px; align-content: start; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.membre--invite, .membre--expire { border: 1.5px dashed var(--line-2); box-shadow: none; }
.membre__tete { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.membre__tete h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; }
.membre__badges { display: grid; gap: 4px; justify-items: end; }
.pill--moi { background: var(--lime); border-color: var(--lime); }
.pill--admin { background: var(--ink); color: var(--paper); }
.membre__compte { font-size: 12.5px; color: var(--muted); }
.membre__compte--invite { color: #a24a00; }
.membre__compte--expire { color: var(--rouge); }
.membre__poles { display: flex; flex-wrap: wrap; gap: 4px; }
.pole { padding: 2px 7px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--white); font-size: 10.5px; }
.pole--BM { background: var(--lime); border-color: var(--lime); }
.pole--BA { background: var(--orange); border-color: var(--orange); }
.pole--AU { background: var(--rose); border-color: var(--rose); }
.membre__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; }
.membre__stats div { padding: 8px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); }
.membre__stats dt { font-size: 10.5px; line-height: 1.2; color: var(--muted); }
.membre__stats dd { margin: 4px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -0.05em; line-height: 1; }
.membre__stats .est-retard dd { color: var(--rouge); }
.charge { display: flex; height: 8px; overflow: hidden; border-radius: 99px; background: rgba(29, 29, 27, 0.08); }
.charge span { display: block; height: 100%; }
.charge__dossiers { background: var(--lime); }
.charge__retard { background: var(--rouge); }
.charge__encours { background: var(--bleu); }
.charge__afaire { background: var(--ink); }
.membre__act { display: flex; flex-wrap: wrap; gap: 6px; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { display: inline-block; width: 14px; height: 8px; border-radius: 99px; }
.assign li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.assign li:first-child { border-top: 0; }
.assign a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.assign__titre { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign select { max-width: 46%; min-height: 34px; padding: 0 8px; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--white); }
.plusieurs__grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.plusieurs__grille p { margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.plusieurs__grille .btn { margin-top: 10px; }

/* ---------- Onglet Suivi d'un dossier ---------- */
.suivi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.suivi__col { display: grid; gap: 18px; min-width: 0; }
.suivi__resp { display: flex; align-items: center; gap: 12px; }
.suivi__resp .fld { flex: 1; min-width: 0; }
.suivi__resp select { width: 100%; min-width: 0; }
.fld__l { display: block; font-size: 12.5px; font-weight: 700; color: rgba(29, 29, 27, 0.8); }
.suivi .card > .fld__l { margin: 14px 0 6px; }
.collab { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px 0 5px; border: 1.5px solid var(--line-2); border-radius: 99px; background: var(--white); cursor: pointer; font-size: 13px; }
.collab.on { border-color: var(--ink); background: var(--accent); font-weight: 700; }
.faites summary { margin-top: 10px; cursor: pointer; font-size: 13px; color: var(--muted); }
.faites .taches { margin-top: 8px; }
.note-form { display: grid; gap: 8px; margin-bottom: 14px; }
.note-form textarea { width: 100%; min-height: 76px; padding: 10px; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--white); resize: vertical; line-height: 1.35; }
.note-form textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(0, 134, 255, 0.18); }
.note-form .btn { justify-self: end; }
.notes { display: grid; gap: 12px; }
.note-eq { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.note-eq__tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; }
.note-eq__tete time { font-size: 12px; color: var(--muted); }
.note-eq__txt { margin-top: 3px; padding: 9px 12px; background: var(--white); border: 1px solid var(--line); border-radius: 0 8px 8px 8px; font-size: 13.5px; overflow-wrap: anywhere; }
.lien { margin-left: auto; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.mention { padding: 0 3px; border-radius: 3px; background: var(--lime); color: var(--ink); font-weight: 700; }
.mention--rose { background: var(--rose); }
.mention--orange { background: var(--orange); }
.mention--bleu { background: var(--bleu-bg); }
.mention--encre { background: rgba(29, 29, 27, 0.12); }

/* ---------- Tableau de bord ---------- */
.taches--accueil .tache { padding: 7px 8px; }
.mentions { display: grid; gap: 6px; margin-top: 14px; }
.label-mini { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.mention-l { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); font-size: 13px; text-decoration: none; }
.mention-l:hover { border-color: var(--ink); }
.evts--compact .evt-l > a { grid-template-columns: 76px minmax(0, 1fr) auto; }

/* ---------- Fenêtres de compte ---------- */
.code-grand { padding: 16px; border: 2px dashed var(--ink); border-radius: 8px; background: var(--white); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: clamp(20px, 4vw, 28px); font-weight: 700; letter-spacing: 0.12em; text-align: center; user-select: all; overflow-wrap: anywhere; }
.mdp-form { display: grid; gap: 12px; }
.mdp-form .porte__erreur { color: var(--rouge); }
.fld--ligne { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; font-size: 13px; font-weight: 700; }
.fld--ligne select { min-height: 36px; padding: 0 8px; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--white); }
.jauge { display: grid; gap: 4px; }
.jauge__barre { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(127, 127, 127, 0.25); }
.jauge__barre i { display: block; width: 0; height: 100%; background: var(--rouge); transition: width 0.25s, background-color 0.25s; }
.jauge[data-score="0"] i { width: 12%; }
.jauge[data-score="1"] i { width: 32%; background: var(--orange); }
.jauge[data-score="2"] i { width: 56%; background: var(--rose); }
.jauge[data-score="3"] i { width: 80%; background: var(--lime); }
.jauge[data-score="4"] i { width: 100%; background: var(--lime); }
.jauge__txt { min-height: 1.2em; font-size: 12px; opacity: 0.8; }

/* ---------- Recherche globale ---------- */
.palette { position: fixed; inset: 0; z-index: 300; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; }
.palette__fond { position: absolute; inset: 0; background: rgba(29, 29, 27, 0.55); }
.palette__boite { position: relative; width: min(640px, 100%); max-height: 72vh; display: flex; flex-direction: column; overflow: hidden; background: var(--paper); border-radius: 10px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5); animation: entree 0.16s ease; }
.palette__champ { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette__champ input { flex: 1; min-width: 0; border: 0; background: none; font-size: 17px; outline: none; }
.palette__res { overflow-y: auto; padding: 6px; }
.palette__groupe { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.palette__item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.palette__item.on { background: var(--ink); color: var(--paper); }
.palette__item.on .palette__txt span { color: rgba(239, 239, 236, 0.7); }
.palette__puce { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 3px; background: var(--line-2); }
.palette__puce[class*="theme-"] { background: var(--accent); }
.palette__txt { display: grid; min-width: 0; }
.palette__txt b, .palette__txt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette__txt span { font-size: 12.5px; color: var(--muted); }
.palette__vide { padding: 18px; color: var(--muted); text-align: center; }
.palette__pied { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------- Écran de démarrage, connexion et création de compte ---------- */
body.porte-ouverte { overflow: hidden; }
.porte { position: fixed; inset: 0; z-index: 600; display: flex; flex-direction: column; overflow-y: auto; padding: 28px 20px 18px; background: var(--ink); color: var(--paper); transition: opacity 0.5s ease, visibility 0.5s; }
.porte--sortie { opacity: 0; visibility: hidden; pointer-events: none; }
.porte__cadre { width: min(560px, 100%); margin: auto; display: grid; justify-items: center; gap: 14px; text-align: center; }
.porte__marque { display: grid; justify-items: center; gap: 10px; }
.porte__drapeau { width: clamp(150px, 30vw, 230px); aspect-ratio: 1.262; }
.porte--rapide .porte__drapeau { width: clamp(110px, 20vw, 150px); }
.porte__logo { width: clamp(170px, 34vw, 250px); }
.porte__app { font-size: 12px; letter-spacing: 0.08em; color: rgba(239, 239, 236, 0.6); }
.porte__charge { width: min(240px, 60vw); height: 4px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: rgba(239, 239, 236, 0.15); }
.porte__charge span { display: block; height: 100%; background: var(--lime); transform: scaleX(0); transform-origin: 0 50%; animation: charge 1.2s cubic-bezier(0.6, 0.1, 0.3, 1) forwards; }
@keyframes charge { to { transform: scaleX(1); } }
.porte--ouverte .porte__charge { display: none; }
.porte__etat { min-height: 1.4em; font-size: 13px; color: rgba(239, 239, 236, 0.62); }
.porte--ouverte .porte__etat:empty { display: none; }
.porte__panneau { width: 100%; display: grid; justify-items: center; gap: 14px; margin-top: 6px; }
.porte__panneau.entre { animation: monte 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes monte { from { opacity: 0; transform: translateY(12px); } }
.porte__titre { font-size: clamp(24px, 4vw, 32px); font-weight: 700; letter-spacing: -0.06em; line-height: 1.05; }
.porte__texte { max-width: 46ch; font-size: 14.5px; color: rgba(239, 239, 236, 0.75); }
.porte__bonjour { font-size: clamp(36px, 7vw, 58px); font-weight: 700; letter-spacing: -0.07em; line-height: 1; }
.porte__bonjour .hl { color: var(--ink); background-size: 100% 0.92em; background-position: 0 70%; padding-inline: 0.14em; }
.porte__resume { font-size: 15px; color: rgba(239, 239, 236, 0.8); }
.porte__resume b { color: var(--lime); }
.porte__boutons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn--clair { background: transparent; color: var(--paper); border-color: rgba(239, 239, 236, 0.45); }
.btn--clair:hover:not(:disabled) { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.porte .btn--accent:hover:not(:disabled) { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.porte .btn--accent:disabled { opacity: 0.35; }
.porte__auto { width: 160px; height: 3px; overflow: hidden; border-radius: 99px; background: rgba(239, 239, 236, 0.12); }
.porte__auto span { display: block; height: 100%; background: rgba(239, 239, 236, 0.5); transform: scaleX(0); transform-origin: 0 50%; animation: charge 2.6s linear forwards; }
.sans-auto .porte__auto { visibility: hidden; }
.comptes { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.compte { display: grid; justify-items: center; align-content: start; gap: 8px; padding: 16px 10px 14px; border: 1.5px solid rgba(239, 239, 236, 0.16); border-radius: 10px; background: rgba(239, 239, 236, 0.04); color: var(--paper); cursor: pointer; transition: background-color 0.15s, border-color 0.15s, transform 0.15s; }
.compte:hover { background: rgba(239, 239, 236, 0.1); border-color: rgba(239, 239, 236, 0.5); transform: translateY(-2px); }
.compte .avatar { border-color: transparent; }
.compte b { font-size: 14px; line-height: 1.15; }
.compte > span:last-child { font-size: 12px; color: rgba(239, 239, 236, 0.6); }
.compte--invite, .compte--expire { border-style: dashed; }
.compte--invite > span:last-child { color: var(--lime); }
.compte--expire { opacity: 0.6; }
.porte__liens { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.lien-clair { padding: 4px; border: 0; background: none; color: rgba(239, 239, 236, 0.85); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.lien-clair:hover { color: var(--paper); }
.porte__demo { font-size: 12.5px; color: rgba(239, 239, 236, 0.55); }
.porte__demo code { background: rgba(239, 239, 236, 0.12); color: var(--lime); }
.porte__retour { justify-self: start; padding: 4px 0; border: 0; background: none; color: rgba(239, 239, 236, 0.7); font-size: 13.5px; cursor: pointer; }
.porte__retour:hover { color: var(--paper); }
.porte__qui { display: grid; justify-items: center; gap: 8px; }
.porte__qui .avatar { border-color: transparent; }
.porte__form { width: min(380px, 100%); display: grid; gap: 12px; text-align: left; }
.porte__panneau > .btn--block, .porte__panneau > .oubli, .porte__panneau > .porte__aide { width: min(380px, 100%); }
.champs2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.champ { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: rgba(239, 239, 236, 0.85); }
.champ input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1.5px solid rgba(239, 239, 236, 0.25); border-radius: 6px; background: rgba(239, 239, 236, 0.06); color: var(--paper); font-size: 15px; font-weight: 500; }
.champ input:focus { border-color: var(--lime); outline: none; box-shadow: 0 0 0 3px rgba(227, 251, 64, 0.18); }
.champ input::placeholder { color: rgba(239, 239, 236, 0.35); }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.12em; text-transform: uppercase; }
.mdp { position: relative; display: block; }
.mdp input { padding-right: 86px; }
.mdp__voir { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 30px; padding: 0 9px; border: 1px solid rgba(239, 239, 236, 0.3); border-radius: 4px; background: transparent; color: rgba(239, 239, 236, 0.8); font-size: 12px; cursor: pointer; }
.case { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: rgba(239, 239, 236, 0.85); cursor: pointer; }
.case input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--lime); }
.porte__erreur { font-size: 13.5px; font-weight: 700; color: #ff8f86; }
.porte__erreur:empty { display: none; }
.porte__note { font-size: 12.5px; line-height: 1.45; color: rgba(239, 239, 236, 0.55); }
.oubli { width: 100%; display: grid; gap: 10px; }
.oubli__choix { display: grid; gap: 4px; padding: 14px 16px; border: 1.5px solid rgba(239, 239, 236, 0.2); border-radius: 8px; background: rgba(239, 239, 236, 0.04); color: var(--paper); text-align: left; cursor: pointer; }
.oubli__choix:hover { border-color: var(--lime); background: rgba(239, 239, 236, 0.08); }
.oubli__choix span { font-size: 13px; color: rgba(239, 239, 236, 0.65); }
.porte__aide { width: 100%; display: grid; justify-items: center; gap: 10px; padding: 14px; border-radius: 8px; background: rgba(239, 239, 236, 0.06); font-size: 13.5px; color: rgba(239, 239, 236, 0.8); }
.code-secours { padding: 14px 18px; border: 2px dashed var(--lime); border-radius: 8px; color: var(--lime); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: clamp(19px, 4.5vw, 28px); font-weight: 700; letter-spacing: 0.1em; user-select: all; overflow-wrap: anywhere; }
.porte__pied { margin-top: 18px; text-align: center; font-size: 11.5px; color: rgba(239, 239, 236, 0.4); }
@media (prefers-reduced-motion: reduce) {
  .porte, .porte__panneau.entre, .porte__charge span, .porte__auto span, .palette__boite, .compte { animation: none !important; transition: none !important; }
  .porte__charge span { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .dgrille { grid-template-columns: minmax(0, 1fr) 350px; }
  .niveaux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  .dgrille { grid-template-columns: 1fr; }
  .dpanneau { position: static; max-height: none; order: -1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .baremes, .regles, .modeles { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 50; height: auto; padding: 12px 16px; gap: 10px; }
  .side__menu { display: inline-block; }
  .side__app, .side__new, .side__nav, .side__pied, .side__recherche, .side__compte, .side__replier { display: none; }
  .side__mobile { display: flex; }
  body.menu-ouvert .side__nav { display: grid; }
  body.menu-ouvert .side__new { display: flex; }
  body.menu-ouvert .side__compte { display: flex; margin-top: 4px; }
  body.menu-ouvert .side { max-height: 100vh; overflow-y: auto; }
  .main { padding: 18px 16px 48px; }
  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc { grid-template-columns: auto minmax(0, 1fr); }
  .doc__statut, .doc__act { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 560px) {
  .fgrid { grid-template-columns: 1fr; }
  .fld, .flist { grid-column: auto; }
  .fcell { flex-basis: 100% !important; }
  .types-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .base-stats { grid-template-columns: repeat(2, 1fr); }
  .journal li { grid-template-columns: 1fr; gap: 2px; }
  .niveaux, .kpis { grid-template-columns: 1fr; }
}

/* ---------- Responsive : espace équipe et écran de démarrage ---------- */
@media (max-width: 1200px) {
  .agenda { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1020px) {
  .agenda, .suivi, .plusieurs__grille { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .membre__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side__mobile .side__menu { padding: 6px 10px; }
  .side__menu--icone { display: inline-grid !important; place-items: center; width: 40px; padding: 0 !important; }
  .side__top { gap: 10px; }
  .side__brand { min-width: 0; }
  .side__logo { width: min(140px, 34vw); }
}
@media (max-width: 700px) {
  .cal__jour { align-items: center; min-height: 52px; padding: 4px 2px; }
  .cal__evts { display: none; }
  .cal__points { display: flex; }
  .cal__titre { min-width: 0; font-size: 15px; white-space: nowrap; }
  .cal__tete { gap: 6px; }
}
@media (max-width: 560px) {
  .tache { grid-template-columns: auto minmax(0, 1fr) auto; }
  .tache__date { grid-column: 2; }
  .journal--auteurs li { grid-template-columns: 26px minmax(0, 1fr); }
  .journal--auteurs li time { grid-column: 1 / -1; }
  .evts--compact .evt-l > a { grid-template-columns: minmax(0, 1fr) auto; }
  .evts--compact .evt-l__date { grid-column: 1 / -1; }
  .ajout-rapide input[type=text] { flex-basis: 100%; }
  .ajout-rapide select, .ajout-rapide input[type=date] { flex: 1 1 0; min-width: 0; }
  .assign li { flex-wrap: wrap; }
  .assign select { max-width: none; width: 100%; }
  .champs2 { grid-template-columns: 1fr; }
  .porte { padding: 22px 16px 14px; }
  .comptes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .palette { padding-top: 8vh; }
}

/* ---------- Menu replié : une colonne d'icônes (ordinateur) ---------- */
@media (min-width: 861px) {
  .app { transition: grid-template-columns 0.25s ease; }
  html.menu-replie .app { grid-template-columns: 76px minmax(0, 1fr); }
  html.menu-replie .side { align-items: center; gap: 12px; padding: 18px 12px 14px; overflow-x: hidden; }
  html.menu-replie .side__top { flex-direction: column; gap: 12px; }
  html.menu-replie .side__flag { width: 38px; flex-basis: 38px; }
  html.menu-replie .side__logo, html.menu-replie .side__app, html.menu-replie .side__pied, html.menu-replie .side__recherche kbd, html.menu-replie .side__groupe .ico--chevron { display: none; }
  /* libellés masqués à l'écran mais lus par les lecteurs d'écran */
  html.menu-replie .side__txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html.menu-replie .side__new, html.menu-replie .side__recherche { position: relative; width: 48px; padding: 0; justify-content: center; }
  html.menu-replie .side__new { min-height: 44px; }
  html.menu-replie .side__nav, html.menu-replie .side__bloc { width: 100%; justify-items: center; }
  html.menu-replie .side__liens, html.menu-replie .side__liens[hidden] { display: grid; justify-items: center; }
  html.menu-replie .side__nav .side__groupe { justify-content: center; width: 100%; height: 14px; margin: 8px 0 2px; padding: 0; pointer-events: none; }
  html.menu-replie .side__nav .side__groupe::after { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--lime); }
  html.menu-replie .side__nav a { position: relative; justify-content: center; width: 48px; height: 44px; padding: 0; }
  html.menu-replie .side__nav .badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; font-size: 10px; }
  html.menu-replie .side__compte { flex-direction: column; align-items: center; width: 100%; }
  html.menu-replie .side__profil { flex: 0 0 auto; justify-content: center; width: 48px; padding: 6px; }
  html.menu-replie .side__profil-txt { display: none; }
  html.menu-replie .side__verrou { flex: 0 0 auto; width: 48px; height: 40px; }
}
@media (min-width: 861px) and (prefers-reduced-motion: reduce) {
  .app { transition: none; }
}
