/* CRM Formation continue — Institut Universitaire d'Abidjan
   Couleurs tirées du logo IUA (#35b5e6). Aucun script : tout le relief est en CSS.
   Ordinateur ≥ 1100 px · tablette 720–1099 px (menu en colonne d'icônes) · téléphone < 720 px (menu en bas). */

:root {
  --iua: #35b5e6;          /* bleu du logo */
  --iua-fonce: #0f6fa8;    /* boutons principaux */
  --lien: #0d6aa3;
  --nuit: #0a2540;         /* menu, titres */
  --nuit-2: #123a63;
  --brume: #eaf2f8;        /* fond des pages */
  --papier: #ffffff;
  --encre: #132338;
  --gris: #566a80;
  --trait: #d6e3ee;
  --trait-doux: #e6eef5;
  --vert: #138a5e;
  --ambre: #9a5b00;
  --rouge: #c42f2f;

  /* Relief : bloc « extrudé » (tranche visible + ombre portée) et carte légèrement surélevée */
  --bloc: inset 0 1px 0 #fff, 0 1px 0 #d3e1ed, 0 2px 0 #cbdbe9, 0 3px 0 #c3d5e5, 0 4px 0 #bbcfe1, 0 5px 0 #b3c9dd, 0 16px 24px -10px rgba(10, 37, 64, .34);
  --bloc-haut: inset 0 1px 0 #fff, 0 1px 0 #d3e1ed, 0 2px 0 #cbdbe9, 0 3px 0 #c3d5e5, 0 4px 0 #bbcfe1, 0 5px 0 #b3c9dd, 0 6px 0 #abc3d9, 0 7px 0 #a3bdd5, 0 26px 32px -12px rgba(10, 37, 64, .42);
  --elev: 0 1px 2px rgba(10, 37, 64, .06), 0 10px 26px -14px rgba(10, 37, 64, .28);
  --creux: inset 0 2px 3px rgba(10, 37, 64, .07);

  --barre-bas: 70px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--encre);
  background: var(--brume);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--lien); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--iua); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--nuit); }
