/* Remises de matériel signées — styles communs (09/11/2026).
   Les couleurs viennent de l'appli hôte (variables --rm-*), clair et sombre suivent son réglage :
   .rm-hote-portail (Brutalist Pop du Portail), .rm-hote-terrain (appli terrain v2), .rm-hote-suivi (page bureau). */
.rm {
  --rm-surface: #fff; --rm-surface-2: #f5f7fa; --rm-encre: #0E2233; --rm-doux: #5C6F83; --rm-trait: #DDE4EC;
  --rm-accent: #0C3D63; --rm-sur-accent: #fff; --rm-ok: #1F8A55; --rm-ok-fond: #DDF1E6; --rm-att: #8a560f; --rm-att-fond: #F7EBD7;
  --rm-no: #B3343A; --rm-no-fond: #F8DFE0; --rm-r: 14px; --rm-bord: 1px solid var(--rm-trait); --rm-ombre: 0 10px 24px -16px rgba(12,61,99,.35);
  --rm-ombre-btn: none; --rm-poids: 700; --rm-f: inherit; --rm-fond-voile: var(--rm-surface-2);
  color: var(--rm-encre); font-family: var(--rm-f);
}
/* ---- Hôte : Portail Collaborateurs (Brutalist Pop) ---- */
.rm-hote-portail { --rm-surface: var(--blanc, #fff); --rm-surface-2: var(--creme, #f9f6ed); --rm-encre: var(--noir, #111); --rm-doux: var(--gris, #6b6b6b);
  --rm-trait: var(--noir, #111); --rm-accent: var(--jaune, #a38d1f); --rm-sur-accent: var(--noir, #111); --rm-r: 0; --rm-bord: var(--b, 3px solid #111);
  --rm-ombre: var(--sh-sm, 3px 3px 0 #111); --rm-ombre-btn: 3px 3px 0 var(--noir, #111); --rm-poids: 900; }
[data-theme=dark] .rm-hote-portail { --rm-ok-fond: #183a26; --rm-no-fond: #3d1c22; --rm-att-fond: #3a2c14; --rm-att: #f0c383; --rm-ok: #7fdaa9; --rm-no: #f5a3a6; --rm-sur-accent: #fff; }
/* ---- Hôte : appli terrain v2 ---- */
.rm-hote-terrain { --rm-surface: var(--surface, #fff); --rm-surface-2: var(--surface-2, #f5f7fa); --rm-encre: var(--encre, #0E2233); --rm-doux: var(--doux, #5C6F83);
  --rm-trait: var(--trait, #DDE4EC); --rm-accent: var(--accent, #0C3D63); --rm-sur-accent: var(--sur-accent, #fff); --rm-ok: var(--ok-encre, #17663F); --rm-ok-fond: var(--ok-fond, #DDF1E6);
  --rm-att: var(--att-encre, #7F4F0F); --rm-att-fond: var(--att-fond, #F7EBD7); --rm-no: var(--no-encre, #962A2E); --rm-no-fond: var(--no-fond, #F8DFE0);
  --rm-r: var(--r, 16px); --rm-ombre: var(--ombre); --rm-f: var(--f); --rm-fond-voile: var(--fond, #EEF2F6); }
/* ---- Hôte : page bureau du Suivi (néo-brutal du Suivi) ---- */
.rm-hote-suivi { --rm-surface: var(--card-bg, #fff); --rm-surface-2: var(--bg, #f4f6f8); --rm-encre: var(--text, #111); --rm-doux: var(--text-muted, #555);
  --rm-trait: var(--border, #111); --rm-accent: #111; --rm-sur-accent: #fff; --rm-r: 0; --rm-bord: 2px solid var(--border, #111);
  --rm-ombre: 4px 4px 0 var(--border, #111); --rm-ombre-btn: 3px 3px 0 var(--border, #111); --rm-poids: 800; }
.dark .rm-hote-suivi, .dark.rm-hote-suivi { --rm-accent: #3b9ad2; --rm-sur-accent: #0b0b08; --rm-ok-fond: #183a26; --rm-no-fond: #3d1c22; --rm-att-fond: #3a2c14; --rm-att: #f0c383; --rm-ok: #7fdaa9; --rm-no: #f5a3a6; }

/* ---- Charpente ---- */
.rm *, .rm *::before, .rm *::after { box-sizing: border-box; }
.rm-tete h2 { margin: 0 0 4px; font-size: 22px; font-weight: var(--rm-poids); letter-spacing: -.01em; }
.rm-sous, .rm-petit { color: var(--rm-doux); font-size: 13.5px; line-height: 1.45; margin: 0 0 12px; }
.rm-onglets { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.rm-onglets::-webkit-scrollbar { display: none; }
.rm-onglet { flex: 0 0 auto; min-height: 40px; padding: 8px 14px; border: var(--rm-bord); border-radius: var(--rm-r); background: var(--rm-surface); color: var(--rm-encre);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.rm-onglet.rm-on { background: var(--rm-accent); color: var(--rm-sur-accent); box-shadow: var(--rm-ombre-btn); }
.rm-pastille { display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 4px; border-radius: 10px; background: var(--rm-no); color: #fff; font-size: 12px; text-align: center; }
.rm-vide { padding: 22px 14px; text-align: center; color: var(--rm-doux); background: var(--rm-surface); border: var(--rm-bord); border-radius: var(--rm-r); line-height: 1.5; }
.rm-vide b { color: var(--rm-encre); }
.rm-erreur { color: var(--rm-no); }

.rm-carte, .rm-groupe, .rm-notifs { background: var(--rm-surface); border: var(--rm-bord); border-radius: var(--rm-r); box-shadow: var(--rm-ombre); padding: 14px; margin: 0 0 12px; }
.rm-a-signer { border-left: 6px solid var(--rm-att); }
.rm-l1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.rm-l1 > b { font-size: 15px; }
.rm-qui { font-size: 13.5px; color: var(--rm-doux); margin: 6px 0 8px; line-height: 1.45; }
.rm-qui b { color: var(--rm-encre); }
.rm-relance { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 8px; background: var(--rm-att-fond); color: var(--rm-att); font-size: 12px; font-weight: 600; }
.rm-puce { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 700; }
.rm-hote-portail .rm-puce, .rm-hote-suivi .rm-puce { border-radius: 0; border: 2px solid currentColor; }
.rm-att { background: var(--rm-att-fond); color: var(--rm-att); }
.rm-ok { background: var(--rm-ok-fond); color: var(--rm-ok); }
.rm-no { background: var(--rm-no-fond); color: var(--rm-no); }
.rm-gris { background: var(--rm-surface-2); color: var(--rm-doux); }
.rm-ok-t { color: var(--rm-ok); } .rm-no-t { color: var(--rm-no); }
.rm-items { list-style: none; margin: 0; padding: 0; }
.rm-items li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rm-trait); align-items: baseline; }
.rm-hote-portail .rm-items li, .rm-hote-suivi .rm-items li { border-top: 1px dashed var(--rm-doux); }
.rm-items li:first-child { border-top: 0; }
.rm-q { flex: 0 0 auto; min-width: 42px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rm-n { display: flex; flex-direction: column; min-width: 0; }
.rm-n b { overflow-wrap: anywhere; }
.rm-n small { color: var(--rm-doux); font-size: 12.5px; margin-top: 2px; }
.rm-info { margin: 8px 0 0; padding: 8px 10px; border-radius: calc(var(--rm-r) * .6); background: var(--rm-surface-2); font-size: 13.5px; line-height: 1.45; }
.rm-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---- Boutons ---- */
.rm-btn { min-height: 44px; padding: 10px 16px; border: var(--rm-bord); border-radius: var(--rm-r); background: var(--rm-surface); color: var(--rm-encre);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: var(--rm-ombre-btn); -webkit-tap-highlight-color: transparent; transition: transform .12s; }
.rm-btn:active { transform: translate(1px, 1px) scale(.99); }
.rm-btn:disabled { opacity: .45; cursor: not-allowed; }
.rm-btn.rm-plein { background: var(--rm-accent); color: var(--rm-sur-accent); border-color: var(--rm-accent); }
.rm-hote-portail .rm-btn.rm-plein, .rm-hote-suivi .rm-btn.rm-plein { border: var(--rm-bord); }
.rm-btn.rm-rouge { background: var(--rm-no); color: #fff; border-color: var(--rm-no); }
.rm-btn.rm-discret { background: transparent; box-shadow: none; border-color: transparent; color: var(--rm-doux); }
.rm-hote-terrain .rm-btn { border: 1px solid var(--rm-trait); }
.rm-hote-terrain .rm-btn.rm-plein { border-color: var(--rm-accent); }

/* ---- Formulaires ---- */
.rm input[type=search], .rm input:not([type]), .rm input[type=text], .rm input[type=number], .rm input[type=date], .rm select, .rm textarea {
  width: 100%; min-height: 44px; padding: 9px 11px; border: var(--rm-bord); border-radius: calc(var(--rm-r) * .6); background: var(--rm-surface); color: var(--rm-encre);
  font: inherit; font-size: 16px; }
.rm-hote-terrain input, .rm-hote-terrain select, .rm-hote-terrain textarea { border: 1px solid var(--rm-trait) !important; }
.rm-champ { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; min-width: 0; }
.rm-champ > span { font-size: 12.5px; font-weight: 700; color: var(--rm-doux); }
.rm-case { display: flex; gap: 10px; align-items: flex-start; padding: 12px; margin: 12px 0 0; border: var(--rm-bord); border-radius: var(--rm-r); background: var(--rm-surface); font-weight: 600; cursor: pointer; line-height: 1.4; }
.rm-case input { width: 24px; height: 24px; flex: 0 0 auto; margin: 0; accent-color: var(--rm-accent); }
.rm-case-petite { padding: 6px 10px; margin: 0; font-weight: 500; font-size: 14px; align-items: center; }
.rm-filtres { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 0 0 12px; }
@media (min-width: 720px) { .rm-filtres { grid-template-columns: 1fr 200px auto; align-items: center; } }

/* ---- Suivi des demandes ---- */
.rm-groupe { padding: 0; overflow: hidden; }
.rm-groupe-tete { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 10px 14px; background: var(--rm-surface-2); border-bottom: var(--rm-bord); }
.rm-groupe-tete small { color: var(--rm-doux); margin-left: auto; }
.rm-ligne-pers { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--rm-trait); }
.rm-ligne-pers:first-of-type { border-top: 0; }
.rm-pers { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 260px; }
.rm-pers small { color: var(--rm-doux); font-size: 12.5px; }
.rm-pers .rm-puce { align-self: flex-start; }
.rm-ligne-pers .rm-actions { margin: 0; }
.rm-ligne-pers .rm-btn { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.rm-notifs ul { list-style: none; padding: 0; margin: 8px 0 0; }
.rm-notifs li { padding: 5px 0; font-size: 14px; }
.rm-notifs small { color: var(--rm-doux); }

/* ---- Nouvelle remise ---- */
.rm-etape { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 8px; }
.rm-etape h3 { margin: 2px 0 2px; font-size: 17px; }
.rm-etape .rm-petit { margin: 0; }
.rm-num { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--rm-accent); color: var(--rm-sur-accent); font-weight: 800; }
.rm-hote-portail .rm-num, .rm-hote-suivi .rm-num { border-radius: 0; border: var(--rm-bord); }
.rm-ed-ligne { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; padding: 12px; margin: 0 0 10px; background: var(--rm-surface); border: var(--rm-bord); border-radius: var(--rm-r); }
.rm-ed-nom { grid-column: 1 / -1; }
.rm-ed-act { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }
.rm-ed-act .rm-btn { min-height: 34px; padding: 4px 10px; font-size: 13.5px; }
@media (min-width: 900px) {
  .rm-ed-ligne { grid-template-columns: 2.4fr .6fr 1.1fr 1fr 1.1fr 1fr auto; align-items: end; }
  .rm-ed-nom { grid-column: auto; }
  .rm-ed-act { grid-column: auto; padding-bottom: 10px; }
}
.rm-personnes { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 0; }
.rm-service small { display: block; font-weight: 700; color: var(--rm-doux); margin: 0 0 5px; text-transform: uppercase; letter-spacing: .04em; font-size: 11.5px; }
.rm-pers-choix { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; margin: 0 6px 6px 0; border: var(--rm-bord); border-radius: var(--rm-r);
  background: var(--rm-surface); cursor: pointer; font-weight: 600; }
.rm-pers-choix input { width: 20px; height: 20px; accent-color: var(--rm-accent); }
.rm-pers-choix.rm-on { background: var(--rm-accent); color: var(--rm-sur-accent); border-color: var(--rm-accent); }
.rm-hote-portail .rm-pers-choix.rm-on, .rm-hote-suivi .rm-pers-choix.rm-on { border: var(--rm-bord); box-shadow: var(--rm-ombre-btn); }
.rm-pp { padding: 12px; margin: 0 0 10px; background: var(--rm-surface-2); border: var(--rm-bord); border-radius: var(--rm-r); }
.rm-apercu { margin: 6px 0 0; }
.rm-pied-fixe { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 16px -4px 0; padding: 10px 4px calc(10px + env(safe-area-inset-bottom)); background: var(--rm-fond-voile); border-top: var(--rm-bord); }
.rm-hote-terrain .rm-pied-fixe { bottom: calc(var(--barre-bas, 64px) + env(safe-area-inset-bottom)); }
.rm-succes { text-align: center; padding: 18px 8px; }
.rm-succes .rm-actions { justify-content: center; }
.rm-coche { width: 64px; height: 64px; margin: 0 auto 8px; display: grid; place-items: center; border-radius: 50%; background: var(--rm-ok-fond); color: var(--rm-ok); font-size: 34px; font-weight: 800; }
.rm code, .rm-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.rm-code { background: var(--rm-surface-2); padding: 8px; border-radius: 8px; line-height: 1.6; }
.rm-controles, .rm-journal { list-style: none; padding: 0; margin: 0 0 8px; }
.rm-controles li, .rm-journal li { padding: 5px 0; font-size: 14px; line-height: 1.4; border-top: 1px solid var(--rm-trait); }

/* ---- Voile plein écran (relecture, signature, refus, preuve) ---- */
html.rm-bloque, html.rm-bloque body { overflow: hidden; }
.rm-voile { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: flex-end; justify-content: center; background: rgba(6, 20, 32, .45);
  opacity: 0; transition: opacity .2s; }
.rm-voile.rm-ouvert { opacity: 1; }
.rm-feuille { display: flex; flex-direction: column; width: 100%; max-width: 760px; max-height: 100%; height: 100%; background: var(--rm-fond-voile); color: var(--rm-encre);
  transform: translateY(18px); transition: transform .25s cubic-bezier(.32,.72,0,1); }
.rm-ouvert .rm-feuille { transform: none; }
@media (min-width: 800px) { .rm-voile { align-items: center; } .rm-feuille { height: auto; max-height: 92vh; border: var(--rm-bord); border-radius: var(--rm-r); box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); } }
.rm-barre { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; background: var(--rm-surface); border-bottom: var(--rm-bord); }
.rm-barre b { text-align: center; font-size: 16px; }
.rm-contenu { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px 18px; }
.rm-contenu h3 { margin: 16px 0 6px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--rm-doux); }
.rm-engagement { font-size: 14px; line-height: 1.5; background: var(--rm-surface); border: var(--rm-bord); border-radius: var(--rm-r); padding: 10px 12px; }
.rm-engagement p { margin: 0 0 6px; } .rm-engagement ul { margin: 0 0 6px; padding-left: 20px; }
.rm-declaration { font-style: italic; font-size: 14px; line-height: 1.5; margin: 12px 0 8px; }
.rm-pied { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--rm-surface); border-top: var(--rm-bord); }
.rm-voile .rm-pied .rm-btn { flex: 1 1 160px; }
.rm-puces-choix { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.rm-choix { min-height: 40px; padding: 6px 12px; border: var(--rm-bord); border-radius: 20px; background: var(--rm-surface); color: var(--rm-encre); font: inherit; font-size: 14px; cursor: pointer; }
.rm-hote-portail .rm-choix, .rm-hote-suivi .rm-choix { border-radius: 0; }
.rm-attente { display: flex; align-items: center; gap: 10px; margin: 0 auto; font-weight: 600; }
.rm-attente i { width: 20px; height: 20px; border: 3px solid var(--rm-trait); border-top-color: var(--rm-accent); border-radius: 50%; animation: rm-tourne .8s linear infinite; }
@keyframes rm-tourne { to { transform: rotate(360deg); } }

/* Pavé de signature : tout l'écran, fond papier */
.rm-signature .rm-feuille { max-width: none; height: 100%; max-height: none; border: 0; border-radius: 0; }
.rm-pave { display: flex; flex-direction: column; height: 100%; background: #FBFBF8; color: #0E2233; }
.rm-pave-haut { padding: calc(10px + env(safe-area-inset-top)) 16px 6px; display: flex; flex-direction: column; gap: 2px; }
.rm-pave-haut b { font-size: 17px; }
.rm-pave-astuce { font-size: 13px; color: #5C6F83; }
@media (orientation: landscape) { .rm-pave-astuce { display: none; } }
.rm-pave-zone { position: relative; flex: 1 1 auto; margin: 6px 12px; border: 2px dashed #9FB0C2; border-radius: 14px; background: #fff; touch-action: none; overflow: hidden; }
.rm-pave-zone canvas { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.rm-pave-ligne { position: absolute; left: 7%; right: 7%; bottom: 26%; border-bottom: 1.5px solid #C9D4DE; pointer-events: none; }
.rm-pave-ligne span { position: absolute; left: -2px; bottom: 2px; font-size: 22px; color: #9FB0C2; }
.rm-pave-vide[hidden] { display: none; }
.rm-pave-vide { position: absolute; inset: 0; display: grid; place-items: center; color: #B8C4D0; font-size: 22px; pointer-events: none; }
.rm-pave-bas { display: flex; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
.rm-pave-bas .rm-btn { flex: 1 1 0; background: #fff; color: #0E2233; border: 1px solid #C9D4DE; box-shadow: none; }
.rm-pave-bas .rm-btn.rm-plein { flex: 2 1 0; background: #0C3D63; color: #fff; border-color: #0C3D63; }

/* Message bref */
.rm-toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 10100; max-width: min(92vw, 520px); transform: translate(-50%, 20px); opacity: 0;
  padding: 12px 16px; border-radius: 12px; background: #0E2233; color: #fff; font-size: 15px; font-weight: 600; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5);
  transition: opacity .2s, transform .2s; pointer-events: none; }
.rm-toast.rm-vu { opacity: 1; transform: translate(-50%, 0); }
.rm-toast.rm-ko { background: #962A2E; }
@media (max-width: 380px) { .rm-tete h2 { font-size: 19px; } .rm-onglet { padding: 8px 10px; font-size: 13.5px; } }

/* ---- Appli terrain : page, bandeau de l'agenda, pastille du profil ---- */
.rm-terrain-page { position: fixed; inset: 0; z-index: 9000; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--fond, #EEF2F6); color: var(--encre, #0E2233); font-family: var(--f, system-ui); }
.rm-terrain-tete { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: var(--verre, rgba(255,255,255,.8)); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); border-bottom: 1px solid var(--trait, #DDE4EC); }
.rm-terrain-tete b { flex: 1; font-size: 17px; }
.rm-terrain-fermer { min-height: 40px; padding: 6px 14px; border: 1px solid var(--trait, #DDE4EC); border-radius: 12px; background: var(--surface, #fff); color: var(--encre, #0E2233); font: inherit; font-weight: 600; }
.rm-terrain-corps { padding: 14px 14px calc(30px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; }
.rm-terrain-corps .rm-tete h2 { font-size: 20px; }
.rm-bandeau { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 12px; padding: 14px; border: 0; border-radius: var(--r, 16px); text-align: left;
  background: var(--att-fond, #F7EBD7); color: var(--att-encre, #7F4F0F); font: inherit; box-shadow: var(--ombre); cursor: pointer; }
.rm-bandeau span:nth-child(2) { display: flex; flex-direction: column; flex: 1; }
.rm-bandeau b { font-size: 16px; } .rm-bandeau small { font-size: 13px; opacity: .85; margin-top: 2px; }
.rm-bandeau-ic { font-size: 24px; } .rm-bandeau-fl { font-size: 26px; opacity: .6; }
#bulleMoi { position: relative; }
.rm-pastille-moi { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--no, #C23A3E); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.rm-pastille-moi[hidden] { display: none; }
.rm-pastille-moi.rm-inline { position: static; display: inline-block; }
