/* Club Deal Marrakech — la maison de SchoolInvest (css/espace.css), reprise pour le club deal.
   Mêmes jetons, mêmes composants, mêmes classes. Clair seulement, comme la référence (color-scheme: light).
   Aucun style dans les attributs HTML : la politique de sécurité du site (style-src 'self') les refuse. */
:root {
  --fond: #f3f5f8; --carte: #fff; --doux: #f8fafc; --bord: #dde4ee; --bord2: #edf1f6;
  --encre: #172238; --encre2: #586880; --encre3: #66758c;
  --accent: #234cd0; --accent-fond: #eaf0ff;
  --vert: #27765d; --vert-fond: #e7f4ee; --orange: #94651b; --orange-fond: #fff3dc;
  --rouge: #b04350; --rouge-fond: #fbecee; --neutre-fond: #edf0f4;
  --rail: #101e34; --rail-encre: #bfd0e7; --rail-survol: #253b54; --tuile-nuit: #172d50;
  --serie: #4265d6; --serie-pale: #dce5fc;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--encre); max-width: 100%; overflow-x: clip; }
body { font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-variant-numeric: tabular-nums; min-height: 100dvh; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 29px; line-height: 1.18; letter-spacing: -.8px; }
h2 { font-size: 18px; line-height: 1.3; letter-spacing: -.25px; }
h3 { font-size: 15px; line-height: 1.4; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #bb8d25; outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .55; }
code { font-size: 12px; }
.cache, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- connexion : photographie sous voile bleu nuit à gauche, formulaire à droite ---------- */
#gate { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100dvh; background: #fff; color: #172333;
  --fond: #f6f7f9; --carte: #ffffff; --bord: #dfe6ed; --encre: #172333; --encre2: #607184; --encre3: #97a6b6;
  --accent: #1740c9; --accent-fond: #eaf0fd; --vert: #168975; --vert-fond: #e8f2ef; --rouge: #b42318; --rouge-fond: #fdeeec; line-height: 1.65; }
.visuel {
  background:
    linear-gradient(155deg, rgba(17,32,51,.66), rgba(15,76,129,.74)),
    url("../images/motif.svg") center/180px repeat,
    linear-gradient(155deg, #112033, #0f4c81);
  color: #fff;
}
.visuel-interieur { height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 46px 48px; }
.gate-marque { font-weight: 700; font-size: 18px; letter-spacing: .3px; }
.gate-citation { margin: 0 0 18px; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.4vw, 46px); line-height: 1.18; letter-spacing: -.5px; font-weight: 500; max-width: 17ch; }
.gate-pour { margin: 0; font-size: 16px; color: #dce5ef; max-width: 40ch; }
.gate-domaines { font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase; color: #b8c8da; }
.gate-formulaire { display: flex; align-items: center; justify-content: center; padding: 46px 32px; background: #fff; }
.gate-contenu { width: 100%; max-width: 380px; }
.gate-contenu h1 { margin: 0 0 6px; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-size: 34px; font-weight: 500; letter-spacing: -.5px; color: #172333; line-height: 1.65; }
.gate-sous { margin: 0 0 24px; color: #607184; font-size: 15px; }
#gate label { display: block; color: #3c4b5c; font-weight: 600; font-size: 13px; margin: 12px 0 4px; }
#gate input { width: 100%; padding: 11px 12px; border: 1px solid #c9d3df; border-radius: 8px; font-size: 15px; min-height: 0; background: #fff; color: #172333; }
#gate input.code { font-size: 24px; letter-spacing: 8px; text-align: center; font-variant-numeric: tabular-nums; }
.gate-bouton { display: block; width: 100%; margin-top: 20px; padding: 13px; border: 0; border-radius: 8px; background: #101f32; color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer; }
.gate-bouton:hover { background: #1b3150; }
.gate-bouton:disabled { opacity: .6; }
.gate-lien { text-align: center; margin: 16px 0 0; font-size: 14px; }
.gate-lien a, .gate-lien button { color: #1740c9; background: none; border: 0; padding: 0; font-size: 14px; }
.gate-filet { border: 0; border-top: 1px solid #e1e6ec; margin: 26px 0 16px; }
.gate-note { margin: 0; color: #607184; font-size: 13px; line-height: 1.6; }
#gate .message { padding: 12px 15px; border-radius: 9px; margin: 10px 0; font-size: 14px; }
#gate .message.info { color: var(--encre); }
.qr { display: block; width: 200px; height: 200px; margin: 14px auto; background: #fff; border: 1px solid #e1e6ec; border-radius: 8px; padding: 8px; }
.secret-totp { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; background: #f6f7f9; border-radius: 6px; padding: 8px 10px; display: block; }
@media (max-width: 860px) {
  #gate { grid-template-columns: 1fr; }
  .visuel-interieur { padding: 30px 24px 34px; gap: 44px; }
  .gate-citation { font-size: 30px; }
  .gate-domaines { display: none; }
  .gate-formulaire { padding: 28px 22px 44px; align-items: flex-start; }
}

/* ---------- ossature bureau ---------- */
.cadre { display: flex; min-height: 100dvh; }
.rail { width: 220px; flex-shrink: 0; background: var(--rail); color: #fff; padding: 28px 19px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.marque { font-size: 17px; font-weight: 800; letter-spacing: 1px; }
.marque span { color: #82b6ff; }
.rail .liens { display: grid; gap: 7px; margin: 30px 0; }
.rail .liens a { border: 0; text-align: left; background: transparent; color: var(--rail-encre); border-radius: 7px; padding: 12px; font-size: 14px; display: block; }
.rail .liens a:hover { background: var(--rail-survol); }
.rail .liens .actif { background: var(--accent); color: #fff; }
.rail .groupe-titre { color: #8fa5c2; font-size: 10px; letter-spacing: 1.7px; text-transform: uppercase; font-weight: 750; margin: 14px 12px 2px; }
.rail .qui { color: #8fa5c2; margin-top: auto; font-size: 12px; font-weight: 400; }
.rail .qui button { color: var(--rail-encre); display: block; margin-top: 6px; background: none; border: 0; padding: 0; font-size: 12px; }
.colonne { min-width: 0; flex: 1; }
.principal { padding: 26px 30px 36px; max-width: 1800px; margin: auto; }

/* ---------- en-tête ---------- */
.haut-mobile { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 22px; background: #fff;
  border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 4; min-height: 66px; }
.profil-mobile { display: flex; align-items: center; gap: 9px; }
.profil-mobile b { font-size: 13px; }
.profil-mobile small { display: block; color: var(--encre2); font-size: 11px; }
.avatar { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: #e8eef9; color: #3c5f9d;
  border-radius: 10px; font-size: 12px; font-weight: 750; flex-shrink: 0; }
.haut-droite { display: flex; align-items: center; gap: 8px; }
.etiquette { color: #526b8e; background: #edf2fa; border: 1px solid #dce5f2; border-radius: 30px; padding: 4px 9px; font-size: 10px; font-weight: 650; white-space: nowrap; }

/* ---------- application téléphone : une colonne de lecture ---------- */
.app { max-width: 500px; margin: 24px auto 38px; background: var(--fond); box-shadow: 0 12px 45px #132c4c12; border: 1px solid #d7e0ed;
  border-radius: 20px; overflow: clip; min-height: 800px; }
.app .principal { padding: 23px 18px 12px; }
.app .grille.deux, .app .grille.trois { grid-template-columns: 1fr; }
.app .haut-mobile { padding: 14px 17px; }

/* ---------- titres et textes ---------- */
.entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.entete h1 { margin: 0; }
.entete p, .entete .sous { margin-top: 7px; }
.sous, .discret { color: var(--encre2); font-size: 13px; }
.surtitre { font-size: 10px; letter-spacing: 1.7px; text-transform: uppercase; font-weight: 750; color: var(--encre2); margin-bottom: 9px; }
.num, .montant { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- cartes ---------- */
.bloc { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; margin-bottom: 15px; overflow: hidden; }
.bloc > h2 { padding: 18px 19px 0; margin: 0; }
.bloc > h2 small { font-weight: 400; color: var(--encre2); font-size: 12px; margin-left: 6px; letter-spacing: 0; }
.corps { padding: 17px 19px; }
.corps > p + p { margin-top: 10px; }

/* ---------- chiffres clés ---------- */
.dominant { background: var(--tuile-nuit); color: #fff; border-radius: 11px; padding: 23px; margin-bottom: 16px; }
.dominant .surtitre { color: #b4c8e7; }
.dominant b { display: block; font-size: 37px; letter-spacing: -1px; line-height: 1.2; margin: 9px 0; }
.dominant p, .dominant span { color: #c2d1e8; font-size: 13px; display: block; }
.chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 17px; }
.chiffre { border: 1px solid var(--bord); border-radius: 8px; background: #fff; padding: 13px; min-width: 0; }
.chiffre span { display: block; color: var(--encre2); font-size: 11px; }
.chiffre b { display: block; font-size: 24px; letter-spacing: -.5px; margin: 4px 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.chiffre em { display: block; font-style: normal; font-size: 11px; color: var(--encre2); }
.cadre .chiffres { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grille { display: grid; gap: 16px; }
.grille.deux { grid-template-columns: 1fr 1fr; }
.grille.trois { grid-template-columns: repeat(3, 1fr); }

/* ---------- boutons ---------- */
.b { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: #fff; color: #344c70; border: 1px solid #cfd9e7;
  border-radius: 7px; padding: 10px 13px; min-height: 44px; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.b.principal-b { background: var(--accent); color: #fff; border-color: var(--accent); }
.b.danger { color: var(--rouge); border-color: #e9c4ca; }
.b.large { width: 100%; }
.b.petit { font-size: 12px; padding: 7px 10px; min-height: 0; }
.b.fantome { background: transparent; border-color: transparent; color: var(--accent); }
.b:disabled, .b[disabled] { cursor: not-allowed; opacity: .55; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.actions.serre { margin-top: 0; }
.cadre .b { min-height: 34px; padding: 7px 12px; }

/* ---------- états : un mot ET une couleur ---------- */
.p { display: inline-block; padding: 3px 7px; font-size: 11px; font-weight: 650; line-height: 1.5; border-radius: 5px; background: var(--neutre-fond); color: var(--encre2); white-space: nowrap; }
.p.ok { background: var(--vert-fond); color: var(--vert); }
.p.att { background: var(--orange-fond); color: var(--orange); }
.p.ko { background: var(--rouge-fond); color: var(--rouge); }
.p.info { background: var(--accent-fond); color: var(--accent); }

/* ---------- filtres ---------- */
.pastilles { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.pastille { background: #fff; border: 1px solid var(--bord); color: var(--encre2); border-radius: 6px; padding: 9px 12px; min-height: 44px; font-size: 12px;
  cursor: pointer; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.pastille.allumee { background: #eaf0ff; color: #315ac2; border-color: #cbd8f4; }
.cadre .pastille { min-height: 34px; padding: 6px 11px; }

/* ---------- listes et tableaux ---------- */
.liste { list-style: none; padding: 0; margin: 0; }
.liste li { padding: 15px 19px; border-top: 1px solid var(--bord2); }
.l1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.l2 { color: var(--encre2); font-size: 12px; margin-top: 5px; }
.tableau-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--encre2); font-weight: 750; padding: 10px 12px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
table.t td { padding: 10px 12px; border-top: 1px solid var(--bord2); vertical-align: top; }
table.t td.num { text-align: right; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 9px 15px; font-size: 13px; margin: 13px 0; }
.kv dt { color: var(--encre2); }
.kv dd { margin: 0; text-align: right; }

/* ---------- champs ---------- */
label { display: block; font-size: 13px; color: #4b607b; font-weight: 600; margin: 16px 0 6px; }
input, select, textarea { width: 100%; border: 1px solid #c8d4e3; border-radius: 7px; padding: 12px; background: #fff; color: var(--encre); font-size: 16px; min-height: 46px; }
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
input[type=checkbox], input[type=radio] { width: 19px; height: 19px; min-height: 0; flex-shrink: 0; accent-color: var(--accent); padding: 0; }
.case { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 13px; line-height: 1.5; }
.aide-champ { font-size: 12px; color: var(--encre2); margin-top: 6px; }
.cadre input, .cadre select { font-size: 14px; min-height: 40px; padding: 9px 11px; }
input[readonly], textarea[readonly], select:disabled { background: var(--doux); color: var(--encre2); }

/* ---------- l'enregistrement visible ---------- */
.sauvegarde { font-size: 11px; color: var(--vert); display: inline-flex; gap: 5px; align-items: center; min-height: 22px; }
.sauvegarde.ko { color: var(--rouge); } .sauvegarde.att { color: var(--orange); }
.conflit { border: 1px solid #e9c4ca; background: var(--rouge-fond); border-radius: 8px; padding: 12px; margin-top: 8px; font-size: 13px; color: var(--encre); }

/* ---------- messages, vide, chargement ---------- */
.message { padding: 13px; border-radius: 7px; margin: 13px 0; font-size: 13px; background: #edf2f8; color: var(--encre2); }
.message.ko { color: var(--rouge); background: var(--rouge-fond); }
.message.ok { color: var(--vert); background: var(--vert-fond); }
.message.info { background: var(--accent-fond); color: #385581; }
.message.att { background: var(--orange-fond); color: var(--orange); }
.message ul { margin: 6px 0 0 18px; padding: 0; }
.vide { padding: 28px 20px; color: var(--encre2); font-size: 13px; text-align: center; }
.vide b { display: block; color: #284468; font-size: 18px; margin: 9px 0; }
.chargement { padding: 24px 19px; color: var(--encre2); }
.squelette { background: #e7edf5; border-radius: 6px; height: 14px; margin: 12px 0; }
.squelette.large { height: 110px; }
.squelette.court { width: 65%; }
.bandeau-reseau { position: sticky; top: 0; z-index: 60; background: var(--rouge); color: #fff; text-align: center; font-weight: 650; font-size: 13px; padding: 9px 12px; }

/* ---------- panneau latéral ---------- */
.panneau-fond { position: fixed; inset: 0; background: #0c1d3d66; z-index: 40; display: flex; justify-content: flex-end; }
.panneau { background: #fff; width: min(560px, 100vw); max-height: 100dvh; overflow: auto; padding: 24px max(20px, env(safe-area-inset-right)) calc(30px + env(safe-area-inset-bottom)); }
.panneau .fermer { float: right; }
.panneau h2 { margin: 12px 0 18px; }
.panneau p { font-size: 14px; color: #536b87; margin: 10px 0; }
.menu-vues { display: grid; gap: 8px; }

/* ---------- la barre basse et le pied ---------- */
.nav-bas { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-around; background: #fff; border-top: 1px solid var(--bord); padding: 6px 8px calc(7px + env(safe-area-inset-bottom)); }
.nav-bas a, .nav-bas button { background: none; border: 0; color: #72849e; font-size: 11px; min-height: 48px; min-width: 60px; padding: 5px 8px; border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; cursor: pointer; }
.nav-bas .actif { color: #234cd0; background: #edf2ff; font-weight: 650; }
.nav-bas .sym { font-size: 19px; line-height: 1.1; }
.pied { font-size: 12px; text-align: center; color: var(--encre2); padding: 21px 13px 26px; }
.pied-legal { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 4px; margin: 6px 0 2px; }
.pied-legal a, .pied-legal button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 10px; color: var(--accent); background: none; border: 0; font-size: 12px; }
.pied .version { margin-top: 8px; font-size: 12px; color: var(--encre2); }
.lien-discret { font-size: 12px; color: var(--encre2); background: none; border: 0; display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 6px; text-decoration: underline; }
.avertissement-permanent { font-size: 12px; color: var(--encre2); border-top: 1px solid var(--bord); margin-top: 18px; padding-top: 12px; }

@media (max-width: 720px) {
  .app { margin: 0; border: 0; border-radius: 0; box-shadow: none; min-height: 100dvh; }
  .app .principal { padding-left: max(17px, env(safe-area-inset-left)); padding-right: max(17px, env(safe-area-inset-right)); padding-bottom: 24px; }
  h1 { font-size: 27px; }
  .panneau-fond { align-items: flex-end; }
  .panneau { width: 100%; max-height: 91dvh; border-radius: 18px 18px 0 0; padding-top: 16px; }
  .app .nav-bas { position: fixed; left: 0; right: 0; bottom: 0; }
  .app { padding-bottom: 72px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print {
  .rail, .nav-bas, .haut-mobile, .panneau-fond, .actions, .ne-pas-imprimer, .pastilles, .bandeau-reseau { display: none !important; }
  .app { max-width: none; border: 0; box-shadow: none; margin: 0; } .principal { padding: 0; } .bloc { break-inside: avoid; } body { background: #fff; }
}
