/* L'Etincelle - fablab. Charte graphique juin 2026.
   Vert atelier #238679 (base) + jaune etincelle #EEC843 (accent unique).
   Titres Space Grotesk, texte Inter, etiquettes JetBrains Mono. */
:root {
  --vert: #238679;      /* primaire : fonds, titres, structure */
  --vert-profond: #06302B; /* fonds sombres, pieds de page */
  --jaune: #EEC843;     /* accent : boutons, soulignes, pictos actifs */
  --jaune-pale: #FBF1CC;/* surlignage, encadres */
  --sauge: #6FA39B;     /* graphiques, decoratif */
  --brume: #DCE9E6;     /* fonds de section clairs */
  --papier: #FAF8F1;    /* fond de page */
  --encre: #1C2522;     /* texte courant */
  --card: #ffffff;
  --line: #d7e2de;
  --ok: #238679;
  --warn: #9a6b00;
  --err: #b3261e;
  --muted: #5d6f6a;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --r: 10px; /* rayon coins (8 a 12px charte) */
}

* { box-sizing: border-box; }
/* L'attribut hidden doit toujours l'emporter : sans ce !important, une classe qui fixe
   un display (ex. .btn { display: inline-block }) reaffiche un element masque en JS.
   Rend inutile le contournement ponctuel qui existait pour .msg-badge. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--sans); background: var(--papier); color: var(--encre); font-size: 15px; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); }
a { color: var(--vert); }

.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 238px; flex-shrink: 0; background: var(--vert); color: #dcebe7;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { padding: 22px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.13); display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.brand .spark-symbol { flex-shrink: 0; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: -0.5px; color: #fff; line-height: 1; }
.brand-sub { width: 100%; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 2.5px; color: var(--jaune); margin-top: 4px; }
.sidebar nav { flex: 1; padding: 10px 0; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 18px; color: #bcd2cd; text-decoration: none;
  font-size: 13.5px; border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a:hover .nav-ico { color: var(--jaune); }
.sidebar nav a.active { background: rgba(255,255,255,.08); color: #fff; border-left-color: var(--jaune); }
.sidebar nav a.active .nav-ico { color: var(--jaune); }
.sidebar-user { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.13); background: var(--vert-profond); }
.su-name { font-weight: 600; font-size: 13.5px; color: #fff; }
.su-role { font-family: var(--mono); font-size: 11px; color: var(--sauge); margin: 2px 0 8px; text-transform: uppercase; letter-spacing: .5px; }
.su-logout { color: var(--jaune); font-size: 12.5px; text-decoration: none; }
.su-logout:hover { text-decoration: underline; }

/* Sections repliables de la barre laterale */
.nav-groupe-tete {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 18px;
  background: none; border: 0; border-left: 3px solid transparent; cursor: pointer;
  color: #9fbdb6; font: inherit; font-size: 11px; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 1.2px; text-align: left;
}
.nav-groupe-tete:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-groupe-nom { flex: 1; }
.nav-chev { width: 14px; height: 14px; flex-shrink: 0; transition: transform .18s; }
.nav-groupe.open .nav-chev { transform: rotate(180deg); }
.nav-groupe.open .nav-groupe-tete { color: #fff; }
.nav-groupe-corps { display: none; padding-bottom: 4px; }
.nav-groupe.open .nav-groupe-corps { display: block; }
.nav-groupe-corps a { padding-left: 34px; font-size: 13px; }
/* Une section fermee qui contient la page courante reste signalee */
.nav-groupe:not(.open) .nav-groupe-corps a.active { display: none; }

.nav-ico { width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; color: inherit; }
.nav-ico svg { width: 100%; height: 100%; }

/* Main */
.main { flex: 1; min-width: 0; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 13px 26px; display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { margin: 0; font-size: 19px; letter-spacing: -0.3px; color: var(--vert); }
.topbar-brand { display: none; align-items: center; gap: 9px; text-decoration: none; }
.topbar-brand span { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--vert); letter-spacing: -0.4px; }
.burger { display: none; color: var(--vert); background: var(--brume); border: 0; cursor: pointer; margin-left: auto; }
.topbar-pts { background: var(--jaune); color: var(--encre); font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; letter-spacing: .5px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.content { padding: 26px; max-width: 1200px; }

/* Page profil */
.profil-head { display: flex; align-items: center; gap: 16px; }
.profil-nom { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--vert); letter-spacing: -0.4px; }
.profil-role { color: var(--muted); font-size: 13px; text-transform: capitalize; }
.profil-points { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 10px; }
.profil-points-val { font-family: var(--display); font-weight: 700; font-size: 40px; color: var(--vert); letter-spacing: -1px; }
.profil-points-lbl { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.profil-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 8px 0 12px; }
.profil-dl dt { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); align-self: center; }
.profil-dl dd { margin: 0; font-size: 14.5px; }

