/* Le thème sobre de la plateforme de pilotage (12 novembre 2026), pour que rien ne dépayse :
   fond clair, surfaces blanches à filet fin, bleu nuit du logo pour le menu et le texte, un seul accent (le cyan),
   réservé au bouton d'action et à l'onglet actif. Les couleurs d'état ne servent qu'aux données.
   Écrit pour le téléphone d'abord ; l'ordinateur commence à 1024 px. */
:root {
  --fond: #eef2f5; --surface: #fff; --sous: #f5f7f9; --filet: #dde4e9; --filet2: #e6ebef;
  --encre: #08222f; --encre2: #2a4856; --encre3: #3b5866;
  --nuit: #0b2a3a; --accent: #2ec5d6; --accent-fonce: #0b7f8f;
  --bleu: #006699; --vert: #0a7a5a; --ambre: #8f5400; --rouge: #b52c22;
  --ombre: 0 1px 2px rgba(11, 42, 58, .06);
  --r-l: 16px; --r-m: 12px; --r-s: 10px;
  --haut: env(safe-area-inset-top, 0px); --bas: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--fond); }
body {
  margin: 0; min-height: 100dvh; color: var(--encre); background: var(--fond);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, a, input, select, textarea, summary { touch-action: manipulation; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent-fonce); outline-offset: 2px; }
[hidden] { display: none !important; }
.evitement { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 10px 14px; border-radius: 10px; background: var(--nuit); color: #fff; }
.evitement:focus { top: calc(12px + var(--haut)); }

/* ---- Menu : barre du bas sur téléphone, colonne à gauche sur ordinateur ---- */
.menu {
  position: fixed; z-index: 10; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 6px 6px calc(6px + var(--bas)); background: var(--nuit);
}
.menu a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 50px; border-radius: 12px; color: rgba(255, 255, 255, .74); text-decoration: none; font-size: 11.5px; font-weight: 600;
}
.menu a[aria-current="page"] { color: var(--accent); }
.menu .pastille {
  position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--accent); color: var(--nuit); font-size: 11.5px; font-weight: 750; line-height: 18px; text-align: center;
}
.marque, .menu-avenir, .menu-pied { display: none; }

main { padding: calc(18px + var(--haut)) 16px calc(92px + var(--bas)); max-width: 760px; margin: 0 auto; }
main:focus { outline: none; }
.attente { padding: 40px 0; text-align: center; color: var(--encre2); }

/* ---- En-tête d'un écran ---- */
.tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.tete h1 { font-size: 28px; line-height: 1.12; font-weight: 750; letter-spacing: -.025em; }
.sur-titre { color: var(--encre2); font-size: 14px; }
.sur-titre::first-letter { text-transform: uppercase; }
.sous-titre { color: var(--encre2); font-size: 14.5px; margin-top: 4px; }
.badge-base { flex: none; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--filet); background: var(--surface); color: var(--encre2); font-size: 12.5px; font-weight: 600; }
.retour { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -8px 0 2px -4px; padding: 0 8px 0 2px; color: var(--encre2); font-size: 14.5px; font-weight: 600; text-decoration: none; border-radius: 10px; }
.retour svg { width: 18px; height: 18px; transform: rotate(180deg); }

