/* Il décroche, espace client. Même marque que le site : bleu nuit + jaune soleil,
   Bricolage Grotesque pour les titres, Hanken Grotesk pour le texte.
   MOBILE D'ABORD : tout est écrit pour un téléphone (360 px), puis élargi avec min-width.
   Sur téléphone, la navigation est une barre d'onglets en bas de l'écran, comme une appli. */
:root {
  --bleu: #1B2B4B;
  --ardoise: #2F4A7D;
  --jaune: #FFC93C;
  --pale: #FFE9A6;
  --brume: #F3F5F9;
  --encre: #121B2E;
  --gris: #5D6B82;
  --ligne: #DDE2EC;
  --blanc: #FFFFFF;
  --rouge: #B42318;
  --vert: #146C43;
  --titre: "Bricolage Grotesque", "Arial Narrow", Arial, sans-serif;
  --texte: "Hanken Grotesk", "Segoe UI", Arial, sans-serif;
  --haut-barre: 56px;
  --haut-onglets: 64px;
  --bas: env(safe-area-inset-bottom, 0px);
  --haut: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--haut-barre) + 16px); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--brume); color: var(--encre); font-family: var(--texte); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
body.app { padding-bottom: calc(var(--haut-onglets) + var(--bas) + 12px); }
h1, h2, h3 { font-family: var(--titre); color: var(--bleu); margin: 0 0 8px; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 800; margin-top: 2px; }
h3 { font-size: 16px; font-weight: 700; margin-top: 16px; }
p { margin: 0 0 10px; }
a { color: var(--ardoise); }
img { display: block; max-width: 100%; height: auto; }
code { font-size: 13px; background: var(--brume); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }
.ico { flex: none; }

/* ---------- En-tête ---------- */
.barre { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  min-height: calc(var(--haut-barre) + var(--haut)); padding: var(--haut) 16px 0; background: var(--blanc); border-bottom: 1px solid var(--ligne); }
.barre__logo { display: block; line-height: 0; }
.barre__logo img { width: 120px; height: auto; }
.pastille-test { margin-left: auto; padding: 3px 10px; border-radius: 6px; background: var(--pale); color: var(--bleu); font-size: 12px; font-weight: 700; text-decoration: none; }
body.auth .barre { justify-content: center; border-bottom: 0; background: transparent; }

/* ---------- Navigation : barre d'onglets en bas (téléphone) ---------- */
.onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--blanc); border-top: 1px solid var(--ligne);
  padding: 0 4px var(--bas); box-shadow: 0 -8px 24px -18px rgba(27, 43, 75, .5); }
.onglets a { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--haut-onglets); color: var(--gris); font-size: 11.5px; font-weight: 600; text-decoration: none; }
.onglets a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onglets a.is-active { color: var(--bleu); }
.onglets a.is-active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--jaune); }
.onglets a:active { background: var(--brume); }

/* ---------- Page ---------- */
.page { max-width: 720px; margin: 0 auto; padding: 16px 16px 24px; }
.entete { margin-bottom: 12px; }
.discret { color: var(--gris); font-size: 14px; }
.retour { margin-bottom: 12px; }
.retour a { text-decoration: none; font-weight: 600; }
.separe { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ligne); font-size: 15px; }