/* Choix du tarif d'adhesion (profil, inscription, grille de gestion) */
.tarif-choix { border: 0; padding: 0; margin: 0; }
/* Une ligne de tarif est un <label>, mais son contenu est du texte courant, pas
   un intitule de champ : elle sort donc du mono-capitales applique aux labels. */
.tarif-ligne, .tarif-ligne * { font-family: var(--sans); text-transform: none;
  letter-spacing: 0; }
.tarif-ligne { font-size: 14.5px; color: var(--encre); }
.tarif-choix legend { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); padding: 0 0 6px; }
.tarif-ligne { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 6px; background: var(--card); }
.tarif-ligne:hover { border-color: var(--sauge); }
.tarif-ligne:has(input:checked) { border-color: var(--vert); background: var(--brume); }
.tarif-ligne input { margin: 0; flex-shrink: 0; }
.tarif-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tarif-txt .muted { font-size: 13px; }
.tarif-prix { font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--vert); white-space: nowrap; }

/* Tarif soumis a justificatif : encadre a part, il ne se regle pas tout de suite */
.tarif-justif { border: 1px dashed var(--sauge); border-radius: var(--r); padding: 12px; margin-top: 10px;
  background: color-mix(in srgb, var(--brume) 45%, transparent); }
.tarif-justif-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tarif-justif-tete .tarif-txt { flex: 1; }
.tarif-justif input[type="file"] { font-size: 13px; }