/* ---- Les chiffres du haut : une seule rangée, même sur téléphone ---- */
.tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.tuiles.trois { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tuile {
  display: flex; flex-direction: column; justify-content: center; gap: 1px; min-height: 68px; padding: 9px 10px;
  border: 1.5px solid var(--filet2); border-radius: var(--r-m); background: var(--surface); color: var(--encre); text-decoration: none; text-align: left;
}
button.tuile { cursor: pointer; }
.tuile strong { font-size: 22px; line-height: 1.15; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tuile span { font-size: 12px; line-height: 1.25; font-weight: 600; color: var(--encre2); white-space: nowrap; }
.tuile.ambre { background: rgba(217, 127, 12, .07); border-color: rgba(217, 127, 12, .24); } .tuile.ambre strong { color: var(--ambre); }
.tuile.bleu { background: rgba(0, 102, 153, .07); border-color: rgba(0, 102, 153, .22); } .tuile.bleu strong { color: var(--bleu); }
.tuile.vert { background: rgba(10, 122, 90, .07); border-color: rgba(10, 122, 90, .22); } .tuile.vert strong { color: var(--vert); }
.tuile.rouge { background: rgba(181, 44, 34, .06); border-color: rgba(181, 44, 34, .22); } .tuile.rouge strong { color: var(--rouge); }
.tuile.cyan { background: rgba(46, 197, 214, .13); border-color: rgba(11, 127, 143, .32); } .tuile.cyan strong { color: var(--accent-fonce); }
.tuile.calme strong { color: var(--encre3); }
.tuile.sobre strong { color: var(--encre); }
.tuile[aria-pressed="true"] { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.tuile.ambre[aria-pressed="true"] { color: var(--ambre); } .tuile.bleu[aria-pressed="true"] { color: var(--bleu); }
.tuile.vert[aria-pressed="true"] { color: var(--vert); } .tuile.rouge[aria-pressed="true"] { color: var(--rouge); }
.tuile.cyan[aria-pressed="true"] { color: var(--accent-fonce); }
.tuile[aria-pressed="true"] span { color: var(--encre); }

/* ---- Blocs repliables : on touche le titre pour ouvrir ---- */
.bloc { margin-bottom: 12px; border: 1px solid var(--filet); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--ombre); overflow: clip; }
.bloc > summary {
  display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 10px 14px 10px 16px; cursor: pointer; list-style: none;
  font-size: 16.5px; font-weight: 700; letter-spacing: -.01em;
}
.bloc > summary::-webkit-details-marker { display: none; }
.bloc > summary .bloc-titre { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bloc > summary small { display: block; font-size: 13px; font-weight: 500; color: var(--encre2); letter-spacing: 0; }
.bloc > summary .chevron { width: 18px; height: 18px; color: var(--encre3); transition: transform .15s ease; }
.bloc[open] > summary .chevron { transform: rotate(90deg); }
.compte { flex: none; min-width: 26px; padding: 2px 8px; border-radius: 99px; background: var(--sous); border: 1px solid var(--filet2); color: var(--encre2); font-size: 13px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.compte.rouge { background: rgba(181, 44, 34, .08); border-color: rgba(181, 44, 34, .22); color: var(--rouge); }
.bloc-corps { border-top: 1px solid var(--filet2); }
.bloc-note { padding: 12px 16px; color: var(--encre2); font-size: 14.5px; }
.vide { padding: 18px 16px; color: var(--encre2); font-size: 15px; }

/* ---- Lignes : deux lignes de texte, l'action à droite ---- */
.ligne { display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 16px; border-top: 1px solid var(--filet2); color: inherit; text-decoration: none; }
.lignes > .ligne:first-child, .lignes > li:first-child > .ligne { border-top: 0; }
a.ligne:hover { background: var(--sous); }
.ligne-texte { flex: 1; min-width: 0; }
.ligne-titre { font-size: 15.5px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.ligne-sous { margin-top: 1px; color: var(--encre2); font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.ligne-droite { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; font-size: 14.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ligne-droite small { font-size: 12.5px; font-weight: 500; color: var(--encre2); }
.ligne .chevron { width: 16px; height: 16px; color: var(--encre3); }
/* Une résidence à plusieurs passages : son nom une fois, ses passages dessous, en retrait */
.ligne.residence { padding-bottom: 2px; }
.ligne.sous-ligne { border-top: 0; padding-top: 5px; padding-bottom: 5px; padding-left: 30px; }
.ligne.sous-ligne:last-child { padding-bottom: 12px; }
.ligne.sous-ligne .ligne-sous { position: relative; margin: 0; color: var(--encre); font-size: 14.5px; }
.ligne.sous-ligne .ligne-sous::before { content: ""; position: absolute; left: -13px; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: #b9c6ce; }
.mot-long { display: none; }
.suivants { display: block; width: 100%; min-height: 46px; border: 0; border-top: 1px solid var(--filet2); background: var(--sous); color: var(--accent-fonce); font-weight: 650; font-size: 14.5px; cursor: pointer; }

.pilule { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 650; line-height: 1.5; white-space: nowrap; background: var(--sous); border: 1px solid var(--filet2); color: var(--encre2); }
.pilule.vert { background: rgba(10, 122, 90, .09); border-color: rgba(10, 122, 90, .22); color: var(--vert); }
.pilule.ambre { background: rgba(217, 127, 12, .09); border-color: rgba(217, 127, 12, .26); color: var(--ambre); }
.pilule.bleu { background: rgba(0, 102, 153, .08); border-color: rgba(0, 102, 153, .22); color: var(--bleu); }
.pilule.rouge { background: rgba(181, 44, 34, .08); border-color: rgba(181, 44, 34, .22); color: var(--rouge); }
.pilules { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }

/* ---- Boutons : 44 px au toucher, le principal porte l'accent ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 15px;
  border: 1px solid #d3dbe1; border-radius: var(--r-s); background: var(--surface); color: var(--encre);
  font-size: 14.5px; font-weight: 650; line-height: 1.2; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn:hover { background: var(--sous); }
.btn.fort { background: var(--accent); border-color: var(--accent); color: var(--nuit); }
.btn.fort:hover { background: #45d0df; }
.btn.discret { border-color: transparent; background: none; color: var(--encre2); }
.btn.danger { color: var(--rouge); }
.btn[disabled] { opacity: .55; cursor: default; }

/* ---- Recherche et filtres ---- */
.recherche { position: relative; margin-bottom: 10px; }
.recherche svg { position: absolute; left: 13px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); color: var(--encre3); pointer-events: none; }
.recherche input { width: 100%; min-height: 48px; padding: 0 14px 0 40px; border: 1px solid #cfd8de; border-radius: var(--r-m); background: var(--surface); }
.filtres { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filtres::-webkit-scrollbar { display: none; }
.filtres button { flex: none; min-height: 38px; padding: 0 13px; border: 1px solid var(--filet); border-radius: 99px; background: var(--surface); color: var(--encre2); font-size: 14px; font-weight: 600; cursor: pointer; }
.filtres button[aria-pressed="true"] { background: var(--nuit); border-color: var(--nuit); color: #fff; }
.filtres button b { font-weight: 700; opacity: .75; margin-left: 3px; font-variant-numeric: tabular-nums; }

/* ---- Alerte dans une fiche ---- */
.alerte { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 12px; padding: 12px 14px 12px 16px; border: 1px solid rgba(217, 127, 12, .3); border-radius: var(--r-m); background: rgba(217, 127, 12, .08); color: var(--encre); font-size: 14.5px; }
.alerte p { flex: 1 1 240px; }
.alerte strong { color: var(--ambre); }

/* ---- Fenêtre : au milieu de l'écran, jamais en bas ---- */
dialog {
  width: min(540px, calc(100vw - 24px)); max-height: calc(100dvh - 32px - var(--haut) - var(--bas)); padding: 0; border: 0; border-radius: 18px;
  background: var(--surface); color: var(--encre); box-shadow: 0 18px 48px rgba(11, 42, 58, .28);
}
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgba(8, 34, 47, .46); overflow: hidden; overscroll-behavior: contain; }
dialog form { display: flex; flex-direction: column; max-height: inherit; }
.dlg-tete { display: flex; align-items: flex-start; gap: 12px; padding: 18px 12px 12px 20px; }
.dlg-tete h2 { flex: 1; font-size: 20px; line-height: 1.2; font-weight: 750; letter-spacing: -.015em; }
.dlg-tete h2:focus { outline: none; }
.dlg-titres { flex: 1; min-width: 0; }
.dlg-tete p { margin-top: 3px; color: var(--encre2); font-size: 14px; font-weight: 400; letter-spacing: 0; }
.dlg-fermer { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -8px; border: 0; border-radius: 12px; background: none; color: var(--encre2); cursor: pointer; }
.dlg-corps { padding: 4px 20px 6px; overflow-y: auto; }
.dlg-pied { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px calc(16px + var(--bas)); border-top: 1px solid var(--filet2); }
.dlg-pied .btn.fort { flex: 1 1 180px; }
.dlg-pied .gauche { margin-right: auto; }
.dlg-erreur { margin: 0 20px 10px; padding: 10px 12px; border-radius: 10px; background: rgba(181, 44, 34, .08); border: 1px solid rgba(181, 44, 34, .24); color: var(--rouge); font-size: 14.5px; font-weight: 600; }

.champ { display: grid; gap: 5px; margin-bottom: 14px; }
.champ > span, .champ > label { font-size: 14px; font-weight: 650; }
.champ small { color: var(--encre2); font-size: 13px; font-weight: 400; }
.champ input, .champ select, .champ textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #c9d3da; border-radius: var(--r-s); background: #fff; }
.champ textarea { min-height: 104px; resize: vertical; line-height: 1.4; }
.champ textarea.court { min-height: 70px; }
.champ :is(input, select, textarea):user-invalid { border-color: var(--rouge); box-shadow: 0 0 0 1px var(--rouge); }
.champ .erreur { display: none; color: var(--rouge); font-size: 13.5px; font-weight: 600; }
.champ:has(:user-invalid) .erreur { display: block; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.coches { display: grid; gap: 2px; margin-bottom: 12px; }
.coche { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.coche input { width: 20px; height: 20px; accent-color: var(--accent-fonce); flex: none; }

/* L'aperçu avant validation : ce qui part, pour combien, à qui */
.apercu h3 { margin: 14px 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--encre3); }
.apercu h3:first-child { margin-top: 2px; }
.apercu-ligne { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-top: 1px solid var(--filet2); font-size: 15px; }
.apercu-ligne:first-of-type { border-top: 0; }
.apercu-ligne span:last-child { flex: none; font-variant-numeric: tabular-nums; font-weight: 600; }
.apercu-ligne small { display: block; color: var(--encre2); font-size: 13px; }
.apercu-total { display: flex; justify-content: space-between; margin-top: 4px; padding: 10px 12px; border-radius: 10px; background: var(--sous); font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; }
.apercu-note { margin: 12px 0 6px; padding: 10px 12px; border-radius: 10px; background: var(--sous); color: var(--encre2); font-size: 13.5px; }
.apercu-manque { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(217, 127, 12, .09); border: 1px solid rgba(217, 127, 12, .28); font-size: 14.5px; }
.apercu-manque strong { color: var(--ambre); }

/* ---- Message bref après un geste ---- */
.annonce {
  position: fixed; z-index: 40; left: 50%; bottom: calc(78px + var(--bas)); max-width: min(520px, calc(100vw - 24px)); width: max-content;
  padding: 12px 16px; border-radius: 12px; background: var(--nuit); color: #fff; font-size: 14.5px; font-weight: 600;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.annonce.visible { opacity: 1; transform: translate(-50%, 0); }
.annonce:empty { display: none; }

/* ---- La porte : le code d'accès de la démonstration en ligne ---- */
.verrou .menu { display: none; }
.verrou main { max-width: 440px; margin: 0 auto; padding: calc(12vh + var(--haut)) 16px 40px; }
.porte { padding: 24px 22px 22px; }
.porte h1 { font-size: 26px; line-height: 1.15; font-weight: 750; letter-spacing: -.02em; }
.porte .sous-titre { margin: 6px 0 18px; }
.porte .btn { width: 100%; min-height: 48px; }
.porte .dlg-erreur { margin: 0 0 12px; }

/* ---- Fiche client ---- */
.coord { display: grid; gap: 2px; padding: 12px 16px; font-size: 15px; }
.coord a { color: var(--accent-fonce); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.plus-liste .ligne-sous { max-width: 56ch; }

@media (prefers-reduced-motion: reduce) { *, ::before, ::after { transition: none !important; animation: none !important; } }

/* ---- À partir de 600 px : un peu d'air ---- */
@media (min-width: 600px) {
  .tuiles { gap: 12px; }
  .tuile { min-height: 84px; padding: 14px 16px; }
  .tuile strong { font-size: 30px; }
  .tuile span { font-size: 13.5px; }
  .mot-long { display: inline; }
}

/* ---- Ordinateur ---- */
@media (min-width: 1024px) {
  .menu {
    top: 16px; bottom: 16px; left: 16px; right: auto; width: 248px; display: flex; flex-direction: column; gap: 4px;
    padding: 16px 12px; border-radius: 20px;
  }
  .marque { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; color: #fff; font-size: 15.5px; font-weight: 750; letter-spacing: .01em; }
  .marque-logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: var(--nuit); font-size: 16px; font-weight: 800; }
  .menu a { flex-direction: row; justify-content: flex-start; gap: 11px; min-height: 46px; padding: 0 12px; font-size: 14.5px; }
  .menu a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
  .menu a[aria-current="page"] { background: var(--accent); color: var(--nuit); font-weight: 700; }
  .menu .pastille { position: static; margin-left: auto; background: rgba(255, 255, 255, .16); color: #fff; }
  .menu a[aria-current="page"] .pastille { background: rgba(11, 42, 58, .16); color: var(--nuit); }
  .menu-plus { display: none !important; }
  .menu-avenir { display: grid; gap: 0; margin-top: 18px; padding: 14px 12px 0; border-top: 1px solid rgba(255, 255, 255, .12); }
  .menu-avenir p { margin-bottom: 6px; color: rgba(255, 255, 255, .5); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .menu-avenir span { padding: 5px 0; color: rgba(255, 255, 255, .5); font-size: 14px; }
  .menu-pied { display: block; margin-top: auto; padding: 0 8px; color: rgba(255, 255, 255, .62); font-size: 12.5px; line-height: 1.4; }
  main { max-width: 1180px; margin: 0; padding: 30px 36px 48px 300px; }
  .tete { margin-bottom: 22px; }
  .tete h1 { font-size: 34px; }
  .tuile { min-height: 96px; padding: 16px 18px; }
  .tuile strong { font-size: 36px; }
  .tuile span { font-size: 14px; }
  .deux-colonnes { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .btn { min-height: 40px; }
  .ligne { padding: 12px 16px 12px 18px; }
  .bloc > summary { padding-left: 18px; }
  .annonce { bottom: 28px; left: calc(50% + 132px); }
  dialog { border-radius: 20px; }
}