h1 { font-size: 28px; line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 17px; line-height: 1.3; margin: 0 0 14px; font-weight: 650; letter-spacing: -.005em; }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 650; }
p { margin: 0 0 8px; }
code { font-size: 12.5px; background: #eef4f9; padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.muted { color: var(--gris); }
.small { font-size: 13px; }
.visuel-masque, .sortir span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ================= Coque : menu latéral (ordinateur) ================= */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.nav {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px;
  padding: 24px 16px 18px;
  color: #c9d8ea;
  background: linear-gradient(170deg, var(--nuit-2) 0%, var(--nuit) 52%, #071a30 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06), 8px 0 28px -16px rgba(7, 26, 48, .55);
}
.marque { display: flex; flex-direction: column; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.marque:hover { text-decoration: none; }
.marque .plaque {
  display: block; padding: 14px 20px 12px; border-radius: 20px;
  background: linear-gradient(180deg, #fff 0%, #f1f7fc 100%);
  box-shadow: inset 0 1px 0 #fff, 0 1px 0 #c3d6e8, 0 2px 0 #b6cbe0, 0 3px 0 #a9c0d8, 0 4px 0 #9db6d0, 0 5px 0 #91acc8, 0 6px 0 #86a3c1, 0 22px 30px -10px rgba(0, 0, 0, .6);
}
/* Le logo officiel reste entier et à plat, à toutes les tailles. */
.marque .plaque img { display: block; width: 152px; height: auto; }
.marque .titre-app { font-size: 15px; font-weight: 650; letter-spacing: .01em; text-align: center; line-height: 1.25; }

.menu { display: flex; flex-direction: column; gap: 4px; }
.menu a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 13px;
  color: #c9d8ea; font-weight: 550; text-decoration: none;
  transition: background-color .15s, color .15s;
}
.menu a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.menu a.actif {
  color: #fff;
  background: linear-gradient(180deg, rgba(53, 181, 230, .26), rgba(53, 181, 230, .12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 1px 0 rgba(0, 0, 0, .25);
}
.menu a.actif::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--iua); box-shadow: 0 0 12px var(--iua); }
.menu .court { display: none; }
.ico-boite {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: 11px;
  background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 2px 0 rgba(0, 0, 0, .25);
}
/* La touche active ressemble à une touche enfoncée de couleur IUA */
.menu a.actif .ico-boite {
  color: #062238;
  background: linear-gradient(180deg, #6fcff2, var(--iua));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 2px 0 #1a8fc2, 0 3px 0 #157aa8, 0 10px 14px -6px rgba(53, 181, 230, .75);
}
.pastille {
  position: absolute; top: -7px; right: -9px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: linear-gradient(180deg, #f06a6f, #e0444a); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--nuit), 0 2px 0 #9e2328;
}

.bas { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 14px 4px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.bas form { margin: 0; }
.bas .moi { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; color: #c9d8ea; text-decoration: none; }
.bas .moi:hover, .bas .moi.actif { background: rgba(255, 255, 255, .07); text-decoration: none; }
.avatar {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  color: #062238; font-weight: 750; font-size: 15px;
  background: radial-gradient(circle at 35% 28%, #b5e8fa 0, var(--iua) 55%, #1d8fc2 100%);
  box-shadow: 0 2px 0 #13689a, 0 8px 12px -6px rgba(0, 0, 0, .55);
}
.bas .qui { display: flex; flex-direction: column; min-width: 0; font-size: 12px; line-height: 1.3; }
.bas .qui b { color: #fff; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sortir {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 11px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .04);
  color: #c9d8ea; cursor: pointer;
}
.sortir:hover { color: #fff; background: rgba(255, 255, 255, .1); }

.contenu { width: 100%; max-width: 1320px; min-width: 0; padding: 32px 38px 60px; }
.entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.entete p { margin: 6px 0 0; color: var(--gris); max-width: 68ch; }
.entete p .badge { margin-left: 6px; vertical-align: 1px; }
.lien-retour { margin: 0 0 6px; font-size: 13.5px; }
.lien-retour a { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.lien-retour .ico { width: 16px; height: 16px; stroke-width: 2.2; }

/* ================= Blocs ================= */
.carte {
  background: var(--papier); border: 1px solid #d9e6f1; border-radius: 16px;
  padding: 20px 22px; box-shadow: var(--elev); overflow-x: auto;
}
.grille { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fiche { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.pile { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* Les chiffres clés : blocs en relief, légèrement inclinés au survol */
.kpi {
  position: relative; overflow: hidden;
  padding: 20px 20px 16px; border-radius: 18px; border: 1px solid #d9e6f1;
  background: linear-gradient(180deg, #fff 0%, #f5f9fc 100%);
  box-shadow: var(--bloc);
  transform: perspective(900px) rotateX(0) translateY(0);
  transition: transform .25s ease, box-shadow .25s ease;
}
.kpi .valeur {
  font-size: 42px; font-weight: 750; line-height: 1; letter-spacing: -.035em; color: var(--nuit);
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 #fff, 0 2px 0 rgba(10, 37, 64, .1);
}
.kpi .libelle { margin-top: 8px; font-size: 14px; font-weight: 650; color: var(--encre); }
.kpi .detail { margin-top: 4px; font-size: 12.5px; color: var(--gris); }
@media (hover: hover) {
  .kpi:hover { transform: perspective(900px) rotateX(8deg) translateY(-4px); box-shadow: var(--bloc-haut); }
}

/* ================= Tableaux ================= */
.enveloppe { background: var(--papier); border: 1px solid #d9e6f1; border-radius: 16px; overflow-x: auto; box-shadow: var(--elev); }
.tableau { width: 100%; border-collapse: collapse; background: var(--papier); }
.tableau th {
  text-align: left; padding: 11px 14px; white-space: nowrap;
  font-size: 12.5px; font-weight: 650; color: var(--gris);
  background: #f4f8fb; border-bottom: 1px solid var(--trait);
}
.tableau td { padding: 13px 14px; border-bottom: 1px solid var(--trait-doux); vertical-align: top; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tr.lien:hover td { background: #f3f9fd; }
.tableau .nom a { font-weight: 650; color: var(--nuit); }
.tableau a.tel { color: var(--gris); font-variant-numeric: tabular-nums; }
.tableau td .bouton + .bouton, .tableau td form + form { margin-left: 6px; }
.tableau td form { display: inline; }
.tableau .echeance { white-space: nowrap; }
.tableau .echeance .badge { display: table; margin-top: 5px; }
.tableau tr.en-retard td:first-child { box-shadow: inset 4px 0 0 #e8a33a; }
.sources td, .sources th { font-size: 14px; }
.vide { padding: 40px 24px; text-align: center; color: var(--gris); }

/* ================= Statuts ================= */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  font-size: 12.5px; font-weight: 650; line-height: 1.4; white-space: nowrap;
  box-shadow: inset 0 -1px 0 rgba(10, 37, 64, .08);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.st-nouveau { background: #e7eef6; color: #34465e; }
.st-appele { background: #dcf1fb; color: #0d6797; }
.st-rappeler { background: #fff0d6; color: var(--ambre); }
.st-rdv { background: #d9f4e7; color: #0f7a52; }
.st-inscrit { background: var(--nuit); color: #fff; }
.st-inscrit::before { background: var(--iua); }
.st-perdu { background: #eceef1; color: #5f6670; }
.st-stop { background: #fde6e6; color: #b42727; }

/* Onglets et périodes : pastilles en relief, l'active est « enfoncée » en bleu nuit */
.onglets, .periodes { display: flex; gap: 8px; flex-wrap: wrap; }
.onglets { margin-bottom: 16px; }
.onglets a, .periodes a {
  padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  background: #fff; color: var(--encre); font-size: 13.5px; font-weight: 550;
  box-shadow: inset 0 0 0 1px #d3e1ed, 0 2px 0 #d3e1ed;
}
.onglets a:hover, .periodes a:hover { text-decoration: none; box-shadow: inset 0 0 0 1px #aecbe2, 0 2px 0 #aecbe2; }
.onglets a.actif, .periodes a.actif { background: var(--nuit); color: #fff; box-shadow: 0 2px 0 #04121f, 0 8px 14px -8px rgba(10, 37, 64, .7); }
.onglets a span { margin-left: 6px; color: var(--gris); font-variant-numeric: tabular-nums; }
.onglets a.actif span { color: #9fd9f1; }

/* ================= Formulaires ================= */
label { display: block; margin: 0 0 5px; font-size: 13.5px; font-weight: 600; color: var(--encre); }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font: inherit; font-size: 15px; color: var(--encre);
  background: #fff; border: 1px solid #c8d8e6; border-radius: 11px; box-shadow: var(--creux);
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23566a80' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--iua); box-shadow: var(--creux), 0 0 0 3px rgba(53, 181, 230, .35); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; padding: 0; box-shadow: none; accent-color: var(--iua-fonce); flex: none; }
.champ { margin-bottom: 14px; }
form .grille { gap: 14px 18px; margin-bottom: 14px; }
.grille > .champ { margin-bottom: 0; }
.ligne { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ligne > * { flex: 1; min-width: 140px; }
.case { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; line-height: 1.4; }
.case input { margin-top: 1px; }
.note-cle { margin-top: 5px; font-size: 12.5px; color: var(--gris); }
.filtres { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filtres select, .filtres input { width: auto; min-width: 160px; }
.filtres input[type="search"] { flex: 1 1 260px; }
.recherche { display: flex; gap: 8px; }
.recherche input { width: 260px; }

/* Boutons : touches en relief qui s'enfoncent au clic */
.bouton {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 16px; border: 0; border-radius: 12px;
  font: inherit; font-size: 14.5px; font-weight: 650; line-height: 1.2; white-space: nowrap;
  color: #fff; cursor: pointer; text-decoration: none;
  background: linear-gradient(180deg, #1d8acb 0%, var(--iua-fonce) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 3px 0 #0a4f7a, 0 10px 18px -8px rgba(15, 111, 168, .7);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
}
.bouton:hover { filter: brightness(1.07); text-decoration: none; }
.bouton:active { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 #0a4f7a, 0 3px 6px -3px rgba(15, 111, 168, .6); }
.bouton .ico { width: 18px; height: 18px; stroke-width: 2; }
.bouton.secondaire {
  color: var(--nuit);
  background: linear-gradient(180deg, #fff 0%, #eef4f9 100%);
  box-shadow: inset 0 0 0 1px #cbdbe9, inset 0 1px 0 #fff, 0 3px 0 #c2d4e4, 0 10px 16px -10px rgba(10, 37, 64, .4);
}
.bouton.secondaire:active { box-shadow: inset 0 0 0 1px #cbdbe9, 0 0 0 #c2d4e4, 0 2px 4px -2px rgba(10, 37, 64, .3); }
.bouton.vert { background: linear-gradient(180deg, #22b37b 0%, var(--vert) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 3px 0 #0b6644, 0 10px 18px -8px rgba(19, 138, 94, .65); }
.bouton.vert:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 #0b6644; }
.bouton.danger { background: linear-gradient(180deg, #db4848 0%, var(--rouge) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 3px 0 #8f1f1f, 0 10px 18px -8px rgba(196, 47, 47, .6); }
.bouton.danger:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 #8f1f1f; }
.bouton.whatsapp { background: linear-gradient(180deg, #2bc565 0%, #1c9f4d 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 3px 0 #126c34, 0 10px 18px -8px rgba(28, 159, 77, .6); }
.bouton.whatsapp:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 #126c34; }
.bouton.petit { min-height: 34px; padding: 6px 12px; border-radius: 10px; font-size: 13px; }
.bouton.lien { min-height: 0; padding: 0; color: var(--lien); font-weight: 500; background: none; box-shadow: none; }
.bouton.lien:hover { text-decoration: underline; filter: none; }
.bouton.lien:active { transform: none; }
.bouton:disabled, .bouton[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.3); }
.bouton:disabled:active { transform: none; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.changer-statut select { width: 200px; }

/* Messages */
.messages { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.erreur, .info { padding: 11px 14px; border-radius: 12px; font-size: 14px; }
.erreur { background: #fdecec; color: #9d2222; box-shadow: inset 4px 0 0 var(--rouge); }
.info { background: #e2f3fb; color: #0c4f7a; box-shadow: inset 4px 0 0 var(--iua); }
.messages .erreur, .messages .info { margin: 0; }
.erreur { margin-bottom: 12px; }

/* ================= Fiche prospect ================= */
.contact-rapide { display: flex; gap: 10px; flex-wrap: wrap; margin: -8px 0 22px; }
.contact-rapide .numero { font-weight: 500; opacity: .85; font-variant-numeric: tabular-nums; }
.infos { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 14px; }
.infos dt { color: var(--gris); }
.infos dd { margin: 0; overflow-wrap: anywhere; }
.appel { background: var(--papier); border: 1px solid #d9e6f1; border-radius: 16px; box-shadow: var(--elev); overflow: hidden; }
.appel + .appel { margin-top: 14px; }
.appel .tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: #f4f8fb; border-bottom: 1px solid var(--trait); }
.appel .corps { padding: 14px 16px; }
.releve { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 12px 0; font-size: 14px; }
.releve div { padding: 8px 10px; border-radius: 10px; background: #f6f9fc; box-shadow: var(--creux); }
.releve div span { display: block; color: var(--gris); font-size: 12px; }
.bulles { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; padding: 4px 2px; }
.bulle { max-width: 82%; padding: 8px 12px; border-radius: 14px; font-size: 14px; }
.bulle.agent { align-self: flex-start; background: #dcf1fb; border-bottom-left-radius: 4px; }
.bulle.user { align-self: flex-end; background: #eef1f5; border-bottom-right-radius: 4px; }
.bulle .qui { display: block; margin-bottom: 1px; font-size: 11px; font-weight: 650; color: var(--gris); }
details > summary { margin-top: 8px; color: var(--lien); font-size: 14px; font-weight: 550; cursor: pointer; }
audio { width: 100%; margin-top: 8px; }
.fil { list-style: none; margin: 0; padding: 0; }
.fil li { padding: 10px 0; border-bottom: 1px solid var(--trait-doux); font-size: 14px; }
.fil li:last-child { border-bottom: 0; }
.fil .quand { color: var(--gris); font-size: 12.5px; }
.zone-danger { border-color: #f2c9c9; }
.zone-danger h2 { color: var(--rouge); }

/* ================= Agenda ================= */
.jour { margin-bottom: 22px; }
.jour h3 { text-transform: capitalize; margin-bottom: 10px; }
.creneau {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  margin-bottom: 10px; padding: 12px 14px;
  background: var(--papier); border: 1px solid #d9e6f1; border-radius: 16px; box-shadow: var(--elev);
}
.creneau .h {
  padding: 9px 0; border-radius: 12px; text-align: center;
  color: #fff; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--nuit-2), var(--nuit));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 3px 0 #04121f, 0 8px 12px -6px rgba(10, 37, 64, .6);
}
.creneau.passe { opacity: .6; }
.creneau form { display: inline; }
.creneau .actions select { width: 130px; }

/* ================= Graphiques du tableau de bord ================= */
.barres {
  display: flex; align-items: flex-end; gap: 7px; height: 170px; padding: 8px 4px 0;
  border-bottom: 2px solid var(--trait);
}
.barres .b { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
/* Colonnes en volume : une face avant claire et une face latérale plus sombre */
.barres .b i {
  width: 100%; min-height: 3px; border-radius: 4px 4px 0 0;
  background: linear-gradient(90deg, #5ac8f0 0, var(--iua) 62%, #1c8cc4 62%, #167cb0 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 -1px 0 rgba(10, 37, 64, .08);
}
.barres .b span { font-size: 11px; color: var(--gris); font-variant-numeric: tabular-nums; }
.barres .b b { font-size: 11px; color: var(--encre); font-weight: 650; }
.entonnoir div { display: grid; grid-template-columns: 140px minmax(0, 1fr) 48px; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 14px; }
.entonnoir .piste { height: 14px; border-radius: 7px; background: #e6eef5; box-shadow: inset 0 2px 3px rgba(10, 37, 64, .14); overflow: hidden; }
.entonnoir .piste i { display: block; height: 100%; border-radius: 7px; background: linear-gradient(180deg, #2c9bd6, var(--iua-fonce)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45); }
.entonnoir div:last-child .piste i { background: linear-gradient(180deg, var(--nuit-2), var(--nuit)); }
.entonnoir b { text-align: right; font-variant-numeric: tabular-nums; }
.pagination { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 14px 2px; font-size: 14px; color: var(--gris); }

/* ================= Connexion, mot de passe, installation ================= */
.connexion {
  min-height: 100vh; display: grid; place-items: center;
  padding: 32px 18px calc(32px + env(safe-area-inset-bottom));
  background: radial-gradient(900px 520px at 50% 0%, rgba(53, 181, 230, .22), transparent 70%), linear-gradient(170deg, var(--nuit-2) 0%, var(--nuit) 55%, #071a30 100%);
}
.connexion .boite {
  width: 100%; max-width: 420px; padding: 30px 28px 26px; border-radius: 24px;
  background: linear-gradient(180deg, #fff 0%, #f6fafd 100%);
  box-shadow: inset 0 1px 0 #fff, 0 1px 0 #c3d6e8, 0 2px 0 #b6cbe0, 0 3px 0 #a9c0d8, 0 4px 0 #9db6d0, 0 5px 0 #91acc8, 0 6px 0 #86a3c1, 0 34px 60px -18px rgba(0, 0, 0, .65);
}
.connexion .sceau { display: flex; justify-content: center; margin: 0 0 16px; }
.connexion .sceau img { display: block; width: 128px; height: auto; filter: drop-shadow(0 3px 0 rgba(13, 106, 163, .18)); }
.connexion h1 { font-size: 23px; text-align: center; margin-bottom: 4px; }
.connexion .sous-titre { color: var(--gris); text-align: center; margin-bottom: 22px; }
.connexion .bouton { width: 100%; margin-top: 4px; min-height: 48px; font-size: 15.5px; }
.connexion .liens { margin-top: 16px; font-size: 14px; text-align: center; }
.connexion .erreur, .connexion .info { margin-bottom: 14px; }
.connexion h3 { margin-top: 20px; }

/* ================= Tablette : menu en colonne d'icônes ================= */
@media (max-width: 1099px) and (min-width: 720px) {
  .app { grid-template-columns: 96px minmax(0, 1fr); }
  .nav { align-items: stretch; gap: 18px; padding: 18px 8px 14px; }
  .marque .titre-app { display: none; }
  .marque .plaque {
    padding: 7px 7px 6px; border-radius: 14px;
    box-shadow: 0 1px 0 #c3d6e8, 0 2px 0 #b6cbe0, 0 3px 0 #a9c0d8, 0 4px 0 #9db6d0, 0 14px 20px -8px rgba(0, 0, 0, .6);
  }
  .marque .plaque img { width: 62px; }
  .menu a { flex-direction: column; gap: 5px; padding: 8px 2px; font-size: 11.5px; text-align: center; }
  .menu a.actif { background: none; box-shadow: none; }
  .menu a.actif::before { left: -8px; }
  .menu .long { display: none; }
  .menu .court { display: block; }
  .bas { flex-direction: column; padding: 12px 0 0; }
  .bas .moi { flex: none; padding: 4px; }
  .bas .qui { display: none; }
  .contenu { padding: 26px 26px 52px; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 959px) and (min-width: 720px) {
  .fiche { grid-template-columns: minmax(0, 1fr); }
}

/* ================= Téléphone : barre du haut + menu en bas, listes en cartes ================= */
@media (max-width: 719px) {
  body { font-size: 15.5px; }
  .app { display: block; }
  .nav {
    position: sticky; top: 0; z-index: 20; height: auto; overflow: visible;
    flex-direction: row; align-items: center; gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    background: linear-gradient(170deg, var(--nuit-2), var(--nuit));
    box-shadow: 0 8px 20px -12px rgba(7, 26, 48, .8);
  }
  .marque { flex: 1; min-width: 0; flex-direction: row; gap: 10px; }
  .marque .plaque {
    flex: none; padding: 4px 6px 3px; border-radius: 11px;
    box-shadow: 0 1px 0 #b6cbe0, 0 2px 0 #9db6d0, 0 8px 12px -6px rgba(0, 0, 0, .6);
  }
  .marque .plaque img { width: 48px; }
  .marque .titre-app { font-size: 15.5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bas { margin: 0; padding: 0; border: 0; gap: 8px; }
  .bas .moi { flex: none; padding: 0; }
  .bas .moi:hover, .bas .moi.actif { background: none; }
  .bas .qui { display: none; }
  .avatar { width: 36px; height: 36px; }
  .sortir { width: 38px; height: 38px; }

  /* Menu principal fixé en bas, à portée de pouce */
  .menu {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    flex-direction: row; gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(10, 37, 64, .97);
    box-shadow: 0 -10px 26px -14px rgba(7, 26, 48, .7), inset 0 1px 0 rgba(255, 255, 255, .08);
  }
  .menu a { flex: 1; min-width: 0; flex-direction: column; gap: 3px; padding: 5px 2px 3px; font-size: 11px; font-weight: 600; text-align: center; border-radius: 12px; }
  .menu a:hover { background: none; }
  .menu a.actif { background: none; box-shadow: none; }
  .menu a.actif::before { display: none; }
  .menu .long { display: none; }
  .menu .court { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ico-boite { width: 48px; height: 32px; border-radius: 16px; background: none; box-shadow: none; }
  .pastille { top: -5px; right: 0; }

  .contenu { padding: 18px 16px calc(var(--barre-bas) + 28px + env(safe-area-inset-bottom)); }
  h1 { font-size: 24px; }
  .entete { margin-bottom: 18px; }
  .entete .actions, .entete > .actions { width: 100%; }
  .entete .actions > .bouton { flex: 1 1 auto; }
  .changer-statut { width: 100%; flex-wrap: nowrap; }
  .changer-statut select { flex: 1; width: auto; min-width: 0; }

  .g2, .g3, .fiche { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .kpi { padding: 16px 14px 13px; border-radius: 16px; }
  .kpi .valeur { font-size: 32px; }
  .kpi .libelle { font-size: 13px; }
  .carte { padding: 16px; border-radius: 14px; }
  .entete .periodes { flex: none; width: calc(100% + 32px); }

  input, select, textarea { font-size: 16px; } /* évite le zoom automatique sur iPhone */
  .bouton { min-height: 46px; }
  .bouton.petit { min-height: 40px; }
  .entete .actions > .bouton { flex: 1 1 140px; white-space: normal; text-align: center; }
  .filtres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .filtres select, .filtres input { width: 100%; min-width: 0; }
  .filtres input[type="search"], .filtres > a { grid-column: 1 / -1; }
  .filtres > a { text-align: center; }
  .filtres select { font-size: 14.5px; padding-left: 10px; padding-right: 30px; background-position: right 10px center; text-overflow: ellipsis; }
  .recherche input { width: 100%; }

  /* Onglets : défilement horizontal plutôt que plusieurs lignes */
  .onglets, .periodes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 2px 16px 8px; }
  .onglets::-webkit-scrollbar, .periodes::-webkit-scrollbar { display: none; }

  /* Fiche prospect : boutons Appeler / WhatsApp toujours visibles en haut */
  .contact-rapide {
    position: sticky; top: calc(62px + env(safe-area-inset-top)); z-index: 10;
    display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px;
    margin: -6px -16px 18px; padding: 10px 16px 12px;
    background: rgba(234, 242, 248, .94);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .contact-rapide .bouton { min-height: 50px; font-size: 15.5px; }
  .contact-rapide .numero { display: none; }
  .infos { grid-template-columns: 104px minmax(0, 1fr); }
  .releve { grid-template-columns: minmax(0, 1fr); }
  .bulle { max-width: 92%; }

  /* Listes en cartes */
  .tableau.empile, .tableau.empile tbody { display: block; }
  .tableau.empile thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tableau.empile tr { position: relative; display: block; padding: 14px 16px; border-bottom: 1px solid var(--trait); }
  .tableau.empile tr:last-child { border-bottom: 0; }
  .carte .tableau.empile tr { padding: 14px 0; }
  .tableau.empile td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 3px 0; border: 0; font-size: 14px; text-align: right; }
  .tableau.empile td::before { content: attr(data-label); flex: none; color: var(--gris); font-size: 13px; text-align: left; }
  .tableau.empile td:not([data-label]) { display: block; text-align: left; }
  .tableau.empile td:not([data-label])::before { content: none; }
  .tableau.empile td.sans-valeur { display: none; }
  .tableau.empile td.nom { margin-bottom: 6px; padding-right: 120px; font-size: 16px; }
  .tableau.empile td.statut { position: absolute; top: 14px; right: 16px; padding: 0; }
  .tableau.empile td.statut::before { content: none; }
  .tableau.empile td.action-ligne { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; margin-top: 10px; }
  .tableau.empile td.action-ligne form + form { margin-left: 0; }
  .tableau.empile td form.actions { flex-wrap: nowrap; gap: 8px; min-width: 0; }
  .tableau.empile td form.actions select { min-width: 0; font-size: 15px; }
  .tableau.empile .echeance { font-weight: 650; color: var(--nuit); margin-bottom: 4px; }
  .tableau.empile .echeance .badge { display: inline-flex; margin: 0 0 0 8px; }
  .tableau.empile tr.en-retard { box-shadow: inset 4px 0 0 #e8a33a; }
  .tableau.empile tr.en-retard td:first-child { box-shadow: none; }
  .tableau.empile tr.lien:hover td { background: none; }
  /* Toute la carte ouvre la fiche ; le numéro reste cliquable pour appeler */
  .cliquable a.etendu::after { content: ""; position: absolute; inset: 0; z-index: 1; }
  .cliquable a.tel { position: relative; z-index: 2; }

  .creneau { grid-template-columns: 64px minmax(0, 1fr); align-items: start; }
  .creneau > .actions { grid-column: 1 / -1; }
  .creneau .actions select { width: auto; flex: 1; }
  .entonnoir div { grid-template-columns: 110px minmax(0, 1fr) 40px; gap: 8px; }
  .barres { gap: 4px; height: 150px; }
  .barres .b b { font-size: 10px; }
  .pagination { flex-direction: column; align-items: stretch; text-align: center; }
  .pagination .actions { justify-content: center; }

  .connexion { align-items: start; padding-top: calc(36px + env(safe-area-inset-top)); }
  .connexion .boite { padding: 26px 20px 22px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .kpi:hover { transform: none; }
  .bouton:active { transform: none; }
}

@media print {
  .nav, .menu, .actions, .contact-rapide, form { display: none !important; }
  .app { display: block; }
  .contenu { padding: 0; }
  .carte, .kpi, .enveloppe { box-shadow: none; }
}