/* Grille des tarifs cote gestion : une ligne = un formulaire */
.tarif-edit { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 10px; }
.tarif-edit.tarif-off { background: #f4f6f5; border-style: dashed; }
.tarif-neuf { border-style: dashed; border-color: var(--sauge); }
.tarif-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.tarif-actif { display: flex; flex-direction: row; align-items: center; gap: 6px; flex: 1 1 auto;
  margin: 0; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.tarif-actif input { margin: 0; }

/* Avatar generique (silhouette sur pastille de couleur) */
.avatar { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden; color: #fff; }
.avatar svg { width: 64%; height: 64%; display: block; }

/* Pastille profil + menu deroulant */
.usermenu { position: relative; }
.usermenu-trigger { display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--brume); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 10px 4px 4px; color: var(--encre); font: inherit; transition: background .12s, border-color .12s; }
.usermenu-trigger:hover, .usermenu-trigger[aria-expanded="true"] { background: #fff; border-color: var(--vert); }
.usermenu-name { font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: -0.2px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu-chev { width: 16px; height: 16px; color: var(--vert); transition: transform .18s; }
.usermenu-trigger[aria-expanded="true"] .usermenu-chev { transform: rotate(180deg); }

.usermenu-pop { position: absolute; top: calc(100% + 8px); right: 0; min-width: 248px; z-index: 50;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 14px 38px rgba(6,48,43,.18);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transform-origin: top right;
  transition: opacity .15s, transform .15s, visibility .15s; }
.usermenu.open .usermenu-pop { opacity: 1; visibility: visible; transform: translateY(0); }
.usermenu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.usermenu-id { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.usermenu-id strong { font-family: var(--display); font-weight: 600; font-size: 14.5px; color: var(--encre); }
.usermenu-id span { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }
.usermenu-pop a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px;
  text-decoration: none; color: var(--encre); font-size: 14px; }
.usermenu-pop a svg { width: 18px; height: 18px; color: var(--vert); flex-shrink: 0; }
.usermenu-pop a:hover { background: var(--brume); }
.usermenu-tag { margin-left: auto; background: var(--jaune); color: var(--encre); font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.usermenu-out { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 11px !important; border-radius: 0 0 9px 9px; }
.usermenu-out svg { color: #c0392b !important; }
.usermenu-out:hover { background: #fdecea !important; }

/* Bouton messagerie + pastille de non-lus (header) */
.msg-btn { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; color: var(--vert); background: var(--brume);
  border: 1px solid var(--line); text-decoration: none; transition: background .12s, border-color .12s; }
.msg-btn:hover, .msg-btn.active { background: #fff; border-color: var(--vert); }
.msg-btn svg { width: 20px; height: 20px; }
.msg-badge { min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--err);
  color: #fff; font-family: var(--mono); font-size: 10px; font-weight: 700; display: inline-flex;
  align-items: center; justify-content: center; border: 2px solid var(--card); }
.msg-btn .msg-badge { position: absolute; top: -5px; right: -5px; }
/* Badge dans la sidebar (aligne a droite du lien) */
.nav-badge { margin-left: auto; border-color: transparent; }
/* Badge dans la barre du bas (sur l'icone) */
.bottomnav .bn-ico { position: relative; }
.bn-badge { position: absolute; top: -6px; right: -9px; min-width: 16px; height: 16px; padding: 0 3px;
  font-size: 9px; border-color: var(--card); }

/* Messagerie */
.chat { display: flex; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: var(--card); height: calc(100vh - 140px); min-height: 420px; }
.chat-list { width: 322px; flex-shrink: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.chat-list-head h2 { margin: 0; font-size: 18px; color: var(--vert); font-family: var(--display); }
.chat-actions { display: flex; gap: 6px; }
.chat-actions .btn { margin-top: 0; }
.chat-convs { overflow-y: auto; flex: 1; min-height: 0; }
.chat-conv { display: flex; align-items: center; gap: 11px; padding: 11px 14px; text-decoration: none; color: var(--encre); border-bottom: 1px solid var(--line); }
.chat-conv:hover, .chat-conv.active { background: var(--brume); }
.chat-conv-ava { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--vert); display: inline-flex; align-items: center; justify-content: center; }
.chat-conv-ava.is-group { background: var(--vert-profond); }
.chat-conv-ava svg { width: 22px; height: 22px; }
.chat-conv-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chat-conv-top strong { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conv-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.chat-conv-last { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conv-badge { flex-shrink: 0; background: var(--vert); color: #fff; min-width: 20px; height: 20px; border-radius: 999px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }

.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-main-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-main-head strong { font-size: 15.5px; color: var(--vert); display: block; }
.chat-main-sub { font-size: 12px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.chat-back { display: none; color: var(--vert); align-items: center; }
.chat-back svg { width: 22px; height: 22px; }
.chat-thread { flex: 1; overflow-y: auto; min-height: 0; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--brume); }
.chat-msg { max-width: 76%; align-self: flex-start; background: var(--card); border-radius: 13px; padding: 7px 12px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 1px 2px rgba(6,48,43,.06); }
.chat-msg.mine { align-self: flex-end; background: var(--vert); color: #fff; }
.chat-msg-auth { font-size: 11.5px; font-weight: 700; color: var(--vert); }
.chat-msg-corps { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.chat-msg-time { font-size: 10px; color: var(--muted); align-self: flex-end; }
.chat-msg.mine .chat-msg-time { color: rgba(255,255,255,.78); }
.chat-composer { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-composer textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14px; max-height: 120px; line-height: 1.3; }
.chat-composer textarea:focus { outline: none; border-color: var(--vert); }
.chat-composer .btn { margin-top: 0; width: 44px; height: 44px; padding: 0; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; }
.chat-composer .btn svg { width: 20px; height: 20px; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); padding: 30px; text-align: center; }
.chat-empty svg { width: 54px; height: 54px; color: var(--line); }
.chat-members { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-top: 4px; }
.chat-member { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.chat-member:hover { background: var(--brume); }

/* Surtitre marqueur // */
.card h2, .section-title {
  margin: 0 0 14px; font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px;
  font-family: var(--mono); color: var(--vert); font-weight: 500;
}
.card h2::before, .section-title::before { content: "// "; color: var(--jaune); font-weight: 700; }

/* Cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* KPI */
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; }
.kpi .k-val { font-family: var(--display); font-size: 27px; font-weight: 700; letter-spacing: -1px; color: var(--vert); }
.kpi .k-label { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--muted); margin-top: 3px; }
.kpi.k-spark { border-top: 3px solid var(--jaune); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); padding: 9px 10px; border-bottom: 2px solid var(--vert); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: var(--brume); }
.table-wrap { overflow-x: auto; }

/* Forms */
form.inline { display: inline; }
label { display: block; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--vert); margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=tel], input[type=file],
select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-family: var(--sans); font-size: 14px; color: var(--encre);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--jaune); outline-offset: 0; border-color: var(--vert); }
textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }

/* Buttons : vert atelier, focus jaune 2px */
.btn {
  display: inline-block; padding: 9px 17px; background: var(--vert); color: #fff;
  border: 0; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; text-decoration: none;
  font-family: var(--sans); margin-top: 10px; transition: background .12s;
}
.btn:hover { background: var(--vert-profond); }
.btn:focus-visible { outline: 2px solid var(--jaune); outline-offset: 2px; }
.btn-spark { background: var(--jaune); color: var(--encre); }
.btn-spark:hover { background: #e3b92b; }
.btn-sm { padding: 5px 11px; font-size: 12px; margin-top: 0; border-radius: 7px; }
.btn-ghost { background: transparent; color: var(--vert); border: 1px solid var(--vert); }
.btn-ghost:hover { background: var(--vert); color: #fff; }
.btn-danger { background: var(--err); }
.btn-danger:hover { background: #8c1c16; }

/* Badges */
.badge { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.8px; padding: 3px 8px; border: 1px solid; border-radius: 6px; }
.badge-ok { color: var(--vert); border-color: var(--vert); background: var(--brume); }
.badge-warn { color: var(--warn); border-color: var(--warn); background: var(--jaune-pale); }
.badge-err { color: var(--err); border-color: var(--err); background: #fbeae9; }
.badge-info { color: var(--vert); border-color: var(--sauge); background: var(--brume); }
.badge-muted { color: var(--muted); border-color: var(--line); background: #f1f0ea; }

/* Flash */
.flash { padding: 11px 16px; margin-bottom: 18px; font-size: 14px; border-left: 4px solid; border-radius: 0 8px 8px 0; }
.flash-ok { background: var(--brume); border-color: var(--jaune); color: var(--vert); }
.flash-err { background: #fbeae9; border-color: var(--err); color: var(--err); }

/* Planning */
.planning-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.planning-day { background: var(--card); border: 1px solid var(--line); border-radius: 8px; min-height: 130px; padding: 8px; }
.planning-day.today { border: 2px solid var(--jaune); }
.pd-head { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); margin-bottom: 6px; }
.pd-item { font-size: 11.5px; padding: 4px 6px; margin-bottom: 4px; border-left: 3px solid var(--sauge); background: var(--brume); border-radius: 0 5px 5px 0; }
.pd-item.t-resa { border-color: var(--vert); background: var(--brume); }
.pd-item.t-atelier { border-color: var(--jaune); background: var(--jaune-pale); }
.pd-item.t-mission { border-color: var(--sauge); background: #eaf2ef; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--vert); padding: 20px; }
.login-box { width: 360px; max-width: 100%; background: var(--card); padding: 36px 34px; border-radius: 14px; }
.login-box .login-logo { display: flex; justify-content: center; margin-bottom: 6px; }
.login-box h1 { font-size: 25px; margin: 6px 0 2px; letter-spacing: -0.5px; color: var(--vert); text-align: center; }
/* Le surtitre, et lui seul. La regle visait `.login-box p` : elle rattrapait au
   passage toute phrase de la carte et la rendait en capitales monospace, illisible
   des que le contenu depassait trois mots. */
.login-box p.login-sur { font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 2px; color: var(--muted); margin: 0 0 18px; text-align: center; }
.login-box p { margin: 0 0 14px; }

/* Connexion : texte d'explication, case "rester connecte", liens de bas de carte.
   On annule le style "surtitre" herite de .login-box p. */
.login-box p.login-intro, .login-box p.login-liens {
  font-family: var(--sans); font-size: 13.5px; text-transform: none; letter-spacing: 0; line-height: 1.5;
}
.login-box p.login-intro { color: var(--encre); margin: 0 0 16px; text-align: left; }
.login-box p.login-liens { margin: 14px 0 0; }
.login-box p.login-liens a { color: var(--vert); font-weight: 600; }
.login-check { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px;
  font-size: 13.5px; color: var(--encre); text-transform: none; letter-spacing: 0; }
.login-check input { width: auto; margin: 0; }

/* Carte elargie : un formulaire long etouffe dans les 360 px de la carte de connexion. */
.login-box-large { width: 620px; padding: 34px 38px 30px; }
@media (max-width: 680px) { .login-box-large { width: 100%; padding: 26px 20px 22px; } }

/* Fil des etapes. Cliquable vers l'arriere seulement : on ne saute pas
   par-dessus un champ obligatoire. */
.etapes { display: flex; gap: 6px; list-style: none; margin: 0 0 22px; padding: 0; }
.etapes-item { flex: 1; display: flex; align-items: center; gap: 8px; cursor: default;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); padding-top: 8px; border-top: 3px solid var(--line); }
.etapes-item span { width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--line); color: var(--muted); font-size: 11px; }
.etapes-item.fait { color: var(--vert); border-top-color: var(--sauge); cursor: pointer; }
.etapes-item.fait span { background: var(--sauge); color: #fff; }
.etapes-item.actif { color: var(--vert); border-top-color: var(--jaune); font-weight: 600; }
.etapes-item.actif span { background: var(--jaune); color: var(--vert-profond); }
@media (max-width: 560px) {
  .etapes-item { font-size: 0; gap: 0; justify-content: center; }
  .etapes-item span { font-size: 11px; }
}

/* Une etape */
.pas { border: 0; padding: 0; margin: 0; min-width: 0; }
.pas-titre { font-family: var(--display); font-size: 19px; font-weight: 600;
  color: var(--vert); padding: 0; margin-bottom: 14px; }
.pas label { display: block; margin-bottom: 12px; font-size: 13.5px; color: var(--muted); }
.pas-duo { display: flex; gap: 12px; flex-wrap: wrap; }
.pas-duo > label { flex: 1 1 180px; margin-bottom: 12px; }
.pas-aide { font-size: 13px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
.pas .tarif-choix label { margin-bottom: 0; }

/* Rappel du tarif retenu, pour qui arrive par un lien et saute l'etape du choix. */
.choix-rappel { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--brume); border-radius: var(--r); padding: 10px 14px;
  margin: 0 0 18px; font-size: 14px; color: var(--vert-profond); }
.choix-rappel span { flex: 1; font-weight: 600; }
.lien-nu { background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--vert); text-decoration: underline;
  text-underline-offset: 3px; }
.lien-nu:hover { text-decoration-color: var(--jaune); text-decoration-thickness: 2px; }

.pas-nav { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px;
  padding-top: 18px; border-top: 1px solid var(--line); }
.pas-nav .btn { min-width: 130px; justify-content: center; }
@media (max-width: 480px) { .pas-nav .btn { flex: 1; min-width: 0; } }

/* Page Notifications */
.push-etat { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; }
.push-etat.push-ok { color: var(--vert); font-weight: 600; }
.push-etat.push-warn { color: var(--warn); }

/* Case a cocher compacte dans une barre d'actions de tableau */
.inline-check { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); text-transform: none; letter-spacing: 0; }
.inline-check input { width: auto; margin: 0; }

.muted { color: var(--muted); font-size: 12.5px; }
.mt0 { margin-top: 0; }
.actions-cell form, .actions-cell a { margin-right: 5px; }
.fiche-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }

/* Bandeau accueil */
.hello { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 14px; }
.hello-hi { font-family: var(--display); font-size: 25px; font-weight: 500; letter-spacing: -0.5px; color: var(--vert); }
.hello-hi strong { font-weight: 700; }
.hello-sub { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: capitalize; margin-top: 3px; }
.resume-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.resume-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; display: flex; align-items: center; gap: 11px; }
.resume-val { font-family: var(--display); font-size: 23px; font-weight: 700; color: var(--vert); line-height: 1; }
.resume-val.hot { color: var(--encre); background: var(--jaune); border-radius: 7px; padding: 2px 9px; }
.resume-lib { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }

/* Selecteur de densite des tuiles */
.tiles-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
.tiles-bar .lbl { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.seg button, .seg a { border: 0; background: transparent; padding: 6px 12px; font-family: var(--mono); font-size: 12px; cursor: pointer; color: var(--muted); border-left: 1px solid var(--line); text-decoration: none; display: inline-flex; align-items: center; }
.seg button:first-child, .seg a:first-child { border-left: 0; }
.seg button.on, .seg a.on { background: var(--vert); color: #fff; }

/* Champ de tags (competences, centres d'interet) */
.taginput { border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; background: var(--card); margin-bottom: 12px; }
.taginput:focus-within { border-color: var(--vert); }
.tag-chips:not(:empty) { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 7px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brume); color: var(--encre); border-radius: 999px; padding: 3px 6px 3px 11px; font-size: 13px; }
.tag-x { border: 0; background: transparent; color: var(--vert); font-size: 17px; line-height: 1; cursor: pointer; padding: 0 2px; }
.tag-entry { width: 100%; border: 0; padding: 5px 4px; font: inherit; font-size: 14px; background: transparent; }
.tag-entry:focus { outline: none; }

/* Grille de tuiles : icone + nom uniquement */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px 14px; text-decoration: none; color: var(--encre);
  transition: background .12s, border-color .12s;
  min-height: 150px; min-width: 0; overflow: hidden;
}
.tile:hover, .tile:active, .tile:focus-visible { background: var(--brume); border-color: var(--vert); outline: none; }
.tile:focus-visible { outline: 2px solid var(--jaune); outline-offset: 2px; }
.tile-ico {
  width: 56px; height: 56px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brume); color: var(--vert); transition: background .12s, color .12s;
}
.tile:hover .tile-ico, .tile:active .tile-ico, .tile:focus-visible .tile-ico { background: var(--jaune); color: var(--vert); }
.tile-ico svg { width: 30px; height: 30px; }
.tile-label { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -0.2px; line-height: 1.15; max-width: 100%; overflow-wrap: anywhere; hyphens: auto; }

/* Scrim */
.scrim { display: none; position: fixed; inset: 0; background: rgba(6,48,43,.55); z-index: 40; opacity: 0; transition: opacity .2s; }
.scrim.show { display: block; opacity: 1; }

/* Barre de navigation du bas (mobile uniquement) */
.bottomnav { display: none; }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); padding: 7px 2px; min-width: 0; }
.bottomnav .bn-ico { display: inline-flex; }
.bottomnav .bn-ico svg { width: 23px; height: 23px; }
.bottomnav .bn-lbl { font-size: 10px; font-weight: 600; letter-spacing: -0.1px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottomnav a.active { color: var(--vert); }
.bottomnav a.active .bn-ico { color: var(--vert); }
.bottomnav .bn-out { color: #c0392b; }
body.no-scroll { overflow: hidden; }

/* ----- Accessibilite ----- */
@font-face { font-family: "OpenDyslexic"; font-weight: 400; font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/@fontsource/opendyslexic@5/files/opendyslexic-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "OpenDyslexic"; font-weight: 700; font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/@fontsource/opendyslexic@5/files/opendyslexic-latin-700-normal.woff2") format("woff2"); }

html.a11y-dys, html.a11y-dys * { font-family: "OpenDyslexic", "Comic Sans MS", sans-serif !important; letter-spacing: .02em; }
html.a11y-bigtext { zoom: 1.15; }
html.a11y-nomotion *, html.a11y-nomotion *::before, html.a11y-nomotion *::after { animation: none !important; transition: none !important; }

html.a11y-contrast {
  --papier: #ffffff; --encre: #000000; --muted: #2a3331; --line: #238679;
  --vert: #06302B; --brume: #c8ddd7; --card: #ffffff;
}
html.a11y-contrast .card, html.a11y-contrast .kpi, html.a11y-contrast .tile,
html.a11y-contrast .resume-item, html.a11y-contrast input, html.a11y-contrast select, html.a11y-contrast textarea { border-width: 2px; }
html.a11y-contrast .muted { color: #2a3331; }
html.a11y-contrast a { text-decoration: underline; }
html.a11y-contrast .sidebar nav a, html.a11y-contrast .btn, html.a11y-contrast .bottomnav a { text-decoration: none; }

/* Reglages (page configuration) */
.cfg-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cfg-row .cfg-txt { flex: 1 1 200px; }
.cfg-row:last-child { border-bottom: 0; }
.cfg-txt b { display: block; font-family: var(--display); font-size: 15px; color: var(--vert); }
.cfg-txt span { font-size: 12.5px; color: var(--muted); }
.switch { position: relative; width: 50px; height: 28px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s; }
.switch .track::before { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + .track { background: var(--vert); }
.switch input:checked + .track::before { transform: translateX(22px); }
.switch input:focus-visible + .track { outline: 2px solid var(--jaune); outline-offset: 2px; }

/* Mode reorganisation des tuiles */
.reorder-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.reorder-hint .lbl { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.btn-reorder { background: var(--card); color: var(--vert); border: 1px solid var(--vert); border-radius: 8px; padding: 6px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: var(--sans); }
.tiles.editing .btn-reorder { background: var(--vert); color: #fff; }
@keyframes jiggle { 0% { transform: rotate(-1.1deg); } 50% { transform: rotate(1.1deg); } 100% { transform: rotate(-1.1deg); } }
.tiles.editing .tile { animation: jiggle .22s ease-in-out infinite; cursor: grab; touch-action: none; }
.tiles.editing .tile.dragging { animation: none; opacity: .92; z-index: 20; cursor: grabbing; box-shadow: 0 10px 28px rgba(6,48,43,.22); }
html.a11y-nomotion .tiles.editing .tile { animation: none; }
.tiles.editing .tile::after { content: ""; position: absolute; top: 7px; right: 9px; width: 14px; height: 14px;
  background: var(--jaune); border-radius: 50%; }
.tile { position: relative; }

/* Grille de reorganisation dans la page Accessibilite */
.tiles-config { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); margin-top: 6px; }
/* Sur PC, cette grille reste un APERCU de l'ecran d'accueil du telephone : sans limite de
   largeur elle produisait des tuiles de 283 px sur ~875 px de haut, pour un reglage qui ne
   concerne que le mobile. On la cadre a une largeur de telephone. */
@media (min-width: 901px) {
  .tiles-apercu { max-width: 340px; border: 1px solid var(--line); border-radius: 22px;
    padding: 14px; background: var(--brume); }
  .tiles-apercu .tiles-config { gap: 10px; }
  .tiles-apercu-note { font-family: var(--mono); font-size: 10px; text-transform: uppercase;
    letter-spacing: 1px; color: var(--muted); text-align: center; margin: 0 0 10px; }
}
@media (max-width: 900px) { .tiles-apercu-note { display: none; } }
.tiles-config .tile { cursor: grab; aspect-ratio: 1 / 1; min-height: 0; padding: 14px 8px; gap: 8px; user-select: none; touch-action: none; }
.tiles-config .tile-ico { width: 44px; height: 44px; }
.tiles-config .tile-ico svg { width: 24px; height: 24px; }
.tiles-config .tile-label { font-size: 12px; }
.tiles-config .tile.dragging { opacity: .92; z-index: 20; cursor: grabbing; box-shadow: 0 10px 28px rgba(6,48,43,.22); }

/* Bouton flottant + (ouvre une popup) */
.fab {
  position: fixed; right: 18px; bottom: 24px; z-index: 46;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--jaune); color: var(--encre); font-size: 32px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(6,48,43,.26);
}
.fab:focus-visible { outline: 3px solid var(--vert); outline-offset: 2px; }
.fab svg { width: 26px; height: 26px; }

/* Popup / modale */
.modal-backdrop { position: fixed; inset: 0; background: rgba(6,48,43,.5); display: none; align-items: center; justify-content: center; z-index: 60; padding: 0; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 16px; padding: 20px 22px 24px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.modal-head h2 { margin: 0; font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--vert); font-weight: 500; }
.modal-head h2::before { content: "// "; color: var(--jaune); font-weight: 700; }
.modal-close { background: var(--brume); color: var(--vert); border: 0; width: 34px; height: 34px; border-radius: 9px; font-size: 22px; line-height: 1; cursor: pointer; flex-shrink: 0; }
.modal .btn { width: 100%; text-align: center; margin-top: 16px; }

@media (max-width: 560px) {
  .modal-backdrop { align-items: flex-end; }
  .modal { max-width: 100%; border-radius: 18px 18px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
@media (max-width: 900px) {
  /* Au-dessus de la barre de navigation du bas */
  .fab { bottom: calc(78px + env(safe-area-inset-bottom)); }
}

.pts-solde { font-family: var(--mono); font-size: 13px; color: var(--vert); min-width: 26px; display: inline-block; }

.chat-main-auto { margin-left: auto; font-family: var(--mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .8px; color: var(--muted); white-space: nowrap; }
@media (max-width: 700px) { .chat-main-auto { display: none; } }

/* Cases du planning : cliquables pour creer */
.planning-day.ajoutable { cursor: pointer; }
.planning-day.ajoutable:hover { border-color: var(--vert); }
.planning-day.ajoutable:focus-visible { outline: 2px solid var(--jaune); outline-offset: 2px; }
.pd-plus { float: right; color: var(--muted); font-weight: 700; opacity: 0; transition: opacity .12s; }
.planning-day.ajoutable:hover .pd-plus,
.planning-day.ajoutable:focus-visible .pd-plus { opacity: 1; color: var(--vert); }
.pa-pane[hidden] { display: none !important; }

/* Champ piege a robots du formulaire d'inscription : hors ecran plutot que display:none,
   que les automates reperent trop facilement. */
.pot-de-miel { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Mouvements de points : le sens doit se lire d'un coup d'oeil */
.pts-credit { color: var(--ok); font-weight: 600; }
.pts-depense { color: var(--muted); }

/* « Mon espace » : accueil PC des adherents, benevoles et partenaires */
.espace { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.espace-carte { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px 14px; display: flex; flex-direction: column; min-height: 152px; }
.espace-titre { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--muted); margin-bottom: 10px; }
.espace-titre::before { content: "// "; color: var(--jaune); font-weight: 700; }
.espace-val { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.4px;
  color: var(--vert); line-height: 1.2; }
.espace-val.espace-date { font-size: 17px; text-transform: capitalize; }
.espace-val.espace-ok { color: var(--ok); }
.espace-val.espace-alerte { color: var(--err); }
.espace-unite { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; margin-left: 6px; }
.espace-points .espace-val { font-size: 38px; }
.espace-sub { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.espace-vide { font-size: 14px; color: var(--muted); font-style: italic; }
.espace-lien { margin-top: auto; padding-top: 12px; font-size: 13px; font-weight: 600;
  color: var(--vert); text-decoration: none; }
.espace-lien:hover { text-decoration: underline; }

/* Bascule PC / mobile */
.hide-desktop { display: none; }
@media (max-width: 900px) {
  .hide-mobile { display: none; }
  .hide-desktop { display: block; }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .planning-grid { grid-template-columns: 1fr; }
  .content { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
  .topbar { padding: 11px 14px; }
  .topbar-title { display: none; }
  .topbar-brand { display: inline-flex; }
  .usermenu-name { display: none; }
  .usermenu-trigger { padding: 4px; }
  .usermenu-pop { min-width: 240px; max-width: calc(100vw - 24px); }

  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--card); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); }

  /* Messagerie : liste OU conversation en plein ecran */
  .chat { height: calc(100vh - 168px); border-radius: 12px; }
  .chat-list { width: 100%; }
  .chat.has-active .chat-list { display: none; }
  .chat:not(.has-active) .chat-main { display: none; }
  .chat-back { display: inline-flex; }

  .hello-hi { font-size: 21px; }
  /* Mobile : box conservee, mais icone sans pastille de fond (grosse) + titre dessous */
  .tile { aspect-ratio: 1 / 1; min-height: 0; padding: 10px 6px; gap: 8px; border-radius: 13px; }
  .tile-ico { width: auto; height: auto; border-radius: 0; background: transparent; color: var(--vert); }
  .tile:hover .tile-ico, .tile:active .tile-ico, .tile:focus-visible .tile-ico { background: transparent; color: var(--vert); }
  .tile-ico svg { width: 52px; height: 52px; }
  .tile-label { font-size: 13px; }
  .tiles.cols-3 { gap: 11px; }
  .tiles.cols-3 .tile { padding: 10px 6px; gap: 7px; }
  .tiles.cols-3 .tile-ico svg { width: 46px; height: 46px; }
  .tiles.cols-3 .tile-label { font-size: 11px; }
  .tiles.cols-4 { gap: 8px; }
  .tiles.cols-4 .tile { aspect-ratio: auto; min-height: 84px; padding: 8px 4px; gap: 6px; }
  .tiles.cols-4 .tile-ico svg { width: 38px; height: 38px; }
  .tiles.cols-4 .tile-label { font-size: 9.5px; line-height: 1.1; }
}

/* Telephones : les grilles a 2 colonnes (ex. fiche adherent) passent en pleine largeur */
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Tableaux transformes en cartes sur mobile */
@media (max-width: 760px) {
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead, .table-wrap tr.row-head { display: none; }
  .table-wrap tr { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; margin-bottom: 10px; }
  .table-wrap tr:hover td { background: transparent; }
  /* Ligne "Libelle ............ valeur" : libelle a gauche, valeur a droite qui revient
     a la ligne et coupe les longues chaines (emails, numeros) au lieu de deborder. */
  .table-wrap td { border: 0; border-bottom: 1px solid var(--line); padding: 9px 0;
    display: grid; grid-template-columns: minmax(72px, auto) 1fr; gap: 2px 14px;
    align-items: baseline; text-align: right; overflow-wrap: anywhere; word-break: break-word; }
  .table-wrap td:last-child { border-bottom: 0; }
  .table-wrap td::before { content: attr(data-label); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); text-align: left; }
  .table-wrap td:not([data-label])::before, .table-wrap td[data-label=""]::before { content: ""; }
  .table-wrap td.actions-cell { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; text-align: left; }
  .table-wrap td.actions-cell::before { width: 100%; margin-bottom: 4px; }
  .table-wrap .inline-form, .table-wrap form.inline { width: auto; }
  .table-wrap td .muted { font-size: 12px; }
}

/* Bannière d'invitation à installer la PWA */
.pwa-install {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex; align-items: center; gap: 12px;
  background: var(--vert); color: #fff;
  border-radius: 16px; padding: 12px 14px;
  box-shadow: 0 12px 32px rgba(6,48,43,.28);
  transform: translateY(140%); opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
  max-width: 460px; margin: 0 auto;
}
.pwa-install.show { transform: translateY(0); opacity: 1; }
.pwa-ico { flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px;
  background: var(--vert-profond); display: inline-flex; align-items: center; justify-content: center; }
.pwa-ico svg { width: 26px; height: 26px; }
.pwa-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.pwa-txt strong { font-family: var(--display); font-weight: 600; font-size: 15px; }
.pwa-txt span { font-size: 12px; color: #cfe3de; }
.pwa-btn { flex-shrink: 0; background: var(--jaune); color: var(--vert-profond);
  border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 700; font-size: 14px;
  font-family: var(--display); cursor: pointer; }
.pwa-btn:active { transform: scale(.97); }
.pwa-hint { flex: 1; font-size: 12.5px; color: #e7f1ee; line-height: 1.3; }
.pwa-share-ico { width: 16px; height: 16px; vertical-align: -3px; display: inline-block; }
.pwa-close { flex-shrink: 0; background: transparent; border: 0; color: #bcd5cf;
  font-size: 24px; line-height: 1; cursor: pointer; padding: 0 2px; align-self: flex-start; }
@media (min-width: 901px) { .pwa-install { left: auto; right: 22px; bottom: 22px; width: 380px; } }

@media (prefers-reduced-motion: reduce) {
  .sidebar, .scrim, .tile, .tile-ico, .pwa-install { transition: none; }
}

/* Formulaires en grille */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: end; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; }
.form-grid input, .form-grid select, .form-grid textarea { font-size: .95rem; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; padding: 6px 9px; font-size: .85rem; }

/* Blocs documents */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.doc-block { border: 1px solid var(--line); border-left: 4px solid var(--jaune); border-radius: 10px; padding: 16px; background: var(--card); display: flex; flex-direction: column; gap: 10px; }
.doc-block h3 { margin: 0; font-size: 1rem; color: var(--vert); font-family: var(--display); }
.doc-block label { display: flex; flex-direction: column; gap: 4px; }
.doc-block .btn { align-self: flex-start; }