/* Cartes */
.carte { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.carte--etroite { max-width: 440px; margin: 8px auto 20px; }
.carte--lien { border-color: var(--jaune); background: #FFFBEF; }
.carte--test { border-color: var(--jaune); background: #FFFBEF; }
.note { background: var(--brume); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 15px; }
.repli { padding: 0; }
.repli > summary { list-style: none; cursor: pointer; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; }
.repli > summary::-webkit-details-marker { display: none; }
.repli > summary h2 { margin: 0; }
.repli > summary::after { content: "+"; font-size: 24px; line-height: 1; color: var(--ardoise); }
.repli[open] > summary::after { content: "–"; }
.repli > :not(summary) { margin-left: 18px; margin-right: 18px; }
.repli > .formulaire { margin-bottom: 18px; }
.repli-simple { margin-top: 12px; }
.repli-simple summary { cursor: pointer; font-weight: 600; color: var(--ardoise); }

/* Messages */
.flash { background: #E7F4EC; color: var(--vert); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.erreur { background: #FDECEA; color: var(--rouge); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.installee { color: var(--vert); font-weight: 600; display: flex; align-items: center; gap: 6px; }

/* ---------- Formulaires (champs de 48 px et 16 px : pas de zoom automatique sur iPhone) ---------- */
.formulaire { display: grid; gap: 14px; margin: 14px 0; }
.formulaire label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; color: var(--bleu); }
input, select { width: 100%; font: inherit; font-size: 16px; font-weight: 400; color: var(--encre); background: var(--blanc);
  border: 1.5px solid var(--ligne); border-radius: 12px; padding: 12px 14px; min-height: 48px; appearance: none; -webkit-appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--gris) 50%), linear-gradient(135deg, var(--gris) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, select:focus { border-color: var(--ardoise); outline: none; box-shadow: 0 0 0 3px rgba(255, 201, 60, .55); }
.lien-copie { font-size: 14px; }
.mdp { position: relative; display: block; }
.mdp input { padding-right: 96px; }
.mdp__voir { position: absolute; right: 4px; top: 4px; bottom: 4px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--brume); color: var(--ardoise); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.case { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; font-size: 14px !important; color: var(--encre) !important; }
.case input { width: 22px; min-height: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--bleu); appearance: auto; -webkit-appearance: checkbox; }

/* Captcha interne */
.captcha { display: grid; gap: 8px; padding: 14px; background: var(--brume); border-radius: 14px; }
.captcha label { font-size: 15px; }
.captcha__ligne { display: flex; align-items: center; gap: 8px; }
.captcha__img { border-radius: 10px; border: 1px solid var(--ligne); background: var(--blanc); max-width: calc(100% - 56px); height: auto; }
.captcha__nouveau { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border: 1.5px solid var(--ligne); border-radius: 12px; background: var(--blanc); color: var(--bleu); cursor: pointer; }
.captcha input { text-transform: uppercase; letter-spacing: .2em; font-weight: 700; text-align: center; }
.captcha .discret { margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

/* ---------- Boutons ---------- */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border: 0; border-radius: 8px;
  background: var(--bleu); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.bouton:hover { background: var(--ardoise); }
.bouton:active { transform: translateY(1px); }
.bouton[disabled] { opacity: .5; cursor: not-allowed; }
.bouton--plein { width: 100%; }
.bouton--clair { background: transparent; color: var(--bleu); box-shadow: inset 0 0 0 2px var(--bleu); }
.bouton--clair:hover { background: var(--brume); }
.bouton--danger { background: transparent; color: var(--rouge); box-shadow: inset 0 0 0 2px var(--rouge); }
.bouton--danger:hover { background: #FDECEA; }
.bouton--petit { min-height: 40px; padding: 8px 16px; font-size: 15px; }
.lien { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 14px; color: var(--ardoise); text-decoration: underline; cursor: pointer; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.en-ligne { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.en-ligne input { min-height: 40px; padding: 8px 12px; }

/* ---------- Bannières (installer l'appli, activer les notifications) ---------- */
.bandeaux { max-width: 720px; margin: 0 auto; padding: 12px 16px 0; }
.bandeau { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 14px; background: var(--bleu); color: #fff; border-radius: 16px; margin-bottom: 8px; }
.bandeau__ico { grid-row: 1; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--jaune); color: var(--bleu); }
.bandeau__texte { display: grid; gap: 2px; font-size: 14.5px; line-height: 1.4; align-self: center; }
.bandeau__texte strong { font-family: var(--titre); font-size: 17px; font-weight: 800; }
.bandeau__actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.bandeau .bouton { background: var(--jaune); color: var(--bleu); }
.bandeau .bouton:hover { background: #FFD666; }
.bandeau .lien { color: #C9D3E6; }
.bandeau__etat { grid-column: 1 / -1; margin: 6px 0 0; font-weight: 600; font-size: 14px; }
.bandeau__etat.is-ok { color: var(--pale); }
.bandeau__etat.is-error { color: #FFB4AB; }

/* Contenu propre à chaque appareil : app.js indique l'appareil dans data-plateforme sur <html> */
.pour { display: none; }
html[data-plateforme="ios"] .pour[data-pour~="ios"],
html[data-plateforme="android"] .pour[data-pour~="android"],
html[data-plateforme="bureau"] .pour[data-pour~="bureau"] { display: revert; }

/* Mode d'emploi en étapes */
.etapes { list-style: none; counter-reset: etape; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.etapes li { counter-increment: etape; display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; }
.etapes__ico { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--pale); color: var(--bleu); }
.etapes__ico::after { content: counter(etape); position: absolute; top: -6px; left: -6px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%;
  background: var(--bleu); color: #fff; font-size: 12px; font-weight: 700; }
.etapes strong { color: var(--bleu); }

/* Fenêtre qui remonte du bas de l'écran */
.feuille { width: 100%; max-width: 560px; max-height: 88dvh; margin: auto auto 0; padding: 18px 18px calc(18px + var(--bas)); border: 0; border-radius: 22px 22px 0 0; background: var(--blanc); color: var(--encre); overflow: auto; }
.feuille::backdrop { background: rgba(18, 27, 46, .55); }
.feuille__haut { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.feuille__haut h2 { margin: 0; }
.feuille__fermer { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--brume); color: var(--bleu); cursor: pointer; }

/* ---------- Filtres et liste d'appels ---------- */
.filtres { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin: 0 -16px 12px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.filtres::-webkit-scrollbar { display: none; }
.filtres a { flex: none; padding: 9px 15px; border-radius: 8px; background: var(--blanc); border: 1px solid var(--ligne);
  color: var(--bleu); font-weight: 600; font-size: 14px; text-decoration: none; }
.filtres a.is-active { background: var(--bleu); border-color: var(--bleu); color: #fff; }

.appels { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.appel { display: grid; gap: 4px; padding: 16px; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 16px; color: inherit; text-decoration: none; }
.appel:active { background: var(--brume); }
.appel.is-nouveau { border-left: 5px solid var(--jaune); }
.appel__haut { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.appel__quand { color: var(--gris); font-size: 13px; }
.appel__qui { font-weight: 700; color: var(--bleu); }
.appel__resume { color: var(--encre); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vide { text-align: center; padding: 36px 16px; }

/* Étiquettes de catégorie et de statut */
.pastille, .badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--brume); color: var(--bleu); white-space: nowrap; }
.pastille--urgence { background: #FDECEA; color: var(--rouge); }
.pastille--rdv, .pastille--commande { background: var(--pale); color: var(--bleu); }
.pastille--rappel { background: #E8EEF8; color: var(--ardoise); }
.pastille--question { background: #E7F4EC; color: var(--vert); }
.badge--ok { background: #E7F4EC; color: var(--vert); }
.badge--alerte { background: #FFF1C4; color: #7A5200; }
.badge--ko { background: #FDECEA; color: var(--rouge); }
.badge--info { background: #E8EEF8; color: var(--ardoise); }
.badge--admin { background: var(--bleu); color: #fff; }
.badge--neutre { background: var(--brume); color: var(--gris); }

/* Détail d'un appel */
.detail__qui { margin-top: 10px; }
.detail__resume { font-size: 17px; }
.infos { display: grid; grid-template-columns: minmax(110px, 35%) minmax(0, 1fr); gap: 6px 12px; margin: 0; }
.infos dt { color: var(--gris); font-size: 14px; }
.infos dd { margin: 0; font-weight: 600; }
.echange { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.echange li { padding: 10px 14px; border-radius: 14px; max-width: 88%; font-size: 15px; }
.echange__agent { background: var(--brume); }
.echange__client { background: #E8EEF8; margin-left: auto; }
.echange__qui { display: block; font-size: 12px; font-weight: 700; color: var(--gris); }

/* Réglages */
.notifs__statut { font-weight: 600; }
.notifs__statut.is-ok { color: var(--vert); }
.notifs__statut.is-error { color: var(--rouge); }
.appareils { list-style: none; padding: 0; margin: 6px 0 12px; display: grid; gap: 6px; }
.appareils li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--ligne); }

/* Administration */
.client__haut { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.client__haut h2, .client__haut h3 { margin: 0; }
.client__liste { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.actions-compte summary { cursor: pointer; font-weight: 600; color: var(--ardoise); padding: 6px 0; }
.actions-compte .actions { padding-top: 8px; }
.journal { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

/* Facturation */
.forfaits { display: grid; gap: 14px; margin: 14px 0; }
.forfait { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 18px; padding: 20px; display: grid; gap: 8px; align-content: start; }
.forfait--vedette { border: 2px solid var(--jaune); }
.forfait h2 { margin: 0; font-size: 24px; }
.forfait__prix { margin: 0; color: var(--gris); }
.forfait__prix strong { font-family: var(--titre); font-size: 34px; color: var(--bleu); }
.coches { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.coches li { display: flex; gap: 8px; align-items: flex-start; }
.coches .ico { color: var(--vert); margin-top: 3px; }
.factures { list-style: none; margin: 0; padding: 0; }
.factures li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ligne); }
.factures li:last-child { border-bottom: 0; }
.verifs { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.verifs li { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.verifs .is-ok { color: var(--vert); }
.verifs .is-ko { color: var(--rouge); }

/* Pied de page (pages hors connexion) */
.pied { max-width: 440px; margin: 0 auto; padding: 8px 16px calc(24px + var(--bas)); text-align: center; font-size: 13px; color: var(--gris); }
.pied a { color: var(--gris); }

/* ---------- Plus grand écran : le menu passe en haut ---------- */
@media (min-width: 760px) {
  h1 { font-size: 34px; }
  body.app { padding-bottom: 24px; }
  .barre { padding-left: 24px; padding-right: 24px; }
  .onglets { position: static; margin-left: auto; padding: 0; border: 0; background: none; box-shadow: none; gap: 4px; }
  .onglets a { flex: none; flex-direction: row; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; font-size: 15px; }
  .onglets a.is-active { background: var(--bleu); color: #fff; }
  .onglets a.is-active::before { display: none; }
  .onglets a:hover:not(.is-active) { background: var(--brume); }
  .pastille-test { margin-left: 0; }
  .page { padding-top: 28px; }
  .forfaits { grid-template-columns: repeat(3, 1fr); }
  .feuille { margin: auto; border-radius: 22px; }
  .filtres { margin: 0 0 12px; padding-left: 0; padding-right: 0; }
}
@media (min-width: 960px) {
  .page, .bandeaux { max-width: 960px; }
}
/* ---------- Ordinateur : menu en barre latérale à gauche (autre présentation que sur téléphone) ---------- */
.barre__compte { display: none; }
@media (min-width: 900px) {
  body.app { padding: 0 0 32px 264px; }
  body.app .barre { position: fixed; z-index: 30; top: 0; left: 0; bottom: 0; width: 264px; min-height: 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: 28px 16px 20px; border-bottom: 0; border-right: 1px solid var(--ligne); overflow-y: auto; }
  body.app .barre__logo { padding: 0 10px 22px; border-bottom: 1px solid var(--ligne); margin-bottom: 14px; }
  body.app .barre__logo img { width: 150px; }
  body.app .pastille-test { align-self: flex-start; margin: 0 10px 10px; }
  body.app .onglets { position: static; flex-direction: column; margin: 0; padding: 0; gap: 2px; background: none; border: 0; box-shadow: none; }
  body.app .onglets a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; height: 44px; padding: 0 12px; border-radius: 8px; font-size: 15px; color: var(--encre); }
  body.app .onglets a:hover:not(.is-active) { background: var(--brume); }
  body.app .onglets a.is-active { background: var(--brume); color: var(--bleu); font-weight: 700; box-shadow: inset 3px 0 0 var(--jaune); }
  body.app .onglets a.is-active::before { display: none; }
  body.app .barre__compte { display: grid; gap: 2px; margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--ligne); font-size: 14px; }
  body.app .barre__nom { font-weight: 700; color: var(--bleu); overflow-wrap: anywhere; }
  body.app .barre__compte .lien { justify-self: start; margin-top: 6px; }
  .page, .bandeaux { max-width: 1040px; }
  .page { padding: 36px 40px 24px; }
  .bandeaux { padding: 20px 40px 0; }
  html { scroll-padding-top: 24px; }
}

/* ---------- Bouton flottant : actualiser la page ---------- */
.rafraichir { position: fixed; z-index: 25; right: 16px; bottom: calc(var(--haut-onglets) + var(--bas) + 16px); width: 48px; height: 48px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: var(--bleu); color: #fff; cursor: pointer; box-shadow: 0 10px 24px -10px rgba(27, 43, 75, .6); }
.rafraichir:hover { background: var(--ardoise); }
.rafraichir:active { transform: scale(.94); }
.rafraichir.is-spin .ico { animation: tourne .7s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (min-width: 760px) { .rafraichir { right: 24px; bottom: 24px; } }
@media print { .rafraichir { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Contacts, statistiques, agenda, CRM ---------- */
.entete--ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.entete--ligne h1 { margin: 0; }
.centre { text-align: center; }
.gras { font-weight: 800; color: var(--bleu); }
.tri { margin-top: 14px; }

.tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tuile { display: grid; gap: 2px; align-content: start; padding: 14px 16px; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 16px; }
.tuile strong { font-family: var(--titre); font-size: 28px; line-height: 1.1; color: var(--bleu); }
.tuile span { font-size: 13.5px; color: var(--gris); line-height: 1.3; }

.recherche { display: flex; gap: 8px; margin-bottom: 12px; }
.recherche input { flex: 1 1 auto; min-width: 0; }
.recherche .bouton { flex: none; }

.segments { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0; }

.demandes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.demandes > li { display: grid; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--ligne); }
.demandes > li:last-child { border-bottom: 0; padding-bottom: 0; }
.demandes select { min-height: 40px; padding: 6px 36px 6px 12px; }
.demandes .actions { margin-top: 4px; }

.jauges { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.jauges li { display: grid; grid-template-columns: minmax(90px, 36%) 1fr 32px; gap: 10px; align-items: center; font-size: 15px; }
.jauges strong { text-align: right; color: var(--bleu); }
progress { width: 100%; height: 12px; border: 0; border-radius: 999px; background: var(--brume); overflow: hidden; appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: var(--brume); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--bleu); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--bleu); border-radius: 999px; }
.classement { margin: 0; padding-left: 22px; display: grid; gap: 4px; }

.graph { display: block; width: 100%; height: auto; max-height: 190px; }
.graph__fond { fill: transparent; }
.graph__barre { fill: var(--bleu); }
.graph g:hover .graph__barre { fill: var(--ardoise); }
.graph__etiq { fill: var(--gris); font-size: 10px; font-family: var(--texte); }

.aide { margin: 8px 0; padding-left: 22px; display: grid; gap: 6px; font-size: 15px; }
.code { margin: 8px 0; padding: 12px; background: var(--brume); border-radius: 12px; font-size: 12px; line-height: 1.5; overflow-x: auto; white-space: pre; }
.liste-liens { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.liste-liens a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 4px; color: var(--bleu); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--ligne); }
.liste-liens li:last-child a { border-bottom: 0; }
.liens-client a { font-weight: 600; }
fieldset.jours { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
fieldset.jours legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 15px; color: var(--bleu); }

/* Agenda : semaine, navigation du jour, tranches horaires */
.semaine { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; }
.semaine__jour { display: grid; justify-items: center; gap: 1px; padding: 8px 0 6px; border-radius: 14px; background: var(--blanc); border: 1px solid var(--ligne); color: var(--gris); font-size: 12px; font-weight: 600; text-decoration: none; }
.semaine__jour strong { font-family: var(--titre); font-size: 19px; color: var(--bleu); line-height: 1.1; }
.semaine__jour.is-aujourdhui { border-color: var(--jaune); }
.semaine__jour.is-active { background: var(--bleu); border-color: var(--bleu); color: #C9D3E6; }
.semaine__jour.is-active strong { color: #fff; }
.semaine__points { display: flex; gap: 3px; min-height: 8px; }
.pt { display: block; width: 7px; height: 7px; border-radius: 50%; }
.pt--ok { background: var(--vert); }
.pt--alerte { background: var(--jaune); }
.semaine__jour.is-active .pt--ok { background: #7FD3A6; }

.jour-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.jour-nav h2 { margin: 0; text-align: center; flex: 1; text-transform: capitalize; }
.jour-nav .bouton { padding: 8px 12px; }

.tranches { list-style: none; margin: 0 0 14px; padding: 0; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 16px; overflow: hidden; }
.tranche { display: grid; grid-template-columns: 56px 1fr; border-bottom: 1px solid var(--ligne); min-height: 52px; }
.tranche:last-child { border-bottom: 0; }
.tranche__heure { padding: 14px 0 0 12px; font-size: 13px; font-weight: 700; color: var(--gris); font-variant-numeric: tabular-nums; }
.tranche__corps { display: grid; gap: 3px; align-content: center; padding: 8px 12px 8px 10px; border-left: 1px solid var(--ligne); font-size: 15px; }
.tranche__titre { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tranche__libre { display: block; padding: 8px 0; color: var(--gris); font-weight: 600; text-decoration: none; }
.tranche__libre:hover { color: var(--bleu); }
.tranche--rdv .tranche__corps { background: #E7F4EC; border-left: 4px solid var(--vert); }
.tranche--propose .tranche__corps { background: #FFF6D9; border-left: 4px solid var(--jaune); }
.tranche--occupe .tranche__corps { background: var(--brume); border-left: 4px solid var(--gris); color: var(--gris); }
.tranche--conflit .tranche__corps { background: #FDECEA; border-left: 4px solid var(--rouge); }
.tranche--ferme { opacity: .6; }
.tranche .actions { margin-top: 4px; }
.tranche .en-ligne { margin-top: 0; }

@media (min-width: 760px) {
  .tuiles { grid-template-columns: repeat(4, 1fr); }
  .semaine__jour { font-size: 13px; }
}

/* Jauge de quota (page Consommation) */
progress.jauge { height: 16px; }
progress.jauge.is-haut::-webkit-progress-value { background: #D99A00; }
progress.jauge.is-haut::-moz-progress-bar { background: #D99A00; }
progress.jauge.is-plein::-webkit-progress-value { background: var(--rouge); }
progress.jauge.is-plein::-moz-progress-bar { background: var(--rouge); }
.jauge__texte { margin: 10px 0 0; }

/* Recherche + tri des clients, documentation API */
.recherche select { flex: 0 0 auto; width: auto; }
.doc-sommaire { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.doc-sommaire a { display: inline-block; padding: 7px 13px; border-radius: 999px; background: var(--blanc); border: 1px solid var(--ligne); font-size: 14px; font-weight: 600; text-decoration: none; }
pre.code { background: var(--brume); border-radius: 12px; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.5; margin: 8px 0 14px; white-space: pre; }
pre.code code { font-family: ui-monospace, Menlo, Consolas, monospace; }
.doc-route { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.doc-route code { word-break: break-all; }
table.doc { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 14px; }
table.doc th, table.doc td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--ligne); }
table.doc th { color: var(--gris); font-weight: 600; }
.doc-table-wrap { overflow-x: auto; }

/* Un texte long (email, nom) ne doit jamais élargir la page : sinon, sur iPhone, la page dézoome et la barre du bas se décale */
html, body { max-width: 100%; overflow-x: clip; }
.page, .carte { min-width: 0; }
.infos dt, .infos dd { min-width: 0; overflow-wrap: anywhere; }
.carte p, .carte li, .carte a { overflow-wrap: anywhere; }

/* ===================================================================
   Habillage renforcé : même univers « autocollant » que la landing
   =================================================================== */
body { background: radial-gradient(circle at 100% 0, rgba(255, 201, 60, .16), transparent 360px), radial-gradient(circle at 0 100%, rgba(47, 74, 125, .08), transparent 420px), var(--brume); background-attachment: fixed; }

/* Titres : surlignage jaune sous le h1 */
.entete h1, .page > h1 { position: relative; display: inline-block; z-index: 0; }
.entete h1::after, .page > h1::after { content: ""; position: absolute; z-index: -1; left: -4px; right: -4px; bottom: 3px; height: 11px; border-radius: 3px; background: var(--jaune); opacity: .8;
  transform-origin: left; animation: espace-trait .7s var(--ease, cubic-bezier(.2, .7, .2, 1)) .15s both; }
h2 { display: flex; align-items: center; gap: 8px; }
.carte > h2:first-child::before { content: ""; flex: none; width: 8px; height: 22px; border-radius: 3px; background: var(--jaune); }

/* Cartes : bord vif, ombre décalée, relief au survol, apparition en cascade */
.carte { border: 1.5px solid var(--bleu); border-radius: 14px; box-shadow: 4px 4px 0 rgba(27, 43, 75, .12); animation: espace-monte .5s cubic-bezier(.2, .7, .2, 1) both;
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s cubic-bezier(.2, .7, .2, 1); }
.page > .carte:nth-of-type(2) { animation-delay: .06s; } .page > .carte:nth-of-type(3) { animation-delay: .12s; }
.page > .carte:nth-of-type(4) { animation-delay: .18s; } .page > .carte:nth-of-type(n+5) { animation-delay: .24s; }
.carte--lien, .carte--test { border-color: var(--bleu); background: #FFF7DB; box-shadow: 4px 4px 0 var(--jaune); }
.note { border-left: 4px solid var(--jaune); border-radius: 8px; }
.flash { border-left: 4px solid var(--vert); border-radius: 8px; }
.erreur { border-left: 4px solid var(--rouge); border-radius: 8px; }
@media (hover: hover) { .carte:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--jaune); } .carte--etroite:hover, .carte--lien:hover, .carte--test:hover { box-shadow: 6px 6px 0 var(--bleu); } }
.repli > summary { transition: background .2s; border-radius: 12px; }
.repli > summary:hover { background: var(--brume); }
.repli > summary::after { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--jaune); color: var(--bleu); font-weight: 800; }

/* Boutons : ombre décalée + brillance lente en aller-retour */
.bouton { position: relative; isolation: isolate; overflow: hidden; border: 2px solid var(--bleu);
  transition: transform .2s cubic-bezier(.2, .7, .2, 1), box-shadow .2s cubic-bezier(.2, .7, .2, 1), background .2s, color .2s; }
.bouton:not(.bouton--clair):not(.bouton--danger) { box-shadow: 3px 3px 0 var(--jaune); }
.bouton::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; transform: translateX(-130%);
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .42) 50%, transparent 62%); animation: espace-brille 6.5s ease-in-out infinite alternate; }
.bouton--clair::after { background: linear-gradient(105deg, transparent 38%, rgba(27, 43, 75, .1) 50%, transparent 62%); }
.bouton--danger { border-color: var(--rouge); }
.bouton[disabled]::after { display: none; }
@media (hover: hover) { .bouton:not(.bouton--clair):not(.bouton--danger):hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--jaune); } }
.bouton:not(.bouton--clair):not(.bouton--danger):active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--jaune); }

/* Champs */
input, select { border-color: #C5CDDC; transition: border-color .2s, box-shadow .2s; }
input:hover, select:hover { border-color: var(--ardoise); }

/* Navigation mobile : l'onglet actif devient une pastille */
@media (max-width: 899px) {
  .onglets a { margin: 6px 2px; height: calc(var(--haut-onglets) - 12px); border-radius: 12px; transition: background .2s, color .2s; }
  .onglets a.is-active { background: var(--pale); }
  .onglets a.is-active::before { display: none; }
  .onglets a.is-active svg, .onglets a.is-active .ico { transform: translateY(-1px) scale(1.1); }
}
.onglets .ico { transition: transform .25s cubic-bezier(.2, .7, .2, 1); }

/* Jauge d'usage plus vivante */
progress.jauge { accent-color: var(--jaune); }
progress.jauge::-webkit-progress-bar { background: #E7EBF3; border-radius: 99px; }
progress.jauge::-webkit-progress-value { background: linear-gradient(90deg, var(--jaune), #FFB300); border-radius: 99px; }
progress.jauge::-moz-progress-bar { background: linear-gradient(90deg, var(--jaune), #FFB300); border-radius: 99px; }

@keyframes espace-monte { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes espace-trait { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes espace-brille { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
@media (prefers-reduced-motion: reduce) {
  .carte, .entete h1::after, .page > h1::after { animation: none; }
  .bouton::after { animation: none; display: none; }
  .carte, .bouton, .onglets .ico { transition: none; }
  .carte:hover { transform: none; }
}

/* ===================================================================
   Barre latérale (ordinateur) : stylisée
   =================================================================== */
@media (min-width: 900px) {
  body.app .barre { width: 264px; padding: 0 14px 18px; background: linear-gradient(180deg, #fff 0, #fff 62%, #FFFBEF 100%); border-right: 2px solid var(--bleu);
    box-shadow: 6px 0 0 rgba(255, 201, 60, .35); }
  /* Bandeau jaune en haut, avec le logo posé dessus */
  body.app .barre__logo { margin: 0 -14px 18px; padding: 26px 24px 22px; background: var(--jaune); border-bottom: 2px solid var(--bleu); position: relative; }
  body.app .barre__logo::after { content: ""; position: absolute; right: -18px; bottom: -22px; width: 70px; height: 70px; border-radius: 50%; background: rgba(255, 255, 255, .35); pointer-events: none; }
  body.app .barre__logo img { width: 150px; position: relative; z-index: 1; }
  body.app .pastille-test { margin: 0 4px 12px; border: 1.5px solid var(--bleu); background: #fff; }

  body.app .onglets { gap: 6px; counter-reset: nav; }
  body.app .onglets a { position: relative; height: 48px; padding: 0 12px 0 8px; gap: 12px; border-radius: 12px; border: 1.5px solid transparent; font-weight: 600; color: var(--bleu);
    transition: transform .22s cubic-bezier(.2, .7, .2, 1), background .2s, border-color .2s, box-shadow .22s cubic-bezier(.2, .7, .2, 1); }
  /* L'icône vit dans une pastille */
  body.app .onglets a .ico { box-sizing: content-box; width: 20px; height: 20px; padding: 7px; border-radius: 10px; background: var(--brume); color: var(--bleu);
    transition: background .2s, color .2s, transform .3s cubic-bezier(.2, .7, .2, 1); }
  body.app .onglets a:hover:not(.is-active) { background: #fff; border-color: var(--bleu); transform: translateX(4px); box-shadow: 3px 3px 0 var(--jaune); }
  body.app .onglets a:hover:not(.is-active) .ico { background: var(--jaune); transform: rotate(-8deg) scale(1.06); }
  /* Page active : pastille bleu nuit, icône jaune, ombre décalée */
  body.app .onglets a.is-active { background: var(--bleu); color: #fff; font-weight: 700; border-color: var(--bleu); box-shadow: 4px 4px 0 var(--jaune); transform: translateX(2px); }
  body.app .onglets a.is-active .ico { background: var(--jaune); color: var(--bleu); }
  body.app .onglets a.is-active::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--jaune); animation: nav-pouls 2s ease-in-out infinite; }
  body.app .onglets a:active { transform: translateX(2px) scale(.98); }

  /* Carte du compte en bas */
  body.app .barre__compte { margin-top: auto; padding: 14px; border: 2px solid var(--bleu); border-radius: 14px; background: #fff; box-shadow: 4px 4px 0 var(--jaune); position: relative; }
  body.app .barre__compte::before { content: ""; position: absolute; top: -10px; right: 14px; width: 18px; height: 18px; border-radius: 50%; background: var(--vert); border: 3px solid #fff; }
  body.app .barre__nom { font-family: var(--titre); font-size: 16px; }
  body.app .barre__compte .lien { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; margin-top: 8px; border: 1.5px solid var(--bleu); border-radius: 8px; text-decoration: none; font-weight: 700; color: var(--bleu); background: transparent; transition: background .2s, color .2s; }
  body.app .barre__compte .lien:hover { background: var(--bleu); color: #fff; }
  body.app .barre::-webkit-scrollbar { width: 0; }
}
@keyframes nav-pouls { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .5; } }

/* Correctif barre latérale : logo lisible sur plaque blanche, bandeau jaune porté par le fond de la barre (aucune marge blanche à droite) */
@media (min-width: 900px) {
  body.app .barre { width: 264px; padding: 0 20px 18px 14px; overflow-x: hidden; box-shadow: none; border-right: 2px solid var(--bleu);
    background:
      linear-gradient(var(--bleu), var(--bleu)) 0 86px / 100% 2px no-repeat,
      linear-gradient(var(--jaune), var(--jaune)) 0 0 / 100% 86px no-repeat,
      linear-gradient(180deg, #fff 0, #FFFBEF 100%); }
  body.app .barre__logo { display: flex; justify-content: center; align-items: center; margin: 16px 0 38px; padding: 9px 14px; background: #fff; border: 2px solid var(--bleu); border-radius: 12px; box-shadow: 3px 3px 0 var(--bleu); }
  body.app .barre__logo::after { display: none; }
  body.app .barre__logo img { width: 142px; }
  body.app .barre__compte { margin-right: 0; }
}
