/* Afrilog — Design « Desktop Pro ». CHARTE COULEUR extraite du LOGO Afrilog :
   voile bleu azur (dégradé #3aa8e4 → #0c86cf → #004a86) · ancre & « log » rouge #e30613 · « Afri » noir.
   Bleu Afrilog (primaire) = #0c86cf · Bleu profond = #004a86 · Rouge (ACTION) = #e30613. Police Arial. */
:root {
  --bleu: #0c86cf; --bleu-fonce: #004a86; --bleu-clair: #3aa8e4;
  --grad: linear-gradient(160deg, #3aa8e4 0%, #0c86cf 52%, #004a86 100%);
  --bleu-10: #e9f4fc; --bleu-sel: #dceffb; --bleu-bord: #bcdcf3;
  --row-zebra: #f3f9fd; --row-hover: #e6f3fc;
  --rouge: #e30613; --rouge-hover: #bd050f; --rouge-10: #fde7e8; --rouge-bord: #f6c9cc; --rouge-txt: #b3050f;
  --ink: #0f2231; --titre: #06304f; --muted: #66788a; --muted-2: #8a99a8;
  --bg: #eef2f6; --panel: #f7f9fb; --line: #d7e0e9; --line-2: #eef2f6;
  --ok: #1f8a5b; --danger: #e03131; --warn: #e84d0e;
  --accent: var(--bleu); --action: var(--rouge);
  --radius: 9px; --shadow: 0 2px 8px rgba(9,35,60,.07);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Arial, "Segoe UI", "Helvetica Neue", sans-serif; background: var(--bg); color: var(--ink); font-size: 13px; }
a { color: var(--bleu); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--grad); }
.login-card { background: #fff; padding: 30px; border-radius: 14px; box-shadow: 0 12px 40px rgba(9,35,60,.28); width: 350px; border-top: 4px solid var(--rouge); }
.login-card h1 { margin: 6px 0 2px; font-size: 22px; color: var(--titre); }
.login-card p { margin: 0 0 20px; color: var(--muted); }
.brand-badge { display: inline-flex; }

/* ---------- Coque desktop-pro ---------- */
.dproot { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.bandeau { flex: none; position: relative; overflow: hidden; background: var(--grad); border-top: 3px solid var(--rouge); }
.bandeau::after { content: ""; position: absolute; left: -120px; top: -120px; width: 300px; height: 300px; border-radius: 99em; background: radial-gradient(circle, rgba(227,6,19,.20), transparent 70%); pointer-events: none; }
.titlebar { height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 14px; position: relative; z-index: 1; color: #fff; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-name { line-height: 1.1; }
.brand-name b { display: block; font-size: 14px; font-weight: 700; letter-spacing: .3px; color: #fff; }
.brand-name i { display: block; font-size: 8.5px; font-weight: 600; font-style: normal; letter-spacing: 2px; color: #bcd7ec; }
.titlebar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.avatar { width: 30px; height: 30px; border-radius: 99px; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.who { line-height: 1.15; text-align: right; }
.who b { display: block; font-size: 12.5px; color: #fff; }
.who span { display: block; font-size: 10px; font-weight: 700; letter-spacing: .5px; color: #bcd7ec; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-quit { background: var(--rouge); color: #fff; border: 0; border-radius: 7px; font-size: 12px; font-weight: 700; padding: 8px 13px; }
.btn-quit:hover { background: var(--rouge-hover); }
.hero { position: relative; z-index: 1; color: #fff; padding: 4px 18px 9px; border-top: 1px solid rgba(255,255,255,.10); display: flex; align-items: center; gap: 10px; }
.hero .accent-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--rouge); flex: none; }
/* « ← Retour » du bandeau — sur toutes les pages sauf l'accueil. Discret (navigation, pas une action) mais
   toujours au même endroit : l'utilisateur ne le cherche pas deux fois. */
.hero .btn-retour { flex: none; font: inherit; font-size: 12px; font-weight: 600; color: #fff; cursor: pointer;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); border-radius: 6px;
  padding: 3px 10px; margin-right: 2px; line-height: 1.6; }
.hero .btn-retour:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.45); }
.hero .btn-retour:active { transform: translateY(1px); }
.hero h2 { font-size: 19px; font-weight: 700; letter-spacing: -.4px; margin: 0; }

.body { flex: 1; display: flex; min-height: 0; }
.main { flex: 1; min-width: 0; overflow: auto; background: #fff; }
.content { padding: 18px; }

/* Sidebar (arbre bleu dégradé) */
.sidebar { width: 234px; flex: none; background: linear-gradient(180deg, var(--bleu), var(--bleu-fonce)); border-right: 1px solid var(--bleu-fonce); display: flex; flex-direction: column; overflow-y: auto; padding: 5px 8px 8px; scrollbar-width: thin; overscroll-behavior: contain; }
.sidebar .mod-title { font-size: 10px; font-weight: 700; letter-spacing: 1.4px; color: #9dc3e2; text-transform: uppercase; padding: 8px 10px 3px; }
/* Sous-titre de CATÉGORIE dans un module (ex. Exploitation / Commercial / Paramétrage). Plus discret
   que le titre de module : pas de majuscules forcées, retrait à gauche et filet de rattachement. */
.sidebar .nav-group { font-size: 10px; font-weight: 600; letter-spacing: .6px; color: #7fa9cc; padding: 6px 10px 2px 12px; margin-top: 1px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar .mod-title + .nav-group { border-top: 0; margin-top: 0; padding-top: 2px; }
.sidebar a.navlink { display: flex; align-items: center; gap: 7px; font-size: 12.5px; line-height: 1.15; color: #d6e6f4; padding: 4px 10px; border-radius: 6px; margin-bottom: 0; }
.sidebar a.navlink .nav-ico { display: inline-block; width: 18px; text-align: center; font-size: 13px; flex: none; opacity: .95; }
.sidebar a.navlink:hover { background: rgba(255,255,255,.10); }
.sidebar a.navlink.active { color: #fff; font-weight: 700; background: rgba(255,255,255,.16); box-shadow: inset 3px 0 0 var(--rouge); }
.sidebar .spacer { flex: 1; }

/* Barre d'état */
.statusbar { height: 26px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 14px; background: var(--bleu-fonce); color: #bcd7ec; font-size: 11px; }
.statusbar .sb-right { margin-left: auto; }
.dot-ok { width: 7px; height: 7px; border-radius: 99px; background: #7be0ae; display: inline-block; margin-right: 5px; }

/* ---------- Launchpad ---------- */
.lp-welcome { margin-bottom: 14px; }
.launchpad { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 15px; }
.mod-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px 15px; box-shadow: var(--shadow); border-top: 4px solid var(--mc-accent, var(--bleu)); cursor: pointer; overflow: hidden; transition: transform .1s ease, box-shadow .1s ease, border-color .1s ease; }
.mod-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 99em; background: radial-gradient(circle, color-mix(in srgb, var(--mc-accent, var(--bleu)) 12%, transparent), transparent 70%); pointer-events: none; opacity: 0; transition: opacity .12s ease; }
.mod-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(9,35,60,.15); }
.mod-card:hover::after { opacity: 1; }
.mod-card .ico { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; font-size: 26px; background: color-mix(in srgb, var(--mc-accent, var(--bleu)) 12%, #fff); border: 1px solid color-mix(in srgb, var(--mc-accent, var(--bleu)) 24%, #fff); box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.mod-card h3 { margin: 12px 0 4px; color: var(--titre); font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.mod-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.mod-card .go { margin-top: 12px; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--mc-accent, var(--bleu)); opacity: .0; transform: translateX(-4px); transition: opacity .12s ease, transform .12s ease; }
.mod-card:hover .go { opacity: 1; transform: translateX(0); }

/* ---------- Composants ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card h2 { position: relative; margin: 0 0 12px; padding-left: 11px; font-size: 15px; color: var(--titre); }
.card h2::before { content: ""; position: absolute; left: 0; top: 1px; bottom: 1px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, var(--bleu-clair), var(--bleu-fonce)); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.field input, .field select, .field textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid color-mix(in srgb, var(--bleu) 35%, transparent); border-color: var(--bleu); }
.req label::after { content: " *"; color: var(--rouge); }

/* Boutons : primaire = ROUGE (action), ghost = bleu */
.btn { background: var(--rouge); color: #fff; border: none; padding: 8px 15px; border-radius: 7px; font-weight: 700; font-size: 12.5px; line-height: 1; display: inline-flex; align-items: center; gap: 7px; }
.btn:hover { background: var(--rouge-hover); }
.btn.ghost { background: #fff; color: var(--bleu); border: 1px solid var(--bleu-bord); }
.btn.ghost:hover { background: var(--bleu-10); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.danger { background: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* KPI — cartes de tableau de bord « desktop pro » : liseré d'accent, survol, pictogramme atténué */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 13px; margin-bottom: 18px; }
.kpi { position: relative; background: linear-gradient(180deg, #fff, #fbfdff); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px 14px; box-shadow: var(--shadow); overflow: hidden; transition: transform .1s ease, box-shadow .1s ease; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--bleu-clair), var(--bleu-fonce)); border-radius: var(--radius) 0 0 var(--radius); }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(9,35,60,.13); }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -.6px; font-variant-numeric: tabular-nums; color: var(--titre); line-height: 1.1; }
.kpi .l { color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; margin-top: 3px; }
.kpi .kico { position: absolute; top: 11px; right: 12px; font-size: 20px; opacity: .28; filter: grayscale(.2); }
.kpi.ok::before { background: linear-gradient(180deg, #37b982, var(--ok)); }
.kpi.warn::before { background: linear-gradient(180deg, #f6a13d, var(--warn)); }
.kpi.danger::before { background: linear-gradient(180deg, #f06565, var(--danger)); }
.kpi.accent::before { background: linear-gradient(180deg, #ff5a66, var(--rouge)); }
.kpi.violet::before { background: linear-gradient(180deg, #8a6bef, #6741d9); }
.kpi.info::before { background: linear-gradient(180deg, #35a7e6, var(--bleu-fonce)); }
.kpi.teal::before { background: linear-gradient(180deg, #2bb3b3, #0b7285); }
/* Tonalités : léger halo assorti sur le pictogramme (reste sobre) */
.kpi.ok .kico { color: var(--ok); opacity: .34; }
.kpi.warn .kico { color: var(--warn); opacity: .34; }
.kpi.danger .kico { color: var(--danger); opacity: .34; }
.kpi.accent .kico { color: var(--rouge); opacity: .32; }
.kpi.violet .kico { color: #6741d9; opacity: .34; }
.kpi.info .kico { color: var(--bleu); opacity: .34; }
.kpi.teal .kico { color: #0b7285; opacity: .34; }

/* KPI « mini » : compteurs par statut (rangée sous un titre de section) — pastille de couleur */
.statrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 11px; }
.kpi.mini { padding: 12px 13px; }
.kpi.mini::before { width: 4px; background: var(--st-color, var(--bleu)); }
.kpi.mini .v { font-size: 21px; }
.kpi.mini .l { display: flex; align-items: center; gap: 6px; }
.kpi.mini .l::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: var(--st-color, var(--bleu)); flex: none; }

/* ---------- Hero de page (tableaux de bord) ---------- */
/* En-tête de page : design + couleur IDENTIQUES partout (bleu Afrilog), compact. */
.page-hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 10px 16px; border-radius: var(--radius); color: #fff; box-shadow: var(--shadow); border-top: 3px solid var(--rouge); background: linear-gradient(135deg, var(--bleu) 0%, var(--bleu-fonce) 100%); }
.page-hero::after { content: ""; position: absolute; right: -60px; top: -70px; width: 200px; height: 200px; border-radius: 99em; background: radial-gradient(circle, rgba(255,255,255,.13), transparent 68%); pointer-events: none; }
.page-hero .ph-ico { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 21px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); }
.page-hero .ph-txt { position: relative; z-index: 1; min-width: 0; }
.page-hero h2 { margin: 0; font-size: 16.5px; font-weight: 700; letter-spacing: -.3px; color: #fff; }
.page-hero .ph-sub { margin-top: 1px; font-size: 12px; color: rgba(255,255,255,.85); }
.page-hero .ph-actions { position: relative; z-index: 1; margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }
/* ---------- Guide interactif du module ---------- */
.sidebar a.navlink.guide-link { color: #fff; background: rgba(255,255,255,.08); border: 1px dashed rgba(255,255,255,.28); margin-bottom: 3px; }
.sidebar a.navlink.guide-link:hover { background: rgba(255,255,255,.16); }
.guide { max-width: 560px; }
.guide-reco { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-radius: 10px; margin-bottom: 12px; font-size: 13.5px; }
.guide-reco.start { background: #fff1e6; border: 1px solid #f6d9bd; color: #8a4b0d; }
.guide-reco.ongoing { background: #e7f6ee; border: 1px solid #b7e3cb; color: #1c6b45; }
.guide-reco .gr-ico { font-size: 18px; flex: none; }
.guide-reco b { color: inherit; }
.guide-intro { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.guide-line { font-size: 13.5px; color: var(--ink); line-height: 1.55; background: var(--bleu-10); border: 1px solid var(--bleu-bord); border-radius: 9px; padding: 9px 12px; }
.guide-line.enj { background: #fff6ec; border-color: #f6d9bd; }
.guide-line b { color: var(--titre); }
.guide-steps { display: flex; flex-direction: column; gap: 0; position: relative; }
.gs-row { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.gs-row:first-child { border-top: none; }
.gs-num { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: linear-gradient(135deg, var(--bleu), var(--bleu-fonce)); color: #fff; font-weight: 700; box-shadow: 0 2px 6px rgba(0,74,134,.3); }
.gs-body { min-width: 0; flex: 1; }
.gs-title { font-weight: 700; color: var(--titre); font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gs-badge { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #fff; background: var(--rouge); padding: 2px 8px; border-radius: 20px; }
.gs-role { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.gs-tip { font-size: 12.5px; color: var(--warn); margin-top: 4px; }
.gs-go { margin-top: 7px; }

/* Boutons d'action rendus SOUS le bandeau */
.hero-wrap .page-hero { margin-bottom: 9px; }
.page-hero-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.btn.on-hero { background: #fff; color: var(--bleu-fonce); }
.btn.on-hero:hover { background: #eef6fc; }
.btn.on-hero.ghost { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.btn.on-hero.ghost:hover { background: rgba(255,255,255,.24); }

/* Mini-barre de progression (jauges de cockpit) */
.progress { height: 7px; border-radius: 99px; background: var(--bleu-10); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--bleu-clair), var(--bleu-fonce)); }

/* Livre-journal : en-tête d'écriture surligné, lignes comptables en retrait */
table.st.jrnl { width: 100%; border-collapse: collapse; }
table.st.jrnl th { position: sticky; top: 0; background: var(--bleu-fonce); color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; text-align: left; z-index: 1; }
table.st.jrnl td { padding: 5px 10px; border-bottom: 1px solid var(--line-2); }
.jrnl-head td { background: var(--bleu-10); border-top: 2px solid var(--bleu-bord); font-size: 12.5px; }
.jrnl-head:hover td { background: var(--bleu-sel); }
.jrnl-line td { color: var(--ink); }
.jrnl-line td:first-child { border-left: 3px solid var(--bleu-bord); }
.jrnl-total td { background: #10222f; color: #fff; font-size: 13px; }
.jrnl-total .money { color: #fff !important; }

/* Table défilante à en-tête collant (dégradé bleu) */
.scrolltable-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: 62vh; background: #fff; }
table.st { border-collapse: collapse; width: 100%; min-width: 600px; font-size: 12.5px; }
table.st th, table.st td { padding: 7px 12px; border-bottom: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
table.st th { position: sticky; top: 0; background: var(--grad); color: #fff; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; z-index: 1; box-shadow: inset -1px 0 0 rgba(255,255,255,.25); }
table.st tbody tr:nth-child(odd) { background: var(--row-zebra); }
table.st tbody tr:hover { background: var(--row-hover); cursor: pointer; }
/* Colonne « ouvrir le détail » (tables cliquables) */
table.st th.st-detailcol { width: 34px; padding-left: 6px; padding-right: 6px; }
table.st td.st-detail { width: 34px; text-align: center; padding-left: 6px; padding-right: 6px; }
.row-open { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; border-radius: 50%; background: var(--bleu-10); color: var(--bleu); font-size: 17px; font-weight: 700; line-height: 1; padding-bottom: 1px; border: 1px solid var(--bleu-bord); transition: background .1s, color .1s, transform .1s; }
table.st tbody tr.clickable:hover .row-open { background: var(--bleu); color: #fff; transform: translateX(2px); }
.tbl-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.tbl-toolbar input.search { flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; }

/* Searchable select */
.ss { position: relative; }
.ss:focus-within { z-index: 40; }
.ss input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.ss .opts { position: absolute; z-index: 40; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 7px; max-height: 176px; overflow: auto; box-shadow: var(--shadow); margin-top: 2px; }
.ss-inline .opts { position: static; z-index: auto; box-shadow: none; margin-top: 4px; }
.ss .opt { padding: 8px 10px; cursor: pointer; }
.ss .opt:hover, .ss .opt.hi { background: var(--bleu-10); }

/* Badges / pills */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 5px; background: var(--bleu-10); color: var(--bleu); border: 1px solid var(--bleu-bord); font-size: 11px; font-weight: 600; margin: 0 4px 4px 0; }
.tag { font-size: 10.5px; color: var(--muted); }
.money { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: none; padding: 9px 13px; color: var(--muted); font-weight: 700; font-size: 12.5px; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--bleu); border-bottom-color: var(--rouge); }
.tabs button { cursor: pointer; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 16px 24px; border-left: 2px solid var(--line); }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--rouge); }
.timeline .when { font-size: 11px; color: var(--muted); }

/* Toast */
#toast { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--titre); color: #fff; padding: 12px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 340px; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(11,39,64,.5); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 12px; box-shadow: 0 18px 50px rgba(9,35,60,.35); width: min(880px, 100%); max-height: 90vh; overflow: auto; padding: 22px 24px; }
.modal h2 { margin-top: 0; color: var(--titre); }
/* Barre de titre = poignée de déplacement (modale déplaçable, cf. enableDrag). */
.modal h2.modal-handle { cursor: move; user-select: none; touch-action: none; padding-right: 20px; position: relative; }
.modal h2.modal-handle::after { content: "⠿"; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); color: var(--muted, #adb5bd); font-size: 14px; letter-spacing: 1px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
/* Formulaire desktop : champs sur 2 colonnes ; tout le reste (titres, notes, textarea, groupes) pleine largeur. */
.modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 20px; align-items: start; }
.modal-grid > .field { margin-bottom: 8px; min-width: 0; }
.modal-grid > *:not(.field) { grid-column: 1 / -1; }
.modal-grid > .field.full { grid-column: 1 / -1; }
.modal-grid > .field:has(textarea) { grid-column: 1 / -1; }
@media (max-width: 560px) { .modal-grid { grid-template-columns: 1fr; } }
.err-inline { color: var(--danger); font-size: 12.5px; }

.l { } /* util (labels inline) */

@media (max-width: 767px) {
  .sidebar { display: none; }
  .who span { display: none; }
}
